ATLAS Offline Software
Loading...
Searching...
No Matches
RpcDigiTool.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_RPCDIGITOOL_H
5#define RPC_DIGITIZATIONR4_RPCDIGITOOL_H
6
7#include "Acts/Utilities/detail/Polynomials.hpp"
8#include "CLHEP/Random/RandExponential.h"
9#include "CLHEP/Random/RandFlat.h"
10#include "CLHEP/Random/RandGaussZiggurat.h"
11#include "GaudiKernel/PhysicalConstants.h"
15
16namespace MuonR4 {
17class RpcDigiTool final : public MuonDigitizationTool {
18public:
19 using MuonDigitizationTool::MuonDigitizationTool;
20
21 StatusCode initialize() override final;
22 StatusCode finalize() override final;
23
24protected:
25 StatusCode
26 digitize(const EventContext &ctx, const TimedHits &hitsToDigit,
27 xAOD::MuonSimHitContainer *sdoContainer) const override final;
28
29private:
31
40 bool digitizeHit(const TimedHit &simHit, const bool measuresPhi,
41 const Muon::DigitEffiData *effiMap,
42 RpcDigitCollection &outContainer,
43 CLHEP::HepRandomEngine *rndEngine,
44 DeadTimeMap &deadTimes) const;
45
53 bool digitizeHitBI(const TimedHit &simHit, const Muon::DigitEffiData *effiMap,
54 RpcDigitCollection &outContainer,
55 CLHEP::HepRandomEngine *rndEngine,
56 DeadTimeMap &deadTimes) const;
57
59 static double timeOverThreshold(CLHEP::HepRandomEngine *rndmEngine);
60
63 "RPC_DIGITS"};
64
66 this, "EffiDataKey", "RpcDigitEff",
67 "Efficiency constants of the individual Rpc gasGaps"};
68
69 mutable std::array<std::atomic<unsigned>, 2> m_allHits ATLAS_THREAD_SAFE{};
70 mutable std::array<std::atomic<unsigned>, 2> m_acceptedHits
72
73 Gaudi::Property<double> m_propagationVelocity{
74 this, "propSpeed", 0.5 * Gaudi::Units::c_light,
75 "Propagation speed of the signal inside the strip"}; // in mm/ns
76
77 Gaudi::Property<double> m_stripTimeResolution{
78 this, "timeResolution", 0.6 * Gaudi::Units::nanosecond,
79 "Estimated time resolution of the strip readout"};
80
81 Gaudi::Property<double> m_deadTime{this, "deadTime",
82 100. * Gaudi::Units::nanosecond};
83
84 Gaudi::Property<bool> m_digitizeMuonOnly{
85 this, "ProcessTrueMuonsOnly", false,
86 "If set to true hit with pdgId != 13 are skipped"};
87
88 // Methods for new BIRPC digitization
89 //
94 CLHEP::HepRandomEngine *rndmEngine) const;
95
99 double calculateChargeOnStrip(const TimedHit &simHit,
100 CLHEP::HepRandomEngine *rndmEngine,
101 const double gasGapSize) const;
102
107 std::vector<double>
108 divideChargeOnStrips(double totalCharge, int n_strips,
109 CLHEP::HepRandomEngine *rndmEngine) const;
110
113 double getTOT(const double aCharge) const;
114
118 double getTOA(const double aCharge, const double aDistance) const;
119};
120
121} // namespace MuonR4
122
123#endif
Barebone implementation of the I/O infrastructure for all MuonDigitizationTools.
std::vector< TimedHitPtr< xAOD::MuonSimHit > > TimedHits
std::vector< std::unique_ptr< DetType > > OutDigitCache_t
DigitContainers are sorted by DigitCollections which are the ensemble of all hits in a given MuonCham...
TimedHitPtr< xAOD::MuonSimHit > TimedHit
std::unordered_map< Identifier, double > DeadTimeMap
StatusCode initialize() override final
Gaudi::Property< double > m_stripTimeResolution
Definition RpcDigiTool.h:77
double getTOT(const double aCharge) const
Returns Time Over Threshold (ns) for a signal on a strip.
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.
Gaudi::Property< bool > m_digitizeMuonOnly
Definition RpcDigiTool.h:84
Gaudi::Property< double > m_deadTime
Definition RpcDigiTool.h:81
double getTOA(const double aCharge, const double aDistance) const
Returns Time Of Arrival (ns) for a signal on a strip.
SG::ReadCondHandleKey< Muon::DigitEffiData > m_effiDataKey
Definition RpcDigiTool.h:65
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...
std::vector< double > divideChargeOnStrips(double totalCharge, int n_strips, CLHEP::HepRandomEngine *rndmEngine) const
Returns a vector with chages (fC) divided on strips.
int determineClusterSizeBI(const Identifier &id, CLHEP::HepRandomEngine *rndmEngine) const
Returns BI cluster strip molteplicity.
SG::WriteHandleKey< RpcDigitContainer > m_writeKey
Definition RpcDigiTool.h:62
StatusCode finalize() override final
Gaudi::Property< double > m_propagationVelocity
Definition RpcDigiTool.h:73
MuonGMR4::RpcReadoutElement::EdgeSide EdgeSide
Definition RpcDigiTool.h:30
OutDigitCache_t< RpcDigitCollection > DigiCache
Definition RpcDigiTool.h:61
static double timeOverThreshold(CLHEP::HepRandomEngine *rndmEngine)
Roll the time over threshold for each signal digit.
double calculateChargeOnStrip(const TimedHit &simHit, CLHEP::HepRandomEngine *rndmEngine, const double gasGapSize) const
Returns the charge (fC) after the amplification in gas.
std::array< std::atomic< unsigned >, 2 > m_allHits ATLAS_THREAD_SAFE
Definition RpcDigiTool.h:69
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.
Property holding a SG store/key/clid from which a WriteHandle is made.
This header ties the generic definitions in this package.
MuonSimHitContainer_v1 MuonSimHitContainer
Define the version of the pixel cluster container.