ATLAS Offline Software
Loading...
Searching...
No Matches
MuonPhaseII/MuonDigitization/sTgcDigitizationR4/sTgcDigitizationR4/sTgcDigitMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
12
13#ifndef sTGCDigitizationR4_STGCDIGITMAKER_H
14#define sTGCDigitizationR4_STGCDIGITMAKER_H
15
25
26namespace CLHEP {
27 class HepRandomEngine;
28 class HepRandom;
29}
34
35namespace MuonR4{
37 public:
41 enum class digitMode: std::uint8_t {
45 };
47 digitMode mode,
48 double meanGasGain,
49 bool doPadChargeSharing);
50
54 virtual ~sTgcDigitMaker();
55
59 StatusCode initialize();
60
68 CLHEP::HepRandomEngine* rndEngine{nullptr};
69 };
70
73
79 using sTgcDigitVec = std::vector<std::unique_ptr<sTgcDigit>>;
80 sTgcDigitVec executeDigi(const DigiConditions& condContainers, const TimedHit& hit) const;
81
82 private:
88 double lowEdge{0.};
89 double kParameter{0.};
90 double thetaParameter{0.};
91 };
92
97 struct Ionization {
98 double distance{-9.99}; //smallest distance bet the wire and particle trajectory
99 double time{0.}; // time of arrival
100 Amg::Vector3D posOnSegment{Amg::Vector3D::Zero()}; // Point of closest approach
101 Amg::Vector3D posOnWire{Amg::Vector3D::Zero()}; // Position on the wire
102 };
103
105 struct DigiInput {
109 Amg::Vector3D posOnSurf{Amg::Vector3D::Zero()};
111 Amg::Vector3D hitDir{Amg::Vector3D::Zero()};
113 double totalCharge{0.};
115 double time{0.};
118 };
119
122 bool getIonizationPoint(const TimedHit& hit, const DigiConditions& condContainers, Ionization& ionization) const;
123
127 double calculateTotalCharge(double energyDeposit, CLHEP::HepRandomEngine* rndEngine) const;
128
132 sTgcDigitVec processStripDigitization(const DigiConditions& condContainers,
133 const DigiInput& digiInput) const;
134
138 sTgcDigitVec processPadDigitization(const DigiInput& digiInput) const;
139
143 sTgcDigitVec processWireDigitization(const DigiInput& digiInput) const;
144
148 sTgcDigitVec processStripChargeSharing(const DigiInput& digiInput,
149 const double peak_position,
150 const int stripNumber) const;
151
155 sTgcDigitVec processPadChargeSharing(const DigiInput& digiInput,
156 const int padEta,
157 const int padPhi) const;
158
162 static void addDigit(sTgcDigitVec& digits,
163 const Identifier& id,
164 double digittime,
165 double charge);
166
170 StatusCode readFileOfTimeArrival();
171
175 StatusCode readFileOfTimeOffsetStrip();
176
187 Ionization pointClosestApproach(const MuonGMR4::StripLayer& stripLayer,
188 int wireNumber,
189 const Amg::Vector3D& locHitPos,
190 const Amg::Vector3D& locHitDir,
191 const double stepLength) const;
192
200 double getTimeOffsetStrip(size_t neighbor_index) const;
201
205 static double getPadChargeFraction(double distance);
206
210 GammaParameter getGammaParameter(double distance) const;
211
215 double getMostProbableArrivalTime(double distance) const;
216
217 // Parameters of the gamma probability distribution function
218 std::vector<GammaParameter> m_gammaParameter;
220 std::array<double, 6> m_timeOffsetStrip{make_array<double, 6>(0.)};
221
224 const sTgcIdHelper& m_idHelper{m_idHelperSvc->stgcIdHelper()};
225 // Computes the charge on a strip given the limits of integral using the error function
226 // In R3, strip cluster charge profile was defined by a double gaussian for every digit
227 // which is computationally inefficient, here we use result of double gaussian integral
228 // to find the charge on each strip of the cluster, where M, N are upper and lower
229 // limits respectively
230 // Strip cluster charge profile: [0] = sigma of inner Gaussian, [1] = sigma of outer Gaussian
231 static constexpr std::array<double, 2> m_clusterParams{0.573, 1.092};
232 double chargeIntegral(double N, double M) const;
233
240 // Digitization parameters
242 double m_theta{10}; // theta=10 value best matches the PDF
243 double m_meanGasGain{5.e4}; // mean gain estimated from ATLAS note "ATL-MUON-PUB-2014-001"
244 bool m_doPadSharing{false};
245
246 // Flag to enable strip time offset
248 // Angular strip resolution parameter
249 double m_StripResolution{0.0949};
252
253 // Dependence of energy deposited on incident angle
255};
256}
257#endif
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
Definition ArrayHelper.h:10
double charge(const T &p)
Definition AtlasPID.h:997
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
The StripLayer interfaces the 2D description of the strip plane layout with the 3D description of the...
Definition StripLayer.h:19
std::vector< std::unique_ptr< sTgcDigit > > sTgcDigitVec
Digitize a given hit.
sTgcDigitVec processWireDigitization(const DigiInput &digiInput) const
Processes wire digitization for a given hit.
StatusCode readFileOfTimeOffsetStrip()
Reads strip time offset data file.
sTgcDigitVec processPadDigitization(const DigiInput &digiInput) const
Processes pad digitization for a given hit.
static double getPadChargeFraction(double distance)
Computes charge fraction shared among pads.
double getTimeOffsetStrip(size_t neighbor_index) const
Gets the time offset for a strip cluster.
bool getIonizationPoint(const TimedHit &hit, const DigiConditions &condContainers, Ionization &ionization) const
Computes the ionization point for a hit.
digitMode m_digitMode
define offsets and widths of time windows for signals from wiregroups and strips.
GammaParameter getGammaParameter(double distance) const
Retrieves gamma distribution parameters based on distance.
static void addDigit(sTgcDigitVec &digits, const Identifier &id, double digittime, double charge)
Adds a digit to the appropriate cache.
sTgcDigitVec processStripChargeSharing(const DigiInput &digiInput, const double peak_position, const int stripNumber) const
Handles charge sharing for strip clusters.
StatusCode initialize()
Initialize digitization parameters, including reading necessary data files.
sTgcDigitMaker(const MuonGMR4::MuonDetectorManager *detMgr, digitMode mode, double meanGasGain, bool doPadChargeSharing)
sTgcDigitVec processStripDigitization(const DigiConditions &condContainers, const DigiInput &digiInput) const
Processes strip digitization for a given hit.
double getMostProbableArrivalTime(double distance) const
Computes the most probable arrival time based on the distance of closest approach.
double calculateTotalCharge(double energyDeposit, CLHEP::HepRandomEngine *rndEngine) const
Calculates total charge from energy deposit, including gas gain.
Ionization pointClosestApproach(const MuonGMR4::StripLayer &stripLayer, int wireNumber, const Amg::Vector3D &locHitPos, const Amg::Vector3D &locHitDir, const double stepLength) const
Computes the closest approach between a trajectory and a wire segment.
sTgcDigitVec processPadChargeSharing(const DigiInput &digiInput, const int padEta, const int padPhi) const
Handles charge sharing for pad clusters.
sTgcDigitVec executeDigi(const DigiConditions &condContainers, const TimedHit &hit) const
virtual ~sTgcDigitMaker()
Destructor.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
a smart pointer to a hit that also provides access to the extended timing info of the host event.
Definition TimedHitPtr.h:18
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.