ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
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. More...
 
 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. More...
 
 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. More...
 
 ~MuPatTrack ()
 destructor, decrease the usedInFit counter of all MuPatSegment objects by one More...
 
 MuPatTrack (const MuPatTrack &can)
 copying constructor. More...
 
MuPatTrackoperator= (const MuPatTrack &can)
 assignment operator. More...
 
Trk::Tracktrack () const
 access to track More...
 
void updateTrack (std::unique_ptr< Trk::Track > &newTrack)
 update track. More...
 
const std::vector< MuPatSegment * > & segments () const
 access to segments More...
 
MuPatSegmentseedSegment () const
 Return pointer to the seed segment. More...
 
const std::vector< MuPatSegment * > & excludedSegments () const
 access to segments More...
 
void addSegment (MuPatSegment *segment, std::unique_ptr< Trk::Track > &newTrack)
 add segment + the associated new track. More...
 
void addExcludedSegment (MuPatSegment *segment)
 add segment that does not match the track More...
 
bool isSegmentExcluded (const MuPatSegment *segment) const
 loops over the excluded segment collection and checks whether the pointer is in there More...
 
const Trk::TrackParametersentryPars () const
 returns first track parameters More...
 
bool hasMomentum () const
 returns whether canditate has a momentum measurement More...
 
std::vector< MuonStationIndex::StIndexstationsInOrder ()
 returns vector with contained stationIndices in the order they were added More...
 
bool resetChambersOnCandidate (const std::set< MuonStationIndex::ChIndex > &chambers)
 reset chambers on the candidate. More...
 
std::string segmentNames () const
 string containing the names of the segments on the candidate More...
 
const MeasVecetaHits () const
 return all eta hits on the entry More...
 
const MeasVecphiHits () const
 return all phi hits on the entry More...
 
const MeasVecfakePhiHits () const
 return all fake phi hits on the entry More...
 
const MeasVechits () const
 return all hits on the entry. More...
 
bool hasSmallChamber () const
 returns whether entry contains a small chamber More...
 
bool hasLargeChamber () const
 returns whether entry contains a small chamber More...
 
bool hasSLOverlap () const
 returns whether there is at least one small/large overlap in the same station layer More...
 
bool hasEndcap () const
 returns whether the entry contains endcap hits More...
 
void hasEndcap (bool hasEC)
 set whether entry has endcap hits More...
 
const std::set< MuonStationIndex::StIndex > & stations () const
 returns set with contained stationIndices More...
 
const std::set< MuonStationIndex::ChIndex > & chambers () const
 returns set with contained chamberIndices More...
 
bool containsChamber (MuonStationIndex::ChIndex chIndex) const
 returns whether the ChamberIndex is already contained in candidate More...
 
bool containsStation (MuonStationIndex::StIndex chIndex) const
 returns whether the StationIndex is already contained in candidate More...
 
const MuPatHitListhitList () const
 returns a reference to the hit list More...
 
const std::set< Identifier > & chamberIds () const
 returns set with contained chamber ids More...
 
bool shareChambers (const MuPatCandidateBase &entry) const
 checks whether the two entries contain the same chamber More...
 
void addToTrash (std::unique_ptr< const Trk::MeasurementBase > meas)
 adds the measurement to the garbage container. More...
 
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. More...
 
static unsigned int processingStageStringMaxLen ()
 maximum width of the strings corresponding to the ProcessingStage More...
 
static std::size_t numberOfInstantiations ()
 

Public Attributes

ProcessingStage created {Unknown}
 
ProcessingStage lastSegmentChange {Unknown}
 
unsigned int nmdtHitsMl1 {0}
 public hit counters More...
 
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 More...
 
void hasLargeChamber (bool hasLarge)
 set whether entry has large chamber More...
 
void hasSLOverlap (bool hasSL)
 set whether entry has at least one small/large overlap in the same station layer More...
 
MuPatHitListhitList ()
 returns a reference to the hit list More...
 
std::set< Identifier > & chamberIds ()
 returns set with contained chamber ids More...
 
void setEtaHits (const MeasVec &hits)
 set eta hits on the entry More...
 
void setPhiHits (const MeasVec &hits)
 set phi hits on the entry More...
 
void setFakePhiHits (const MeasVec &hits)
 set fake phi hits on the entry More...
 
void setAllHits (const MeasVec &hits)
 set all hits on the entry More...
 
void clearChambers ()
 clear the list of contained chambers. More...
 
void addChamber (MuonStationIndex::ChIndex chIndex)
 add the chamber to the list of contained chambers. More...
 
void setChambers (const std::set< MuonStationIndex::ChIndex > &chambers)
 Set the list of chambers and update list of stations. More...
 

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 More...
 
void modifySegmentCounters (int change)
 increase the segment counters by the passed number More...
 

Static Private Member Functions

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

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. More...
 
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:

The following information is cached:

Definition at line 37 of file MuPatTrack.h.

Member Typedef Documentation

◆ MeasVec

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.

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())
87  m_seedSeg = segments[0];
88  for (MuPatSegment* seg : segments){
89  addToTrash(seg->garbage());
90  }
91  }

◆ 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  }

◆ ~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  :
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  }

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  }

◆ 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  }

◆ addToTrash() [1/2]

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

Definition at line 92 of file MuPatCandidateBase.cxx.

92  {
93  if (m_garbage.capacity() < measurements.size() + m_garbage.size()){
94  m_garbage.reserve(measurements.size() + m_garbage.size());
95  }
96  m_garbage.insert(m_garbage.end(), measurements.begin(), measurements.end());
97  }

◆ addToTrash() [2/2]

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

adds the measurement to the garbage container.

Definition at line 91 of file MuPatCandidateBase.cxx.

91 {m_garbage.push_back(std::move(meas));}

◆ 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; }

◆ 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  }

◆ 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.

59 { return m_fakePhiHits; }

◆ garbage()

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

Definition at line 98 of file MuPatCandidateBase.cxx.

98 {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.

71 { return m_hasEndcap; }

◆ 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.

45 { return m_hasLargeChamber; }

◆ 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
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  }

◆ 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.

47 { return m_hasSLOverlap; }

◆ 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.

43 { return m_hasSmallChamber; }

◆ 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.

61 { return m_allHits; }

◆ 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  {
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()

static 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  }

◆ 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.

57 { return m_phiHits; }

◆ 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  }

◆ 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  }

◆ 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  }

◆ 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;
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  }

◆ 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; }

◆ 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.

63 { m_etaHits = hits; }

◆ setFakePhiHits()

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

set fake phi hits on the entry

Definition at line 67 of file MuPatCandidateBase.cxx.

67 { m_fakePhiHits = hits; }

◆ 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  }

◆ 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  }

◆ 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  }

◆ 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); }

Friends And Related Function Documentation

◆ 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.

◆ lastSegmentChange

ProcessingStage Muon::MuPatTrack::lastSegmentChange {Unknown}

Definition at line 145 of file MuPatTrack.h.

◆ 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.

◆ 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.

◆ m_hasEndcap

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

Definition at line 186 of file MuPatCandidateBase.h.

◆ m_hasLargeChamber

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

Definition at line 188 of file MuPatCandidateBase.h.

◆ m_hasMomentum

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

Definition at line 172 of file MuPatCandidateBase.h.

◆ m_hasSLOverlap

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

Definition at line 189 of file MuPatCandidateBase.h.

◆ m_hasSmallChamber

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

Definition at line 187 of file MuPatCandidateBase.h.

◆ 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.

◆ m_segments

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

Definition at line 156 of file MuPatTrack.h.

◆ 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.

◆ ncscHitsEta

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

Definition at line 178 of file MuPatCandidateBase.h.

◆ ncscHitsPhi

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

Definition at line 179 of file MuPatCandidateBase.h.

◆ nmdtHitsMl1

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

public hit counters

Definition at line 176 of file MuPatCandidateBase.h.

◆ nmdtHitsMl2

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

Definition at line 177 of file MuPatCandidateBase.h.

◆ nrpcHitsEta

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

Definition at line 180 of file MuPatCandidateBase.h.

◆ nrpcHitsPhi

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

Definition at line 181 of file MuPatCandidateBase.h.

◆ ntgcHitsEta

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

Definition at line 182 of file MuPatCandidateBase.h.

◆ ntgcHitsPhi

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

Definition at line 183 of file MuPatCandidateBase.h.

