ATLAS Offline Software
RpcFastDigiTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef RPC_DIGITIZATIONR4_RPCFASTDIGITOOL_H
5 #define RPC_DIGITIZATIONR4_RPCFASTDIGITOOL_H
6 
7 
11 
12 
13 #include "GaudiKernel/PhysicalConstants.h"
14 
15 namespace MuonR4{
17  public:
18  using MuonDigitizationTool::MuonDigitizationTool;
19 
20  StatusCode initialize() override final;
21  StatusCode finalize() override final;
22  protected:
23  StatusCode digitize(const EventContext& ctx,
24  const TimedHits& hitsToDigit,
25  xAOD::MuonSimHitContainer* sdoContainer) const override final;
26 
27 
28  private:
30  int m_stIdxBIL{-1}; // Station name index of the BIL stations
31  int m_stIdxBIS{-1}; // Station name index of the BIS stations
32 
40  bool digitizeHit(const TimedHit& simHit,
41  const bool measuresPhi,
42  const Muon::DigitEffiData* effiMap,
43  RpcDigitCollection& outContainer,
44  CLHEP::HepRandomEngine* rndEngine,
45  DeadTimeMap& deadTimes) const;
46 
53  bool digitizeHitBI(const TimedHit& simHit,
54  const Muon::DigitEffiData* effiMap,
55  RpcDigitCollection& outContainer,
56  CLHEP::HepRandomEngine* rndEngine,
57  DeadTimeMap& deadTimes) const;
58 
60  static double timeOverThreshold(CLHEP::HepRandomEngine* rndmEngine) ;
61 
63  SG::WriteHandleKey<RpcDigitContainer> m_writeKey{this, "OutputObjectName", "RPC_DIGITS"};
64 
65  SG::ReadCondHandleKey<Muon::DigitEffiData> m_effiDataKey{this, "EffiDataKey", "RpcDigitEff",
66  "Efficiency constants of the individual Rpc gasGaps"};
67 
68  mutable std::array<std::atomic<unsigned>, 2> m_allHits ATLAS_THREAD_SAFE{};
69  mutable std::array<std::atomic<unsigned>, 2> m_acceptedHits ATLAS_THREAD_SAFE{};
70 
71  Gaudi::Property<double> m_propagationVelocity{this, "propSpeed", 0.5 * Gaudi::Units::c_light,
72  "Propagation speed of the signal inside the strip"}; // in mm/ns
73 
74  Gaudi::Property<double> m_stripTimeResolution{this, "timeResolution", 0.6 * Gaudi::Units::nanosecond,
75  "Estimated time resolution of the strip readout"};
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 #endif
MuonR4::RpcFastDigiTool::m_effiDataKey
SG::ReadCondHandleKey< Muon::DigitEffiData > m_effiDataKey
Definition: RpcFastDigiTool.h:65
MuonR4::RpcFastDigiTool::m_stripTimeResolution
Gaudi::Property< double > m_stripTimeResolution
Definition: RpcFastDigiTool.h:74
MuonR4::RpcFastDigiTool::digitizeHit
bool digitizeHit(const TimedHit &simHit, const bool measuresPhi, const Muon::DigitEffiData *effiMap, RpcDigitCollection &outContainer, CLHEP::HepRandomEngine *rndEngine, DeadTimeMap &deadTimes) const
Digitize the sim hit as Rpc strip 1D hit.
Definition: RpcFastDigiTool.cxx:75
RpcDigitContainer.h
RpcDigitCollection
Definition: RpcDigitCollection.h:17
MuonR4::MuonDigitizationTool::TimedHit
TimedHitPtr< xAOD::MuonSimHit > TimedHit
Definition: MuonDigitizationTool.h:57
MuonR4::RpcFastDigiTool::m_stIdxBIL
int m_stIdxBIL
Definition: RpcFastDigiTool.h:30
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:80
MuonR4::RpcFastDigiTool::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned >, 2 > m_allHits ATLAS_THREAD_SAFE
Definition: RpcFastDigiTool.h:68
python.SystemOfUnits.nanosecond
float nanosecond
Definition: SystemOfUnits.py:134
MuonR4::RpcFastDigiTool::initialize
StatusCode initialize() override final
Definition: RpcFastDigiTool.cxx:18
MuonR4::RpcFastDigiTool
Definition: RpcFastDigiTool.h:16
MuonR4::RpcFastDigiTool::digitizeHitBI
bool digitizeHitBI(const TimedHit &simHit, const Muon::DigitEffiData *effiMap, RpcDigitCollection &outContainer, CLHEP::HepRandomEngine *rndEngine, DeadTimeMap &deadTimes) const
Digitize the sim hit as Rpc strip 2D hit.
Definition: RpcFastDigiTool.cxx:150
MuonR4::RpcFastDigiTool::DigiCache
OutDigitCache_t< RpcDigitCollection > DigiCache
Definition: RpcFastDigiTool.h:62
MuonGMR4::RpcReadoutElement::EdgeSide
EdgeSide
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:109
MuonDigitizationTool.h
MuonR4::RpcFastDigiTool::m_deadTime
Gaudi::Property< double > m_deadTime
Definition: RpcFastDigiTool.h:77
MuonR4::RpcFastDigiTool::m_digitizeMuonOnly
Gaudi::Property< bool > m_digitizeMuonOnly
Definition: RpcFastDigiTool.h:79
SG::WriteHandleKey< RpcDigitContainer >
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonR4::RpcFastDigiTool::m_writeKey
SG::WriteHandleKey< RpcDigitContainer > m_writeKey
Definition: RpcFastDigiTool.h:63
MuonR4::RpcFastDigiTool::m_stIdxBIS
int m_stIdxBIS
Definition: RpcFastDigiTool.h:31
MuonR4::RpcFastDigiTool::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: RpcFastDigiTool.cxx:32
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
columnar::final
CM final
Definition: ColumnAccessor.h:106
MuonR4::RpcFastDigiTool::m_propagationVelocity
Gaudi::Property< double > m_propagationVelocity
Definition: RpcFastDigiTool.h:71
Muon::DigitEffiData
Definition: DigitEffiData.h:23
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:73
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
SG::ReadCondHandleKey< Muon::DigitEffiData >
MuonR4::MuonDigitizationTool
Barebone implementation of the I/O infrastructure for all MuonDigitizationTools.
Definition: MuonDigitizationTool.h:30
MuonR4::MuonDigitizationTool::TimedHits
std::vector< TimedHitPtr< xAOD::MuonSimHit > > TimedHits
Definition: MuonDigitizationTool.h:58
MuonR4::RpcFastDigiTool::finalize
StatusCode finalize() override final
Definition: RpcFastDigiTool.cxx:26
DigitEffiData.h
MuonR4::MuonDigitizationTool::DeadTimeMap
std::unordered_map< Identifier, double > DeadTimeMap
Definition: MuonDigitizationTool.h:100
MuonR4::RpcFastDigiTool::timeOverThreshold
static double timeOverThreshold(CLHEP::HepRandomEngine *rndmEngine)
Roll the time over threshold for each signal digit.
Definition: RpcFastDigiTool.cxx:241