ATLAS Offline Software
MuonPatternCalibration.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iostream>
8 #include <set>
9 #include <sstream>
10 
20 namespace Muon {
21 
22 MuonPatternCalibration::MuonPatternCalibration(const std::string& t, const std::string& n, const IInterface* p)
23  : base_class(t, n, p) {}
24 
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 }
37 
38 
39 
40 StatusCode MuonPatternCalibration::calibrate(const EventContext& ctx, const MuonPatternCombination& pattern, ROTsPerRegion& hitsPerRegion) const {
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 }
48 
49 
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 }
56 
57 
58 bool
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 }
71 
74  RegionMap& regionMap, bool hasPhiMeasurements ) const
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 }
199 
200 void
202  const Amg::Vector3D& patdire, bool hasPhiMeasurements) const
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 }
301 
302 
303 void
305  const Amg::Vector3D& patdire, bool hasPhiMeasurements) const
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 }
404 
405 void
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 }
427 
428 void
430  IMuonPatternCalibration::ROTsPerRegion& hitsPerRegion) const {
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 }
462 
463 template <class ContType> StatusCode MuonPatternCalibration::loadFromStoreGate(const EventContext& ctx,
465  const ContType* & cont_ptr) const {
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 }
479 
480 } // namespace Muon
Muon::MuonStationIndex::BIS
@ BIS
Definition: MuonStationIndex.h:17
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
Muon::MuonPatternCalibration::Region::mdtPrdsPerChamber
RegionIdMap mdtPrdsPerChamber
Definition: MuonPatternCalibration.h:44
Muon::MuonPatternCalibration::m_removeDoubleMdtHits
Gaudi::Property< bool > m_removeDoubleMdtHits
Definition: MuonPatternCalibration.h:110
Trk::PrepRawDataType::MdtPrepData
@ MdtPrepData
MdtReadoutElement.h
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
MuonPatternChamberIntersect.h
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
MuonGM::RpcReadoutElement::StripLength
double StripLength(bool measphi) const
returns the strip length for the phi or eta plane
Trk::PrepRawDataType::MMPrepData
@ MMPrepData
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Muon::MuonPatternCalibration::calibrate
StatusCode calibrate(const EventContext &ctx, const MuonPatternCombination &pat, ROTsPerRegion &hitsPerRegion) const override
Definition: MuonPatternCalibration.cxx:40
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Muon::MuonPatternCalibration::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuonPatternCalibration.h:93
Muon::MuonPatternCalibration::Region::regionPos
Amg::Vector3D regionPos
Definition: MuonPatternCalibration.h:41
IRIO_OnTrackCreator.h
Muon::MuonCluster::collectionHash
virtual IdentifierHash collectionHash() const
Returns the IdentifierHash corresponding to the PRD collection in the PRD container.
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonCluster.h:104
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.
MuonGM::TgcReadoutElement::stripLength
double stripLength() const
Returns the length of each strip which is equal to the height of the chamber.
Muon::TgcPrepData::detectorElement
virtual const MuonGM::TgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD The pointer will be zero if the det el is not ...
Definition: TgcPrepData.h:120
Muon::MuonPatternCalibration::initialize
virtual StatusCode initialize() override
Definition: MuonPatternCalibration.cxx:26
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon::MuonCluster::globalPosition
virtual const Amg::Vector3D & globalPosition() const =0
Returns the global position of the measurement (calculated on the fly)
MuonPrepDataContainer.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
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
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MuonPatternCalibration::m_recoverTriggerHits
Gaudi::Property< bool > m_recoverTriggerHits
Definition: MuonPatternCalibration.h:109
MuonGM::MuonClusterReadoutElement::surface
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
Definition: MuonClusterReadoutElement.h:123
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::Region
Definition: MuonPatternCalibration.h:39
Muon::MuonPatternCalibration::m_clusterCreator
ToolHandle< IMuonClusterOnTrackCreator > m_clusterCreator
Definition: MuonPatternCalibration.h:88
MuonPatternCalibration.h
Muon::MuonPatternCalibration::RegionMap
std::map< int, Region > RegionMap
Definition: MuonPatternCalibration.h:49
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
EventPrimitivesToStringConverter.h
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
Muon::RpcPrepData
Class to represent RPC measurements.
Definition: RpcPrepData.h:35
Muon::RpcPrepData::detectorElement
virtual const MuonGM::RpcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
Definition: RpcPrepData.h:202
Muon::MuonPatternChamberIntersect
This class holds information needed for the Moore and MoMu pattern recognition for a muon chamber.
Definition: MuonPatternChamberIntersect.h:38
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::MuonPatternCalibration::Region::triggerPrds
ISPrdVec triggerPrds
Definition: MuonPatternCalibration.h:43
MuonGM::MdtReadoutElement::getActiveTubeLength
double getActiveTubeLength(const int tubeLayer, const int tube) const
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CscReadoutElement.h
Muon::MuonPatternCalibration::EtaPhiHits
Definition: MuonPatternCalibration.h:51
Muon::MdtPrepData::globalPosition
virtual const Amg::Vector3D & globalPosition() const
Returns the global position of the CENTER of the drift tube (i.e.
Definition: MdtPrepData.h:133
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
Muon::MuonPatternCalibration::Region::regionDir
Amg::Vector3D regionDir
Definition: MuonPatternCalibration.h:42
MuonGM::TgcReadoutElement::gangCentralWidth
double gangCentralWidth(int gasGap, int gang) const
Returns the length of the central wire in the gang.
Definition: MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx:92
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
Muon::IMuonPatternCalibration::ROTsPerRegion
std::vector< ROTRegion > ROTsPerRegion
Definition: IMuonPatternCalibration.h:55
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
Muon::MuonPatternCalibration::MuonPatternCalibration
MuonPatternCalibration(const std::string &, const std::string &, const IInterface *)
Definition: MuonPatternCalibration.cxx:22
Muon::MdtPrepData::tdc
int tdc() const
Returns the TDC (typically range is 0 to 2500).
Definition: MdtPrepData.h:145
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::PrepRawDataType::sTgcPrepData
@ sTgcPrepData
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
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
MuonDetectorManager.h
Muon::MuonPatternCalibration::EtaPhiHits::nphi
unsigned int nphi
Definition: MuonPatternCalibration.h:54
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 B' along the line B that's closest to a second line A.
Definition: GeoPrimitivesHelpers.h:347
Muon::MuonStationIndex::BIL
@ BIL
Definition: MuonStationIndex.h:17
Muon::MuonPatternCalibration::Region::init
bool init
Definition: MuonPatternCalibration.h:45
Muon::TgcPrepData
Class to represent TGC measurements.
Definition: TgcPrepData.h:32
Muon::MuonPatternCalibration::printRegionMap
void printRegionMap(const RegionMap &regionMap) const
Definition: MuonPatternCalibration.cxx:406
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
Muon::MuonCluster
Class representing clusters in the muon system.
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonCluster.h:37
TgcReadoutElement.h
LArCellBinning.phiRange
phiRange
Filling Phi ranges.
Definition: LArCellBinning.py:107
Muon::MuonPatternCalibration::EtaPhiHits::neta
unsigned int neta
Definition: MuonPatternCalibration.h:53
Muon::MuonCluster::detectorElement
virtual const MuonGM::MuonClusterReadoutElement * detectorElement() const override=0
Returns the detector element corresponding to this PRD.
Muon::MuonPatternCalibration::m_keyRpc
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
Definition: MuonPatternCalibration.h:112
Muon::MuonPatternCombination
The MuonPatternCombination class provides the means to store the output of the initial global pattern...
Definition: MuonPatternCombination.h:29
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Muon::MuonPatternCalibration::m_doMultiAnalysis
Gaudi::Property< bool > m_doMultiAnalysis
Definition: MuonPatternCalibration.h:105
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Trk::TrkDetElementBase::center
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
Muon::MuonStationIndex::BOL
@ BOL
Definition: MuonStationIndex.h:17
Muon::MdtPrepData::detectorElement
virtual const MuonGM::MdtReadoutElement * detectorElement() const override
Returns the detector element corresponding to this PRD.
Definition: MdtPrepData.h:141
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
RpcReadoutElement.h
Identifier
Definition: IdentifierFieldParser.cxx:14