Project
Loading...
Searching...
No Matches
testTPCParameters.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#define BOOST_TEST_MODULE Test TPC Parameters
17#define BOOST_TEST_MAIN
18#define BOOST_TEST_DYN_LINK
19#include <boost/test/unit_test.hpp>
26#include <boost/property_tree/ptree.hpp>
27
28namespace o2::tpc
29{
30
32
35BOOST_AUTO_TEST_CASE(ParameterDetector_test1)
36{
37 BOOST_CHECK_CLOSE(ParameterDetector::Instance().PadCapacitance, 0.1f, 1E-3);
38 BOOST_CHECK_CLOSE(ParameterDetector::Instance().TPClength, 250.f, 1E-3);
39 BOOST_CHECK_CLOSE(ParameterDetector::Instance().TmaxTriggered, 550.f, 1E-12);
40
41 BOOST_CHECK_CLOSE(ParameterDetector::Instance().PadCapacitance,
42 o2::conf::ConfigurableParam::getValueAs<float>("TPCDetParam.PadCapacitance"), 1E-3);
43 BOOST_CHECK_CLOSE(ParameterDetector::Instance().TPClength,
44 o2::conf::ConfigurableParam::getValueAs<float>("TPCDetParam.TPClength"), 1E-3);
46 ParameterDetector::Instance().TmaxTriggered == o2::conf::ConfigurableParam::getValueAs<TimeBin>("TPCDetParam.TmaxTriggered"));
47}
48
51BOOST_AUTO_TEST_CASE(ParameterDetector_test2)
52{
54 "TPCDetParam.PadCapacitance=2;TPCDetParam.TPClength=3;TPCDetParam.TmaxTriggered=4");
55 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCDetParam.PadCapacitance"), 2.f, 1E-12);
56 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCDetParam.TPClength"), 3.f, 1E-12);
57 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCDetParam.TmaxTriggered"), 4.f, 1E-12);
58 BOOST_CHECK_CLOSE(ParameterDetector::Instance().PadCapacitance, 2.f, 1E-12);
59 BOOST_CHECK_CLOSE(ParameterDetector::Instance().TPClength, 3.f, 1E-12);
60 BOOST_CHECK_CLOSE(ParameterDetector::Instance().TmaxTriggered, 4.f, 1E-12);
61}
62
65BOOST_AUTO_TEST_CASE(ParameterElectronics_test1)
66{
67 BOOST_CHECK(ParameterElectronics::Instance().NShapedPoints == 8);
68 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().PeakingTime, 160e-3, 1e-3);
69 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ChipGain, 20, 1e-3);
70 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ADCdynamicRange, 2200, 1e-3);
71 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ADCsaturation, 1024, 1e-3);
72 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ZbinWidth, NominalTimeBin, 1e-3);
73 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ElectronCharge, 1.602e-19, 1e-3);
75
76 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<int>("TPCEleParam.NShapedPoints") == 8);
77 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.PeakingTime"), 160e-3, 1e-3);
78 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ChipGain"), 20, 1e-3);
79 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ADCdynamicRange"), 2200, 1e-3);
80 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ADCsaturation"), 1024, 1e-3);
81 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ZbinWidth"), NominalTimeBin, 1e-3);
82 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ElectronCharge"), 1.602e-19, 1e-3);
83}
84
87BOOST_AUTO_TEST_CASE(ParameterElectronics_test2)
88{
90 "TPCEleParam.NShapedPoints=1;TPCEleParam.PeakingTime=2;TPCEleParam.ChipGain=3;TPCEleParam.ADCdynamicRange=4;TPCEleParam.ADCsaturation=5;TPCEleParam.ZbinWidth=6;TPCEleParam.ElectronCharge=7;TPCEleParam.DigiMode=0");
91 BOOST_CHECK(ParameterElectronics::Instance().NShapedPoints == 1);
92 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().PeakingTime, 2.f, 1e-12);
93 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ChipGain, 3.f, 1e-12);
94 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ADCdynamicRange, 4.f, 1e-12);
95 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ADCsaturation, 5.f, 1e-12);
96 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ZbinWidth, 6.f, 1e-12);
97 BOOST_CHECK_CLOSE(ParameterElectronics::Instance().ElectronCharge, 7.f, 1e-12);
99 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<int>("TPCEleParam.NShapedPoints") == 1);
100 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.PeakingTime"), 2.f, 1e-12);
101 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ChipGain"), 3.f, 1e-12);
102 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ADCdynamicRange"), 4.f, 1e-12);
103 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ADCsaturation"), 5.f, 1e-12);
104 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ZbinWidth"), 6.f, 1e-12);
105 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCEleParam.ElectronCharge"), 7.f, 1e-12);
106}
107
110BOOST_AUTO_TEST_CASE(ParameterGas_test1)
111{
112 BOOST_CHECK_CLOSE(ParameterGas::Instance().Wion, 37.3e-9, 1e-3);
113 BOOST_CHECK_CLOSE(ParameterGas::Instance().Ipot, 20.77e-9, 1e-3);
114 BOOST_CHECK_CLOSE(ParameterGas::Instance().AttCoeff, 250.f, 1e-3);
115 BOOST_CHECK_CLOSE(ParameterGas::Instance().OxygenCont, 5e-6, 1e-3);
116 BOOST_CHECK_CLOSE(ParameterGas::Instance().DriftV, 2.58f, 1e-3);
117 BOOST_CHECK_CLOSE(ParameterGas::Instance().SigmaOverMu, 0.78f, 1e-3);
118 BOOST_CHECK_CLOSE(ParameterGas::Instance().DiffT, 0.0209f, 1e-3);
119 BOOST_CHECK_CLOSE(ParameterGas::Instance().DiffL, 0.0221f, 1e-3);
120 BOOST_CHECK_CLOSE(ParameterGas::Instance().Nprim, 14.f, 1e-3);
121 BOOST_CHECK_CLOSE(ParameterGas::Instance().ScaleFactorG4, 0.85f, 1e-3);
122 BOOST_CHECK_CLOSE(ParameterGas::Instance().FanoFactorG4, 0.7f, 1e-3);
123 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[0], 0.820172e-1, 1e-3);
124 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[1], 9.94795f, 1e-3);
125 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[2], 8.97292e-05f, 1e-3);
126 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[3], 2.05873f, 1e-3);
127 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[4], 1.65272f, 1e-3);
128
129 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Wion"), 37.3e-9, 1e-3);
130 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Ipot"), 20.77e-9, 1e-3);
131 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.AttCoeff"), 250.f, 1e-3);
132 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.OxygenCont"), 5e-6, 1e-3);
133 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.DriftV"), 2.58f, 1e-3);
134 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.SigmaOverMu"), 0.78f, 1e-3);
135 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.DiffT"), 0.0209f, 1e-3);
136 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.DiffL"), 0.0221f, 1e-3);
137 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Nprim"), 14.f, 1e-3);
138 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.ScaleFactorG4"), 0.85f, 1e-3);
139 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.FanoFactorG4"), 0.7f, 1e-3);
140 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[0]"), 0.820172e-1, 1e-3);
141 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[1]"), 9.94795f, 1e-3);
142 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[2]"), 8.97292e-05f, 1e-3);
143 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[3]"), 2.05873f, 1e-3);
144 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[4]"), 1.65272f, 1e-3);
145}
146
149BOOST_AUTO_TEST_CASE(ParameterGas_test2)
150{
152 "TPCGasParam.Wion=1;TPCGasParam.Ipot=2;TPCGasParam.AttCoeff=3;TPCGasParam.OxygenCont=4;TPCGasParam.DriftV=5;TPCGasParam.SigmaOverMu=6;"
153 "TPCGasParam.DiffT=7;TPCGasParam.DiffL=8;"
154 "TPCGasParam.Nprim=9;TPCGasParam.ScaleFactorG4=10;TPCGasParam.FanoFactorG4=11;TPCGasParam.BetheBlochParam[0]=12;TPCGasParam.BetheBlochParam[1]=13;TPCGasParam.BetheBlochParam[2]=14;"
155 "TPCGasParam.BetheBlochParam[3]=15;TPCGasParam.BetheBlochParam[4]=16");
156
157 BOOST_CHECK_CLOSE(ParameterGas::Instance().Wion, 1.f, 1e-12);
158 BOOST_CHECK_CLOSE(ParameterGas::Instance().Ipot, 2.f, 1e-12);
159 BOOST_CHECK_CLOSE(ParameterGas::Instance().AttCoeff, 3.f, 1e-12);
160 BOOST_CHECK_CLOSE(ParameterGas::Instance().OxygenCont, 4.f, 1e-12);
161 BOOST_CHECK_CLOSE(ParameterGas::Instance().DriftV, 5.f, 1e-12);
162 BOOST_CHECK_CLOSE(ParameterGas::Instance().SigmaOverMu, 6.f, 1e-12);
163 BOOST_CHECK_CLOSE(ParameterGas::Instance().DiffT, 7.f, 1e-12);
164 BOOST_CHECK_CLOSE(ParameterGas::Instance().DiffL, 8.f, 1e-12);
165 BOOST_CHECK_CLOSE(ParameterGas::Instance().Nprim, 9.f, 1e-12);
166 BOOST_CHECK_CLOSE(ParameterGas::Instance().ScaleFactorG4, 10.f, 1e-12);
167 BOOST_CHECK_CLOSE(ParameterGas::Instance().FanoFactorG4, 11.f, 1e-3);
168 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[0], 12.f, 1e-12);
169 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[1], 13.f, 1e-12);
170 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[2], 14.f, 1e-12);
171 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[3], 15.f, 1e-12);
172 BOOST_CHECK_CLOSE(ParameterGas::Instance().BetheBlochParam[4], 16.f, 1e-12);
173 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Wion"), 1.f, 1e-12);
174 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Ipot"), 2.f, 1e-12);
175 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.AttCoeff"), 3.f, 1e-12);
176 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.OxygenCont"), 4.f, 1e-12);
177 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.DriftV"), 5.f, 1e-12);
178 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.SigmaOverMu"), 6.f, 1e-12);
179 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.DiffT"), 7.f, 1e-12);
180 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.DiffL"), 8.f, 1e-12);
181 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Nprim"), 9.f, 1e-12);
182 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.ScaleFactorG4"), 10.f, 1e-12);
183 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.FanoFactorG4"), 11.f, 1e-3);
184 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[0]"), 12.f, 1e-12);
185 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[1]"), 13.f, 1e-12);
186 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[2]"), 14.f, 1e-12);
187 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[3]"), 15.f, 1e-12);
188 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.BetheBlochParam[4]"), 16.f, 1e-12);
189}
190
193BOOST_AUTO_TEST_CASE(setValues_test1)
194{
195 BOOST_CHECK_CLOSE(ParameterGas::Instance().Wion, o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Wion"), 1e-3);
196 o2::conf::ConfigurableParam::setValue<float>("TPCGasParam", "Wion", 3.0);
197 BOOST_CHECK_CLOSE(ParameterGas::Instance().Wion, 3.0, 1e-3);
198 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Wion"), 3.0, 1e-3);
199 o2::conf::ConfigurableParam::setValue("TPCGasParam.Wion", "5.0");
200 BOOST_CHECK_CLOSE(ParameterGas::Instance().Wion, 5.0, 1e-3);
201 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGasParam.Wion"), 5.0, 1e-3);
202}
203
207BOOST_AUTO_TEST_CASE(ParameterGEM_test1)
208{
209 BOOST_CHECK(ParameterGEM::Instance().Geometry[0] == 0);
210 BOOST_CHECK(ParameterGEM::Instance().Geometry[1] == 2);
211 BOOST_CHECK(ParameterGEM::Instance().Geometry[2] == 2);
212 BOOST_CHECK(ParameterGEM::Instance().Geometry[3] == 0);
213 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[0], 4.f, 1e-3);
214 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[1], 0.2f, 1e-3);
215 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[2], 0.2f, 1e-3);
216 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[3], 0.2f, 1e-3);
217 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[4], 0.2f, 1e-3);
218 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[0], 270.f, 1e-3);
219 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[1], 250.f, 1e-3);
220 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[2], 270.f, 1e-3);
221 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[3], 340.f, 1e-3);
222 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[0], 0.4f, 1e-3);
223 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[1], 4.f, 1e-3);
224 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[2], 2.f, 1e-3);
225 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[3], 0.1f, 1e-3);
226 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[4], 4.f, 1e-3);
227 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[0], 14.f, 1e-3);
228 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[1], 8.f, 1e-3);
229 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[2], 53.f, 1e-3);
230 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[3], 240.f, 1e-3);
231 BOOST_CHECK_CLOSE(ParameterGEM::Instance().TotalGainStack, 2000.f, 1e-3);
232 BOOST_CHECK_CLOSE(ParameterGEM::Instance().KappaStack, 1.205f, 1e-3);
233 BOOST_CHECK_CLOSE(ParameterGEM::Instance().EfficiencyStack, 0.528f, 1e-3);
235
236 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<int>("TPCGEMParam.Geometry[0]") == 0);
237 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<int>("TPCGEMParam.Geometry[1]") == 2);
238 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<int>("TPCGEMParam.Geometry[2]") == 2);
239 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<int>("TPCGEMParam.Geometry[3]") == 0);
240 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[0]"), 4.f, 1e-3);
241 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[1]"), 0.2f, 1e-3);
242 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[2]"), 0.2f, 1e-3);
243 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[3]"), 0.2f, 1e-3);
244 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[4]"), 0.2f, 1e-3);
245 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[0]"), 270.f, 1e-3);
246 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[1]"), 250.f, 1e-3);
247 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[2]"), 270.f, 1e-3);
248 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[3]"), 340.f, 1e-3);
249 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[0]"), 0.4f, 1e-3);
250 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[1]"), 4.f, 1e-3);
251 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[2]"), 2.f, 1e-3);
252 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[3]"), 0.1f, 1e-3);
253 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[4]"), 4.f, 1e-3);
254 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[0]"), 14.f, 1e-3);
255 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[1]"), 8.f, 1e-3);
256 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[2]"), 53.f, 1e-3);
257 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[3]"), 240.f, 1e-3);
258 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.TotalGainStack"), 2000.f, 1e-3);
259 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.KappaStack"), 1.205f, 1e-3);
260 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.EfficiencyStack"), 0.528f, 1e-3);
261
262 // For fixed values
263 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[0], 1.f, 1e-3);
264 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[1], 0.2f, 1e-3);
265 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[2], 0.25f, 1e-3);
266 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[3], 1.f, 1e-3);
267 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[0], 0.65f, 1e-3);
268 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[1], 0.55f, 1e-3);
269 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[2], 0.12f, 1e-3);
270 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[3], 0.6f, 1e-3);
271 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[0]"), 1.f, 1e-3);
272 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[1]"), 0.2f, 1e-3);
273 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[2]"), 0.25f, 1e-3);
274 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[3]"), 1.f, 1e-3);
275 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[0]"), 0.65f, 1e-3);
276 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[1]"), 0.55f, 1e-3);
277 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[2]"), 0.12f, 1e-3);
278 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[3]"), 0.6f, 1e-3);
279
280 for (int i = 0; i < 4; ++i) {
281 BOOST_CHECK_CLOSE(ParameterGEM::Instance().getEffectiveGain(i),
282 ParameterGEM::Instance().AbsoluteGain[i] * ParameterGEM::Instance().CollectionEfficiency[i] * ParameterGEM::Instance().ExtractionEfficiency[i], 1e-3);
283 }
284}
285
288BOOST_AUTO_TEST_CASE(ParameterGEM_test2)
289{
290
292 "TPCGEMParam.Geometry[0]=1;TPCGEMParam.Geometry[1]=2;TPCGEMParam.Geometry[2]=3;TPCGEMParam.Geometry[3]=4;"
293 "TPCGEMParam.Distance[0]=5;TPCGEMParam.Distance[1]=6;TPCGEMParam.Distance[2]=7;TPCGEMParam.Distance[3]=8;TPCGEMParam.Distance[4]=9;"
294 "TPCGEMParam.Potential[0]=10;TPCGEMParam.Potential[1]=11;TPCGEMParam.Potential[2]=12;TPCGEMParam.Potential[3]=13;"
295 "TPCGEMParam.ElectricField[0]=14;TPCGEMParam.ElectricField[1]=15;TPCGEMParam.ElectricField[2]=16;TPCGEMParam.ElectricField[3]=17;TPCGEMParam.ElectricField[4]=18;"
296 "TPCGEMParam.AbsoluteGain[0]=19;TPCGEMParam.AbsoluteGain[1]=20;TPCGEMParam.AbsoluteGain[2]=21;TPCGEMParam.AbsoluteGain[3]=22;"
297 "TPCGEMParam.CollectionEfficiency[0]=23;TPCGEMParam.CollectionEfficiency[1]=24;TPCGEMParam.CollectionEfficiency[2]=25;TPCGEMParam.CollectionEfficiency[3]=26;"
298 "TPCGEMParam.ExtractionEfficiency[0]=27;TPCGEMParam.ExtractionEfficiency[1]=28;TPCGEMParam.ExtractionEfficiency[2]=29;TPCGEMParam.ExtractionEfficiency[3]=30;"
299 "TPCGEMParam.TotalGainStack=31;TPCGEMParam.KappaStack=32;TPCGEMParam.EfficiencyStack=33;TPCGEMParam.AmplMode=0;"
300 "");
301
302 BOOST_CHECK(ParameterGEM::Instance().Geometry[0] == 1);
303 BOOST_CHECK(ParameterGEM::Instance().Geometry[1] == 2);
304 BOOST_CHECK(ParameterGEM::Instance().Geometry[2] == 3);
305 BOOST_CHECK(ParameterGEM::Instance().Geometry[3] == 4);
306 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[0], 5, 1e-12);
307 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[1], 6, 1e-12);
308 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[2], 7, 1e-12);
309 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[3], 8, 1e-12);
310 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Distance[4], 9, 1e-12);
311 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[0], 10, 1e-12);
312 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[1], 11, 1e-12);
313 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[2], 12, 1e-12);
314 BOOST_CHECK_CLOSE(ParameterGEM::Instance().Potential[3], 13, 1e-12);
315 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[0], 14, 1e-12);
316 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[1], 15, 1e-12);
317 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[2], 16, 1e-12);
318 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[3], 17, 1e-12);
319 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ElectricField[4], 18, 1e-12);
320 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[0], 19, 1e-12);
321 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[1], 20, 1e-12);
322 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[2], 21, 1e-12);
323 BOOST_CHECK_CLOSE(ParameterGEM::Instance().AbsoluteGain[3], 22, 1e-12);
324 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[0], 23, 1e-12);
325 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[1], 24, 1e-12);
326 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[2], 25, 1e-12);
327 BOOST_CHECK_CLOSE(ParameterGEM::Instance().CollectionEfficiency[3], 26, 1e-12);
328 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[0], 27, 1e-12);
329 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[1], 28, 1e-12);
330 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[2], 29, 1e-12);
331 BOOST_CHECK_CLOSE(ParameterGEM::Instance().ExtractionEfficiency[3], 30, 1e-12);
332 BOOST_CHECK_CLOSE(ParameterGEM::Instance().TotalGainStack, 31, 1e-12);
333 BOOST_CHECK_CLOSE(ParameterGEM::Instance().KappaStack, 32, 1e-12);
334 BOOST_CHECK_CLOSE(ParameterGEM::Instance().EfficiencyStack, 33, 1e-3);
336 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Geometry[0]") == 1);
337 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Geometry[1]") == 2);
338 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Geometry[2]") == 3);
339 BOOST_CHECK(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Geometry[3]") == 4);
340 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[0]"), 5, 1e-12);
341 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[1]"), 6, 1e-12);
342 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[2]"), 7, 1e-12);
343 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[3]"), 8, 1e-12);
344 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Distance[4]"), 9, 1e-12);
345 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[0]"), 10, 1e-12);
346 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[1]"), 11, 1e-12);
347 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[2]"), 12, 1e-12);
348 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.Potential[3]"), 13, 1e-12);
349 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[0]"), 14, 1e-12);
350 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[1]"), 15, 1e-12);
351 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[2]"), 16, 1e-12);
352 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[3]"), 17, 1e-12);
353 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ElectricField[4]"), 18, 1e-12);
354 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[0]"), 19, 1e-12);
355 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[1]"), 20, 1e-12);
356 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[2]"), 21, 1e-12);
357 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.AbsoluteGain[3]"), 22, 1e-12);
358 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[0]"), 23, 1e-12);
359 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[1]"), 24, 1e-12);
360 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[2]"), 25, 1e-12);
361 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.CollectionEfficiency[3]"), 26, 1e-12);
362 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[0]"), 27, 1e-12);
363 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[1]"), 28, 1e-12);
364 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[2]"), 29, 1e-12);
365 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.ExtractionEfficiency[3]"), 30, 1e-12);
366 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.TotalGainStack"), 31, 1e-12);
367 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.KappaStack"), 32, 1e-12);
368 BOOST_CHECK_CLOSE(o2::conf::ConfigurableParam::getValueAs<float>("TPCGEMParam.EfficiencyStack"), 33, 1e-3);
369}
370} // namespace o2
int32_t i
Definition of the parameter class for the detector.
Definition of the parameter class for the detector electronics.
Definition of the parameter class for the GEM stack.
Definition of the parameter class for the detector gas.
static void setValue(std::string const &mainkey, std::string const &subkey, T x)
static void updateFromString(std::string const &)
constexpr double LHCBunchSpacingNS
Global TPC definitions and constants.
Definition SimTraits.h:167
BOOST_AUTO_TEST_CASE(ClusterHardware_test1)
@ EffectiveMode
Effective amplification mode using one polya distribution only.
@ FullMode
Full 4-GEM simulation of all efficiencies etc.
@ Auto
Automatically decide based on DCS settings in CCDB.
@ FullMode
Apply noise, pedestal and saturation.
constexpr float NominalTimeBin
BOOST_CHECK(tree)