ATLAS Offline Software
RpcFastDigiTool.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 RPC_DIGITIZATIONR4_RPCFASTDIGITOOL_H
5 #define RPC_DIGITIZATIONR4_RPCFASTDIGITOOL_H
6 
7 
12 
13 #include "GaudiKernel/PhysicalConstants.h"
14 
15 namespace MuonR4{
16  class RpcFastDigiTool final: public MuonDigitizationTool {
17  public:
18  RpcFastDigiTool(const std::string& type, const std::string& name, const IInterface* pIID);
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 
43  bool digitizeHit(const Identifier& gasGapId,
44  const bool measuresPhi,
45  const MuonGMR4::RpcReadoutElement& reEle,
46  const double hitTime,
47  const Amg::Vector2D& locPos,
48  const Muon::DigitEffiData* effiMap,
49  RpcDigitCollection& outContainer,
50  CLHEP::HepRandomEngine* rndEngine,
51  DeadTimeMap& deadTimes) const;
52 
62  bool digitizeHitBI(const Identifier& gasGapId,
63  const MuonGMR4::RpcReadoutElement& reEle,
64  const double hitTime,
65  const Amg::Vector2D& locPos,
66  const Muon::DigitEffiData* effiMap,
67  RpcDigitCollection& outContainer,
68  CLHEP::HepRandomEngine* rndEngine,
69  DeadTimeMap& deadTimes) const;
70 
72  static double timeOverThreshold(CLHEP::HepRandomEngine* rndmEngine) ;
73 
75  SG::WriteHandleKey<RpcDigitContainer> m_writeKey{this, "OutputObjectName", "RPC_DIGITS"};
76 
77  SG::ReadCondHandleKey<Muon::DigitEffiData> m_effiDataKey{this, "EffiDataKey", "RpcDigitEff",
78  "Efficiency constants of the individual Rpc gasGaps"};
79 
80  mutable std::array<std::atomic<unsigned>, 2> m_allHits ATLAS_THREAD_SAFE{};
81  mutable std::array<std::atomic<unsigned>, 2> m_acceptedHits ATLAS_THREAD_SAFE{};
82 
83  Gaudi::Property<double> m_propagationVelocity{this, "propSpeed", 0.5 * Gaudi::Units::c_light,
84  "Propagation speed of the signal inside the strip"}; // in mm/ns
85 
86  Gaudi::Property<double> m_stripTimeResolution{this, "timeResolution", 0.6 * Gaudi::Units::nanosecond,
87  "Estimated time resolution of the strip readout"};
88 
89  Gaudi::Property<double> m_deadTime{this, "deadTime", 100.*Gaudi::Units::nanosecond};
90 
91  Gaudi::Property<bool> m_digitizeMuonOnly{this, "ProcessTrueMuonsOnly", false,
92  "If set to true hit with pdgId != 13 are skipped"};
93 
94  };
95 }
96 #endif
MuonR4::RpcFastDigiTool::m_effiDataKey
SG::ReadCondHandleKey< Muon::DigitEffiData > m_effiDataKey
Definition: RpcFastDigiTool.h:77
MuonR4::RpcFastDigiTool::m_stripTimeResolution
Gaudi::Property< double > m_stripTimeResolution
Definition: RpcFastDigiTool.h:86
python.SystemOfUnits.nanosecond
int nanosecond
Definition: SystemOfUnits.py:119
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
RpcDigitContainer.h
RpcDigitCollection
Definition: RpcDigitCollection.h:17
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:109
MuonR4::RpcFastDigiTool::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned >, 2 > m_allHits ATLAS_THREAD_SAFE
Definition: RpcFastDigiTool.h:80
MuonR4::RpcFastDigiTool::initialize
StatusCode initialize() override final
Definition: RpcFastDigiTool.cxx:20
MuonR4::RpcFastDigiTool
Definition: RpcFastDigiTool.h:16
MuonR4::RpcFastDigiTool::DigiCache
OutDigitCache_t< RpcDigitCollection > DigiCache
Definition: RpcFastDigiTool.h:74
MuonGMR4::RpcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:17
MuonGMR4::RpcReadoutElement::EdgeSide
EdgeSide
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:107
MuonDigitizationTool.h
MuonR4::RpcFastDigiTool::RpcFastDigiTool
RpcFastDigiTool(const std::string &type, const std::string &name, const IInterface *pIID)
Definition: RpcFastDigiTool.cxx:17
MuonR4::RpcFastDigiTool::m_deadTime
Gaudi::Property< double > m_deadTime
Definition: RpcFastDigiTool.h:89
MuonR4::RpcFastDigiTool::m_digitizeMuonOnly
Gaudi::Property< bool > m_digitizeMuonOnly
Definition: RpcFastDigiTool.h:91
SG::WriteHandleKey< RpcDigitContainer >
MuonR4::RpcFastDigiTool::digitizeHitBI
bool digitizeHitBI(const Identifier &gasGapId, const MuonGMR4::RpcReadoutElement &reEle, const double hitTime, const Amg::Vector2D &locPos, const Muon::DigitEffiData *effiMap, RpcDigitCollection &outContainer, CLHEP::HepRandomEngine *rndEngine, DeadTimeMap &deadTimes) const
Digitize the sim hit as Rpc strip 2D hit.
Definition: RpcFastDigiTool.cxx:159
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:75
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:34
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
MuonR4::RpcFastDigiTool::m_propagationVelocity
Gaudi::Property< double > m_propagationVelocity
Definition: RpcFastDigiTool.h:83
Muon::DigitEffiData
Definition: DigitEffiData.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
RpcReadoutElement.h
MuonR4::MuonDigitizationTool::hitTime
static double hitTime(const TimedHit &hit)
Returns the global time of the hit which is the sum of eventTime & individual hit time.
Definition: MuonDigitizationTool.cxx:69
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:41
MuonR4::MuonDigitizationTool::TimedHits
std::vector< TimedHitPtr< xAOD::MuonSimHit > > TimedHits
Definition: MuonDigitizationTool.h:71
MuonR4::RpcFastDigiTool::finalize
StatusCode finalize() override final
Definition: RpcFastDigiTool.cxx:28
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DigitEffiData.h
MuonR4::MuonDigitizationTool::DeadTimeMap
std::unordered_map< Identifier, double > DeadTimeMap
Definition: MuonDigitizationTool.h:129
MuonR4::RpcFastDigiTool::digitizeHit
bool digitizeHit(const Identifier &gasGapId, const bool measuresPhi, const MuonGMR4::RpcReadoutElement &reEle, const double hitTime, const Amg::Vector2D &locPos, const Muon::DigitEffiData *effiMap, RpcDigitCollection &outContainer, CLHEP::HepRandomEngine *rndEngine, DeadTimeMap &deadTimes) const
Digitize the sim hit as Rpc strip 1D hit.
Definition: RpcFastDigiTool.cxx:95
MuonR4::RpcFastDigiTool::timeOverThreshold
static double timeOverThreshold(CLHEP::HepRandomEngine *rndmEngine)
Roll the time over threshold for each signal digit.
Definition: RpcFastDigiTool.cxx:249
Identifier
Definition: IdentifierFieldParser.cxx:14