ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Muon::MuonPatternCalibration Class Reference

#include <MuonPatternCalibration.h>

Inheritance diagram for Muon::MuonPatternCalibration:
Collaboration diagram for Muon::MuonPatternCalibration:

Classes

struct  EtaPhiHits
 
struct  Region
 

Public Types

using ISPrd = std::pair< Amg::Vector3D, const MuonCluster * >
 
using ISPrdVec = std::vector< ISPrd >
 
using ISPrdMdt = std::pair< Amg::Vector3D, const MdtPrepData * >
 
using ISPrdMdtVec = std::vector< ISPrdMdt >
 
using RegionIdMap = std::map< int, ISPrdMdtVec >
 
using RegionMap = std::map< int, Region >
 

Public Member Functions

 MuonPatternCalibration (const std::string &, const std::string &, const IInterface *)
 
virtual ~MuonPatternCalibration ()=default
 
virtual StatusCode initialize () override
 
StatusCode calibrate (const EventContext &ctx, const MuonPatternCombination &pat, ROTsPerRegion &hitsPerRegion) const override
 
int getRegionId (const Identifier &id) const override
 
bool checkForPhiMeasurements (const MuonPatternCombination &pat) const override
 

Private Member Functions

StatusCode createRegionMap (const EventContext &ctx, const MuonPatternCombination &pat, RegionMap &regionMap, bool hasPhiMeasurements) const
 
void printRegionMap (const RegionMap &regionMap) const
 
void calibrateRegionMap (const RegionMap &regionMap, IMuonPatternCalibration::ROTsPerRegion &hitsPerRegion) const
 
void insertCluster (const MuonCluster &mdt, RegionMap &regionMap, const Amg::Vector3D &patpose, const Amg::Vector3D &patdire, bool hasPhiMeasurements) const
 
void insertMdt (const MdtPrepData &clus, RegionMap &regionMap, const Amg::Vector3D &patpose, const Amg::Vector3D &patdire, bool hasPhiMeasurements) const
 
template<class ContType >
StatusCode loadFromStoreGate (const EventContext &ctx, const SG::ReadHandleKey< ContType > &key, const ContType *&cont_ptr) const
 load the container from storegate given a ReadHandleKey. More...
 

Private Attributes

ToolHandle< IMdtDriftCircleOnTrackCreatorm_mdtCreator
 
ToolHandle< IMuonClusterOnTrackCreatorm_clusterCreator
 
PublicToolHandle< MuonEDMPrinterToolm_printer
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc
 
Gaudi::Property< bool > m_doMultiAnalysis {this, "DoMultiChamberAnalysis", true}
 
Gaudi::Property< double > m_dropDistance {this, "DropDistance", 1500.}
 
Gaudi::Property< double > m_phiAngleCut {this, "AngleCutPhi", 1.e9}
 
Gaudi::Property< bool > m_doSummary {this, "DoSummary", false}
 
Gaudi::Property< bool > m_recoverTriggerHits {this, "RecoverTriggerHits", true}
 
Gaudi::Property< bool > m_removeDoubleMdtHits {this, "RemoveDoubleMdtHits", true}
 
SG::ReadHandleKey< Muon::RpcPrepDataContainerm_keyRpc {this, "RpcPrepDataContainer","RPC_Measurements"}
 
SG::ReadHandleKey< Muon::TgcPrepDataContainerm_keyTgc {this, "TgcPrepDataContainer","TGC_Measurements"}
 

Detailed Description

Definition at line 30 of file MuonPatternCalibration.h.

Member Typedef Documentation

◆ ISPrd

Definition at line 32 of file MuonPatternCalibration.h.

◆ ISPrdMdt

Definition at line 35 of file MuonPatternCalibration.h.

◆ ISPrdMdtVec

Definition at line 36 of file MuonPatternCalibration.h.

◆ ISPrdVec

Definition at line 33 of file MuonPatternCalibration.h.

◆ RegionIdMap

Definition at line 37 of file MuonPatternCalibration.h.

◆ RegionMap

Definition at line 49 of file MuonPatternCalibration.h.

Constructor & Destructor Documentation

◆ MuonPatternCalibration()

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

Definition at line 22 of file MuonPatternCalibration.cxx.

23  : base_class(t, n, p) {}

◆ ~MuonPatternCalibration()

virtual Muon::MuonPatternCalibration::~MuonPatternCalibration ( )
virtualdefault

Member Function Documentation

◆ calibrate()

StatusCode Muon::MuonPatternCalibration::calibrate ( const EventContext &  ctx,
const MuonPatternCombination pat,
ROTsPerRegion &  hitsPerRegion 
) const
override

Definition at line 40 of file MuonPatternCalibration.cxx.

40  {
42  bool hasPhiMeasurements = checkForPhiMeasurements(pattern);
43  ATH_CHECK(createRegionMap(ctx, pattern, regionMap, hasPhiMeasurements));
44  // calibrate hits
45  calibrateRegionMap(regionMap, hitsPerRegion);
46  return StatusCode::SUCCESS;
47 }

◆ calibrateRegionMap()

void Muon::MuonPatternCalibration::calibrateRegionMap ( const RegionMap regionMap,
IMuonPatternCalibration::ROTsPerRegion hitsPerRegion 
) const
private

Definition at line 429 of file MuonPatternCalibration.cxx.

430  {
431 
432 
433  for (const auto& [regionId, regMeasColl] : regionMap) {
434 
435  ROTRegion rotRegion{};
436  rotRegion.regionId = regionId;
437  rotRegion.regionPos = regMeasColl.regionPos;
438  rotRegion.regionDir = regMeasColl.regionDir;
439  for (const auto& [globalPos, prd] : regMeasColl.triggerPrds) {
440  std::unique_ptr<const MuonClusterOnTrack> cluster{m_clusterCreator->createRIO_OnTrack(*prd, globalPos)};
441  if (!cluster) continue;
442  rotRegion.push_back(std::move(cluster));
443  }
444  for (const auto& [regionId, MdtsWithIsect] :regMeasColl.mdtPrdsPerChamber) {
445  ATH_MSG_VERBOSE("Run over region id "<<regionId);
446  MdtVec mdtROTs{};
447  for (const auto& [globalPos, prd] : MdtsWithIsect) {
448  ATH_MSG_VERBOSE("Calibrate prd"<<m_idHelperSvc->toString(prd->identify())
449  <<",tdc: "<<prd->tdc()<<",adc: "<<prd->adc()<<" at "<<Amg::toString(globalPos));
450  const MdtDriftCircleOnTrack* mdt = m_mdtCreator->createRIO_OnTrack(*prd, globalPos, &globalPos);
451  if (!mdt) {
452  ATH_MSG_VERBOSE("Failed to calibrate " << m_idHelperSvc->toString(prd->identify()));
453  continue;
454  }
455  mdtROTs.push_back(mdt);
456  }
457  if (!mdtROTs.empty()) rotRegion.push_back(std::move(mdtROTs));
458  }
459  hitsPerRegion.push_back(std::move(rotRegion));
460  }
461 }

◆ checkForPhiMeasurements()

bool Muon::MuonPatternCalibration::checkForPhiMeasurements ( const MuonPatternCombination pat) const
override

Exclude the sTGC hits. MM hits do not have phi measurements

Definition at line 59 of file MuonPatternCalibration.cxx.

59  {
60 
61  for (const MuonPatternChamberIntersect& intersect : pat.chamberData()) {
62  for (const Trk::PrepRawData* prd : intersect.prepRawDataVec()){
63  const Identifier id = prd->identify();
65  if (!m_idHelperSvc->issTgc(id) &&
66  m_idHelperSvc->measuresPhi(id)) return true;
67  }
68  }
69  return false;
70 }

◆ createRegionMap()

StatusCode Muon::MuonPatternCalibration::createRegionMap ( const EventContext &  ctx,
const MuonPatternCombination pat,
RegionMap regionMap,
bool  hasPhiMeasurements 
) const
private

Try to recover missing phi clusters:

  • loop over the clusters in the region and sort them by collection
  • count the number of eta and phi clusters per collection

Remove the NSW hits from the segment building

Definition at line 73 of file MuonPatternCalibration.cxx.

75 {
76  if (hasPhiMeasurements)
77  ATH_MSG_DEBUG("pattern has phi measurements using extrapolation to determine second coordinate");
78  else
79  ATH_MSG_DEBUG("No phi measurements using center tubes");
80 
81 
82  const Muon::TgcPrepDataContainer* tgcPrdCont{nullptr};
83  const Muon::RpcPrepDataContainer* rpcPrdCont{nullptr};
84  ATH_CHECK(loadFromStoreGate(ctx, m_keyRpc, rpcPrdCont));
85  ATH_CHECK(loadFromStoreGate(ctx, m_keyTgc, tgcPrdCont));
86 
87  for (const MuonPatternChamberIntersect& isect : pat.chamberData()) {
88 
89  if (isect.prepRawDataVec().empty()) continue;
90 
91  const Amg::Vector3D& patpose = isect.intersectPosition();
92  const Amg::Vector3D patdire = isect.intersectDirection().unit();
93 
99  std::map<int, EtaPhiHits> etaPhiHitsPerChamber;
100  std::set<Identifier> clusterIds;
101 
102 
103  const Trk::PrepRawData* prd = isect.prepRawDataVec().front();
104  const Identifier id = prd->identify();
105 
106  // apply cut on the opening angle between pattern and chamber phi
107  // do some magic to avoid problems at phi = 0 and 2*pi
108  double phiStart = patdire.phi();
109  double chPhi = prd->detectorElement()->center().phi();
110  constexpr double phiRange = 0.75 * M_PI;
111  constexpr double phiRange2 = 0.25 * M_PI;
112  double phiOffset = 0.;
113  if (phiStart > phiRange || phiStart < -phiRange)
114  phiOffset = 2 * M_PI;
115  else if (phiStart > -phiRange2 && phiStart < phiRange2)
116  phiOffset = M_PI;
117 
118  if (phiOffset > 1.5 * M_PI) {
119  if (phiStart < 0) phiStart += phiOffset;
120  if (chPhi < 0) chPhi += phiOffset;
121  } else if (phiOffset > 0.) {
122  phiStart += phiOffset;
123  chPhi += phiOffset;
124  }
125  double dphi = std::abs(phiStart - chPhi);
126 
127  if (dphi > m_phiAngleCut) {
128  ATH_MSG_DEBUG("Large angular phi difference between pattern and chamber, phi pattern "
129  << patdire.phi() << " phi chamber " << prd->detectorElement()->center().phi());
130  continue;
131  }
132 
133  // map to find duplicate hits in the chamber
134  std::map<Identifier, const MdtPrepData*> idMdtMap{};
135 
136  for (const Trk::PrepRawData* isect_prd : isect.prepRawDataVec()) {
137 
138  if (isect_prd->type(Trk::PrepRawDataType::MdtPrepData)) {
139  const MdtPrepData* mdt = dynamic_cast<const MdtPrepData*>(isect_prd);
140  if (m_removeDoubleMdtHits) {
141  const MdtPrepData*& previousMdt = idMdtMap[mdt->identify()];
142  if (!previousMdt || previousMdt->tdc() > mdt->tdc())
143  previousMdt = mdt;
144  else
145  continue;
146  }
147  insertMdt(*mdt, regionMap, patpose, patdire, hasPhiMeasurements);
148  continue;
149  }
150  else if (isect_prd->type(Trk::PrepRawDataType::MMPrepData) || isect_prd->type(Trk::PrepRawDataType::sTgcPrepData)){
151  continue;
152  }
153  const MuonCluster* clus = dynamic_cast<const MuonCluster*>(isect_prd);
154  if (!clus) continue;
155  const Identifier id = clus->identify();
156  if (!clusterIds.insert(id).second) continue;
157 
158  if (m_recoverTriggerHits) {
159  bool measuresPhi = m_idHelperSvc->measuresPhi(id);
160  int colHash = clus->collectionHash();
161  EtaPhiHits& hitsPerChamber = etaPhiHitsPerChamber[colHash];
162  if (measuresPhi)
163  ++hitsPerChamber.nphi;
164  else
165  ++hitsPerChamber.neta;
166  }
167  insertCluster(*clus, regionMap, patpose, patdire, hasPhiMeasurements);
168  }
169  for (const auto& [coll_hash, hits] : etaPhiHitsPerChamber) {
170  if ((hits.neta > 0 && hits.nphi == 0) || (hits.nphi > 0 && hits.neta == 0)) {
171  if (m_idHelperSvc->isRpc(id) && rpcPrdCont) {
172 
173  const Muon::RpcPrepDataCollection* prd_coll = rpcPrdCont->indexFindPtr(coll_hash);
174  if (!prd_coll) {
175  ATH_MSG_VERBOSE("RpcPrepDataCollection not found in container!!"<< m_keyRpc);
176  continue;
177  }
178  for (const Muon::RpcPrepData* rpc_prd : *prd_coll) {
179  if (!clusterIds.insert(rpc_prd->identify()).second) continue;
180  insertCluster(*rpc_prd, regionMap, patpose, patdire, hasPhiMeasurements);
181  }
182  } else if (m_idHelperSvc->isTgc(id) && tgcPrdCont) {
183  const Muon::TgcPrepDataCollection* prd_coll = tgcPrdCont->indexFindPtr(coll_hash);
184  if (!prd_coll) {
185  ATH_MSG_DEBUG("TgcPrepDataCollection not found in container!! "<< m_keyTgc);
186  continue;
187  }
188 
189  for (const Muon::TgcPrepData* tgc_prd : *prd_coll) {
190  if (!clusterIds.insert(tgc_prd->identify()).second) continue;
191  insertCluster(*tgc_prd, regionMap, patpose, patdire, hasPhiMeasurements);
192  }
193  }
194  }
195  }
196  }
197  return StatusCode::SUCCESS;
198 }

◆ getRegionId()

int Muon::MuonPatternCalibration::getRegionId ( const Identifier id) const
override

Definition at line 50 of file MuonPatternCalibration.cxx.

50  {
51 
52  // simple division of MuonSpectrometer in regions using barrel/endcap seperation plus
53  // inner/middle/outer seperation
54  return m_idHelperSvc->stationIndex(id)* ( m_idHelperSvc->stationEta(id) > 0 ? 1 : -1);
55 }

◆ initialize()

StatusCode Muon::MuonPatternCalibration::initialize ( )
overridevirtual

Definition at line 26 of file MuonPatternCalibration.cxx.

27 {
28  ATH_MSG_VERBOSE("MuonPatternCalibration::Initializing");
29  ATH_CHECK(m_mdtCreator.retrieve());
30  ATH_CHECK(m_printer.retrieve());
31  ATH_CHECK(m_idHelperSvc.retrieve());
32  ATH_CHECK(m_keyRpc.initialize(!m_keyRpc.empty()));
33  ATH_CHECK(m_keyTgc.initialize(!m_keyTgc.empty()));
34  ATH_CHECK(m_clusterCreator.retrieve(EnableTool{!m_keyRpc.empty() || !m_keyTgc.empty()}));
35  return StatusCode::SUCCESS;
36 }

◆ insertCluster()

void Muon::MuonPatternCalibration::insertCluster ( const MuonCluster mdt,
RegionMap regionMap,
const Amg::Vector3D patpose,
const Amg::Vector3D patdire,
bool  hasPhiMeasurements 
) const
private

Definition at line 201 of file MuonPatternCalibration.cxx.

203 {
204 
205  const Identifier id = clus.identify();
206  // check whether we are measuring phi or eta
207  const bool measuresPhi = m_idHelperSvc->measuresPhi(id);
208 
209  Amg::Vector3D globalpos = clus.globalPosition();
211 
212  if (hasPhiMeasurements) {
213  // if there is a phi measurement in the pattern use the global direction to calculate the intersect with
214  // measurement plane and use the intersect to calculate the position along the strip
215 
216  // calculate intersect pattern measurement plane
217  const Trk::Surface& surf = clus.detectorElement()->surface(id);
218  Amg::Vector3D planepostion = surf.center();
219  Amg::Vector3D planenormal = surf.normal();
220  double denom = patdire.dot(planenormal);
221  double u = (planenormal.dot(planepostion - patpose)) / (denom);
222  Amg::Vector3D piOnPlane = (patpose + u * patdire);
223 
224  // transform to local plane coordiantes
225  const Amg::Transform3D gToLocal = clus.detectorElement()->surface().transform().inverse();
226  Amg::Vector3D ilpos = gToLocal * piOnPlane;
227  Amg::Vector3D glpos = gToLocal * globalpos;
228 
229  // strip length
230  double striplen(0.);
231 
232  // projective strips
233  bool hasPointingPhiStrips = false;
234 
235  // detector specific stuff
236  const RpcPrepData* rpc = dynamic_cast<const RpcPrepData*>(&clus);
237  if (rpc) {
238  striplen = rpc->detectorElement()->StripLength(measuresPhi);
239  } else {
240  const TgcPrepData* tgc = dynamic_cast<const TgcPrepData*>(&clus);
241  if (!tgc) return;
242 
243  int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(id);
244  if (measuresPhi) {
245  hasPointingPhiStrips = true;
246  striplen = tgc->detectorElement()->stripLength();
247  } else {
248  int wire = m_idHelperSvc->tgcIdHelper().channel(id);
249  striplen = tgc->detectorElement()->gangCentralWidth(gasGap, wire);
250  }
251  }
252 
253  // set the position along the strip
254  if (!measuresPhi) {
255  glpos[0] = ilpos.x();
256  } else {
257  if (hasPointingPhiStrips) {
258  // do some special for tgcs
259  glpos[1] = ilpos.y();
260  } else {
261  glpos[1] = ilpos.y();
262  }
263  }
264 
265  // transform back to global coordinates
266  intersect = gToLocal.inverse() * glpos;
267  Amg::Vector3D dif = globalpos - intersect;
268  if ((intersect - piOnPlane).mag() > m_dropDistance || dif.mag() > 0.5 * striplen + m_dropDistance) {
269 
270  ATH_MSG_VERBOSE(">>>> extrapolated position far outside volume, dropping hit "
271  << m_idHelperSvc->toString(id) << ". dist along strip " << dif.mag() << " 1/2 strip len "
272  << 0.5 * striplen << " dist measurement plane " << (intersect - piOnPlane).mag());
273  return;
274  }
275  if (dif.mag() > 0.5 * striplen) {
276  Amg::Vector3D newpos = globalpos - dif * (0.5 * striplen / dif.mag());
277 
278  ATH_MSG_VERBOSE(">>>> extrapolated position outside volume, shifting position "
279  << m_idHelperSvc->toString(id) << ". position along strip " << dif.mag() << " 1/2 tube len "
280  << 0.5 * striplen << " dist To strip " << (intersect - piOnPlane).mag()
281  << ". dist to newpos " << (newpos - globalpos).mag() << " pos " << newpos);
282 
283  intersect = newpos;
284  }
285  } else {
286  // no phi measurements, use strip center
287  intersect = globalpos;
288  }
289 
290  // enter hit in map
291  int regionId = getRegionId(id);
292 
293  Region& region = regionMap[regionId];
294  if (!region.init) {
295  region.regionDir = patdire;
296  region.regionPos = patpose;
297  region.init = true;
298  }
299  region.triggerPrds.emplace_back(intersect, &clus);
300 }

◆ insertMdt()

void Muon::MuonPatternCalibration::insertMdt ( const MdtPrepData clus,
RegionMap regionMap,
const Amg::Vector3D patpose,
const Amg::Vector3D patdire,
bool  hasPhiMeasurements 
) const
private

Definition at line 304 of file MuonPatternCalibration.cxx.

306 {
307 
309  const Identifier& id = mdt.identify();
310 
311  const MuonGM::MdtReadoutElement* detEl = mdt.detectorElement();
312  const Amg::Vector3D& tubePos = mdt.globalPosition();
313 
314  if (hasPhiMeasurements) {
315  // if there is a phi measurement in the pattern use the global direction to calculate the intersect with the
316  // tube use the intersect to calculate the second coordinate
317 
318  const Amg::Transform3D amdbToGlobal = detEl->AmdbLRSToGlobalTransform();
319 
320 
321  // calculate intersect pattern measurement plane
322  const Amg::Vector3D& planepostion = tubePos;
323 
324  // always project on plane with normal in radial direction
325  Amg::Vector3D planenormal = m_idHelperSvc->mdtIdHelper().isBarrel(id)
326  ? amdbToGlobal.linear() * Amg::Vector3D(0., 0., 1.)
327  : amdbToGlobal.linear() * Amg::Vector3D(0., 1., 0.);
328 
329  double denom = patdire.dot(planenormal);
330  double u = (planenormal.dot(planepostion - patpose)) / (denom);
331  Amg::Vector3D piOnPlane = (patpose + u * patdire);
332 
333  Amg::Vector3D lpiOnPlane = amdbToGlobal.inverse() * piOnPlane;
334  Amg::Vector3D ltubePos = amdbToGlobal.inverse() * tubePos;
335 
336  intersect = amdbToGlobal * Amg::Vector3D(lpiOnPlane.x(), ltubePos.y(), ltubePos.z());
337 
338  Amg::Vector3D dif = tubePos - intersect;
339  double tubelen = detEl->getActiveTubeLength(m_idHelperSvc->mdtIdHelper().tubeLayer(id),
340  m_idHelperSvc->mdtIdHelper().tube(id));
341 
342  if (dif.mag() > 0.5 * tubelen) {
343  Amg::Vector3D newpos = tubePos - dif * (0.5 * tubelen / dif.mag());
344 
345  ATH_MSG_VERBOSE(">>>> extrapolated position outside volume, shifting position "
346  << m_idHelperSvc->toString(id) << ". position along strip " << dif.mag() << " 1/2 tube len "
347  << 0.5 * tubelen << " dist To Wire " << (piOnPlane - intersect).mag() << ". dist to newpos "
348  << (newpos - tubePos).mag() << " pos " << newpos);
349 
350  intersect = newpos;
351  }
352  } else {
353  // not phi measurement, use tube center
354  intersect = tubePos;
355  }
356 
357  // enter hit in map
358  Identifier elId = m_idHelperSvc->mdtIdHelper().elementID(id);
359 
360  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(elId);
361  int chFlag = elId.get_identifier32().get_compact();
362  if (m_doMultiAnalysis) {
363  if (m_idHelperSvc->isSmallChamber(id)) {
364  ATH_MSG_VERBOSE(" Small chamber " << m_idHelperSvc->toString(elId));
365  chFlag = 0;
366  if (chIndex == MuonStationIndex::BIS) {
367  int eta = m_idHelperSvc->stationEta(elId);
368  if (std::abs(eta) == 8) {
369  ATH_MSG_VERBOSE(" BIS8 chamber " << m_idHelperSvc->toString(elId));
370  chFlag = 3;
371  }
372  }
373  } else {
374  ATH_MSG_VERBOSE(" Large chamber " << m_idHelperSvc->toString(elId));
375  chFlag = 1;
376  if (chIndex == MuonStationIndex::BIL) {
377  std::string stName = m_idHelperSvc->chamberNameString(id);
378  if (stName[2] == 'R') {
379  ATH_MSG_VERBOSE(" BIR chamber " << m_idHelperSvc->toString(elId));
380  chFlag = 2;
381  }
382  } else if (chIndex == MuonStationIndex::BOL) {
383  if (std::abs(m_idHelperSvc->stationEta(id)) == 7) {
384  ATH_MSG_VERBOSE(" BOE chamber " << m_idHelperSvc->toString(elId));
385  chFlag = 4;
386  }
387  }
388  }
389  int phi = m_idHelperSvc->mdtIdHelper().stationPhi(id);
390 
391  chFlag += 10 * phi;
392  }
393  // use center tube for region assignment
394  int regionId = getRegionId(id);
395 
396  Region& region = regionMap[regionId];
397  if (!region.init) {
398  region.regionPos = patpose;
399  region.regionDir = patdire;
400  region.init = true;
401  }
402  region.mdtPrdsPerChamber[chFlag].emplace_back(intersect, &mdt);
403 }

◆ loadFromStoreGate()

template<class ContType >
StatusCode Muon::MuonPatternCalibration::loadFromStoreGate ( const EventContext &  ctx,
const SG::ReadHandleKey< ContType > &  key,
const ContType *&  cont_ptr 
) const
private

load the container from storegate given a ReadHandleKey.

If the key is empty a nullptr will be returned

Definition at line 463 of file MuonPatternCalibration.cxx.

465  {
466  if (key.empty()){
467  ATH_MSG_VERBOSE("Empty key given for "<<typeid(ContType).name()<<".");
468  cont_ptr = nullptr;
469  return StatusCode::SUCCESS;
470  }
471  SG::ReadHandle<ContType> readHandle{key, ctx};
472  if (!readHandle.isValid()) {
473  ATH_MSG_FATAL("Failed to retrieve "<<key.fullKey()<<" from store gate");
474  return StatusCode::FAILURE;
475  }
476  cont_ptr = readHandle.cptr();
477  return StatusCode::SUCCESS;
478 }

◆ printRegionMap()

void Muon::MuonPatternCalibration::printRegionMap ( const RegionMap regionMap) const
private

Definition at line 406 of file MuonPatternCalibration.cxx.

407 {
408 
409  ATH_MSG_INFO("Summarizing input");
410 
411  for (const auto& [detRegionId, chamberData] : regionMap) {
412  ATH_MSG_INFO("new region " << detRegionId << " trigger " << chamberData.triggerPrds.size() << " mdt ch "
413  << chamberData.mdtPrdsPerChamber.size());
414  if (!chamberData.triggerPrds.empty()) ATH_MSG_INFO("trigger hits " << chamberData.triggerPrds.size());
415 
416  for (const auto& [globalPos, prd] : chamberData.triggerPrds) {
417  ATH_MSG_INFO(" " << m_printer->print(*prd)<<" "<<globalPos);
418  }
419  for (const auto& [statId, MdtChamHits]: chamberData.mdtPrdsPerChamber) {
420  ATH_MSG_INFO("new MDT chamber with " << MdtChamHits.size() << " hits");
421  for (const auto& [globalPos, prd] : MdtChamHits) {
422  ATH_MSG_INFO(" " << m_printer->print(*prd)<<" "<<globalPos);
423  }
424  }
425  }
426 }

