ATLAS Offline Software
TgcFastDigiTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TGC_DIGITIZATIONR4_TGCFASTDIGITOOL_H
5 #define TGC_DIGITIZATIONR4_TGCFASTDIGITOOL_H
6 
7 
11 
12 namespace MuonR4{
13  class TgcFastDigiTool final: public MuonDigitizationTool {
14  public:
15  TgcFastDigiTool(const std::string& type, const std::string& name, const IInterface* pIID);
16 
17  StatusCode initialize() override final;
18  StatusCode finalize() override final;
19  protected:
20  StatusCode digitize(const EventContext& ctx,
21  const TimedHits& hitsToDigit,
22  xAOD::MuonSimHitContainer* sdoContainer) const override final;
23 
24 
25  private:
36  bool digitizeWireHit(const EventContext& ctx,
37  const TimedHit& timedHit,
38  const Muon::DigitEffiData* efficiencyMap,
39  TgcDigitCollection& outColl,
40  CLHEP::HepRandomEngine* rndEngine,
41  DeadTimeMap& deadTimes) const;
42 
53  bool digitizeStripHit(const EventContext& ctx,
54  const TimedHit& timedHit,
55  const Muon::DigitEffiData* efficiencyMap,
56  TgcDigitCollection& outColl,
57  CLHEP::HepRandomEngine* rndEngine,
58  DeadTimeMap& deadTimes) const;
59 
64  int associateBCIdTag(const EventContext& ctx,
65  const TimedHit& timedHit) const;
66 
68 
69  SG::WriteHandleKey<TgcDigitContainer> m_writeKey{this, "OutputObjectName", "TGC_DIGITS"};
70 
71  SG::ReadCondHandleKey<Muon::DigitEffiData> m_effiDataKey{this, "EffiDataKey", "TgcDigitEff",
72  "Efficiency constants of the individual Rpc gasGaps"};
73 
74  mutable std::array<std::atomic<unsigned>, 2> m_allHits ATLAS_THREAD_SAFE{};
75  mutable std::array<std::atomic<unsigned>, 2> m_acceptedHits ATLAS_THREAD_SAFE{};
76 
77  Gaudi::Property<double> m_deadTime{this, "deadTime", 100.*Gaudi::Units::nanosecond};
78 
79  Gaudi::Property<bool> m_digitizeMuonOnly{this, "ProcessTrueMuonsOnly", false,
80  "If set to true hit with pdgId != 13 are skipped"};
81 
82 
83  };
84 }
85 #endif
MuonR4::TgcFastDigiTool::m_effiDataKey
SG::ReadCondHandleKey< Muon::DigitEffiData > m_effiDataKey
Definition: TgcFastDigiTool.h:71
MuonR4::TgcFastDigiTool::m_digitizeMuonOnly
Gaudi::Property< bool > m_digitizeMuonOnly
Definition: TgcFastDigiTool.h:79
MuonR4::TgcFastDigiTool::initialize
StatusCode initialize() override final
Definition: TgcFastDigiTool.cxx:18
python.SystemOfUnits.nanosecond
int nanosecond
Definition: SystemOfUnits.py:119
MuonR4::TgcFastDigiTool
Definition: TgcFastDigiTool.h:13
MuonR4::TgcFastDigiTool::digitizeStripHit
bool digitizeStripHit(const EventContext &ctx, const TimedHit &timedHit, const Muon::DigitEffiData *efficiencyMap, TgcDigitCollection &outColl, CLHEP::HepRandomEngine *rndEngine, DeadTimeMap &deadTimes) const
Digitize the strip hit by smearing the truth hit position according to the wire group pitch and then ...
Definition: TgcFastDigiTool.cxx:109
MuonR4::TgcFastDigiTool::DigiCache
OutDigitCache_t< TgcDigitCollection > DigiCache
Definition: TgcFastDigiTool.h:67
MuonR4::MuonDigitizationTool::OutDigitCache_t
std::vector< std::unique_ptr< DetType > > OutDigitCache_t
DigitContainers are sorted by DigitCollections which are the ensemble of all hits in a given MuonCham...
Definition: MuonDigitizationTool.h:109
TimedHitPtr< xAOD::MuonSimHit >
MuonR4::TgcFastDigiTool::TgcFastDigiTool
TgcFastDigiTool(const std::string &type, const std::string &name, const IInterface *pIID)
Definition: TgcFastDigiTool.cxx:15
MuonR4::TgcFastDigiTool::associateBCIdTag
int associateBCIdTag(const EventContext &ctx, const TimedHit &timedHit) const
: Associates the global bcIdTag to the digit
Definition: TgcFastDigiTool.cxx:31
MuonDigitizationTool.h
MuonR4::TgcFastDigiTool::finalize
StatusCode finalize() override final
Definition: TgcFastDigiTool.cxx:24
MuonR4::TgcFastDigiTool::digitize
StatusCode digitize(const EventContext &ctx, const TimedHits &hitsToDigit, xAOD::MuonSimHitContainer *sdoContainer) const override final
Digitize the time ordered hits and write them to the digit format specific for the detector technolog...
Definition: TgcFastDigiTool.cxx:201
SG::WriteHandleKey< TgcDigitContainer >
MuonR4::TgcFastDigiTool::m_deadTime
Gaudi::Property< double > m_deadTime
Definition: TgcFastDigiTool.h:77
MuonR4::TgcFastDigiTool::digitizeWireHit
bool digitizeWireHit(const EventContext &ctx, const TimedHit &timedHit, const Muon::DigitEffiData *efficiencyMap, TgcDigitCollection &outColl, CLHEP::HepRandomEngine *rndEngine, DeadTimeMap &deadTimes) const
Digitize the wire hit by smearing the truth hit position according to the wire group pitch and then a...
Definition: TgcFastDigiTool.cxx:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TgcDigitCollection
Definition: TgcDigitCollection.h:17
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Muon::DigitEffiData
Definition: DigitEffiData.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
SG::ReadCondHandleKey< Muon::DigitEffiData >
MuonR4::TgcFastDigiTool::m_writeKey
SG::WriteHandleKey< TgcDigitContainer > m_writeKey
Definition: TgcFastDigiTool.h:69
MuonR4::MuonDigitizationTool
Barebone implementation of the I/O infrastructure for all MuonDigitizationTools.
Definition: MuonDigitizationTool.h:41
MuonR4::MuonDigitizationTool::TimedHits
std::vector< TimedHitPtr< xAOD::MuonSimHit > > TimedHits
Definition: MuonDigitizationTool.h:71
MuonR4::TgcFastDigiTool::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned >, 2 > m_allHits ATLAS_THREAD_SAFE
Definition: TgcFastDigiTool.h:74
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DigitEffiData.h
MuonR4::MuonDigitizationTool::DeadTimeMap
std::unordered_map< Identifier, double > DeadTimeMap
Definition: MuonDigitizationTool.h:129
TgcDigitContainer.h