ATLAS Offline Software
Loading...
Searching...
No Matches
MuonPhaseII/MuonDigitization/sTgcDigitizationR4/sTgcDigitizationR4/sTgcDigitizationTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
6#ifndef STGC_DIGITIZATIONR4_DIGITIZATIONTOOL_H
7#define STGC_DIGITIZATIONR4_DIGITIZATIONTOOL_H
8
9#include <memory>
10#include <vector>
11#include <string>
12
17
22
25
26namespace MuonR4 {
27
29 public:
30 using MuonDigitizationTool::MuonDigitizationTool;
31
32 StatusCode initialize() override final;
33
40 using DigiConditions = sTgcDigitMaker::DigiConditions; // struct from digitmaker
41 using sTgcDigitVec = sTgcDigitMaker::sTgcDigitVec; // vector of sTgcDigit
42 using DigiCache = OutDigitCache_t<sTgcDigitCollection>; // vector of digit collection
43
45 public:
46 sTgcSimDigitHit() = default;
47 sTgcSimDigitHit(const TimedHit& simHit, std::unique_ptr<sTgcDigit> digit):
48 m_sTGCSimHit{simHit},
49 m_sTGCDigit{std::move(digit)}{}
50
51 const TimedHit& getSimHit() const { return m_sTGCSimHit; }
54 const sTgcDigit& getDigit() const { return *m_sTGCDigit; }
56 std::unique_ptr<sTgcDigit> releaseDigit() { return std::move(m_sTGCDigit); }
57 Identifier identify() const { return getDigit().identify(); }
58 double time() const {return getDigit().time(); }
59
60 private:
62 std::unique_ptr<sTgcDigit> m_sTGCDigit;
63 };
64 using sTgcSimDigitVec = std::vector<sTgcSimDigitHit>; //vector of custom class defined above
65 StatusCode digitize(const EventContext& ctx,
66 const TimedHits& hitsToDigit,
67 xAOD::MuonSimHitContainer* sdoContainer) const override final;
68
69 private:
70
71 SG::WriteHandleKey<sTgcDigitContainer> m_writeKey{this, "OutputObjectName", "STGC_DIGITS"};
72
73 SG::ReadCondHandleKey<Muon::DigitEffiData> m_effiDataKey{this, "EffiDataKey", "sTgcDigitEff", "Efficiency constants"};
74 SG::ReadCondHandleKey<NswCalibDbThresholdData> m_condThrshldsKey{this, "CondThrshldsKey", "NswCalibDbThresholdData", "Calibration data"};
75
76 ToolHandle<Muon::INSWCalibSmearingTool> m_smearingTool{this, "SmearingTool", "Muon::NSWCalibSmearingTool/STGCCalibSmearingTool"};
77 ToolHandle<Muon::INSWCalibTool> m_calibrationTool{this, "CalibrationTool", "Muon::NSWCalibTool/STGCCalibTool"};
78
79 Gaudi::Property<bool> m_digitizeMuonOnly{this, "ProcessTrueMuonsOnly", false};
80 Gaudi::Property<bool> m_useTimeWindow{this, "UseTimeWindow", true};
81 Gaudi::Property<bool> m_doSmearing{this, "doSmearing", false};
82 Gaudi::Property<bool> m_doToFCorrection{this,"doToFCorrection", true};
83
84 Gaudi::Property<int> m_digitMode{this, "digitMode", 3}; //
85 Gaudi::Property<bool> m_doPadSharing{this,"padChargeSharing", false};
86 Gaudi::Property<double> m_deadtimeStrip{this,"deadtimeStrip", 250};
87 Gaudi::Property<double> m_deadtimePad{this,"deadtimePad" , 250};
88 Gaudi::Property<double> m_deadtimeWire{this,"deadtimeWire" , 250};
89 Gaudi::Property<bool> m_doNeighborOn{this,"neighborOn", true};
90 Gaudi::Property<double> m_runVoltage{this,"operatingHVinkV" , 2.8};
91 Gaudi::Property<bool> m_useCondThresholds{this, "useCondThresholds", false,
92 "Use conditions data to get VMM charge threshold values"};
93
94 Gaudi::Property<double> m_energyDepositThreshold{this,"energyDepositThreshold",300.0*CLHEP::eV};
95 Gaudi::Property<double> m_limitElectronKineticEnergy{this,"limitElectronKineticEnergy",5.0*CLHEP::MeV};
96
97 Gaudi::Property<double> m_chargeThreshold{this,"chargeThreshold", 0.030};
98
99 static constexpr double m_timeJitterElectronicsStrip{2.f};
100 static constexpr double m_timeJitterElectronicsPad{2.f};
101 static constexpr double m_hitTimeMergeThreshold{30.f};
102
106 bool operator()(const TimedHit&a, const TimedHit& b) const {
107 return a.get() < b.get();
108 }
109 };
110 using SdoIdMap_t = std::map<const TimedHit, std::vector<Identifier>, SimHitSorter>;
111
112 StatusCode processDigitsWithVMM(const EventContext& ctx,
113 const DigiConditions& digiCond,
114 sTgcSimDigitVec&& digitsInChamber,
115 const double vmmDeadTime,
116 const bool isNeighbourOn,
117 sTgcDigitCollection& outColl,
118 SdoIdMap_t& sdoIdMap) const;
119
120 sTgcSimDigitVec mergeDigitsVMM(const EventContext& ctx,
121 const DigiConditions& digiCond,
122 const double vmmDeadTime,
123 const bool isNeighbourOn,
124 sTgcSimDigitVec&& unmergedDigits) const;
125
126
127 uint16_t bcTagging(const double digitTime) const;
128
129 double getChannelThreshold(const EventContext& ctx,
130 const Identifier& channelID,
131 const NswCalibDbThresholdData& thresholdData) const;
132
133 std::unique_ptr<sTgcDigitMaker> m_digitizer{};
134 };
135
136}
137#endif
static Double_t a
Identifier identify() const
Definition MuonDigit.h:30
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::vector< std::unique_ptr< sTgcDigit > > sTgcDigitVec
Digitize a given hit.
StatusCode processDigitsWithVMM(const EventContext &ctx, const DigiConditions &digiCond, sTgcSimDigitVec &&digitsInChamber, const double vmmDeadTime, const bool isNeighbourOn, sTgcDigitCollection &outColl, SdoIdMap_t &sdoIdMap) const
sTgcSimDigitVec mergeDigitsVMM(const EventContext &ctx, const DigiConditions &digiCond, const double vmmDeadTime, const bool isNeighbourOn, sTgcSimDigitVec &&unmergedDigits) const
double getChannelThreshold(const EventContext &ctx, const Identifier &channelID, const NswCalibDbThresholdData &thresholdData) const
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::map< const TimedHit, std::vector< Identifier >, SimHitSorter > SdoIdMap_t
sTgcIdHelper::sTgcChannelTypes ReadoutChannelType
ReadoutChannelType to distinguish the available readout channels Pad - pad readout channel Strip - et...
Conditions data to model a channel dependent energy deposit threshold such that the electronics retur...
Property holding a SG store/key/clid from which a WriteHandle is made.
float time() const
Definition sTgcDigit.cxx:61
This header ties the generic definitions in this package.
STL namespace.
MuonSimHitContainer_v1 MuonSimHitContainer
Define the version of the pixel cluster container.
Data type to deduplicate the SDOs && associate them with the digit produced by them.