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

 MdtRdoToPrepDataToolMT (const std::string &, const std::string &, const IInterface *)
 
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...
 
void createxAODPrepData (const MdtCalibInput &calibInput, const MdtCalibOutput &calibOutput, xAOD::MdtDriftCircleContainer *xAODMdtPrepDataContainer) const
 Creates the xAOD 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_useAllBOLTwin {this, "UseAllBOLTwin", false}
 
Gaudi::Property< bool > m_twinCorrectSlewing {this, "TwinCorrectSlewing", false}
 
Gaudi::Property< bool > m_discardSecondaryHitTwin {this, "DiscardSecondaryHitTwin", false}
 
int m_twin_chamber [2][3][36] {}
 
int m_secondaryHit_twin_chamber [2][3][36] {}
 
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_mdtxAODKey {this, "MdtxAODKey", "", "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()

Muon::MdtRdoToPrepDataToolMT::MdtRdoToPrepDataToolMT ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 80 of file MdtRdoToPrepDataToolMT.cxx.

80  :
81  base_class(t, n, p) {}

◆ ~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 241 of file MdtRdoToPrepDataToolMT.cxx.

243  {
244  if (calibInput.isMasked() || calibInput.adc() < m_adcCut ||
246  ATH_MSG_VERBOSE("Do not create calib hit for "<<m_idHelperSvc->toString(calibInput.identify())<<
247  " because it's masked "<<(calibInput.isMasked() ? "si" : "no") <<", "
248  <<"adc: "<<calibInput.adc()<<" vs. "<<m_adcCut<<", calibration bailed out "
249  <<(calibOutput.status() == MdtDriftCircleStatus::MdtStatusUnDefined? "si": "no"));
250  return nullptr;
251  }
252  const MuonGM::MdtReadoutElement* descriptor = calibInput.legacyDescriptor();
253  if (!descriptor) {
254  if (!cache.legacyDetMgr) {
255  return nullptr;
256  }
257  descriptor = cache.legacyDetMgr->getMdtReadoutElement(calibInput.identify());
258  }
259  ATH_MSG_VERBOSE("Calibrated prepdata "<<m_idHelperSvc->toString(calibInput.identify())
260  <<std::endl<<calibInput<<std::endl<<calibOutput);
261 
263  Amg::MatrixX cov(1, 1);
264  if (calibOutput.status() == MdtDriftCircleStatus::MdtStatusDriftTime){
266  const float r = calibOutput.driftRadius();
267  const float sigR = calibOutput.driftRadiusUncert();
268  driftRadius[0] = r;
269  (cov)(0, 0) = sigR * sigR;
270  } else (cov)(0, 0) = 0;
271 
272  return std::make_unique<MdtPrepData>(calibInput.identify(),
273  descriptor->identifyHash(),
274  std::move(driftRadius),
275  std::move(cov),
276  descriptor,
277  calibInput.tdc(),
278  calibInput.adc(),
279  calibOutput.status());
280  }

◆ createxAODPrepData()

void Muon::MdtRdoToPrepDataToolMT::createxAODPrepData ( const MdtCalibInput calibInput,
const MdtCalibOutput calibOutput,
xAOD::MdtDriftCircleContainer xAODMdtPrepDataContainer 
) const
protected

Creates the xAOD PRD object.

Test by how much do we break frozen Tier0

Definition at line 282 of file MdtRdoToPrepDataToolMT.cxx.

284  {
285 
286  if (!xAODMdtPrepDataContainer || !calibInput.decriptor() || calibInput.isMasked() ||
287  calibInput.adc() < m_adcCut || calibOutput.status() == MdtDriftCircleStatus::MdtStatusUnDefined) {
288  ATH_MSG_VERBOSE("Do not create calib hit for "
289  << m_idHelperSvc->toString(calibInput.identify())
290  << " because it's masked " << (calibInput.isMasked() ? "si" : "no")
291  << ", " << "adc: " << calibInput.adc() << " vs. " << m_adcCut
292  << ", calibration bailed out " << (calibOutput.status() == MdtDriftCircleStatus::MdtStatusUnDefined ? "si": "no"));
293  return;
294  }
295  ATH_MSG_VERBOSE("Calibrated xAOD prepdata "<< m_idHelperSvc->toString(calibInput.identify()) << std::endl
296  << calibInput << std::endl << calibOutput);
297 
300 
301  if (calibOutput.status() == MdtDriftCircleStatus::MdtStatusDriftTime) {
303  const float r = calibOutput.driftRadius();
304  const float sigR = calibOutput.driftRadiusUncert();
305  driftRadius[0] = r;
306  (cov)(0, 0) = sigR * sigR;
307  } else
308  (cov)(0, 0) = 0;
309 
310  auto xprd = new xAOD::MdtDriftCircle();
311  xAODMdtPrepDataContainer->push_back(xprd);
312 
313  const MdtIdHelper& id_helper{m_idHelperSvc->mdtIdHelper()};
314 
315  const Identifier prdId{calibInput.identify()};
316  xprd->setIdentifier(calibInput.identify().get_compact());
317 
318  xprd->setMeasurement(calibInput.decriptor()
319  ? calibInput.decriptor()->identHash()
320  : calibInput.legacyDescriptor()->identifyHash(), driftRadius, cov);
321 
322  xprd->setTdc(calibInput.tdc());
323  xprd->setAdc(calibInput.adc());
324  xprd->setTube(id_helper.tube(prdId));
325  xprd->setLayer(id_helper.tubeLayer(prdId));
326  xprd->setStatus(calibOutput.status());
327  xprd->setReadoutElement(calibInput.decriptor());
328  return;
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 207 of file MdtRdoToPrepDataToolMT.cxx.

208  {
209 
210  ATH_MSG_DEBUG("decodeMdtRDO for " << idVect.size() << " offline collections called");
211 
212  // setup output container
213  ConvCache mdtPrepDataContainer = setupMdtPrepDataContainer(ctx);
214  if (!mdtPrepDataContainer.isValid) {
215  return StatusCode::FAILURE;
216  }
217 
218 
219  if (!m_decodeData) {
220  ATH_MSG_DEBUG("Stored empty container. Decoding MDT RDO into MDT PrepRawData is switched off");
221  return StatusCode::SUCCESS;
222  }
223  // seeded or unseeded decoding
224  if (!idVect.empty()) {
225  processPRDHashes(ctx, mdtPrepDataContainer, idVect);
226  } else {
228  std::vector<IdentifierHash> rdoHashes{};
229  const MdtCsmContainer* rdoContainer = getRdoContainer(ctx);
230  if (!rdoContainer || rdoContainer->empty()) return StatusCode::SUCCESS;
231  rdoHashes.reserve(rdoContainer->size());
232  for (const MdtCsm* csm : *rdoContainer) rdoHashes.push_back(csm->identifyHash());
233 
234  processPRDHashes(ctx, mdtPrepDataContainer, rdoHashes);
235  }
236  ATH_CHECK(mdtPrepDataContainer.finalize(msgStream()));
237 
238  return StatusCode::SUCCESS;
239  }

◆ decode() [2/2]

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

Definition at line 155 of file MdtRdoToPrepDataToolMT.cxx.

155  {
157  const MuonMDT_CablingMap* readCdo{*readHandle};
158  if (!readCdo) {
159  ATH_MSG_ERROR("nullptr to the read conditions object");
160  return StatusCode::FAILURE;
161  }
162  return decode(ctx, readCdo->getMultiLayerHashVec(robIds, msgStream()));
163  }

◆ 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 165 of file MdtRdoToPrepDataToolMT.cxx.

165  {
166  SG::ReadHandle<MdtCsmContainer> rdoContainerHandle{m_rdoContainerKey, ctx};
167  if (rdoContainerHandle.isValid()) {
168  ATH_MSG_DEBUG("MdtgetRdoContainer success");
169  return rdoContainerHandle.cptr();
170  }
171  ATH_MSG_WARNING("Retrieval of Mdt RDO container failed !");
172  return nullptr;
173  }

◆ handlePRDHash()

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

Definition at line 186 of file MdtRdoToPrepDataToolMT.cxx.

188  {
189  const MdtCsmContainer* rdoContainer{getRdoContainer(ctx)};
190 
191  if (rdoContainer->empty()) {
192  ATH_MSG_DEBUG("The container is empty");
193  return true;
194  }
195  const MdtCsm* rdoColl = rdoContainer->indexFindPtr(rdoHash);
196  if (!rdoColl) {
197  ATH_MSG_DEBUG("The rdo container does not have the hash " << rdoHash);
198  return true;
199  }
200  if (processCsm(ctx, mdtPrepDataContainer, rdoColl).isFailure()) {
201  ATH_MSG_WARNING("processCsm failed for RDO id " << m_idHelperSvc->toString(rdoColl->identify()));
202  return false;
203  }
204  return true;
205  }

◆ initDeadChannels()

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

Definition at line 628 of file MdtRdoToPrepDataToolMT.cxx.

628  {
629  PVConstLink cv = mydetEl->getMaterialGeom(); // it is "Multilayer"
630  int nGrandchildren = cv->getNChildVols();
631  if (nGrandchildren <= 0) return;
632 
633  std::vector<int> tubes;
634  geoGetIds([&](int id) { tubes.push_back(id); }, &*cv);
635  std::sort(tubes.begin(), tubes.end());
636 
637  const Identifier detElId = mydetEl->identify();
638  const int ml = mydetEl->getMultilayer();
639  std::vector<int>::iterator it = tubes.begin();
640  for (int layer = 1; layer <= mydetEl->getNLayers(); layer++) {
641  for (int tube = 1; tube <= mydetEl->getNtubesperlayer(); tube++) {
642  int want_id = layer * maxNTubesPerLayer + tube;
643  if (it != tubes.end() && *it == want_id) {
644  ++it;
645  } else {
646  it = std::lower_bound(tubes.begin(), tubes.end(), want_id);
647  if (it != tubes.end() && *it == want_id) {
648  ++it;
649  } else {
650  Identifier deadTubeId = m_idHelperSvc->mdtIdHelper().channelID(detElId, ml, layer, tube);
651  m_DeadChannels.insert(deadTubeId);
652  ATH_MSG_VERBOSE("adding dead tube "<<m_idHelperSvc->toString(deadTubeId));
653  }
654  }
655  }
656  }
657 
658  }

◆ initialize()

StatusCode Muon::MdtRdoToPrepDataToolMT::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 83 of file MdtRdoToPrepDataToolMT.cxx.

83  {
84  ATH_CHECK(m_calibrationTool.retrieve());
85  ATH_MSG_VERBOSE("MdtCalibrationTool retrieved with pointer = " << m_calibrationTool);
86  ATH_CHECK(m_prdContainerCacheKey.initialize(!m_prdContainerCacheKey.key().empty()));
87  ATH_CHECK(m_idHelperSvc.retrieve());
88  // Retrieve the RDO decoder
89  ATH_CHECK(m_mdtDecoder.retrieve());
90 
91  // + TWIN TUBES
92  // make an array of [multilayer][layer][twin-pair]; 2 multilayers, 3 layer per multilayer, 36 twin-pairs per layer
93  if (m_useTwin) {
94  for (int i = 0; i < 2; i++) {
95  for (int j = 0; j < 3; j++) {
96  for (int k = 0; k < 36; k++) {
97  // fill m_twin_chamber array with unique numbers
98  m_twin_chamber[i][j][k] = 1000 * i + 100 * j + k;
99  // for secondary hits we need to make a second array with unique numbers
100  // (i+1 is used in the expression, so numbers are always different from m_twin_chamber array)
101  m_secondaryHit_twin_chamber[i][j][k] = 10000 * (i + 1) + 100 * j + k;
102  }
103  }
104  }
105  } // end if(m_useTwin){
106  // - TWIN TUBES
107 
108 
109  m_BMGid = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG");
110  m_BMGpresent = m_BMGid != -1;
111  if (m_useNewGeo) {
113  }
114  if (m_BMGpresent && !m_useNewGeo) {
115  const MuonGM::MuonDetectorManager* muDetMgr = nullptr;
116  ATH_CHECK(detStore()->retrieve(muDetMgr));
117 
118  ATH_MSG_INFO("Processing configuration for layouts with BMG chambers.");
119 
120  for (int phi = 6; phi < 8; phi++) { // phi sectors
121  for (int eta = 1; eta < 4; eta++) { // eta sectors
122  for (int side = -1; side < 2; side += 2) { // side
123  if (!muDetMgr->getMuonStation("BMG", side * eta, phi)) continue;
124  for (int roe = 1; roe <= (muDetMgr->getMuonStation("BMG", side * eta, phi))->nMuonReadoutElements();
125  roe++) { // iterate on readout elemets
126  const MdtReadoutElement* mdtRE = dynamic_cast<const MdtReadoutElement*>(
127  (muDetMgr->getMuonStation("BMG", side * eta, phi))->getMuonReadoutElement(roe)); // has to be an MDT
128  if (mdtRE) initDeadChannels(mdtRE);
129  }
130  }
131  }
132  }
133  } else if (m_useNewGeo) {
134  std::vector<const MuonGMR4::MdtReadoutElement*> mdtRE = m_detMgrR4->getAllMdtReadoutElements();
135  for (const MuonGMR4::MdtReadoutElement* re : mdtRE) {
136  if (re->stationName() != m_BMGid) {
137  continue;
138  }
139  for (IdentifierHash dead : re->getParameters().removedTubes) {
140  m_DeadChannels.insert(re->measurementId(dead));
141  }
142  }
143  }
144 
145  // check if initializing of DataHandle objects success
147  ATH_CHECK(m_mdtPrepDataContainerKey.initialize());
150  ATH_CHECK(m_mdtxAODKey.initialize(!m_mdtxAODKey.empty()));
152  return StatusCode::SUCCESS;
153  }

◆ 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  // two chambers in ATLAS are installed with Twin Tubes; in detector coordinates BOL4A13 & BOL4C13; only INNER multilayer(=1) is
336  // with twin tubes implement twin tube writing to prepData either for all BOL (m_useAllBOLTwin = true) _OR_ only for two
337  // chambers really installed
338  Identifier elementId = rdoColl->identify();
339  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(elementId);
340  if (chIndex == MuonStationIndex::BOL &&
341  (m_useAllBOLTwin || (std::abs(id_helper.stationEta(elementId)) == 4 && id_helper.stationPhi(elementId) == 7))) {
342  return processCsmTwin(ctx, cache, rdoColl);
343  }
344  }
345 
346  ATH_MSG_DEBUG(" ***************** Start of processCsm");
347 
349  const Identifier elementId = id_helper.parentID(rdoColl->identify());
350 
351  uint16_t subdetId = rdoColl->SubDetId();
352  uint16_t mrodId = rdoColl->MrodId();
353  uint16_t csmId = rdoColl->CsmId();
354  ATH_MSG_VERBOSE("Identifier = " << m_idHelperSvc->toString(elementId) << " subdetId/ mrodId/ csmId = " << subdetId << " / "
355  << mrodId << " / " << csmId);
356 
357  // for each Csm, loop over AmtHit, converter AmtHit to digit
358  // retrieve/create digit collection, and insert digit into collection
359  int mc = 0;
360  for (const MdtAmtHit* amtHit : *rdoColl) {
361  mc++;
362 
363  // FIXME: Still use the digit class.
364  ATH_MSG_VERBOSE("Amt Hit n. " << mc << " tdcId = " << amtHit->tdcId());
365  std::unique_ptr<MdtDigit> newDigit{m_mdtDecoder->getDigit(amtHit, subdetId, mrodId, csmId)};
366  if (!newDigit) {
367  ATH_MSG_WARNING("Found issue MDT RDO decoder for subdetId/mrodId/csmId "
368  << subdetId << "/" << mrodId << "/" << csmId << " amtHit channelId/tdcId =" << amtHit->channelId() << "/"
369  << amtHit->tdcId());
370  continue;
371  }
372  // Do something with it
373  Identifier channelId = newDigit->identify();
374  if (m_DeadChannels.count(channelId)) continue;
375 
376  // Retrieve the proper PRD container. Note that there are cases where one CSM is either split into 2 chambers (BEE / BIS78
377  // legacy) or 2 CSMs are split into one chamber
378  MdtPrepDataCollection* driftCircleColl = cache.createCollection(channelId, msgStream());
379  if (!driftCircleColl) {
380  ATH_MSG_DEBUG("Corresponding multi layer " << m_idHelperSvc->toString(channelId) << " is already decoded.");
381  continue;
382  }
383 
384  // check if the module ID of this channel is different from the CSM one
385  // If it's the first case, create the additional collection
386 
387  ATH_MSG_VERBOSE("got digit with id ext / hash " << m_idHelperSvc->toString(channelId) << " / "
388  << driftCircleColl->identifyHash());
389 
390  // Rescale ADC/TDC of chambers using HPTDC digitization chip
391  // Must create a new digit from the old one, because MdtDigit has no methods to set ADC/TDC
392  if (m_idHelperSvc->hasHPTDC(channelId)) {
393  int adc = newDigit->adc() / 4;
394  int tdc = newDigit->tdc() / 4;
395  int mask = newDigit->is_masked();
396  newDigit = std::make_unique<MdtDigit>(channelId, tdc, adc, mask);
397  ATH_MSG_DEBUG("Change HPTDC ADC/TDC " << m_idHelperSvc->toString(channelId) << " Old ADC/TDC=" << adc * 4 << " " << tdc * 4
398  << " New=" << adc << " " << tdc);
399  }
400  const MdtCalibInput calibIn = m_useNewGeo ? MdtCalibInput{*newDigit, *m_detMgrR4, *cache.gctx}:
401  MdtCalibInput{*newDigit, *cache.legacyDetMgr};
402  const MdtCalibOutput calibResult{m_calibrationTool->calibrate(ctx, calibIn, false)};
403 
404  std::unique_ptr<MdtPrepData> newPrepData = createPrepData(calibIn, calibResult, cache);
405  if (newPrepData) {
406  newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
407  driftCircleColl->push_back(std::move(newPrepData));
408  }
409  createxAODPrepData(calibIn, calibResult, cache.xAODPrd);
410  }
411  return StatusCode::SUCCESS;
412  }

