ATLAS Offline Software
Loading...
Searching...
No Matches
TRTDigSettings.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// TRTDigSettings.cxx //
8// //
9// Class containing parameters and settings mainly used by TRT //
10// digitization. //
11// //
12// Author: Thomas Kittelmann <kittel@nbi.dk> //
13// First version: April 2005. Rewritten November 2005. //
14// //
15// - Settings can be changed via: //
16// share/postInclude.OverrideTRTparameters.py //
17// //
19#include "TRTDigSettings.h"
20
22
23#include "GaudiKernel/Algorithm.h" //For adding properties to an algorithm
24#include "GaudiKernel/AlgTool.h" //For adding properties to an algtool
25
26#include "CLHEP/Units/SystemOfUnits.h"
27#include "CLHEP/Units/PhysicalConstants.h" //For speed of light
28
29#include <iostream>
30#include <limits>
31
32// RDBAccessSvc (Interface to the DD database) has been removed since
33// TRT_Digitization-01-00-11 because the fetched values are correctly
34// hard-coded already. See TRT_Digitization-01-00-10 for an example of
35// how that works.
36
37//_________________________________________________________________________________________________________
45
46//_________________________________________________________________________________________________________
48
49 //1) Fill defaults based on digversion
50 fillDefaults(detmgr);
51
52 //2) Process overrides.
54
55}
56
57//_________________________________________________________________________________________________________
59
60 //The ranges of allowed values are pretty wide. If parameters are outside we will assume something is wrong.
61
62 //doubles:
63 defineNewVariable("ionisationPotential", &m_ionisationPotential, "Ionisation potential", "eV",CLHEP::eV,1.0,50.0);
64 defineNewVariable("ionisationPotentialArgon", &m_ionisationPotentialArgon, "Ionisation potential Argon", "eV",CLHEP::eV,1.0,50.0);
65 defineNewVariable("ionisationPotentialKrypton",&m_ionisationPotentialKrypton,"Ionisation potential Krypton","eV",CLHEP::eV,1.0,50.0);
66 defineNewVariable("smearingFactor", &m_smearingFactor, "Cluster energy smearing factor","", 1,0.1,1.0);
67 defineNewVariable("smearingFactorArgon", &m_smearingFactorArgon, "Cluster energy smearing factor Argon","", 1,0.1,1.0);
68 defineNewVariable("smearingFactorKrypton", &m_smearingFactorKrypton, "Cluster energy smearing factor Krypton","",1,0.1,1.0);
69 defineNewVariable("timeInterval", &m_timeInterval, "Time interval covered by each digit","ns",CLHEP::ns,1,200);
70 defineNewVariable("minDiscriminatorWidth", &m_minDiscriminatorWidth, "Minimum discriminator time over threshold","ns",CLHEP::ns,0.5,20.0);
71 defineNewVariable("discriminatorSettlingTime", &m_discriminatorSettlingTime, "Discriminator settling time", "ns",CLHEP::ns,0.5,20.0);
72 defineNewVariable("discriminatorDeadTime", &m_discriminatorDeadTime, "Discriminator dead time", "ns",CLHEP::ns,0.5,20.0);
73 defineNewVariable("TrtRangeCutProperty", &m_trtRangeCutProperty, "Electrons range cut in TRT xenon simulation","mm",CLHEP::mm,0.05,30.00);
74
75 // LT Bar
76 defineNewVariable("lowThresholdBar", &m_lowThresholdBar, "Low Threshold Barrel", "eV",CLHEP::eV,50.0,500.0);
77 defineNewVariable("lowThresholdBarArgon", &m_lowThresholdBarArgon, "Low Threshold Barrel Argon", "eV",CLHEP::eV,50.0,500.0);
78 defineNewVariable("lowThresholdBarKrypton",&m_lowThresholdBarKrypton,"Low Threshold Barrel Krypton", "eV",CLHEP::eV,50.0,500.0);
79 // LT EC
80 defineNewVariable("lowThresholdEC", &m_lowThresholdEC, "Low Threshold end-cap", "eV",CLHEP::eV,50.0,500.0);
81 defineNewVariable("lowThresholdECArgon", &m_lowThresholdECArgon, "Low Threshold end-cap Argon", "eV",CLHEP::eV,50.0,500.0);
82 defineNewVariable("lowThresholdECKrypton", &m_lowThresholdECKrypton, "Low Threshold end-cap Krypton","eV",CLHEP::eV,50.0,500.0);
83 // HT Short
84 defineNewVariable("highThresholdBarShort", &m_highThresholdBarShort, "High Threshold short barrel straws", "keV",CLHEP::keV,0.3,10.0);
85 defineNewVariable("highThresholdBarShortArgon", &m_highThresholdBarShortArgon, "High Threshold short barrel straws Argon", "keV",CLHEP::keV,0.3,10.0);
86 defineNewVariable("highThresholdBarShortKrypton",&m_highThresholdBarShortKrypton,"High Threshold short barrel straws Krypton","keV",CLHEP::keV,0.3,10.0);
87 // HT Long
88 defineNewVariable("highThresholdBarLong", &m_highThresholdBarLong, "High Threshold long barrel straws", "keV",CLHEP::keV,0.3,10.0);
89 defineNewVariable("highThresholdBarLongArgon", &m_highThresholdBarLongArgon, "High Threshold long barrel straws Argon", "keV",CLHEP::keV,0.3,10.0);
90 defineNewVariable("highThresholdBarLongKrypton",&m_highThresholdBarLongKrypton,"High Threshold long barrel straws Krypton","keV",CLHEP::keV,0.3,10.0);
91 // HT EC-A
92 defineNewVariable("highThresholdECAwheels", &m_highThresholdECAwheels, "High Threshold A type wheels", "keV",CLHEP::keV,0.3,10.0);
93 defineNewVariable("highThresholdECAwheelsArgon", &m_highThresholdECAwheelsArgon, "High Threshold A type wheels Argon", "keV",CLHEP::keV,0.3,10.0);
94 defineNewVariable("highThresholdECAwheelsKrypton",&m_highThresholdECAwheelsKrypton,"High Threshold A type wheels Krypton","keV",CLHEP::keV,0.3,10.0);
95 // HT EC-B
96 defineNewVariable("highThresholdECBwheels", &m_highThresholdECBwheels, "High Threshold B type wheels", "keV",CLHEP::keV,0.3,10.0);
97 defineNewVariable("highThresholdECBwheelsArgon", &m_highThresholdECBwheelsArgon, "High Threshold B type wheels Argon", "keV",CLHEP::keV,0.3,10.0);
98 defineNewVariable("highThresholdECBwheelsKrypton",&m_highThresholdECBwheelsKrypton,"High Threshold B type wheels Krypton","keV",CLHEP::keV,0.3,10.0);
99
100 defineNewVariable("innerRadiusOfStraw",&m_innerRadiusOfStraw,"Inner radius of straw","mm",CLHEP::mm,1.0,3.0); // 2.0 mm
101 defineNewVariable("outerRadiusOfWire",&m_outerRadiusOfWire,"Outer radius of wire","micrometer",CLHEP::micrometer,5.0,40.0); // 0.0155 mm
102 defineNewVariable("lengthOfDeadRegion",&m_lengthOfDeadRegion,"Length of dead region at straw ends","mm",CLHEP::mm,1.0,3.0);
103 defineNewVariable("signalPropagationSpeed",&m_signalPropagationSpeed,"Speed of signal propagation along wire","c",CLHEP::c_light,0.1,1.0);
104 defineNewVariable("distanceToTimeFactor",&m_distanceToTimeFactor,"Fudge factor changing assumed particle propagation speed in time corr. calculations","",1.0,0.1,10.0);
105 defineNewVariable("maxVertexDisplacement",&m_maxVertexDisplacement,"Maximum vertex displacement","cm",CLHEP::cm,0.0,50.0);
106 defineNewVariable("timeOffsetCalcVertexX",&m_timeOffsetCalcVertexX,"X coord. of point where particles are assumed to originate from for time-shift","m",CLHEP::m,-150.0,150.0);
107 defineNewVariable("timeOffsetCalcVertexY",&m_timeOffsetCalcVertexY,"Y coord. of point where particles are assumed to originate from for time-shift","m",CLHEP::m,-150.0,150.0);
108 defineNewVariable("timeOffsetCalcVertexZ",&m_timeOffsetCalcVertexZ,"Z coord. of point where particles are assumed to originate from for time-shift","m",CLHEP::m,-150.0,150.0);
109 defineNewVariable("pileUpSDOsMinEkin",&m_pileUpSDOsMinEkin,"Minimum kinetic energy for pile-up MC-truth (0.0=all, 999TeV=none)","GeV",CLHEP::GeV,0.0,999.0*CLHEP::TeV);
110 defineNewVariable("trEfficiencyBarrel",&m_trEfficiencyBarrel,"Transition radiation efficiency barrel","%",0.01,0.0,100.0);
111 defineNewVariable("trEfficiencyEndCapA",&m_trEfficiencyEndCapA,"Transition radiation efficiency endcap A","%",0.01,0.0,100.0);
112 defineNewVariable("trEfficiencyEndCapB",&m_trEfficiencyEndCapB,"Transition radiation efficiency endcap B","%",0.01,0.0,100.0);
113 defineNewVariable("trEfficiencyBarrelArgon",&m_trEfficiencyBarrelArgon,"Transition radiation efficiency barrel Argon","%",0.01,0.0,100.0);
114 defineNewVariable("trEfficiencyEndCapAArgon",&m_trEfficiencyEndCapAArgon,"Transition radiation efficiency endcap A Argon","%",0.01,0.0,100.0);
115 defineNewVariable("trEfficiencyEndCapBArgon",&m_trEfficiencyEndCapBArgon,"Transition radiation efficiency endcap B Argon","%",0.01,0.0,100.0);
116 defineNewVariable("trEfficiencyBarrelKrypton",&m_trEfficiencyBarrelKrypton,"Transition radiation efficiency barrel Krypton","%",0.01,0.0,100.0);
117 defineNewVariable("trEfficiencyEndCapAKrypton",&m_trEfficiencyEndCapAKrypton,"Transition radiation efficiency endcap A Krypton","%",0.01,0.0,100.0);
118 defineNewVariable("trEfficiencyEndCapBKrypton",&m_trEfficiencyEndCapBKrypton,"Transition radiation efficiency endcap B Krypton","%",0.01,0.0,100.0);
119 defineNewVariable("fastElectronicsNoisePulseDistance",&m_fastElectronicsNoisePulseDistance,"Fast electronics noise-pulse distance","ns",CLHEP::ns,0.01,20.0);
120 defineNewVariable("slowPeriodicNoisePulseDistance",&m_slowPeriodicNoisePulseDistance,"Slow periodic electronics noise-pulse distance","ns",CLHEP::ns,1.0,500.0);
121 defineNewVariable("slowPeriodicNoisePulseFraction",&m_slowPeriodicNoisePulseFraction,"Fraction of slow periodic pulses","%",0.01,0.0,1.0);
122 defineNewVariable("averageNoiseLevel",&m_averageNoiseLevel,"Average noise level used for fake cond. map","%",0.01,0.0,10.0);
123 defineNewVariable("crossTalkNoiseLevel",&m_crosstalkNoiseLevel,"Average crosstalk noise level used for fake cond. map","%",0.01,0.0,100.0);
124 defineNewVariable("crossTalkNoiseLevelOtherEnd",&m_crosstalkNoiseLevelOtherEnd,"Average crosstalk noise level on the other end as straws with pad hits","%",0.01,0.0,100.0);
125 defineNewVariable("relativeLowThresholdFluctuation",&m_relativeLowThresholdFluctuation,"Relative LT fluct. (evt to evt & straw to straw)","%",0.01,0.0,35.0);
126 defineNewVariable("relativeHighThresholdFluctuation",&m_relativeHighThresholdFluctuation,"Relative HT fluct. (evt to evt & straw to straw)","%",0.01,0.0,35.0);
127 defineNewVariable("solenoidFieldStrength",&m_solenoidFieldStrength,"Solenoid Field Strength (assume perfect uniform field)","T",CLHEP::tesla,0.0,3.0);
128 defineNewVariable("jitterTimeOffset",&m_jitterTimeOffset,"Jitter time offset (simulate lack of cosmic bunchcrossing time","ns",CLHEP::ns,0.0,25.0);
129 defineNewVariable("attenuationLength",&m_attenuationLength,"Signal attenuation length in the wire","cm",CLHEP::cm,100.0,700.0);
130
131 //unsigned ints:
132 defineNewUIntVariable("numberOfBins",&m_numberOfBins,"Number of internal bins in time interval covered by each digit (must be whole multiple of numberOfBinsInEncodingBin)",24,480);
133 defineNewUIntVariable("numberOfBinsInEncodingBin",&m_numberOfBinsInEncodingBin,"Number of bins in each encoding bin in digit",1,20);
134 defineNewUIntVariable("numberOfCrossingsBeforeMain",&m_numberOfCrossingsBeforeMain,"Number of crossings before main event",0,50);
135 defineNewUIntVariable("cosmicFlag",&m_cosmicFlag,"Flag for masking out certain barrel modules for the cosmic runs",0,3);
136 defineNewUIntVariable("storeSDO",&m_storeSDO,"Define the time range in which to store the SDOs",0,2);
137
138 //bools:
139 defineNewBoolVariable("timeCorrection",&m_timeCorrection,"Corrections due to time of flight and wire-propagation times (false for beamType='cosmics')");
140 defineNewBoolVariable("noiseInUnhitStraws",&m_noiseInUnhitStraws,"Noise in straws not passed by sim. particles");
141 defineNewBoolVariable("noiseInSimhits",&m_noiseInSimhits,"Noise in straws passed by sim. particles");
142 defineNewBoolVariable("electronicsAreAtFarEnd",&m_electronicsAreAtFarEnd,"Electronics assumed to be at the straw ends furthest from primary sim. vertex");
143 defineNewBoolVariable("timeshiftsSymmetricForPhiSectors",&m_timeshiftsSymmetricForPhiSectors,"Electronics Time offsets are symmetric from phi-sector to phi-sector");
144 defineNewBoolVariable("isCTB",&m_isCTB,"Flag set for CTB digitization");
145 defineNewBoolVariable("killEndCap",&m_killEndCap,"Kill all EndCap straws");
146 defineNewBoolVariable("killBarrel",&m_killBarrel,"Kill all Barrel straws");
147 defineNewBoolVariable("doCosmicTimingPit",&m_doCosmicTimingPit,"Do cosmic timing corresponding to pit setup");
148 defineNewBoolVariable("doCrosstalk",&m_doCrosstalk,"Do crosstalk noise simulation");
149 defineNewBoolVariable("useMagneticFieldMap",&m_useMagneticFieldMap,"Use magnetic field map in drifttime calculation");
150 defineNewBoolVariable("useAttenuation",&m_useAttenuation,"Simulate attenuation of signal strength depending on propagation length in wire");
151 defineNewBoolVariable("getT0FromData",&m_getT0FromData,"Shift the individual straw t0 according to data (conditions database)");
152 defineNewBoolVariable("isOverlay",&m_isOverlay,"Flag set for overlay jobs");
153
154 //ints:
155
156 // Time shifts
157 defineNewIntVariable("htT0shiftBarShort", &m_htT0shiftBarShort, "HT T0 shift in 0.78125 ns steps, short barrel straws",-32,32);
158 defineNewIntVariable("htT0shiftBarLong", &m_htT0shiftBarLong, "HT T0 shift in 0.78125 ns steps, long barrel straws", -32,32);
159 defineNewIntVariable("htT0shiftECAwheels", &m_htT0shiftECAwheels, "HT T0 shift in 0.78125 ns steps, A type wheels", -32,32);
160 defineNewIntVariable("htT0shiftECBwheels", &m_htT0shiftECBwheels, "HT T0 shift in 0.78125 ns steps, B type wheels", -32,32);
161
162 defineNewIntVariable("ltT0shiftBarShortXe", &m_ltT0shiftBarShortXe, "LT T0 shift in 0.78125 ns steps, short barrel straws, Xe",-32,32);
163 defineNewIntVariable("ltT0shiftBarShortKr", &m_ltT0shiftBarShortKr, "LT T0 shift in 0.78125 ns steps, short barrel straws, Kr",-32,32);
164 defineNewIntVariable("ltT0shiftBarShortAr", &m_ltT0shiftBarShortAr, "LT T0 shift in 0.78125 ns steps, short barrel straws, Ar",-32,32);
165 defineNewIntVariable("ltT0shiftBarLongXe", &m_ltT0shiftBarLongXe, "LT T0 shift in 0.78125 ns steps, long barrel straws, Xe", -32,32);
166 defineNewIntVariable("ltT0shiftBarLongKr", &m_ltT0shiftBarLongKr, "LT T0 shift in 0.78125 ns steps, long barrel straws, Kr", -32,32);
167 defineNewIntVariable("ltT0shiftBarLongAr", &m_ltT0shiftBarLongAr, "LT T0 shift in 0.78125 ns steps, long barrel straws, Ar", -32,32);
168 defineNewIntVariable("ltT0shiftECAwheelsXe",&m_ltT0shiftECAwheelsXe,"LT T0 shift in 0.78125 ns steps, A type wheels, Xe", -32,32);
169 defineNewIntVariable("ltT0shiftECAwheelsKr",&m_ltT0shiftECAwheelsKr,"LT T0 shift in 0.78125 ns steps, A type wheels, Kr", -32,32);
170 defineNewIntVariable("ltT0shiftECAwheelsAr",&m_ltT0shiftECAwheelsAr,"LT T0 shift in 0.78125 ns steps, A type wheels, Ar", -32,32);
171 defineNewIntVariable("ltT0shiftECBwheelsXe",&m_ltT0shiftECBwheelsXe,"LT T0 shift in 0.78125 ns steps, B type wheels, Xe", -32,32);
172 defineNewIntVariable("ltT0shiftECBwheelsKr",&m_ltT0shiftECBwheelsKr,"LT T0 shift in 0.78125 ns steps, B type wheels, Kr", -32,32);
173 defineNewIntVariable("ltT0shiftECBwheelsAr",&m_ltT0shiftECBwheelsAr,"LT T0 shift in 0.78125 ns steps, B type wheels, Ar", -32,32);
174
175}
176
177//check that all have a default set and that it is inside range!!
178//(check also that unsetmagicnumber is outside range)
179//In init: setDefaultsBasedOnVersionNumber(digVers);
180//_________________________________________________________________________________________________________
181void TRTDigSettings::print(const std::string& front) const {
182
183 std::cout << front << "======= Printing TRT Digitization Settings ======="<<std::endl;
184
185 std::map <std::string,doubleparameter>::const_iterator itd = m_doubleparMap.begin();
186 std::map <std::string,doubleparameter>::const_iterator itdE = m_doubleparMap.end();
187
188 for (;itd!=itdE;++itd) {
189 std::cout << front << itd->second.description<<": "<<(*(itd->second.directvaraddress))/itd->second.unit<<" "<<itd->second.unitname <<std::endl;
190 };
191
192 std::map <std::string,intboolparameter>::const_iterator itib = m_intboolparMap.begin();
193 std::map <std::string,intboolparameter>::const_iterator itibE = m_intboolparMap.end();
194
195 for (;itib!=itibE;++itib) {
196 if (itib->second.directvaraddress_int) {
197 //int
198 std::cout << front << itib->second.description<<": "<<*(itib->second.directvaraddress_int)<<std::endl;
199 } else if (itib->second.directvaraddress_uint) {
200 //unsigned int
201 std::cout << front << itib->second.description<<": "<<*(itib->second.directvaraddress_uint)<<std::endl;
202 } else {
203 //bool
204 assert(itib->second.directvaraddress_bool);
205 std::cout << front << itib->second.description<<": "<<(*(itib->second.directvaraddress_bool)?1:0)<<std::endl;
206 }
207 }
208
209 std::cout << front << "==============================================="<<std::endl;
210
211}
212
213//_________________________________________________________________________________________________________
215
216 std::map <std::string,doubleparameter>::iterator itd = m_doubleparMap.begin();
217 std::map <std::string,doubleparameter>::iterator itdE = m_doubleparMap.end();
218
219 for (;itd!=itdE;++itd) {
220 alg->declareProperty(std::string("Override_")+itd->first, itd->second.valueSetByUser );
221 }
222
223 std::map <std::string,intboolparameter>::iterator itib = m_intboolparMap.begin();
224 std::map <std::string,intboolparameter>::iterator itibE = m_intboolparMap.end();
225
226 for (;itib!=itibE;++itib) {
227 alg->declareProperty(std::string("Override_")+itib->first, itib->second.valueSetByUser );
228 }
229}
230
231//_________________________________________________________________________________________________________
233
234 std::map <std::string,doubleparameter>::iterator itd = m_doubleparMap.begin();
235 std::map <std::string,doubleparameter>::iterator itdE = m_doubleparMap.end();
236
237 for (;itd!=itdE;++itd) {
238 algt->declareProperty(std::string("Override_")+itd->first, itd->second.valueSetByUser );
239 }
240
241 std::map <std::string,intboolparameter>::iterator itib = m_intboolparMap.begin();
242 std::map <std::string,intboolparameter>::iterator itibE = m_intboolparMap.end();
243
244 for (;itib!=itibE;++itib) {
245 algt->declareProperty(std::string("Override_")+itib->first, itib->second.valueSetByUser );
246 }
247
248}
249
250//_________________________________________________________________________________________________________
251void TRTDigSettings::printFlagsForOverrideableParameters(const std::string& front) const {
252
253 std::cout << front << "======= Printing TRT Digitization Settings Overrideable parameters ======="<<std::endl;
254
255 std::map <std::string,doubleparameter>::const_iterator itd = m_doubleparMap.begin();
256 std::map <std::string,doubleparameter>::const_iterator itdE = m_doubleparMap.end();
257
258 for (;itd!=itdE;++itd) {
259 std::cout << front << std::endl;
260 std::cout << front << "Alg. Property: Override_"<<itd->first<<std::endl;
261 std::cout << front << " Type: Double"<<std::endl;
262 std::cout << front << " Range: ["<<itd->second.okrange_low/itd->second.unit<<" "
263 << itd->second.unitname<<", "
264 << itd->second.okrange_high/itd->second.unit<<" "<<itd->second.unitname<<"]"<<std::endl;
265 std::cout << front << " Description: "<<itd->second.description<<std::endl;
266 }
267
268 std::map <std::string,intboolparameter>::const_iterator itib = m_intboolparMap.begin();
269 std::map <std::string,intboolparameter>::const_iterator itibE = m_intboolparMap.end();
270
271 for (;itib!=itibE;++itib) {
272 std::cout << front << std::endl;
273 std::cout << front << "Alg. Property: Override_"<<itib->first<<std::endl;
274 std::cout << front << " Type: Int"<<std::endl;
275 std::cout << front << " Range: ["<<itib->second.okrange_low<<", "
276 << itib->second.okrange_high<<"]"<<std::endl;
277 std::cout << front << " Description: "<<itib->second.description<<std::endl;
278 }
279
280 std::cout << front <<std::endl;
281 std::cout << front << "==============================================="<<std::endl;
282
283}
284
285//_________________________________________________________________________________________________________
286void TRTDigSettings::defineNewVariable(const std::string & name, double * datamember,const std::string &description,
287 const std::string & unitname,double unitval,double lowrange,double highrange) {
288
289 //sanity checks:
290 if (m_intboolparMap.find(name)!=m_intboolparMap.end() || m_doubleparMap.find(name)!=m_doubleparMap.end()) {
291 ATH_MSG_FATAL("TRTDigSettings: Multiple definitions of "<<name);
292 return;
293 }
294 if (lowrange > highrange || lowrange*unitval<=m_propertyNotSetMagicNumber ) {
295 ATH_MSG_FATAL("TRTDigSettings: Problem in range of par "<<name);
296 return;
297 }
298
300 p.description = description;
301 p.directvaraddress = datamember;
302 p.unitname = unitname;
303 p.unit = unitval;
304 p.okrange_low = lowrange*unitval;
305 p.okrange_high = highrange*unitval;
306 p.valueSetByUser = m_propertyNotSetMagicNumber;
307
308 m_doubleparMap[name] = p;
309
310}
311
312//_________________________________________________________________________________________________________
313void TRTDigSettings::defineNewUIntVariable(const std::string &name,unsigned int * datamember, const std::string &description,
314 unsigned int lowrange, unsigned int highrange) {
315 //sanity checks:
316 if (m_intboolparMap.find(name)!=m_intboolparMap.end() || m_doubleparMap.find(name)!=m_doubleparMap.end()) {
317 ATH_MSG_FATAL("TRTDigSettings: Multiple definitions of "<<name);
318 return;
319 }
320 if (lowrange > highrange ) {
321 ATH_MSG_FATAL("TRTDigSettings: Problem in range of par "<<name);
322 return;
323 }
324
326
327 p.description = description;
328 p.directvaraddress_int = nullptr;
329 p.directvaraddress_uint = datamember;
330 p.directvaraddress_bool = nullptr;
331 p.okrange_low = static_cast<int>(lowrange);
332 p.okrange_high = static_cast<int>(highrange);
333 p.valueSetByUser = m_propertyNotSetMagicNumber_int;
334
335 m_intboolparMap[name] = p;
336
337}
338
339//_________________________________________________________________________________________________________
340void TRTDigSettings::defineNewIntVariable(const std::string & name,int * datamember,const std::string & description,
341 int lowrange, int highrange) {
342 //sanity checks:
343 if (m_intboolparMap.find(name)!=m_intboolparMap.end() || m_doubleparMap.find(name)!=m_doubleparMap.end()) {
344 ATH_MSG_FATAL("TRTDigSettings: Multiple definitions of "<<name);
345 return;
346 }
347 if (lowrange > highrange || lowrange<=m_propertyNotSetMagicNumber_int ) {
348 ATH_MSG_FATAL("TRTDigSettings: Problem in range of par "<<name);
349 return;
350 }
351
353
354 p.description = description;
355 p.directvaraddress_int = datamember;
356 p.directvaraddress_uint = nullptr;
357 p.directvaraddress_bool = nullptr;
358 p.okrange_low = lowrange;
359 p.okrange_high = highrange;
360 p.valueSetByUser = m_propertyNotSetMagicNumber_int;
361
362 m_intboolparMap[name] = p;
363
364}
365
366//_________________________________________________________________________________________________________
367void TRTDigSettings::defineNewBoolVariable(const std::string & name,bool * datamember,const std::string & description) {
368 //sanity checks:
369 if (m_intboolparMap.find(name)!=m_intboolparMap.end() || m_doubleparMap.find(name)!=m_doubleparMap.end()) {
370 ATH_MSG_FATAL("TRTDigSettings: Multiple definitions of "<<name);
371 return;
372 }
373
375
376 p.description = description;
377 p.directvaraddress_int = nullptr;
378 p.directvaraddress_uint = nullptr;
379 p.directvaraddress_bool = datamember;
380 p.okrange_low = 0;
381 p.okrange_high = 1;
382 p.valueSetByUser = m_propertyNotSetMagicNumber_int;
383
384 m_intboolparMap[name] = p;
385
386}
387
388//_________________________________________________________________________________________________________
390
392
393 bool gasok = false;
394 if ( activegastype == InDetDD::TRT_DetectorManager::newgas ) gasok = true;
395
396 if (!gasok) {
397 ATH_MSG_WARNING("Active gas setting seems incompatible with dig. version number.");
398 ATH_MSG_WARNING("If not deliberate, it might indicate a configuration or DB problem.");
399 }
400
401 // miscellaneous
402 m_solenoidFieldStrength = 2.0*CLHEP::tesla;
403
404 // falses (unlikely to change)
405 m_doCrosstalk = false; //Crosstalk noise switched off by default (so far). Switch on by doCrosstalk() flag in j.o.
406 m_crosstalkNoiseLevel = 0.01; // In cosmics: tuned to 0.01
407 m_crosstalkNoiseLevelOtherEnd = 0.01;// In cosmics: tuned to 0.01
408 m_doCosmicTimingPit = false;
409 m_getT0FromData=false;
410 m_killEndCap = false;
411 m_killBarrel = false;
412 m_cosmicFlag=0;
413 m_isCTB = false;
414 m_isOverlay=false;
415 m_noiseInUnhitStraws = false;
416
417 // trues
418 m_timeCorrection = true;
419 m_noiseInSimhits = true;
422 m_useAttenuation = true;
424
425 // output
426 m_timeInterval = 75*CLHEP::ns;
427 m_numberOfBins = 96;
429 m_storeSDO = 2;
430 m_numberOfCrossingsBeforeMain = 2; // allows migration of signal in readout window
431 m_pileUpSDOsMinEkin = 0.0*CLHEP::MeV; //lowered for lowPt tracking
432
433 // speed
434 m_signalPropagationSpeed = 225.0*CLHEP::mm/CLHEP::ns;
436
437 // time
438 // Fred: It would seem to me that the timing base for both low and high hits could
439 // be slightly different for the A & C sides and it would be wise to allow
440 // for the possibility in the code [FIXME].
441 m_minDiscriminatorWidth = 1.1*CLHEP::ns;
442 m_discriminatorSettlingTime = 1.1*CLHEP::ns;
443 m_discriminatorDeadTime = 6.0*CLHEP::ns;
444 m_jitterTimeOffset = 0.0*CLHEP::ns;
445
446 // HT middle-bit fraction tune; KyungEon.Choi@cern.ch
447 // https://indico.cern.ch/event/389682/contribution/5/material/slides/0.pdf
448 m_htT0shiftBarShort = -6; // Timing shift applied just before discrimination (steps of 0.78125 ns).
449 m_htT0shiftBarLong = -6; // It affects only HL threshold timing. The purpose is to
450 m_htT0shiftECAwheels = -6; // tune the middle HT bit fraction so that HT probability
451 m_htT0shiftECBwheels = -6; // can be based on the middle bit only at high occupancy.
452
453 // LT timimg shift in steps of 0.78125 ns.
466
467 // length
468 m_innerRadiusOfStraw = 2.0*CLHEP::mm;
469 m_outerRadiusOfWire = 0.0155*CLHEP::mm;
470 m_lengthOfDeadRegion = 3.0*CLHEP::mm;
471 m_attenuationLength = 400.*CLHEP::cm;
473 m_timeOffsetCalcVertexX = 0.0*CLHEP::cm;
474 m_timeOffsetCalcVertexY = 0.0*CLHEP::cm;
475 m_timeOffsetCalcVertexZ = 0.0*CLHEP::cm;
476
477 // (Xenon)
478 // HT fine-tune on 2011 data tagged as 00-11-07
479 // HT middle-bit fraction tune - wider shaping function; 01-00-24
480 // Delta-ray suppression tune tagged as 01-01-03
481 // Delta-ray suppression tune with backward compatibility with non suppressed delta-ray simulation tagged as 01-01-07
482 // Delta-ray suppression HT middle-bit fraction tune - 2015 data; 01-01-16
483 // HT rough-tune on 2022 data R23 for mc23e production
484 m_trtRangeCutProperty = m_doubleparMap["TrtRangeCutProperty"].valueSetByUser;//To avoid overwritting warning message and to use python configured value
485 if(std::abs(m_trtRangeCutProperty-0.05) >= std::numeric_limits<double>::epsilon()){
486 m_lowThresholdBar = 0.260*CLHEP::keV;
487 m_lowThresholdEC = 0.275*CLHEP::keV;
488 m_highThresholdBarShort = 5.195*CLHEP::keV;
489 m_highThresholdBarLong = 4.751*CLHEP::keV;
490 m_highThresholdECAwheels = 4.941*CLHEP::keV;
491 m_highThresholdECBwheels = 4.868*CLHEP::keV;
492 m_trEfficiencyBarrel = 0.774;
493 m_trEfficiencyEndCapA = 0.909;
494 m_trEfficiencyEndCapB = 0.809;
495 }
496 else {
497 m_lowThresholdBar = 0.260*CLHEP::keV;
498 m_lowThresholdEC = 0.275*CLHEP::keV;
499 m_highThresholdBarShort = 6.576*CLHEP::keV;
500 m_highThresholdBarLong = 6.016*CLHEP::keV;
501 m_highThresholdECAwheels = 6.390*CLHEP::keV;
502 m_highThresholdECBwheels = 6.074*CLHEP::keV;
506 ATH_MSG_WARNING("Setting up non suppressed double counted delta-ray xenon tune");
507 }
508
509 // (Argon) Initial tuning by Artem July 2014. See log file. Requires fine tuning.
510 // HT middle-bit fraction tune - wider shaping function; 01-00-24
511 // HT middle-bit fraction tune - 2015 data; 01-01-16
512 // HT rough-tune on 2022 data R23 for mc23e production (required also overlay correction tune)
513 // Argon LT tune to 2015 data; r22
514 m_lowThresholdBarArgon = 0.100*CLHEP::keV;
515 m_lowThresholdECArgon = 0.100*CLHEP::keV;
516 m_highThresholdBarShortArgon = 2.271*CLHEP::keV;
517 m_highThresholdBarLongArgon = 2.061*CLHEP::keV;
518 m_highThresholdECAwheelsArgon = 2.168*CLHEP::keV;
519 m_highThresholdECBwheelsArgon = 2.089*CLHEP::keV;
523
524 // (Krypton)
525 // Initial implementation in May 2015 - guess; 01-01-00
526 // Tuning from 2015 data by Kevin in April 2016, no LT tune; 01-02-01
527 m_lowThresholdBarKrypton = 0.140*CLHEP::keV;
528 m_lowThresholdECKrypton = 0.150*CLHEP::keV;
529 m_highThresholdBarShortKrypton = 3.07*CLHEP::keV;
530 m_highThresholdBarLongKrypton = 2.90*CLHEP::keV;
531 m_highThresholdECAwheelsKrypton = 3.15*CLHEP::keV;
532 m_highThresholdECBwheelsKrypton = 3.02*CLHEP::keV;
536
537 // Noise
539 m_slowPeriodicNoisePulseDistance = 25.0*CLHEP::ns;
541 m_averageNoiseLevel = 0.02;
544
545 // Clusters
546 m_smearingFactor = 0.4;
549 m_ionisationPotential = 26.0*CLHEP::eV;
550 m_ionisationPotentialArgon = 28.3*CLHEP::eV;
551 m_ionisationPotentialKrypton = 28.3*CLHEP::eV;
552
553}
554
555//_________________________________________________________________________________________________________
557
558 bool anyoverrides = false;
559 std::map <std::string,doubleparameter>::iterator itd = m_doubleparMap.begin();
560 std::map <std::string,doubleparameter>::iterator itdE = m_doubleparMap.end();
561
562 for (;itd!=itdE;++itd) {
563 if (itd->second.valueSetByUser != m_propertyNotSetMagicNumber) {
564 if (itd->second.valueSetByUser < itd->second.okrange_low || itd->second.valueSetByUser > itd->second.okrange_high) {
565 ATH_MSG_ERROR("Can not override value of "<<itd->first<<" : New value outside allowed range");
566 } else {
567 if ( static_cast<float>(*(itd->second.directvaraddress)) != static_cast<float>(itd->second.valueSetByUser) ) {
568 ATH_MSG_WARNING("Overriding "<<itd->first<<" flag ("
569 << (*(itd->second.directvaraddress))/itd->second.unit<<" "<<itd->second.unitname<<" -> "
570 << itd->second.valueSetByUser/itd->second.unit<<" "<<itd->second.unitname<<")");
571 *(itd->second.directvaraddress) = itd->second.valueSetByUser;
572 anyoverrides = true;
573 }
574 }
575 }
576 }
577
578 std::map <std::string,intboolparameter>::iterator itib = m_intboolparMap.begin();
579 std::map <std::string,intboolparameter>::iterator itibE = m_intboolparMap.end();
580
581 for (;itib!=itibE;++itib) {
582 if (itib->second.valueSetByUser != m_propertyNotSetMagicNumber_int) {
583 if (itib->second.valueSetByUser < itib->second.okrange_low || itib->second.valueSetByUser > itib->second.okrange_high) {
584 ATH_MSG_ERROR("Can not override value of "<<itib->first<<" : New value outside allowed range");
585 } else {
586 if (itib->second.directvaraddress_int) {
587 //int
588 if ( (*(itib->second.directvaraddress_int)) != itib->second.valueSetByUser ) {
589 ATH_MSG_WARNING("Overriding "<<itib->first<<" flag ("
590 << *(itib->second.directvaraddress_int)<<" -> "<< itib->second.valueSetByUser<<")");
591 *(itib->second.directvaraddress_int) = itib->second.valueSetByUser;
592 anyoverrides = true;
593 }
594 } else if (itib->second.directvaraddress_uint) {
595 //unsigned int
596 if ( (*(itib->second.directvaraddress_uint)) != static_cast<unsigned int>(itib->second.valueSetByUser) ) {
597 ATH_MSG_WARNING("Overriding "<<itib->first<<" flag ("
598 << *(itib->second.directvaraddress_uint)<<" -> "<< itib->second.valueSetByUser<<")");
599 *(itib->second.directvaraddress_uint) = itib->second.valueSetByUser;
600 anyoverrides = true;
601 }
602 } else {
603 //bool
604 assert(itib->second.directvaraddress_bool);
605 if ( (*(itib->second.directvaraddress_bool)) != itib->second.valueSetByUser ) {
606 ATH_MSG_WARNING("Overriding "<<itib->first<<" flag ("
607 << (*(itib->second.directvaraddress_bool)?1:0)<<" -> "
608 << (itib->second.valueSetByUser?1:0)<<")");
609 *(itib->second.directvaraddress_bool) = itib->second.valueSetByUser == 1;
610 anyoverrides = true;
611 }
612 }
613 }
614 }
615 }
616
617 if (anyoverrides)
618 ATH_MSG_WARNING("Settings overridden from joboptions => possible deviation from version defaults.");
619
620}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_WARNING(x)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
double m_attenuationLength
double m_highThresholdECBwheelsKrypton
High threshold discriminator setting Krypton.
double m_trEfficiencyBarrelArgon
Transition Radiation efficiency, barrel, Argon.
double m_relativeHighThresholdFluctuation
Relative high threshold fluctuation.
double m_discriminatorDeadTime
Discriminator dead time.
void defineNewBoolVariable(const std::string &name, bool *datamember, const std::string &description)
Define new bool variable.
int m_ltT0shiftBarShortKr
LT T0 shift.
double m_trEfficiencyEndCapA
Transition Radiation efficiency, end cap A.
double m_timeOffsetCalcVertexX
x-coord.
bool m_noiseInSimhits
Simulate noise in hit straws.
unsigned int m_numberOfCrossingsBeforeMain
For pileup: BCs before main event.
double m_slowPeriodicNoisePulseDistance
Slow periodic noise pulse distance (time)
double m_timeOffsetCalcVertexY
y-coord.
double m_outerRadiusOfWire
Radius of drift wire.
double m_highThresholdECBwheels
High threshold discriminator setting.
double m_trEfficiencyEndCapB
Transition Radiation efficiency, end cap B.
TRTDigSettings()
Parameters and settings for TRT digitization.
void printFlagsForOverrideableParameters(const std::string &front="") const
Print TRT digitization settings overrideable parameters.
int m_propertyNotSetMagicNumber_int
double m_trEfficiencyBarrelKrypton
Transition Radiation efficiency, barrel, Krypton.
void processOverrides()
Overwrite default values by uses values.
double m_distanceToTimeFactor
Fudge factor: time to distance.
void print(const std::string &front="") const
Printing of TRT digitization settings.
double m_smearingFactorArgon
Cluster energy smearing factor for Argon mixture.
double m_trEfficiencyEndCapAArgon
Transition Radiation efficiency, end cap A, Argon.
double m_ionisationPotential
Mean ionisation potential.
double m_highThresholdBarShort
High threshold discriminator setting.
double m_crosstalkNoiseLevel
Average cross talk noise level.
bool m_timeshiftsSymmetricForPhiSectors
Time offset assumed phi symmetric.
double m_timeOffsetCalcVertexZ
z-coord.
void fillDefaults(const InDetDD::TRT_DetectorManager *detmgr)
Fill default values into settable variables.
bool m_isOverlay
Doing overlay.
double m_highThresholdECAwheelsArgon
High threshold discriminator setting Argon.
unsigned int m_storeSDO
Time window in which to store SDOs.
double m_jitterTimeOffset
Event time not correlated with LHC clock.
double m_highThresholdBarLongKrypton
High threshold discriminator setting Krypton.
double m_slowPeriodicNoisePulseFraction
Slow periodic noise pulse fraction.
double m_highThresholdECAwheelsKrypton
High threshold discriminator setting Krypton.
void addPropertiesForOverrideableParameters(Algorithm *alg)
Add properties for overrideable parameters.
std::map< std::string, doubleparameter > m_doubleparMap
Map of settable parameters (double)
double m_lowThresholdBarKrypton
Low threshold discriminator setting for Krypton mixture.
bool m_electronicsAreAtFarEnd
Electronics assumed at far end of straw.
bool m_doCrosstalk
Crosstalk noise.
double m_highThresholdECBwheelsArgon
High threshold discriminator setting Argon.
double m_relativeLowThresholdFluctuation
Relative low threshold fluctuation.
double m_lowThresholdBar
Low threshold discriminator setting.
double m_signalPropagationSpeed
Signal propagation time in signal wire.
double m_lowThresholdBarArgon
Low threshold discriminator setting for Argon mixture.
double m_trEfficiencyEndCapBArgon
Transition Radiation efficiency, end cap B, Argon.
double m_highThresholdBarLongArgon
High threshold discriminator setting Argon.
double m_trEfficiencyEndCapBKrypton
Transition Radiation efficiency, end cap B, Krypton.
double m_lowThresholdECKrypton
Low threshold discriminator setting for Krypton mixture.
double m_highThresholdBarLong
High threshold discriminator setting.
double m_maxVertexDisplacement
Max.
double m_trEfficiencyBarrel
Transition Radiation efficiency, barrel.
double m_averageNoiseLevel
Average noise level.
int m_htT0shiftBarLong
HT T0 shift.
bool m_isCTB
Data is from CTB (Combined Test Beam)
unsigned int m_numberOfBinsInEncodingBin
No.
void defineNewVariable(const std::string &name, double *datamember, const std::string &description, const std::string &unitname, double unitval, double lowrange, double highrange)
Define new double variable.
double m_innerRadiusOfStraw
Inner radius of straw.
bool m_timeCorrection
Corrrect for flight and wire propagation delays.
double m_ionisationPotentialArgon
Mean ionisation potential for Argon mixture.
double m_highThresholdBarShortKrypton
High threshold discriminator setting Krypton.
double m_discriminatorSettlingTime
Discriminator settling time.
double m_smearingFactor
Cluster energy smearing factor.
double m_lowThresholdECArgon
Low threshold discriminator setting for Argon mixture.
unsigned int m_numberOfBins
No.
unsigned int m_cosmicFlag
Data is cosmics.
void defineVariables()
Define settable variables.
double m_lengthOfDeadRegion
Length of dead region at straw end.
std::map< std::string, intboolparameter > m_intboolparMap
Map of settable parameters (int & bool)
bool m_noiseInUnhitStraws
Simulate noise in unhit straws.
double m_trtRangeCutProperty
Electrons xenon range cut in TRT simulation.
double m_lowThresholdEC
Low threshold discriminator setting.
double m_ionisationPotentialKrypton
Mean ionisation potential for Krypton mixture.
bool m_killBarrel
Disable barrel.
double m_pileUpSDOsMinEkin
Min.
double m_timeInterval
Time interval covered by each digit.
double m_propertyNotSetMagicNumber
double m_fastElectronicsNoisePulseDistance
Fast electronics noise pulse distance (time)
void defineNewUIntVariable(const std::string &name, unsigned int *datamember, const std::string &description, unsigned int lowrange, unsigned int highrange)
Define new unsigned int variable.
void initialize(const InDetDD::TRT_DetectorManager *detmgr)
Initialize: fill defaults and overwrite by user values where appropriate.
bool m_killEndCap
Disable end cap.
double m_solenoidFieldStrength
Solenoid field strength.
double m_highThresholdECAwheels
High threshold discriminator setting.
double m_crosstalkNoiseLevelOtherEnd
Average cross talk noise level - other end.
double m_trEfficiencyEndCapAKrypton
Transition Radiation efficiency, end cap A, Krypton.
double m_minDiscriminatorWidth
Min.
bool m_doCosmicTimingPit
Cosmics pit setup.
void defineNewIntVariable(const std::string &name, int *datamember, const std::string &description, int lowrange, int highrange)
Define new int variable.
double m_smearingFactorKrypton
Cluster energy smearing factor for Krypton mixture.
double m_highThresholdBarShortArgon
High threshold discriminator setting Argon.
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91
Settable parameter, double.
Settable parameter, int and bool.