ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuPatTrack Class Reference

track candidate object. More...

#include <MuPatTrack.h>

Inheritance diagram for Muon::MuPatTrack:
Collaboration diagram for Muon::MuPatTrack:

Public Types

enum  ProcessingStage {
  Unknown , InitialLoop , LayerRecovery , ExtendedWithSegment ,
  SegmentRecovery , FitRemovedSegment , RefitRemovedSegment , AmbiguityCreateCandidateFromSeeds ,
  AmbiguitySelectCandidates , MatchFail , FitFail , FitWorse ,
  UnassociatedEM , FitRemovedLayer , TrackSelector , KeptUntilEndOfCombi ,
  NumberOfProcessingStages
}
 enum to keep track of the life of candidates More...
using MeasVec = std::vector<const Trk::MeasurementBase*>

Public Member Functions

 MuPatTrack (const std::vector< MuPatSegment * > &segments, std::unique_ptr< Trk::Track > &track, MuPatSegment *seedSeg=0)
 constructor taking a vector of MuPatSegment object, the candidate takes ownership of the track It will increase the usedInFit counter of the MuPatSegment objects by one.
 MuPatTrack (MuPatSegment *segment, std::unique_ptr< Trk::Track > &track)
 constructor taking a MuPatSegment object, the candidate takes ownership of the track It will increase the usedInFit counter of the MuPatSegment objects by one.
 MuPatTrack (MuPatSegment *segment1, MuPatSegment *segment2, std::unique_ptr< Trk::Track > &track, MuPatSegment *seedSeg=0)
 constructor taking two MuPatSegment objects, the candidate takes ownership of the track It will increase the usedInFit counter of the MuPatSegment objects by one.
 ~MuPatTrack ()
 destructor, decrease the usedInFit counter of all MuPatSegment objects by one
 MuPatTrack (const MuPatTrack &can)
 copying constructor.
MuPatTrackoperator= (const MuPatTrack &can)
 assignment operator.
Trk::Tracktrack () const
 access to track
void updateTrack (std::unique_ptr< Trk::Track > &newTrack)
 update track.
const std::vector< MuPatSegment * > & segments () const
 access to segments
MuPatSegmentseedSegment () const
 Return pointer to the seed segment.
const std::vector< MuPatSegment * > & excludedSegments () const
 access to segments
void addSegment (MuPatSegment *segment, std::unique_ptr< Trk::Track > &newTrack)
 add segment + the associated new track.
void addExcludedSegment (MuPatSegment *segment)
 add segment that does not match the track
bool isSegmentExcluded (const MuPatSegment *segment) const
 loops over the excluded segment collection and checks whether the pointer is in there
const Trk::TrackParametersentryPars () const
 returns first track parameters
bool hasMomentum () const
 returns whether canditate has a momentum measurement
std::vector< MuonStationIndex::StIndexstationsInOrder ()
 returns vector with contained stationIndices in the order they were added
bool resetChambersOnCandidate (const std::set< MuonStationIndex::ChIndex > &chambers)
 reset chambers on the candidate.
std::string segmentNames () const
 string containing the names of the segments on the candidate
const MeasVecetaHits () const
 return all eta hits on the entry
const MeasVecphiHits () const
 return all phi hits on the entry
const MeasVecfakePhiHits () const
 return all fake phi hits on the entry
const MeasVechits () const
 return all hits on the entry.
bool hasSmallChamber () const
 returns whether entry contains a small chamber
bool hasLargeChamber () const
 returns whether entry contains a small chamber
bool hasSLOverlap () const
 returns whether there is at least one small/large overlap in the same station layer
bool hasEndcap () const
 returns whether the entry contains endcap hits
void hasEndcap (bool hasEC)
 set whether entry has endcap hits
const std::set< MuonStationIndex::StIndex > & stations () const
 returns set with contained stationIndices
const std::set< MuonStationIndex::ChIndex > & chambers () const
 returns set with contained chamberIndices
bool containsChamber (MuonStationIndex::ChIndex chIndex) const
 returns whether the ChamberIndex is already contained in candidate
bool containsStation (MuonStationIndex::StIndex chIndex) const
 returns whether the StationIndex is already contained in candidate
const MuPatHitListhitList () const
 returns a reference to the hit list
const std::set< Identifier > & chamberIds () const
 returns set with contained chamber ids
bool shareChambers (const MuPatCandidateBase &entry) const
 checks whether the two entries contain the same chamber
const Trk::MeasurementBaseaddToTrash (std::unique_ptr< const Trk::MeasurementBase > meas)
 adds the measurement to the garbage container.
void addToTrash (const std::vector< std::shared_ptr< const Trk::MeasurementBase > > &measurements)
const std::vector< std::shared_ptr< const Trk::MeasurementBase > > & garbage () const

Static Public Member Functions

static const std::string & processingStageString (ProcessingStage stage)
 Convert enum to string.
static unsigned int processingStageStringMaxLen ()
 maximum width of the strings corresponding to the ProcessingStage
static std::size_t numberOfInstantiations ()

Public Attributes

ProcessingStage created {Unknown}
ProcessingStage lastSegmentChange {Unknown}
unsigned int nmdtHitsMl1 {0}
 public hit counters
