Skip to content
Snippets Groups Projects
Commit fb0db1ce authored by notarann's avatar notarann
Browse files

configurable code for the change of CB parameters

parent 4c569cc2
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,12 @@ def CaloWaveformDigiCfg(flags, name="CaloWaveformDigiAlg", **kwargs):
digiAlg = CompFactory.CaloWaveformDigiAlg(name, **kwargs)
kwargs.setdefault("WaveformDigitisationTool", tool)
digiAlg.CB_alpha_C = -0.9
digiAlg.CB_n_C = 4
digiAlg.CB_mean_C = 10
digiAlg.CB_sigma_C = 900
acc.addEventAlgo(digiAlg)
......
......@@ -28,7 +28,15 @@ CaloWaveformDigiAlg::initialize() {
// Will eventually depend on the type of detector
// TODO: Vary time at which centre it?
// TODO: Change params compared to scint
m_kernel = new TF1("PDF", " ROOT::Math::crystalball_pdf(x, -0.25, 10, 4, 900)", 0, 1200);
// m_kernel = new TF1("PDF", " ROOT::Math::crystalball_pdf(x, -0.9, 10, 4, 900)", 0, 1200);
m_kernel = new TF1("PDF", "ROOT::Math::crystalball_pdf(x, [0],[1],[2],[3])", 0, 1200);
//m_kernel->SetParameters(-0.25,10,4,900);
m_kernel->SetParameter(0, m_CB_alpha_C);
m_kernel->SetParameter(1, m_CB_n_C);
m_kernel->SetParameter(2, m_CB_sigma_C);
m_kernel->SetParameter(3, m_CB_mean_C);
return StatusCode::SUCCESS;
}
......
......@@ -48,6 +48,14 @@ class CaloWaveformDigiAlg : public AthReentrantAlgorithm {
CaloWaveformDigiAlg &operator=(const CaloWaveformDigiAlg&) = delete;
//@}
Gaudi::Property<double> m_CB_alpha_C {this, "CB_alpha_C", 0, "Alpha of the crystal ball function"};
Gaudi::Property<double> m_CB_n_C {this, "CB_n_C", 0, "n of the crystal ball function"};
Gaudi::Property<double> m_CB_mean_C {this, "CB_mean_C", 0, "Mean of the crystal ball function"};
Gaudi::Property<double> m_CB_sigma_C {this, "CB_sigma_C", 0, "Sigma of the crystal ball function"};
/// Kernel PDF
TF1* m_kernel;
......
......@@ -29,7 +29,13 @@ def ScintWaveformDigiCfg(flags, name="ScintWaveformDigiAlg", source="", **kwargs
kwargs.setdefault("ScintHitContainerKey", source+"Hits")
kwargs.setdefault("WaveformContainerKey", source+"Waveforms")
# digiAlg = CompFactory.ScintWaveformDigiAlg(name,CB_alpha= -0.32275, CB_n = 65, CB_sigma=5.372, CB_mean=846.55, **kwargs)
digiAlg = CompFactory.ScintWaveformDigiAlg(name, **kwargs)
digiAlg.CB_alpha = -0.32275
digiAlg.CB_n = 65
digiAlg.CB_mean = 846.55
digiAlg.CB_sigma = 5.372
kwargs.setdefault("WaveformDigitisationTool", tool)
acc.addEventAlgo(digiAlg)
......
#include "ScintWaveformDigiAlg.h"
#include "Identifier/Identifier.h"
#include <vector>
#include <map>
#include "Math/PdfFuncMathCore.h"
ScintWaveformDigiAlg::ScintWaveformDigiAlg(const std::string& name,
ISvcLocator* pSvcLocator)
......@@ -28,7 +30,31 @@ ScintWaveformDigiAlg::initialize() {
// Will eventually depend on the type of detector
// TODO: Vary time at which centre it?
// TODO: Better parameters
m_kernel = new TF1("PDF", " ROOT::Math::crystalball_pdf(x, -0.25, 10, 4, 900)", 0, 1200);
//TString CBB= "";
// CBB+="x";
//CBB+=CB_alpha;
//CBB+=CB_n;
//CBB+=CB_mean;
//CBB+=CB_sigma;
//TString CBB_n= "";
//CBB_n+=CB_n;
//TString CBB_mean= "";
//CBB_mean+=CB_mean;
//TString CBB_sigma= "";
// CBB_sigma+=CB_sigma;
m_kernel = new TF1("PDF", "ROOT::Math::crystalball_pdf(x, [0],[1],[2],[3])", 0, 1200);
//m_kernel->SetParameters(-0.25,10,4,900);
m_kernel->SetParameter(0, m_CB_alpha);
m_kernel->SetParameter(1, m_CB_n);
m_kernel->SetParameter(2, m_CB_sigma);
m_kernel->SetParameter(3, m_CB_mean);
return StatusCode::SUCCESS;
}
......
......@@ -21,7 +21,8 @@
// ROOT
#include "TF1.h"
#include "Math/Math.h"
#include "Math/PdfFuncMathCore.h"
// STL
#include <string>
......@@ -39,6 +40,12 @@ class ScintWaveformDigiAlg : public AthReentrantAlgorithm {
virtual StatusCode finalize() override;
//@}
// Gaudi::Property<float> CB_alpha {this, "CB_alpha_", 0, "Alpha of the crystal ball function"};
// Gaudi::Property<float> CB_n {this, "CB_n_", 0, "n of the crystal ball function"};
// Gaudi::Property<float> CB_mean {this, "CB_mean_", 0, "Mean of the crystal ball function"};
// Gaudi::Property<float> CB_sigma {this, "CB_sigma_", 0, "Sigma of the crystal ball function"};
private:
/** @name Disallow default instantiation, copy, assignment */
......@@ -48,6 +55,11 @@ class ScintWaveformDigiAlg : public AthReentrantAlgorithm {
ScintWaveformDigiAlg &operator=(const ScintWaveformDigiAlg&) = delete;
//@}
Gaudi::Property<double> m_CB_alpha {this, "CB_alpha", 0, "Alpha of the crystal ball function"};
Gaudi::Property<double> m_CB_n {this, "CB_n", 0, "n of the crystal ball function"};
Gaudi::Property<double> m_CB_mean {this, "CB_mean", 0, "Mean of the crystal ball function"};
Gaudi::Property<double> m_CB_sigma {this, "CB_sigma", 0, "Sigma of the crystal ball function"};
/// Kernel PDF
TF1* m_kernel;
......
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!-- Edited By POOL -->
<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory">
<POOLFILECATALOG>
<File ID="422D1B59-C166-9A4F-B6A0-EC7C6D397188">
<physical>
<pfn filetype="ROOT_All" name="/eos/project-f/faser-commissioning/Simulation/Test/TB.Elec.200GeV.SIM.root"/>
</physical>
<logical/>
</File>
<File ID="81C968F6-07F0-9442-9F9F-2EDE7208A89F">
<physical>
<pfn filetype="ROOT_All" name="output.xAOD.root"/>
</physical>
<logical/>
</File>
</POOLFILECATALOG>
......@@ -30,7 +30,7 @@ if __name__ == "__main__":
ConfigFlags.GeoModel.Align.Dynamic = False
ConfigFlags.Input.Files = [
"/bundle/data/FASER/LC_output/BatchOutput/TestBeam/ScanPoint8/Elec100GeV.s8.p8.r5x13.8y22.7.split1.TB.SIM.root"
"/eos/project-f/faser-commissioning/Simulation/Test/TB.Elec.200GeV.SIM.root"
]
if doRDO:
......
done processing event #99, run #12345 100 events read so far <<<===
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment