ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Muon::MdtRdoToPrepDataToolMT Class Reference

#include <MdtRdoToPrepDataToolMT.h>

Inheritance diagram for Muon::MdtRdoToPrepDataToolMT:
Collaboration diagram for Muon::MdtRdoToPrepDataToolMT:

Classes

struct  ConvCache
 Helper struct to parse the event data around the tool. More...
 

Public Member Functions

virtual ~MdtRdoToPrepDataToolMT ()=default
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode decode (const EventContext &ctx, const std::vector< IdentifierHash > &idVect) const override
 Decode method - declared in Muon::IMuonRdoToPrepDataTool. More...
 
virtual StatusCode provideEmptyContainer (const EventContext &ctx) const override
 
virtual StatusCode decode (const EventContext &ctx, const std::vector< uint32_t > &robIds) const override
 

Protected Member Functions

void printPrepDataImpl (const Muon::MdtPrepDataContainer *mdtPrepDataContainer) const
 
Muon::MdtDriftCircleStatus getMdtTwinPosition (const MdtDigit &prompt_digit, const MdtDigit &twin_digit, double &radius, double &errRadius, double &zTwin, double &errZTwin, bool &twinIsPrompt) const
 method to get the twin tube 2nd coordinate More...
 
StatusCode processCsm (const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColl) const
 
StatusCode processCsmTwin (const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColll) const
 
std::unique_ptr< MdtPrepDatacreatePrepData (const MdtCalibInput &calibInput, const MdtCalibOutput &calibOutput, ConvCache &cache) const
 Creates the PRD object. More...
 
ConvCache setupMdtPrepDataContainer (const EventContext &ctx) const
 Creates the prep data container to be written. More...
 
const MdtCsmContainergetRdoContainer (const EventContext &ctx) const
 Loads the input RDO container from StoreGate. More...
 
void processPRDHashes (const EventContext &ctx, ConvCache &mdtPrepDataContainer, const std::vector< IdentifierHash > &chamberHashInRobs) const
 
bool handlePRDHash (const EventContext &ctx, ConvCache &mdtPrepDataContainer, IdentifierHash rdoHash) const
 
void initDeadChannels (const MuonGM::MdtReadoutElement *mydetEl)
 

Protected Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< IMdtCalibrationToolm_calibrationTool {this, "CalibrationTool", "MdtCalibrationTool"}
 MDT calibration service. More...
 
Gaudi::Property< bool > m_useNewGeo
 
const MuonGMR4::MuonDetectorManagerm_detMgrR4 {nullptr}
 
SG::ReadHandleKey< ActsGeometryContextm_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "Stored alignment"}
 
SG::WriteHandleKey< Muon::MdtPrepDataContainerm_mdtPrepDataContainerKey {this, "OutputCollection", "MDT_DriftCircles"}
 MdtPrepRawData containers. More...
 
SG::ReadHandleKey< MdtCsmContainerm_rdoContainerKey {this, "RDOContainer", "MDTCSM"}
 
Gaudi::Property< int > m_adcCut
 member variables for algorithm properties: More...
 
Gaudi::Property< bool > m_calibratePrepData {this, "CalibratePrepData", true}
 toggle on/off calibration of MdtPrepData More...
 
Gaudi::Property< bool > m_decodeData {this, "DecodeData", true}
 toggle on/off the decoding of MDT RDO into MdtPrepData More...
 
bool m_sortPrepData = false
 Toggle on/off the sorting of the MdtPrepData. More...
 
ToolHandle< Muon::IMDT_RDO_Decoderm_mdtDecoder {this, "Decoder", "Muon::MdtRDO_Decoder/MdtRDO_Decoder"}
 
bool m_BMGpresent {false}
 
int m_BMGid {-1}
 
Gaudi::Property< bool > m_useTwin {this, "UseTwin", true}
 
Gaudi::Property< bool > m_discardSecondaryHitTwin {this, "DiscardSecondaryHitTwin", false}
 
SG::ReadCondHandleKey< TwinTubeMapm_twinTubeKey {this, "TwinTubeKey", "MdtTwinTubeMap"}
 
std::unordered_set< Identifierm_DeadChannels {}
 
