ATLAS Offline Software
sTgcFastDigiTool.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 STGC_DIGITIZATIONR4_STGCFASTDIGITOOL_H
5 #define STGC_DIGITIZATIONR4_STGCFASTDIGITOOL_H
6 
7 
12 
13 namespace MuonR4{
14  class sTgcFastDigiTool final: public MuonDigitizationTool {
15  public:
16  sTgcFastDigiTool(const std::string& type, const std::string& name, const IInterface* pIID);
17 
18  StatusCode initialize() override final;
19  StatusCode finalize() override final;
20  protected:
21  StatusCode digitize(const EventContext& ctx,
22  const TimedHits& hitsToDigit,
23  xAOD::MuonSimHitContainer* sdoContainer) const override final;
24  private:
25 
26  bool digitizeStrip(const EventContext& ctx,
27  const TimedHit& timedHit,
28  const NswErrorCalibData* errorCalibDB,
29  const Muon::DigitEffiData* effiData,
30  CLHEP::HepRandomEngine* rndEngine,
31  sTgcDigitCollection& outCollection) const;
32 
33  bool digitizeWire(const EventContext& ctx,
34  const TimedHit& timedHit,
35  const Muon::DigitEffiData* effiData,
36  CLHEP::HepRandomEngine* rndEngine,
37  sTgcDigitCollection& outCollection) const;
38 
39  bool digitizePad(const EventContext& ctx,
40  const TimedHit& timedHit,
41  const Muon::DigitEffiData* effiData,
42  CLHEP::HepRandomEngine* rndEngine,
43  sTgcDigitCollection& outCollection) const;
44 
49  int associateBCIdTag(const EventContext& ctx,
50  const TimedHit& timedHit) const;
51 
52 
53 
55  SG::WriteHandleKey<sTgcDigitContainer> m_writeKey{this, "OutputObjectName", "sTGC_DIGITS"};
56 
57  SG::ReadCondHandleKey<Muon::DigitEffiData> m_effiDataKey{this, "EffiDataKey", "sTgcDigitEff",
58  "Efficiency constants of the individual sTgc gasGaps"};
59 
60 
61  SG::ReadCondHandleKey<NswErrorCalibData> m_uncertCalibKey{this, "ErrorCalibKey", "NswUncertData",
62  "Key of the parametrized NSW uncertainties"};
63 
64  mutable std::array<std::atomic<unsigned>, 3> m_allHits ATLAS_THREAD_SAFE{};
65  mutable std::array<std::atomic<unsigned>, 3> m_acceptedHits ATLAS_THREAD_SAFE{};
66 
67  Gaudi::Property<bool> m_digitizeStrip{this, "doStrips", true, "Digitize strip hits"};
68  Gaudi::Property<bool> m_digitizeWire{this, "doWires", true, "Digitize wire hits"};
69  Gaudi::Property<bool> m_digitizePads{this, "doPads", false, "Digitize pad hits"};
70 
71  Gaudi::Property<double> m_deadTime{this, "deadTime", 300. * Gaudi::Units::ns};
72 
73  Gaudi::Property<bool> m_digitizeMuonOnly{this, "ProcessTrueMuonsOnly", false,
74  "If set to true hit with pdgId != 13 are skipped"};
75 
76  };
77 }
78 #endif
NswErrorCalibData
Definition: NswErrorCalibData.h:19
MuonR4::sTgcFastDigiTool::initialize
StatusCode initialize() override final
Definition: sTgcFastDigiTool.cxx:19
MuonR4::sTgcFastDigiTool::m_effiDataKey
SG::ReadCondHandleKey< Muon::DigitEffiData > m_effiDataKey
Definition: sTgcFastDigiTool.h:57
MuonR4::sTgcFastDigiTool::m_digitizeMuonOnly
Gaudi::Property< bool > m_digitizeMuonOnly
Definition: sTgcFastDigiTool.h:73
MuonR4::sTgcFastDigiTool::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: sTgcFastDigiTool.cxx:36
MuonR4::sTgcFastDigiTool::associateBCIdTag
int associateBCIdTag(const EventContext &ctx, const TimedHit &timedHit) const
: Associates the global bcIdTag to the digit
Definition: sTgcFastDigiTool.cxx:282
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::sTgcFastDigiTool
Definition: sTgcFastDigiTool.h:14
MuonR4::sTgcFastDigiTool::m_writeKey
SG::WriteHandleKey< sTgcDigitContainer > m_writeKey
Definition: sTgcFastDigiTool.h:55
MuonDigitizationTool.h
MuonR4::sTgcFastDigiTool::m_uncertCalibKey
SG::ReadCondHandleKey< NswErrorCalibData > m_uncertCalibKey
Definition: sTgcFastDigiTool.h:61
MuonR4::sTgcFastDigiTool::m_digitizePads
Gaudi::Property< bool > m_digitizePads
Definition: sTgcFastDigiTool.h:69
SG::WriteHandleKey< sTgcDigitContainer >
MuonR4::sTgcFastDigiTool::m_deadTime
Gaudi::Property< double > m_deadTime
Definition: sTgcFastDigiTool.h:71
sTgcDigitCollection
Definition: sTgcDigitCollection.h:18
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
NswErrorCalibData.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
MuonR4::sTgcFastDigiTool::digitizeWire
bool digitizeWire(const EventContext &ctx, const TimedHit &timedHit, const Muon::DigitEffiData *effiData, CLHEP::HepRandomEngine *rndEngine, sTgcDigitCollection &outCollection) const
Definition: sTgcFastDigiTool.cxx:200
MuonR4::sTgcFastDigiTool::DigiCache
OutDigitCache_t< sTgcDigitCollection > DigiCache
Definition: sTgcFastDigiTool.h:54
Muon::DigitEffiData
Definition: DigitEffiData.h:23
MuonR4::sTgcFastDigiTool::finalize
StatusCode finalize() override final
Definition: sTgcFastDigiTool.cxx:26
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonR4::sTgcFastDigiTool::m_digitizeWire
Gaudi::Property< bool > m_digitizeWire
Definition: sTgcFastDigiTool.h:68
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::sTgcFastDigiTool::digitizeStrip
bool digitizeStrip(const EventContext &ctx, const TimedHit &timedHit, const NswErrorCalibData *errorCalibDB, const Muon::DigitEffiData *effiData, CLHEP::HepRandomEngine *rndEngine, sTgcDigitCollection &outCollection) const
Definition: sTgcFastDigiTool.cxx:83
SG::ReadCondHandleKey< Muon::DigitEffiData >
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
sTgcDigitContainer.h
DigitEffiData.h
MuonR4::sTgcFastDigiTool::m_digitizeStrip
Gaudi::Property< bool > m_digitizeStrip
Definition: sTgcFastDigiTool.h:67
MuonR4::sTgcFastDigiTool::sTgcFastDigiTool
sTgcFastDigiTool(const std::string &type, const std::string &name, const IInterface *pIID)
Definition: sTgcFastDigiTool.cxx:16
MuonR4::sTgcFastDigiTool::digitizePad
bool digitizePad(const EventContext &ctx, const TimedHit &timedHit, const Muon::DigitEffiData *effiData, CLHEP::HepRandomEngine *rndEngine, sTgcDigitCollection &outCollection) const
Definition: sTgcFastDigiTool.cxx:288
MuonR4::sTgcFastDigiTool::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned >, 3 > m_allHits ATLAS_THREAD_SAFE
Definition: sTgcFastDigiTool.h:64