ATLAS Offline Software
sTgcFastDigiTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "sTgcFastDigiTool.h"
5 #include "CLHEP/Random/RandGaussZiggurat.h"
6 #include "CLHEP/Random/RandFlat.h"
8 namespace {
9  constexpr double percentage(unsigned int numerator, unsigned int denom) {
10  return 100. * numerator / std::max(denom, 1u);
11  }
12  using channelType = sTgcIdHelper::sTgcChannelTypes;
13 }
14 namespace MuonR4 {
15 
16  sTgcFastDigiTool::sTgcFastDigiTool(const std::string& type, const std::string& name, const IInterface* pIID):
18 
24  return StatusCode::SUCCESS;
25  }
27  ATH_MSG_INFO("Tried to convert "<<m_allHits[channelType::Strip]<<"/"
28  <<m_allHits[channelType::Wire]<<"/"
29  <<m_allHits[channelType::Pad]<<" strip/wire/pad hits. In, "
30  <<percentage(m_acceptedHits[channelType::Strip], m_allHits[channelType::Strip]) <<"/"
31  <<percentage(m_acceptedHits[channelType::Wire], m_allHits[channelType::Wire])<<"/"
32  <<percentage(m_acceptedHits[channelType::Pad], m_allHits[channelType::Pad])
33  <<"% of the cases, the conversion was successful");
34  return StatusCode::SUCCESS;
35  }
36  StatusCode sTgcFastDigiTool::digitize(const EventContext& ctx,
37  const TimedHits& hitsToDigit,
38  xAOD::MuonSimHitContainer* sdoContainer) const {
39  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
40  // Prepare the temporary cache
41  DigiCache digitCache{};
43  const Muon::DigitEffiData* efficiencyMap{nullptr};
44  ATH_CHECK(retrieveConditions(ctx, m_effiDataKey, efficiencyMap));
45  const NswErrorCalibData* nswUncertDB{nullptr};
46  ATH_CHECK(retrieveConditions(ctx, m_uncertCalibKey, nswUncertDB));
47 
48  CLHEP::HepRandomEngine* rndEngine = getRandomEngine(ctx);
49  xAOD::ChamberViewer viewer{hitsToDigit, m_idHelperSvc.get()};
50  do {
51  for (const TimedHit& simHit : viewer) {
53  if (m_digitizeMuonOnly && std::abs(simHit->pdgId()) != 13){
54  continue;
55  }
56  sTgcDigitCollection* digiColl = fetchCollection(simHit->identify(), digitCache);
57  const bool digitizedStrip = digitizeStrip(ctx, simHit, nswUncertDB, efficiencyMap, rndEngine, *digiColl);
58  const bool digitizedWire = digitizeWire(ctx, simHit, efficiencyMap, rndEngine, *digiColl);
59  const bool digitizedPad = digitizePad(ctx, simHit, efficiencyMap, rndEngine, *digiColl);
60 
61  if (digitizedStrip) {
62  xAOD::MuonSimHit* sdo = addSDO(simHit, sdoContainer);
63  size_t stripIdx = digiColl->size() - 1 - digitizedWire - digitizedPad;
64  sdo->setIdentifier(digiColl->at(stripIdx)->identify());
65  } else if (digitizedWire || digitizedPad) {
66  xAOD::MuonSimHit* sdo = addSDO(simHit, sdoContainer);
67  sdo->setIdentifier(digiColl->at(digiColl->size() - 1)->identify());
68  const MuonGMR4::sTgcReadoutElement* re{m_detMgr->getsTgcReadoutElement(simHit->identify())};
69 
70  const Amg::Transform3D etaToPhi{re->globalToLocalTrans(getGeoCtx(ctx), re->layerHash(sdo->identify())) *
71  re->localToGlobalTrans(getGeoCtx(ctx), re->layerHash(simHit->identify()))};
72 
73  sdo->setLocalDirection(xAOD::toStorage(etaToPhi * xAOD::toEigen(sdo->localDirection())));
74  sdo->setLocalPosition(xAOD::toStorage(etaToPhi * xAOD::toEigen(sdo->localPosition())));
75  }
76  }
77  } while (viewer.next());
79  ATH_CHECK(writeDigitContainer(ctx, m_writeKey, std::move(digitCache),
80  idHelper.module_hash_max()));
81  return StatusCode::SUCCESS;
82  }
83  bool sTgcFastDigiTool::digitizeStrip(const EventContext& ctx,
84  const TimedHit& timedHit,
85  const NswErrorCalibData* errorCalibDB,
86  const Muon::DigitEffiData* efficiencyMap,
87  CLHEP::HepRandomEngine* rndEngine,
88  sTgcDigitCollection& outCollection) const {
89 
90  if (!m_digitizeStrip) {
91  return false;
92  }
93  ++m_allHits[channelType::Strip];
94  const Identifier hitId{timedHit->identify()};
95  const MuonGMR4::sTgcReadoutElement* readOutEle{m_detMgr->getsTgcReadoutElement(hitId)};
96 
97  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
98 
99  const int gasGap = idHelper.gasGap(hitId);
100  const MuonGMR4::StripDesign& design{readOutEle->stripDesign(hitId)};
101 
102  const Amg::Vector2D stripPos{xAOD::toEigen(timedHit->localPosition()).block<2,1>(0,0)};
103 
104  const int stripNum = design.stripNumber(stripPos);
105  if (stripNum < 0) {
106  ATH_MSG_VERBOSE("Strip hit "<<Amg::toString(stripPos)<<" "<<m_idHelperSvc->toStringGasGap(hitId)
107  <<" is out of range "<<std::endl<<design);
108  return false;
109  }
110 
111  bool isValid{false};
112  const Identifier stripId = idHelper.channelID(hitId, readOutEle->multilayer(),
113  gasGap, channelType::Strip, stripNum, isValid);
114 
115  if (!isValid) {
116  ATH_MSG_WARNING("Failed to deduce a valid identifier from "
117  <<m_idHelperSvc->toStringGasGap(hitId)<<" strip: "<<stripNum);
118  return false;
119  }
120 
122  bool isInnerQ1 = readOutEle->isEtaZero(readOutEle->measurementHash(hitId), stripPos);
123  if (efficiencyMap && efficiencyMap->getEfficiency(hitId, isInnerQ1) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
124  ATH_MSG_VERBOSE("Simulated strip hit "<<xAOD::toEigen(timedHit->localPosition())
125  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
126  return false;
127  }
128 
129  NswErrorCalibData::Input errorCalibInput{};
130  errorCalibInput.stripId= stripId;
131  errorCalibInput.locTheta = M_PI - timedHit->localDirection().theta();
132  errorCalibInput.clusterAuthor = 3; // centroid
133 
134  const double uncert = errorCalibDB->clusterUncertainty(errorCalibInput);
135  const double smearedX = CLHEP::RandGaussZiggurat::shoot(rndEngine, stripPos.x(), uncert);
136 
137  const Amg::Vector2D digitPos{smearedX * Amg::Vector2D::UnitX()};
138 
139  const int digitStrip = design.stripNumber(digitPos);
140  if (digitStrip < 0) {
141  ATH_MSG_VERBOSE("Smeared strip hit "<<Amg::toString(digitPos)<<" "<<m_idHelperSvc->toStringGasGap(hitId)
142  <<" is out of range "<<std::endl<<design);
143  return false;
144  }
145  const Identifier digitId = idHelper.channelID(hitId, readOutEle->multilayer(),
146  gasGap, channelType::Strip, digitStrip, isValid);
147 
148  if (!isValid) {
149  ATH_MSG_WARNING("Failed to deduce a valid identifier from "
150  <<m_idHelperSvc->toStringGasGap(hitId)<<" digit: "<<digitStrip);
151  return false;
152  }
153  constexpr double dummyCharge = 66666;
174  const double pull = (smearedX - (*design.center(digitStrip)).x()) / design.stripPitch();
175  const double w1 = CLHEP::RandFlat::shoot(rndEngine, 0., 0.5 *(1. - pull));
176  const double w2 = 1. - pull -2.*w1;
177  const double w3 = pull + w1;
178  const Identifier stripIdB = idHelper.channelID(hitId, readOutEle->multilayer(),
179  gasGap, channelType::Strip, digitStrip -1, isValid);
180  if (isValid) {
181  outCollection.push_back(std::make_unique<sTgcDigit>(stripIdB,
182  associateBCIdTag(ctx, timedHit),
183  hitTime(timedHit), dummyCharge * w1, false, false));
184  }
185  outCollection.push_back(std::make_unique<sTgcDigit>(digitId,
186  associateBCIdTag(ctx, timedHit),
187  hitTime(timedHit), dummyCharge * w2, false, false));
188 
189  const Identifier stripIdA = idHelper.channelID(hitId, readOutEle->multilayer(),
190  gasGap, channelType::Strip, digitStrip + 1, isValid);
191  if (isValid) {
192  outCollection.push_back(std::make_unique<sTgcDigit>(stripIdA,
193  associateBCIdTag(ctx, timedHit),
194  hitTime(timedHit), dummyCharge * w3, false, false));
195  }
196  ++m_acceptedHits[channelType::Strip];
197  return true;
198  }
199 
200  bool sTgcFastDigiTool::digitizeWire(const EventContext& ctx,
201  const TimedHit& timedHit,
202  const Muon::DigitEffiData* efficiencyMap,
203  CLHEP::HepRandomEngine* rndEngine,
204  sTgcDigitCollection& outCollection) const {
205 
206  if (!m_digitizeWire) {
207  return false;
208  }
209 
210  ++m_allHits[channelType::Wire];
211 
212  const Identifier hitId{timedHit->identify()};
214  if (efficiencyMap && efficiencyMap->getEfficiency(hitId) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
215  ATH_MSG_VERBOSE("Simulated wire hit "<<xAOD::toEigen(timedHit->localPosition())
216  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
217  return false;
218  }
219  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
220  const MuonGMR4::sTgcReadoutElement* readOutEle = m_detMgr->getsTgcReadoutElement(hitId);
221  const int gasGap = idHelper.gasGap(hitId);
222 
223 
225  // Rotate the sim hit into the wire view
226  const IdentifierHash stripLayHash{readOutEle->createHash(gasGap, channelType::Strip, 0)};
227  const IdentifierHash wireLayHash{readOutEle->createHash(gasGap, channelType::Wire, 0)};
228 
229  const ActsGeometryContext& gctx{getGeoCtx(ctx)};
230  const Amg::Transform3D toWire{readOutEle->globalToLocalTrans(gctx, wireLayHash) *
231  readOutEle->localToGlobalTrans(gctx, stripLayHash)};
232 
233  const Amg::Vector2D wirePos{(toWire*xAOD::toEigen(timedHit->localPosition())).block<2,1>(0,0)};
234  // do not digitise wires that are never read out in reality
235  bool isInnerQ1 = readOutEle->isEtaZero(readOutEle->measurementHash(hitId), wirePos);
236  if(isInnerQ1) return false;
237 
239  if (efficiencyMap && efficiencyMap->getEfficiency(hitId, isInnerQ1) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
240  ATH_MSG_VERBOSE("Simulated wire hit "<<xAOD::toEigen(timedHit->localPosition())
241  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
242  return false;
243  }
244 
245  const MuonGMR4::WireGroupDesign& design{readOutEle->wireDesign(gasGap)};
246 
247  const int wireGrpNum = design.stripNumber(wirePos);
248  if (wireGrpNum < 0) {
249  ATH_MSG_VERBOSE("The wire "<<Amg::toString(wirePos)<<" in "<<m_idHelperSvc->toStringGasGap(hitId)
250  <<" is outside of the acceptance of "<<std::endl<<design);
251  return false;
252  }
253  const double uncert = design.stripPitch() * design.numWiresInGroup(wireGrpNum);
254 
255  const double smearedX = CLHEP::RandGaussZiggurat::shoot(rndEngine, wirePos.x(), uncert);
256 
257  const Amg::Vector2D digitPos{smearedX * Amg::Vector2D::UnitX()};
258 
259  const int digitWire = design.stripNumber(digitPos);
260  if (digitWire < 0) {
261  ATH_MSG_VERBOSE("Strip hit "<<Amg::toString(digitPos)<<" "<<m_idHelperSvc->toStringGasGap(hitId)
262  <<" is out of range "<<std::endl<<design);
263  return false;
264  }
265  bool isValid{false};
266  const Identifier digitId = idHelper.channelID(hitId, readOutEle->multilayer(),
267  gasGap, channelType::Wire, digitWire, isValid);
268 
269  if (!isValid) {
270  ATH_MSG_WARNING("Failed to deduce a valid identifier from "
271  <<m_idHelperSvc->toStringGasGap(hitId)<<" digit: "<<digitWire);
272  return false;
273  }
274  outCollection.push_back(std::make_unique<sTgcDigit>(digitId,
275  associateBCIdTag(ctx, timedHit),
276  hitTime(timedHit), 666, false, false));
277 
278 
279  ++m_acceptedHits[channelType::Wire];
280  return true;
281  }
282  int sTgcFastDigiTool::associateBCIdTag(const EventContext& /*ctx*/,
283  const TimedHit& /*timedHit*/) const {
285  return 0;
286  }
287 
288  bool sTgcFastDigiTool::digitizePad(const EventContext& ctx,
289  const TimedHit& timedHit,
290  const Muon::DigitEffiData* efficiencyMap,
291  CLHEP::HepRandomEngine* rndEngine,
292  sTgcDigitCollection& outCollection) const {
293 
294  if (!m_digitizePads) {
295  return false;
296  }
297 
298  ++m_allHits[channelType::Pad];
299 
300  const Identifier hitId{timedHit->identify()};
301  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
302  const MuonGMR4::sTgcReadoutElement* readOutEle = m_detMgr->getsTgcReadoutElement(hitId);
303  const int gasGap = idHelper.gasGap(hitId);
304 
305 
307  // Rotate the sim hit into the wire view
308  const IdentifierHash stripLayHash{readOutEle->createHash(gasGap, channelType::Strip, 0)};
309  const IdentifierHash padLayerHash{readOutEle->createHash(gasGap, channelType::Pad, 0)};
310 
311  const ActsGeometryContext& gctx{getGeoCtx(ctx)};
312  const Amg::Transform3D toPad{readOutEle->globalToLocalTrans(gctx, padLayerHash) *
313  readOutEle->localToGlobalTrans(gctx, stripLayHash)};
314 
315  const Amg::Vector2D padPos{(toPad*xAOD::toEigen(timedHit->localPosition())).block<2,1>(0,0)};
317  const MuonGMR4::PadDesign& design{readOutEle->padDesign(gasGap)};
318 
319  const auto [padEta, padPhi] = design.channelNumber(padPos);
320  if (padEta < 0 || padPhi < 0) {
321  ATH_MSG_VERBOSE("The pad "<<Amg::toString(padPos)<<" in "<<m_idHelperSvc->toStringGasGap(hitId)
322  <<" is outside of the acceptance of "<<std::endl<<design);
323  return false;
324  }
325  bool isValid{false};
326  const Identifier padId = idHelper.padID(hitId, readOutEle->multilayer(),
327  gasGap, channelType::Pad, padEta, padPhi, isValid);
328 
329 
330  if (!isValid) {
331  ATH_MSG_WARNING("Failed to decuce a valid pad Identifier from "<<Amg::toString(padPos)
332  <<" in "<<m_idHelperSvc->toStringGasGap(hitId));
333  return false;
334  }
335 
337  bool isInnerQ1 = readOutEle->isEtaZero(readOutEle->measurementHash(hitId), padPos);
338  if (efficiencyMap && efficiencyMap->getEfficiency(hitId, isInnerQ1) < CLHEP::RandFlat::shoot(rndEngine,0.,1.)){
339  ATH_MSG_VERBOSE("Simulated pad hit "<<xAOD::toEigen(timedHit->localPosition())
340  << m_idHelperSvc->toString(hitId) <<" is rejected because of efficency modelling");
341  return false;
342  }
343 
344 
345 
346  outCollection.push_back(std::make_unique<sTgcDigit>(padId,
347  associateBCIdTag(ctx, timedHit),
348  hitTime(timedHit), 666, false, false));
349 
350  ++m_acceptedHits[channelType::Pad];
351 
352  return true;
353  }
354 
355 
356 }
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
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:19
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:36
MuonR4::sTgcFastDigiTool::associateBCIdTag
int associateBCIdTag(const EventContext &ctx, const TimedHit &timedHit) const
: Associates the global bcIdTag to the digit
Definition: sTgcFastDigiTool.cxx:282
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:68
xAOD::MuonSimHit_v1::setLocalPosition
void setLocalPosition(MeasVector< 3 > vec)
Sets the local position of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:55
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:620
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
MuonR4::MuonDigitizationTool::retrieveConditions
StatusCode retrieveConditions(const EventContext &ctx, const SG::ReadCondHandleKey< Container > &key, const Container *&contPtr) const
Helper function to access the conditions data.
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.
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:65
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
MuonR4::MuonDigitizationTool::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const EventContext &ctx) const
Definition: MuonDigitizationTool.cxx:135
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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:36
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:282
xAOD::MuonSimHit_v1::localDirection
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:65
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:335
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:200
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:141
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:148
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:26
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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:61
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
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:69
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::MuonDigitizationTool::initialize
StatusCode initialize() override
Definition: MuonDigitizationTool.cxx:17
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:83
MuonDigit::identify
Identifier identify() const
Definition: MuonDigit.h:30
MuonR4::MuonDigitizationTool
Barebone implementation of the I/O infrastructure for all MuonDigitizationTools.
Definition: MuonDigitizationTool.h:41
MuonR4::MuonDigitizationTool::TimedHits
std::vector< TimedHitPtr< xAOD::MuonSimHit > > TimedHits
Definition: MuonDigitizationTool.h:71
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonR4::MuonDigitizationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonDigitizationTool.h:142
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:59
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:140
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:16
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:288
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.
Identifier
Definition: IdentifierFieldParser.cxx:14