ATLAS Offline Software
sTgcFastDigiTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "sTgcFastDigiTool.h"
6 #include "CLHEP/Random/RandGaussZiggurat.h"
7 #include "CLHEP/Random/RandFlat.h"
9 namespace {
10  constexpr double percentage(unsigned int numerator, unsigned int denom) {
11  return 100. * numerator / std::max(denom, 1u);
12  }
13  using channelType = sTgcIdHelper::sTgcChannelTypes;
14 }
15 namespace MuonR4 {
16 
17  sTgcFastDigiTool::sTgcFastDigiTool(const std::string& type, const std::string& name, const IInterface* pIID):
19 
25  return StatusCode::SUCCESS;
26  }
28  ATH_MSG_INFO("Tried to convert "<<m_allHits[channelType::Strip]<<"/"
29  <<m_allHits[channelType::Wire]<<"/"
30  <<m_allHits[channelType::Pad]<<" strip/wire/pad hits. In, "
31  <<percentage(m_acceptedHits[channelType::Strip], m_allHits[channelType::Strip]) <<"/"
32  <<percentage(m_acceptedHits[channelType::Wire], m_allHits[channelType::Wire])<<"/"
33  <<percentage(m_acceptedHits[channelType::Pad], m_allHits[channelType::Pad])
34  <<"% of the cases, the conversion was successful");
35  return StatusCode::SUCCESS;
36  }
37  StatusCode sTgcFastDigiTool::digitize(const EventContext& ctx,
38  const TimedHits& hitsToDigit,
39  xAOD::MuonSimHitContainer* sdoContainer) const {
40  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
41  // Prepare the temporary cache
42  DigiCache digitCache{};
44  const Muon::DigitEffiData* efficiencyMap{nullptr};
45  ATH_CHECK(SG::get(efficiencyMap, m_effiDataKey, ctx));
46  const NswErrorCalibData* nswUncertDB{nullptr};
47  ATH_CHECK(SG::get(nswUncertDB, m_uncertCalibKey, ctx));
48 
49  CLHEP::HepRandomEngine* rndEngine = getRandomEngine(ctx);
50  xAOD::ChamberViewer viewer{hitsToDigit, m_idHelperSvc.get()};
51  do {
52  for (const TimedHit& simHit : viewer) {
54  if (m_digitizeMuonOnly && !MC::isMuon(simHit)){
55  continue;
56  }
57 
58  if (simHit->energyDeposit() < m_energyDepositThreshold){
59  ATH_MSG_VERBOSE("Hit with Energy Deposit of " << simHit->energyDeposit()
60  << " less than " << m_energyDepositThreshold << ". Skip this hit." );
61  continue;
62  }
63 
64  const double hitKineticEnergy = simHit->kineticEnergy();
65  if (hitKineticEnergy < m_limitElectronKineticEnergy && MC::isElectron(simHit)) {
66  ATH_MSG_DEBUG("Skip electron hit with kinetic energy " << hitKineticEnergy
67  << ", which is less than the lower limit of " << m_limitElectronKineticEnergy);
68  continue;
69  }
70  sTgcDigitCollection* digiColl = fetchCollection(simHit->identify(), digitCache);
71  const bool digitizedStrip = digitizeStrip(ctx, simHit, nswUncertDB, efficiencyMap, rndEngine, *digiColl);
72  const bool digitizedWire = digitizeWire(ctx, simHit, efficiencyMap, rndEngine, *digiColl);
73  const bool digitizedPad = digitizePad(ctx, simHit, efficiencyMap, rndEngine, *digiColl);
74 
75  if (digitizedStrip) {
76  xAOD::MuonSimHit* sdo = addSDO(simHit, sdoContainer);
77  size_t stripIdx = digiColl->size() - 1 - digitizedWire - digitizedPad;
78  sdo->setIdentifier(digiColl->at(stripIdx)->identify());
79  } else if (digitizedWire || digitizedPad) {
80  xAOD::MuonSimHit* sdo = addSDO(simHit, sdoContainer);
81  sdo->setIdentifier(digiColl->at(digiColl->size() - 1)->identify());
82  const MuonGMR4::sTgcReadoutElement* re{m_detMgr->getsTgcReadoutElement(simHit->identify())};
83 
84  const Amg::Transform3D etaToPhi{re->globalToLocalTrans(getGeoCtx(ctx), re->layerHash(sdo->identify())) *
85  re->localToGlobalTrans(getGeoCtx(ctx), re->layerHash(simHit->identify()))};
86 
87  sdo->setLocalDirection(xAOD::toStorage(etaToPhi * xAOD::toEigen(sdo->localDirection())));
88  sdo->setLocalPosition(xAOD::toStorage(etaToPhi * xAOD::toEigen(sdo->localPosition())));
89  }
90  }
91  } while (viewer.next());
93  ATH_CHECK(writeDigitContainer(ctx, m_writeKey, std::move(digitCache),
94  idHelper.module_hash_max()));
95  return StatusCode::SUCCESS;
96  }
97  bool sTgcFastDigiTool::digitizeStrip(const EventContext& ctx,
98  const TimedHit& timedHit,
99  const NswErrorCalibData* errorCalibDB,
100  const Muon::DigitEffiData* efficiencyMap,
101  CLHEP::HepRandomEngine* rndEngine,
102  sTgcDigitCollection& outCollection) const {
103 
104  if (!m_digitizeStrip) {
105  return false;
106  }
107  ++m_allHits[channelType::Strip];
108  const Identifier hitId{timedHit->identify()};
109  const MuonGMR4::sTgcReadoutElement* readOutEle{m_detMgr->getsTgcReadoutElement(hitId)};
110 
111  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
112 
113  const int gasGap = idHelper.gasGap(hitId);
114  const MuonGMR4::StripDesign& design{readOutEle->stripDesign(hitId)};
115 
116  const Amg::Vector2D stripPos{xAOD::toEigen(timedHit->localPosition()).block<2,1>(0,0)};
117 
118  const int stripNum = design.stripNumber(stripPos);
119  if (stripNum < 0) {
120  ATH_MSG_VERBOSE("Strip hit "<<Amg::toString(stripPos)<<" "<<m_idHelperSvc->toStringGasGap(hitId)
121  <<" is out of range "<<std::endl<<design);
122  return false;
123  }
124 
125 
126  bool isValid{false};
127  const Identifier stripId = idHelper.channelID(hitId, readOutEle->multilayer(),
128  gasGap, channelType::Strip, stripNum, isValid);
129 
130  if (!isValid) {
131  ATH_MSG_WARNING("Failed to deduce a valid identifier from "
132  <<m_idHelperSvc->toStringGasGap(hitId)<<" strip: "<<stripNum);
133  return false;
134  }
135 
137  bool isInnerQ1 = readOutEle->isEtaZero(readOutEle->measurementHash(hitId), stripPos);
138  if (efficiencyMap && efficiencyMap->getEfficiency(hitId, isInnerQ1) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
139  ATH_MSG_VERBOSE("Simulated strip hit "<<xAOD::toEigen(timedHit->localPosition())
140  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
141  return false;
142  }
143 
144  NswErrorCalibData::Input errorCalibInput{};
145  errorCalibInput.stripId= stripId;
146  errorCalibInput.locTheta = M_PI - timedHit->localDirection().theta();
147  errorCalibInput.clusterAuthor = 3; // centroid
148 
149  const double uncert = errorCalibDB->clusterUncertainty(errorCalibInput);
150  const double smearedX = CLHEP::RandGaussZiggurat::shoot(rndEngine, stripPos.x(), uncert);
151 
152  const Amg::Vector2D digitPos{smearedX * Amg::Vector2D::UnitX()};
153 
154  const int digitStrip = design.stripNumber(digitPos);
155  if (digitStrip < 0) {
156  ATH_MSG_VERBOSE("Smeared strip hit "<<Amg::toString(digitPos)<<" "<<m_idHelperSvc->toStringGasGap(hitId)
157  <<" is out of range "<<std::endl<<design);
158  return false;
159  }
160  const Identifier digitId = idHelper.channelID(hitId, readOutEle->multilayer(),
161  gasGap, channelType::Strip, digitStrip, isValid);
162 
163  if (!isValid) {
164  ATH_MSG_WARNING("Failed to deduce a valid identifier from "
165  <<m_idHelperSvc->toStringGasGap(hitId)<<" digit: "<<digitStrip);
166  return false;
167  }
168  constexpr double dummyCharge = 66666;
189  const double pull = (smearedX - (*design.center(digitStrip)).x()) / design.stripPitch();
190  const double w1 = CLHEP::RandFlat::shoot(rndEngine, 0., 0.5 *(1. - pull));
191  const double w2 = 1. - pull -2.*w1;
192  const double w3 = pull + w1;
193 
194  if (digitStrip> 1) {
195  const Identifier stripIdB = idHelper.channelID(hitId, readOutEle->multilayer(),
196  gasGap, channelType::Strip, digitStrip -1);
197  outCollection.push_back(std::make_unique<sTgcDigit>(stripIdB,
198  associateBCIdTag(ctx, timedHit),
199  hitTime(timedHit), dummyCharge * w1, false, false));
200  }
201  outCollection.push_back(std::make_unique<sTgcDigit>(digitId,
202  associateBCIdTag(ctx, timedHit),
203  hitTime(timedHit), dummyCharge * w2, false, false));
204 
205  if (digitStrip + 1 <= design.numStrips()) {
206  const Identifier stripIdA = idHelper.channelID(hitId, readOutEle->multilayer(),
207  gasGap, channelType::Strip, digitStrip + 1);
208 
209  outCollection.push_back(std::make_unique<sTgcDigit>(stripIdA,
210  associateBCIdTag(ctx, timedHit),
211  hitTime(timedHit), dummyCharge * w3, false, false));
212  }
213  ++m_acceptedHits[channelType::Strip];
214  return true;
215  }
216 
217  bool sTgcFastDigiTool::digitizeWire(const EventContext& ctx,
218  const TimedHit& timedHit,
219  const Muon::DigitEffiData* efficiencyMap,
220  CLHEP::HepRandomEngine* rndEngine,
221  sTgcDigitCollection& outCollection) const {
222 
223  if (!m_digitizeWire) {
224  return false;
225  }
226 
227  ++m_allHits[channelType::Wire];
228 
229  const Identifier hitId{timedHit->identify()};
231  if (efficiencyMap && efficiencyMap->getEfficiency(hitId) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
232  ATH_MSG_VERBOSE("Simulated wire hit "<<xAOD::toEigen(timedHit->localPosition())
233  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
234  return false;
235  }
236  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
237  const MuonGMR4::sTgcReadoutElement* readOutEle = m_detMgr->getsTgcReadoutElement(hitId);
238  const int gasGap = idHelper.gasGap(hitId);
239 
240 
242  // Rotate the sim hit into the wire view
243  const IdentifierHash stripLayHash{readOutEle->createHash(gasGap, channelType::Strip, 0)};
244  const IdentifierHash wireLayHash{readOutEle->createHash(gasGap, channelType::Wire, 0)};
245 
246  const ActsGeometryContext& gctx{getGeoCtx(ctx)};
247  const Amg::Transform3D toWire{readOutEle->globalToLocalTrans(gctx, wireLayHash) *
248  readOutEle->localToGlobalTrans(gctx, stripLayHash)};
249 
250  const Amg::Vector2D wirePos{(toWire*xAOD::toEigen(timedHit->localPosition())).block<2,1>(0,0)};
251  // do not digitise wires that are never read out in reality
252  bool isInnerQ1 = readOutEle->isEtaZero(readOutEle->measurementHash(hitId), wirePos);
253  if(isInnerQ1) return false;
254 
256  if (efficiencyMap && efficiencyMap->getEfficiency(hitId, isInnerQ1) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
257  ATH_MSG_VERBOSE("Simulated wire hit "<<xAOD::toEigen(timedHit->localPosition())
258  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
259  return false;
260  }
261 
262  const MuonGMR4::WireGroupDesign& design{readOutEle->wireDesign(wireLayHash)};
263 
264  const int wireGrpNum = design.stripNumber(wirePos);
265  if (wireGrpNum < 0) {
266  ATH_MSG_VERBOSE("The wire "<<Amg::toString(wirePos)<<" in "<<m_idHelperSvc->toStringGasGap(hitId)
267  <<" is outside of the acceptance of "<<std::endl<<design);
268  return false;
269  }
270  const double uncert = design.stripPitch() * design.numWiresInGroup(wireGrpNum);
271 
272  const double smearedX = CLHEP::RandGaussZiggurat::shoot(rndEngine, wirePos.x(), uncert);
273 
274  const Amg::Vector2D digitPos{smearedX * Amg::Vector2D::UnitX()};
275 
276  const int digitWire = design.stripNumber(digitPos);
277  if (digitWire < 0) {
278  ATH_MSG_VERBOSE("Strip hit "<<Amg::toString(digitPos)<<" "<<m_idHelperSvc->toStringGasGap(hitId)
279  <<" is out of range "<<std::endl<<design);
280  return false;
281  }
282  bool isValid{false};
283  const Identifier digitId = idHelper.channelID(hitId, readOutEle->multilayer(),
284  gasGap, channelType::Wire, digitWire, isValid);
285 
286  if (!isValid) {
287  ATH_MSG_WARNING("Failed to deduce a valid identifier from "
288  <<m_idHelperSvc->toStringGasGap(hitId)<<" digit: "<<digitWire);
289  return false;
290  }
291  outCollection.push_back(std::make_unique<sTgcDigit>(digitId,
292  associateBCIdTag(ctx, timedHit),
293  hitTime(timedHit), 666, false, false));
294 
295 
296  ++m_acceptedHits[channelType::Wire];
297  return true;
298  }
299  int sTgcFastDigiTool::associateBCIdTag(const EventContext& /*ctx*/,
300  const TimedHit& /*timedHit*/) const {
302  return 0;
303  }
304 
305  bool sTgcFastDigiTool::digitizePad(const EventContext& ctx,
306  const TimedHit& timedHit,
307  const Muon::DigitEffiData* efficiencyMap,
308  CLHEP::HepRandomEngine* rndEngine,
309  sTgcDigitCollection& outCollection) const {
310 
311  if (!m_digitizePads) {
312  return false;
313  }
314 
315  ++m_allHits[channelType::Pad];
316 
317  const Identifier hitId{timedHit->identify()};
318  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
319  const MuonGMR4::sTgcReadoutElement* readOutEle = m_detMgr->getsTgcReadoutElement(hitId);
320  const int gasGap = idHelper.gasGap(hitId);
321 
322 
324  // Rotate the sim hit into the wire view
325  const IdentifierHash stripLayHash{readOutEle->createHash(gasGap, channelType::Strip, 0)};
326  const IdentifierHash padLayerHash{readOutEle->createHash(gasGap, channelType::Pad, 0)};
327 
328  const ActsGeometryContext& gctx{getGeoCtx(ctx)};
329  const Amg::Transform3D toPad{readOutEle->globalToLocalTrans(gctx, padLayerHash) *
330  readOutEle->localToGlobalTrans(gctx, stripLayHash)};
331 
332  const Amg::Vector2D padPos{(toPad*xAOD::toEigen(timedHit->localPosition())).block<2,1>(0,0)};
334  const MuonGMR4::PadDesign& design{readOutEle->padDesign(padLayerHash)};
335 
336  const auto [padEta, padPhi] = design.channelNumber(padPos);
337  if (padEta < 0 || padPhi < 0) {
338  ATH_MSG_VERBOSE("The pad "<<Amg::toString(padPos)<<" in "<<m_idHelperSvc->toStringGasGap(hitId)
339  <<" is outside of the acceptance of "<<std::endl<<design);
340  return false;
341  }
342  bool isValid{false};
343  const Identifier padId = idHelper.padID(hitId, readOutEle->multilayer(),
344  gasGap, channelType::Pad, padEta, padPhi, isValid);
345 
346 
347  if (!isValid) {
348  ATH_MSG_WARNING("Failed to decuce a valid pad Identifier from "<<Amg::toString(padPos)
349  <<" in "<<m_idHelperSvc->toStringGasGap(hitId));
350  return false;
351  }
352 
354  bool isInnerQ1 = readOutEle->isEtaZero(readOutEle->measurementHash(hitId), padPos);
355  if (efficiencyMap && efficiencyMap->getEfficiency(hitId, isInnerQ1) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
356  ATH_MSG_VERBOSE("Simulated pad hit "<<xAOD::toEigen(timedHit->localPosition())
357  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
358  return false;
359  }
360 
361 
362 
363  outCollection.push_back(std::make_unique<sTgcDigit>(padId,
364  associateBCIdTag(ctx, timedHit),
365  hitTime(timedHit), 666, false, false));
366 
367  ++m_acceptedHits[channelType::Pad];
368 
369  return true;
370  }
371 
372 
373 }
sTgcFastDigiTool.h
NswErrorCalibData
Definition: NswErrorCalibData.h:19
xAOD::MuonSimHit_v1
Definition: MuonSimHit_v1.h:18
MuonGMR4::sTgcReadoutElement::multilayer
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonR4::sTgcFastDigiTool::m_limitElectronKineticEnergy
Gaudi::Property< double > m_limitElectronKineticEnergy
Definition: sTgcFastDigiTool.h:76
MuonGMR4::StripDesign::stripNumber
virtual int stripNumber(const Amg::Vector2D &pos) const
Calculates the number of the strip whose center is closest to the given point.
MuonGMR4::StripDesign
Definition: StripDesign.h:30
xAOD::MuonSimHit_v1::setIdentifier
void setIdentifier(const Identifier &id)
Sets the global ATLAS identifier.
Definition: xAODMuonSimHit_V1.cxx:43
MuonGMR4::WireGroupDesign
Definition: WireGroupDesign.h:23
xAOD::MuonSimHit_v1::identify
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
Definition: xAODMuonSimHit_V1.cxx:42
MuonR4::sTgcFastDigiTool::initialize
StatusCode initialize() override final
Definition: sTgcFastDigiTool.cxx:20
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonR4::sTgcFastDigiTool::m_effiDataKey
SG::ReadCondHandleKey< Muon::DigitEffiData > m_effiDataKey
Definition: sTgcFastDigiTool.h:57
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonR4::sTgcFastDigiTool::m_digitizeMuonOnly
Gaudi::Property< bool > m_digitizeMuonOnly
Definition: sTgcFastDigiTool.h:73
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
MuonR4::sTgcFastDigiTool::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: sTgcFastDigiTool.cxx:37
MuonR4::sTgcFastDigiTool::associateBCIdTag
int associateBCIdTag(const EventContext &ctx, const TimedHit &timedHit) const
: Associates the global bcIdTag to the digit
Definition: sTgcFastDigiTool.cxx:299
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD::toStorage
MeasVector< N > toStorage(const AmgVector(N)&amgVec)
Converts the double precision of the AmgVector into the floating point storage precision of the MeasV...
Definition: MeasurementDefs.h:69
xAOD::MuonSimHit_v1::setLocalPosition
void setLocalPosition(MeasVector< 3 > vec)
Sets the local position of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:56
MuonGMR4::MuonReadoutElement::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:78
TimedHitPtr< xAOD::MuonSimHit >
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:867
MuonR4::sTgcFastDigiTool::m_writeKey
SG::WriteHandleKey< sTgcDigitContainer > m_writeKey
Definition: sTgcFastDigiTool.h:55
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
sTgcIdHelper::sTgcChannelTypes
sTgcChannelTypes
Definition: sTgcIdHelper.h:190
x
#define x
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
MuonGMR4::sTgcReadoutElement::measurementHash
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
MuonGMR4::PadDesign::channelNumber
std::pair< int, int > channelNumber(const Amg::Vector2D &hitPos) const
Function to retrieve the pad eta and phi given a local position coordinate.
MuonR4::sTgcFastDigiTool::m_uncertCalibKey
SG::ReadCondHandleKey< NswErrorCalibData > m_uncertCalibKey
Definition: sTgcFastDigiTool.h:61
xAOD::ChamberViewer
Definition: ChamberViewer.h:59
MuonGMR4::sTgcReadoutElement::wireDesign
const WireGroupDesign & wireDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
MuonR4::sTgcFastDigiTool::m_digitizePads
Gaudi::Property< bool > m_digitizePads
Definition: sTgcFastDigiTool.h:69
MuonGMR4::sTgcReadoutElement::createHash
static IdentifierHash createHash(const unsigned int gasGap, const unsigned int channelType, const unsigned int channel, const unsigned int wireInGrp=0)
Create a measurement hash from the Identifier fields.
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
sTgcDigitCollection
Definition: sTgcDigitCollection.h:18
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
MuonR4::MuonDigitizationTool::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const EventContext &ctx) const
Definition: MuonDigitizationTool.cxx:129
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:12
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Muon::DigitEffiData::getEfficiency
double getEfficiency(const Identifier &channelId, bool isInnerQ1=false) const
Returns the signal generation efficiency of the sTgc channel.
Definition: DigitEffiData.cxx:38
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:304
xAOD::MuonSimHit_v1::localDirection
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:66
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
NswErrorCalibData::clusterUncertainty
double clusterUncertainty(const Input &clustInfo) const
Definition: NswErrorCalibData.cxx:96
MuonGMR4::sTgcReadoutElement::isEtaZero
bool isEtaZero(const IdentifierHash &measurementHash, const Amg::Vector2D &localPosition) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/sTgcReadoutElement.cxx:321
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
MuonR4::sTgcFastDigiTool::digitizeWire
bool digitizeWire(const EventContext &ctx, const TimedHit &timedHit, const Muon::DigitEffiData *effiData, CLHEP::HepRandomEngine *rndEngine, sTgcDigitCollection &outCollection) const
Definition: sTgcFastDigiTool.cxx:217
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
compute_lumi.denom
denom
Definition: compute_lumi.py:76
MuonR4::sTgcFastDigiTool::DigiCache
OutDigitCache_t< sTgcDigitCollection > DigiCache
Definition: sTgcFastDigiTool.h:54
NswErrorCalibData::Input::stripId
Identifier stripId
Identifier of the strip.
Definition: NswErrorCalibData.h:27
Muon::DigitEffiData
Definition: DigitEffiData.h:23
MuonR4::MuonDigitizationTool::getGeoCtx
const ActsGeometryContext & getGeoCtx(const EventContext &ctx) const
Returns the reference to the ActsGeometryContext needed to fetch global positions from the Readout ge...
Definition: MuonDigitizationTool.cxx:135
MuonR4::MuonDigitizationTool::addSDO
xAOD::MuonSimHit * addSDO(const TimedHit &hit, xAOD::MuonSimHitContainer *sdoContainer) const
Adds the timed simHit to the output SDO container.
Definition: MuonDigitizationTool.cxx:142
MuonGMR4::WireGroupDesign::stripNumber
int stripNumber(const Amg::Vector2D &pos) const override
Calculates the number of the strip whose center is closest to the given point.
MuonR4::sTgcFastDigiTool::finalize
StatusCode finalize() override final
Definition: sTgcFastDigiTool.cxx:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonR4::MuonDigitizationTool::writeDigitContainer
StatusCode writeDigitContainer(const EventContext &ctx, const SG::WriteHandleKey< DigitCont > &key, OutDigitCache_t< DigitColl > &&digitCache, unsigned int hashMax) const
Helper function to move the collected digits into the final DigitContainer.
xAOD::MuonSimHit_v1::setLocalDirection
void setLocalDirection(MeasVector< 3 > vec)
Sets the local direction of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:62
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MuonR4::sTgcFastDigiTool::m_digitizeWire
Gaudi::Property< bool > m_digitizeWire
Definition: sTgcFastDigiTool.h:68
sTgcIdHelper
Definition: sTgcIdHelper.h:55
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ChamberViewer.h
MuonR4::sTgcFastDigiTool::m_energyDepositThreshold
Gaudi::Property< double > m_energyDepositThreshold
Definition: sTgcFastDigiTool.h:75
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:20
MuonGMR4::sTgcReadoutElement::padDesign
const PadDesign & padDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
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:63
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::MuonDigitizationTool::initialize
StatusCode initialize() override
Definition: MuonDigitizationTool.cxx:11
MuonR4::sTgcFastDigiTool::digitizeStrip
bool digitizeStrip(const EventContext &ctx, const TimedHit &timedHit, const NswErrorCalibData *errorCalibDB, const Muon::DigitEffiData *effiData, CLHEP::HepRandomEngine *rndEngine, sTgcDigitCollection &outCollection) const
Definition: sTgcFastDigiTool.cxx:97
MuonDigit::identify
Identifier identify() const
Definition: MuonDigit.h:30
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:58
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonR4::MuonDigitizationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonDigitizationTool.h:113
re
const boost::regex re(r_e)
xAOD::MuonSimHit_v1::localPosition
ConstVectorMap< 3 > localPosition() const
Returns the local postion of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:60
MuonGMR4::MuonReadoutElement::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:81
MuonR4::MuonDigitizationTool::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: MuonDigitizationTool.h:111
MuonR4::sTgcFastDigiTool::m_digitizeStrip
Gaudi::Property< bool > m_digitizeStrip
Definition: sTgcFastDigiTool.h:67
NswErrorCalibData::Input
Helper struct to be parsed to the object to derive the specific error of the cluster.
Definition: NswErrorCalibData.h:25
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
MuonR4::sTgcFastDigiTool::sTgcFastDigiTool
sTgcFastDigiTool(const std::string &type, const std::string &name, const IInterface *pIID)
Definition: sTgcFastDigiTool.cxx:17
MuonGMR4::PadDesign
Definition: PadDesign.h:24
MuonR4::sTgcFastDigiTool::digitizePad
bool digitizePad(const EventContext &ctx, const TimedHit &timedHit, const Muon::DigitEffiData *effiData, CLHEP::HepRandomEngine *rndEngine, sTgcDigitCollection &outCollection) const
Definition: sTgcFastDigiTool.cxx:305
MuonR4::MuonDigitizationTool::fetchCollection
DigitColl * fetchCollection(const Identifier &hitId, OutDigitCache_t< DigitColl > &digitCache) const
Helper function that provides fetches the proper DigitCollection from the DigitCache for a given hit ...
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
HepMCHelpers.h
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:202
Identifier
Definition: IdentifierFieldParser.cxx:14