SG::ReadCondHandleKey< MuonMDT_CablingMapm_readKey {this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"}
 
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_muDetMgrKey
 
SG::UpdateHandleKey< MdtPrepDataCollection_Cachem_prdContainerCacheKey
 This is the key for the cache for the MDT PRD containers, can be empty. More...
 
SG::WriteHandleKey< xAOD::MdtDriftCircleContainerm_xAODKey {this, "xAODKey", "", "If empty, do not produce xAOD, otherwise this is the key of the output xAOD MDT PRD container"}
 
SG::WriteHandleKey< xAOD::MdtTwinDriftCircleContainerm_xAODTwinKey {this, "xAODTwinKey", "", "If empty, do not produce xAOD, otherwise this is the key of the output xAOD MDT PRD container"}
 

Detailed Description

Tool to produce MDT PRDs

Definition at line 40 of file MdtRdoToPrepDataToolMT.h.

Constructor & Destructor Documentation

◆ ~MdtRdoToPrepDataToolMT()

virtual Muon::MdtRdoToPrepDataToolMT::~MdtRdoToPrepDataToolMT ( )
virtualdefault

default destructor

Member Function Documentation

◆ createPrepData()

std::unique_ptr< MdtPrepData > Muon::MdtRdoToPrepDataToolMT::createPrepData ( const MdtCalibInput calibInput,
const MdtCalibOutput calibOutput,
ConvCache cache 
) const
protected

Creates the PRD object.

Test by how much do we break frozen Tier0

Definition at line 292 of file MdtRdoToPrepDataToolMT.cxx.

294  {
295  if (calibInput.adc() < m_adcCut ||
297  ATH_MSG_VERBOSE("Do not create calib hit for "<<m_idHelperSvc->toString(calibInput.identify())
298  <<", adc: "<<calibInput.adc()<<" vs. "<<m_adcCut<<", calibration bailed out "
299  <<(calibOutput.status() == MdtDriftCircleStatus::MdtStatusUnDefined? "si": "no"));
300  return nullptr;
301  }
302  const MuonGM::MdtReadoutElement* descriptor = calibInput.legacyDescriptor();
303  if (!descriptor) {
304  if (!cache.legacyDetMgr) {
305  return nullptr;
306  }
307  descriptor = cache.legacyDetMgr->getMdtReadoutElement(calibInput.identify());
308  }
309  ATH_MSG_VERBOSE("Calibrated prepdata "<<m_idHelperSvc->toString(calibInput.identify())
310  <<std::endl<<calibInput<<std::endl<<calibOutput);
311 
313  Amg::MatrixX cov(1, 1);
314  if (calibOutput.status() == MdtDriftCircleStatus::MdtStatusDriftTime){
316  const float r = calibOutput.driftRadius();
317  const float sigR = calibOutput.driftRadiusUncert();
318  driftRadius[0] = r;
319  (cov)(0, 0) = sigR * sigR;
320  } else (cov)(0, 0) = std::pow(descriptor->innerTubeRadius(), 2);
321 
322  return std::make_unique<MdtPrepData>(calibInput.identify(),
323  std::move(driftRadius),
324  std::move(cov),
325  descriptor,
326  calibInput.tdc(),
327  calibInput.adc(),
328  calibOutput.status());
329  }

◆ decode() [1/2]

StatusCode Muon::MdtRdoToPrepDataToolMT::decode ( const EventContext &  ctx,
const std::vector< IdentifierHash > &  idVect 
) const
overridevirtual

Decode method - declared in Muon::IMuonRdoToPrepDataTool.

Construct the hashes from the existing RDOs

Definition at line 258 of file MdtRdoToPrepDataToolMT.cxx.

259  {
260 
261  ATH_MSG_DEBUG("decodeMdtRDO for " << idVect.size() << " offline collections called");
262 
263  // setup output container
264  ConvCache mdtPrepDataContainer = setupMdtPrepDataContainer(ctx);
265  if (!mdtPrepDataContainer.isValid) {
266  return StatusCode::FAILURE;
267  }
268 
269 
270  if (!m_decodeData) {
271  ATH_MSG_DEBUG("Stored empty container. Decoding MDT RDO into MDT PrepRawData is switched off");
272  return StatusCode::SUCCESS;
273  }
274  // seeded or unseeded decoding
275  if (!idVect.empty()) {
276  processPRDHashes(ctx, mdtPrepDataContainer, idVect);
277  } else {
279  std::vector<IdentifierHash> rdoHashes{};
280  const MdtCsmContainer* rdoContainer = getRdoContainer(ctx);
281  if (!rdoContainer || rdoContainer->empty()) return StatusCode::SUCCESS;
282  rdoHashes.reserve(rdoContainer->size());
283  for (const MdtCsm* csm : *rdoContainer) rdoHashes.push_back(csm->identifyHash());
284 
285  processPRDHashes(ctx, mdtPrepDataContainer, rdoHashes);
286  }
287  ATH_CHECK(mdtPrepDataContainer.finalize(msgStream()));
288 
289  return StatusCode::SUCCESS;
290  }

◆ decode() [2/2]

StatusCode Muon::MdtRdoToPrepDataToolMT::decode ( const EventContext &  ctx,
const std::vector< uint32_t > &  robIds 
) const
overridevirtual

Definition at line 210 of file MdtRdoToPrepDataToolMT.cxx.

210  {
211  const MuonMDT_CablingMap* readCdo{nullptr};
212  ATH_CHECK(SG::get(readCdo, m_readKey, ctx));
213  return decode(ctx, readCdo->getMultiLayerHashVec(robIds, msgStream()));
214  }

◆ getMdtTwinPosition()

Muon::MdtDriftCircleStatus Muon::MdtRdoToPrepDataToolMT::getMdtTwinPosition ( const MdtDigit prompt_digit,
const MdtDigit twin_digit,
double &  radius,
double &  errRadius,
double &  zTwin,
double &  errZTwin,
bool &  twinIsPrompt 
) const
protected

method to get the twin tube 2nd coordinate

◆ getRdoContainer()

const MdtCsmContainer * Muon::MdtRdoToPrepDataToolMT::getRdoContainer ( const EventContext &  ctx) const
protected

Loads the input RDO container from StoreGate.

Definition at line 216 of file MdtRdoToPrepDataToolMT.cxx.

216  {
217  SG::ReadHandle rdoContainerHandle{m_rdoContainerKey, ctx};
218  if (rdoContainerHandle.isValid()) {
219  ATH_MSG_DEBUG("MdtgetRdoContainer success");
220  return rdoContainerHandle.cptr();
221  }
222  ATH_MSG_WARNING("Retrieval of Mdt RDO container failed !");
223  return nullptr;
224  }

◆ handlePRDHash()

bool Muon::MdtRdoToPrepDataToolMT::handlePRDHash ( const EventContext &  ctx,
ConvCache mdtPrepDataContainer,
IdentifierHash  rdoHash 
) const
protected

Definition at line 237 of file MdtRdoToPrepDataToolMT.cxx.

239  {
240  const MdtCsmContainer* rdoContainer{getRdoContainer(ctx)};
241 
242  if (rdoContainer->empty()) {
243  ATH_MSG_DEBUG("The container is empty");
244  return true;
245  }
246  const MdtCsm* rdoColl = rdoContainer->indexFindPtr(rdoHash);
247  if (!rdoColl) {
248  ATH_MSG_DEBUG("The rdo container does not have the hash " << rdoHash);
249  return true;
250  }
251  if (processCsm(ctx, mdtPrepDataContainer, rdoColl).isFailure()) {
252  ATH_MSG_WARNING("processCsm failed for RDO id " << m_idHelperSvc->toString(rdoColl->identify()));
253  return false;
254  }
255  return true;
256  }

◆ initDeadChannels()

void Muon::MdtRdoToPrepDataToolMT::initDeadChannels ( const MuonGM::MdtReadoutElement mydetEl)
protected

Definition at line 549 of file MdtRdoToPrepDataToolMT.cxx.

549  {
550  PVConstLink cv = mydetEl->getMaterialGeom(); // it is "Multilayer"
551  int nGrandchildren = cv->getNChildVols();
552  if (nGrandchildren <= 0) return;
553 
554  std::vector<int> tubes;
555  geoGetIds([&](int id) { tubes.push_back(id); }, &*cv);
556  std::sort(tubes.begin(), tubes.end());
557 
558  const Identifier detElId = mydetEl->identify();
559  const int ml = mydetEl->getMultilayer();
560  std::vector<int>::iterator it = tubes.begin();
561  for (int layer = 1; layer <= mydetEl->getNLayers(); layer++) {
562  for (int tube = 1; tube <= mydetEl->getNtubesperlayer(); tube++) {
563  int want_id = layer * maxNTubesPerLayer + tube;
564  if (it != tubes.end() && *it == want_id) {
565  ++it;
566  } else {
567  it = std::lower_bound(tubes.begin(), tubes.end(), want_id);
568  if (it != tubes.end() && *it == want_id) {
569  ++it;
570  } else {
571  Identifier deadTubeId = m_idHelperSvc->mdtIdHelper().channelID(detElId, ml, layer, tube);
572  m_DeadChannels.insert(deadTubeId);
573  ATH_MSG_VERBOSE("adding dead tube "<<m_idHelperSvc->toString(deadTubeId));
574  }
575  }
576  }
577  }
578 
579  }

◆ initialize()

StatusCode Muon::MdtRdoToPrepDataToolMT::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 153 of file MdtRdoToPrepDataToolMT.cxx.

153  {
154  ATH_CHECK(m_calibrationTool.retrieve());
155  ATH_MSG_VERBOSE("MdtCalibrationTool retrieved with pointer = " << m_calibrationTool);
156  ATH_CHECK(m_prdContainerCacheKey.initialize(!m_prdContainerCacheKey.key().empty()));
157  ATH_CHECK(m_idHelperSvc.retrieve());
158  // Retrieve the RDO decoder
159  ATH_CHECK(m_mdtDecoder.retrieve());
160 
161  ATH_CHECK(m_twinTubeKey.initialize(m_useTwin));
162 
163  m_BMGid = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG");
164  m_BMGpresent = m_BMGid != -1;
165  if (m_useNewGeo) {
167  }
168  if (m_BMGpresent && !m_useNewGeo) {
169  const MuonGM::MuonDetectorManager* muDetMgr = nullptr;
170  ATH_CHECK(detStore()->retrieve(muDetMgr));
171 
172  ATH_MSG_INFO("Processing configuration for layouts with BMG chambers.");
173 
174  for (int phi = 6; phi < 8; phi++) { // phi sectors
175  for (int eta = 1; eta < 4; eta++) { // eta sectors
176  for (int side = -1; side < 2; side += 2) { // side
177  if (!muDetMgr->getMuonStation("BMG", side * eta, phi)) continue;
178  for (int roe = 1; roe <= (muDetMgr->getMuonStation("BMG", side * eta, phi))->nMuonReadoutElements();
179  roe++) { // iterate on readout elemets
180  const MdtReadoutElement* mdtRE = dynamic_cast<const MdtReadoutElement*>(
181  (muDetMgr->getMuonStation("BMG", side * eta, phi))->getMuonReadoutElement(roe)); // has to be an MDT
182  if (mdtRE) initDeadChannels(mdtRE);
183  }
184  }
185  }
186  }
187  } else if (m_useNewGeo) {
188  std::vector<const MuonGMR4::MdtReadoutElement*> mdtRE = m_detMgrR4->getAllMdtReadoutElements();
189  for (const MuonGMR4::MdtReadoutElement* re : mdtRE) {
190  if (re->stationName() != m_BMGid) {
191  continue;
192  }
193  for (const IdentifierHash& dead : re->getParameters().removedTubes) {
194  m_DeadChannels.insert(re->measurementId(dead));
195  }
196  }
197  }
198 
199  // check if initializing of DataHandle objects success
201  ATH_CHECK(m_mdtPrepDataContainerKey.initialize());
204  ATH_CHECK(m_xAODKey.initialize(!m_xAODKey.empty()));
205  ATH_CHECK(m_xAODTwinKey.initialize(!m_xAODTwinKey.empty()));
207  return StatusCode::SUCCESS;
208  }

◆ printPrepDataImpl()

void Muon::MdtRdoToPrepDataToolMT::printPrepDataImpl ( const Muon::MdtPrepDataContainer mdtPrepDataContainer) const
protected

◆ processCsm()

StatusCode Muon::MdtRdoToPrepDataToolMT::processCsm ( const EventContext &  ctx,
ConvCache mdtPrepDataContainer,
const MdtCsm rdoColl 
) const
protected

MDT hit context

Definition at line 331 of file MdtRdoToPrepDataToolMT.cxx.

331  {
332  const MdtIdHelper& id_helper = m_idHelperSvc->mdtIdHelper();
333  // first handle the case of twin tubes
334  if (m_useTwin) {
335  if (cache.twinTubeMap->isTwinTubeLayer(rdoColl->identify())) {
336  return processCsmTwin(ctx, cache, rdoColl);
337  }
338  }
339 
340  ATH_MSG_DEBUG(" ***************** Start of processCsm");
341 
343  const Identifier elementId = id_helper.parentID(rdoColl->identify());
344 
345  uint16_t subdetId = rdoColl->SubDetId();
346  uint16_t mrodId = rdoColl->MrodId();
347  uint16_t csmId = rdoColl->CsmId();
348  ATH_MSG_VERBOSE("Identifier = " << m_idHelperSvc->toString(elementId) << " subdetId/ mrodId/ csmId = " << subdetId << " / "
349  << mrodId << " / " << csmId);
350 
351  // for each Csm, loop over AmtHit, converter AmtHit to digit
352  // retrieve/create digit collection, and insert digit into collection
353  unsigned mc{0};
354 
355  for (const MdtAmtHit* amtHit : *rdoColl) {
356  ++mc;
357 
358  // FIXME: Still use the digit class.
359  ATH_MSG_VERBOSE("Amt Hit n. " << mc << " tdcId = " << amtHit->tdcId());
360  std::unique_ptr<MdtDigit> newDigit{m_mdtDecoder->getDigit(ctx, *amtHit, subdetId, mrodId, csmId)};
361  if (!newDigit) {
362  ATH_MSG_WARNING("Found issue MDT RDO decoder for subdetId/mrodId/csmId "
363  << subdetId << "/" << mrodId << "/" << csmId << " amtHit channelId/tdcId =" << amtHit->channelId() << "/"
364  << amtHit->tdcId());
365  continue;
366  }
367  // Do something with it
368  Identifier channelId = newDigit->identify();
369  if (newDigit->isMasked() || m_DeadChannels.count(channelId)) {
370  continue;
371  }
372  // Retrieve the proper PRD container. Note that there are cases where one CSM is either split into 2 chambers (BEE / BIS78
373  // legacy) or 2 CSMs are split into one chamber
374  MdtPrepDataCollection* driftCircleColl = cache.createCollection(channelId);
375  if (!driftCircleColl) {
376  ATH_MSG_DEBUG("Corresponding multi layer " << m_idHelperSvc->toString(channelId) << " is already decoded.");
377  continue;
378  }
379 
380  // check if the module ID of this channel is different from the CSM one
381  // If it's the first case, create the additional collection
382 
383  ATH_MSG_VERBOSE("got digit with id ext / hash " << m_idHelperSvc->toString(channelId) << " / "
384  << driftCircleColl->identifyHash());
385 
386  // Rescale ADC/TDC of chambers using HPTDC digitization chip
387  // Must create a new digit from the old one, because MdtDigit has no methods to set ADC/TDC
388  if (m_idHelperSvc->hasHPTDC(channelId)) {
389  newDigit->setAdc(newDigit->adc() / 4);
390  newDigit->setTdc(newDigit->tdc() / 4);
391  }
392  const MdtCalibInput calibIn = m_useNewGeo ? MdtCalibInput{*newDigit, *m_detMgrR4, *cache.gctx}:
393  MdtCalibInput{*newDigit, *cache.legacyDetMgr};
394  const MdtCalibOutput calibResult{m_calibrationTool->calibrate(ctx, calibIn, false)};
395 
396  std::unique_ptr<MdtPrepData> newPrepData = createPrepData(calibIn, calibResult, cache);
397  if (!newPrepData) {
398  continue;
399  }
400  if (driftCircleColl->size()) {
401  MdtPrepData* prevPrd = driftCircleColl->at(driftCircleColl->size()-1);
402  if (prevPrd->identify() == channelId) {
403  std::stringstream sstr{};
404  ATH_MSG_VERBOSE("Duplicated prep data object detected: "<<std::endl
405  <<" **** "<<print(*prevPrd)<<std::endl
406  <<" **** "<<print(*newPrepData));
407  if (prevPrd->status() == MdtDriftCircleStatus::MdtStatusDriftTime) {
408  ATH_MSG_VERBOSE("Prd is already good");
409  } else if (newPrepData->status() == MdtDriftCircleStatus::MdtStatusDriftTime) {
410  (*prevPrd) = std::move(*newPrepData);
411  prevPrd->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size()-1);
412  }
413  continue;
414  }
415  }
416  ATH_MSG_VERBOSE("New prd created "<<print(*newPrepData));
417  newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
418  driftCircleColl->push_back(std::move(newPrepData));
419  }
420  return StatusCode::SUCCESS;
421  }

