ATLAS Offline Software
MdtRdoToPrepDataToolMT.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <algorithm>
8 #include <vector>
9 
10 #include "GaudiKernel/PhysicalConstants.h"
12 #include "MdtRDO_Decoder.h"
22 
23 
24 using namespace MuonGM;
25 using namespace Trk;
26 
28 
29 
30 namespace {
31  // the tube number of a tube in a tubeLayer is encoded in the GeoSerialIdentifier (modulo maxNTubesPerLayer)
32  constexpr unsigned int maxNTubesPerLayer = MdtIdHelper::maxNTubesPerLayer;
33 
34  inline void updateClosestApproachTwin(MdtCalibInput & in) {
35  const MuonGM::MdtReadoutElement* descriptor = in.legacyDescriptor();
36  if (descriptor) {
37  if (std::abs(descriptor->getStationS()) < std::numeric_limits<double>::epsilon()) {
38  return;
39  }
40  const Amg::Vector3D nominalTubePos = descriptor->tubePos(in.identify());
41  double measuredPerp = std::sqrt(nominalTubePos.perp2() - descriptor->getStationS()* descriptor->getStationS());
42  CxxUtils::sincos tubeSC{nominalTubePos.phi()};
43  Amg::Vector3D measurePos{tubeSC.cs * measuredPerp, tubeSC.sn *measuredPerp, nominalTubePos.z()};
44  in.setClosestApproach(measurePos);
45  }
46  }
47 } // namespace
48 
49 namespace Muon {
50 
51 
52  MdtRdoToPrepDataToolMT::ConvCache::ConvCache(const Muon::IMuonIdHelperSvc* idHelperSvc):
53  m_idHelperSvc{idHelperSvc} {
54  addedCols.resize(m_idHelperSvc->mdtIdHelper().module_hash_max());
55  }
56 
58 
59  IdentifierHash mdtHashId = m_idHelperSvc->moduleHash(elementId);
60 
61  std::unique_ptr<MdtPrepDataCollection>& coll {addedCols[mdtHashId]};
62  if (!coll) {
63  coll = std::make_unique<MdtPrepDataCollection>(mdtHashId);
64  coll->setIdentifier(m_idHelperSvc->chamberId(elementId));
65  }
66  return coll.get();
67  }
69  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
70 
71  for (unsigned int moduleHash =0; moduleHash < addedCols.size(); ++moduleHash) {
72  std::unique_ptr<MdtPrepDataCollection>& toInsert{addedCols[moduleHash]};
73  if (!toInsert || toInsert->empty()) continue;
74  if (xAODPrd) {
76  std::vector<const MdtPrepData*> sortMe{toInsert->begin(), toInsert->end()};
77  std::ranges::sort(sortMe, IdentifierByDetElSorter{m_idHelperSvc});
78  for (const MdtPrepData* prd : sortMe) {
79  const Identifier prdId{prd->identify()};
80  xAOD::MdtDriftCircle* dc{nullptr};
82  if (!xAODTwinPrd|| !twinTubeMap || twinTubeMap->twinId(prdId) == prdId ||
83  prd->dimension() == 1) {
84  dc = xAODPrd->push_back(std::make_unique<xAOD::MdtDriftCircle>());
85  } else {
86  dc = xAODTwinPrd->push_back(std::make_unique<xAOD::MdtTwinDriftCircle>());
87  }
89  dc->setIdentifier(prdId.get_compact());
90  dc->setTdc(prd->tdc());
91  dc->setAdc(prd->adc());
92  dc->setTube(idHelper.tube(prdId));
93  dc->setLayer(idHelper.tubeLayer(prdId));
94  dc->setStatus(prd->status());
95  if (r4DetMgr){
96  dc->setReadoutElement(r4DetMgr->getMdtReadoutElement(prdId));
97  }
98  const IdentifierHash detHash{m_idHelperSvc->detElementHash(prdId)};
99  float driftRadius{0.f}, driftCov{0.f};
100  if (prd->status() == MdtDriftCircleStatus::MdtStatusDriftTime) {
101  driftRadius = prd->localPosition().x();
102  driftCov = prd->localCovariance()(0,0);
103  } else {
105  const float maxR = r4DetMgr ? dc->readoutElement()->innerTubeRadius()
106  : prd->detectorElement()->innerTubeRadius();
107  driftCov = std::pow(maxR, 2);
108  }
110  if (dc->numDimensions() == 1) {
113  dc->setMeasurement<1>(detHash, std::move(locPos), std::move(locCov));
114  } else {
116  locCov(Trk::locR, Trk::locR) = prd->localCovariance()(Trk::locR, Trk::locR);
117  locCov(Trk::locZ, Trk::locZ) = prd->localCovariance()(Trk::locZ, Trk::locZ);
118  dc->setMeasurement<2>(detHash, xAOD::toStorage(prd->localPosition()), std::move(locCov));
119  auto* twinDC{static_cast<xAOD::MdtTwinDriftCircle*>(dc)};
120  auto* twinPRD{static_cast<const MdtTwinPrepData*>(prd)};
121  twinDC->setTwinAdc(twinPRD->adcTwin());
122  twinDC->setTwinTdc(twinPRD->tdcTwin());
123  const Identifier twinId = twinTubeMap->twinId(prdId);
124  twinDC->setTwinTube(idHelper.tube(twinId));
125  twinDC->setTwinLayer(idHelper.tubeLayer(twinId));
126  }
127  }
128  }
129  MdtPrepDataContainer::IDC_WriteHandle lock = legacyPrd->getWriteHandle(moduleHash);
130  if (lock.addOrDelete(std::move(toInsert)).isFailure()) {
131  msg << MSG::ERROR << " Failed to add prep data collection " << moduleHash << endmsg;
132  return StatusCode::FAILURE;
133  }
134  }
135  if (xAODPrd) {
136  xAODPrd->lock();
137  }
138  if (xAODTwinPrd) {
139  xAODTwinPrd->lock();
140  }
141  return StatusCode::SUCCESS;
142  }
143 
144  MdtRdoToPrepDataToolMT::MdtRdoToPrepDataToolMT(const std::string& t, const std::string& n, const IInterface* p) :
145  base_class(t, n, p) {}
146 
148  ATH_CHECK(m_calibrationTool.retrieve());
149  ATH_MSG_VERBOSE("MdtCalibrationTool retrieved with pointer = " << m_calibrationTool);
150  ATH_CHECK(m_prdContainerCacheKey.initialize(!m_prdContainerCacheKey.key().empty()));
151  ATH_CHECK(m_idHelperSvc.retrieve());
152  // Retrieve the RDO decoder
153  ATH_CHECK(m_mdtDecoder.retrieve());
154 
155  ATH_CHECK(m_twinTubeKey.initialize(m_useTwin));
156 
157  m_BMGid = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG");
158  m_BMGpresent = m_BMGid != -1;
159  if (m_useNewGeo) {
161  }
162  if (m_BMGpresent && !m_useNewGeo) {
163  const MuonGM::MuonDetectorManager* muDetMgr = nullptr;
164  ATH_CHECK(detStore()->retrieve(muDetMgr));
165 
166  ATH_MSG_INFO("Processing configuration for layouts with BMG chambers.");
167 
168  for (int phi = 6; phi < 8; phi++) { // phi sectors
169  for (int eta = 1; eta < 4; eta++) { // eta sectors
170  for (int side = -1; side < 2; side += 2) { // side
171  if (!muDetMgr->getMuonStation("BMG", side * eta, phi)) continue;
172  for (int roe = 1; roe <= (muDetMgr->getMuonStation("BMG", side * eta, phi))->nMuonReadoutElements();
173  roe++) { // iterate on readout elemets
174  const MdtReadoutElement* mdtRE = dynamic_cast<const MdtReadoutElement*>(
175  (muDetMgr->getMuonStation("BMG", side * eta, phi))->getMuonReadoutElement(roe)); // has to be an MDT
176  if (mdtRE) initDeadChannels(mdtRE);
177  }
178  }
179  }
180  }
181  } else if (m_useNewGeo) {
182  std::vector<const MuonGMR4::MdtReadoutElement*> mdtRE = m_detMgrR4->getAllMdtReadoutElements();
183  for (const MuonGMR4::MdtReadoutElement* re : mdtRE) {
184  if (re->stationName() != m_BMGid) {
185  continue;
186  }
187  for (const IdentifierHash& dead : re->getParameters().removedTubes) {
188  m_DeadChannels.insert(re->measurementId(dead));
189  }
190  }
191  }
192 
193  // check if initializing of DataHandle objects success
195  ATH_CHECK(m_mdtPrepDataContainerKey.initialize());
198  ATH_CHECK(m_xAODKey.initialize(!m_xAODKey.empty()));
199  ATH_CHECK(m_xAODTwinKey.initialize(!m_xAODTwinKey.empty()));
201  return StatusCode::SUCCESS;
202  }
203 
204  StatusCode MdtRdoToPrepDataToolMT::decode(const EventContext& ctx, const std::vector<uint32_t>& robIds) const {
206  const MuonMDT_CablingMap* readCdo{*readHandle};
207  if (!readCdo) {
208  ATH_MSG_ERROR("nullptr to the read conditions object");
209  return StatusCode::FAILURE;
210  }
211  return decode(ctx, readCdo->getMultiLayerHashVec(robIds, msgStream()));
212  }
213 
214  const MdtCsmContainer* MdtRdoToPrepDataToolMT::getRdoContainer(const EventContext& ctx) const {
215  SG::ReadHandle rdoContainerHandle{m_rdoContainerKey, ctx};
216  if (rdoContainerHandle.isValid()) {
217  ATH_MSG_DEBUG("MdtgetRdoContainer success");
218  return rdoContainerHandle.cptr();
219  }
220  ATH_MSG_WARNING("Retrieval of Mdt RDO container failed !");
221  return nullptr;
222  }
223 
225  return setupMdtPrepDataContainer(ctx).isValid ? StatusCode::SUCCESS : StatusCode::FAILURE;
226  }
227 
228  void MdtRdoToPrepDataToolMT::processPRDHashes(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
229  const std::vector<IdentifierHash>& multiLayerHashInRobs) const {
230  for (const IdentifierHash& hash : multiLayerHashInRobs) {
231  if (!handlePRDHash(ctx, mdtPrepDataContainer, hash)) { ATH_MSG_DEBUG("Failed to process hash " << hash); }
232  } // ends loop over chamberhash
233  }
234 
235  bool MdtRdoToPrepDataToolMT::handlePRDHash(const EventContext& ctx,
236  ConvCache& mdtPrepDataContainer,
237  IdentifierHash rdoHash) const {
238  const MdtCsmContainer* rdoContainer{getRdoContainer(ctx)};
239 
240  if (rdoContainer->empty()) {
241  ATH_MSG_DEBUG("The container is empty");
242  return true;
243  }
244  const MdtCsm* rdoColl = rdoContainer->indexFindPtr(rdoHash);
245  if (!rdoColl) {
246  ATH_MSG_DEBUG("The rdo container does not have the hash " << rdoHash);
247  return true;
248  }
249  if (processCsm(ctx, mdtPrepDataContainer, rdoColl).isFailure()) {
250  ATH_MSG_WARNING("processCsm failed for RDO id " << m_idHelperSvc->toString(rdoColl->identify()));
251  return false;
252  }
253  return true;
254  }
255 
256  StatusCode MdtRdoToPrepDataToolMT::decode(const EventContext& ctx,
257  const std::vector<IdentifierHash>& idVect) const {
258 
259  ATH_MSG_DEBUG("decodeMdtRDO for " << idVect.size() << " offline collections called");
260 
261  // setup output container
262  ConvCache mdtPrepDataContainer = setupMdtPrepDataContainer(ctx);
263  if (!mdtPrepDataContainer.isValid) {
264  return StatusCode::FAILURE;
265  }
266 
267 
268  if (!m_decodeData) {
269  ATH_MSG_DEBUG("Stored empty container. Decoding MDT RDO into MDT PrepRawData is switched off");
270  return StatusCode::SUCCESS;
271  }
272  // seeded or unseeded decoding
273  if (!idVect.empty()) {
274  processPRDHashes(ctx, mdtPrepDataContainer, idVect);
275  } else {
277  std::vector<IdentifierHash> rdoHashes{};
278  const MdtCsmContainer* rdoContainer = getRdoContainer(ctx);
279  if (!rdoContainer || rdoContainer->empty()) return StatusCode::SUCCESS;
280  rdoHashes.reserve(rdoContainer->size());
281  for (const MdtCsm* csm : *rdoContainer) rdoHashes.push_back(csm->identifyHash());
282 
283  processPRDHashes(ctx, mdtPrepDataContainer, rdoHashes);
284  }
285  ATH_CHECK(mdtPrepDataContainer.finalize(msgStream()));
286 
287  return StatusCode::SUCCESS;
288  }
289 
290  std::unique_ptr<MdtPrepData> MdtRdoToPrepDataToolMT::createPrepData(const MdtCalibInput& calibInput,
291  const MdtCalibOutput& calibOutput,
292  ConvCache& cache) const {
293  if (calibInput.adc() < m_adcCut ||
295  ATH_MSG_VERBOSE("Do not create calib hit for "<<m_idHelperSvc->toString(calibInput.identify())
296  <<", adc: "<<calibInput.adc()<<" vs. "<<m_adcCut<<", calibration bailed out "
297  <<(calibOutput.status() == MdtDriftCircleStatus::MdtStatusUnDefined? "si": "no"));
298  return nullptr;
299  }
300  const MuonGM::MdtReadoutElement* descriptor = calibInput.legacyDescriptor();
301  if (!descriptor) {
302  if (!cache.legacyDetMgr) {
303  return nullptr;
304  }
305  descriptor = cache.legacyDetMgr->getMdtReadoutElement(calibInput.identify());
306  }
307  ATH_MSG_VERBOSE("Calibrated prepdata "<<m_idHelperSvc->toString(calibInput.identify())
308  <<std::endl<<calibInput<<std::endl<<calibOutput);
309 
311  Amg::MatrixX cov(1, 1);
312  if (calibOutput.status() == MdtDriftCircleStatus::MdtStatusDriftTime){
314  const float r = calibOutput.driftRadius();
315  const float sigR = calibOutput.driftRadiusUncert();
316  driftRadius[0] = r;
317  (cov)(0, 0) = sigR * sigR;
318  } else (cov)(0, 0) = std::pow(descriptor->innerTubeRadius(), 2);
319 
320  return std::make_unique<MdtPrepData>(calibInput.identify(),
321  std::move(driftRadius),
322  std::move(cov),
323  descriptor,
324  calibInput.tdc(),
325  calibInput.adc(),
326  calibOutput.status());
327  }
328 
329  StatusCode MdtRdoToPrepDataToolMT::processCsm(const EventContext& ctx, ConvCache& cache, const MdtCsm* rdoColl) const {
330  const MdtIdHelper& id_helper = m_idHelperSvc->mdtIdHelper();
331  // first handle the case of twin tubes
332  if (m_useTwin) {
333  if (cache.twinTubeMap->isTwinTubeLayer(rdoColl->identify())) {
334  return processCsmTwin(ctx, cache, rdoColl);
335  }
336  }
337 
338  ATH_MSG_DEBUG(" ***************** Start of processCsm");
339 
341  const Identifier elementId = id_helper.parentID(rdoColl->identify());
342 
343  uint16_t subdetId = rdoColl->SubDetId();
344  uint16_t mrodId = rdoColl->MrodId();
345  uint16_t csmId = rdoColl->CsmId();
346  ATH_MSG_VERBOSE("Identifier = " << m_idHelperSvc->toString(elementId) << " subdetId/ mrodId/ csmId = " << subdetId << " / "
347  << mrodId << " / " << csmId);
348 
349  // for each Csm, loop over AmtHit, converter AmtHit to digit
350  // retrieve/create digit collection, and insert digit into collection
351  int mc = 0;
352  for (const MdtAmtHit* amtHit : *rdoColl) {
353  mc++;
354 
355  // FIXME: Still use the digit class.
356  ATH_MSG_VERBOSE("Amt Hit n. " << mc << " tdcId = " << amtHit->tdcId());
357  std::unique_ptr<MdtDigit> newDigit{m_mdtDecoder->getDigit(ctx, *amtHit, subdetId, mrodId, csmId)};
358  if (!newDigit) {
359  ATH_MSG_WARNING("Found issue MDT RDO decoder for subdetId/mrodId/csmId "
360  << subdetId << "/" << mrodId << "/" << csmId << " amtHit channelId/tdcId =" << amtHit->channelId() << "/"
361  << amtHit->tdcId());
362  continue;
363  }
364  // Do something with it
365  Identifier channelId = newDigit->identify();
366  if (newDigit->isMasked() || m_DeadChannels.count(channelId)) {
367  continue;
368  }
369  // Retrieve the proper PRD container. Note that there are cases where one CSM is either split into 2 chambers (BEE / BIS78
370  // legacy) or 2 CSMs are split into one chamber
371  MdtPrepDataCollection* driftCircleColl = cache.createCollection(channelId);
372  if (!driftCircleColl) {
373  ATH_MSG_DEBUG("Corresponding multi layer " << m_idHelperSvc->toString(channelId) << " is already decoded.");
374  continue;
375  }
376 
377  // check if the module ID of this channel is different from the CSM one
378  // If it's the first case, create the additional collection
379 
380  ATH_MSG_VERBOSE("got digit with id ext / hash " << m_idHelperSvc->toString(channelId) << " / "
381  << driftCircleColl->identifyHash());
382 
383  // Rescale ADC/TDC of chambers using HPTDC digitization chip
384  // Must create a new digit from the old one, because MdtDigit has no methods to set ADC/TDC
385  if (m_idHelperSvc->hasHPTDC(channelId)) {
386  newDigit->setAdc(newDigit->adc() / 4);
387  newDigit->setTdc(newDigit->tdc() / 4);
388  }
389  const MdtCalibInput calibIn = m_useNewGeo ? MdtCalibInput{*newDigit, *m_detMgrR4, *cache.gctx}:
390  MdtCalibInput{*newDigit, *cache.legacyDetMgr};
391  const MdtCalibOutput calibResult{m_calibrationTool->calibrate(ctx, calibIn, false)};
392 
393  std::unique_ptr<MdtPrepData> newPrepData = createPrepData(calibIn, calibResult, cache);
394  if (newPrepData) {
395  newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
396  driftCircleColl->push_back(std::move(newPrepData));
397  }
398  }
399  return StatusCode::SUCCESS;
400  }
401  StatusCode MdtRdoToPrepDataToolMT::processCsmTwin(const EventContext& ctx, ConvCache& cache, const MdtCsm* rdoColl) const {
402  const MdtIdHelper& id_helper = m_idHelperSvc->mdtIdHelper();
403  ATH_MSG_DEBUG(" ***************** Start of processCsmTwin");
404  ATH_MSG_DEBUG(" Number of AmtHit in this Csm " << rdoColl->size());
406  Identifier elementId = id_helper.parentID(rdoColl->identify());
407 
408  uint16_t subdetId = rdoColl->SubDetId();
409  uint16_t mrodId = rdoColl->MrodId();
410  uint16_t csmId = rdoColl->CsmId();
411  ATH_MSG_VERBOSE("Identifier = " << m_idHelperSvc->toString(elementId) << " subdetId/ mrodId/ csmId = " << rdoColl->SubDetId()
412  << " / " << rdoColl->MrodId() << " / " << rdoColl->CsmId());
413 
414  // for each Csm, loop over AmtHit, converter AmtHit to digit
415  // retrieve/create digit collection, and insert digit into collection
416  std::map<Identifier, std::array<std::unique_ptr<MdtDigit>, 2>> mdtDigitColl{};
417 
418  for (const MdtAmtHit* amtHit : *rdoColl) {
419  std::unique_ptr<MdtDigit> newDigit{m_mdtDecoder->getDigit(ctx, *amtHit, subdetId, mrodId, csmId)};
420 
421  if (!newDigit) {
422  ATH_MSG_WARNING("Error in MDT RDO decoder for subdetId/mrodId/csmId "
423  << subdetId << "/" << mrodId << "/" << csmId << " amtHit channelId/tdcId =" << amtHit->channelId() << "/"
424  << amtHit->tdcId());
425  continue;
426  }
427  std::array<std::unique_ptr<MdtDigit>, 2> & moveTo = mdtDigitColl[newDigit->identify()];
428  if (!moveTo[0]) {
429  moveTo[0] = std::move(newDigit);
430  } else if (!moveTo[1] && !m_discardSecondaryHitTwin) {
431  moveTo[1] = std::move(newDigit);
432  } else {
433  ATH_MSG_VERBOSE(" TWIN TUBES: found a tertiary hit in a twin tube in one RdoCollection for "
434  << m_idHelperSvc->toString(newDigit->identify()) << " with adc = " << newDigit->adc()
435  << " tdc = " << newDigit->tdc());
436  }
437  } // end for-loop over rdoColl
438 
439  auto convertTwins = [this, &cache, &ctx](std::unique_ptr<MdtDigit> digit,
440  std::unique_ptr<MdtDigit> digit2) {
441  if (!digit || digit->isMasked() || !cache.legacyDetMgr) {
442  return;
443  }
444 
445  MdtPrepDataCollection* driftCircleColl = cache.createCollection(digit->identify());
446 
447  if (!digit2 || digit2->isMasked()) {
448  ATH_MSG_VERBOSE("Got single digit " << m_idHelperSvc->toString(digit->identify())<<", tdc: "
449  <<digit->tdc()<<", adc: "<<digit->adc()
450  << ", hash: "<< driftCircleColl->identifyHash());
451 
452  const MdtCalibInput mdtCalibIn = m_useNewGeo ? MdtCalibInput{*digit, *m_detMgrR4, *cache.gctx}:
453  MdtCalibInput{*digit, *cache.legacyDetMgr};
454 
455  const MdtCalibOutput mdtCalibOut{m_calibrationTool->calibrate(ctx, mdtCalibIn, false)};
456 
458  std::unique_ptr<MdtPrepData> newPrepData = createPrepData(mdtCalibIn, mdtCalibOut, cache);
459  if (!newPrepData) return;
460 
461  newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
462  driftCircleColl->push_back(std::move(newPrepData));
463  return;
464  }
465  ATH_MSG_VERBOSE("Twin digit calibration "<<m_idHelperSvc->toString(digit->identify())
466  <<", tdc: "<<digit->tdc()<<", adc: "<<digit->adc()<<" -- "
467  <<m_idHelperSvc->toString(digit2->identify())
468  <<", tdc: "<<digit2->tdc()<<", adc: "<<digit2->adc());
469  MdtCalibInput mdtCalib1st = m_useNewGeo ? MdtCalibInput{*digit, *m_detMgrR4, *cache.gctx}
470  : MdtCalibInput{*digit, *cache.legacyDetMgr};
471 
472  MdtCalibInput mdtCalib2nd = m_useNewGeo ? MdtCalibInput{*digit2, *m_detMgrR4, *cache.gctx}
473  : MdtCalibInput{*digit2, *cache.legacyDetMgr};
474 
475  updateClosestApproachTwin(mdtCalib1st);
476  updateClosestApproachTwin(mdtCalib2nd);
477 
478  const MdtCalibTwinOutput twinCalib = m_calibrationTool->calibrateTwinTubes(ctx,
479  std::move(mdtCalib1st),
480  std::move(mdtCalib2nd));
481 
482  Amg::Vector2D hitPos{twinCalib.primaryDriftR(), twinCalib.locZ()};
483  Amg::MatrixX cov(2, 2);
484  cov(0, 0) = twinCalib.uncertPrimaryR() * twinCalib.uncertPrimaryR();
485  cov(1, 1) = twinCalib.sigmaZ() * twinCalib.sigmaZ();
486  cov(0, 1) = cov(1, 0) = 0;
487 
488  const MuonGM::MdtReadoutElement* descriptor = cache.legacyDetMgr->getMdtReadoutElement(digit->identify());
489  auto twin_newPrepData = std::make_unique<MdtTwinPrepData>(twinCalib.primaryID(),
490  std::move(hitPos),
491  std::move(cov),
492  descriptor,
493  twinCalib.primaryTdc(),
494  twinCalib.primaryAdc(),
495  twinCalib.twinTdc(),
496  twinCalib.twinAdc(),
497  twinCalib.primaryStatus());
498 
499  ATH_MSG_VERBOSE(" MADE A 2D TWINPREPDATA " << m_idHelperSvc->toString(twinCalib.primaryID()) << " & "
500  << m_idHelperSvc->toString(twinCalib.twinID()) << " "<<twinCalib);
501 
502  ATH_MSG_VERBOSE("global pos center tube " << Amg::toString(twin_newPrepData->globalPosition(), 2) << std::endl
503  <<"local pos center tube w/ TWIN INFO "<<Amg::toString(twinCalib.locZ() * Amg::Vector3D::UnitZ(), 2)<<std::endl
504  <<"global pos w/o TWIN INFO "<<Amg::toString(descriptor->tubePos(twinCalib.primaryID())));
505 
506  twin_newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
507  driftCircleColl->push_back(std::move(twin_newPrepData));
508  };
509 
510  // iterate over mdtDigitColl
511  for (auto &[id, digits] : mdtDigitColl) {
512  // get the twin hits from mdtDigitColl
513  const Identifier twinId = cache.twinTubeMap->twinId(id);
515  if (id != twinId) {
516  std::array<std::unique_ptr<MdtDigit>, 2>& twinDigits = mdtDigitColl[twinId];
517  ATH_MSG_VERBOSE("Convert digits: "<<digits[0].get()<<" "<<twinDigits[0].get());
518  convertTwins(std::move(digits[0]), std::move(twinDigits[0]));
519  ATH_MSG_VERBOSE("Convert digits: "<<digits[1].get()<<" "<<twinDigits[1].get());
520  convertTwins(std::move(digits[1]), std::move(twinDigits[1]));
521  } else {
522  convertTwins(std::move(digits[0]), nullptr);
523  convertTwins(std::move(digits[1]), nullptr);
524  }
525  }
526  return StatusCode::SUCCESS;
527  }
529  PVConstLink cv = mydetEl->getMaterialGeom(); // it is "Multilayer"
530  int nGrandchildren = cv->getNChildVols();
531  if (nGrandchildren <= 0) return;
532 
533  std::vector<int> tubes;
534  geoGetIds([&](int id) { tubes.push_back(id); }, &*cv);
535  std::sort(tubes.begin(), tubes.end());
536 
537  const Identifier detElId = mydetEl->identify();
538  const int ml = mydetEl->getMultilayer();
539  std::vector<int>::iterator it = tubes.begin();
540  for (int layer = 1; layer <= mydetEl->getNLayers(); layer++) {
541  for (int tube = 1; tube <= mydetEl->getNtubesperlayer(); tube++) {
542  int want_id = layer * maxNTubesPerLayer + tube;
543  if (it != tubes.end() && *it == want_id) {
544  ++it;
545  } else {
546  it = std::lower_bound(tubes.begin(), tubes.end(), want_id);
547  if (it != tubes.end() && *it == want_id) {
548  ++it;
549  } else {
550  Identifier deadTubeId = m_idHelperSvc->mdtIdHelper().channelID(detElId, ml, layer, tube);
551  m_DeadChannels.insert(deadTubeId);
552  ATH_MSG_VERBOSE("adding dead tube "<<m_idHelperSvc->toString(deadTubeId));
553  }
554  }
555  }
556  }
557 
558  }
560 
561  ConvCache cache{m_idHelperSvc.get()};
562 
564  // Caching of PRD container
565  if (m_prdContainerCacheKey.key().empty()) {
566  // without the cache we just record the container
567  StatusCode status = handle.record(std::make_unique<MdtPrepDataContainer>(m_idHelperSvc->mdtIdHelper().module_hash_max()));
568  if (status.isFailure() || !handle.isValid()) {
569  ATH_MSG_FATAL("Could not record container of MDT PrepData Container at " << m_mdtPrepDataContainerKey.key());
570  return cache;
571  }
572  ATH_MSG_VERBOSE("Created container " << m_mdtPrepDataContainerKey.key());
573  cache.legacyPrd = handle.ptr();
574  } else {
575  // use the cache to get the container
577  if (!update.isValid()) {
578  ATH_MSG_FATAL("Invalid UpdateHandle " << m_prdContainerCacheKey.key());
579  return cache;
580  }
581  StatusCode status = handle.record(std::make_unique<MdtPrepDataContainer>(update.ptr()));
582  if (status.isFailure() || !handle.isValid()) {
583  ATH_MSG_FATAL("Could not record container of MDT PrepData Container using cache " << m_prdContainerCacheKey.key() << " - "
584  << m_mdtPrepDataContainerKey.key());
585  return cache;
586  }
587  ATH_MSG_VERBOSE("Created container using cache for " << m_prdContainerCacheKey.key());
588  cache.legacyPrd = handle.ptr();
589  }
590  if (!m_xAODTwinKey.empty()) {
591  SG::WriteHandle writeHandle{m_xAODTwinKey, ctx};
592  if (!writeHandle.recordNonConst(std::make_unique<xAOD::MdtTwinDriftCircleContainer>(),
593  std::make_unique<xAOD::MdtTwinDriftCircleAuxContainer>()).isSuccess() ||
594  !writeHandle.isValid()) {
595  ATH_MSG_FATAL("Failed to write xAOD::MdtPrepDataContainer "<<m_xAODTwinKey.fullKey());
596  return cache;
597  }
598  cache.xAODTwinPrd = writeHandle.ptr();
599  }
600  if (!m_xAODKey.empty()) {
601  SG::WriteHandle writeHandle{m_xAODKey, ctx};
602  if (!writeHandle.recordNonConst(std::make_unique<xAOD::MdtDriftCircleContainer>(),
603  std::make_unique<xAOD::MdtDriftCircleAuxContainer>()).isSuccess() ||
604  !writeHandle.isValid()) {
605  ATH_MSG_FATAL("Failed to write xAOD::MdtPrepDataContainer "<<m_xAODKey.fullKey());
606  return cache;
607  }
608  cache.xAODPrd = writeHandle.ptr();
609  }
611  if (!m_geoCtxKey.empty()) {
612  SG::ReadHandle readHandle{m_geoCtxKey, ctx};
613  if (!readHandle.isPresent()) {
614  ATH_MSG_FATAL("Failed to retrieve the geometry context "<<m_geoCtxKey.fullKey());
615  return cache;
616  }
617  cache.gctx = readHandle.cptr();
618  }
620  if (!m_muDetMgrKey.empty()) {
621  SG::ReadCondHandle detMgrHandle{m_muDetMgrKey, ctx};
622  if (!detMgrHandle.isValid()) {
623  ATH_MSG_FATAL("Failed to retrieve the detector manager from the conditions store "<<m_muDetMgrKey.fullKey());
624  return cache;
625  }
626  cache.legacyDetMgr = detMgrHandle.cptr();
627  }
628  if (m_useTwin) {
629  SG::ReadCondHandle twinTubeHandle{m_twinTubeKey, ctx};
630  if (!twinTubeHandle.isValid()) {
631  ATH_MSG_FATAL("Failed to initialize twin tube map "<<m_twinTubeKey.fullKey());
632  return cache;
633  }
634  cache.twinTubeMap = twinTubeHandle.cptr();
635  }
636  cache.r4DetMgr = m_detMgrR4;
637  // Pass the container from the handle
638  cache.isValid = true;
639  return cache;
640  }
641 } // namespace Muon
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
beamspotman.r
def r
Definition: beamspotman.py:676
MdtCsm::CsmId
uint16_t CsmId() const
Returns the CSM online id (online identifier inside a MROD)
Definition: MdtCsm.h:61
Muon::MdtRdoToPrepDataToolMT::m_useNewGeo
Gaudi::Property< bool > m_useNewGeo
Definition: MdtRdoToPrepDataToolMT.h:122
MdtReadoutElement.h
MuonGM::MdtReadoutElement::getNLayers
int getNLayers() const
Returns the number of tube layers inside the multilayer.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
MdtAmtHit
MDT RDO's : data from a single channel of an AMT Atlas Muon TDC.
Definition: MdtAmtHit.h:20
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonGM::MuonReadoutElement::getStationS
double getStationS() const
Seems to be exclusively used by the MDTs --> Move it to MdtReadoutElement.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:202
MdtCalibOutput::MdtDriftCircleStatus
Muon::MdtDriftCircleStatus MdtDriftCircleStatus
Definition: MdtCalibOutput.h:63
MdtCalibInput
Definition: MdtCalibInput.h:35
MuonGM::MdtReadoutElement::innerTubeRadius
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
MdtRDO_Decoder.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MdtCalibTwinOutput::twinAdc
int twinAdc() const
Definition: MdtCalibTwinOutput.cxx:37
Muon::MdtRdoToPrepDataToolMT::MdtRdoToPrepDataToolMT
MdtRdoToPrepDataToolMT(const std::string &, const std::string &, const IInterface *)
Definition: MdtRdoToPrepDataToolMT.cxx:144
MdtCalibInput::legacyDescriptor
const MuonGM::MdtReadoutElement * legacyDescriptor() const
Returns the legacy readout element.
Definition: MdtCalibInput.cxx:87
Muon::MdtRdoToPrepDataToolMT::createPrepData
std::unique_ptr< MdtPrepData > createPrepData(const MdtCalibInput &calibInput, const MdtCalibOutput &calibOutput, ConvCache &cache) const
Creates the PRD object.
Definition: MdtRdoToPrepDataToolMT.cxx:290
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
Muon::MdtRdoToPrepDataToolMT::m_twinTubeKey
SG::ReadCondHandleKey< TwinTubeMap > m_twinTubeKey
Definition: MdtRdoToPrepDataToolMT.h:152
MuonR4::driftCov
double driftCov(const CalibratedSpacePoint &dcHit)
Definition: MdtSegmentSeedGenerator.cxx:22
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Muon::MdtRdoToPrepDataToolMT::m_rdoContainerKey
SG::ReadHandleKey< MdtCsmContainer > m_rdoContainerKey
Definition: MdtRdoToPrepDataToolMT.h:132
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:209
MdtCsm::identify
Identifier identify() const
Returns the CSM offline identifier (chamber offline id)
Definition: MdtCsm.h:51
MdtCsm::SubDetId
uint16_t SubDetId() const
Returns the sub-detector Id.
Definition: MdtCsm.h:57
Muon::MdtDriftCircleStatus
MdtDriftCircleStatus
Enum to represent the 'status' of Mdt measurements e.g.
Definition: MdtDriftCircleStatus.h:25
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
MdtCalibTwinOutput::sigmaZ
double sigmaZ() const
Definition: MdtCalibTwinOutput.cxx:49
MdtCalibTwinOutput::twinTdc
int twinTdc() const
Definition: MdtCalibTwinOutput.cxx:38
Muon::MdtRdoToPrepDataToolMT::provideEmptyContainer
virtual StatusCode provideEmptyContainer(const EventContext &ctx) const override
Definition: MdtRdoToPrepDataToolMT.cxx:224
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition: MdtCsmContainer.h:22
MdtDriftCircleAuxContainer.h
Trk::locR
@ locR
Definition: ParamDefs.h:44
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
MdtCsm
MDT RDOs : Chamber Service Module, container of AmtHits of a single Mdt chamber.
Definition: MdtCsm.h:19
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
GeoGetIds.h
Visitor to collect all IDs under a GeoModel node.
MdtCalibTwinOutput::uncertPrimaryR
double uncertPrimaryR() const
Definition: MdtCalibTwinOutput.cxx:52
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
MdtCalibInput::identify
const Identifier & identify() const
Returns the Identifier of the hit.
Definition: MdtCalibInput.cxx:84
MdtCalibTwinOutput::primaryTdc
int primaryTdc() const
Definition: MdtCalibTwinOutput.cxx:35
Muon::MdtRdoToPrepDataToolMT::m_adcCut
Gaudi::Property< int > m_adcCut
member variables for algorithm properties:
Definition: MdtRdoToPrepDataToolMT.h:136
Muon::MdtRdoToPrepDataToolMT::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: MdtRdoToPrepDataToolMT.h:126
Muon::MdtRdoToPrepDataToolMT::processCsm
StatusCode processCsm(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColl) const
Definition: MdtRdoToPrepDataToolMT.cxx:329
IdentifiableContainerMT::empty
bool empty() const
return true if container is empty
Definition: IdentifiableContainerMT.h:247
TRT::Hit::side
@ side
Definition: HitInfo.h:83
Muon::MdtRdoToPrepDataToolMT::m_mdtPrepDataContainerKey
SG::WriteHandleKey< Muon::MdtPrepDataContainer > m_mdtPrepDataContainerKey
MdtPrepRawData containers.
Definition: MdtRdoToPrepDataToolMT.h:130
Muon::MdtRdoToPrepDataToolMT::decode
virtual StatusCode decode(const EventContext &ctx, const std::vector< IdentifierHash > &idVect) const override
Decode method - declared in Muon::IMuonRdoToPrepDataTool.
Definition: MdtRdoToPrepDataToolMT.cxx:256
MdtCsm::MrodId
uint16_t MrodId() const
Returns the MROD id from the CSM header.
Definition: MdtCsm.h:59
MuonMDT_CablingMap
Definition: MuonMDT_CablingMap.h:28
xAOD::UncalibratedMeasurement_v1::setIdentifier
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
Muon::MdtRdoToPrepDataToolMT::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: MdtRdoToPrepDataToolMT.cxx:147
mc
Definition: mc.PG_single_nu_valid.py:1
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Muon::MuonPrepDataCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
Muon::MdtRdoToPrepDataToolMT::m_detMgrR4
const MuonGMR4::MuonDetectorManager * m_detMgrR4
Definition: MdtRdoToPrepDataToolMT.h:125
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Muon::MdtRdoToPrepDataToolMT::m_useTwin
Gaudi::Property< bool > m_useTwin
Definition: MdtRdoToPrepDataToolMT.h:148
MdtTwinPrepData.h
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:42
CxxUtils::sincos::cs
double cs
Definition: sincos.h:95
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
Muon::TwinTubeMap::twinId
Identifier twinId(const Identifier &channelId) const
Returns the Identifier of the mapped twin tube.
Definition: TwinTubeMap.cxx:19
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
Muon::MdtRdoToPrepDataToolMT::setupMdtPrepDataContainer
ConvCache setupMdtPrepDataContainer(const EventContext &ctx) const
Creates the prep data container to be written.
Definition: MdtRdoToPrepDataToolMT.cxx:559
Muon::MdtRdoToPrepDataToolMT::processCsmTwin
StatusCode processCsmTwin(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColll) const
Definition: MdtRdoToPrepDataToolMT.cxx:401
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
Muon::MdtRdoToPrepDataToolMT::m_BMGpresent
bool m_BMGpresent
Definition: MdtRdoToPrepDataToolMT.h:144
xAOD::MdtTwinDriftCircle_v1
Definition: MdtTwinDriftCircle_v1.h:12
MuonDetectorManager.h
IdentifiableContainerMT::IDC_WriteHandle
Definition: IdentifiableContainerMT.h:34
MdtIdHelper
Definition: MdtIdHelper.h:61
Muon::MdtRdoToPrepDataToolMT::m_readKey
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_readKey
Definition: MdtRdoToPrepDataToolMT.h:157
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MdtRdoToPrepDataToolMT::initDeadChannels
void initDeadChannels(const MuonGM::MdtReadoutElement *mydetEl)
Definition: MdtRdoToPrepDataToolMT.cxx:528
MdtCalibTwinOutput::locZ
double locZ() const
Definition: MdtCalibTwinOutput.cxx:48
Muon::MdtRdoToPrepDataToolMT::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtRdoToPrepDataToolMT.h:116
Muon::MdtRdoToPrepDataToolMT::getRdoContainer
const MdtCsmContainer * getRdoContainer(const EventContext &ctx) const
Loads the input RDO container from StoreGate.
Definition: MdtRdoToPrepDataToolMT.cxx:214
MdtCalibInput::setClosestApproach
void setClosestApproach(const Amg::Vector3D &approach)
Sets the closest approach.
Definition: MdtCalibInput.cxx:106
MuonGM::MdtReadoutElement::getMultilayer
int getMultilayer() const
Returns the multilayer represented by the readout element.
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
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
MdtCalibOutput::status
MdtDriftCircleStatus status() const
Status of the calibration.
Definition: MdtCalibOutput.cxx:40
MdtCalibOutput
Definition: MdtCalibOutput.h:10
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
MdtRdoToPrepDataToolMT.h
xAOD::MeasVector
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
Definition: MeasurementDefs.h:52
Muon::MdtRdoToPrepDataToolMT::ConvCache::gctx
const ActsGeometryContext * gctx
Acts Geometry context.
Definition: MdtRdoToPrepDataToolMT.h:84
MdtTwinDriftCircleAuxContainer.h
MdtCalibTwinOutput::twinID
Identifier twinID() const
Definition: MdtCalibTwinOutput.cxx:41
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:22
Muon::MdtRdoToPrepDataToolMT::m_discardSecondaryHitTwin
Gaudi::Property< bool > m_discardSecondaryHitTwin
Definition: MdtRdoToPrepDataToolMT.h:149
SG::UpdateHandle
Definition: UpdateHandle.h:94
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MdtCalibTwinOutput::primaryStatus
MdtDriftCircleStatus primaryStatus() const
Definition: MdtCalibTwinOutput.cxx:54
Muon::MdtRdoToPrepDataToolMT::handlePRDHash
bool handlePRDHash(const EventContext &ctx, ConvCache &mdtPrepDataContainer, IdentifierHash rdoHash) const
Definition: MdtRdoToPrepDataToolMT.cxx:235
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
MdtCalibInput::adc
int16_t adc() const
Returns the amount of accumulated charge.
Definition: MdtCalibInput.cxx:86
Muon::MdtRdoToPrepDataToolMT::ConvCache::finalize
StatusCode finalize(MsgStream &msg)
Copy the non-empty collections into the created prd container.
Definition: MdtRdoToPrepDataToolMT.cxx:68
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IdentifiableContainerMT::IDC_WriteHandle::addOrDelete
StatusCode addOrDelete(std::unique_ptr< T > ptr)
Definition: IdentifiableContainerMT.h:56
Muon::MdtRdoToPrepDataToolMT::m_BMGid
int m_BMGid
Definition: MdtRdoToPrepDataToolMT.h:145
MdtCalibOutput::driftRadiusUncert
double driftRadiusUncert() const
Returns the uncertainty on the drift radius.
Definition: MdtCalibOutput.cxx:20
Muon::MdtRdoToPrepDataToolMT::ConvCache::twinTubeMap
const TwinTubeMap * twinTubeMap
Pointer to the map having the mapping of twin tube pairs.
Definition: MdtRdoToPrepDataToolMT.h:86
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
MuonGM::MuonDetectorManager::getMuonStation
const MuonStation * getMuonStation(const std::string &stName, int eta, int phi) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:137
Muon::MdtRdoToPrepDataToolMT::ConvCache
Helper struct to parse the event data around the tool.
Definition: MdtRdoToPrepDataToolMT.h:65
geoGetIds
void geoGetIds(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
Definition: GeoGetIds.h:82
Muon::MdtRdoToPrepDataToolMT::ConvCache::isValid
bool isValid
Flag set to indicate that the complete validation was successful.
Definition: MdtRdoToPrepDataToolMT.h:89
MuonGM::MdtReadoutElement::tubePos
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
MdtCalibTwinOutput
Definition: MdtCalibTwinOutput.h:11
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MdtReadoutElement.h
re
const boost::regex re(r_e)
MuonGM::MuonReadoutElement::identify
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:184
MdtCalibTwinOutput::primaryAdc
int primaryAdc() const
Definition: MdtCalibTwinOutput.cxx:34
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
GeoPrimitivesToStringConverter.h
CxxUtils::sincos
Helper to simultaneously calculate sin and cos of the same angle.
Definition: sincos.h:76
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
Muon::MdtRdoToPrepDataToolMT::m_calibrationTool
ToolHandle< IMdtCalibrationTool > m_calibrationTool
MDT calibration service.
Definition: MdtRdoToPrepDataToolMT.h:119
Muon::MdtRdoToPrepDataToolMT::processPRDHashes
void processPRDHashes(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const std::vector< IdentifierHash > &chamberHashInRobs) const
Definition: MdtRdoToPrepDataToolMT.cxx:228
Muon::MdtStatusUnDefined
@ MdtStatusUnDefined
Undefined.
Definition: MdtDriftCircleStatus.h:43
MdtCalibTwinOutput::primaryDriftR
double primaryDriftR() const
Definition: MdtCalibTwinOutput.cxx:50
MdtCalibTwinOutput::primaryID
Identifier primaryID() const
Definition: MdtCalibTwinOutput.cxx:40
merge.status
status
Definition: merge.py:17
IdentifierByDetElSorter.h
xAOD::MeasMatrix
Eigen::Matrix< float, N, N > MeasMatrix
Definition: MeasurementDefs.h:54
Muon::IdentifierByDetElSorter
Definition: IdentifierByDetElSorter.h:17
Muon::MdtRdoToPrepDataToolMT::ConvCache::createCollection
MdtPrepDataCollection * createCollection(const Identifier &id)
Creates a new MdtPrepDataCollection, if it's neccessary and also possible.
Definition: MdtRdoToPrepDataToolMT.cxx:57
Muon::MdtRdoToPrepDataToolMT::m_decodeData
Gaudi::Property< bool > m_decodeData
toggle on/off the decoding of MDT RDO into MdtPrepData
Definition: MdtRdoToPrepDataToolMT.h:139
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
Muon::MdtRdoToPrepDataToolMT::m_mdtDecoder
ToolHandle< Muon::IMDT_RDO_Decoder > m_mdtDecoder
Definition: MdtRdoToPrepDataToolMT.h:142
MdtIdHelper::maxNTubesPerLayer
static constexpr int maxNTubesPerLayer
The maxNTubesPerLayer represents the absolute maximum of tubes which are built into a single multilay...
Definition: MdtIdHelper.h:68
MuonGM::MdtReadoutElement::getNtubesperlayer
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
MuonStation.h
MdtCalibInput::tdc
int16_t tdc() const
Returns the tdc counts of the hit.
Definition: MdtCalibInput.cxx:85
Muon::TwinTubeMap::isTwinTubeLayer
bool isTwinTubeLayer(const Identifier &channelId) const
Returns whether the multilayer is equipped with twin-tubes or not.
Definition: TwinTubeMap.cxx:12
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Muon::MdtRdoToPrepDataToolMT::m_muDetMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
Definition: MdtRdoToPrepDataToolMT.h:159
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67
calibdata.tube
tube
Definition: calibdata.py:31
Muon::MdtRdoToPrepDataToolMT::ConvCache::legacyDetMgr
const MuonGM::MuonDetectorManager * legacyDetMgr
Detector manager from the conditions store.
Definition: MdtRdoToPrepDataToolMT.h:80
MdtCalibOutput::driftRadius
double driftRadius() const
Returns the drift radius of the calibrated object.
Definition: MdtCalibOutput.cxx:19
Muon::MdtTwinPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtTwinPrepData.h:33
Muon::MdtRdoToPrepDataToolMT::m_prdContainerCacheKey
SG::UpdateHandleKey< MdtPrepDataCollection_Cache > m_prdContainerCacheKey
This is the key for the cache for the MDT PRD containers, can be empty.
Definition: MdtRdoToPrepDataToolMT.h:162
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
MdtIdHelper::parentID
Identifier parentID(const Identifier &id) const
get parent id from channel id
Definition: MdtIdHelper.cxx:711
Muon::MdtRdoToPrepDataToolMT::m_xAODTwinKey
SG::WriteHandleKey< xAOD::MdtTwinDriftCircleContainer > m_xAODTwinKey
Definition: MdtRdoToPrepDataToolMT.h:167
Muon::MdtRdoToPrepDataToolMT::m_DeadChannels
std::unordered_set< Identifier > m_DeadChannels
Definition: MdtRdoToPrepDataToolMT.h:154
Muon::MdtRdoToPrepDataToolMT::m_xAODKey
SG::WriteHandleKey< xAOD::MdtDriftCircleContainer > m_xAODKey
Definition: MdtRdoToPrepDataToolMT.h:166
Identifier
Definition: IdentifierFieldParser.cxx:14