16#define BOOST_TEST_MODULE Test TPC GEMAmplification
17#define BOOST_TEST_MAIN
18#define BOOST_TEST_DYN_LINK
19#include <boost/test/unit_test.hpp>
42 TH1D hTest(
"hTest",
"", 10000, 0, 1000000);
43 TF1 gaus(
"gaus",
"gaus");
45 const int nEleIn = 158;
47 for (
int i = 0;
i < 100000; ++
i) {
51 hTest.Fit(
"gaus",
"Q0");
52 float energyResolution = gaus.GetParameter(2) / gaus.GetParameter(1) * 100.f;
56 BOOST_CHECK_CLOSE(gaus.GetParameter(1) /
static_cast<float>(nEleIn), (gemParam.getEffectiveGain(0) * gemParam.getEffectiveGain(1) * gemParam.getEffectiveGain(2) * gemParam.getEffectiveGain(3)), 20.f);
59 BOOST_CHECK_CLOSE(energyResolution, 12.1, 5);
70 TH1D hTest(
"hTest",
"", 100000, 0, 1000000);
71 TF1 gaus(
"gaus",
"gaus");
73 const int nEleIn = 158;
75 for (
int i = 0;
i < 500000; ++
i) {
79 hTest.Fit(
"gaus",
"Q0");
80 float energyResolution = gaus.GetParameter(2) / gaus.GetParameter(1) * 100.f;
83 BOOST_CHECK_CLOSE(gaus.GetParameter(1) /
static_cast<float>(nEleIn), (gemParam.TotalGainStack), 1.f);
86 BOOST_CHECK_CLOSE(energyResolution, 12.1, 5);
97 TH1D hTest(
"hTest",
"", 10000, 0, 10000);
98 TF1 gaus(
"gaus",
"gaus");
100 for (
int i = 0;
i < 100000; ++
i) {
104 hTest.Fit(
"gaus",
"Q0");
107 const float multiplication = gemParam.getEffectiveGain(0);
108 BOOST_CHECK_CLOSE(gaus.GetParameter(1), multiplication * 1000.f, 0.1);
118 cdb.setUseDefaults();
122 TH1D hTest(
"hTest",
"", 10000, 0, 10000);
123 TH1D hTest2(
"hTest2",
"", 10000, 0, 10000);
124 TF1 gaus(
"gaus",
"gaus");
126 for (
int i = 0;
i < 100000; ++
i) {
131 hTest.Fit(
"gaus",
"Q0");
137 BOOST_CHECK_CLOSE(gaus.GetParameter(1), gemParam.AbsoluteGain[1] * 1000.f, 0.1);
139 BOOST_CHECK_CLOSE(gaus.GetParameter(2), std::sqrt(1000.f) * gasParam.SigmaOverMu * gemParam.AbsoluteGain[1], 2.5);
141 BOOST_CHECK_CLOSE(hTest2.GetMean(), gemParam.AbsoluteGain[2] * 100.f, 5);
151 cdb.setUseDefaults();
153 TH1D hTest(
"hTest",
"", 100, 0, 100);
154 TH1D hTest2(
"hTest2",
"", 10, 0, 10);
155 TF1 gaus(
"gaus",
"gaus");
157 for (
int i = 0;
i < 100000; ++
i) {
162 hTest.Fit(
"gaus",
"Q0");
170 BOOST_CHECK_CLOSE(gaus.GetParameter(1), 60, 1.5);
172 BOOST_CHECK_CLOSE(gaus.GetParameter(2), std::sqrt(100.f * 0.6 * (1 - 0.6)), 1.5);
174 BOOST_CHECK_CLOSE(hTest2.GetMean(), 2, 0.5);
Simple interface to the CDB manager.
Definition of the GEM amplification.
Definition of the parameter class for the GEM stack.
Definition of the parameter class for the detector gas.
static const ParameterGEM & Instance()
static CDBInterface & instance()
int getElectronLosses(int nElectrons, float probability)
int getEffectiveStackAmplification(int nElectrons=1)
int getStackAmplification(int nElectrons=1)
int getSingleGEMAmplification(int nElectrons, int GEM)
int getGEMMultiplication(int nElectrons, int GEM)
static GEMAmplification & instance()
Default constructor.
BOOST_AUTO_TEST_CASE(ClusterHardware_test1)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...