Skip to content

Commit 7375907

Browse files
Andreas Mathissawenzel
authored andcommitted
[TPC] Fine-tune and improve the GEM response for the simulation
o improve the logic of the efficiency o set the gain to 2000 o when the efficiency or kappa is changed, the gain remains unaffected
1 parent 1d67b84 commit 7375907

4 files changed

Lines changed: 17 additions & 16 deletions

File tree

Detectors/TPC/base/include/TPCBase/ParameterGEM.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ struct ParameterGEM : public o2::conf::ConfigurableParamHelper<ParameterGEM> {
5454
float AbsoluteGain[4] = {14.f, 8.f, 53.f, 240.f}; ///< Absolute gain
5555
float CollectionEfficiency[4] = {1.f, 0.2f, 0.25f, 1.f}; ///< Collection efficiency
5656
float ExtractionEfficiency[4] = {0.65f, 0.55f, 0.12f, 0.6f}; ///< Extraction efficiency
57-
float TotalGainStack = 1644.f; ///< Total gain of the stack for the EffectiveMode
58-
float KappaStack = 1.2295f; ///< Variable steering the energy resolution of the full stack for the EffectiveMode
59-
float EfficiencyStack = 0.473805f; ///< Variable steering the single electron efficiency of the full stack for the EffectiveMode
57+
float TotalGainStack = 2000.f; ///< Total gain of the stack for the EffectiveMode
58+
float KappaStack = 1.205f; ///< Variable steering the energy resolution of the full stack for the EffectiveMode
59+
float EfficiencyStack = 0.528f; ///< Variable steering the single electron efficiency of the full stack for the EffectiveMode
6060
AmplificationMode AmplMode = AmplificationMode::EffectiveMode; ///< Amplification mode [FullMode / EffectiveMode]
6161

6262
O2ParamDef(ParameterGEM, "TPCGEMParam");

Detectors/TPC/base/test/testTPCParameters.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ BOOST_AUTO_TEST_CASE(ParameterGEM_test1)
229229
BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[1], 8.f, 1e-3);
230230
BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[2], 53.f, 1e-3);
231231
BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[3], 240.f, 1e-3);
232-
BOOST_CHECK_CLOSE(ParameterGEM::Instance().TotalGainStack, 1644.f, 1e-3);
233-
BOOST_CHECK_CLOSE(ParameterGEM::Instance().KappaStack, 1.2295f, 1e-3);
234-
BOOST_CHECK_CLOSE(ParameterGEM::Instance().EfficiencyStack, 0.473805f, 1e-3);
232+
BOOST_CHECK_CLOSE(ParameterGEM::Instance().TotalGainStack, 2000.f, 1e-3);
233+
BOOST_CHECK_CLOSE(ParameterGEM::Instance().KappaStack, 1.205f, 1e-3);
234+
BOOST_CHECK_CLOSE(ParameterGEM::Instance().EfficiencyStack, 0.528f, 1e-3);
235235
BOOST_CHECK(ParameterGEM::Instance().AmplMode == AmplificationMode::EffectiveMode);
236236

237237
BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<int>("TPCGEMParam.Geometry[0]") == 0);
@@ -256,9 +256,9 @@ BOOST_AUTO_TEST_CASE(ParameterGEM_test1)
256256
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[1]"), 8.f, 1e-3);
257257
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[2]"), 53.f, 1e-3);
258258
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[3]"), 240.f, 1e-3);
259-
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.TotalGainStack"), 1644.f, 1e-3);
260-
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.KappaStack"), 1.2295f, 1e-3);
261-
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.EfficiencyStack"), 0.473805f, 1e-3);
259+
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.TotalGainStack"), 2000.f, 1e-3);
260+
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.KappaStack"), 1.205f, 1e-3);
261+
BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.EfficiencyStack"), 0.528f, 1e-3);
262262

263263
// For fixed values
264264
BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[0], 1.f, 1e-3);

Detectors/TPC/simulation/src/GEMAmplification.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ GEMAmplification::GEMAmplification()
7777
const float gainStack = mGEMParam->TotalGainStack;
7878
const float kappaStack = mGEMParam->KappaStack;
7979
const float effStack = mGEMParam->EfficiencyStack;
80-
const float sStack = gainStack / (kappaStack * (1.f - effStack));
80+
// Correct for electron losses occurring when changing kappa and the efficiency
81+
const float sStack = gainStack / (kappaStack * effStack);
8182
polya % kappaStack % sStack % sStack % (kappaStack - 1) % sStack;
8283
std::string name = polya.str();
8384
o2::math_utils::CachingTF1* polyaDistribution = nullptr;
8485
if (!cacheexists) {
85-
polyaDistribution = new o2::math_utils::CachingTF1("polya", name.c_str(), 0, 50000);
86+
polyaDistribution = new o2::math_utils::CachingTF1("polya", name.c_str(), 0, 25.f * gainStack);
8687
polyaDistribution->SetNpx(50000);
8788
} else {
8889
polyaDistribution = (o2::math_utils::CachingTF1*)outfile->Get("polyaStack");
@@ -130,7 +131,7 @@ int GEMAmplification::getEffectiveStackAmplification(int nElectrons)
130131
/// in the stack is handled in an effective manner
131132
int nElectronsGEM = 0;
132133
for (int i = 0; i < nElectrons; ++i) {
133-
if (mRandomFlat.getNextValue() < mGEMParam->EfficiencyStack) {
134+
if (mRandomFlat.getNextValue() > mGEMParam->EfficiencyStack) {
134135
continue;
135136
}
136137
nElectronsGEM += mGainFullStack.getNextValue();

Detectors/TPC/simulation/test/testTPCGEMAmplification.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ BOOST_AUTO_TEST_CASE(GEMamplification_effective_test)
7272

7373
const int nEleIn = 158; /// Number of electrons liberated in Ne-CO2-N2 by an incident Fe-55 photon
7474

75-
for (int i = 0; i < 100000; ++i) {
75+
for (int i = 0; i < 500000; ++i) {
7676
hTest.Fill(gemStack.getEffectiveStackAmplification(nEleIn));
7777
}
7878

7979
hTest.Fit("gaus", "Q0");
8080
float energyResolution = gaus.GetParameter(2) / gaus.GetParameter(1) * 100.f;
8181

8282
/// Check the resulting gain
83-
/// \todo should be more restrictive
84-
BOOST_CHECK_CLOSE(gaus.GetParameter(1) / static_cast<float>(nEleIn), (gemParam.TotalGainStack), 5.f);
83+
BOOST_CHECK_CLOSE(gaus.GetParameter(1) / static_cast<float>(nEleIn), (gemParam.TotalGainStack), 1.f);
8584
/// Check the resulting energy resolution
86-
BOOST_CHECK_CLOSE(energyResolution, 12.4f, 0.5f);
85+
/// we allow for 5% variation which is given by the uncertainty of the experimental determination of the energy resolution (12.1 +/- 0.5) %
86+
BOOST_CHECK_CLOSE(energyResolution, 12.1, 5);
8787
}
8888

8989
/// \brief Test of the getSingleGEMAmplification function

0 commit comments

Comments
 (0)