ATLAS Offline Software
MuonHoughTransformTester.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/SystemOfUnits.h"
14 #include "GaudiKernel/PhysicalConstants.h"
15 
16 namespace {
17  constexpr double c_inv = 1. /Gaudi::Units::c_light;
18 }
19 namespace MuonValR4 {
20  using namespace MuonR4;
21  using TruthHitCol = std::unordered_set<const xAOD::MuonSimHit*>;
22  unsigned int countMatched(const TruthHitCol& truthHits,
23  const TruthHitCol& recoHits) {
24  unsigned int matched{0};
25  for (const xAOD::MuonSimHit* reco : recoHits) {
26  matched += truthHits.count(reco);
27  }
28  return matched;
29  }
30  std::vector<MuonHoughTransformTester::ObjectMatching>
32  const SegmentSeedContainer* seedContainer,
33  const SegmentContainer* segmentContainer) const {
34  std::vector<ObjectMatching> assocObj{}, assocObjMultMatch{};
35  std::unordered_set<const SegmentSeed*> usedSeeds{};
36  std::unordered_set<const Segment*> usedSegs{};
37  std::vector<TruthHitCol> truthHitsVec{}, seedHitsVec{}, segmentHitsVec{};
38 
39  if (truthSegments) {
40  for (const SegmentSeed* seed: *seedContainer) {
41  seedHitsVec.emplace_back(getTruthMatchedHits(*seed));
42  }
43  for (const Segment* segment: *segmentContainer){
44  segmentHitsVec.emplace_back(getTruthMatchedHits(*segment));
45  }
46 
47  for (const xAOD::MuonSegment* truth: *truthSegments) {
48  const TruthHitCol& truthHits{truthHitsVec.emplace_back(getTruthMatchedHits(*truth))};
49  ObjectMatching matchTempl{};
50  matchTempl.truthSegment = truth;
51  matchTempl.chamber = m_r4DetMgr->getSectorEnvelope((*truthHits.begin())->identify());
52  int seedIdx{-1};
53  for (const SegmentSeed* seed : *seedContainer){
54  ++seedIdx;
55  if (seed->msSector() != matchTempl.chamber) {
56  continue;
57  }
58  const TruthHitCol& seedHits{seedHitsVec[seedIdx]};
59  unsigned int matchedHits = countMatched(truthHits, seedHits);
60  if (!matchedHits) {
61  continue;
62  }
63  double matchFracion{1.*matchedHits / (1.*seed->getHitsInMax().size())};
64  if (matchFracion > matchTempl.matchFracSeed) {
65  matchTempl.matchFracSeed = matchFracion;
66  matchTempl.matchedSeed = seed;
67  matchTempl.nTruthMatchedMax = matchedHits;
68  }
69  }
70  int segmentIdx{-1};
72  std::vector<const Segment*> matchedSegs{};
73  for (const Segment* segment : *segmentContainer) {
74  ++segmentIdx;
75  if (segment->msSector() != matchTempl.chamber) {
76  continue;
77  }
78  const TruthHitCol& segmentHits{segmentHitsVec[segmentIdx]};
79  unsigned int matchedHits = countMatched(truthHits, segmentHits);
80  if (!matchedHits) {
81  continue;
82  }
83 
84  double matchFracion{1.*matchedHits / (1.*truthHits.size())};
85  if (matchFracion > matchTempl.matchFracSegment) {
86  matchTempl.matchFracSegment = matchFracion;
87  matchTempl.nTruthMatchedSeg = matchedHits;
88  matchTempl.matchedSegment = segment;
89  matchedSegs.clear();
91  } else if (matchTempl.nTruthMatchedSeg == matchedHits) {
92  matchedSegs.push_back(segment);
93  }
94  }
95  usedSegs.insert(matchTempl.matchedSegment);
96  usedSeeds.insert(matchTempl.matchedSeed);
97  assocObj.push_back(matchTempl);
98  for (const Segment* matched : matchedSegs) {
99  ObjectMatching matching{matchTempl};
100  matching.matchedSeed = matched->parent();
101  matching.matchedSegment = matched;
102  usedSeeds.insert(matching.matchedSeed);
103  usedSegs.insert(matching.matchedSegment);
104  assocObjMultMatch.push_back(std::move(matching));
105  }
106  }
107  }
108  int segIdx{-1};
109  for (const Segment* seg: *segmentContainer) {
110  ++segIdx;
111  if (usedSegs.count(seg)) {
112  continue;
113  }
115  match.chamber = seg->msSector();
116  match.matchedSegment = seg;
117  match.matchedSeed = seg->parent();
118  for (unsigned int truthIdx = 0 ; truthIdx < truthHitsVec.size(); ++truthIdx){
119  if (assocObj[truthIdx].chamber != match.chamber) {
120  continue;
121  }
122  unsigned int matches = countMatched(truthHitsVec[truthIdx], segmentHitsVec[segIdx]);
123  if (!matches) continue;
124  match.bestTruthMatch = false;
125  const double matchFrac = 1. * matches / (1. *seg->measurements().size());
126  if (matchFrac > match.matchFracSegment) {
127  match.matchFracSeed = matchFrac;
128  match.truthSegment = truthSegments->at(truthIdx);
129  match.nTruthMatchedSeg = matches;
130  }
131  }
132  usedSeeds.insert(match.matchedSeed);
133  assocObj.push_back(match);
134  }
135  int seedIdx{-1};
136  for (const SegmentSeed* seed: *seedContainer) {
137  ++seedIdx;
138  if (usedSeeds.count(seed)) {
139  continue;
140  }
142  match.chamber = seed->msSector();
143  match.matchedSeed = seed;
144  for (unsigned int truthIdx = 0 ; truthIdx < truthHitsVec.size(); ++truthIdx){
145  if (assocObj[truthIdx].chamber != match.chamber) {
146  continue;
147  }
148  unsigned int matches = countMatched(truthHitsVec[truthIdx], seedHitsVec[seedIdx]);
149  if (!matches) continue;
150  match.bestTruthMatch = false;
151  const double matchFrac = 1. * matches / (1. *seed->getHitsInMax().size());
152  if (matchFrac > match.matchFracSeed) {
153  match.matchFracSeed = matchFrac;
154  match.truthSegment = truthSegments->at(truthIdx);
155  match.nTruthMatchedMax = matches;
156  }
157  }
158  assocObj.push_back(match);
159  }
160  assocObj.insert(assocObj.end(), std::make_move_iterator(assocObjMultMatch.begin()),
161  std::make_move_iterator(assocObjMultMatch.end()));
162  return assocObj;
163  }
164 
165 
166  MuonHoughTransformTester::MuonHoughTransformTester(const std::string& name, ISvcLocator* pSvcLocator):
167  AthHistogramAlgorithm(name, pSvcLocator) {}
168 
169 
172  ATH_CHECK(m_spacePointKey.initialize());
173  ATH_CHECK(m_inHoughSegmentSeedKey.initialize());
174  ATH_CHECK(m_truthSegmentKey.initialize(!m_truthSegmentKey.empty()));
175  ATH_CHECK(m_inSegmentKey.initialize(!m_inSegmentKey.empty()));
176  m_tree.addBranch(std::make_shared<MuonVal::EventInfoBranch>(m_tree,0));
177  m_out_SP = std::make_shared<MuonValR4::SpacePointTesterModule>(m_tree, m_spacePointKey.key());
179  ATH_CHECK(m_tree.init(this));
180  ATH_CHECK(m_idHelperSvc.retrieve());
182  ATH_MSG_DEBUG("Succesfully initialised");
183  return StatusCode::SUCCESS;
184  }
185  template <class ContainerType>
188  const ContainerType*& contToPush) const {
189  contToPush = nullptr;
190  if (key.empty()) {
191  ATH_MSG_VERBOSE("No key has been parsed for object "<< typeid(ContainerType).name());
192  return StatusCode::SUCCESS;
193  }
194  SG::ReadHandle<ContainerType> readHandle{key, ctx};
195  ATH_CHECK(readHandle.isPresent());
196  contToPush = readHandle.cptr();
197  return StatusCode::SUCCESS;
198  }
199 
202  return StatusCode::SUCCESS;
203  }
204 
206  const Identifier& hitId) const {
207  const MuonGMR4::MuonReadoutElement* reElement = m_r4DetMgr->getReadoutElement(hitId);
208  //transform from local (w.r.t tube's frame) to global (ATLAS frame) and then to chamber's frame
209  const MuonGMR4::SpectrometerSector* muonChamber = reElement->msSector();
211  const IdentifierHash trfHash = reElement->detectorType() == ActsTrk::DetectorType::Mdt ?
212  reElement->measurementHash(hitId) : reElement->layerHash(hitId);
213  return muonChamber->globalToLocalTrans(gctx) * reElement->localToGlobalTrans(gctx, trfHash);
214  }
215 
217  m_out_stationName = msSector->chamberIndex();
218  m_out_stationEta = msSector->side();
219  m_out_stationPhi = msSector->stationPhi();
220  }
222  if (!segment) return;
223  m_out_hasTruth = true;
224 
225  const Amg::Vector3D segDir{segment->direction()};
226  static const SG::Accessor<float> acc_pt{"pt"};
227  // eta is interpreted as the eta-location
228  m_out_gen_Eta = segDir.eta();
229  m_out_gen_Phi = segDir.phi();
230  m_out_gen_Pt = acc_pt(*segment);
231  const auto [chamberPos, chamberDir] = SegmentFit::makeLine(SegmentFit::localSegmentPars(*segment));
232 
233  m_out_gen_nHits = segment->nPrecisionHits()+segment->nPhiLayers() + segment->nTrigEtaLayers();
234 
235  m_out_gen_nMDTHits = (segment->technology() == Muon::MuonStationIndex::MDT ? segment->nPrecisionHits() : 0);
236  m_out_gen_nNswHits = (segment->technology() != Muon::MuonStationIndex::MDT ? segment->nPrecisionHits() : 0);
237  m_out_gen_nTGCHits = (segment->chamberIndex() > Muon::MuonStationIndex::ChIndex::BEE ? segment->nPhiLayers() + segment->nTrigEtaLayers() : 0);
238  m_out_gen_nRPCHits = (segment->chamberIndex() <= Muon::MuonStationIndex::ChIndex::BEE ? segment->nPhiLayers() + segment->nTrigEtaLayers() : 0);
239 
240 
241  m_out_gen_tantheta = houghTanTheta(chamberDir);
242  m_out_gen_tanphi = houghTanPhi(chamberDir);
243  m_out_gen_y0 = chamberPos.y();
244  m_out_gen_x0 = chamberPos.x();
245  m_out_gen_time = segment->t0();
247  }
249  const SegmentSeed* foundMax = obj.matchedSeed;
250  if (!foundMax) return;
251  m_out_hasMax = true;
253  m_out_max_matchFraction = obj.nTruthMatchedMax;
254  m_out_max_tantheta = foundMax->tanTheta();
255  m_out_max_y0 = foundMax->interceptY();
257  m_out_max_tanphi = foundMax->tanPhi();
258  m_out_max_x0 = foundMax->interceptX();
259  }
260  m_out_max_nHits = foundMax->getHitsInMax().size();
261  m_out_max_nEtaHits = std::accumulate(foundMax->getHitsInMax().begin(), foundMax->getHitsInMax().end(),0,
262  [](int i, const HoughHitType & h){i += h->measuresEta();return i;});
263  m_out_max_nPhiHits = std::accumulate(foundMax->getHitsInMax().begin(), foundMax->getHitsInMax().end(),0,
264  [](int i, const HoughHitType & h){i += h->measuresPhi();return i;});
265  unsigned int nMdtMax{0}, nRpcMax{0}, nTgcMax{0}, nMmMax{0}, nsTgcMax{0};
266  for (const HoughHitType & houghSP: foundMax->getHitsInMax()){
267  m_spacePointOnSeed[m_out_SP->push_back(*houghSP)] = true;
268  switch (houghSP->type()) {
270  ++nMdtMax;
271  break;
273  nRpcMax+=houghSP->measuresEta();
274  nRpcMax+=houghSP->measuresPhi();
275  break;
277  nTgcMax+=houghSP->measuresEta();
278  nTgcMax+=houghSP->measuresPhi();
279  break;
281  ++nsTgcMax;
282  break;
284  ++nMmMax;
285  break;
286  default:
287  ATH_MSG_WARNING("Technology "<<m_idHelperSvc->toString(houghSP->identify())
288  <<" not yet implemented");
289  }
290  }
291  m_out_max_nMdt = nMdtMax;
292  m_out_max_nRpc = nRpcMax;
293  m_out_max_nTgc = nTgcMax;
294  m_out_max_nsTgc = nsTgcMax;
295  m_out_max_nMm = nMmMax;
296  }
297 
299  const ObjectMatching& obj){
300 
301  const Segment* segment = obj.matchedSegment;
302  using namespace SegmentFit;
303  if (!segment) return;
304  m_out_hasSegment = true;
305  m_out_segment_hasPhi = std::ranges::find_if(segment->measurements(), [](const auto& meas){ return meas->measuresPhi();})
306  !=segment->measurements().end();
307  m_out_segment_fitIter = segment->nFitIterations();
308  m_out_segment_matchFraction = obj.matchFracSegment;
309  m_out_segment_truthMatchedHits = obj.nTruthMatchedSeg;
310  m_out_segment_chi2 = segment->chi2();
311  m_out_segment_nDoF = segment->nDoF();
312  m_out_segment_hasTimeFit = segment->hasTimeFit();
313 
319  for (const double c2 : segment->chi2PerMeasurement()){
321  }
322  const auto [locPos, locDir] = makeLine(localSegmentPars(gctx, *segment));
325  m_out_segment_y0 = locPos.y();
326  m_out_segment_x0 = locPos.x();
327  m_out_segment_time = segment->segementT0() + segment->position().mag() * c_inv;
328 
329  unsigned int nMdtHits{0}, nRpcEtaHits{0}, nRpcPhiHits{0}, nTgcEtaHits{0}, nTgcPhiHits{0};
330  for (const auto & meas : segment->measurements()){
331  switch (meas->type()) {
333  m_spacePointOnSegment[m_out_SP->push_back(*meas->spacePoint())] = true;
334  ++nMdtHits;
335  break;
337  m_spacePointOnSegment[m_out_SP->push_back(*meas->spacePoint())] = true;
338  nRpcEtaHits += meas->measuresEta();
339  nRpcPhiHits += meas->measuresPhi();
340  break;
342  m_spacePointOnSegment[m_out_SP->push_back(*meas->spacePoint())] = true;
343  nTgcEtaHits += meas->measuresEta();
344  nTgcPhiHits += meas->measuresPhi();
345  break;
346  default:
347  break;
348  }
349  }
350  m_out_segment_nMdtHits = nMdtHits;
351  m_out_segment_nRpcEtaHits= nRpcEtaHits;
352  m_out_segment_nRpcPhiHits= nRpcPhiHits;
353  m_out_segment_nTgcEtaHits= nTgcEtaHits;
354  m_out_segment_nTgcPhiHits= nTgcPhiHits;
355  }
357 
358  const EventContext & ctx = Gaudi::Hive::currentContext();
359  const ActsGeometryContext* gctxPtr{nullptr};
360  ATH_CHECK(retrieveContainer(ctx, m_geoCtxKey, gctxPtr));
361  const ActsGeometryContext& gctx{*gctxPtr};
362 
363  // retrieve the two input collections
364 
365  const SegmentSeedContainer* readSegmentSeeds{nullptr};
366  ATH_CHECK(retrieveContainer(ctx, m_inHoughSegmentSeedKey, readSegmentSeeds));
367 
368  const SegmentContainer* readMuonSegments{nullptr};
369  ATH_CHECK(retrieveContainer(ctx, m_inSegmentKey, readMuonSegments));
370 
371  const xAOD::MuonSegmentContainer* readTruthSegments{nullptr};
372  ATH_CHECK(retrieveContainer(ctx, m_truthSegmentKey, readTruthSegments));
373 
374 
375  ATH_MSG_DEBUG("Succesfully retrieved input collections");
376 
377  std::vector<ObjectMatching> objects = matchWithTruth(readTruthSegments, readSegmentSeeds, readMuonSegments);
378  for (const ObjectMatching& obj : objects) {
379  fillChamberInfo(obj.chamber);
380  m_out_gen_bestMatch = obj.bestTruthMatch;
381  fillTruthInfo(obj.truthSegment);
382  fillSeedInfo(obj);
383  fillSegmentInfo(gctx, obj);
384  ATH_CHECK(m_tree.fill(ctx));
385  }
386 
387  return StatusCode::SUCCESS;
388  }
389 } // namespace MuonValR4
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MuonValR4::MuonHoughTransformTester::m_out_max_nsTgc
MuonVal::ScalarBranch< unsigned short > & m_out_max_nsTgc
Definition: MuonHoughTransformTester.h:146
MuonSimHitHelpers.h
xAOD::MuonSimHit_v1
Definition: MuonSimHit_v1.h:18
MuonValR4::MuonHoughTransformTester::m_out_max_nEtaHits
MuonVal::ScalarBranch< unsigned short > & m_out_max_nEtaHits
Definition: MuonHoughTransformTester.h:141
UtilFunctions.h
MuonValR4::MuonHoughTransformTester::m_out_hasTruth
MuonVal::ScalarBranch< bool > & m_out_hasTruth
Definition: MuonHoughTransformTester.h:106
MuonValR4::MuonHoughTransformTester::m_out_gen_nMDTHits
MuonVal::ScalarBranch< unsigned short > & m_out_gen_nMDTHits
Definition: MuonHoughTransformTester.h:121
MuonValR4::MuonHoughTransformTester::m_out_gen_nNswHits
MuonVal::ScalarBranch< unsigned short > & m_out_gen_nNswHits
Definition: MuonHoughTransformTester.h:124
MuonGMR4::SpectrometerSector::side
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
Definition: SpectrometerSector.cxx:36
MuonValR4::MuonHoughTransformTester::finalize
virtual StatusCode finalize() override
Definition: MuonHoughTransformTester.cxx:200
MuonValR4::MuonHoughTransformTester::m_out_stationPhi
MuonVal::ScalarBranch< int > & m_out_stationPhi
Definition: MuonHoughTransformTester.h:104
MuonGMR4::MuonReadoutElement::msSector
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:39
MuonValR4::MuonHoughTransformTester::m_out_segment_err_tanphi
MuonVal::ScalarBranch< float > & m_out_segment_err_tanphi
Definition: MuonHoughTransformTester.h:171
LArConditions2Ntuple.objects
objects
Definition: LArConditions2Ntuple.py:58
MuonValR4::MuonHoughTransformTester::m_out_SP
std::shared_ptr< MuonValR4::SpacePointTesterModule > m_out_SP
space point teste module
Definition: MuonHoughTransformTester.h:136
MuonGMR4::SpectrometerSector::stationPhi
int stationPhi() const
: Returns the station phi of the sector
Definition: SpectrometerSector.cxx:42
MuonVal::MuonTesterTree::init
StatusCode init(OWNER *instance)
Initialize method.
MuonR4::getTruthMatchedHits
std::unordered_set< const xAOD::MuonSimHit * > getTruthMatchedHits(const xAOD::MuonSegment &segment)
: Returns all truth hits matched to a xAOD::MuonSegment
Definition: MuonSimHitHelpers.cxx:24
SG::Accessor< float >
MuonValR4::MuonHoughTransformTester::m_out_segment_y0
MuonVal::ScalarBranch< float > & m_out_segment_y0
Definition: MuonHoughTransformTester.h:161
MuonValR4::MuonHoughTransformTester::m_out_segment_truthMatchedHits
MuonVal::ScalarBranch< unsigned short > & m_out_segment_truthMatchedHits
Definition: MuonHoughTransformTester.h:175
MuonValR4::MuonHoughTransformTester::m_out_gen_x0
MuonVal::ScalarBranch< float > & m_out_gen_x0
Definition: MuonHoughTransformTester.h:115
calibdata.chamber
chamber
Definition: calibdata.py:32
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MuonValR4::MuonHoughTransformTester::m_out_gen_tantheta
MuonVal::ScalarBranch< float > & m_out_gen_tantheta
Definition: MuonHoughTransformTester.h:112
MuonValR4::MuonHoughTransformTester::m_out_segment_err_time
MuonVal::ScalarBranch< float > & m_out_segment_err_time
Definition: MuonHoughTransformTester.h:172
xAOD::L2MuonParameters::BEE
@ BEE
BEE measurement point.
Definition: TrigMuonDefs.h:24
MuonR4::SegmentSeed::tanPhi
double tanPhi() const
Returns the angle from the phi extension.
Definition: SegmentSeed.cxx:31
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
MuonValR4::MuonHoughTransformTester::m_out_segment_err_y0
MuonVal::ScalarBranch< float > & m_out_segment_err_y0
Definition: MuonHoughTransformTester.h:168
MuonValR4::MuonHoughTransformTester::m_out_segment_time
MuonVal::ScalarBranch< float > & m_out_segment_time
Definition: MuonHoughTransformTester.h:165
MuonR4::Segment
Placeholder for what will later be the muon segment EDM representation.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:19
MuonValR4::MuonHoughTransformTester::m_out_max_nMm
MuonVal::ScalarBranch< unsigned short > & m_out_max_nMm
Definition: MuonHoughTransformTester.h:147
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
MuonValR4::MuonHoughTransformTester::ObjectMatching
Definition: MuonHoughTransformTester.h:63
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
HoughHelperFunctions.h
MuonValR4::MuonHoughTransformTester::m_out_segment_tantheta
MuonVal::ScalarBranch< float > & m_out_segment_tantheta
Definition: MuonHoughTransformTester.h:163
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonValR4::MuonHoughTransformTester::toChamberTrf
Amg::Transform3D toChamberTrf(const ActsGeometryContext &gctx, const Identifier &hitId) const
Definition: MuonHoughTransformTester.cxx:205
MuonValR4::MuonHoughTransformTester::m_out_segment_nRpcEtaHits
MuonVal::ScalarBranch< unsigned short > & m_out_segment_nRpcEtaHits
Definition: MuonHoughTransformTester.h:177
EventInfoBranch.h
ActsTrk::IDetectorElementBase::detectorType
virtual DetectorType detectorType() const =0
Returns the detector element type.
MuonValR4::MuonHoughTransformTester::m_out_max_nTgc
MuonVal::ScalarBranch< unsigned short > & m_out_max_nTgc
Definition: MuonHoughTransformTester.h:145
MuonValR4::MuonHoughTransformTester::m_out_gen_time
MuonVal::ScalarBranch< float > & m_out_gen_time
Definition: MuonHoughTransformTester.h:116
MuonValR4::MuonHoughTransformTester::m_out_segment_chi2_measurement
MuonVal::VectorBranch< float > & m_out_segment_chi2_measurement
Definition: MuonHoughTransformTester.h:174
MuonGMR4::MuonReadoutElement::layerHash
virtual IdentifierHash layerHash(const Identifier &measId) const =0
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::ReadHandleKey< ContainerType >
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
SpectrometerSector.h
MuonR4::SegmentFit::makeLine
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
Definition: SegmentFitterEventData.cxx:30
MuonValR4::MuonHoughTransformTester::m_truthSegmentKey
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_truthSegmentKey
Definition: MuonHoughTransformTester.h:88
MuonValR4::MuonHoughTransformTester::m_spacePointKey
SG::ReadHandleKey< MuonR4::SpacePointContainer > m_spacePointKey
Definition: MuonHoughTransformTester.h:92
MuonValR4::MuonHoughTransformTester::m_out_max_x0
MuonVal::ScalarBranch< float > & m_out_max_x0
Definition: MuonHoughTransformTester.h:131
MuonValR4::MuonHoughTransformTester::m_out_max_tanphi
MuonVal::ScalarBranch< float > & m_out_max_tanphi
Definition: MuonHoughTransformTester.h:133
MuonValR4::MuonHoughTransformTester::m_out_segment_nTgcEtaHits
MuonVal::ScalarBranch< unsigned short > & m_out_segment_nTgcEtaHits
Definition: MuonHoughTransformTester.h:179
MuonR4::SegmentFit::ParamDefs::phi
@ phi
MuonValR4::MuonHoughTransformTester::m_out_stationEta
MuonVal::ScalarBranch< int > & m_out_stationEta
Definition: MuonHoughTransformTester.h:103
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
MuonValR4::MuonHoughTransformTester::m_tree
MuonVal::MuonTesterTree m_tree
Definition: MuonHoughTransformTester.h:100
MuonValR4::MuonHoughTransformTester::m_spacePointOnSeed
MuonVal::VectorBranch< unsigned char > & m_spacePointOnSeed
Definition: MuonHoughTransformTester.h:137
MuonValR4::TruthHitCol
std::unordered_set< const xAOD::MuonSimHit * > TruthHitCol
Definition: MuonHoughTransformTester.cxx:21
MuonR4::houghTanPhi
double houghTanPhi(const Amg::Vector3D &v)
: Returns the hough tanPhi [x] / [z]
Definition: SegmentFitterEventData.cxx:18
MuonValR4::MuonHoughTransformTester::matchWithTruth
std::vector< ObjectMatching > matchWithTruth(const xAOD::MuonSegmentContainer *truthSegments, const MuonR4::SegmentSeedContainer *seedContainer, const MuonR4::SegmentContainer *segmentContainer) const
Definition: MuonHoughTransformTester.cxx:31
MuonValR4::MuonHoughTransformTester::ObjectMatching::matchedSeed
const MuonR4::SegmentSeed * matchedSeed
Definition: MuonHoughTransformTester.h:66
MuonGMR4::SpectrometerSector::chamberIndex
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
Definition: SpectrometerSector.cxx:41
MuonValR4::MuonHoughTransformTester::m_out_hasMax
MuonVal::ScalarBranch< bool > & m_out_hasMax
Definition: MuonHoughTransformTester.h:126
MuonValR4::MuonHoughTransformTester::m_out_gen_nRPCHits
MuonVal::ScalarBranch< unsigned short > & m_out_gen_nRPCHits
Definition: MuonHoughTransformTester.h:120
MuonValR4::MuonHoughTransformTester::m_out_segment_nTgcPhiHits
MuonVal::ScalarBranch< unsigned short > & m_out_segment_nTgcPhiHits
Definition: MuonHoughTransformTester.h:180
MuonValR4::MuonHoughTransformTester::m_out_segment_err_tantheta
MuonVal::ScalarBranch< float > & m_out_segment_err_tantheta
Definition: MuonHoughTransformTester.h:170
MuonR4::SegmentSeed::tanTheta
double tanTheta() const
Returns the angular coordinate of the eta transform.
Definition: SegmentSeed.cxx:32
MuonR4::SegmentSeed::hasPhiExtension
bool hasPhiExtension() const
check whether the segment seed includes a valid phi extension
Definition: SegmentSeed.cxx:40
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonValR4::MuonHoughTransformTester::m_out_segment_err_x0
MuonVal::ScalarBranch< float > & m_out_segment_err_x0
Definition: MuonHoughTransformTester.h:169
MuonValR4::MuonHoughTransformTester::m_spacePointOnSegment
MuonVal::VectorBranch< unsigned char > & m_spacePointOnSegment
Definition: MuonHoughTransformTester.h:138
h
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
SegmentFitHelperFunctions.h
MuonValR4::MuonHoughTransformTester::m_out_gen_bestMatch
MuonVal::ScalarBranch< bool > & m_out_gen_bestMatch
Definition: MuonHoughTransformTester.h:108
MuonValR4::MuonHoughTransformTester::m_out_gen_tanphi
MuonVal::ScalarBranch< float > & m_out_gen_tanphi
Definition: MuonHoughTransformTester.h:114
MuonGMR4::SpectrometerSector::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
Definition: SpectrometerSector.cxx:54
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonR4::SegmentSeed::interceptY
double interceptY() const
Returns the intercept coordinate of the eta transform.
Definition: SegmentSeed.cxx:34
MuonValR4::MuonHoughTransformTester::m_out_max_tantheta
MuonVal::ScalarBranch< float > & m_out_max_tantheta
Definition: MuonHoughTransformTester.h:132
MuonR4::SegmentSeed::getHitsInMax
const std::vector< HitType > & getHitsInMax() const
Returns the list of assigned hits.
Definition: SegmentSeed.cxx:37
MuonValR4::MuonHoughTransformTester::m_out_segment_matchFraction
MuonVal::ScalarBranch< float > & m_out_segment_matchFraction
Definition: MuonHoughTransformTester.h:151
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonValR4::MuonHoughTransformTester::m_out_max_hasPhiExtension
MuonVal::ScalarBranch< bool > & m_out_max_hasPhiExtension
Definition: MuonHoughTransformTester.h:127
MuonValR4::MuonHoughTransformTester::m_out_segment_nDoF
MuonVal::ScalarBranch< uint16_t > & m_out_segment_nDoF
Definition: MuonHoughTransformTester.h:153
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
MuonValR4::MuonHoughTransformTester::fillSegmentInfo
void fillSegmentInfo(const ActsGeometryContext &gctx, const ObjectMatching &obj)
Definition: MuonHoughTransformTester.cxx:298
MuonR4::SegmentFit::ParamDefs::x0
@ x0
MuonValR4::MuonHoughTransformTester::m_r4DetMgr
const MuonGMR4::MuonDetectorManager * m_r4DetMgr
Definition: MuonHoughTransformTester.h:97
AthHistogramAlgorithm
Definition: AthHistogramAlgorithm.h:32
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonValR4::MuonHoughTransformTester::m_out_segment_x0
MuonVal::ScalarBranch< float > & m_out_segment_x0
Definition: MuonHoughTransformTester.h:162
MuonR4::SegmentFit::ParamDefs::time
@ time
MuonVal::VectorBranch::push_back
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:18
MuonValR4::MuonHoughTransformTester::m_out_gen_Eta
MuonVal::ScalarBranch< float > & m_out_gen_Eta
Definition: MuonHoughTransformTester.h:109
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition: IPatternVisualizationTool.h:23
MuonValR4::MuonHoughTransformTester::ObjectMatching::truthSegment
const xAOD::MuonSegment * truthSegment
Definition: MuonHoughTransformTester.h:65
MuonR4::SegmentFit::ParamDefs::y0
@ y0
MuonHoughDefs.h
ActsTrk::DetectorType::Mdt
@ Mdt
MuonSpectrometer.
MuonValR4::MuonHoughTransformTester::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: MuonHoughTransformTester.h:94
MuonValR4::MuonHoughTransformTester::m_out_gen_nHits
MuonVal::ScalarBranch< unsigned short > & m_out_gen_nHits
Definition: MuonHoughTransformTester.h:119
MuonValR4::MuonHoughTransformTester::m_out_gen_Phi
MuonVal::ScalarBranch< float > & m_out_gen_Phi
Definition: MuonHoughTransformTester.h:110
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
MuonValR4::MuonHoughTransformTester::m_out_segment_hasTimeFit
MuonVal::ScalarBranch< bool > & m_out_segment_hasTimeFit
Definition: MuonHoughTransformTester.h:155
python.ElectronD3PDObject.matched
matched
Definition: ElectronD3PDObject.py:138
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
MuonR4::SegmentSeed::interceptX
double interceptX() const
Returns the intercept from the phi extension.
Definition: SegmentSeed.cxx:33
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonValR4::MuonHoughTransformTester::initialize
virtual StatusCode initialize() override
Definition: MuonHoughTransformTester.cxx:170
MuonValR4::MuonHoughTransformTester::m_out_max_nPhiHits
MuonVal::ScalarBranch< unsigned short > & m_out_max_nPhiHits
Definition: MuonHoughTransformTester.h:142
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:113
MuonValR4::MuonHoughTransformTester::MuonHoughTransformTester
MuonHoughTransformTester(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonHoughTransformTester.cxx:166
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonValR4::MuonHoughTransformTester::execute
virtual StatusCode execute() override
Definition: MuonHoughTransformTester.cxx:356
MuonValR4::MuonHoughTransformTester::m_out_max_nRpc
MuonVal::ScalarBranch< unsigned short > & m_out_max_nRpc
Definition: MuonHoughTransformTester.h:144
MuonValR4::MuonHoughTransformTester::fillSeedInfo
void fillSeedInfo(const ObjectMatching &obj)
Definition: MuonHoughTransformTester.cxx:248
Muon::MuonStationIndex::MDT
@ MDT
Definition: MuonStationIndex.h:56
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
MuonValR4::MuonHoughTransformTester::m_out_segment_hasPhi
MuonVal::ScalarBranch< bool > & m_out_segment_hasPhi
Definition: MuonHoughTransformTester.h:154
MuonValR4::MuonHoughTransformTester::m_out_segment_nMdtHits
MuonVal::ScalarBranch< unsigned short > & m_out_segment_nMdtHits
Definition: MuonHoughTransformTester.h:176
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonVal::ScalarBranch::getVariable
const T & getVariable() const
MuonValR4::MuonHoughTransformTester::m_inHoughSegmentSeedKey
SG::ReadHandleKey< MuonR4::SegmentSeedContainer > m_inHoughSegmentSeedKey
Definition: MuonHoughTransformTester.h:90
MuonR4::SegmentSeed
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Definition: SegmentSeed.h:14
MuonValR4::MuonHoughTransformTester::m_out_gen_Pt
MuonVal::ScalarBranch< float > & m_out_gen_Pt
Definition: MuonHoughTransformTester.h:111
MuonGMR4::MuonReadoutElement::measurementHash
virtual IdentifierHash measurementHash(const Identifier &measId) const =0
Constructs the identifier hash from the full measurement Identifier.
MuonValR4::MuonHoughTransformTester::m_out_max_nMdt
MuonVal::ScalarBranch< unsigned short > & m_out_max_nMdt
Definition: MuonHoughTransformTester.h:143
MuonValR4::MuonHoughTransformTester::m_out_max_nHits
MuonVal::ScalarBranch< unsigned short > & m_out_max_nHits
Definition: MuonHoughTransformTester.h:140
MuonValR4::MuonHoughTransformTester::m_out_segment_nRpcPhiHits
MuonVal::ScalarBranch< unsigned short > & m_out_segment_nRpcPhiHits
Definition: MuonHoughTransformTester.h:178
MuonValR4::MuonHoughTransformTester::m_out_segment_tanphi
MuonVal::ScalarBranch< float > & m_out_segment_tanphi
Definition: MuonHoughTransformTester.h:164
MuonVal::MuonTesterTree::fill
bool fill(const EventContext &ctx)
Fills the tree per call.
Definition: MuonTesterTree.cxx:89
MuonGMR4::MuonReadoutElement::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:81
MuonVal::MuonTesterTree::write
StatusCode write()
Finally write the TTree objects.
Definition: MuonTesterTree.cxx:178
MuonValR4::countMatched
unsigned int countMatched(const TruthHitCol &truthHits, const TruthHitCol &recoHits)
Definition: MuonHoughTransformTester.cxx:22
MuonHoughTransformTester.h
MuonR4::SegmentFit::localSegmentPars
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
Definition: SegmentFitterEventData.cxx:36
MuonValR4::MuonHoughTransformTester::m_out_gen_nTGCHits
MuonVal::ScalarBranch< unsigned short > & m_out_gen_nTGCHits
Definition: MuonHoughTransformTester.h:122
MuonValR4::MuonHoughTransformTester::TruthHitCol
std::unordered_set< const xAOD::MuonSimHit * > TruthHitCol
Definition: MuonHoughTransformTester.h:50
MuonValR4::MuonHoughTransformTester::m_inSegmentKey
SG::ReadHandleKey< MuonR4::SegmentContainer > m_inSegmentKey
Definition: MuonHoughTransformTester.h:91
MuonValR4::MuonHoughTransformTester::m_out_max_y0
MuonVal::ScalarBranch< float > & m_out_max_y0
Definition: MuonHoughTransformTester.h:130
MuonValR4::MuonHoughTransformTester::m_out_segment_fitIter
MuonVal::ScalarBranch< uint16_t > & m_out_segment_fitIter
Definition: MuonHoughTransformTester.h:157
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
MuonValR4::MuonHoughTransformTester::fillChamberInfo
void fillChamberInfo(const MuonGMR4::SpectrometerSector *chamber)
Definition: MuonHoughTransformTester.cxx:216
MuonValR4::MuonHoughTransformTester::m_out_segment_chi2
MuonVal::ScalarBranch< float > & m_out_segment_chi2
Definition: MuonHoughTransformTester.h:152
MuonValR4::MuonHoughTransformTester::m_out_hasSegment
MuonVal::ScalarBranch< bool > & m_out_hasSegment
Definition: MuonHoughTransformTester.h:150
MuonValR4::MuonHoughTransformTester::fillTruthInfo
void fillTruthInfo(const xAOD::MuonSegment *truthSegment)
Definition: MuonHoughTransformTester.cxx:221
python.PyAthena.obj
obj
Definition: PyAthena.py:132
MuonValR4::MuonHoughTransformTester::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonHoughTransformTester.h:96
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
MuonValR4::MuonHoughTransformTester::m_out_gen_y0
MuonVal::ScalarBranch< float > & m_out_gen_y0
Definition: MuonHoughTransformTester.h:113
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MuonValR4::MuonHoughTransformTester::m_out_stationName
MuonVal::ScalarBranch< int > & m_out_stationName
Definition: MuonHoughTransformTester.h:102
MuonValR4::MuonHoughTransformTester::m_out_max_matchFraction
MuonVal::ScalarBranch< float > & m_out_max_matchFraction
Definition: MuonHoughTransformTester.h:128
MuonR4::houghTanTheta
double houghTanTheta(const Amg::Vector3D &v)
Returns the hough tanTheta [y] / [z].
Definition: SegmentFitterEventData.cxx:14
MuonSegmentReaderConfig.reco
reco
Definition: MuonSegmentReaderConfig.py:133
MuonR4::SegmentFit::ParamDefs::theta
@ theta
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
MuonGMR4::MuonDetectorManager::getSectorEnvelope
const SpectrometerSector * getSectorEnvelope(const Identifier &channelId) const
Retrieves the spectrometer envelope enclosing the channel's readout element.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:159
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
MuonValR4::MuonHoughTransformTester::retrieveContainer
StatusCode retrieveContainer(const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const
Helper method to fetch data from StoreGate.
Definition: MuonHoughTransformTester.cxx:186
MuonVal::MuonTesterTree::addBranch
bool addBranch(std::shared_ptr< IMuonTesterBranch > branch)
Branch is added to the tree without transferring the ownership.
Definition: MuonTesterTree.cxx:61
MuonGMR4::MuonDetectorManager::getReadoutElement
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14