◆ processCsmTwin()

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

MDT hit context

Definition at line 413 of file MdtRdoToPrepDataToolMT.cxx.

413  {
414  const MdtIdHelper& id_helper = m_idHelperSvc->mdtIdHelper();
415  ATH_MSG_DEBUG(" ***************** Start of processCsmTwin");
416  ATH_MSG_DEBUG(" Number of AmtHit in this Csm " << rdoColl->size());
418  Identifier elementId = id_helper.parentID(rdoColl->identify());
419 
420  uint16_t subdetId = rdoColl->SubDetId();
421  uint16_t mrodId = rdoColl->MrodId();
422  uint16_t csmId = rdoColl->CsmId();
423  ATH_MSG_VERBOSE("Identifier = " << m_idHelperSvc->toString(elementId) << " subdetId/ mrodId/ csmId = " << rdoColl->SubDetId()
424  << " / " << rdoColl->MrodId() << " / " << rdoColl->CsmId());
425 
426  // for each Csm, loop over AmtHit, converter AmtHit to digit
427  // retrieve/create digit collection, and insert digit into collection
428 
429  // make a map to be filled for every twin-pair
430  // std::map<int, std::vector<MdtDigit*> > mdtDigitColl;
431 
432  using twin_digit = std::pair<std::unique_ptr<MdtDigit>, std::unique_ptr<MdtDigit>>;
433  std::map<int, twin_digit> mdtDigitColl;
434 
435  for (const MdtAmtHit* amtHit : *rdoColl) {
436  std::unique_ptr<MdtDigit> newDigit{m_mdtDecoder->getDigit(amtHit, subdetId, mrodId, csmId)};
437 
438  if (!newDigit) {
439  ATH_MSG_WARNING("Error in MDT RDO decoder for subdetId/mrodId/csmId "
440  << subdetId << "/" << mrodId << "/" << csmId << " amtHit channelId/tdcId =" << amtHit->channelId() << "/"
441  << amtHit->tdcId());
442  continue;
443  }
444 
445  // make an Identifier
446  Identifier channelId = newDigit->identify();
447 
448  // get tube params
449  int tube = id_helper.tube(channelId);
450  int layer = id_helper.tubeLayer(channelId);
451  int multilayer = id_helper.multilayer(channelId);
452 
453  // find the correct twin-pair (tube-1 & tube-3 are twin pair 1, tube-2 & tube-4 are twin pair 2)
454  int twinPair = -1;
455  if (tube % 4 == 1) {
456  twinPair = (tube + 1) / 2;
457  } else if (tube % 4 == 3) {
458  twinPair = (tube - 1) / 2;
459  } else if (tube % 4 == 2) {
460  twinPair = (tube + 2) / 2;
461  } else {
462  twinPair = tube / 2;
463  } // tube%4 == 0
464 
465  // fill the digitColl map
466  twin_digit& pair = mdtDigitColl[m_twin_chamber[multilayer - 1][layer - 1][twinPair - 1]];
467  if (!pair.first) {
468  pair.first = std::move(newDigit);
469  } else if (!pair.second) {
470  pair.second = std::move(newDigit);
471  }
472  // if a secondary hit appears in a tube add it to mdtDigitColl, unless m_discardSecondaryHitTwin flag is true
473  else {
474  ATH_MSG_VERBOSE(" TWIN TUBES: found a secondary(not twin) hit in a twin tube");
475  twin_digit& secondPair = mdtDigitColl[m_secondaryHit_twin_chamber[multilayer - 1][layer - 1][twinPair - 1]];
477  if (!secondPair.first) {
478  secondPair.first = std::move(newDigit);
479  } else if (!secondPair.second) {
480  secondPair.second = std::move(newDigit);
481  } else {
482  ATH_MSG_VERBOSE(" TWIN TUBES: found a tertiary hit in a twin tube in one RdoCollection for "
483  << m_idHelperSvc->toString(channelId) << " with adc = " << newDigit->adc()
484  << " tdc = " << newDigit->tdc());
485  }
486  } // end -- if(!m_discardSecondaryHitTwin){
487  else {
488  ATH_MSG_DEBUG(" TWIN TUBES: discarding secondary(non-twin) hit in a twin tube as flag m_discardSecondaryHitTwin is set to true");
489  }
490  }
491  } // end for-loop over rdoColl
492 
493  // iterate over mdtDigitColl
494  for (std::pair<const int, twin_digit>& digitPair : mdtDigitColl) {
495  // get the twin hits from mdtDigitColl
496  std::unique_ptr<MdtDigit>& digit = digitPair.second.first;
497  std::unique_ptr<MdtDigit>& second_digit = digitPair.second.second;
498 
499  if (!digit) {
500  ATH_MSG_FATAL("nullptr to a digit ");
501  return StatusCode::FAILURE;
502  }
503 
504  // Do something with it
505  Identifier channelId = digit->identify();
506  int multilayer = id_helper.multilayer(channelId);
507 
508  MdtPrepDataCollection* driftCircleColl = cache.createCollection(channelId, msgStream());
509  if (!driftCircleColl) {
510  ATH_MSG_DEBUG("Corresponding multi layer " << m_idHelperSvc->toString(channelId) << " is already decoded.");
511  continue;
512  }
513 
514  // check if the hit is in multilayer=1
515  // two chambers in ATLAS are installed with Twin Tubes; in detector coordinates BOL4A13 & BOL4C13; only INNER multilayer(=1) is
516  // with twin tubes
517  if (multilayer == 1) {
518  // if no twin hit present in data, use standard PRD making
519  if (!second_digit) {
520  ATH_MSG_VERBOSE("got digit with id ext / hash " << m_idHelperSvc->toString(channelId) << " / "
521  << driftCircleColl->identifyHash());
522 
523  const MdtCalibInput mdtCalibIn = m_useNewGeo ? MdtCalibInput{*digit, *m_detMgrR4, *cache.gctx}:
524  MdtCalibInput{*digit, *cache.legacyDetMgr};
525 
526  const MdtCalibOutput mdtCalibOut{m_calibrationTool->calibrate(ctx, mdtCalibIn, false)};
527 
528  // Create new PrepData
529  std::unique_ptr<MdtPrepData> newPrepData = createPrepData(mdtCalibIn, mdtCalibOut, cache);
530  if (newPrepData) {
531  newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
532  driftCircleColl->push_back(std::move(newPrepData));
533 
534  }
535  createxAODPrepData(mdtCalibIn, mdtCalibOut, cache.xAODPrd);
536  ATH_MSG_DEBUG(" MADE ORIGINAL PREPDATA " << m_idHelperSvc->toString(channelId) << " " << mdtCalibOut);
537  continue;
538  }
539  if (digit->is_masked() || second_digit->is_masked()) {
540  continue;
541  }
542  MdtCalibInput mdtCalib1st = m_useNewGeo ? MdtCalibInput{*digit, *m_detMgrR4, *cache.gctx}
543  : MdtCalibInput{*digit, *cache.legacyDetMgr};
544 
545  MdtCalibInput mdtCalib2nd = m_useNewGeo ? MdtCalibInput{*second_digit, *m_detMgrR4, *cache.gctx}
546  : MdtCalibInput{*second_digit, *cache.legacyDetMgr};
547 
548  updateClosestApproachTwin(mdtCalib1st);
549  updateClosestApproachTwin(mdtCalib2nd);
550 
551  const MdtCalibTwinOutput twinCalib = m_calibrationTool->calibrateTwinTubes(ctx, mdtCalib1st, mdtCalib2nd);
552 
553  Amg::Vector2D hitPos{twinCalib.primaryDriftR(), twinCalib.locZ()};
554  Amg::MatrixX cov(2, 2);
555  (cov)(0, 0) = twinCalib.uncertPrimaryR() * twinCalib.uncertPrimaryR();
556  (cov)(1, 1) = twinCalib.sigmaZ() * twinCalib.sigmaZ();
557  (cov)(0, 1) = 0;
558  (cov)(1, 0) = 0;
559 
560  const MuonGM::MdtReadoutElement* descriptor = cache.legacyDetMgr->getMdtReadoutElement(mdtCalib1st.identify());
561  std::unique_ptr<MdtTwinPrepData> twin_newPrepData = std::make_unique<MdtTwinPrepData>(twinCalib.primaryID(),
562  descriptor->identifyHash(),
563  std::move(hitPos),
564  std::move(cov),
565  descriptor,
566  twinCalib.primaryTdc(),
567  twinCalib.primaryAdc(),
568  twinCalib.twinTdc(),
569  twinCalib.twinAdc(),
570  twinCalib.primaryStatus());
571 
572  ATH_MSG_DEBUG(" MADE A 2D TWINPREPDATA " << m_idHelperSvc->toString(twinCalib.primaryID()) << " & "
573  << m_idHelperSvc->toString(twinCalib.twinID()) << " "<<twinCalib);
574  Amg::Vector3D gpos_centertube = twin_newPrepData->globalPosition();
575 
576  Amg::Vector3D locpos_centertube = twinCalib.locZ() * Amg::Vector3D::UnitZ();
577  const Amg::Vector3D gpos_twin = descriptor->localToGlobalTransf(twinCalib.primaryID())*locpos_centertube;
578 
579  ATH_MSG_DEBUG("global pos center tube " << Amg::toString(gpos_centertube, 2) << std::endl
580  <<"local pos center tube w/ TWIN INFO "<<Amg::toString(locpos_centertube, 2)<<std::endl
581  <<"global pos w/ TWIN INFO "<<Amg::toString(gpos_twin));
582 
583  twin_newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
584  driftCircleColl->push_back(std::move(twin_newPrepData));
585 
586 
587  } else {
588  // if multilayer=2, then treat every hit as a separate hit, no twin hit should be present here as the hardware is not
589  // installed
590 
591  const MdtCalibInput calibInput1st = m_useNewGeo ? MdtCalibInput{*digit, *m_detMgrR4, *cache.gctx}
592  : MdtCalibInput{*digit, *cache.legacyDetMgr};
593  const MdtCalibOutput calibResult1st{m_calibrationTool->calibrate(ctx, calibInput1st, false)};
594  // Create new PrepData
595  std::unique_ptr<MdtPrepData> newPrepData = createPrepData(calibInput1st, calibResult1st, cache);
596  if (newPrepData) {
597  newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
598  driftCircleColl->push_back(std::move(newPrepData));
599  ATH_MSG_DEBUG(" MADE ORIGINAL PREPDATA " << m_idHelperSvc->toString(channelId) << " "<<calibResult1st);
600  }
601  createxAODPrepData(calibInput1st, calibResult1st, cache.xAODPrd);
602 
603  if (!second_digit) continue;
604  // Calculate radius
605 
606  const MdtCalibInput calibInput2nd = m_useNewGeo ? MdtCalibInput{*second_digit, *m_detMgrR4, *cache.gctx}
607  : MdtCalibInput{*second_digit, *cache.legacyDetMgr};
608  const MdtCalibOutput calibResult2nd{m_calibrationTool->calibrate(ctx, calibInput2nd, false)};
609 
610  // second_digit
611  // Create new PrepData
612  std::unique_ptr<MdtPrepData> second_newPrepData = createPrepData(calibInput2nd, calibResult2nd, cache);
613  if (second_newPrepData) {
614  second_newPrepData->setHashAndIndex(driftCircleColl->identifyHash(), driftCircleColl->size());
615  driftCircleColl->push_back(std::move(second_newPrepData));
616  }
617  createxAODPrepData(calibInput2nd, calibResult2nd, cache.xAODPrd);
618 
619  // second_digit
620  ATH_MSG_DEBUG(" MADE ORIGINAL PREPDATA FOR SECOND DIGIT "
621  << m_idHelperSvc->toString(calibInput2nd.identify())
622  << " "<<calibResult2nd);
623 
624  }
625  }
626  return StatusCode::SUCCESS;
627  }

