ATLAS Offline Software
Loading...
Searching...
No Matches
MuonRecoValidationTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "GaudiKernel/ConcurrencyFlags.h"
8#include "GaudiKernel/IIncidentSvc.h"
9#include "GaudiKernel/ITHistSvc.h"
19#include "TFile.h"
20#include "TTree.h"
22#include "TrkTrack/Track.h"
27
28namespace {
29 constexpr float SIG_VEL = 4.80000;
30 constexpr float C_VEL = 3.33564;
31} // namespace
32
33namespace Muon {
34 using namespace MuonStationIndex;
35
36 MuonRecoValidationTool::MuonRecoValidationTool(const std::string& t, const std::string& n, const IInterface* p) :
37 AthAlgTool(t, n, p),
38 m_segmentHitSummaryTool("Muon::MuonSegmentHitSummaryTool/MuonSegmentHitSummaryTool"),
39 m_hitSummaryTool("Muon::MuonHitSummaryTool/MuonHitSummaryTool"),
40 m_truthSummaryTool("Muon::MuonTruthSummaryTool/MuonTruthSummaryTool"),
41 m_extrapolator("Trk::Extrapolation/AtlasExtrapolator"),
42 m_matchingTool("MuTagMatchingTool/MuTagMatchingTool"),
43 m_hitTimingTool("Muon::MuonHitTimingTool/MuonHitTimingTool"),
44 m_incidentSvc("IncidentSvc", n),
46 declareInterface<IMuonRecoValidationTool>(this);
47 declareProperty("MuonSegmentHitSummaryTool", m_segmentHitSummaryTool);
48 declareProperty("MuonHitSummaryTool", m_hitSummaryTool);
49 declareProperty("MuonTruthSummaryTool", m_truthSummaryTool);
50 declareProperty("Extrapolator", m_extrapolator);
51 declareProperty("MatchTool", m_matchingTool);
52 declareProperty("MuonHitTimingTool", m_hitTimingTool);
53 declareProperty("IncidentSvc", m_incidentSvc);
54 declareProperty("isMC", m_isMC = false);
55 }
56
58
59 if (Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
60 ATH_MSG_ERROR("This tool cannot be used in multi-threaded mode");
61 return StatusCode::FAILURE;
62 }
63
64 ATH_CHECK(m_idHelperSvc.retrieve());
65 ATH_CHECK(m_edmHelperSvc.retrieve());
67 ATH_CHECK(m_hitSummaryTool.retrieve());
68 if (m_isMC) {
69 ATH_CHECK(m_truthSummaryTool.retrieve());
70 } else {
71 m_truthSummaryTool.disable();
72 }
73 ATH_CHECK(m_extrapolator.retrieve());
74 ATH_CHECK(m_matchingTool.retrieve());
75 ATH_CHECK(m_hitTimingTool.retrieve());
76 SmartIF<ITHistSvc> thistSvc{service("THistSvc")};
77 ATH_CHECK(thistSvc.isValid());
78
79 m_tree = new TTree("data", "RecoValidation");
80 ATH_CHECK(thistSvc->regTree("/MuonRecoVal/data", m_tree));
81
82 m_ntuple.init("", m_tree);
83
84 // call handle in case of EndEvent
85 ATH_CHECK(m_incidentSvc.retrieve());
86 m_incidentSvc->addListener(this, IncidentType::EndEvent);
87
88 return StatusCode::SUCCESS;
89 }
90
97
98 void MuonRecoValidationTool::handle(const Incident& inc) {
99 // Only clear cache for EndEvent incident
100 if (inc.type() == IncidentType::EndEvent) {
101 ATH_MSG_DEBUG(" clearing cache at end of event ");
102 m_tree->Fill();
103 clear();
104 }
105 }
106
108 const MuonSystemExtension& muonSystemExtension) const {
109 m_ntuple.trackParticleBlock.pt->push_back(indetTrackParticle.pt());
110 m_ntuple.trackParticleBlock.p->push_back(1. / indetTrackParticle.qOverP());
111 m_ntuple.trackParticleBlock.eta->push_back(indetTrackParticle.eta());
112 m_ntuple.trackParticleBlock.phi->push_back(indetTrackParticle.phi());
113 int pdg = 0;
114 int uniqueID = HepMC::INVALID_PARTICLE_ID;
115 float beta = 1.;
116 // set truth
117 typedef ElementLink<xAOD::TruthParticleContainer> ElementTruthLink_t;
119 truthParticleLinkAcc("truthParticleLink");
120 if (truthParticleLinkAcc.isAvailable(indetTrackParticle)) {
121 const ElementTruthLink_t link = truthParticleLinkAcc(indetTrackParticle);
122 if (link.isValid()) {
123 pdg = (*link)->pdgId();
124 uniqueID = HepMC::uniqueID(*link);
125 beta = (*link)->p4().Beta();
126 }
127 }
128 m_ntuple.trackParticleBlock.truth.fill(pdg, uniqueID, beta);
129
130 // try to find the pointer of the indetTrackParticle
131 bool found = false;
132 for (unsigned int index = 0; index < m_trackParticles.size(); ++index) {
133 if (&indetTrackParticle == m_trackParticles[index]) {
134 found = true;
135 break;
136 }
137 }
138 if (!found) {
139 // set index to the last element
140 unsigned int index = m_trackParticles.size();
141 m_trackParticles.push_back(&indetTrackParticle);
142
143 const std::vector<Muon::MuonSystemExtension::Intersection>& layerIntersections = muonSystemExtension.layerIntersections();
144 ATH_MSG_DEBUG("Adding ID track: pt " << indetTrackParticle.pt() << " eta " << indetTrackParticle.eta() << " phi "
145 << indetTrackParticle.phi() << " layers " << layerIntersections.size());
146
147 for (std::vector<Muon::MuonSystemExtension::Intersection>::const_iterator it = layerIntersections.begin();
148 it != layerIntersections.end(); ++it) {
149 m_trackParticleIndexLookup[it->trackParameters.get()] = index;
150 }
151 }
152 return true;
153 }
154
155 int MuonRecoValidationTool::getUniqueID(const std::set<Identifier>& ids) const {
157
158 // count how often a barcode occurs
159 std::map<int, int> counters;
160 for (std::set<Identifier>::const_iterator it = ids.begin(); it != ids.end(); ++it) {
161 const int uniqueID = m_truthSummaryTool->getUniqueID(*it);
162 if (uniqueID != HepMC::INVALID_PARTICLE_ID) ++counters[uniqueID];
163 }
164
165 // pick the most frequent
166 int barcode = HepMC::INVALID_PARTICLE_ID;
167 int max = -1;
168 for (std::map<int, int>::iterator it = counters.begin(); it != counters.end(); ++it) {
169 if (it->second > max) {
170 barcode = it->first; // FIXME barcode-based
171 max = it->second;
172 }
173 }
174
175 return barcode;
176 }
177
179 const MuGirlNS::StauHits& stauHits) const {
180 Muon::MuonBetaCalculationUtils muonBetaCalculationUtils;
181
182 auto pos = std::find(m_trackParticles.begin(), m_trackParticles.end(), &indetTrackParticle);
183 if (pos == m_trackParticles.end()) {
184 ATH_MSG_WARNING("addTimeMeasurement: indetTrackParticle not found ");
185 return false;
186 }
187 int index = std::distance(m_trackParticles.begin(), pos);
188
189 for (const auto& stauHit : stauHits) {
190 Identifier id = stauHit.id;
191 int type = toInt(m_idHelperSvc->technologyIndex(id)) + 10;
192 double r = std::hypot(stauHit.x, stauHit.y);
193 double tof = muonBetaCalculationUtils.calculateTof(1, std::hypot(r, stauHit.z));
194 // track index
195 m_ntuple.timeBlock.track.fill(index);
196
197 // identifier info
198 m_ntuple.timeBlock.id.fill(m_idHelperSvc->sector(id), toInt(m_idHelperSvc->chamberIndex(id)));
199
200 // position + time information
201 m_ntuple.timeBlock.fill(type, m_idHelperSvc->gasGapId(id).get_identifier32().get_compact(), r, stauHit.z, stauHit.mToF - tof,
202 stauHit.error, stauHit.propagationTime, stauHit.e, tof, 0., stauHit.shift, 1000 * m_candidateCounter);
203
204 // uniqueID + pdg
205 int uniqueID = HepMC::INVALID_PARTICLE_ID, pdg = 0;
206 if (m_isMC) {
207 uniqueID = m_truthSummaryTool->getUniqueID(id);
208 pdg = uniqueID != HepMC::INVALID_PARTICLE_ID ? m_truthSummaryTool->getPdgId(uniqueID) : 0;
209 }
210 m_ntuple.timeBlock.truth.fill(pdg, uniqueID);
211 }
213 return true;
214 }
215
217 const Amg::Vector3D& gpos, float time, float errorTime) const {
218 // track index
219 m_ntuple.timeBlock.track.fill(getIndex(intersection));
220
221 // identifier info
222 m_ntuple.timeBlock.id.fill(m_idHelperSvc->sector(id), toInt(m_idHelperSvc->chamberIndex(id)));
223
224 // position information
225 m_ntuple.timeBlock.fill(2, m_idHelperSvc->gasGapId(id).get_identifier32().get_compact(), gpos.perp(), gpos.z(), time, errorTime);
226
227 // uniqueID + pdg
228 int uniqueID = HepMC::INVALID_PARTICLE_ID, pdg = 0;
229 if (m_isMC) {
230 uniqueID = m_truthSummaryTool->getUniqueID(id);
231 pdg = uniqueID != HepMC::INVALID_PARTICLE_ID ? m_truthSummaryTool->getPdgId(uniqueID) : 0;
232 }
233 m_ntuple.timeBlock.truth.fill(pdg, uniqueID);
234
235 return true;
236 }
237
239 const Trk::MeasurementBase& meas) const {
240 float segmentTimeCorrection = 0.;
241
242 const MuonSegment* seg = dynamic_cast<const MuonSegment*>(&meas);
243 if (seg && seg->hasFittedT0()) {
244 m_ntuple.timeBlock.track.fill(getIndex(intersection));
245
246 Identifier id = m_edmHelperSvc->chamberId(*seg);
247 m_ntuple.timeBlock.id.fill(m_idHelperSvc->sector(id), toInt(m_idHelperSvc->chamberIndex(id)));
248
249 // position information
250 m_ntuple.timeBlock.fill(1, m_idHelperSvc->chamberId(id).get_identifier32().get_compact(), seg->globalPosition().perp(),
251 seg->globalPosition().z(), seg->time() - segmentTimeCorrection, seg->errorTime());
252
253 // uniqueID + pdg
254 std::set<Identifier> ids;
255 std::vector<const MuonClusterOnTrack*> clusters;
256 extract(*seg, ids, clusters);
257 int uniqueID = getUniqueID(ids);
258 int pdg = 0;
259 if (m_isMC) pdg = uniqueID != HepMC::INVALID_PARTICLE_ID ? m_truthSummaryTool->getPdgId(uniqueID) : 0;
260 m_ntuple.timeBlock.truth.fill(pdg, uniqueID);
261
262 return true;
263 }
264
265 const RpcClusterOnTrack* rpc = dynamic_cast<const RpcClusterOnTrack*>(&meas);
266 if (rpc) {
267 m_ntuple.timeBlock.track.fill(getIndex(intersection));
268
269 Identifier id = rpc->identify();
270 m_ntuple.timeBlock.id.fill(m_idHelperSvc->sector(id), toInt(m_idHelperSvc->chamberIndex(id)));
271
272 // uniqueID + pdg
273 int uniqueID = HepMC::INVALID_PARTICLE_ID, pdg = 0;
274 if (m_isMC) {
275 uniqueID = m_truthSummaryTool->getUniqueID(id);
276 pdg = uniqueID != HepMC::INVALID_PARTICLE_ID ? m_truthSummaryTool->getPdgId(uniqueID) : 0;
277 }
278 m_ntuple.timeBlock.truth.fill(pdg, uniqueID);
279
280 bool measphi = m_idHelperSvc->measuresPhi(id);
281 const Amg::Vector3D& GP = rpc->globalPosition();
282 const Muon::RpcPrepData* MClus = rpc->prepRawData();
283 const MuonGM::RpcReadoutElement* rpc_readout_element = MClus->detectorElement();
284 Amg::Vector3D posi = rpc_readout_element->stripPos(id);
285
286 // let's correct rpc time subtracting delay due to the induced electric signal propagation along strip
287 double correct_time_along_strip = 0;
288 if (measphi == 0) {
289 correct_time_along_strip = rpc_readout_element->distanceToEtaReadout(GP) / 1000. * SIG_VEL;
290 } else {
291 correct_time_along_strip = rpc_readout_element->distanceToPhiReadout(GP) / 1000. * SIG_VEL;
292 }
293
294 // let's evaluate the average delay due to the induced electric signal propagation along strip
295 double av_correct_time_along_strip = 0;
296 if (measphi == 0) {
297 av_correct_time_along_strip = rpc_readout_element->distanceToEtaReadout(posi) / 1000. * SIG_VEL;
298 } else {
299 av_correct_time_along_strip = rpc_readout_element->distanceToPhiReadout(posi) / 1000. * SIG_VEL;
300 }
301
302 // let's evaluate [real TOF - nominal TOF]
303 double real_TOF_onRPCgap = GP.mag() / 1000. * C_VEL;
304 double nominal_TOF_onRPCgap = posi.mag() / 1000. * C_VEL;
305
306 // let's evaluate the total time correction
307 double correct_time_tot = real_TOF_onRPCgap - nominal_TOF_onRPCgap + correct_time_along_strip - av_correct_time_along_strip;
308
309 // time and position information
310 m_ntuple.timeBlock.fill(0, m_idHelperSvc->gasGapId(id).get_identifier32().get_compact(), rpc->globalPosition().perp(),
311 rpc->globalPosition().z(), rpc->time(), 2., correct_time_along_strip, av_correct_time_along_strip,
312 real_TOF_onRPCgap, nominal_TOF_onRPCgap, correct_time_tot);
313
314 return true;
315 }
316
317 return true;
318 }
319
321 const EventContext& ctx = Gaudi::Hive::currentContext();
322 m_ntuple.segmentBlock.stage->push_back(stage);
323
324 Identifier id = m_edmHelperSvc->chamberId(segment);
325 m_ntuple.segmentBlock.id.fill(m_idHelperSvc->sector(id), toInt(m_idHelperSvc->chamberIndex(id)));
326
327 // position information
328 m_ntuple.segmentBlock.r->push_back(segment.globalPosition().perp());
329 m_ntuple.segmentBlock.z->push_back(segment.globalPosition().z());
330
331 // timing information
332 float t0 = segment.hasFittedT0() ? segment.time() : -99999;
333 float t0Error = segment.hasFittedT0() ? segment.errorTime() : -99999;
334 m_ntuple.segmentBlock.t0->push_back(t0);
335 m_ntuple.segmentBlock.t0Error->push_back(t0Error);
336
337 // extract clusters and ids
338 std::set<Identifier> ids;
339 std::vector<const MuonClusterOnTrack*> clusters;
340 extract(segment, ids, clusters);
341
342 IMuonHitTimingTool::TimingResult result = m_hitTimingTool->calculateTimingResult(clusters);
343 t0 = result.valid ? result.time : -99999;
344 t0Error = result.valid ? result.error : -99999;
345 m_ntuple.segmentBlock.t0Trig->push_back(t0);
346 m_ntuple.segmentBlock.t0TrigError->push_back(t0Error);
347
348 // hit counts
349 IMuonSegmentHitSummaryTool::HitCounts hitCounts = m_segmentHitSummaryTool->getHitCounts(segment);
350 m_ntuple.segmentBlock.nmdtHits->push_back(hitCounts.nmdtHits()+ hitCounts.nmmHits() + hitCounts.ncscHits.netaHits);
351 m_ntuple.segmentBlock.ntrigEtaHits->push_back(hitCounts.netaTrigHitLayers);
352 m_ntuple.segmentBlock.ntrigPhiHits->push_back(hitCounts.nphiTrigHitLayers);
353
354 // uniqueID + pdg
355 int uniqueID = getUniqueID(ids);
356 int pdg = 0;
357 if (m_isMC) pdg = uniqueID != HepMC::INVALID_PARTICLE_ID ? m_truthSummaryTool->getPdgId(uniqueID) : 0;
358 m_ntuple.segmentBlock.truth.fill(pdg, uniqueID);
359
360 m_ntuple.segmentBlock.track.fill(getIndex(intersection));
361
362 // extrapolate and create an intersection @ the segment surface.
363 std::shared_ptr<Trk::TrackParameters> exPars(
364 m_extrapolator->extrapolate(ctx, *intersection.trackParameters, segment.associatedSurface(), Trk::anyDirection, false, Trk::muon));
365 if (!exPars) {
366 ATH_MSG_VERBOSE(" extrapolation failed ");
367 m_ntuple.segmentBlock.quality->push_back(-2);
368 m_ntuple.segmentBlock.xresiduals.fill(0., 1., 0., 1., -1);
369 m_ntuple.segmentBlock.yresiduals.fill(0., 1., 0., 1., -1);
370 m_ntuple.segmentBlock.angleXZ.fill(0., 1., 0., 1., -1);
371 m_ntuple.segmentBlock.angleYZ.fill(0., 1., 0., 1., -1);
372 m_ntuple.segmentBlock.combinedYZ.fill(0., 1., 0., 1., -1);
373 return false;
374 }
375
376 // cast to AtaPlane so we can get the segment info
377 std::shared_ptr<Trk::AtaPlane> ataPlane = std::dynamic_pointer_cast<Trk::AtaPlane>(exPars);
378 if (!ataPlane) {
379 ATH_MSG_WARNING(" dynamic_cast<> failed ");
380 m_ntuple.segmentBlock.quality->push_back(-2);
381 m_ntuple.segmentBlock.angleXZ.fill(0., 1., 0., 1., -1);
382 m_ntuple.segmentBlock.angleYZ.fill(0., 1., 0., 1., -1);
383 m_ntuple.segmentBlock.combinedYZ.fill(0., 1., 0., 1., -1);
384 return false;
385 }
386 MuonCombined::MuonSegmentInfo segmentInfo = m_matchingTool->muTagSegmentInfo(ctx, nullptr, segment, ataPlane);
387 m_ntuple.segmentBlock.quality->push_back(segmentInfo.quality);
388 m_ntuple.segmentBlock.xresiduals.fillResPull(segmentInfo.resX, segmentInfo.pullX, segmentInfo.segErrorX, segmentInfo.exErrorX, 1);
389 m_ntuple.segmentBlock.yresiduals.fillResPull(segmentInfo.resY, segmentInfo.pullY, segmentInfo.segErrorY, segmentInfo.exErrorY, 1);
390 m_ntuple.segmentBlock.angleXZ.fillResPull(segmentInfo.dangleXZ, segmentInfo.pullXZ, segmentInfo.segErrorXZ, segmentInfo.exErrorXZ,
391 1);
392 m_ntuple.segmentBlock.angleYZ.fillResPull(segmentInfo.dangleYZ, segmentInfo.pullYZ, segmentInfo.segErrorYZ, segmentInfo.exErrorYZ,
393 1);
394 m_ntuple.segmentBlock.combinedYZ.fillResPull(segmentInfo.resCY, segmentInfo.pullCY, 1);
395
396 ATH_MSG_DEBUG(" Adding Segment to ntuple: stage " << stage);
397
398 return true;
399 }
400
402 const MuonHough::MuonLayerHough::Maximum& maximum) const {
403 m_ntuple.houghBlock.maximum->push_back(maximum.max);
404
405 m_ntuple.houghBlock.track.fill(getIndex(intersection));
406
407 int sector = -1;
408 int chIndex = -1;
409 float maxwidth = (maximum.binposmax - maximum.binposmin);
410 if (maximum.hough) {
411 maxwidth *= maximum.hough->m_binsize;
412 sector = maximum.hough->m_descriptor.sector;
414 }
415 m_ntuple.houghBlock.id.fill(sector, chIndex);
416 m_ntuple.houghBlock.residuals.fill(maximum.pos, maxwidth, intersection, Trk::loc1);
417
418 // get truth from hits
419 std::set<Identifier> ids;
420
421 MuonHough::HitVec::const_iterator hit = maximum.hits.begin();
422 MuonHough::HitVec::const_iterator hit_end = maximum.hits.end();
423 for (; hit != hit_end; ++hit) {
424 // treat the case that the hit is a composite TGC hit
425 if ((*hit)->tgc) {
426 for (const auto& prd : (*hit)->tgc->etaCluster) ids.insert(prd->identify());
427 } else if ((*hit)->prd) {
428 ids.insert((*hit)->prd->identify());
429 }
430 }
431 int uniqueID = HepMC::INVALID_PARTICLE_ID, pdg = 0;
432 if (m_isMC) {
433 uniqueID = getUniqueID(ids);
434 pdg = uniqueID != HepMC::INVALID_PARTICLE_ID ? m_truthSummaryTool->getPdgId(uniqueID) : 0;
435 }
436 m_ntuple.houghBlock.truth.fill(pdg, uniqueID);
437
438 ATH_MSG_DEBUG(" Adding Hough maximum to ntuple ");
439
440 return true;
441 }
442
444 float expos_err) const {
445 Identifier id = prd.identify();
446 m_ntuple.hitBlock.id.fill(m_idHelperSvc->sector(id), toInt(m_idHelperSvc->chamberIndex(id)));
447 m_ntuple.hitBlock.track.fill(getIndex(intersection));
448
449 int uniqueID = HepMC::INVALID_PARTICLE_ID, pdg = 0;
450 if (m_isMC) {
451 uniqueID = m_truthSummaryTool->getUniqueID(id);
452 pdg = uniqueID != HepMC::INVALID_PARTICLE_ID ? m_truthSummaryTool->getPdgId(uniqueID) : 0;
453 }
454 m_ntuple.hitBlock.truth.fill(pdg, uniqueID);
455
456 float sign = expos < 0 ? -1. : 1.;
457 m_ntuple.hitBlock.residuals.fill(sign * prd.localPosition()[Trk::locX], Amg::error(prd.localCovariance(), Trk::locX), expos,
458 expos_err);
459
460 return true;
461 }
462
463 void MuonRecoValidationTool::extract(const MuonSegment& segment, std::set<Identifier>& ids,
464 std::vector<const MuonClusterOnTrack*>& clusters) const {
465 // loop over hits and extract clusters and ids
466 std::vector<const Trk::MeasurementBase*>::const_iterator mit = segment.containedMeasurements().begin();
467 std::vector<const Trk::MeasurementBase*>::const_iterator mit_end = segment.containedMeasurements().end();
468 for (; mit != mit_end; ++mit) {
469 // get Identifier and remove MDT hits
470 Identifier id = m_edmHelperSvc->getIdentifier(**mit);
471 if (!id.is_valid()) continue;
472 ids.insert(id);
473 if (!m_idHelperSvc->isTrigger(id)) continue;
474
475 // cast to MuonClusterOnTrack
476 const MuonClusterOnTrack* clus = dynamic_cast<const MuonClusterOnTrack*>(*mit);
477 if (clus)
478 clusters.push_back(clus);
479 else {
480 const CompetingMuonClustersOnTrack* crot = dynamic_cast<const CompetingMuonClustersOnTrack*>(*mit);
481 if (!crot || crot->containedROTs().empty()) continue;
482 clusters.insert(clusters.end(), crot->containedROTs().begin(), crot->containedROTs().end());
483 }
484 }
485 }
486
487 bool MuonRecoValidationTool::addMuonCandidate(const xAOD::TrackParticle& indetTrackParticle, const MuonCandidate* candidate,
488 Trk::Track* combinedTrack, int ntimes, float beta, float chi2ndof, int stage) const {
489 auto pos = std::find(m_trackParticles.begin(), m_trackParticles.end(), &indetTrackParticle);
490 if (pos == m_trackParticles.end()) {
491 ATH_MSG_WARNING("addMuonCandidate: indetTrackParticle not found ");
492 return false;
493 }
494
495 m_ntuple.candidateBlock.track.fill(std::distance(m_trackParticles.begin(), pos));
496 int nprec = 0;
497 int ntrigPhi = 0;
498 int ntrigEta = 0;
499 int nseg = candidate ? candidate->layerIntersections.size() : 0;
500 const Trk::Track* track = combinedTrack;
501 if (combinedTrack) {
502 IMuonHitSummaryTool::CompactSummary summary = m_hitSummaryTool->summary(*track);
503 nprec = summary.nprecisionLayers;
504 ntrigPhi = summary.nphiLayers;
505 ntrigEta = summary.ntrigEtaLayers;
506 }
507 m_ntuple.candidateBlock.fill(ntimes, beta, chi2ndof, nseg, nprec, ntrigPhi, ntrigEta, stage);
508 return true;
509 }
510
511} // namespace Muon
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Helper class to provide constant type-safe access to aux data.
static Double_t t0
int sign(int a)
#define max(a, b)
Definition cfImp.cxx:41
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Class for competing MuonClusters, it extends the Trk::CompetingRIOsOnTrack base class.
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
float calculateTof(float beta, float dist)
Base class for Muon cluster RIO_OnTracks.
virtual const Amg::Vector3D & globalPosition() const override
Returns global position.
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
bool addTimeMeasurements(const xAOD::TrackParticle &indetTrackParticle, const MuGirlNS::StauHits &stauHits) const override
add StauHits to ntuple
ToolHandle< IMuTagMatchingTool > m_matchingTool
std::atomic< unsigned int > m_candidateCounter
ToolHandle< Trk::IExtrapolator > m_extrapolator
MuonRecoValidationTool(const std::string &, const std::string &, const IInterface *)
default AlgTool constructor
std::vector< const xAOD::TrackParticle * > m_trackParticles
ToolHandle< IMuonSegmentHitSummaryTool > m_segmentHitSummaryTool
bool addTimeMeasurement(const MuonSystemExtension::Intersection &intersection, const Trk::MeasurementBase &meas) const override
add a new time measurement
ServiceHandle< IIncidentSvc > m_incidentSvc
void extract(const MuonSegment &segment, std::set< Identifier > &ids, std::vector< const MuonClusterOnTrack * > &clusters) const
int getUniqueID(const std::set< Identifier > &ids) const
int getIndex(const MuonSystemExtension::Intersection &intersection) const
ToolHandle< IMuonHitTimingTool > m_hitTimingTool
bool add(const MuonSystemExtension::Intersection &intersection, const MuonSegment &segment, int stage) const override
add a new segment
ToolHandle< IMuonTruthSummaryTool > m_truthSummaryTool
ToolHandle< IMuonHitSummaryTool > m_hitSummaryTool
MuonInsideOutValidationNtuple m_ntuple
virtual void handle(const Incident &inc) override
incident service handle for EndEvent
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
bool addTrackParticle(const xAOD::TrackParticle &indetTrackParticle, const MuonSystemExtension &muonSystemExtention) const override
add a new TrackParticle with it's muon system extension
std::map< const Trk::TrackParameters *, unsigned int > m_trackParticleIndexLookup
virtual StatusCode initialize() override
initialize method, method taken from bass-class AlgTool
bool addMuonCandidate(const xAOD::TrackParticle &indetTrackParticle, const MuonCandidate *candidate, Trk::Track *combinedTrack, int ntimes, float beta, float chi2ndof, int stage) const override
add a new muon candidate
This is the common class for 3D segments used in the muon spectrometer.
virtual const Amg::Vector3D & globalPosition() const override final
global position
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
Tracking class to hold the extrapolation from a particle from the calo entry to the end of muon syste...
const std::vector< Intersection > & layerIntersections() const
access to the intersections with the layers.
Class to represent calibrated clusters formed from RPC strips.
virtual const RpcPrepData * prepRawData() const override final
Returns the RpcPrepData - is a TRT_DriftCircle in this scope.
float time() const
Return the time (ns)
Class to represent RPC measurements.
Definition RpcPrepData.h:35
virtual const MuonGM::RpcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
This class is the pure abstract base class for all fittable tracking measurements.
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Identifier identify() const
return the identifier -extends MeasurementBase
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
float errorTime() const
access to the error on the measured time
float time() const
access to the measured time
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
float qOverP() const
Returns the parameter.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
int r
Definition globals.cxx:22
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr int INVALID_PARTICLE_ID
int uniqueID(const T &p)
std::vector< StauHit > StauHits
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
constexpr int toInt(const EnumType enumVal)
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
@ anyDirection
@ locX
Definition ParamDefs.h:37
@ loc1
Definition ParamDefs.h:34
Definition index.py:1
TrackParticle_v1 TrackParticle
Reference the current persistent version:
double segErrorXZ
error from segment on angle in non-bending plane
double segErrorY
error from segment on residual in bending plane
double dangleYZ
angular residual in the Local coordinate bending plane
double exErrorX
error from extrapolation on residual in non-bending plane
double exErrorY
error from extrapolation on residual in bending plane
double pullCY
pull on combined local position Y and angle YZ
double resY
residual track - segment in Local coordinate in bending plane
double exErrorXZ
error from extrapolation on angle in non-bending plane
double pullXZ
pull on angle in non-bending plane
double pullX
pull on residual in non-bending plane
double resCY
residual on combined local position Y and angle YZ
double pullYZ
pull on angle in bending plane
double segErrorX
error from segment on residual in non-bending plane
double segErrorYZ
error from segment on angle in bending plane
double exErrorYZ
error from extrapolation on angle in bending plane
double pullY
pull on residual in bending plane
double resX
residual track - segment in Local coordinate non-bending plane
double dangleXZ
angular residual in the Local coordinate non-bending plane
struct representing the maximum in the hough space
RegionDescriptor m_descriptor
simple struct holding the result of the tool
uint8_t nmdtHits() const
Returns the number of hits in both MDT layers.
uint8_t nmmHits() const
Returns the number of hits in the micromegas.
uint8_t nphiTrigHitLayers
Number of eta stereo hits.