◆ processCsmTwin()

StatusCode Muon::MdtRdoToPrepDataToolMT::processCsmTwin ( const EventContext &  ctx,
ConvCache mdtPrepDataContainer,
const MdtCsm rdoColll 
) const
protected

MDT hit context

Create new PrepData

check for the twin tube id

Definition at line 422 of file MdtRdoToPrepDataToolMT.cxx.

422  {
423  const MdtIdHelper& id_helper = m_idHelperSvc->mdtIdHelper();
424  ATH_MSG_DEBUG(" ***************** Start of processCsmTwin");
425  ATH_MSG_DEBUG(" Number of AmtHit in this Csm " << rdoColl->size());
427  Identifier elementId = id_helper.parentID(rdoColl->identify());
428 
429  uint16_t subdetId = rdoColl->SubDetId();
430  uint16_t mrodId = rdoColl->MrodId();
431  uint16_t csmId = rdoColl->CsmId();
432  ATH_MSG_VERBOSE("Identifier = " << m_idHelperSvc->toString(elementId) << " subdetId/ mrodId/ csmId = " << rdoColl->SubDetId()
433  << " / " << rdoColl->MrodId() << " / " << rdoColl->CsmId());
434 
435  // for each Csm, loop over AmtHit, converter AmtHit to digit
436  // retrieve/create digit collection, and insert digit into collection
437  std::map<Identifier, std::array<std::unique_ptr<MdtDigit>, 2>> mdtDigitColl{};
438 
439  for (const MdtAmtHit* amtHit : *rdoColl) {
440  std::unique_ptr<MdtDigit> newDigit{m_mdtDecoder->getDigit(ctx, *amtHit, subdetId, mrodId, csmId)};
441 
442  if (!newDigit) {
443  ATH_MSG_WARNING("Error in MDT RDO decoder for subdetId/mrodId/csmId "
444  << subdetId << "/" << mrodId << "/" << csmId << " amtHit channelId/tdcId =" << amtHit->channelId() << "/"
445  << amtHit->tdcId());
446  continue;
447  }
448  std::array<std::unique_ptr<MdtDigit>, 2> & moveTo = mdtDigitColl[newDigit->identify()];
449  if (!moveTo[0]) {
450  moveTo[0] = std::move(newDigit);
451  } else if (!moveTo[1] && !m_discardSecondaryHitTwin) {
452  moveTo[1] = std::move(newDigit);
453  } else {
454  ATH_MSG_VERBOSE(" TWIN TUBES: found a tertiary hit in a twin tube in one RdoCollection for "
455  << m_idHelperSvc->toString(newDigit->identify()) << " with adc = " << newDigit->adc()
456  << " tdc = " << newDigit->tdc());
457  }
458  } // end for-loop over rdoColl
459 
460  auto convertTwins = [this, &cache, &ctx](std::unique_ptr<MdtDigit> digit,
461  std::unique_ptr<MdtDigit> digit2) {
462  if (!digit || digit->isMasked() || !cache.legacyDetMgr) {
463  return;
464  }
465 
466  MdtPrepDataCollection* driftCircleColl = cache.createCollection(digit->identify());
467 
468  if (!digit2 || digit2->isMasked()) {
469  ATH_MSG_VERBOSE("Got single digit " << m_idHelperSvc->toString(digit->identify())<<", tdc: "
470  <<digit->tdc()<<", adc: "<<digit->adc()
471  << ", hash: "<< driftCircleColl->identifyHash());
472 
473  const MdtCalibInput mdtCalibIn = m_useNewGeo ? MdtCalibInput{*digit, *m_detMgrR4, *cache.gctx}:
474  MdtCalibInput{*digit, *cache.legacyDetMgr};
475 
476  const MdtCalibOutput mdtCalibOut{m_calibrationTool->calibrate(ctx, mdtCalibIn, false)};
477 
479  std::unique_ptr<MdtPrepData> newPrepData = createPrepData(mdtCalibIn, mdtCalibOut, cache);
480  if (!newPrepData) return;
481 
482  newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
483  driftCircleColl->push_back(std::move(newPrepData));
484  return;
485  }
486  ATH_MSG_VERBOSE("Twin digit calibration "<<m_idHelperSvc->toString(digit->identify())
487  <<", tdc: "<<digit->tdc()<<", adc: "<<digit->adc()<<" -- "
488  <<m_idHelperSvc->toString(digit2->identify())
489  <<", tdc: "<<digit2->tdc()<<", adc: "<<digit2->adc());
490  MdtCalibInput mdtCalib1st = m_useNewGeo ? MdtCalibInput{*digit, *m_detMgrR4, *cache.gctx}
491  : MdtCalibInput{*digit, *cache.legacyDetMgr};
492 
493  MdtCalibInput mdtCalib2nd = m_useNewGeo ? MdtCalibInput{*digit2, *m_detMgrR4, *cache.gctx}
494  : MdtCalibInput{*digit2, *cache.legacyDetMgr};
495 
496  updateClosestApproachTwin(mdtCalib1st);
497  updateClosestApproachTwin(mdtCalib2nd);
498 
499  const MdtCalibTwinOutput twinCalib = m_calibrationTool->calibrateTwinTubes(ctx,
500  std::move(mdtCalib1st),
501  std::move(mdtCalib2nd));
502 
503  Amg::Vector2D hitPos{twinCalib.primaryDriftR(), twinCalib.locZ()};
504  Amg::MatrixX cov(2, 2);
505  cov(0, 0) = twinCalib.uncertPrimaryR() * twinCalib.uncertPrimaryR();
506  cov(1, 1) = twinCalib.sigmaZ() * twinCalib.sigmaZ();
507  cov(0, 1) = cov(1, 0) = 0;
508 
509  const MuonGM::MdtReadoutElement* descriptor = cache.legacyDetMgr->getMdtReadoutElement(digit->identify());
510  auto twin_newPrepData = std::make_unique<MdtTwinPrepData>(twinCalib.primaryID(),
511  std::move(hitPos),
512  std::move(cov),
513  descriptor,
514  twinCalib.primaryTdc(),
515  twinCalib.primaryAdc(),
516  twinCalib.twinTdc(),
517  twinCalib.twinAdc(),
518  twinCalib.primaryStatus());
519 
520  ATH_MSG_VERBOSE(" MADE A 2D TWINPREPDATA " << m_idHelperSvc->toString(twinCalib.primaryID()) << " & "
521  << m_idHelperSvc->toString(twinCalib.twinID()) << " "<<twinCalib);
522 
523  ATH_MSG_VERBOSE("global pos center tube " << Amg::toString(twin_newPrepData->globalPosition(), 2) << std::endl
524  <<"local pos center tube w/ TWIN INFO "<<Amg::toString(twinCalib.locZ() * Amg::Vector3D::UnitZ(), 2)<<std::endl
525  <<"global pos w/o TWIN INFO "<<Amg::toString(descriptor->tubePos(twinCalib.primaryID())));
526 
527  twin_newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
528  driftCircleColl->push_back(std::move(twin_newPrepData));
529  };
530 
531  // iterate over mdtDigitColl
532  for (auto &[id, digits] : mdtDigitColl) {
533  // get the twin hits from mdtDigitColl
534  const Identifier twinId = cache.twinTubeMap->twinId(id);
536  if (id != twinId) {
537  std::array<std::unique_ptr<MdtDigit>, 2>& twinDigits = mdtDigitColl[twinId];
538  ATH_MSG_VERBOSE("Convert digits: "<<digits[0].get()<<" "<<twinDigits[0].get());
539  convertTwins(std::move(digits[0]), std::move(twinDigits[0]));
540  ATH_MSG_VERBOSE("Convert digits: "<<digits[1].get()<<" "<<twinDigits[1].get());
541  convertTwins(std::move(digits[1]), std::move(twinDigits[1]));
542  } else {
543  convertTwins(std::move(digits[0]), nullptr);
544  convertTwins(std::move(digits[1]), nullptr);
545  }
546  }
547  return StatusCode::SUCCESS;
548  }