◆ processPRDHashes()

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

Definition at line 179 of file MdtRdoToPrepDataToolMT.cxx.

180  {
181  for (const IdentifierHash& hash : multiLayerHashInRobs) {
182  if (!handlePRDHash(ctx, mdtPrepDataContainer, hash)) { ATH_MSG_DEBUG("Failed to process hash " << hash); }
183  } // ends loop over chamberhash
184  }

◆ provideEmptyContainer()

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

Definition at line 175 of file MdtRdoToPrepDataToolMT.cxx.

175  {
176  return setupMdtPrepDataContainer(ctx).isValid ? StatusCode::SUCCESS : StatusCode::FAILURE;
177  }

◆ 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 659 of file MdtRdoToPrepDataToolMT.cxx.

659  {
660 
661  ConvCache cache{m_idHelperSvc.get()};
662 
664  // Caching of PRD container
665  if (m_prdContainerCacheKey.key().empty()) {
666  // without the cache we just record the container
667  StatusCode status = handle.record(std::make_unique<MdtPrepDataContainer>(m_idHelperSvc->mdtIdHelper().module_hash_max()));
668  if (status.isFailure() || !handle.isValid()) {
669  ATH_MSG_FATAL("Could not record container of MDT PrepData Container at " << m_mdtPrepDataContainerKey.key());
670  return cache;
671  }
672  ATH_MSG_VERBOSE("Created container " << m_mdtPrepDataContainerKey.key());
673  cache.legacyPrd = handle.ptr();
674  } else {
675  // use the cache to get the container
677  if (!update.isValid()) {
678  ATH_MSG_FATAL("Invalid UpdateHandle " << m_prdContainerCacheKey.key());
679  return cache;
680  }
681  StatusCode status = handle.record(std::make_unique<MdtPrepDataContainer>(update.ptr()));
682  if (status.isFailure() || !handle.isValid()) {
683  ATH_MSG_FATAL("Could not record container of MDT PrepData Container using cache " << m_prdContainerCacheKey.key() << " - "
684  << m_mdtPrepDataContainerKey.key());
685  return cache;
686  }
687  ATH_MSG_VERBOSE("Created container using cache for " << m_prdContainerCacheKey.key());
688  cache.legacyPrd = handle.ptr();
689  }
690  if (!m_mdtxAODKey.empty()) {
692  if (!writeHandle.recordNonConst(std::make_unique<xAOD::MdtDriftCircleContainer>(),
693  std::make_unique<xAOD::MdtDriftCircleAuxContainer>()).isSuccess() ||
694  !writeHandle.isValid()) {
695  ATH_MSG_FATAL("Failed to write xAOD::MdtPrepDataContainer "<<m_mdtxAODKey.fullKey());
696  return cache;
697  }
698  cache.xAODPrd = writeHandle.ptr();
699  }
701  if (!m_geoCtxKey.empty()) {
703  if (!readHandle.isPresent()) {
704  ATH_MSG_FATAL("Failed to retrieve the geometry context "<<m_geoCtxKey.fullKey());
705  return cache;
706  }
707  cache.gctx = readHandle.cptr();
708  }
710  if (!m_muDetMgrKey.empty()) {
712  if (!detMgrHandle.isValid()) {
713  ATH_MSG_FATAL("Failed to retrieve the detector manager from the conditions store "<<m_muDetMgrKey.fullKey());
714  return cache;
715  }
716  cache.legacyDetMgr = detMgrHandle.cptr();
717  }
718  // Pass the container from the handle
719  cache.isValid = true;
720  return cache;
721  }

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 140 of file MdtRdoToPrepDataToolMT.h.

◆ m_BMGid

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

Definition at line 149 of file MdtRdoToPrepDataToolMT.h.

◆ m_BMGpresent

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

Definition at line 148 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 142 of file MdtRdoToPrepDataToolMT.h.

◆ m_calibrationTool

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

MDT calibration service.

Definition at line 123 of file MdtRdoToPrepDataToolMT.h.

◆ m_DeadChannels

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

Definition at line 160 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 143 of file MdtRdoToPrepDataToolMT.h.

◆ m_detMgrR4

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

Definition at line 129 of file MdtRdoToPrepDataToolMT.h.

◆ m_discardSecondaryHitTwin

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

Definition at line 155 of file MdtRdoToPrepDataToolMT.h.

◆ m_geoCtxKey

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

Definition at line 130 of file MdtRdoToPrepDataToolMT.h.

◆ m_idHelperSvc

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

Definition at line 120 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 146 of file MdtRdoToPrepDataToolMT.h.

◆ m_mdtPrepDataContainerKey

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

MdtPrepRawData containers.

Definition at line 134 of file MdtRdoToPrepDataToolMT.h.

◆ m_mdtxAODKey

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

Definition at line 172 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 165 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 168 of file MdtRdoToPrepDataToolMT.h.

◆ m_rdoContainerKey

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

Definition at line 136 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 163 of file MdtRdoToPrepDataToolMT.h.

◆ m_secondaryHit_twin_chamber

int Muon::MdtRdoToPrepDataToolMT::m_secondaryHit_twin_chamber[2][3][36] {}
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 144 of file MdtRdoToPrepDataToolMT.h.

◆ m_twin_chamber

int Muon::MdtRdoToPrepDataToolMT::m_twin_chamber[2][3][36] {}
protected

Definition at line 156 of file MdtRdoToPrepDataToolMT.h.

◆ m_twinCorrectSlewing

Gaudi::Property<bool> Muon::MdtRdoToPrepDataToolMT::m_twinCorrectSlewing {this, "TwinCorrectSlewing", false}
protected

Definition at line 154 of file MdtRdoToPrepDataToolMT.h.

◆ m_useAllBOLTwin

Gaudi::Property<bool> Muon::MdtRdoToPrepDataToolMT::m_useAllBOLTwin {this, "UseAllBOLTwin", false}
protected

Definition at line 153 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 126 of file MdtRdoToPrepDataToolMT.h.

◆ m_useTwin

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

Definition at line 152 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
MdtCalibInput::tdc
int tdc() const
Returns the tdc counts of the hit.
Definition: MdtCalibInput.cxx:63
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:722
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:126
MdtCalibInput::decriptor
const MuonGMR4::MdtReadoutElement * decriptor() const
Returns the R4 readout element.
Definition: MdtCalibInput.cxx:66
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:29
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
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:27
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
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
MdtCalibInput::legacyDescriptor
const MuonGM::MdtReadoutElement * legacyDescriptor() const
Returns the legacy readout element.
Definition: MdtCalibInput.cxx:65
Muon::MdtRdoToPrepDataToolMT::createPrepData
std::unique_ptr< MdtPrepData > createPrepData(const MdtCalibInput &calibInput, const MdtCalibOutput &calibOutput, ConvCache &cache) const
Creates the PRD object.
Definition: MdtRdoToPrepDataToolMT.cxx:241
MdtCalibInput::isMasked
bool isMasked() const
Returns whether the constructing digit has been masked.
Definition: MdtCalibInput.cxx:67
Muon::MdtRdoToPrepDataToolMT::m_mdtxAODKey
SG::WriteHandleKey< xAOD::MdtDriftCircleContainer > m_mdtxAODKey
Definition: MdtRdoToPrepDataToolMT.h:172
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Muon::MdtRdoToPrepDataToolMT::m_rdoContainerKey
SG::ReadHandleKey< MdtCsmContainer > m_rdoContainerKey
Definition: MdtRdoToPrepDataToolMT.h:136
Muon::MdtPrepDataCollection
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection
Definition: MuonPrepDataCollection.h:106
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
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:209
MdtCsm::SubDetId
uint16_t SubDetId() const
Returns the sub-detector Id.
Definition: MdtCsm.h:57
MdtCalibTwinOutput::sigmaZ
double sigmaZ() const
Definition: MdtCalibTwinOutput.cxx:49
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:724
MdtCalibTwinOutput::twinTdc
int twinTdc() const
Definition: MdtCalibTwinOutput.cxx:38
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition: MdtCsmContainer.h:22
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
MdtCalibTwinOutput::uncertPrimaryR
double uncertPrimaryR() const
Definition: MdtCalibTwinOutput.cxx:52
MdtDigit::is_masked
bool is_masked() const
Definition: MdtDigit.h:56
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:62
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:140
Muon::MdtRdoToPrepDataToolMT::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: MdtRdoToPrepDataToolMT.h:130
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
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:247
TRT::Hit::side
@ side
Definition: HitInfo.h:83
Muon::MdtRdoToPrepDataToolMT::m_mdtPrepDataContainerKey
SG::WriteHandleKey< Muon::MdtPrepDataContainer > m_mdtPrepDataContainerKey
MdtPrepRawData containers.
Definition: MdtRdoToPrepDataToolMT.h:134
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:207
MdtCsm::MrodId
uint16_t MrodId() const
Returns the MROD id from the CSM header.
Definition: MdtCsm.h:59
MuonMDT_CablingMap
Definition: MuonMDT_CablingMap.h:24
xAOD::MdtDriftCircle
MdtDriftCircle_v1 MdtDriftCircle
Defined the version of the MdtDriftCircle.
Definition: MdtDriftCircle.h:12
mc
Definition: mc.PG_single_nu_valid.py:1
Muon::MdtRdoToPrepDataToolMT::m_detMgrR4
const MuonGMR4::MuonDetectorManager * m_detMgrR4
Definition: MdtRdoToPrepDataToolMT.h:129
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:152
MdtCalibInput::adc
int adc() const
Returns the amount of accumulated charge.
Definition: MdtCalibInput.cxx:64
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:50
Muon::MdtRdoToPrepDataToolMT::setupMdtPrepDataContainer
ConvCache setupMdtPrepDataContainer(const EventContext &ctx) const
Creates the prep data container to be written.
Definition: MdtRdoToPrepDataToolMT.cxx:659
Muon::MdtRdoToPrepDataToolMT::processCsmTwin
StatusCode processCsmTwin(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColll) const
Definition: MdtRdoToPrepDataToolMT.cxx:413
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
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
Muon::MdtRdoToPrepDataToolMT::m_useAllBOLTwin
Gaudi::Property< bool > m_useAllBOLTwin
Definition: MdtRdoToPrepDataToolMT.h:153
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:59
Muon::MdtRdoToPrepDataToolMT::m_BMGpresent
bool m_BMGpresent
Definition: MdtRdoToPrepDataToolMT.h:148
MdtIdHelper
Definition: MdtIdHelper.h:61
MdtIdHelper::tube
int tube(const Identifier &id) const
Definition: MdtIdHelper.cxx:726
Muon::MdtRdoToPrepDataToolMT::m_readKey
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_readKey
Definition: MdtRdoToPrepDataToolMT.h:163
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MdtRdoToPrepDataToolMT::initDeadChannels
void initDeadChannels(const MuonGM::MdtReadoutElement *mydetEl)
Definition: MdtRdoToPrepDataToolMT.cxx:628
MdtCalibTwinOutput::locZ
double locZ() const
Definition: MdtCalibTwinOutput.cxx:48
Muon::MdtRdoToPrepDataToolMT::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtRdoToPrepDataToolMT.h:120
Muon::MdtRdoToPrepDataToolMT::getRdoContainer
const MdtCsmContainer * getRdoContainer(const EventContext &ctx) const
Loads the input RDO container from StoreGate.
Definition: MdtRdoToPrepDataToolMT.cxx:165
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
MuonGMR4::MuonReadoutElement::identHash
IdentifierHash identHash() const
Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class...
MuonGM::MdtReadoutElement::localToGlobalTransf
const Amg::Transform3D & localToGlobalTransf(const Identifier &id) const
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:122
xAOD::MeasVector
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
Definition: MeasurementDefs.h:52
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:814
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:19
Muon::MdtRdoToPrepDataToolMT::m_discardSecondaryHitTwin
Gaudi::Property< bool > m_discardSecondaryHitTwin
Definition: MdtRdoToPrepDataToolMT.h:155
SG::UpdateHandle
Definition: UpdateHandle.h:94
Muon::MdtRdoToPrepDataToolMT::m_twin_chamber
int m_twin_chamber[2][3][36]
Definition: MdtRdoToPrepDataToolMT.h:156
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
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:809
Muon::MdtRdoToPrepDataToolMT::handlePRDHash
bool handlePRDHash(const EventContext &ctx, ConvCache &mdtPrepDataContainer, IdentifierHash rdoHash) const
Definition: MdtRdoToPrepDataToolMT.cxx:186
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::MdtRdoToPrepDataToolMT::m_BMGid
int m_BMGid
Definition: MdtRdoToPrepDataToolMT.h:149
MdtCalibOutput::driftRadiusUncert
double driftRadiusUncert() const
Returns the uncertainty on the drift radius.
Definition: MdtCalibOutput.cxx:20
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
geoGetIds
void geoGetIds(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
Definition: GeoGetIds.h:82
dqt_zlumi_pandas.update
update
Definition: dqt_zlumi_pandas.py:42
Muon::MdtRdoToPrepDataToolMT::ConvCache::isValid
bool isValid
Flag set to indicate that the complete validation was successful.
Definition: MdtRdoToPrepDataToolMT.h:85
MdtCalibTwinOutput
Definition: MdtCalibTwinOutput.h:11
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
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
MdtCalibTwinOutput::primaryAdc
int primaryAdc() const
Definition: MdtCalibTwinOutput.cxx:34
Muon::MdtRdoToPrepDataToolMT::m_calibrationTool
ToolHandle< IMdtCalibrationTool > m_calibrationTool
MDT calibration service.
Definition: MdtRdoToPrepDataToolMT.h:123
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MdtRdoToPrepDataToolMT::processPRDHashes
void processPRDHashes(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const std::vector< IdentifierHash > &chamberHashInRobs) const
Definition: MdtRdoToPrepDataToolMT.cxx:179
Muon::MdtStatusUnDefined
@ MdtStatusUnDefined
Undefined.
Definition: MdtDriftCircleStatus.h:43
Muon::MdtRdoToPrepDataToolMT::createxAODPrepData
void createxAODPrepData(const MdtCalibInput &calibInput, const MdtCalibOutput &calibOutput, xAOD::MdtDriftCircleContainer *xAODMdtPrepDataContainer) const
Creates the xAOD PRD object.
Definition: MdtRdoToPrepDataToolMT.cxx:282
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
MuonGM::MuonReadoutElement::identifyHash
IdentifierHash identifyHash() const override final
Returns the IdentifierHash of the MuonStation, i.e.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:185
xAOD::MeasMatrix
Eigen::Matrix< float, N, N > MeasMatrix
Definition: MeasurementDefs.h:54
Muon::MdtRdoToPrepDataToolMT::m_decodeData
Gaudi::Property< bool > m_decodeData
toggle on/off the decoding of MDT RDO into MdtPrepData
Definition: MdtRdoToPrepDataToolMT.h:143
Muon::MdtRdoToPrepDataToolMT::m_mdtDecoder
ToolHandle< Muon::IMDT_RDO_Decoder > m_mdtDecoder
Definition: MdtRdoToPrepDataToolMT.h:146
MuonGM::MdtReadoutElement::getNtubesperlayer
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
Muon::MdtRdoToPrepDataToolMT::m_secondaryHit_twin_chamber
int m_secondaryHit_twin_chamber[2][3][36]
Definition: MdtRdoToPrepDataToolMT.h:157
Muon::MuonStationIndex::BOL
@ BOL
Definition: MuonStationIndex.h:17
Muon::MdtRdoToPrepDataToolMT::m_muDetMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
Definition: MdtRdoToPrepDataToolMT.h:165
calibdata.tube
tube
Definition: calibdata.py:31
MdtCalibOutput::driftRadius
double driftRadius() const
Returns the drift radius of the calibrated object.
Definition: MdtCalibOutput.cxx:19
fitman.k
k
Definition: fitman.py:528
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:168
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_DeadChannels
std::unordered_set< Identifier > m_DeadChannels
Definition: MdtRdoToPrepDataToolMT.h:160