ATLAS Offline Software
Loading...
Searching...
No Matches
MuPatCandidateTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <cstdlib> // for std::abs( int )
8#include <set>
9#include <sstream>
10#include <string>
11
13#include "MuPatHitTool.h"
30#include "TrkTrack/Track.h"
31
32namespace Muon {
33
34 MuPatCandidateTool::MuPatCandidateTool(const std::string& t, const std::string& n, const IInterface* p) :
35 AthAlgTool(t, n, p) {
36 declareInterface<MuPatCandidateTool>(this);
37 }
38
40 ATH_CHECK(m_idHelperSvc.retrieve());
41 ATH_CHECK(m_mdtRotCreator.retrieve());
42 ATH_CHECK(m_cscRotCreator.retrieve(EnableTool{m_idHelperSvc->hasCSC()}));
43
45 ATH_CHECK(m_hitHandler.retrieve());
46 ATH_CHECK(m_edmHelperSvc.retrieve());
47 ATH_CHECK(m_printer.retrieve());
48 ATH_CHECK(m_segmentSelector.retrieve());
49
50 return StatusCode::SUCCESS;
51 }
52
53 std::unique_ptr<MuPatSegment> MuPatCandidateTool::createSegInfo(const EventContext& ctx, const MuonSegment& segment) const {
54 Identifier chid = m_edmHelperSvc->chamberId(segment);
55 if (m_idHelperSvc->isTrigger(chid)) {
56 ATH_MSG_WARNING("Trigger hit only segments not supported " << m_idHelperSvc->toStringChamber(chid));
57 return nullptr;
58 }
59 std::unique_ptr<MuPatSegment> info = std::make_unique<MuPatSegment>();
60 info->segment = &segment;
61 info->chid = chid;
62 info->chIndex = m_idHelperSvc->chamberIndex(info->chid);
63 std::set<Identifier> chIds = m_edmHelperSvc->chamberIds(segment);
64 for (const Identifier& id : chIds) {
65 MuonStationIndex::ChIndex chIdx = m_idHelperSvc->chamberIndex(id);
66 info->addChamber(chIdx);
67 // set default name
68 if (!info->name.empty()) info->name += "+";
69 // stationname_eta_phi
70 std::ostringstream oss;
71 oss << MuonStationIndex::chName(chIdx) << "_" << m_idHelperSvc->stationEta(id) << "_" << m_idHelperSvc->stationPhi(id);
72 info->name += oss.str();
73 }
74 info->stIndex = m_idHelperSvc->stationIndex(info->chid);
75 info->isEndcap = m_idHelperSvc->isEndcap(info->chid);
76 info->isMdt = m_idHelperSvc->isMdt(info->chid);
77 info->usedInFit = 0;
78 info->quality = m_segmentSelector->quality(segment);
79 info->segQuality = dynamic_cast<const MuonSegmentQuality*>(segment.fitQuality());
80
81 info->segPars.reset(m_edmHelperSvc->createTrackParameters(segment, 5000., 0.));
82 if (!info->segPars) { ATH_MSG_WARNING(" failed to create track parameter for segment "); }
83
84 updateHits(*info, info->segment->containedMeasurements(), m_doMdtRecreation, m_doCscRecreation, true);
85 m_hitHandler->create(ctx, segment, info->hitList());
86 return info;
87 }
88
89 bool MuPatCandidateTool::extendWithSegment(MuPatTrack& can, MuPatSegment& segInfo, std::unique_ptr<Trk::Track>& track) const {
90 // add segment to candidate
91 can.addSegment(&segInfo, track);
93 }
94
95 std::unique_ptr<MuPatTrack> MuPatCandidateTool::copyCandidate(MuPatTrack* canIn) {
96 // copy and update hits
97 std::unique_ptr<MuPatTrack> can = std::make_unique<MuPatTrack>(*canIn);
98 return can;
99 }
100
101 std::unique_ptr<MuPatTrack> MuPatCandidateTool::createCandidate(MuPatSegment& segInfo, std::unique_ptr<Trk::Track>& track) const {
102 // create the new candidate
103 std::unique_ptr<MuPatTrack> candidate = std::make_unique< MuPatTrack>(&segInfo, track);
105 return candidate;
106 }
107
108 bool MuPatCandidateTool::updateTrack(MuPatTrack& candidate, std::unique_ptr<Trk::Track>& track) const {
109 candidate.updateTrack(track);
110 return recalculateCandidateSegmentContent(candidate);
111 }
112
113 std::unique_ptr<MuPatTrack> MuPatCandidateTool::createCandidate(MuPatSegment& segInfo1, MuPatSegment& segInfo2,
114 std::unique_ptr<Trk::Track>& track) const {
115 // create the new candidate
116 std::unique_ptr<MuPatTrack> candidate = std::make_unique<MuPatTrack>(&segInfo1, &segInfo2, track);
118 return candidate;
119 }
120
121 std::unique_ptr<MuPatTrack> MuPatCandidateTool::createCandidate(std::unique_ptr<Trk::Track>& track) const {
122 // create a dummy segment vector
123 std::vector<MuPatSegment*> segments;
124
125 // create the new candidate
126 std::unique_ptr<MuPatTrack> candidate = std::make_unique<MuPatTrack>(segments, track);
128 return candidate;
129 }
130
132 bool recreateMDT, bool recreateCSC, bool createComp) const {
133 MeasVec etaHits{}, phiHits{}, fakePhiHits{}, allHits{};
134
135 unsigned int nmdtHitsMl1{0}, nmdtHitsMl2{0}, ncscHitsEta{0}, ncscHitsPhi{0}, nrpcHitsEta{0}, nrpcHitsPhi{0}, ntgcHitsEta{0},
136 ntgcHitsPhi{0};
137
138 entry.clearChambers(); // also clears stations and chamberIds
139
140 bool hasEndcap{false}, hasSmall{false}, hasLarge{false}, hassloverlap{false}, previssmall{false};
141 MuonStationIndex::StIndex prevstIndex = MuonStationIndex::StIndex::StUnknown;
142
144
145 // vector to store trigger hits in case we have special treatment for them
146 std::vector<const MuonClusterOnTrack*> triggerHitsPhi{}, triggerHitsEta{};
147
148 // loop over hits
149 bool is_first_meas = true;
150 for (const Trk::MeasurementBase* meas : measurements) {
151 Identifier id = m_edmHelperSvc->getIdentifier(*meas);
152 if (!id.is_valid()) {
153 fakePhiHits.push_back(meas);
154 continue;
155 }
156
157 // skip ID hits
158 if (!m_idHelperSvc->isMuon(id)) continue;
159
160 Identifier chId = m_idHelperSvc->chamberId(id);
161 MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
162 MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(chId);
163 if (!hasEndcap) hasEndcap = m_idHelperSvc->isEndcap(id);
164
165 bool measuresPhi = false;
166
167 bool isMdt = m_idHelperSvc->isMdt(id);
168 bool isCsc = m_idHelperSvc->isCsc(id);
169 bool isNSW = m_idHelperSvc->isMM(id) || m_idHelperSvc->issTgc(id);
170 // only add precision hits
171 if (isMdt || isCsc || isNSW) {
172 entry.addChamber(chIndex); // will also add stationIndex
173 entry.chamberIds().insert(chId);
174 }
175 if (isMdt) {
176 // if in MDT recreation mode, recreate MDT using ROT creator. Store the pointer as we have to delete it ourselfs.
177 if (recreateMDT) {
178 if (!m_doMdtRecreation) {
180 " recreation of MDTs requiered although not configured via jobO, ignoring request. Please check jobO ");
181 } else {
182 const auto* mdt = dynamic_cast<const MdtDriftCircleOnTrack*>(meas);
183 if (!mdt) {
184 ATH_MSG_WARNING(" found MdtDriftCircleOnTrack without MDT identifier " << m_idHelperSvc->toString(id));
185 continue;
186 }
187 ATH_MSG_DEBUG(" recreating MdtDriftCircleOnTrack ");
188 meas = entry.addToTrash
189 (std::unique_ptr<const MdtDriftCircleOnTrack>
190 (m_mdtRotCreator->createRIO_OnTrack(*mdt->prepRawData(), mdt->globalPosition())));
191 }
192 }
193
194 const bool isSmall = m_idHelperSvc->isSmallChamber(id);
195 hasSmall |= isSmall;
196 hasLarge |= !isSmall;
197
198 if (isSmall != previssmall && !is_first_meas && stIndex == prevstIndex) hassloverlap = true;
199
200 is_first_meas = false;
201 previssmall = isSmall;
202 prevstIndex = stIndex;
203
204 unsigned int ml = m_idHelperSvc->mdtIdHelper().multilayer(id);
205 nmdtHitsMl1 += (ml ==1);
206 nmdtHitsMl2 += (ml ==2);
207 } else {
208 measuresPhi = m_idHelperSvc->measuresPhi(id);
209
210 const bool isRpc = m_idHelperSvc->isRpc(id);
211 const bool isTgc = m_idHelperSvc->isTgc(id);
212 nrpcHitsPhi += (measuresPhi && isRpc);
213 nrpcHitsEta += (!measuresPhi && isRpc);
214
215 ntgcHitsPhi += (measuresPhi && isTgc);
216 ntgcHitsEta += (!measuresPhi && isTgc);
217
218 ncscHitsPhi+= (measuresPhi && isCsc);
219 ncscHitsEta+= (!measuresPhi && isCsc);
220 if (isCsc && recreateCSC) {
221 const auto* csc = dynamic_cast<const CscClusterOnTrack*>(meas);
222 if (!csc) {
223 ATH_MSG_WARNING(" found CscClusterOnTrack without CSC identifier " << m_idHelperSvc->toString(id));
224 continue;
225 }
226 ATH_MSG_DEBUG(" recreating CscClusterOnTrack ");
227 meas = entry.addToTrash
228 (std::unique_ptr<const MuonClusterOnTrack>
229 (m_cscRotCreator->createRIO_OnTrack(*csc->prepRawData(), csc->globalPosition())));
230 }
231
232
233 // if selected create competing ROTs for trigger hits
234 if (createComp && (isRpc || isTgc)) {
235 if (measuresPhi && m_createCompetingROTsPhi) {
236 addCluster(*meas, triggerHitsPhi);
237 continue;
238 } else if (!measuresPhi && m_createCompetingROTsEta) {
239 addCluster(*meas, triggerHitsEta);
240 continue;
241 }
242 }
243 }
244
245 allHits.push_back(meas);
246
247 if (measuresPhi) {
248 phiHits.push_back(meas);
249 } else {
250 etaHits.push_back(meas);
251 }
252 }
253
254 if (createComp) {
255 if (m_createCompetingROTsEta && !triggerHitsEta.empty()) createAndAddCompetingROTs(triggerHitsEta, etaHits, allHits, entry);
256 if (m_createCompetingROTsPhi && !triggerHitsPhi.empty()) createAndAddCompetingROTs(triggerHitsPhi, phiHits, allHits, entry);
257 }
258
259 entry.nmdtHitsMl1 = nmdtHitsMl1;
260 entry.nmdtHitsMl2 = nmdtHitsMl2;
261 entry.ncscHitsEta = ncscHitsEta;
262 entry.ncscHitsPhi = ncscHitsPhi;
263 entry.nrpcHitsEta = nrpcHitsEta;
264 entry.nrpcHitsPhi = nrpcHitsPhi;
265 entry.ntgcHitsEta = ntgcHitsEta;
266 entry.ntgcHitsPhi = ntgcHitsPhi;
267 if (!triggerHitsEta.empty() && etaHits.empty()) {
268 ATH_MSG_WARNING("did not find any eta hits");
269 }
270 entry.setEtaHits(etaHits);
271 if (!triggerHitsPhi.empty() && phiHits.empty()) {
272 ATH_MSG_WARNING("did not find any phi hits");
273 }
274 entry.setPhiHits(phiHits);
275 entry.setFakePhiHits(fakePhiHits);
276 entry.setAllHits(allHits);
277 entry.hasEndcap(hasEndcap);
278 entry.hasSmallChamber(hasSmall);
279 entry.hasLargeChamber(hasLarge);
280 entry.hasSLOverlap(hassloverlap);
281 }
282
283 void MuPatCandidateTool::addCluster(const Trk::MeasurementBase& meas, std::vector<const MuonClusterOnTrack*>& rots) const {
284 const MuonClusterOnTrack* clus = dynamic_cast<const MuonClusterOnTrack*>(&meas);
285 if (clus)
286 rots.push_back(clus);
287 else {
288 const CompetingMuonClustersOnTrack* compclus = dynamic_cast<const CompetingMuonClustersOnTrack*>(&meas);
289 if (compclus) {
290 std::ranges::transform(compclus->containedROTs(),std::back_inserter(rots), [](const auto& rot){
291 return rot.get();
292 });
293 } else {
294 Identifier id = m_edmHelperSvc->getIdentifier(meas);
295 ATH_MSG_WARNING(" Trigger Measurement is not a MuonClusterOnTrack or CompetingMuonClustersOnTrack!! "
296 << m_idHelperSvc->toString(id));
297 }
298 }
299 }
300
301 void MuPatCandidateTool::createAndAddCompetingROTs(const std::vector<const MuonClusterOnTrack*>& rots,
303 MuPatCandidateBase& trash_bin) const {
304 typedef std::map<Identifier, std::vector<const MuonClusterOnTrack*> > IdClusMap;
305 typedef IdClusMap::iterator IdClusIt;
306 IdClusMap idClusters;
307
308 // loop over hits and sort by detector element
309 for (const MuonClusterOnTrack* clus : rots) {
310 Identifier id = clus->identify();
311 Identifier detId = m_idHelperSvc->detElId(id);
312 idClusters[detId].push_back(clus);
313 }
314
315 ATH_MSG_DEBUG(" creating CompetingMuonClustersOnTrack for " << idClusters.size() << " chambers ");
316
317 IdClusIt chit = idClusters.begin();
318 IdClusIt chit_end = idClusters.end();
319 for (; chit != chit_end; ++chit) {
320 if (msgLvl(MSG::VERBOSE)) {
321 msg(MSG::VERBOSE )<<__FILE__<<":"<<__LINE__ << " in " << m_idHelperSvc->toStringDetEl(chit->first) << " clusters: " << chit->second.size()
322 << std::endl;
323 for (const MuonClusterOnTrack* cl_it : chit->second) {
324 msg(MSG::VERBOSE) << " " << m_idHelperSvc->toString(cl_it->identify());
325
326 // hack to get correct print-out
327 if (cl_it == chit->second.back())
328 msg(MSG::VERBOSE) << endmsg;
329 else
330 msg(MSG::VERBOSE) << std::endl;
331 }
332 }
333
334 if (chit->second.empty()) {
335 ATH_MSG_WARNING(" empty list, could not create CompetingMuonClustersOnTrack in chamber "
336 << m_idHelperSvc->toString(chit->first));
337 continue;
338 }
339
340 // only create competing ROT if there is more than one PRD
341 if (chit->second.size() == 1) {
342 hits.push_back(chit->second.front());
343 allHits.push_back(chit->second.front());
344 continue;
345 }
346
347 // create list of PRDs
348 std::list<const Trk::PrepRawData*> prds;
349 std::vector<const MuonClusterOnTrack*>::iterator cl_it = chit->second.begin();
350 std::vector<const MuonClusterOnTrack*>::iterator cl_it_end = chit->second.end();
351 for (; cl_it != cl_it_end; ++cl_it) {
352 const Trk::PrepRawData* prd = (*cl_it)->prepRawData();
353 if (prd) {
354 prds.push_back(prd);
355 } else {
356 ATH_MSG_WARNING("MuonClusterOnTrack has no PRD.");
357 }
358 }
359
360 std::unique_ptr<const CompetingMuonClustersOnTrack> comprot = m_compClusterCreator->createBroadCluster(prds, 0);
361 if (!comprot) {
362 ATH_MSG_WARNING(" could not create CompetingMuonClustersOnTrack in chamber " << m_idHelperSvc->toString(chit->first));
363 continue;
364 }
365 // cppcheck-suppress danglingLifetime
366 hits.push_back(comprot.get());
367 // cppcheck-suppress danglingLifetime
368 allHits.push_back(comprot.get());
369
370 // add to garbage collection
371 trash_bin.addToTrash(std::move(comprot));
372 }
373 }
374
376 // loop over track and get the chambers on the track
377 const Trk::TrackStates* states = candidate.track().trackStateOnSurfaces();
378 if (!states) return false;
379
380 std::set<MuonStationIndex::ChIndex> chambers;
381
382 // loop over TSOSs
383 for (const Trk::TrackStateOnSurface* tsos : *states) {
384 // only look at measurements
385 if (!tsos->type(Trk::TrackStateOnSurface::Measurement) || tsos->type(Trk::TrackStateOnSurface::Outlier)) continue;
386
387 // check whether state is a measurement
388 const Trk::MeasurementBase* meas = tsos->measurementOnTrack();
389 if (!meas) continue;
390
391 // get chamber index
392 Identifier id = m_edmHelperSvc->getIdentifier(*meas);
393 if (!id.is_valid() || !m_idHelperSvc->isMuon(id)) continue;
394
395 // don't include trigger hits
396 if (m_idHelperSvc->isTrigger(id)) continue;
397
398 chambers.insert(m_idHelperSvc->chamberIndex(id));
399
400 ATH_MSG_VERBOSE(" in recal " << m_idHelperSvc->toString(id));
401 }
402 if (msgLvl(MSG::VERBOSE)) {
403 ATH_MSG_VERBOSE(" recalculateCandidateSegmentContent, old chambers " << candidate.chambers().size() << " new chambers "
404 << chambers.size());
405 for (const MuonStationIndex::ChIndex& chit : candidate.chambers()) {
406 if (!chambers.count(chit)) { ATH_MSG_VERBOSE(" removing chamber index from candidate " << MuonStationIndex::chName(chit)); }
407 }
408 }
409
410 // reset chamber content
411 bool bRemovedSegments = candidate.resetChambersOnCandidate(chambers);
412
413 // recalculate hit list
414 candidate.hitList().clear();
415 m_hitHandler->create(candidate.track(), candidate.hitList());
416 // update the hit summary
417 updateHits(candidate, candidate.track().measurementsOnTrack()->stdcont());
418
419 ATH_MSG_VERBOSE("Print content after recalculateCandidateSegmentContent() -- "<<m_hitHandler->print(candidate.hitList()));
420
421 return bRemovedSegments;
422 }
423
424 std::set<const MuonGM::MuonReadoutElement*> MuPatCandidateTool::readoutElements(const MuPatCandidateBase& entry) const {
425 std::set<const MuonGM::MuonReadoutElement*> roEls;
426
427 MuPatHitCit it = entry.hitList().begin();
428 MuPatHitCit it_end = entry.hitList().end();
429 for (; it != it_end; ++it) {
430 if (!(*it)->info().id.is_valid()) continue;
431 // only want MDT or CSC detEls
432 if (!m_idHelperSvc->isMdt((*it)->info().id) && !m_idHelperSvc->isCsc((*it)->info().id)) continue;
433
434 const Trk::MeasurementBase& meas = (*it)->measurement();
435 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(&meas);
436 if (!rot) {
437 const CompetingMuonClustersOnTrack* crot = dynamic_cast<const CompetingMuonClustersOnTrack*>(&meas);
438 if (crot) {
439 if (!crot->containedROTs().empty()) {
440 rot = crot->containedROTs().front().get();
441 }
442 }
443 }
444 if (rot) {
445 const MuonGM::MuonReadoutElement* roEl = dynamic_cast<const MuonGM::MuonReadoutElement*>(rot->detectorElement());
446 if (roEl) roEls.insert(roEl);
447 }
448 }
449 return roEls;
450 }
451
452 std::string MuPatCandidateTool::print(const MuPatSegment& segment, int level) const {
453 std::ostringstream oss;
454 oss << segment.name << ": " << m_printer->print(*segment.segment) << " q " << segment.quality;
455 if (level == 0) return oss.str();
456
457 if (segment.hitList().size() >= 2) {
458 DistanceAlongParameters distCal{};
459 oss << " length " << distCal(segment.hitList().front(), segment.hitList().back());
460 }
461 oss << std::endl << m_hitHandler->print(segment.hitList(), true, false, false);
462 return oss.str();
463 }
464
465 std::string MuPatCandidateTool::print(const std::vector<MuPatSegment*>& segments, int level) const {
466 std::vector<MuPatSegment*>::const_iterator it = segments.begin();
467 std::vector<MuPatSegment*>::const_iterator it_end = segments.end();
468 std::ostringstream oss;
469 oss << " Segment candidate vector: " << segments.size();
470 for (; it != it_end; ++it) oss << std::endl << print(**it, level);
471
472 return oss.str();
473 }
474
475 std::string MuPatCandidateTool::print(const MuPatTrack& track, int level) const {
476 std::ostringstream oss;
477 oss << m_printer->print(track.track()) << std::endl << m_printer->printStations(track.track());
478
479 if (level == 0) return oss.str();
480
481 const std::vector<MuPatSegment*>& segs = track.segments();
482 oss << std::endl << print(segs, 0);
483
484 return oss.str();
485 }
486
487 std::string MuPatCandidateTool::print(const std::vector<std::unique_ptr<MuPatTrack> >& tracks, int level) const {
488 std::ostringstream oss;
489 oss << "MuPatTracks " << tracks.size() << std::endl;
490 std::vector<std::unique_ptr<MuPatTrack> >::const_iterator tit = tracks.begin();
491 std::vector<std::unique_ptr<MuPatTrack> >::const_iterator tit_end = tracks.end();
492 for (; tit != tit_end; ++tit) oss << " " << print(**tit, level) << std::endl;
493
494 return oss.str();
495 }
496
497 std::string MuPatCandidateTool::print(const MuPatCandidateBase& candidate, int level) const {
498 const MuPatSegment* seg = dynamic_cast<const MuPatSegment*>(&candidate);
499 if (seg) return print(*seg, level);
500
501 const MuPatTrack* track = dynamic_cast<const MuPatTrack*>(&candidate);
502 if (track) return print(*track, level);
503
504 return "Unknown candidate type";
505 }
506
507} // namespace Muon
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
const_iterator end() const
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
Class for competing MuonClusters, it extends the Trk::CompetingRIOsOnTrack base class.
const std::vector< std::unique_ptr< const MuonClusterOnTrack > > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
Class to represent the calibrated clusters created from CSC strips.
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
track candidate entry object.
const Trk::MeasurementBase * addToTrash(std::unique_ptr< const Trk::MeasurementBase > meas)
adds the measurement to the garbage container.
const MuPatHitList & hitList() const
returns a reference to the hit list
const std::set< MuonStationIndex::ChIndex > & chambers() const
returns set with contained chamberIndices
bool extendWithSegment(MuPatTrack &can, MuPatSegment &segInfo, std::unique_ptr< Trk::Track > &track) const
extend a track candidate with a segment
std::unique_ptr< MuPatSegment > createSegInfo(const EventContext &ctx, const MuonSegment &segment) const
create a MuPatSegment object from a segment
ToolHandle< IMuonClusterOnTrackCreator > m_cscRotCreator
std::vector< const Trk::MeasurementBase * > MeasVec
ToolHandle< MuPatHitTool > m_hitHandler
ToolHandle< IMuonCompetingClustersOnTrackCreator > m_compClusterCreator
void createAndAddCompetingROTs(const std::vector< const MuonClusterOnTrack * > &rots, MeasVec &hits, MeasVec &allHits, MuPatCandidateBase &entry) const
create CompetingMuonClustersOnTracks from ROTs and add them to the MeasVec.
Gaudi::Property< bool > m_createCompetingROTsPhi
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
std::unique_ptr< MuPatTrack > createCandidate(MuPatSegment &segInfo, std::unique_ptr< Trk::Track > &track) const
create a track candidate from one segment
ToolHandle< Muon::IMuonSegmentSelectionTool > m_segmentSelector
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
std::string print(const MuPatSegment &segment, int level=0) const
print the measurements on the track to string
static std::unique_ptr< MuPatTrack > copyCandidate(MuPatTrack *canIn)
copy a candidate without copying the track (lazy pointer copy)
virtual StatusCode initialize() override
initialize method, method taken from bass-class AlgTool
Gaudi::Property< bool > m_createCompetingROTsEta
Gaudi::Property< bool > m_doCscRecreation
bool updateTrack(MuPatTrack &candidate, std::unique_ptr< Trk::Track > &track) const
set the new track in the candidate, and update candidate contents.
PublicToolHandle< MuonEDMPrinterTool > m_printer
MuPatCandidateTool(const std::string &, const std::string &, const IInterface *)
default AlgTool constructor
std::set< const MuonGM::MuonReadoutElement * > readoutElements(const MuPatCandidateBase &entry) const
get list of the readout elements of the hits on the entry
bool recalculateCandidateSegmentContent(MuPatTrack &candidate) const
recalculate the chamber indices on the candidate and reset them.
void addCluster(const Trk::MeasurementBase &meas, std::vector< const MuonClusterOnTrack * > &rots) const
extract MuonClusterOnTrack('s) from measurement
Gaudi::Property< bool > m_doMdtRecreation
void updateHits(MuPatCandidateBase &entry, const MeasVec &measurements, bool recreateMDT=false, bool recreateCSC=false, bool createComp=false) const
update hits for a MuPatCandidateBase
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
segment candidate object.
const MuonSegment * segment
track candidate object.
Definition MuPatTrack.h:37
Trk::Track & track() const
access to track
Definition MuPatTrack.h:175
void updateTrack(std::unique_ptr< Trk::Track > &newTrack)
update track.
bool resetChambersOnCandidate(const std::set< MuonStationIndex::ChIndex > &chambers)
reset chambers on the candidate.
Base class for Muon cluster RIO_OnTracks.
This is the common muon segment quality object.
This is the common class for 3D segments used in the muon spectrometer.
magnetic field properties to steer the behavior of the extrapolation
This class is the pure abstract base class for all fittable tracking measurements.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
Identifier identify() const
return the identifier -extends MeasurementBase
const FitQuality * fitQuality() const
return the FitQuality object, returns NULL if no FitQuality is defined
represents the track state (measurement, material, fit parameters and quality) at a surface.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
StIndex
enum to classify the different station layers in the muon spectrometer
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
const std::string & chName(ChIndex index)
convert ChIndex into a string
ChIndex
enum to classify the different chamber layers in the muon spectrometer
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
MuPatHitList::const_iterator MuPatHitCit
Definition MuPatHit.h:27
DataVector< const Trk::TrackStateOnSurface > TrackStates