◆ processPRDHashes()

void Muon::MdtRdoToPrepDataToolMT::processPRDHashes ( const EventContext &  ctx,
ConvCache mdtPrepDataContainer,
const std::vector< IdentifierHash > &  chamberHashInRobs 
) const
protected

Definition at line 230 of file MdtRdoToPrepDataToolMT.cxx.

231  {
232  for (const IdentifierHash& hash : multiLayerHashInRobs) {
233  if (!handlePRDHash(ctx, mdtPrepDataContainer, hash)) { ATH_MSG_DEBUG("Failed to process hash " << hash); }
234  } // ends loop over chamberhash
235  }

◆ provideEmptyContainer()

StatusCode Muon::MdtRdoToPrepDataToolMT::provideEmptyContainer ( const EventContext &  ctx) const
overridevirtual

Definition at line 226 of file MdtRdoToPrepDataToolMT.cxx.

226  {
227  return setupMdtPrepDataContainer(ctx).isValid ? StatusCode::SUCCESS : StatusCode::FAILURE;
228  }

◆ setupMdtPrepDataContainer()

MdtRdoToPrepDataToolMT::ConvCache Muon::MdtRdoToPrepDataToolMT::setupMdtPrepDataContainer ( const EventContext &  ctx) const
protected

Creates the prep data container to be written.