unsigned int nmdtHitsMl2 {0}
unsigned int ncscHitsEta {0}
unsigned int ncscHitsPhi {0}
unsigned int nrpcHitsEta {0}
unsigned int nrpcHitsPhi {0}
unsigned int ntgcHitsEta {0}
unsigned int ntgcHitsPhi {0}

Static Public Attributes

static std::atomic_size_t s_numberOfInstantiations

Protected Member Functions

void hasSmallChamber (bool hasSmall)
 set whether entry has small chamber
void hasLargeChamber (bool hasLarge)
 set whether entry has large chamber
void hasSLOverlap (bool hasSL)
 set whether entry has at least one small/large overlap in the same station layer
MuPatHitListhitList ()
 returns a reference to the hit list
std::set< Identifier > & chamberIds ()
 returns set with contained chamber ids
void setEtaHits (const MeasVec &hits)
 set eta hits on the entry
void setPhiHits (const MeasVec &hits)
 set phi hits on the entry
void setFakePhiHits (const MeasVec &hits)
 set fake phi hits on the entry
void setAllHits (const MeasVec &hits)
 set all hits on the entry
void clearChambers ()
 clear the list of contained chambers.
void addChamber (MuonStationIndex::ChIndex chIndex)
 add the chamber to the list of contained chambers.
void setChambers (const std::set< MuonStationIndex::ChIndex > &chambers)
 Set the list of chambers and update list of stations.

Protected Attributes

std::set< MuonStationIndex::ChIndexm_chambers
std::set< MuonStationIndex::StIndexm_stations
bool m_hasMomentum {false}

Private Member Functions

void updateSegments (bool add)
 update segment/track association, if add == true ,will add track to segments else remove it
void modifySegmentCounters (int change)
 increase the segment counters by the passed number

Static Private Member Functions

static std::vector< std::string > initProcessingStageStrings ()
 Initialize s_processingStageStrings & s_processingStageStringMaxLen.
static const std::vector< std::string > & processingStageStrings ()
 Return list of processing stage strings.
static bool hasMomentum (const Trk::Track &track)
 check whether track measures momentum

Private Attributes

std::vector< MuPatSegment * > m_segments {}
std::vector< MuPatSegment * > m_excludedSegments {}
std::unique_ptr< Trk::Trackm_track {}
MuPatSegmentm_seedSeg {nullptr}
 The special segment for this track.
MeasVec m_etaHits
MeasVec m_phiHits
MeasVec m_fakePhiHits
MeasVec m_allHits
MuPatHitList m_hitList
std::set< Identifierm_chamberIds
bool m_hasEndcap {false}
bool m_hasSmallChamber {false}
bool m_hasLargeChamber {false}
bool m_hasSLOverlap {false}
std::vector< std::shared_ptr< const Trk::MeasurementBase > > m_garbage {}

Friends

class MuPatCandidateTool

Detailed Description

track candidate object.

The purpose of the track candidate is three folded:

  • provide the generic MuPatCandidateBase interface for tracks
  • keep track of segments used to build track
  • cache additional information that cannot be stored on the track

The following information is cached:

  • the stage during the pattern recognition the candidate was made (Moore legacy)
  • the pointer to the track
  • a vector of the segments that were used to form the track
  • a vector of the segments that were already tested against the candidate but failed. This information can be used to speed up the pat-rec code by avoiding fits that were already tried.

Definition at line 37 of file MuPatTrack.h.

Member Typedef Documentation

◆ MeasVec

using Muon::MuPatCandidateBase::MeasVec = std::vector<const Trk::MeasurementBase*>
inherited

Definition at line 50 of file MuPatCandidateBase.h.

Member Enumeration Documentation

◆ ProcessingStage

enum to keep track of the life of candidates

Enumerator
Unknown 
InitialLoop 
LayerRecovery 
ExtendedWithSegment 
SegmentRecovery 
FitRemovedSegment 
RefitRemovedSegment 
AmbiguityCreateCandidateFromSeeds 
AmbiguitySelectCandidates 
MatchFail 
FitFail 
FitWorse 
UnassociatedEM 
FitRemovedLayer 
TrackSelector 
KeptUntilEndOfCombi 
NumberOfProcessingStages 

Definition at line 42 of file MuPatTrack.h.

42 {
43 Unknown,
53 FitFail,
60 };
@ AmbiguityCreateCandidateFromSeeds
Definition MuPatTrack.h:50

Constructor & Destructor Documentation

◆ MuPatTrack() [1/4]

Muon::MuPatTrack::MuPatTrack ( const std::vector< MuPatSegment * > & segments,
std::unique_ptr< Trk::Track > & track,
MuPatSegment * seedSeg = 0 )

constructor taking a vector of MuPatSegment object, the candidate takes ownership of the track It will increase the usedInFit counter of the MuPatSegment objects by one.

Definition at line 72 of file MuPatTrack.cxx.

72 :
74
75 m_track.swap(track);
76 // increase segment counters
79
80 // now update links between tracks and segments
81 updateSegments(true);
82
83 if (seedSeg){
84 m_seedSeg = seedSeg;
85 addToTrash(seedSeg->garbage());
86 } else if (!segments.empty())
88 for (MuPatSegment* seg : segments){
89 addToTrash(seg->garbage());
90 }
91 }
MuPatCandidateBase()=default
constructor.
const Trk::MeasurementBase * addToTrash(std::unique_ptr< const Trk::MeasurementBase > meas)
adds the measurement to the garbage container.
Trk::Track & track() const
access to track
Definition MuPatTrack.h:175
void updateSegments(bool add)
update segment/track association, if add == true ,will add track to segments else remove it
MuPatSegment * m_seedSeg
The special segment for this track.
Definition MuPatTrack.h:159
bool hasMomentum() const
returns whether canditate has a momentum measurement
void modifySegmentCounters(int change)
increase the segment counters by the passed number
std::vector< MuPatSegment * > m_segments
Definition MuPatTrack.h:156
std::unique_ptr< Trk::Track > m_track
Definition MuPatTrack.h:158
const std::vector< MuPatSegment * > & segments() const
access to segments
Definition MuPatTrack.h:167

◆ MuPatTrack() [2/4]

Muon::MuPatTrack::MuPatTrack ( MuPatSegment * segment,
std::unique_ptr< Trk::Track > & track )

constructor taking a MuPatSegment object, the candidate takes ownership of the track It will increase the usedInFit counter of the MuPatSegment objects by one.

Definition at line 93 of file MuPatTrack.cxx.

93 :
95 m_track.swap(track);
96
97 m_segments.reserve(3);
98 m_segments.push_back(segment);
99 addToTrash(segment->garbage());
100 // increase segment counters
103
104 // now update links between tracks and segments
105 updateSegments(true);
106
107 }

◆ MuPatTrack() [3/4]

Muon::MuPatTrack::MuPatTrack ( MuPatSegment * segment1,
MuPatSegment * segment2,
std::unique_ptr< Trk::Track > & track,
MuPatSegment * seedSeg = 0 )

constructor taking two MuPatSegment objects, the candidate takes ownership of the track It will increase the usedInFit counter of the MuPatSegment objects by one.

Definition at line 109 of file MuPatTrack.cxx.

109 :
111 m_track.swap(track);
112
113 m_segments.reserve(3);
114 m_segments.push_back(segment1);
115 m_segments.push_back(segment2);
116 // increase segment counters
119
120 // now update links between tracks and segments
121 updateSegments(true);
122
123 m_excludedSegments.clear();
124 if (seedSeg)
125 m_seedSeg = seedSeg;
126 else
127 m_seedSeg = segment1 ? segment1 : segment2;
128 for (MuPatSegment* seg : {segment1, segment2, seedSeg}) {
129 if (seg) addToTrash(seg->garbage());
130 }
131 }
std::vector< MuPatSegment * > m_excludedSegments
Definition MuPatTrack.h:157

◆ ~MuPatTrack()

Muon::MuPatTrack::~MuPatTrack ( )

destructor, decrease the usedInFit counter of all MuPatSegment objects by one

Definition at line 133 of file MuPatTrack.cxx.

133 {
134 // now update links between tracks and segments
135 updateSegments(false);
136 }

◆ MuPatTrack() [4/4]

Muon::MuPatTrack::MuPatTrack ( const MuPatTrack & can)

copying constructor.

It will not copy the track, just its pointer (lazy). It will increase the usedInFit counter of the MuPatSegment objects by one.

Definition at line 138 of file MuPatTrack.cxx.

138 :
140 Trk::ObjectCounter<MuPatTrack>(can),
141 created(can.created),
142 lastSegmentChange(can.lastSegmentChange),
143 m_segments(can.m_segments),
144 m_excludedSegments(can.m_excludedSegments),
145 m_track (std::make_unique<Trk::Track>(can.track())),
146 m_seedSeg(can.m_seedSeg) {
147 m_hasMomentum = can.m_hasMomentum;
148 // increase segment counters
150
151 // now update links between tracks and segments
152 updateSegments(true);
153 }
ProcessingStage created
Definition MuPatTrack.h:144
ProcessingStage lastSegmentChange
Definition MuPatTrack.h:145

Member Function Documentation

◆ addChamber()

void Muon::MuPatCandidateBase::addChamber ( MuonStationIndex::ChIndex chIndex)
protectedinherited

add the chamber to the list of contained chambers.

Will also add the corresponding station.

Definition at line 38 of file MuPatCandidateBase.cxx.

38 {
39 m_chambers.insert(chIndex);
41 }
std::set< MuonStationIndex::StIndex > m_stations
std::set< MuonStationIndex::ChIndex > m_chambers
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex

◆ addExcludedSegment()

void Muon::MuPatTrack::addExcludedSegment ( MuPatSegment * segment)

add segment that does not match the track

Definition at line 212 of file MuPatTrack.cxx.

212{ m_excludedSegments.push_back(segment); }

◆ addSegment()

void Muon::MuPatTrack::addSegment ( MuPatSegment * segment,
std::unique_ptr< Trk::Track > & newTrack )

add segment + the associated new track.

Takes ownership of the track.

Definition at line 216 of file MuPatTrack.cxx.

216 {
217 // add segment and increase counter
218 m_segments.push_back(segment);
219 addToTrash(segment->garbage());
220 segment->addTrack(this);
221 ++segment->usedInFit;
222 for (const MuonStationIndex::ChIndex& chit : segment->chambers()) addChamber(chit);
223
224 if (newTrack) {
225 // delete old track, assign new
226 m_track.swap(newTrack);
227 }
229 }
void addChamber(MuonStationIndex::ChIndex chIndex)
add the chamber to the list of contained chambers.
ChIndex
enum to classify the different chamber layers in the muon spectrometer

