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 
11 
12 #include "GaudiKernel/PhysicalConstants.h"
13 
14 namespace MuonR4{
15  class RpcFastDigiTool final: public MuonDigitizationTool {
16  public:
17  RpcFastDigiTool(const std::string& type, const std::string& name, const IInterface* pIID);
18 
19  StatusCode initialize() override final;
20  StatusCode finalize() override final;
21  protected:
22  StatusCode digitize(const EventContext& ctx,
23  const TimedHits& hitsToDigit,
24  xAOD::MuonSimHitContainer* sdoContainer) const override final;
25 
26 
27  private:
28  int m_stIdxBIL{-1}; // Station name index of the BIL stations
29 
40  bool digitizeHit(const Identifier& gasGapId,
41  const bool measuresPhi,
42  const MuonGMR4::StripDesignPtr& designPtr,
43  const double hitTime,
44  const double locPos,
45  const Muon::DigitEffiData* effiMap,
46  RpcDigitCollection& outContainer,
47  CLHEP::HepRandomEngine* rndEngine) const;
48 
58  bool digitizeHit(const Identifier& gasGapId,
59  const MuonGMR4::StripDesignPtr& designPtr,
60  const double hitTime,
61  const Amg::Vector2D& locPos,
62  const Muon::DigitEffiData* effiMap,
63  RpcDigitCollection& outContainer,
64  CLHEP::HepRandomEngine* rndEngine) const;
65 
67  static double timeOverThreshold(CLHEP::HepRandomEngine* rndmEngine) ;
68 
70  SG::WriteHandleKey<RpcDigitContainer> m_writeKey{this, "OutputObjectName", "RPC_DIGITS"};
71 
72  SG::ReadCondHandleKey<Muon::DigitEffiData> m_effiDataKey{this, "EffiDataKey", "RpcDigitEff",
73  "Efficiency constants of the individual Rpc gasGaps"};
74 
75  mutable std::array<std::atomic<unsigned>, 2> m_allHits ATLAS_THREAD_SAFE{};
76  mutable std::array<std::atomic<unsigned>, 2> m_acceptedHits ATLAS_THREAD_SAFE{};
77 
78  Gaudi::Property<double> m_propagationVelocity{this, "propSpeed", 0.5 * Gaudi::Units::c_light,
79  "Propagation speed of the signal inside the strip"}; // in mm/ns
80 
81  Gaudi::Property<double> m_stripTimeResolution{this, "timeResolution", 0.6 * Gaudi::Units::nanosecond,
82  "Estimated time resolution of the strip readout"};
83  };
84 }
85 #endif
GeoModel::TransientConstSharedPtr< StripDesign >
MuonR4::RpcFastDigiTool::m_effiDataKey
SG::ReadCondHandleKey< Muon::DigitEffiData > m_effiDataKey
Definition: RpcFastDigiTool.h:72
MuonR4::RpcFastDigiTool::m_stripTimeResolution
Gaudi::Property< double > m_stripTimeResolution
Definition: RpcFastDigiTool.h:81
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:28
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:98
MuonR4::RpcFastDigiTool::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned >, 2 > m_allHits ATLAS_THREAD_SAFE
Definition: RpcFastDigiTool.h:75
MuonR4::RpcFastDigiTool::initialize
StatusCode initialize() override final
Definition: RpcFastDigiTool.cxx:18
MuonR4::RpcFastDigiTool
Definition: RpcFastDigiTool.h:15
MuonR4::RpcFastDigiTool::DigiCache
OutDigitCache_t< RpcDigitCollection > DigiCache
Definition: RpcFastDigiTool.h:69
MuonDigitizationTool.h
MuonR4::RpcFastDigiTool::RpcFastDigiTool
RpcFastDigiTool(const std::string &type, const std::string &name, const IInterface *pIID)
Definition: RpcFastDigiTool.cxx:15
SG::WriteHandleKey< RpcDigitContainer >
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:70
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:31
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
MuonR4::RpcFastDigiTool::m_propagationVelocity
Gaudi::Property< double > m_propagationVelocity
Definition: RpcFastDigiTool.h:78
Muon::DigitEffiData
Definition: DigitEffiData.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
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
The CsvMuonSimHitDumper reads a Simulation Hit container for muons and dumps information to csv files...
Definition: MuonSpacePoint.h:11
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:60
MuonR4::RpcFastDigiTool::finalize
StatusCode finalize() override final
Definition: RpcFastDigiTool.cxx:25
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DigitEffiData.h
MuonR4::RpcFastDigiTool::digitizeHit
bool digitizeHit(const Identifier &gasGapId, const bool measuresPhi, const MuonGMR4::StripDesignPtr &designPtr, const double hitTime, const double locPos, const Muon::DigitEffiData *effiMap, RpcDigitCollection &outContainer, CLHEP::HepRandomEngine *rndEngine) const
Digitize the sim hit as Rpc strip 1D hit.
Definition: RpcFastDigiTool.cxx:71
MuonR4::RpcFastDigiTool::timeOverThreshold
static double timeOverThreshold(CLHEP::HepRandomEngine *rndmEngine)
Roll the time over threshold for each signal digit.
Definition: RpcFastDigiTool.cxx:220