Retrieve the Geometry context if activated

Retrieve the legacy detector mananger if activated

Definition at line 580 of file MdtRdoToPrepDataToolMT.cxx.

580  {
581 
582  ConvCache cache{m_idHelperSvc.get()};
583 
585  // Caching of PRD container
586  if (m_prdContainerCacheKey.key().empty()) {
587  // without the cache we just record the container
588  StatusCode status = handle.record(std::make_unique<MdtPrepDataContainer>(m_idHelperSvc->mdtIdHelper().module_hash_max()));
589  if (status.isFailure() || !handle.isValid()) {
590  ATH_MSG_FATAL("Could not record container of MDT PrepData Container at " << m_mdtPrepDataContainerKey.key());
591  return cache;
592  }
593  ATH_MSG_VERBOSE("Created container " << m_mdtPrepDataContainerKey.key());
594  cache.legacyPrd = handle.ptr();
595  } else {
596  // use the cache to get the container
598  if (!update.isValid()) {
599  ATH_MSG_FATAL("Invalid UpdateHandle " << m_prdContainerCacheKey.key());
600  return cache;
601  }
602  StatusCode status = handle.record(std::make_unique<MdtPrepDataContainer>(update.ptr()));
603  if (status.isFailure() || !handle.isValid()) {
604  ATH_MSG_FATAL("Could not record container of MDT PrepData Container using cache " << m_prdContainerCacheKey.key() << " - "
605  << m_mdtPrepDataContainerKey.key());
606  return cache;
607  }
608  ATH_MSG_VERBOSE("Created container using cache for " << m_prdContainerCacheKey.key());
609  cache.legacyPrd = handle.ptr();
610  }
611  if (!m_xAODTwinKey.empty()) {
612  SG::WriteHandle writeHandle{m_xAODTwinKey, ctx};
613  if (!writeHandle.recordNonConst(std::make_unique<xAOD::MdtTwinDriftCircleContainer>(),
614  std::make_unique<xAOD::MdtTwinDriftCircleAuxContainer>()).isSuccess() ||
615  !writeHandle.isValid()) {
616  ATH_MSG_FATAL("Failed to write xAOD::MdtPrepDataContainer "<<m_xAODTwinKey.fullKey());
617  return cache;
618  }
619  cache.xAODTwinPrd = writeHandle.ptr();
620  }
621  if (!m_xAODKey.empty()) {
622  SG::WriteHandle writeHandle{m_xAODKey, ctx};
623  if (!writeHandle.recordNonConst(std::make_unique<xAOD::MdtDriftCircleContainer>(),
624  std::make_unique<xAOD::MdtDriftCircleAuxContainer>()).isSuccess() ||
625  !writeHandle.isValid()) {
626  ATH_MSG_FATAL("Failed to write xAOD::MdtPrepDataContainer "<<m_xAODKey.fullKey());
627  return cache;
628  }
629  cache.xAODPrd = writeHandle.ptr();
630  }
632  if (!m_geoCtxKey.empty()) {
633  SG::ReadHandle readHandle{m_geoCtxKey, ctx};
634  if (!readHandle.isPresent()) {
635  ATH_MSG_FATAL("Failed to retrieve the geometry context "<<m_geoCtxKey.fullKey());
636  return cache;
637  }
638  cache.gctx = readHandle.cptr();
639  }
641  if (!m_muDetMgrKey.empty()) {
642  SG::ReadCondHandle detMgrHandle{m_muDetMgrKey, ctx};
643  if (!detMgrHandle.isValid()) {
644  ATH_MSG_FATAL("Failed to retrieve the detector manager from the conditions store "<<m_muDetMgrKey.fullKey());
645  return cache;
646  }
647  cache.legacyDetMgr = detMgrHandle.cptr();
648  }
649  if (m_useTwin) {
650  SG::ReadCondHandle twinTubeHandle{m_twinTubeKey, ctx};
651  if (!twinTubeHandle.isValid()) {
652  ATH_MSG_FATAL("Failed to initialize twin tube map "<<m_twinTubeKey.fullKey());
653  return cache;
654  }
655  cache.twinTubeMap = twinTubeHandle.cptr();
656  }
657  cache.r4DetMgr = m_detMgrR4;
658  // Pass the container from the handle
659  cache.isValid = true;
660  return cache;
661  }

Member Data Documentation

◆ m_adcCut

Gaudi::Property<int> Muon::MdtRdoToPrepDataToolMT::m_adcCut
protected
Initial value:
{this, "AdcCut", 50,
"Minimal cut on the adc to convert it into a prepdata object"}

member variables for algorithm properties:

Definition at line 136 of file MdtRdoToPrepDataToolMT.h.

◆ m_BMGid

int Muon::MdtRdoToPrepDataToolMT::m_BMGid {-1}
protected

Definition at line 145 of file MdtRdoToPrepDataToolMT.h.

◆ m_BMGpresent

bool Muon::MdtRdoToPrepDataToolMT::m_BMGpresent {false}
protected

Definition at line 144 of file MdtRdoToPrepDataToolMT.h.

◆ m_calibratePrepData

Gaudi::Property<bool> Muon::MdtRdoToPrepDataToolMT::m_calibratePrepData {this, "CalibratePrepData", true}
protected

toggle on/off calibration of MdtPrepData

Definition at line 138 of file MdtRdoToPrepDataToolMT.h.

◆ m_calibrationTool

ToolHandle<IMdtCalibrationTool> Muon::MdtRdoToPrepDataToolMT::m_calibrationTool {this, "CalibrationTool", "MdtCalibrationTool"}
protected