◆ addToTrash() [1/2]

void Muon::MuPatCandidateBase::addToTrash ( const std::vector< std::shared_ptr< const Trk::MeasurementBase > > & measurements)
inherited

Definition at line 97 of file MuPatCandidateBase.cxx.

97 {
98 if (m_garbage.capacity() < measurements.size() + m_garbage.size()){
99 m_garbage.reserve(measurements.size() + m_garbage.size());
100 }
101 m_garbage.insert(m_garbage.end(), measurements.begin(), measurements.end());
102 }
std::vector< std::shared_ptr< const Trk::MeasurementBase > > m_garbage

◆ addToTrash() [2/2]

const Trk::MeasurementBase * Muon::MuPatCandidateBase::addToTrash ( std::unique_ptr< const Trk::MeasurementBase > meas)
inherited

adds the measurement to the garbage container.

Definition at line 92 of file MuPatCandidateBase.cxx.

93 {
94 m_garbage.push_back(std::move(meas));
95 return m_garbage.back().get();
96 }

◆ chamberIds() [1/2]

std::set< Identifier > & Muon::MuPatCandidateBase::chamberIds ( )
protectedinherited

returns set with contained chamber ids

Definition at line 36 of file MuPatCandidateBase.cxx.

36{ return m_chamberIds; }
std::set< Identifier > m_chamberIds

◆ chamberIds() [2/2]

const std::set< Identifier > & Muon::MuPatCandidateBase::chamberIds ( ) const
inherited

returns set with contained chamber ids

Definition at line 33 of file MuPatCandidateBase.cxx.

33{ return m_chamberIds; }

◆ chambers()

const std::set< MuonStationIndex::ChIndex > & Muon::MuPatCandidateBase::chambers ( ) const
inherited

returns set with contained chamberIndices

Definition at line 31 of file MuPatCandidateBase.cxx.

31{ return m_chambers; }

◆ clearChambers()

void Muon::MuPatCandidateBase::clearChambers ( )
protectedinherited

clear the list of contained chambers.

Will also clear the list of contained stations and list of chamber Ids.

Definition at line 83 of file MuPatCandidateBase.cxx.

83 {
84 m_chambers.clear();
85 m_stations.clear();
86 m_chamberIds.clear();
87 }

◆ containsChamber()

bool Muon::MuPatCandidateBase::containsChamber ( MuonStationIndex::ChIndex chIndex) const
inherited

returns whether the ChamberIndex is already contained in candidate

Definition at line 75 of file MuPatCandidateBase.cxx.

75 {
76 return m_chambers.find(chIndex) != m_chambers.end();
77 }

◆ containsStation()

bool Muon::MuPatCandidateBase::containsStation ( MuonStationIndex::StIndex chIndex) const
inherited

returns whether the StationIndex is already contained in candidate

Definition at line 79 of file MuPatCandidateBase.cxx.

79 {
80 return m_stations.find(stIndex) != m_stations.end();
81 }

◆ entryPars()

const Trk::TrackParameters & Muon::MuPatTrack::entryPars ( ) const
inlinevirtual

returns first track parameters

Implements Muon::MuPatCandidateBase.

Definition at line 177 of file MuPatTrack.h.

177 {
178 const Trk::Perigee* pp = m_track->perigeeParameters();
179 if (pp) { return *pp; }
180 assert(!m_track->trackParameters() || m_track->trackParameters()->empty());
181 return *m_track->trackParameters()->front();
182 }
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee

◆ etaHits()

const MeasVec & Muon::MuPatCandidateBase::etaHits ( ) const
inherited

return all eta hits on the entry

◆ excludedSegments()

const std::vector< MuPatSegment * > & Muon::MuPatTrack::excludedSegments ( ) const
inline

access to segments

Definition at line 173 of file MuPatTrack.h.

173{ return m_excludedSegments; }

◆ fakePhiHits()

const MuPatCandidateBase::MeasVec & Muon::MuPatCandidateBase::fakePhiHits ( ) const
inherited

return all fake phi hits on the entry

Definition at line 59 of file MuPatCandidateBase.cxx.

◆ garbage()

const std::vector< std::shared_ptr< const Trk::MeasurementBase > > & Muon::MuPatCandidateBase::garbage ( ) const
inherited

Definition at line 103 of file MuPatCandidateBase.cxx.

103{return m_garbage;}

◆ hasEndcap() [1/2]

bool Muon::MuPatCandidateBase::hasEndcap ( ) const
inherited

returns whether the entry contains endcap hits

Definition at line 71 of file MuPatCandidateBase.cxx.

◆ hasEndcap() [2/2]

void Muon::MuPatCandidateBase::hasEndcap ( bool hasEC)
inherited

set whether entry has endcap hits

Definition at line 73 of file MuPatCandidateBase.cxx.

73{ m_hasEndcap = hasEC; }

◆ hasLargeChamber() [1/2]

bool Muon::MuPatCandidateBase::hasLargeChamber ( ) const
inherited

returns whether entry contains a small chamber

Definition at line 45 of file MuPatCandidateBase.cxx.

◆ hasLargeChamber() [2/2]