◆ 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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Muon::MuPatTrack::InitialLoop
@ InitialLoop
Definition: MuPatTrack.h:44
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Muon::MuPatCandidateBase::addToTrash
void addToTrash(std::unique_ptr< const Trk::MeasurementBase > meas)
adds the measurement to the garbage container.
Definition: MuPatCandidateBase.cxx:91
Muon::MuonStationIndex::toStationIndex
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Definition: MuonStationIndex.cxx:43
Muon::MuPatCandidateBase::m_phiHits
MeasVec m_phiHits
Definition: MuPatCandidateBase.h:161
Muon::MuPatTrack::Unknown
@ Unknown
Definition: MuPatTrack.h:43
python.FPGATrackSimAnalysisConfig.stage
stage
Definition: FPGATrackSimAnalysisConfig.py:558
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Muon::MuPatTrack::TrackSelector
@ TrackSelector
Definition: MuPatTrack.h:57
Muon::MuPatCandidateBase::m_hasMomentum
bool m_hasMomentum
Definition: MuPatCandidateBase.h:172
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
Muon::MuPatCandidateBase::m_fakePhiHits
MeasVec m_fakePhiHits
Definition: MuPatCandidateBase.h:162
Muon::MuPatCandidateBase::chambers
const std::set< MuonStationIndex::ChIndex > & chambers() const
returns set with contained chamberIndices
Definition: MuPatCandidateBase.cxx:31
Muon::MuPatTrack::updateSegments
void updateSegments(bool add)
update segment/track association, if add == true ,will add track to segments else remove it
Definition: MuPatTrack.cxx:285
Muon::MuPatTrack::m_track
std::unique_ptr< Trk::Track > m_track
Definition: MuPatTrack.h:158
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
Muon::MuPatTrack::FitWorse
@ FitWorse
Definition: MuPatTrack.h:54
skel.it
it
Definition: skel.GENtoEVGEN.py:396
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Muon::MuPatTrack::AmbiguitySelectCandidates
@ AmbiguitySelectCandidates
Definition: MuPatTrack.h:51
Muon::MuPatCandidateBase::m_hasEndcap
bool m_hasEndcap
Definition: MuPatCandidateBase.h:186
Muon::MuPatCandidateBase::m_garbage
std::vector< std::shared_ptr< const Trk::MeasurementBase > > m_garbage
Definition: MuPatCandidateBase.h:191
intersection
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:25
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
Muon::MuPatTrack::FitRemovedLayer
@ FitRemovedLayer
Definition: MuPatTrack.h:56
Muon::MuPatTrack::SegmentRecovery
@ SegmentRecovery
Definition: MuPatTrack.h:47
Trk::ObjectCounter< MuPatTrack >
Muon::MuPatTrack::initProcessingStageStrings
static std::vector< std::string > initProcessingStageStrings()
Initialize s_processingStageStrings & s_processingStageStringMaxLen.
Definition: MuPatTrack.cxx:30
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Muon::MuPatCandidateBase::m_hasSmallChamber
bool m_hasSmallChamber
Definition: MuPatCandidateBase.h:187
Muon::MuPatTrack::LayerRecovery
@ LayerRecovery
Definition: MuPatTrack.h:45
Trk::TrackInfo::StraightTrack
@ StraightTrack
A straight track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:84
Muon::MuPatTrack::hasMomentum
bool hasMomentum() const
returns whether canditate has a momentum measurement
Definition: MuPatTrack.cxx:186
PlotPulseshapeFromCool.can
can
Definition: PlotPulseshapeFromCool.py:91
Muon::MuPatCandidateBase::MuPatCandidateBase
MuPatCandidateBase()=default
constructor.
Muon::MuPatCandidateBase::chamberIds
const std::set< Identifier > & chamberIds() const
returns set with contained chamber ids
Definition: MuPatCandidateBase.cxx:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::MuPatTrack::created
ProcessingStage created
Definition: MuPatTrack.h:144
Muon::MuPatTrack::m_excludedSegments
std::vector< MuPatSegment * > m_excludedSegments
Definition: MuPatTrack.h:157
python.subdetectors.mmg.names
names
Definition: mmg.py:8
Muon::MuPatCandidateBase::m_stations
std::set< MuonStationIndex::StIndex > m_stations
Definition: MuPatCandidateBase.h:171
Muon::MuPatCandidateBase::setChambers
void setChambers(const std::set< MuonStationIndex::ChIndex > &chambers)
Set the list of chambers and update list of stations.
Definition: MuPatCandidateBase.cxx:14
Muon::MuPatTrack::processingStageStrings
static const std::vector< std::string > & processingStageStrings()
Return list of processing stage strings.
Definition: MuPatTrack.cxx:54
Muon::MuPatTrack::FitRemovedSegment
@ FitRemovedSegment
Definition: MuPatTrack.h:48
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
Muon::MuPatTrack::m_seedSeg
MuPatSegment * m_seedSeg
The special segment for this track.
Definition: MuPatTrack.h:159
Muon::MuPatTrack::MatchFail
@ MatchFail
Definition: MuPatTrack.h:52
Muon::MuPatTrack::modifySegmentCounters
void modifySegmentCounters(int change)
increase the segment counters by the passed number
Definition: MuPatTrack.cxx:231
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
Muon::MuPatTrack::lastSegmentChange
ProcessingStage lastSegmentChange
Definition: MuPatTrack.h:145
Muon::MuPatTrack::NumberOfProcessingStages
@ NumberOfProcessingStages
Definition: MuPatTrack.h:59
Muon::MuPatCandidateBase::m_etaHits
MeasVec m_etaHits
Definition: MuPatCandidateBase.h:160
Muon::MuPatCandidateBase::m_hasSLOverlap
bool m_hasSLOverlap
Definition: MuPatCandidateBase.h:189
Muon::MuPatCandidateBase::m_hasLargeChamber
bool m_hasLargeChamber
Definition: MuPatCandidateBase.h:188
Trk::ObjectCounter< MuPatTrack >::s_numberOfInstantiations
static std::atomic_size_t s_numberOfInstantiations
Definition: TrkObjectCounter.h:22
Muon::MuPatCandidateBase::containsChamber
bool containsChamber(MuonStationIndex::ChIndex chIndex) const
returns whether the ChamberIndex is already contained in candidate
Definition: MuPatCandidateBase.cxx:75
Muon::MuPatTrack::track
Trk::Track & track() const
access to track
Definition: MuPatTrack.h:175
Muon::MuPatTrack::KeptUntilEndOfCombi
@ KeptUntilEndOfCombi
Definition: MuPatTrack.h:58
Muon::MuPatCandidateBase::m_chamberIds
std::set< Identifier > m_chamberIds
Definition: MuPatCandidateBase.h:167
Muon::MuPatCandidateBase::m_chambers
std::set< MuonStationIndex::ChIndex > m_chambers
Definition: MuPatCandidateBase.h:170
Muon::MuPatTrack::RefitRemovedSegment
@ RefitRemovedSegment
Definition: MuPatTrack.h:49
Muon::MuPatTrack::ExtendedWithSegment
@ ExtendedWithSegment
Definition: MuPatTrack.h:46
Muon::MuPatCandidateBase::addChamber
void addChamber(MuonStationIndex::ChIndex chIndex)
add the chamber to the list of contained chambers.
Definition: MuPatCandidateBase.cxx:38
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuPatTrack::FitFail
@ FitFail
Definition: MuPatTrack.h:53
Muon::MuPatTrack::m_segments
std::vector< MuPatSegment * > m_segments
Definition: MuPatTrack.h:156
Muon::MuPatCandidateBase::m_hitList
MuPatHitList m_hitList
Definition: MuPatCandidateBase.h:165
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
Muon::MuPatTrack::UnassociatedEM
@ UnassociatedEM
Definition: MuPatTrack.h:55
Muon::MuPatTrack::segments
const std::vector< MuPatSegment * > & segments() const
access to segments
Definition: MuPatTrack.h:167
Muon::MuPatTrack::AmbiguityCreateCandidateFromSeeds
@ AmbiguityCreateCandidateFromSeeds
Definition: MuPatTrack.h:50
Muon::MuPatCandidateBase::hits
const MeasVec & hits() const
return all hits on the entry.
Definition: MuPatCandidateBase.cxx:61
Trk::TrackInfo::trackProperties
bool trackProperties(const TrackProperties &property) const
Access methods for track properties.
Muon::MuPatCandidateBase::m_allHits
MeasVec m_allHits
Definition: MuPatCandidateBase.h:163
Muon::MuPatCandidateBase::stations
const std::set< MuonStationIndex::StIndex > & stations() const
returns set with contained stationIndices
Definition: MuPatCandidateBase.cxx:29
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5