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:
45  MuPatSegment() = default;
46 
47  ~MuPatSegment() = default;
48 
49 
50  int quality{0};
51  const MuonSegmentQuality* segQuality{nullptr};
52  const MuonSegment* segment{nullptr};
53  std::shared_ptr<const Trk::AtaPlane> segPars{nullptr};
54  int segmentIndex{-1};
55  int usedInFit{0};
57  std::string name{};
60  bool isEndcap{false};
61  bool isMdt{false};
62 
64  const Trk::TrackParameters& entryPars() const;
65 
67  void addTrack(MuPatTrack*);
68 
70  void removeTrack(MuPatTrack*);
71 
73  const std::set<MuPatTrack*>& tracks() const { return m_associatedTracks; }
74 
75  private:
76  std::set<MuPatTrack*> m_associatedTracks; //<! list of associated tracks
77 
78  }; // class MuPatSegment
79 
80  //
81  // inline member functions implementations
82  //
83  inline const Trk::TrackParameters& MuPatSegment::entryPars() const { return *segPars; }
84 
85  struct SortSegInfoByR {
86  bool operator()(const MuPatSegment* c1, const MuPatSegment* c2) { return operator()(*c1, *c2); }
87  bool operator()(const MuPatSegment& c1, const MuPatSegment& c2) {
88  return c1.segment->globalPosition().perp() < c2.segment->globalPosition().perp();
89  }
90  };
91  struct SortSegInfoByZ {
92  bool operator()(const MuPatSegment* c1, const MuPatSegment* c2) { return operator()(*c1, *c2); }
93  bool operator()(const MuPatSegment& c1, const MuPatSegment& c2) {
94  return fabs(c1.segment->globalPosition().z()) < fabs(c2.segment->globalPosition().z());
95  }
96  };
98  bool operator()(const MuPatSegment* c1, const MuPatSegment* c2) { return operator()(*c1, *c2); }
99  bool operator()(const MuPatSegment& c1, const MuPatSegment& c2) { return c1.quality > c2.quality; }
100  };
101 
102 } // namespace Muon
103 
104 #endif
Muon::MuonSegmentQuality
Definition: MuonSegmentQuality.h:34
Muon::MuonStationIndex::StUnknown
@ StUnknown
Definition: MuonStationIndex.h:24
Muon::SortSegInfoByZ::operator()
bool operator()(const MuPatSegment *c1, const MuPatSegment *c2)
Definition: MuPatSegment.h:92
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:93
extractSporadic.c1
c1
Definition: extractSporadic.py:134
Muon::MuPatSegment::segQuality
const MuonSegmentQuality * segQuality
Definition: MuPatSegment.h:51
Muon::MuPatSegment::tracks
const std::set< MuPatTrack * > & tracks() const
access to the tracks the segment is associated with
Definition: MuPatSegment.h:73
MuPatCandidateBase.h
Muon::MuPatSegment::name
std::string name
Definition: MuPatSegment.h:57
Muon::MuPatSegment::removeTrack
void removeTrack(MuPatTrack *)
remove a track from the segment
Definition: MuPatSegment.cxx:13
MuonSegmentQuality.h
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::MuPatSegment::stIndex
MuonStationIndex::StIndex stIndex
Definition: MuPatSegment.h:59
Muon::MuPatSegment::isMdt
bool isMdt
true for MDT, false for CSC
Definition: MuPatSegment.h:61
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:53
Muon::SortSegInfoByQuality::operator()
bool operator()(const MuPatSegment *c1, const MuPatSegment *c2)
Definition: MuPatSegment.h:98
Muon::MuPatSegment::chid
Identifier chid
Definition: MuPatSegment.h:56
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:83
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Muon::MuPatSegment::isEndcap
bool isEndcap
Definition: MuPatSegment.h:60
Muon::MuPatSegment::chIndex
MuonStationIndex::ChIndex chIndex
Definition: MuPatSegment.h:58
Muon::MuPatSegment::usedInFit
int usedInFit
Definition: MuPatSegment.h:55
Muon::MuPatSegment::segment
const MuonSegment * segment
Definition: MuPatSegment.h:52
Muon::SortSegInfoByR
Definition: MuPatSegment.h:85
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::SortSegInfoByQuality::operator()
bool operator()(const MuPatSegment &c1, const MuPatSegment &c2)
Definition: MuPatSegment.h:99
Muon::MuPatSegment::MuPatSegment
MuPatSegment()=default
Muon::MuonStationIndex::ChUnknown
@ ChUnknown
Definition: MuonStationIndex.h:16
compileRPVLLRates.c2
c2
Definition: compileRPVLLRates.py:361
Muon::MuPatSegment::segmentIndex
int segmentIndex
index of segment within station
Definition: MuPatSegment.h:54
Muon::SortSegInfoByR::operator()
bool operator()(const MuPatSegment &c1, const MuPatSegment &c2)
Definition: MuPatSegment.h:87
Muon::MuPatSegment
segment candidate object.
Definition: MuPatSegment.h:43
Muon::SortSegInfoByR::operator()
bool operator()(const MuPatSegment *c1, const MuPatSegment *c2)
Definition: MuPatSegment.h:86
Muon::MuPatSegment::m_associatedTracks
std::set< MuPatTrack * > m_associatedTracks
Definition: MuPatSegment.h:76
Muon::MuPatTrack
track candidate object.
Definition: MuPatTrack.h:37
Muon::SortSegInfoByZ
Definition: MuPatSegment.h:91
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:97
Muon::MuPatSegment::quality
int quality
Definition: MuPatSegment.h:50