void Muon::MuPatCandidateBase::hasLargeChamber ( bool hasLarge)
protectedinherited

set whether entry has large chamber

Definition at line 51 of file MuPatCandidateBase.cxx.

51{ m_hasLargeChamber = hasLarge; }

◆ hasMomentum() [1/2]

bool Muon::MuPatTrack::hasMomentum ( ) const

returns whether canditate has a momentum measurement

Definition at line 186 of file MuPatTrack.cxx.

186 {
187 if (!m_track) return false;
188 return hasMomentum(*m_track);
189 }

◆ hasMomentum() [2/2]

bool Muon::MuPatTrack::hasMomentum ( const Trk::Track & track)
staticprivate

check whether track measures momentum

Definition at line 191 of file MuPatTrack.cxx.

191 {
192 // use track info if set properly
193 if (track.info().trackProperties(Trk::TrackInfo::StraightTrack)) return false;
194
195 bool hasMom = false;
196 const Trk::Perigee* pp = track.perigeeParameters();
197 if (pp) {
198 const AmgSymMatrix(5)* cov = pp->covariance();
199 if (cov) {
200 // sum covariance terms of momentum, use it to determine whether fit was SL fit
201 double momCov = 0.;
202 for (int i = 0; i < 4; ++i) momCov += std::abs((*cov)(4, i));
203 for (int i = 0; i < 4; ++i) momCov += std::abs((*cov)(i, 4));
204 if (momCov > 1e-10) { hasMom = true; }
205 }
206 }
207 return hasMom;
208 }
#define AmgSymMatrix(dim)

◆ hasSLOverlap() [1/2]

bool Muon::MuPatCandidateBase::hasSLOverlap ( ) const
inherited

returns whether there is at least one small/large overlap in the same station layer

Definition at line 47 of file MuPatCandidateBase.cxx.

◆ hasSLOverlap() [2/2]

void Muon::MuPatCandidateBase::hasSLOverlap ( bool hasSL)
protectedinherited

set whether entry has at least one small/large overlap in the same station layer

Definition at line 53 of file MuPatCandidateBase.cxx.

53{ m_hasSLOverlap = hasSL; }

◆ hasSmallChamber() [1/2]

bool Muon::MuPatCandidateBase::hasSmallChamber ( ) const
inherited

returns whether entry contains a small chamber

Definition at line 43 of file MuPatCandidateBase.cxx.

◆ hasSmallChamber() [2/2]

void Muon::MuPatCandidateBase::hasSmallChamber ( bool hasSmall)
protectedinherited

set whether entry has small chamber

Definition at line 49 of file MuPatCandidateBase.cxx.

49{ m_hasSmallChamber = hasSmall; }

◆ hitList() [1/2]

MuPatHitList & Muon::MuPatCandidateBase::hitList ( )
inlineprotectedinherited

returns a reference to the hit list

Definition at line 145 of file MuPatCandidateBase.h.

145{ return m_hitList; }

◆ hitList() [2/2]

const MuPatHitList & Muon::MuPatCandidateBase::hitList ( ) const
inlineinherited

returns a reference to the hit list

Definition at line 108 of file MuPatCandidateBase.h.

108{ return m_hitList; }

◆ hits()

const MuPatCandidateBase::MeasVec & Muon::MuPatCandidateBase::hits ( ) const
inherited

return all hits on the entry.

(Does not including the fake phi hits)

Definition at line 61 of file MuPatCandidateBase.cxx.

◆ initProcessingStageStrings()

std::vector< std::string > Muon::MuPatTrack::initProcessingStageStrings ( )
staticprivate

Initialize s_processingStageStrings & s_processingStageStringMaxLen.

Definition at line 30 of file MuPatTrack.cxx.

30 {
31 std::vector<std::string> pss;
32 pss.resize(NumberOfProcessingStages + 1);
33 pss[Unknown] = "Unknown";
34 pss[InitialLoop] = "InitialLoop";
35 pss[LayerRecovery] = "LayerRecov";
36 pss[ExtendedWithSegment] = "ExtWSegment";
37 pss[SegmentRecovery] = "SegmentRecov";
38 pss[FitRemovedSegment] = "FitRmSegment";
39 pss[RefitRemovedSegment] = "RefitRmSegment";
40 pss[AmbiguityCreateCandidateFromSeeds] = "AmbiCreate";
41 pss[AmbiguitySelectCandidates] = "AmbiSelect";
42 pss[MatchFail] = "MatchFail";
43 pss[FitFail] = "FitFail";
44 pss[FitWorse] = "FitWorse";
45 pss[UnassociatedEM] = "UnassocEM";
46 pss[FitRemovedLayer] = "FitRmLayer";
47 pss[TrackSelector] = "TrackSelect";
48 pss[KeptUntilEndOfCombi] = "--KEPT--";
49 pss[NumberOfProcessingStages] = "OutOfBounds";
50
51 return pss;
52 }

◆ isSegmentExcluded()

bool Muon::MuPatTrack::isSegmentExcluded ( const MuPatSegment * segment) const

loops over the excluded segment collection and checks whether the pointer is in there

Definition at line 213 of file MuPatTrack.cxx.

213 {
214 return std::find(m_excludedSegments.begin(), m_excludedSegments.end(), segment) != m_excludedSegments.end();
215 }

◆ modifySegmentCounters()

void Muon::MuPatTrack::modifySegmentCounters ( int change)
private

increase the segment counters by the passed number

Definition at line 231 of file MuPatTrack.cxx.

231 {
232 // modify usedInFit counter of segment
233 for (MuPatSegment* seg : m_segments) {
234 for (const MuonStationIndex::ChIndex& chit : seg->chambers()) addChamber(chit);
235 seg->usedInFit += change;
236 }
237 }

◆ numberOfInstantiations()

std::size_t Trk::ObjectCounter< MuPatTrack >::numberOfInstantiations ( )
inlinestaticinherited

Definition at line 25 of file TrkObjectCounter.h.

26 {
27#ifndef NDEBUG
28 return s_numberOfInstantiations.load();
29#endif
30 return 0;
31 }
Helper to enable counting number of instantiations in debug builds.

◆ operator=()

MuPatTrack & Muon::MuPatTrack::operator= ( const MuPatTrack & can)

assignment operator.

It will not copy the track, just its pointer (lazy). It will increase the usedInFit counter of the MuPatSegment objects by one.

Definition at line 155 of file MuPatTrack.cxx.

155 {
156 if (&can != this) {
157
158 // now update links between tracks and segments, remove old links
159 updateSegments(false);
160
161 // decrease old segment counters
163
164 // copy members
165 MuPatCandidateBase::operator=(can);
166 created = can.created;
167 lastSegmentChange = can.lastSegmentChange;
168 m_segments = can.m_segments;
169 m_excludedSegments = can.m_excludedSegments;
170
171 m_track = std::make_unique<Trk::Track>(can.track());
172 m_chambers = can.m_chambers;
173 m_stations = can.m_stations;
174 m_hasMomentum = can.m_hasMomentum;
175 m_seedSeg = can.m_seedSeg;
176
177 // increase new segment counters
179
180 // now update links between tracks and segments, add new segments
181 updateSegments(true);
182 }
183 return *this;
184 }

◆ phiHits()

const MuPatCandidateBase::MeasVec & Muon::MuPatCandidateBase::phiHits ( ) const
inherited

return all phi hits on the entry

Definition at line 57 of file MuPatCandidateBase.cxx.

◆ processingStageString()

const std::string & Muon::MuPatTrack::processingStageString ( MuPatTrack::ProcessingStage stage)
static

Convert enum to string.

Definition at line 61 of file MuPatTrack.cxx.

61 {
62 const std::vector<std::string>& pss = processingStageStrings();
63
64 if (static_cast<size_t>(stage) < pss.size()) {
65 return pss[static_cast<size_t>(stage)];
66 } else {
67 return pss[NumberOfProcessingStages];
68 }
69 }
static const std::vector< std::string > & processingStageStrings()
Return list of processing stage strings.

◆ processingStageStringMaxLen()

unsigned int Muon::MuPatTrack::processingStageStringMaxLen ( )
static

maximum width of the strings corresponding to the ProcessingStage

Definition at line 16 of file MuPatTrack.cxx.

16 {
17 static const unsigned int maxlen = []() -> unsigned int {
18 const std::vector<std::string>& pss = processingStageStrings();
19 auto it = std::max_element(pss.begin(), pss.end(),
20 [](const std::string& lhs, const std::string& rhs) { return lhs.size() < rhs.size(); });
21
22 if (it != pss.end())
23 return it->size();
24 return 0u;
25 }();
26
27 return maxlen;
28 }
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ processingStageStrings()

const std::vector< std::string > & Muon::MuPatTrack::processingStageStrings ( )
staticprivate

Return list of processing stage strings.

Definition at line 54 of file MuPatTrack.cxx.

55 {
56 static const std::vector<std::string> processingStrings =
58 return processingStrings;
59 }
static std::vector< std::string > initProcessingStageStrings()
Initialize s_processingStageStrings & s_processingStageStringMaxLen.

◆ resetChambersOnCandidate()

bool Muon::MuPatTrack::resetChambersOnCandidate ( const std::set< MuonStationIndex::ChIndex > & chambers)

reset chambers on the candidate.

Return whether segments were removed.

Definition at line 239 of file MuPatTrack.cxx.

239 {
240 // loop over input chambers, check whether segments have a chamber in the list
241 // remove segment if not in the list
242 setChambers(chambers); // also updates station list
243
244 bool bRemovedSegments = false;
245 std::vector<MuPatSegment*>::iterator it = m_segments.begin();
246 // NOTE: can not cache m_segments.end() because it may change in the loop
247 while (it != m_segments.end()) {
248 bool inChamberSet = false;
249 for (const MuonStationIndex::ChIndex& chit : (*it)->chambers()) {
250 if (containsChamber(chit)) {
251 inChamberSet = true;
252 break;
253 }
254 }
255 if (inChamberSet) {
256 ++it;
257 } else {
258 (*it)->removeTrack(this);
259 bRemovedSegments = true;
260 it = m_segments.erase(it); // it points to next element
261 }
262 }
263
264 return bRemovedSegments;
265 }
void setChambers(const std::set< MuonStationIndex::ChIndex > &chambers)
Set the list of chambers and update list of stations.
bool containsChamber(MuonStationIndex::ChIndex chIndex) const
returns whether the ChamberIndex is already contained in candidate
const std::set< MuonStationIndex::ChIndex > & chambers() const
returns set with contained chamberIndices

◆ seedSegment()

MuPatSegment * Muon::MuPatTrack::seedSegment ( ) const
inline

Return pointer to the seed segment.

Definition at line 169 of file MuPatTrack.h.

169 {
170 return m_seedSeg; // could be a null pointer - do not dereference immediately!!
171 }

◆ segmentNames()

std::string Muon::MuPatTrack::segmentNames ( ) const

string containing the names of the segments on the candidate

Remove the trailing white space

Definition at line 274 of file MuPatTrack.cxx.

274 {
275 std::string names;
276 // rest with spaces
277 for (const MuPatSegment* seg : m_segments) {
278 names += seg->name;
279 names += " ";
280 }
282 return names.substr(0, names.size() - 1);
283 }

◆ segments()

const std::vector< MuPatSegment * > & Muon::MuPatTrack::segments ( ) const
inline

access to segments

Definition at line 167 of file MuPatTrack.h.

167{ return m_segments; }

◆ setAllHits()

void Muon::MuPatCandidateBase::setAllHits ( const MeasVec & hits)
protectedinherited

set all hits on the entry

Definition at line 69 of file MuPatCandidateBase.cxx.

69{ m_allHits = hits; }
const MeasVec & hits() const
return all hits on the entry.

◆ setChambers()

void Muon::MuPatCandidateBase::setChambers ( const std::set< MuonStationIndex::ChIndex > & chambers)
protectedinherited

Set the list of chambers and update list of stations.

Definition at line 14 of file MuPatCandidateBase.cxx.

14 {
16 m_stations.clear();
18 }

◆ setEtaHits()

void Muon::MuPatCandidateBase::setEtaHits ( const MeasVec & hits)
protectedinherited

set eta hits on the entry

Definition at line 63 of file MuPatCandidateBase.cxx.

◆ setFakePhiHits()

void Muon::MuPatCandidateBase::setFakePhiHits ( const MeasVec & hits)
protectedinherited

set fake phi hits on the entry

Definition at line 67 of file MuPatCandidateBase.cxx.

◆ setPhiHits()

void Muon::MuPatCandidateBase::setPhiHits ( const MeasVec & hits)
protectedinherited

set phi hits on the entry

Definition at line 65 of file MuPatCandidateBase.cxx.

65{ m_phiHits = hits; }

◆ shareChambers()

bool Muon::MuPatCandidateBase::shareChambers ( const MuPatCandidateBase & entry) const
inherited

checks whether the two entries contain the same chamber

Definition at line 20 of file MuPatCandidateBase.cxx.

20 {
21 std::vector<Identifier> intersection;
22 std::set_intersection(entry.chamberIds().begin(), entry.chamberIds().end(), chamberIds().begin(), chamberIds().end(),
23 std::back_inserter(intersection));
24
25 unsigned int intersectionSize = intersection.size();
26 return intersectionSize != 0;
27 }
const std::set< Identifier > & chamberIds() const
returns set with contained chamber ids
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)

◆ stations()

const std::set< MuonStationIndex::StIndex > & Muon::MuPatCandidateBase::stations ( ) const
inherited

returns set with contained stationIndices

Definition at line 29 of file MuPatCandidateBase.cxx.

29{ return m_stations; }

◆ stationsInOrder()

std::vector< MuonStationIndex::StIndex > Muon::MuPatTrack::stationsInOrder ( )

returns vector with contained stationIndices in the order they were added

Definition at line 267 of file MuPatTrack.cxx.

267 {
268 std::vector<MuonStationIndex::StIndex> stations;
269 stations.reserve(m_segments.size());
270 for (MuPatSegment* seg : m_segments) stations.push_back(seg->stIndex);
271 return stations;
272 }
const std::set< MuonStationIndex::StIndex > & stations() const
returns set with contained stationIndices

◆ track()

Trk::Track & Muon::MuPatTrack::track ( ) const
inline

access to track

Definition at line 175 of file MuPatTrack.h.

175{ return *m_track; }

◆ updateSegments()

void Muon::MuPatTrack::updateSegments ( bool add)
private

update segment/track association, if add == true ,will add track to segments else remove it

Definition at line 285 of file MuPatTrack.cxx.

285 {
286 for (MuPatSegment* seg : m_segments) {
287 if (add) {
288 seg->addTrack(this);
289 } else {
290 seg->removeTrack(this);
291 }
292 }
293 }
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55

◆ updateTrack()

void Muon::MuPatTrack::updateTrack ( std::unique_ptr< Trk::Track > & newTrack)

update track.

Candidate takes ownership of track.

Definition at line 210 of file MuPatTrack.cxx.

210{ m_track.swap(track); }

◆ MuPatCandidateTool

friend class MuPatCandidateTool
friend

Definition at line 38 of file MuPatTrack.h.

Member Data Documentation

◆ created

ProcessingStage Muon::MuPatTrack::created {Unknown}

Definition at line 144 of file MuPatTrack.h.

144{Unknown};

◆ lastSegmentChange

ProcessingStage Muon::MuPatTrack::lastSegmentChange {Unknown}

Definition at line 145 of file MuPatTrack.h.

145{Unknown};

◆ m_allHits

MeasVec Muon::MuPatCandidateBase::m_allHits
privateinherited

Definition at line 163 of file MuPatCandidateBase.h.

◆ m_chamberIds

std::set<Identifier> Muon::MuPatCandidateBase::m_chamberIds
privateinherited

Definition at line 167 of file MuPatCandidateBase.h.

◆ m_chambers

std::set<MuonStationIndex::ChIndex> Muon::MuPatCandidateBase::m_chambers
protectedinherited

Definition at line 170 of file MuPatCandidateBase.h.

◆ m_etaHits

MeasVec Muon::MuPatCandidateBase::m_etaHits
privateinherited

Definition at line 160 of file MuPatCandidateBase.h.

◆ m_excludedSegments

std::vector<MuPatSegment*> Muon::MuPatTrack::m_excludedSegments {}
private

Definition at line 157 of file MuPatTrack.h.

157{}; //<! list of associated segments

◆ m_fakePhiHits

MeasVec Muon::MuPatCandidateBase::m_fakePhiHits
privateinherited

Definition at line 162 of file MuPatCandidateBase.h.

◆ m_garbage

std::vector<std::shared_ptr<const Trk::MeasurementBase> > Muon::MuPatCandidateBase::m_garbage {}
privateinherited

Definition at line 191 of file MuPatCandidateBase.h.

191{};

◆ m_hasEndcap

bool Muon::MuPatCandidateBase::m_hasEndcap {false}
privateinherited

Definition at line 186 of file MuPatCandidateBase.h.

186{false};

◆ m_hasLargeChamber

bool Muon::MuPatCandidateBase::m_hasLargeChamber {false}
privateinherited

Definition at line 188 of file MuPatCandidateBase.h.

188{false};

◆ m_hasMomentum

bool Muon::MuPatCandidateBase::m_hasMomentum {false}
protectedinherited

Definition at line 172 of file MuPatCandidateBase.h.

172{false};

◆ m_hasSLOverlap

bool Muon::MuPatCandidateBase::m_hasSLOverlap {false}
privateinherited

Definition at line 189 of file MuPatCandidateBase.h.

189{false};

◆ m_hasSmallChamber

bool Muon::MuPatCandidateBase::m_hasSmallChamber {false}
privateinherited

Definition at line 187 of file MuPatCandidateBase.h.

187{false};

◆ m_hitList

MuPatHitList Muon::MuPatCandidateBase::m_hitList
privateinherited

Definition at line 165 of file MuPatCandidateBase.h.

◆ m_phiHits

MeasVec Muon::MuPatCandidateBase::m_phiHits
privateinherited

Definition at line 161 of file MuPatCandidateBase.h.

◆ m_seedSeg

MuPatSegment* Muon::MuPatTrack::m_seedSeg {nullptr}
private

The special segment for this track.

Definition at line 159 of file MuPatTrack.h.

159{nullptr};

◆ m_segments

std::vector<MuPatSegment*> Muon::MuPatTrack::m_segments {}
private

Definition at line 156 of file MuPatTrack.h.

156{}; //<! list of associated segments

◆ m_stations

std::set<MuonStationIndex::StIndex> Muon::MuPatCandidateBase::m_stations
protectedinherited

Definition at line 171 of file MuPatCandidateBase.h.

◆ m_track

std::unique_ptr<Trk::Track> Muon::MuPatTrack::m_track {}
private

Definition at line 158 of file MuPatTrack.h.

158{}; //<! associated track

◆ ncscHitsEta

unsigned int Muon::MuPatCandidateBase::ncscHitsEta {0}
inherited

Definition at line 178 of file MuPatCandidateBase.h.

178{0};

◆ ncscHitsPhi

unsigned int Muon::MuPatCandidateBase::ncscHitsPhi {0}
inherited

Definition at line 179 of file MuPatCandidateBase.h.

179{0};

◆ nmdtHitsMl1

unsigned int Muon::MuPatCandidateBase::nmdtHitsMl1 {0}
inherited

public hit counters

Definition at line 176 of file MuPatCandidateBase.h.

176{0};

◆ nmdtHitsMl2

unsigned int Muon::MuPatCandidateBase::nmdtHitsMl2 {0}
inherited

Definition at line 177 of file MuPatCandidateBase.h.

177{0};

◆ nrpcHitsEta

unsigned int Muon::MuPatCandidateBase::nrpcHitsEta {0}
inherited

Definition at line 180 of file MuPatCandidateBase.h.

180{0};

◆ nrpcHitsPhi

unsigned int Muon::MuPatCandidateBase::nrpcHitsPhi {0}
inherited

Definition at line 181 of file MuPatCandidateBase.h.

181{0};

◆ ntgcHitsEta

unsigned int Muon::MuPatCandidateBase::ntgcHitsEta {0}
inherited

Definition at line 182 of file MuPatCandidateBase.h.

182{0};

◆ ntgcHitsPhi

unsigned int Muon::MuPatCandidateBase::ntgcHitsPhi {0}
inherited

Definition at line 183 of file MuPatCandidateBase.h.

183{0};

◆ s_numberOfInstantiations

std::atomic_size_t Trk::ObjectCounter< MuPatTrack >::s_numberOfInstantiations
inlinestaticinherited

Definition at line 22 of file TrkObjectCounter.h.


The documentation for this class was generated from the following files: