|
ATLAS Offline Software
|
Simulation of noise hits in the TRT.
More...
#include <TRTNoise.h>
|
| TRTNoise (const TRTDigSettings *, const InDetDD::TRT_DetectorManager *, CLHEP::HepRandomEngine *noiseRndmEngine, CLHEP::HepRandomEngine *elecNoiseRndmEngine, CLHEP::HepRandomEngine *elecProcRndmEngine, CLHEP::HepRandomEngine *elecNoiseResetRndmEngine, TRTDigCondBase *digcond, TRTElectronicsProcessing *ep, TRTElectronicsNoise *electronicsnoise, const TRT_ID *trt_id, int UseGasMix, ToolHandle< ITRT_StrawStatusSummaryTool > sumTool) |
| Constructor. More...
|
|
void | appendPureNoiseToProperDigits (std::vector< TRTDigit > &digitVect, const std::set< int > &sim_hitids, CLHEP::HepRandomEngine *noiseRndmEngine) |
| Append noise digits to list of digits from proper hits. More...
|
|
void | appendCrossTalkNoiseToProperDigits (std::vector< TRTDigit > &digitVect, const std::set< Identifier > &simhitsIdentifiers, const ServiceHandle< ITRT_StrawNeighbourSvc > &m_TRTStrawNeighbourSvc, CLHEP::HepRandomEngine *noiseRndmEngine) |
|
| ~TRTNoise () |
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
static float | useLookupTable (const float &x, const std::vector< float > &y_given_x, const float &min_x, const float &max_x) |
| Return y value corresponding to input x value from LUT. More...
|
|
static void | makeInvertedLookupTable (const std::vector< float > &y_given_x, const float &min_x, const float &max_x, std::vector< float > &x_given_y, float &min_y, float &max_y) |
| Invert look-up-table: Go from tabulated y values vs. More...
|
|
static void | evolve_LT2AmpVsNL_to_include_LTfluct (std::vector< float > &nl_given_lt2na, const float &min_lt2na, const float &max_lt2na, const float relativeLTFluct, float &new_min_lt2na, float &new_max_lt2na, const unsigned int &number_new_bins) |
| Refined noise treatment by allowing for event-by-event fluctuations in the low threshold settings. More...
|
|
Simulation of noise hits in the TRT.
For method, please see Thomas Kittelmanns thesis
Definition at line 39 of file TRTNoise.h.
◆ TRTNoise()
TRTNoise::TRTNoise |
( |
const TRTDigSettings * |
digset, |
|
|
const InDetDD::TRT_DetectorManager * |
detmgr, |
|
|
CLHEP::HepRandomEngine * |
noiseRndmEngine, |
|
|
CLHEP::HepRandomEngine * |
elecNoiseRndmEngine, |
|
|
CLHEP::HepRandomEngine * |
elecProcRndmEngine, |
|
|
CLHEP::HepRandomEngine * |
elecNoiseResetRndmEngine, |
|
|
TRTDigCondBase * |
digcond, |
|
|
TRTElectronicsProcessing * |
ep, |
|
|
TRTElectronicsNoise * |
electronicsnoise, |
|
|
const TRT_ID * |
trt_id, |
|
|
int |
UseGasMix, |
|
|
ToolHandle< ITRT_StrawStatusSummaryTool > |
sumTool |
|
) |
| |
◆ ~TRTNoise()
◆ appendCrossTalkNoiseToProperDigits()
Definition at line 356 of file TRTNoise.cxx.
364 std::vector<Identifier> IdsFromChip;
365 std::vector<Identifier> CrossTalkIds;
366 std::vector<Identifier> CrossTalkIdsOtherEnd;
367 std::set<Identifier>::const_iterator simhitsIdentifiers_end = simhitsIdentifiers.end();
368 std::set<Identifier>::const_iterator simhitsIdentifiers_begin = simhitsIdentifiers.begin();
371 for (simhitsIdentifiersIter=simhitsIdentifiers_begin; simhitsIdentifiersIter!=simhitsIdentifiers_end; ++simhitsIdentifiersIter) {
373 TRTStrawNeighbourSvc->getStrawsFromChip(*simhitsIdentifiersIter,IdsFromChip);
374 CrossTalkIds.assign(IdsFromChip.begin(),IdsFromChip.end());
384 if (otherEndID.
get_compact()) { CrossTalkIdsOtherEnd.push_back(otherEndID); }
386 for (
auto & CrossTalkId : CrossTalkIds) {
388 if ( simhitsIdentifiers.find(CrossTalkId) == simhitsIdentifiers_end ) {
390 const int ndigit(
m_digitPool[CLHEP::RandFlat::shootInt(noiseRndmEngine,
392 int barrel_endcap, isneg;
394 case -1: barrel_endcap = 0; isneg = 0;
break;
395 case 1: barrel_endcap = 0; isneg = 1;
break;
397 ATH_MSG_WARNING(
"TRTDigitization::TRTNoise - identifier problems - skipping detector element!!");
408 digitVect.emplace_back(hitid,ndigit);
413 for (
auto &
i : CrossTalkIdsOtherEnd) {
414 if ( simhitsIdentifiers.find(
i) == simhitsIdentifiers_end ) {
419 int barrel_endcap, isneg;
421 case -1: barrel_endcap = 0; isneg = 0;
break;
422 case 1: barrel_endcap = 0; isneg = 1;
break;
424 ATH_MSG_WARNING(
"TRTDigitization::TRTNoise - identifier problems - skipping detector element!!");
436 digitVect.emplace_back(hitid,ndigit);
441 IdsFromChip.resize(0);
442 CrossTalkIdsOtherEnd.resize(0);
443 CrossTalkIds.resize(0);
◆ appendPureNoiseToProperDigits()
void TRTNoise::appendPureNoiseToProperDigits |
( |
std::vector< TRTDigit > & |
digitVect, |
|
|
const std::set< int > & |
sim_hitids, |
|
|
CLHEP::HepRandomEngine * |
noiseRndmEngine |
|
) |
| |
Append noise digits to list of digits from proper hits.
We are here dealing with unhit straws and noise digits are added from a pool of cached digits (m_digitPool
).
- Parameters
-
digitVect | vector of digits this event. At input, contains digits from hits. At output, noise digits have been added. |
sim_hitids | list of IDs of hit straws. This to make sure we do not add noise digit to already hit straw. |
Definition at line 333 of file TRTNoise.cxx.
337 const std::set<int>::const_iterator sim_hitids_end(sim_hitids.end());
346 if ( sim_hitids.find(hitid) == sim_hitids_end ) {
348 digitVect.emplace_back(hitid,ndigit);
352 digitVect.pop_back(); }
◆ evolve_LT2AmpVsNL_to_include_LTfluct()
void TRTNoise::evolve_LT2AmpVsNL_to_include_LTfluct |
( |
std::vector< float > & |
nl_given_lt2na, |
|
|
const float & |
min_lt2na, |
|
|
const float & |
max_lt2na, |
|
|
const float |
relativeLTFluct, |
|
|
float & |
new_min_lt2na, |
|
|
float & |
new_max_lt2na, |
|
|
const unsigned int & |
number_new_bins |
|
) |
| |
|
staticprivate |
Refined noise treatment by allowing for event-by-event fluctuations in the low threshold settings.
This is done by smearing of a LUT giving noise fractions as function of LT/NA values (see TK thesis).
What this method effectively does, is to smear the x-axis in a LUT with a Gaussian with a given relative width.
- Parameters
-
nl_given_lt2na | The (inverted) LUT of noise level vs. LT/NA values (input and output) |
min_lt2na | lower LT/NA value (input) |
max_lt2na | higher LT/NA value (input) |
relativeLTfluct | relative event-by-event fluctuations in low threshold level (input) |
new_min_lt2na | lower LT/NA value after smearing (output) |
new_max_lt2na | higher LT/NA value after smearing (output) |
number_new_bins | LUT is expanded to this number of bins (input) |
Definition at line 539 of file TRTNoise.cxx.
550 std::vector<float> new_nl_given_lt2na(number_new_bins);
551 constexpr
double reciprocalSqrt2Pi = M_2_SQRTPI * 0.5 * M_SQRT1_2;
552 new_min_lt2na = min_lt2na;
553 new_max_lt2na = relativeLTFluct < 0.4 ? max_lt2na/(1.0-2.0*relativeLTFluct) : 5*max_lt2na;
555 for (
unsigned int i = 0;
i<number_new_bins;++
i) {
556 const float new_lt2naval(new_min_lt2na + (new_max_lt2na-new_min_lt2na)*
static_cast<float>(
i)/(number_new_bins-1));
557 float sigma = new_lt2naval*relativeLTFluct;
560 else {
sigma = 1.0e-8; }
562 const float lowerintrange(new_lt2naval - 5.0*
sigma);
563 float upperintrange(new_lt2naval + 5.0*
sigma);
564 if (upperintrange>max_lt2na) {
565 upperintrange = max_lt2na;
567 const double du((upperintrange-lowerintrange)/100.0);
569 const double minusoneover2sigmasq(- 1.0 / (2.0*
sigma*
sigma));
571 for (
double u(lowerintrange);
u < upperintrange;
u += du) {
573 exp(minusoneover2sigmasq * (
u-new_lt2naval) * (
u-new_lt2naval));
576 new_nl_given_lt2na[
i] =
sum;
579 nl_given_lt2na.resize(number_new_bins);
580 copy(new_nl_given_lt2na.begin(),
581 new_nl_given_lt2na.end(),
582 nl_given_lt2na.begin());
◆ getStrawIdentifier()
Identifier TRTNoise::getStrawIdentifier |
( |
int |
hitID | ) |
|
|
private |
Definition at line 585 of file TRTNoise.cxx.
590 const int mask(0x0000001F);
591 const int word_shift(5);
592 int trtID, ringID, moduleID, layerID, strawID;
593 int wheelID, planeID, sectorID;
598 if ( !(hitID & 0x00200000) ) {
599 strawID = hitID &
mask;
600 hitID >>= word_shift;
601 layerID = hitID &
mask;
602 hitID >>= word_shift;
603 moduleID = hitID &
mask;
604 hitID >>= word_shift;
605 ringID = hitID &
mask;
606 trtID = hitID >> word_shift;
609 if ( barrelElement ) {
610 IdLayer = barrelElement->
identify();
613 ATH_MSG_ERROR(
"Could not find detector element for barrel identifier with "
614 <<
"(ipos,iring,imod,ilayer,istraw) = ("
615 << trtID <<
", " << ringID <<
", " << moduleID <<
", "
616 << layerID <<
", " << strawID <<
")");
619 strawID = hitID &
mask;
620 hitID >>= word_shift;
621 planeID = hitID &
mask;
622 hitID >>= word_shift;
623 sectorID = hitID &
mask;
624 hitID >>= word_shift;
625 wheelID = hitID &
mask;
626 trtID = hitID >> word_shift;
629 if (trtID == 3) { trtID = 0; }
634 if ( endcapElement ) {
635 IdLayer = endcapElement->
identify();
638 ATH_MSG_ERROR(
"Could not find detector element for endcap identifier with "
639 <<
"(ipos,iwheel,isector,iplane,istraw) = ("
640 << trtID <<
", " << wheelID <<
", " << sectorID <<
", "
641 << planeID <<
", " << strawID <<
")");
642 ATH_MSG_ERROR(
"If this happens very rarely, don't be alarmed "
643 "(it is a Geant4 'feature')");
644 ATH_MSG_ERROR(
"If it happens a lot, you probably have misconfigured geometry "
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ InitThresholdsAndNoiseAmplitudes_and_ProduceNoiseDigitPool()
void TRTNoise::InitThresholdsAndNoiseAmplitudes_and_ProduceNoiseDigitPool |
( |
CLHEP::HepRandomEngine * |
noiseRndmEngine, |
|
|
CLHEP::HepRandomEngine * |
elecNoiseRndmEngine, |
|
|
CLHEP::HepRandomEngine * |
elecProcRndmEngine |
|
) |
| |
|
private |
Initialize thresholds and noise amplitudes.
This is the main initialization method for the noise treatment.
Strategy:
- First we create a lookup table so that we can, based on the noiselevel_i (i=straw_id), calculate for each straw: (LT/NA)_i (NA=Noise Amplitude).
- We also know for each straw their relative noise amplitude, r_i.
- C.f. Thomas Kittelmanns thesis, one finds that the lowthreshold and noise amplitude for each straw is given by the formulas:
LT_i = (LT/NA)_i * r_i * k and NA_i = r_i * k, with k = < LT_i > / <(LT/NA)_i * r_i>
Steps:
- Create lookup table for mapping: noiselevel to LT/NA
- Find constant: k=< LT_i > / <(LT/NA)_i * r_i>
- Calculate and set actual values of LT_i and NA_i for each straw.
- Call method
ProduceNoiseDigitPool
to produce pool of pure noise digits
Loop through all non-dead straws (there are no dead straws since 2009!):
Definition at line 69 of file TRTNoise.cxx.
98 std::vector<float> maxLTOverNoiseAmp;
102 reverse( maxLTOverNoiseAmp.begin(), maxLTOverNoiseAmp.end() );
108 if ( relfluct > 0. ) {
109 std::vector<float> nl_given_LT2Amp;
110 float min_lt2amp, max_lt2amp;
112 nl_given_LT2Amp, min_lt2amp, max_lt2amp);
113 float new_min_lt2amp, new_max_lt2amp;
115 min_lt2amp, max_lt2amp,
117 new_min_lt2amp, new_max_lt2amp,
118 static_cast<unsigned int>(0.1*nl_given_LT2Amp.size()));
129 unsigned long nstrawsBa_Xe(0), nstrawsEC_Xe(0);
130 unsigned long nstrawsBa_Kr(0), nstrawsEC_Kr(0);
131 unsigned long nstrawsBa_Ar(0), nstrawsEC_Ar(0);
132 double sumBa_Xe(0.), sumEC_Xe(0.);
133 double sumBa_Kr(0.), sumEC_Kr(0.);
134 double sumBa_Ar(0.), sumEC_Ar(0.);
136 float noiselevel(0.), noiseamp(0.);
143 const bool isBarrel(!(hitid & 0x00200000));
146 float lt =
useLookupTable(noiselevel, maxLTOverNoiseAmp, 0., 1.) * noiseamp;
148 if (strawGasType==0) {
149 if (
isBarrel ) { ++nstrawsBa_Xe; sumBa_Xe += lt; }
150 else { ++nstrawsEC_Xe; sumEC_Xe += lt; }
152 else if (strawGasType==1) {
153 if (
isBarrel ) { ++nstrawsBa_Kr; sumBa_Kr += lt; }
154 else { ++nstrawsEC_Kr; sumEC_Kr += lt; }
156 else if (strawGasType==2) {
157 if (
isBarrel ) { ++nstrawsBa_Ar; sumBa_Ar += lt; }
158 else { ++nstrawsEC_Ar; sumEC_Ar += lt; }
164 double kBa_Xe(0.), kEC_Xe(0.);
165 double kBa_Kr(0.), kEC_Kr(0.);
166 double kBa_Ar(0.), kEC_Ar(0.);
178 std::vector<float> actual_LTs, actual_noiseamps;
179 std::vector<int> strawTypes;
182 actual_LTs.reserve(nstraws);
183 actual_noiseamps.reserve(nstraws);
186 float actualLT, actualNA;
190 double sumLT_Ar(0.), sumLTsq_Ar(0.), sumNA_Ar(0.), sumNAsq_Ar(0.);
191 double sumLT_Xe(0.), sumLTsq_Xe(0.), sumNA_Xe(0.), sumNAsq_Xe(0.);
192 double sumLT_Kr(0.), sumLTsq_Kr(0.), sumNA_Kr(0.), sumNAsq_Kr(0.);
199 const bool isBarrel(!(hitid & 0x00200000));
200 if (strawGasType==0) { actualNA = noiseamp*(
isBarrel ? kBa_Xe : kEC_Xe ); }
201 else if (strawGasType==1) { actualNA = noiseamp*(
isBarrel ? kBa_Kr : kEC_Kr ); }
202 else if (strawGasType==2) { actualNA = noiseamp*(
isBarrel ? kBa_Ar : kEC_Ar ); }
203 else { actualNA = 0.0; }
205 actualLT =
useLookupTable(noiselevel, maxLTOverNoiseAmp, 0., 1.)*actualNA;
207 if (strawGasType==0) {
208 sumNA_Xe += actualNA; sumNAsq_Xe += actualNA*actualNA;
209 sumLT_Xe += actualLT; sumLTsq_Xe += actualLT*actualLT;
211 else if (strawGasType==1) {
212 sumNA_Kr += actualNA; sumNAsq_Kr += actualNA*actualNA;
213 sumLT_Kr += actualLT; sumLTsq_Kr += actualLT*actualLT;
215 else if (strawGasType==2) {
216 sumNA_Ar += actualNA; sumNAsq_Ar += actualNA*actualNA;
217 sumLT_Ar += actualLT; sumLTsq_Ar += actualLT*actualLT;
223 actual_LTs.push_back(actualLT);
224 actual_noiseamps.push_back(actualNA);
225 strawTypes.push_back(strawGasType);
233 unsigned long nstraws_Kr = nstrawsBa_Kr + nstrawsEC_Kr;
234 unsigned long nstraws_Xe = nstrawsBa_Xe + nstrawsEC_Xe;
235 unsigned long nstraws_Ar = nstrawsBa_Ar + nstrawsEC_Ar;
239 << sqrt((sumLTsq_Xe/nstraws_Xe)-(sumLT_Xe/nstraws_Xe)*(sumLT_Xe/nstraws_Xe))/
CLHEP::eV <<
" eV");
241 << sqrt((sumNAsq_Xe/nstraws_Xe)-(sumNA_Xe/nstraws_Xe)*(sumNA_Xe/nstraws_Xe))/
CLHEP::eV <<
" eV");
245 << sqrt((sumLTsq_Kr/nstraws_Kr)-(sumLT_Kr/nstraws_Kr)*(sumLT_Kr/nstraws_Kr))/
CLHEP::eV <<
" eV");
247 << sqrt((sumNAsq_Kr/nstraws_Kr)-(sumNA_Kr/nstraws_Kr)*(sumNA_Kr/nstraws_Kr))/
CLHEP::eV <<
" eV");
251 << sqrt((sumLTsq_Ar/nstraws_Ar)-(sumLT_Ar/nstraws_Ar)*(sumLT_Ar/nstraws_Ar))/
CLHEP::eV <<
" eV");
253 << sqrt((sumNAsq_Ar/nstraws_Ar)-(sumNA_Ar/nstraws_Ar)*(sumNA_Ar/nstraws_Ar))/
CLHEP::eV <<
" eV");
262 ProduceNoiseDigitPool( actual_LTs, actual_noiseamps, strawTypes, noiseRndmEngine, elecNoiseRndmEngine, elecProcRndmEngine );
◆ makeInvertedLookupTable()
void TRTNoise::makeInvertedLookupTable |
( |
const std::vector< float > & |
y_given_x, |
|
|
const float & |
min_x, |
|
|
const float & |
max_x, |
|
|
std::vector< float > & |
x_given_y, |
|
|
float & |
min_y, |
|
|
float & |
max_y |
|
) |
| |
|
staticprivate |
Invert look-up-table: Go from tabulated y values vs.
equidistantly spaced x values to tabulated x values vs. equidistantly spaced y values.
- Parameters
-
y_given_x | y given x (input) |
min_x | lower x value (input) |
max_x | higher x value (input) |
x_given_y | x given y (output) |
min_y | lower y value (output) |
max_y | higher y value (output) |
Definition at line 485 of file TRTNoise.cxx.
499 if ( y_given_x.front() < y_given_x.back() ) {
502 min_y = y_given_x.front();
503 max_y = y_given_x.back();
506 min_y = y_given_x.back();
507 max_y = y_given_x.front();
510 const unsigned int n(y_given_x.size());
511 if ( x_given_y.size() !=
n ) {
516 const float step_y((max_y-min_y)/(
n-1));
517 const float step_x((max_x-min_x)/(
n-1));
519 unsigned int searchindex = rising ? 0 :
n-1;
521 x_given_y.front() = rising ? min_x : max_x;
522 for (
unsigned int i = 1;
i <
n-1; ++
i) {
523 yval = min_y +
i*step_y;
527 while ( y_given_x[searchindex] <
yval ) { ++searchindex; };
528 x_given_y[
i] = min_x + searchindex*step_x;
530 while ( y_given_x[searchindex]<
yval ) { --searchindex; };
531 x_given_y[
i] = min_x + searchindex*step_x;
534 x_given_y.back() = rising ? max_x : min_x;
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ ProduceNoiseDigitPool()
void TRTNoise::ProduceNoiseDigitPool |
( |
const std::vector< float > & |
lowthresholds, |
|
|
const std::vector< float > & |
noiseamps, |
|
|
const std::vector< int > & |
strawType, |
|
|
CLHEP::HepRandomEngine * |
noiseRndmEngine, |
|
|
CLHEP::HepRandomEngine * |
elecNoiseRndmEngine, |
|
|
CLHEP::HepRandomEngine * |
elecProcRndmEngine |
|
) |
| |
|
private |
Produce pool of pure noise digits (for simulation of noise in unhit straws) and store them in m_digitPool
.
The procedure uses TRTElectronicsProcessing::ProcessDeposits()
, but with no input deposits. This way, we get the noise contribution only. The noise signals are thus originating from the cached vectors TRTElectronicsNoise::m_cachedFastNoiseAfterSignalShaping
[] and TRTElectronicsNoise::m_cachedSlowNoiseAfterSignalShaping
[]
- Parameters
-
lowthresholds | low threshold settings, all straws |
noiseamp | noise amplitudes, all straws |
Definition at line 268 of file TRTNoise.cxx.
275 unsigned int nstraw = lowthresholds.size();
280 std::vector<TRTElectronicsProcessing::Deposit> deposits;
283 unsigned int nokdigits(0);
284 unsigned int ntries(0);
291 if ( ntries%400==0 ) {
299 istraw = CLHEP::RandFlat::shootInt(noiseRndmEngine, nstraw );
305 lowthresholds.at(istraw),
306 noiseamps.at(istraw),
307 strawType.at(istraw),
313 if (
digit.GetDigit() ) {
325 <<
" (efficiency was " <<
static_cast<double>(
m_digitPool.size())/ntries <<
")");
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ simulateNoiseFrequency()
double TRTNoise::simulateNoiseFrequency |
( |
const unsigned int & |
totalNumberOfTests, |
|
|
const double & |
electronicsNoiseAmplitude, |
|
|
double |
lowthreshold = -1.0 |
|
) |
| |
|
private |
◆ sortDigits()
void TRTNoise::sortDigits |
( |
std::vector< TRTDigit > & |
digitVect | ) |
|
|
static |
◆ useLookupTable()
float TRTNoise::useLookupTable |
( |
const float & |
x, |
|
|
const std::vector< float > & |
y_given_x, |
|
|
const float & |
min_x, |
|
|
const float & |
max_x |
|
) |
| |
|
staticprivate |
Return y value corresponding to input x value from LUT.
- Returns
- y: Output y value
- Parameters
-
x | Input x value |
y_given_x | Look-up-table: gives y values for uniformly distributed x values |
min_x | lowest tabulated x value |
max_x | highest tabulated x value |
Definition at line 453 of file TRTNoise.cxx.
459 unsigned int lower_index;
460 double fraction_into_bin;
466 return y_given_x.front();
470 bin_withfrac = (
x-min_x)*(y_given_x.size()-1)/(max_x-min_x);
471 lower_index =
static_cast<unsigned int>(bin_withfrac);
474 if ( lower_index >= y_given_x.size()-1 ) {
475 return y_given_x.back();
479 fraction_into_bin = bin_withfrac - lower_index;
480 return (1.-fraction_into_bin) * y_given_x[lower_index] + fraction_into_bin * y_given_x[lower_index+1];
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_detmgr
◆ m_digitPool
std::vector<unsigned int> TRTNoise::m_digitPool |
|
private |
Pool of noise digits for noise in unhit straws.
Definition at line 145 of file TRTNoise.h.
◆ m_digitPoolLength
unsigned int TRTNoise::m_digitPoolLength |
|
private |
Length of noise digit pool m_digitPool
.
Definition at line 141 of file TRTNoise.h.
◆ m_digitPoolLength_nextaccessindex
unsigned int TRTNoise::m_digitPoolLength_nextaccessindex |
|
private |
Pointer into noise digit pool m_digitPool
.
Definition at line 143 of file TRTNoise.h.
◆ m_id_helper
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_noise_randengine
CLHEP::HepRandomEngine* TRTNoise::m_noise_randengine {} |
|
private |
◆ m_pDigConditions
◆ m_pElectronicsNoise
◆ m_pElectronicsProcessing
◆ m_settings
◆ m_sumTool
◆ m_UseGasMix
int TRTNoise::m_UseGasMix {} |
|
private |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
std::atomic< MSG::Level > m_lvl
Current logging level.
double lowThresholdEC(int strawGasType) const
bool crossTalkNoise(CLHEP::HepRandomEngine *) const
TRTDigCondBase * m_pDigConditions
unsigned int m_digitPoolLength
Length of noise digit pool m_digitPool.
Identifier getStrawIdentifier(int hitID)
struct TRTDigitSorter TRTDigitSorterObject
const TRT_BarrelElement * getBarrelElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
Access Barrel Elements:---------------—(Fast)-------------------------—.
void ProduceNoiseDigitPool(const std::vector< float > &lowthresholds, const std::vector< float > &noiseamps, const std::vector< int > &strawType, CLHEP::HepRandomEngine *noiseRndmEngine, CLHEP::HepRandomEngine *elecNoiseRndmEngine, CLHEP::HepRandomEngine *elecProcRndmEngine)
Produce pool of pure noise digits (for simulation of noise in unhit straws) and store them in m_digit...
bool getNextStraw(int &hitID, float &noiselevel, float &noiseamp)
For looping over all straws: get next straw.
const InDetDD::TRT_DetectorManager * m_detmgr
value_type get_compact() const
Get the compact id.
bool noiseInUnhitStraws() const
Query whether simulation of noise in unhit straws.
#define ATH_MSG_VERBOSE(x)
TRTElectronicsNoise * m_pElectronicsNoise
double relativeLowThresholdFluctuation() const
Get relative low threshold fluctuations (evt to evt & straw to straw)
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
@ u
Enums for curvilinear frames.
IMessageSvc * getMessageSvc(bool quiet=false)
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
void reinitElectronicsNoise(const unsigned int &numberOfDigitLengths, CLHEP::HepRandomEngine *rndmEngine)
Re-initialize electronics noise table.
TRTElectronicsProcessing * m_pElectronicsProcessing
AthMessaging()
Default constructor:
int straw(const Identifier &id) const
bool msgLvl(const MSG::Level lvl) const
Test the output level.
unsigned int totalNumberOfActiveStraws() const
Get total number of active straws.
bool getNextNoisyStraw(CLHEP::HepRandomEngine *, int &hitID, float &noiselevel)
For simulation of noise in unhit straws: get next noisy straw.
double lowThresholdBar(int strawGasType) const
Get discriminator setting for low threshold.
static void evolve_LT2AmpVsNL_to_include_LTfluct(std::vector< float > &nl_given_lt2na, const float &min_lt2na, const float &max_lt2na, const float relativeLTFluct, float &new_min_lt2na, float &new_max_lt2na, const unsigned int &number_new_bins)
Refined noise treatment by allowing for event-by-event fluctuations in the low threshold settings.
virtual Identifier identify() const override final
identifier of this detector element:
static const TRTHitIdHelper * GetHelper()
bool crossTalkNoiseOtherEnd(CLHEP::HepRandomEngine *) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
std::vector< unsigned int > m_digitPool
Pool of noise digits for noise in unhit straws.
int straw_layer(const Identifier &id) const
int layer_or_wheel(const Identifier &id) const
MsgStream & msg() const
The standard message stream.
bool noiseInSimhits() const
Query whether simulation of noise in hit straws.
const TRT_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
int buildHitId(const int, const int, const int, const int, const int, const int) const
const TRT_ID * m_id_helper
int phi_module(const Identifier &id) const
void resetGetNextStraw()
For looping over all straws: Rewind straw list to start from beginning.
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
void ProcessDeposits(const std::vector< Deposit > &, const int &hitID, TRTDigit &outdigit, double lowthreshold, const double &noiseamplitude, int strawGasType, CLHEP::HepRandomEngine *rndmEngine, CLHEP::HepRandomEngine *elecNoiseRndmEngine, double highthreshold=-1.0)
Process deposits in a straw.
#define ATH_MSG_WARNING(x)
void setRefinedStrawParameters(const int &hitID, const double &lowthreshold, const double &noiseamplitude)
Set straw parameters.
std::string m_nm
Message source name.
int StrawGasType(int statusHT, int useGasMix, MsgStream *log)
void resetGetNextNoisyStraw()
For noise in unhit straws: Rewind straw list to start from beginning.
void initMessaging() const
Initialize our message level and MessageSvc.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void getSamplesOfMaxLTOverNoiseAmp(std::vector< float > &maxLTOverNoiseAmp, unsigned long nsamplings, CLHEP::HepRandomEngine *rndmEngine)
From generated (and cached) noise samples, this function returns in vector maxLTOverNoiseAmp the maxi...
const TRTDigSettings * m_settings
unsigned int m_digitPoolLength_nextaccessindex
Pointer into noise digit pool m_digitPool.
static void makeInvertedLookupTable(const std::vector< float > &y_given_x, const float &min_x, const float &max_x, std::vector< float > &x_given_y, float &min_y, float &max_y)
Invert look-up-table: Go from tabulated y values vs.
void InitThresholdsAndNoiseAmplitudes_and_ProduceNoiseDigitPool(CLHEP::HepRandomEngine *noiseRndmEngine, CLHEP::HepRandomEngine *elecNoiseRndmEngine, CLHEP::HepRandomEngine *elecProcRndmEngine)
Initialize thresholds and noise amplitudes.
static float useLookupTable(const float &x, const std::vector< float > &y_given_x, const float &min_x, const float &max_x)
Return y value corresponding to input x value from LUT.
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: