ATLAS Offline Software
MuPatSegment.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUPATSEGMENT_H
6 #define MUPATSEGMENT_H
7 
8 #include <mutex>
9 #include <set>
10 
11 #include "Identifier/Identifier.h"
17 
18 namespace Muon {
19 
20  class MuPatTrack;
21 
43  class MuPatSegment : public MuPatCandidateBase, public Trk::ObjectCounter<MuPatSegment> {
44  public:
47  MuPatSegment() = default;
48  ~MuPatSegment() = default;
49 
50 
51  int quality{0};
52  const MuonSegmentQuality* segQuality{nullptr};
53  const MuonSegment* segment{nullptr};
54  std::shared_ptr<const Trk::AtaPlane> segPars{nullptr};
55  int segmentIndex{-1};
56  int usedInFit{0};
58  std::string name{};
59  ChIdx chIndex{ChIdx::ChUnknown};
60  StIdx stIndex{StIdx::StUnknown};
61  bool isEndcap{false};
62  bool isMdt{false};
63 
65  const Trk::TrackParameters& entryPars() const;
66 
68  void addTrack(MuPatTrack*);
69 
71  void removeTrack(MuPatTrack*);
72 
74  const std::set<MuPatTrack*>& tracks() const { return m_associatedTracks; }
75 
76  private:
77  std::set<MuPatTrack*> m_associatedTracks; //<! list of associated tracks
78 
79  }; // class MuPatSegment
80 
81  //
82  // inline member functions implementations
83  //
84  inline const Trk::TrackParameters& MuPatSegment::entryPars() const { return *segPars; }
85 
86  struct SortSegInfoByR {
87  bool operator()(const MuPatSegment* c1, const MuPatSegment* c2) { return operator()(*c1, *c2); }
88  bool operator()(const MuPatSegment& c1, const MuPatSegment& c2) {
89  return c1.segment->globalPosition().perp() < c2.segment->globalPosition().perp();
90  }
91  };
92  struct SortSegInfoByZ {
93  bool operator()(const MuPatSegment* c1, const MuPatSegment* c2) { return operator()(*c1, *c2); }
94  bool operator()(const MuPatSegment& c1, const MuPatSegment& c2) {
95  return fabs(c1.segment->globalPosition().z()) < fabs(c2.segment->globalPosition().z());
96  }
97  };
99  bool operator()(const MuPatSegment* c1, const MuPatSegment* c2) { return operator()(*c1, *c2); }
100  bool operator()(const MuPatSegment& c1, const MuPatSegment& c2) { return c1.quality > c2.quality; }
101  };
102 
103 } // namespace Muon
104 
105 #endif
Muon::MuonSegmentQuality
Definition: MuonSegmentQuality.h:34
Muon::SortSegInfoByZ::operator()
bool operator()(const MuPatSegment *c1, const MuPatSegment *c2)
Definition: MuPatSegment.h:93
TrackParameters.h
Muon::MuPatCandidateBase
track candidate entry object.
Definition: MuPatCandidateBase.h:46
Muon::SortSegInfoByZ::operator()
bool operator()(const MuPatSegment &c1, const MuPatSegment &c2)
Definition: MuPatSegment.h:94
Muon::MuPatSegment::chIndex
ChIdx chIndex
Definition: MuPatSegment.h:59
extractSporadic.c1
c1
Definition: extractSporadic.py:134
Muon::MuPatSegment::segQuality
const MuonSegmentQuality * segQuality
Definition: MuPatSegment.h:52
Muon::MuPatSegment::tracks
const std::set< MuPatTrack * > & tracks() const
access to the tracks the segment is associated with
Definition: MuPatSegment.h:74
MuPatCandidateBase.h
Muon::MuPatSegment::name
std::string name
Definition: MuPatSegment.h:58
Muon::MuPatSegment::removeTrack
void removeTrack(MuPatTrack *)
remove a track from the segment
Definition: MuPatSegment.cxx:13
MuonSegmentQuality.h
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MuPatSegment::isMdt
bool isMdt
true for MDT, false for CSC
Definition: MuPatSegment.h:62
Muon::MuPatSegment::~MuPatSegment
~MuPatSegment()=default
Trk::ObjectCounter
Helper to enable counting number of instantiations in debug builds.
Definition: TrkObjectCounter.h:18
Muon::MuPatSegment::segPars
std::shared_ptr< const Trk::AtaPlane > segPars
Definition: MuPatSegment.h:54
Muon::SortSegInfoByQuality::operator()
bool operator()(const MuPatSegment *c1, const MuPatSegment *c2)
Definition: MuPatSegment.h:99
Muon::MuPatSegment::chid
Identifier chid
Definition: MuPatSegment.h:57
Muon::MuPatSegment::stIndex
StIdx stIndex
Definition: MuPatSegment.h:60
Muon::MuPatSegment::addTrack
void addTrack(MuPatTrack *)
add a new track to the segment
Definition: MuPatSegment.cxx:10
Muon::MuPatSegment::entryPars
const Trk::TrackParameters & entryPars() const
returns first track parameters
Definition: MuPatSegment.h:84
Muon::MuPatSegment::isEndcap
bool isEndcap
Definition: MuPatSegment.h:61
Muon::MuPatSegment::usedInFit
int usedInFit
Definition: MuPatSegment.h:56
Muon::MuPatSegment::segment
const MuonSegment * segment
Definition: MuPatSegment.h:53
Muon::SortSegInfoByR
Definition: MuPatSegment.h:86
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::SortSegInfoByQuality::operator()
bool operator()(const MuPatSegment &c1, const MuPatSegment &c2)
Definition: MuPatSegment.h:100
Muon::MuPatSegment::MuPatSegment
MuPatSegment()=default
Muon::MuPatSegment::segmentIndex
int segmentIndex
index of segment within station
Definition: MuPatSegment.h:55
Muon::SortSegInfoByR::operator()
bool operator()(const MuPatSegment &c1, const MuPatSegment &c2)
Definition: MuPatSegment.h:88
Muon::MuPatSegment
segment candidate object.
Definition: MuPatSegment.h:43
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
Muon::SortSegInfoByR::operator()
bool operator()(const MuPatSegment *c1, const MuPatSegment *c2)
Definition: MuPatSegment.h:87
Muon::MuPatSegment::m_associatedTracks
std::set< MuPatTrack * > m_associatedTracks
Definition: MuPatSegment.h:77
Muon::MuPatTrack
track candidate object.
Definition: MuPatTrack.h:37
Muon::SortSegInfoByZ
Definition: MuPatSegment.h:92
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
MuonSegment.h
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
MuonStationIndex.h
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
Muon::SortSegInfoByQuality
Definition: MuPatSegment.h:98
Muon::MuPatSegment::quality
int quality
Definition: MuPatSegment.h:51
Identifier
Definition: IdentifierFieldParser.cxx:14