Member Data Documentation

◆ m_clusterCreator

ToolHandle<IMuonClusterOnTrackCreator> Muon::MuonPatternCalibration::m_clusterCreator
private
Initial value:
{
this,
"ClusterCreator",
"Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator",
}

Definition at line 88 of file MuonPatternCalibration.h.

◆ m_doMultiAnalysis

Gaudi::Property<bool> Muon::MuonPatternCalibration::m_doMultiAnalysis {this, "DoMultiChamberAnalysis", true}
private

Definition at line 105 of file MuonPatternCalibration.h.

◆ m_doSummary

Gaudi::Property<bool> Muon::MuonPatternCalibration::m_doSummary {this, "DoSummary", false}
private

Definition at line 108 of file MuonPatternCalibration.h.

◆ m_dropDistance

Gaudi::Property<double> Muon::MuonPatternCalibration::m_dropDistance {this, "DropDistance", 1500.}
private

Definition at line 106 of file MuonPatternCalibration.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonPatternCalibration::m_idHelperSvc
private
Initial value:
{
this,
"MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
}

Definition at line 99 of file MuonPatternCalibration.h.

◆ m_keyRpc

SG::ReadHandleKey<Muon::RpcPrepDataContainer> Muon::MuonPatternCalibration::m_keyRpc {this, "RpcPrepDataContainer","RPC_Measurements"}
private

Definition at line 112 of file MuonPatternCalibration.h.

◆ m_keyTgc

SG::ReadHandleKey<Muon::TgcPrepDataContainer> Muon::MuonPatternCalibration::m_keyTgc {this, "TgcPrepDataContainer","TGC_Measurements"}
private

Definition at line 113 of file MuonPatternCalibration.h.

◆ m_mdtCreator

ToolHandle<IMdtDriftCircleOnTrackCreator> Muon::MuonPatternCalibration::m_mdtCreator
private
Initial value:
{
this,
"MdtCreator",
"",
}

Definition at line 83 of file MuonPatternCalibration.h.

◆ m_phiAngleCut

Gaudi::Property<double> Muon::MuonPatternCalibration::m_phiAngleCut {this, "AngleCutPhi", 1.e9}
private

Definition at line 107 of file MuonPatternCalibration.h.

◆ m_printer

PublicToolHandle<MuonEDMPrinterTool> Muon::MuonPatternCalibration::m_printer
private
Initial value:
{
this,
"Printer",
"Muon::MuonEDMPrinterTool",
}

Definition at line 93 of file MuonPatternCalibration.h.

◆ m_recoverTriggerHits

Gaudi::Property<bool> Muon::MuonPatternCalibration::m_recoverTriggerHits {this, "RecoverTriggerHits", true}
private

Definition at line 109 of file MuonPatternCalibration.h.

◆ m_removeDoubleMdtHits

Gaudi::Property<bool> Muon::MuonPatternCalibration::m_removeDoubleMdtHits {this, "RemoveDoubleMdtHits", true}
private

Definition at line 110 of file MuonPatternCalibration.h.


The documentation for this class was generated from the following files:
Muon::MuonStationIndex::BIS
@ BIS
Definition: MuonStationIndex.h:17
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
Muon::MuonPatternCalibration::m_removeDoubleMdtHits
Gaudi::Property< bool > m_removeDoubleMdtHits
Definition: MuonPatternCalibration.h:110
test_pyathena.eta
eta
Definition: test_pyathena.py:10
Trk::PrepRawDataType::MdtPrepData
@ MdtPrepData
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
Muon::MuonPatternCalibration::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonPatternCalibration.h:99
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonGM::MuonReadoutElement::AmdbLRSToGlobalTransform
virtual Amg::Transform3D AmdbLRSToGlobalTransform() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:145
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
Trk::PrepRawDataType::TgcPrepData
@ TgcPrepData
Trk::PrepRawDataType::MMPrepData
@ MMPrepData
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Muon::MuonPatternCalibration::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuonPatternCalibration.h:93
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Muon::MuonPatternCalibration::getRegionId
int getRegionId(const Identifier &id) const override
Definition: MuonPatternCalibration.cxx:50
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
Muon::MuonPatternCalibration::calibrateRegionMap
void calibrateRegionMap(const RegionMap &regionMap, IMuonPatternCalibration::ROTsPerRegion &hitsPerRegion) const
Definition: MuonPatternCalibration.cxx:429
Trk::PrepRawDataType::RpcPrepData
@ RpcPrepData
Muon::MuonPatternCalibration::m_recoverTriggerHits
Gaudi::Property< bool > m_recoverTriggerHits
Definition: MuonPatternCalibration.h:109
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
Muon::MuonPatternCalibration::m_clusterCreator
ToolHandle< IMuonClusterOnTrackCreator > m_clusterCreator
Definition: MuonPatternCalibration.h:88
Muon::MuonPatternCalibration::RegionMap
std::map< int, Region > RegionMap
Definition: MuonPatternCalibration.h:49
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
Muon::RpcPrepData
Class to represent RPC measurements.
Definition: RpcPrepData.h:35
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonGM::MdtReadoutElement::getActiveTubeLength
double getActiveTubeLength(const int tubeLayer, const int tube) const
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
dumpNswErrorDb.linear
def linear
Definition: dumpNswErrorDb.py:23
Region
Region
Definition: TrigL2HitResidual.h:14
Trk::Surface::normal
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonPatternCalibration::insertCluster
void insertCluster(const MuonCluster &mdt, RegionMap &regionMap, const Amg::Vector3D &patpose, const Amg::Vector3D &patdire, bool hasPhiMeasurements) const
Definition: MuonPatternCalibration.cxx:201
MuonGM::MuonReadoutElement::globalPosition
const Amg::Vector3D globalPosition() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:47
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
compute_lumi.denom
denom
Definition: compute_lumi.py:76
Muon::MuonPatternCalibration::m_dropDistance
Gaudi::Property< double > m_dropDistance
Definition: MuonPatternCalibration.h:106
Muon::MuonPatternCalibration::checkForPhiMeasurements
bool checkForPhiMeasurements(const MuonPatternCombination &pat) const override
Definition: MuonPatternCalibration.cxx:59
Trk::PrepRawData
Definition: PrepRawData.h:62
dso-stats.pat
pat
Definition: dso-stats.py:39
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Muon::MuonPatternCalibration::loadFromStoreGate
StatusCode loadFromStoreGate(const EventContext &ctx, const SG::ReadHandleKey< ContType > &key, const ContType *&cont_ptr) const
load the container from storegate given a ReadHandleKey.
Definition: MuonPatternCalibration.cxx:463
Muon::MuonPatternCalibration::insertMdt
void insertMdt(const MdtPrepData &clus, RegionMap &regionMap, const Amg::Vector3D &patpose, const Amg::Vector3D &patdire, bool hasPhiMeasurements) const
Definition: MuonPatternCalibration.cxx:304
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::PrepRawDataType::sTgcPrepData
@ sTgcPrepData
MuonCluster
Definition: Trigger/TrigAlgorithms/TrigLongLivedParticles/src/MuonCluster.h:46
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::MuonPatternCalibration::m_phiAngleCut
Gaudi::Property< double > m_phiAngleCut
Definition: MuonPatternCalibration.h:107
Muon::MuonPatternCalibration::m_keyTgc
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_keyTgc
Definition: MuonPatternCalibration.h:113
Muon::MuonPatternCalibration::m_mdtCreator
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtCreator
Definition: MuonPatternCalibration.h:83
Amg::intersect
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point of closest approach of two lines.
Definition: GeoPrimitivesHelpers.h:325
Muon::MuonStationIndex::BIL
@ BIL
Definition: MuonStationIndex.h:17
Muon::TgcPrepData
Class to represent TGC measurements.
Definition: TgcPrepData.h:32
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuonPatternCalibration::createRegionMap
StatusCode createRegionMap(const EventContext &ctx, const MuonPatternCombination &pat, RegionMap &regionMap, bool hasPhiMeasurements) const
Definition: MuonPatternCalibration.cxx:73
LArCellBinning.phiRange
phiRange
Filling Phi ranges.
Definition: LArCellBinning.py:107
Muon::MuonPatternCalibration::m_keyRpc
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
Definition: MuonPatternCalibration.h:112
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Muon::MuonPatternCalibration::m_doMultiAnalysis
Gaudi::Property< bool > m_doMultiAnalysis
Definition: MuonPatternCalibration.h:105
Trk::TrkDetElementBase::center
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
Muon::MuonStationIndex::BOL
@ BOL
Definition: MuonStationIndex.h:17
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
Trk::PrepRawData::detectorElement
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14