MDT calibration service.

Definition at line 119 of file MdtRdoToPrepDataToolMT.h.

◆ m_DeadChannels

std::unordered_set<Identifier> Muon::MdtRdoToPrepDataToolMT::m_DeadChannels {}
protected

Definition at line 154 of file MdtRdoToPrepDataToolMT.h.

◆ m_decodeData

Gaudi::Property<bool> Muon::MdtRdoToPrepDataToolMT::m_decodeData {this, "DecodeData", true}
protected

toggle on/off the decoding of MDT RDO into MdtPrepData

Definition at line 139 of file MdtRdoToPrepDataToolMT.h.

◆ m_detMgrR4

const MuonGMR4::MuonDetectorManager* Muon::MdtRdoToPrepDataToolMT::m_detMgrR4 {nullptr}
protected

Definition at line 125 of file MdtRdoToPrepDataToolMT.h.

◆ m_discardSecondaryHitTwin

Gaudi::Property<bool> Muon::MdtRdoToPrepDataToolMT::m_discardSecondaryHitTwin {this, "DiscardSecondaryHitTwin", false}
protected

Definition at line 149 of file MdtRdoToPrepDataToolMT.h.

◆ m_geoCtxKey

SG::ReadHandleKey<ActsGeometryContext> Muon::MdtRdoToPrepDataToolMT::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "Stored alignment"}
protected

Definition at line 126 of file MdtRdoToPrepDataToolMT.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MdtRdoToPrepDataToolMT::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
protected

Definition at line 116 of file MdtRdoToPrepDataToolMT.h.

◆ m_mdtDecoder

ToolHandle<Muon::IMDT_RDO_Decoder> Muon::MdtRdoToPrepDataToolMT::m_mdtDecoder {this, "Decoder", "Muon::MdtRDO_Decoder/MdtRDO_Decoder"}
protected

Definition at line 142 of file MdtRdoToPrepDataToolMT.h.

◆ m_mdtPrepDataContainerKey

SG::WriteHandleKey<Muon::MdtPrepDataContainer> Muon::MdtRdoToPrepDataToolMT::m_mdtPrepDataContainerKey {this, "OutputCollection", "MDT_DriftCircles"}
protected

MdtPrepRawData containers.

Definition at line 130 of file MdtRdoToPrepDataToolMT.h.

◆ m_muDetMgrKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> Muon::MdtRdoToPrepDataToolMT::m_muDetMgrKey
protected
Initial value:
{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}

Definition at line 159 of file MdtRdoToPrepDataToolMT.h.

◆ m_prdContainerCacheKey

SG::UpdateHandleKey<MdtPrepDataCollection_Cache> Muon::MdtRdoToPrepDataToolMT::m_prdContainerCacheKey
protected
Initial value:
{this, "MdtPrdContainerCacheKey", "",
"Optional external cache for the MDT PRD container"}

This is the key for the cache for the MDT PRD containers, can be empty.

Definition at line 162 of file MdtRdoToPrepDataToolMT.h.

◆ m_rdoContainerKey

SG::ReadHandleKey<MdtCsmContainer> Muon::MdtRdoToPrepDataToolMT::m_rdoContainerKey {this, "RDOContainer", "MDTCSM"}
protected

Definition at line 132 of file MdtRdoToPrepDataToolMT.h.

◆ m_readKey

