ATLAS Offline Software
TgcDigitMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
12 #ifndef TGCDIGITMAKER_H
13 #define TGCDIGITMAKER_H
14 
15 #include <string>
16 #include <vector>
17 
19 #include "GaudiKernel/StatusCode.h"
21 #include "Identifier/Identifier.h"
25 
26 namespace CLHEP {
27 class HepRandomEngine;
28 }
29 
30 namespace MuonGM {
31 class MuonDetectorManager;
32 }
33 
34 class TgcDigitCollection;
35 class TgcHitIdHelper;
36 class TgcIdHelper;
37 class TGCSimHit;
38 
39 //--- class description
40 class TgcDigitMaker : public AthMessaging {
41  public:
42  TgcDigitMaker(const TgcHitIdHelper* hitIdHelper,
43  const MuonGM::MuonDetectorManager* mdManager,
44  const bool doFourBunch);
45 
46  virtual ~TgcDigitMaker() = default;
47 
55 
77  const double globalHitTime,
78  const TgcDigitASDposData* ASDpos,
79  const TgcDigitTimeOffsetData* TOffset,
80  const TgcDigitCrosstalkData* Crosstalk,
81  CLHEP::HepRandomEngine* rndmEngine);
82 
83  //====== for private
84  private:
92  N_GASGAP = 3,
94  N_ISSTRIP = 2,
100  };
102  enum TgcSensor { kWIRE = 0, kSTRIP, N_SENSOR };
103 
112  float timeJitter(const Amg::Vector3D&,
113  CLHEP::HepRandomEngine* rndmEngine) const;
114 
118  bool efficiencyCheck(const TgcSensor sensor,
119  CLHEP::HepRandomEngine* rndmEngine) const;
120  bool efficiencyCheck(const std::string& stationName, const int stationEta,
121  const int stationPhi, const int gasGap,
122  const TgcSensor sensor,
123  const double energyDeposit) const;
124 
125  uint16_t bcTagging(const double digittime, const double window,
126  const double offset) const;
127  static void addDigit(const Identifier id, const uint16_t bctag,
128  TgcDigitCollection* digits) ;
129 
136 
138  double getEnergyThreshold(const std::string& stationName, int stationEta,
139  int stationPhi, int gasGap,
140  const TgcSensor sensor) const;
141  void randomCrossTalk(const TgcDigitCrosstalkData* crosstalk,
142  const Identifier elemId, const int gasGap,
143  const TgcSensor sensor, const int channel,
144  const float posInStrip, const float digitTime,
145  const float time_offset,
146  CLHEP::HepRandomEngine* rndmEngine,
147  TgcDigitCollection* digits) const;
149  bool isDeadChamber(const std::string& stationName, int stationEta,
150  int stationPhi, int gasGap);
152  static int getIStationName(const std::string& staionName) ;
154  float getStripPosition(const std::string& stationName, int stationEta,
155  int channel) const;
157  static double getSigPropTimeDelay(const float cableDistance) ;
159  static float timeDiffByCableRadiusOfInner(const int iStationName,
160  const int stationPhi,
161  const int channel) ;
163  float getDistanceToAsdFromSensor(const TgcDigitASDposData* readCdo,
164  const int iStationName,
165  const int stationEta, const int stationPhi,
166  const TgcSensor sensor, const int channel,
167  const float position) const;
169  static float getTimeOffset(const TgcDigitTimeOffsetData* readCdo,
170  const uint16_t station_num, const int station_eta,
171  const TgcSensor sensor) ;
173  static float getCrosstalkProbability(const TgcDigitCrosstalkData* readCdo,
174  const uint16_t layer_id,
175  const TgcSensor sensor,
176  const unsigned int index_prob) ;
177 
179  unsigned int getRunPeriod() const;
180 
183  [N_GASGAP][N_ISSTRIP]{};
186 
189 
190  std::vector<std::vector<float> > m_vecAngle_Time;
191 
194  m_mdManager{}; // cannot use ReadCondHandleKey since no athena component
197 
206 
209 };
210 
211 #endif
TgcDigitMaker
Definition: TgcDigitMaker.h:40
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:161
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
TgcDigitMaker::N_STATION
@ N_STATION
Definition: TgcDigitMaker.h:101
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
TgcDigitMaker::m_StripPos
float m_StripPos[N_STATIONNAME][N_ABSSTATIONETA][N_STRIPCHANNEL]
Position of Strip Channel (Longer base or Shorter base)
Definition: TgcDigitMaker.h:188
TgcDigitASDposData.h
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TgcDigitMaker::readFileOfDeadChamber
StatusCode readFileOfDeadChamber()
Read share/TGC_Digitization_deadChamber.dat file.
Definition: TgcDigitMaker.cxx:817
TgcDigitMaker::getTimeOffset
static float getTimeOffset(const TgcDigitTimeOffsetData *readCdo, const uint16_t station_num, const int station_eta, const TgcSensor sensor)
Method to get time offset to absorb signal delay.
Definition: TgcDigitMaker.cxx:1225
TgcDigitTimeOffsetData
Definition: TgcDigitTimeOffsetData.h:20
TgcDigitMaker::kOUTER
@ kOUTER
Definition: TgcDigitMaker.h:101
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
TgcDigitMaker::TgcDigitMaker
TgcDigitMaker(const TgcHitIdHelper *hitIdHelper, const MuonGM::MuonDetectorManager *mdManager, const bool doFourBunch)
Definition: TgcDigitMaker.cxx:37
TgcIdHelper
Definition: TgcIdHelper.h:50
TgcDigitMaker::TgcSensor
TgcSensor
Definition: TgcDigitMaker.h:102
TgcDigitMaker::OFFSET_STRIPCHANNEL
@ OFFSET_STRIPCHANNEL
Definition: TgcDigitMaker.h:99
TgcDigitMaker::getStripPosition
float getStripPosition(const std::string &stationName, int stationEta, int channel) const
Method to get position of Strip channel.
Definition: TgcDigitMaker.cxx:1156
TgcDigitCrosstalkData
Definition: TgcDigitCrosstalkData.h:22
TgcDigitMaker::getDistanceToAsdFromSensor
float getDistanceToAsdFromSensor(const TgcDigitASDposData *readCdo, const int iStationName, const int stationEta, const int stationPhi, const TgcSensor sensor, const int channel, const float position) const
Method to get propagation time to the ASD from the sensor.
Definition: TgcDigitMaker.cxx:1197
TgcDigitMaker::getRunPeriod
unsigned int getRunPeriod() const
Determine the run period.
Definition: TgcDigitMaker.cxx:773
TgcDigitMaker::readFileOfEnergyThreshold
StatusCode readFileOfEnergyThreshold()
Read share/TGC_Digitization_energyThreshold.dat file.
Definition: TgcDigitMaker.cxx:693
TgcDigitMaker::m_mdManager
const MuonGM::MuonDetectorManager * m_mdManager
Definition: TgcDigitMaker.h:194
TgcDigitMaker::OFFSET_STATIONPHI
@ OFFSET_STATIONPHI
Definition: TgcDigitMaker.h:91
TgcDigitMaker::timeDiffByCableRadiusOfInner
static float timeDiffByCableRadiusOfInner(const int iStationName, const int stationPhi, const int channel)
Method to get time difference by cable radius of inner.
Definition: TgcDigitMaker.cxx:1177
Trk::energyDeposit
@ energyDeposit
Definition: MeasurementType.h:32
TgcHitIdHelper
Definition: TgcHitIdHelper.h:13
TgcDigitMaker::OFFSET_STATIONNAME
@ OFFSET_STATIONNAME
Definition: TgcDigitMaker.h:87
TgcDigitMaker::OFFSET_ISSTRIP
@ OFFSET_ISSTRIP
Definition: TgcDigitMaker.h:95
TgcDigitMaker::initialize
StatusCode initialize()
Initializes TgcHitIdHelper, TgcIdHelper and random number of a stream for the digitization.
Definition: TgcDigitMaker.cxx:59
TgcDigitMaker::N_STATIONETA
@ N_STATIONETA
Definition: TgcDigitMaker.h:88
GeoPrimitives.h
TgcDigitMaker::N_SENSOR
@ N_SENSOR
Definition: TgcDigitMaker.h:102
TgcDigitMaker::kINNER
@ kINNER
Definition: TgcDigitMaker.h:101
TgcDigitMaker::OFFSET_ABSSTATIONETA
@ OFFSET_ABSSTATIONETA
Definition: TgcDigitMaker.h:97
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TgcDigitMaker::~TgcDigitMaker
virtual ~TgcDigitMaker()=default
TgcDigitMaker::m_hitIdHelper
const TgcHitIdHelper * m_hitIdHelper
Definition: TgcDigitMaker.h:192
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TgcDigitCollection
Definition: TgcDigitCollection.h:17
TgcDigitMaker::N_ISSTRIP
@ N_ISSTRIP
Definition: TgcDigitMaker.h:94
TgcDigitMaker::efficiencyCheck
bool efficiencyCheck(const TgcSensor sensor, CLHEP::HepRandomEngine *rndmEngine) const
Determines whether a hit is detected or not.
Definition: TgcDigitMaker.cxx:630
TgcDigitMaker::m_gateTimeWindow
double m_gateTimeWindow[N_STATION][N_SENSOR]
define the time windows for signals from wiregangs and strips.
Definition: TgcDigitMaker.h:204
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
TgcDigitMaker::m_vecAngle_Time
std::vector< std::vector< float > > m_vecAngle_Time
Definition: TgcDigitMaker.h:190
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
TgcDigitMaker::N_ABSSTATIONETA
@ N_ABSSTATIONETA
Definition: TgcDigitMaker.h:96
TgcDigitMaker::randomCrossTalk
void randomCrossTalk(const TgcDigitCrosstalkData *crosstalk, const Identifier elemId, const int gasGap, const TgcSensor sensor, const int channel, const float posInStrip, const float digitTime, const float time_offset, CLHEP::HepRandomEngine *rndmEngine, TgcDigitCollection *digits) const
Definition: TgcDigitMaker.cxx:1014
TgcDigitASDposData
Definition: TgcDigitASDposData.h:24
TgcDigitMaker::addDigit
static void addDigit(const Identifier id, const uint16_t bctag, TgcDigitCollection *digits)
Definition: TgcDigitMaker.cxx:673
TgcDigitCrosstalkData.h
TgcDigitMaker::kWIRE
@ kWIRE
Definition: TgcDigitMaker.h:102
TgcDigitMaker::N_STRIPCHANNEL
@ N_STRIPCHANNEL
Definition: TgcDigitMaker.h:98
TgcDigitMaker::NumberOfDimensions
NumberOfDimensions
Definition: TgcDigitMaker.h:85
TgcDigitMaker::TgcStation
TgcStation
Definition: TgcDigitMaker.h:101
TgcDigitMaker::readFileOfStripPosition
StatusCode readFileOfStripPosition()
Read share/TGC_Digitization_StripPosition.dat file.
Definition: TgcDigitMaker.cxx:916
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TGCSimHit
Definition: TGCSimHit.h:19
TgcDigitMaker::OFFSET_STATIONETA
@ OFFSET_STATIONETA
Definition: TgcDigitMaker.h:89
CalibCoolCompareRT.station_eta
station_eta
Definition: CalibCoolCompareRT.py:88
TgcDigitMaker::N_STATIONPHI
@ N_STATIONPHI
Definition: TgcDigitMaker.h:90
TgcDigitMaker::getIStationName
static int getIStationName(const std::string &staionName)
Get stationName integer from stationName string.
Definition: TgcDigitMaker.cxx:1134
TgcDigitMaker::executeDigi
TgcDigitCollection * executeDigi(const TGCSimHit *hit, const double globalHitTime, const TgcDigitASDposData *ASDpos, const TgcDigitTimeOffsetData *TOffset, const TgcDigitCrosstalkData *Crosstalk, CLHEP::HepRandomEngine *rndmEngine)
A single hit can be digitized in the two directions independently: R and phi directions.
Definition: TgcDigitMaker.cxx:88
TgcDigitMaker::m_energyThreshold
double m_energyThreshold[N_STATIONNAME][N_STATIONETA][N_STATIONPHI][N_GASGAP][N_ISSTRIP]
Energy threshold value for each chamber.
Definition: TgcDigitMaker.h:183
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
TgcDigitMaker::OFFSET_GASGAP
@ OFFSET_GASGAP
Definition: TgcDigitMaker.h:93
TgcDigitMaker::N_STATIONNAME
@ N_STATIONNAME
Definition: TgcDigitMaker.h:86
AthMessaging.h
TgcDigitMaker::kSTRIP
@ kSTRIP
Definition: TgcDigitMaker.h:102
TgcDigitMaker::N_GASGAP
@ N_GASGAP
Definition: TgcDigitMaker.h:92
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TgcDigitMaker::m_bunchCrossingTime
double m_bunchCrossingTime
Definition: TgcDigitMaker.h:205
TgcDigitMaker::m_efficiency
float m_efficiency[N_SENSOR]
Definition: TgcDigitMaker.h:196
TgcDigitMaker::getEnergyThreshold
double getEnergyThreshold(const std::string &stationName, int stationEta, int stationPhi, int gasGap, const TgcSensor sensor) const
Get energy threshold value for each chamber.
Definition: TgcDigitMaker.cxx:978
TgcDigitTimeOffsetData.h
TgcDigitMaker::m_isDeadChamber
bool m_isDeadChamber[N_STATIONNAME][N_STATIONETA][N_STATIONPHI][N_GASGAP]
Dead chamber flag for each chamber.
Definition: TgcDigitMaker.h:185
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
TgcDigitMaker::readFileOfTimeJitter
StatusCode readFileOfTimeJitter()
Reads parameters for intrinsic time response from timejitter.dat.
Definition: TgcDigitMaker.cxx:548
TgcDigitMaker::m_doFourBunchDigitization
bool m_doFourBunchDigitization
Activate four bunch digitization.
Definition: TgcDigitMaker.h:208
TgcDigitMaker::getCrosstalkProbability
static float getCrosstalkProbability(const TgcDigitCrosstalkData *readCdo, const uint16_t layer_id, const TgcSensor sensor, const unsigned int index_prob)
Method to get the channel crosstalk probability.
Definition: TgcDigitMaker.cxx:1236
TgcDigitMaker::m_idHelper
const TgcIdHelper * m_idHelper
Definition: TgcDigitMaker.h:195
TgcDigitMaker::bcTagging
uint16_t bcTagging(const double digittime, const double window, const double offset) const
Definition: TgcDigitMaker.cxx:649
TgcDigitMaker::isDeadChamber
bool isDeadChamber(const std::string &stationName, int stationEta, int stationPhi, int gasGap)
Method to check a chamber is dead or active.
Definition: TgcDigitMaker.cxx:1101
TgcDigitMaker::getSigPropTimeDelay
static double getSigPropTimeDelay(const float cableDistance)
Method to get signal propagation time delay.
Definition: TgcDigitMaker.cxx:1191
TgcDigitMaker::timeJitter
float timeJitter(const Amg::Vector3D &, CLHEP::HepRandomEngine *rndmEngine) const
Calculates intrinsic time response according to incident angle of a track based on time response para...
Definition: TgcDigitMaker.cxx:598
Identifier
Definition: IdentifierFieldParser.cxx:14