ATLAS Offline Software
TRTNoise.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRT_DIGITIZATION_TRTNOISE_H
6 #define TRT_DIGITIZATION_TRTNOISE_H
7 
8 #include "TRTDigit.h"
9 
13 
14 #include "GaudiKernel/ServiceHandle.h"
15 #include "GaudiKernel/ToolHandle.h"
16 
17 #include "CLHEP/Random/RandomEngine.h"
18 
19 #include <set>
20 #include <vector>
21 
22 class Identifier;
23 class TRTDigCondBase;
26 class TRT_ID;
27 
28 namespace InDetDD {
29  class TRT_DetectorManager;
30 }
31 
32 class TRTDigSettings;
33 
39 class TRTNoise : public AthMessaging {
40 public:
44  TRTNoise( const TRTDigSettings*,
46  CLHEP::HepRandomEngine* noiseRndmEngine,
47  CLHEP::HepRandomEngine* elecNoiseRndmEngine,
48  CLHEP::HepRandomEngine* elecProcRndmEngine,
49  CLHEP::HepRandomEngine* elecNoiseResetRndmEngine,
50  TRTDigCondBase* digcond,
52  TRTElectronicsNoise * electronicsnoise,
53  const TRT_ID* trt_id,
54  int UseGasMix,
55  ToolHandle<ITRT_StrawStatusSummaryTool> sumTool
56  );
57 
69  void appendPureNoiseToProperDigits( std::vector<TRTDigit>& digitVect,
70  const std::set<int>& sim_hitids,
71  CLHEP::HepRandomEngine* noiseRndmEngine) ;
72 
73 
74  void appendCrossTalkNoiseToProperDigits(std::vector<TRTDigit>& digitVect,
75  const std::set<Identifier>& simhitsIdentifiers,
76  const ServiceHandle<ITRT_StrawNeighbourSvc>& m_TRTStrawNeighbourSvc,
77  CLHEP::HepRandomEngine* noiseRndmEngine);
78 
79  static void sortDigits(std::vector<TRTDigit>& digitVect);
80 
82 
83 private:
84 
87 
91  CLHEP::HepRandomEngine* m_noise_randengine{};
92 
93  //--- Initialization:
94 
115  void InitThresholdsAndNoiseAmplitudes_and_ProduceNoiseDigitPool(CLHEP::HepRandomEngine* noiseRndmEngine,
116  CLHEP::HepRandomEngine* elecNoiseRndmEngine,
117  CLHEP::HepRandomEngine* elecProcRndmEngine);
118 
131  void ProduceNoiseDigitPool( const std::vector<float>& lowthresholds,
132  const std::vector<float>& noiseamps,
133  const std::vector<int>& strawType,
134  CLHEP::HepRandomEngine* noiseRndmEngine,
135  CLHEP::HepRandomEngine* elecNoiseRndmEngine,
136  CLHEP::HepRandomEngine* elecProcRndmEngine
137  );
138 
141  unsigned int m_digitPoolLength;
145  std::vector<unsigned int> m_digitPool;
146 
147  double simulateNoiseFrequency( const unsigned int& totalNumberOfTests,
148  const double& electronicsNoiseAmplitude,
149  double lowthreshold = -1.0 );
150 
160  static float useLookupTable(const float& x,
161  const std::vector<float>& y_given_x,
162  const float & min_x,
163  const float & max_x);
164 
176  static void makeInvertedLookupTable( const std::vector<float>& y_given_x,
177  const float & min_x,
178  const float & max_x,
179  std::vector<float>& x_given_y,
180  float & min_y,
181  float & max_y );
199  static void evolve_LT2AmpVsNL_to_include_LTfluct( std::vector<float>& nl_given_lt2na,
200  const float & min_lt2na,
201  const float & max_lt2na,
202  const float relativeLTFluct,
203  float & new_min_lt2na,
204  float & new_max_lt2na,
205  const unsigned int& number_new_bins );
206 
207  Identifier getStrawIdentifier (int hitID);
208 
209  int m_UseGasMix{};
210  ToolHandle<ITRT_StrawStatusSummaryTool> m_sumTool; // need for Argon
211 
212 };
213 
214 #endif
TRTNoise::m_noise_randengine
CLHEP::HepRandomEngine * m_noise_randengine
Definition: TRTNoise.h:91
TRTNoise::m_pDigConditions
TRTDigCondBase * m_pDigConditions
Definition: TRTNoise.h:88
TRTNoise::m_digitPoolLength
unsigned int m_digitPoolLength
Length of noise digit pool m_digitPool.
Definition: TRTNoise.h:141
TRTNoise::getStrawIdentifier
Identifier getStrawIdentifier(int hitID)
Definition: TRTNoise.cxx:585
TRTNoise::sortDigits
static void sortDigits(std::vector< TRTDigit > &digitVect)
Definition: TRTNoise.cxx:447
TRTNoise::ProduceNoiseDigitPool
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...
Definition: TRTNoise.cxx:268
TRTNoise::m_detmgr
const InDetDD::TRT_DetectorManager * m_detmgr
Definition: TRTNoise.h:86
TRTNoise::appendCrossTalkNoiseToProperDigits
void appendCrossTalkNoiseToProperDigits(std::vector< TRTDigit > &digitVect, const std::set< Identifier > &simhitsIdentifiers, const ServiceHandle< ITRT_StrawNeighbourSvc > &m_TRTStrawNeighbourSvc, CLHEP::HepRandomEngine *noiseRndmEngine)
Definition: TRTNoise.cxx:356
TRTElectronicsProcessing
Electronics Processing.
Definition: TRTElectronicsProcessing.h:23
TRTNoise::m_pElectronicsNoise
TRTElectronicsNoise * m_pElectronicsNoise
Definition: TRTNoise.h:90
x
#define x
TRTNoise::m_pElectronicsProcessing
TRTElectronicsProcessing * m_pElectronicsProcessing
Definition: TRTNoise.h:89
TRTElectronicsNoise
Simulate TRT Electronics Noise For description of metod, see Thomas Kittelmanns PhD thesis chapters ...
Definition: TRTElectronicsNoise.h:18
TRTNoise::appendPureNoiseToProperDigits
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.
Definition: TRTNoise.cxx:333
ITRT_StrawStatusSummaryTool.h
abstract interface to TRT straw status constants
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
TRTNoise::TRTNoise
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.
Definition: TRTNoise.cxx:36
TRTNoise::m_UseGasMix
int m_UseGasMix
Definition: TRTNoise.h:209
TRTNoise::~TRTNoise
~TRTNoise()
TRTNoise
Simulation of noise hits in the TRT.
Definition: TRTNoise.h:39
TRTNoise::evolve_LT2AmpVsNL_to_include_LTfluct
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.
Definition: TRTNoise.cxx:539
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
TRTNoise::m_digitPool
std::vector< unsigned int > m_digitPool
Pool of noise digits for noise in unhit straws.
Definition: TRTNoise.h:145
TRTNoise::simulateNoiseFrequency
double simulateNoiseFrequency(const unsigned int &totalNumberOfTests, const double &electronicsNoiseAmplitude, double lowthreshold=-1.0)
TRTDigit.h
TRTNoise::m_id_helper
const TRT_ID * m_id_helper
Definition: TRTNoise.h:139
ITRT_StrawNeighbourSvc.h
Abstract interface to information on straws electronic grouping.
TRTNoise::m_sumTool
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
Definition: TRTNoise.h:210
TRT_ID
Definition: TRT_ID.h:84
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition: TRT_DetectorManager.h:69
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
AthMessaging.h
TRTDigSettings
Class containing parameters and settings used by TRT digitization.
Definition: TRTDigSettings.h:35
TRTNoise::m_settings
const TRTDigSettings * m_settings
Definition: TRTNoise.h:85
TRTNoise::m_digitPoolLength_nextaccessindex
unsigned int m_digitPoolLength_nextaccessindex
Pointer into noise digit pool m_digitPool.
Definition: TRTNoise.h:143
TRTNoise::makeInvertedLookupTable
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.
Definition: TRTNoise.cxx:485
TRTNoise::InitThresholdsAndNoiseAmplitudes_and_ProduceNoiseDigitPool
void InitThresholdsAndNoiseAmplitudes_and_ProduceNoiseDigitPool(CLHEP::HepRandomEngine *noiseRndmEngine, CLHEP::HepRandomEngine *elecNoiseRndmEngine, CLHEP::HepRandomEngine *elecProcRndmEngine)
Initialize thresholds and noise amplitudes.
Definition: TRTNoise.cxx:69
TRTNoise::useLookupTable
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.
Definition: TRTNoise.cxx:453
ServiceHandle< ITRT_StrawNeighbourSvc >
TRTDigCondBase
Communication with CondDB.
Definition: TRTDigCondBase.h:32