SG::ReadCondHandleKey<MuonMDT_CablingMap> Muon::MdtRdoToPrepDataToolMT::m_readKey {this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"}
protected

Definition at line 157 of file MdtRdoToPrepDataToolMT.h.

◆ m_sortPrepData

bool Muon::MdtRdoToPrepDataToolMT::m_sortPrepData = false
protected

Toggle on/off the sorting of the MdtPrepData.

Definition at line 140 of file MdtRdoToPrepDataToolMT.h.

◆ m_twinTubeKey

SG::ReadCondHandleKey<TwinTubeMap> Muon::MdtRdoToPrepDataToolMT::m_twinTubeKey {this, "TwinTubeKey", "MdtTwinTubeMap"}
protected

Definition at line 152 of file MdtRdoToPrepDataToolMT.h.

◆ m_useNewGeo

Gaudi::Property<bool> Muon::MdtRdoToPrepDataToolMT::m_useNewGeo
protected
Initial value:
{this, "UseR4DetMgr", false,
"Switch between the legacy and the new geometry"}

Definition at line 122 of file MdtRdoToPrepDataToolMT.h.

◆ m_useTwin

Gaudi::Property<bool> Muon::MdtRdoToPrepDataToolMT::m_useTwin {this, "UseTwin", true}
protected

Definition at line 148 of file MdtRdoToPrepDataToolMT.h.

◆ m_xAODKey

SG::WriteHandleKey<xAOD::MdtDriftCircleContainer> Muon::MdtRdoToPrepDataToolMT::m_xAODKey {this, "xAODKey", "", "If empty, do not produce xAOD, otherwise this is the key of the output xAOD MDT PRD container"}
protected

Definition at line 166 of file MdtRdoToPrepDataToolMT.h.

◆ m_xAODTwinKey

SG::WriteHandleKey<xAOD::MdtTwinDriftCircleContainer> Muon::MdtRdoToPrepDataToolMT::m_xAODTwinKey {this, "xAODTwinKey", "", "If empty, do not produce xAOD, otherwise this is the key of the output xAOD MDT PRD container"}
protected

Definition at line 167 of file MdtRdoToPrepDataToolMT.h.


The documentation for this class was generated from the following files:
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:674
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
Trk::PrepRawDataType::MdtPrepData
@ MdtPrepData
test_pyathena.eta
eta
Definition: test_pyathena.py:10
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
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
MdtCalibInput
Definition: MdtCalibInput.h:34
MuonGM::MdtReadoutElement::innerTubeRadius
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
MdtCalibTwinOutput::twinAdc
int twinAdc() const
Definition: MdtCalibTwinOutput.cxx:37
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:292
Muon::MdtRdoToPrepDataToolMT::m_twinTubeKey
SG::ReadCondHandleKey< TwinTubeMap > m_twinTubeKey
Definition: MdtRdoToPrepDataToolMT.h:152
skel.it
it
Definition: skel.GENtoEVGEN.py:407
Muon::MdtRdoToPrepDataToolMT::m_rdoContainerKey
SG::ReadHandleKey< MdtCsmContainer > m_rdoContainerKey
Definition: MdtRdoToPrepDataToolMT.h:132
Muon::MdtPrepDataCollection
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection
Definition: MuonPrepDataCollection.h:106
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:200
MdtCsm::identify
Identifier identify() const
Returns the CSM offline identifier (chamber offline id)
Definition: MdtCsm.h:51
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:206
MdtCsm::SubDetId
uint16_t SubDetId() const
Returns the sub-detector Id.
Definition: MdtCsm.h:57
MdtCalibTwinOutput::sigmaZ
double sigmaZ() const
Definition: MdtCalibTwinOutput.cxx:49
MdtCalibTwinOutput::twinTdc
int twinTdc() const
Definition: MdtCalibTwinOutput.cxx:38
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition: MdtCsmContainer.h:22
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
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:331
IdentifiableContainerMT::empty
bool empty() const
return true if container is empty
Definition: IdentifiableContainerMT.h:244
TRT::Hit::side
@ side
Definition: HitInfo.h:83
Muon::MdtRdoToPrepDataToolMT::m_mdtPrepDataContainerKey
SG::WriteHandleKey< Muon::MdtPrepDataContainer > m_mdtPrepDataContainerKey
MdtPrepRawData containers.
Definition: MdtRdoToPrepDataToolMT.h:130
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
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:258
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
mc
Definition: mc.PG_single_nu_valid.py:1
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
Muon::MdtRdoToPrepDataToolMT::m_useTwin
Gaudi::Property< bool > m_useTwin
Definition: MdtRdoToPrepDataToolMT.h:148
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
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:580
Muon::MdtRdoToPrepDataToolMT::processCsmTwin
StatusCode processCsmTwin(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColll) const
Definition: MdtRdoToPrepDataToolMT.cxx:422
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
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
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:549
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:216
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
MdtCalibOutput
Definition: MdtCalibOutput.h:10
MdtCalibOutput::status
MdtDriftCircleStatus status() const
Status of the calibration.
Definition: MdtCalibOutput.cxx:40
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:121
MdtCalibTwinOutput::twinID
Identifier twinID() const
Definition: MdtCalibTwinOutput.cxx:41
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:18
Muon::MdtRdoToPrepDataToolMT::m_discardSecondaryHitTwin
Gaudi::Property< bool > m_discardSecondaryHitTwin
Definition: MdtRdoToPrepDataToolMT.h:149
SG::UpdateHandle
Definition: UpdateHandle.h:91
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:237
MdtCalibInput::adc
int16_t adc() const
Returns the amount of accumulated charge.
Definition: MdtCalibInput.cxx:86
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
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
MuonGM::MuonDetectorManager::getMuonStation
const MuonStation * getMuonStation(const std::string &stName, int eta, int phi) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:139
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:108
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:51
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
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
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
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
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:230
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:16
Muon::MdtRdoToPrepDataToolMT::m_decodeData
Gaudi::Property< bool > m_decodeData
toggle on/off the decoding of MDT RDO into MdtPrepData
Definition: MdtRdoToPrepDataToolMT.h:139
Muon::MdtRdoToPrepDataToolMT::m_mdtDecoder
ToolHandle< Muon::IMDT_RDO_Decoder > m_mdtDecoder
Definition: MdtRdoToPrepDataToolMT.h:142
covarianceTool.mc
mc
Definition: covarianceTool.py:554
MuonGM::MdtReadoutElement::getNtubesperlayer
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
MdtCalibInput::tdc
int16_t tdc() const
Returns the tdc counts of the hit.
Definition: MdtCalibInput.cxx:85
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
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:30
MdtCalibOutput::driftRadius
double driftRadius() const
Returns the drift radius of the calibrated object.
Definition: MdtCalibOutput.cxx:19
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