ATLAS Offline Software
MuonSegmentCombination.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MdtSegment.h, (c) ATLAS Detector software
8 
9 #ifndef MUONSEGMENT_MUONSEGMENTCOMBINATION_H
10 #define MUONSEGMENT_MUONSEGMENTCOMBINATION_H
11 
12 namespace Trk {
13  class Segment;
14 }
15 
16 #include <vector>
17 #include <memory>
19 
20 namespace Muon {
21 
31  public:
32  typedef std::vector< std::unique_ptr<MuonSegment> > SegmentVec;
33  typedef std::vector< std::unique_ptr<SegmentVec> > SegmentVecVec;
34  public:
37 
40 
43 
46 
53  bool addSegments( std::unique_ptr<SegmentVec> );
54 
56  unsigned int numberOfStations() const;
57 
59  SegmentVec* stationSegments( unsigned int index ) const;
60 
62  unsigned int numberOfAmbiguities() const;
63 
65 
66  int getNGoodCscLayers(int isEta) const; //isEta=0 means phi
67 
68  bool use2LayerSegments(int isEta) const; //isEta=0 means phi
69 
70  bool useStripsInSegment(int isEta) const; //isEta=0 means phi
71 
72  private:
74  void clear();
75 
77  void copy( const MuonSegmentCombination& segc );
78 
80 
81  //if the station is a CSC station, this tells us how many good eta and phi layers it has
82  int m_nGood[2]{};
83  };
84 
85  //if there are only 2 good layers for eta or phi those segments may be 2-layer segments
86  inline bool MuonSegmentCombination::use2LayerSegments(int isEta) const
87  {
88  return m_nGood[isEta]==2;
89  }
90 
91  //if there are fewer than 2 good layers for eta or phi we don't try to use eta or phi to build segments
92  inline bool MuonSegmentCombination::useStripsInSegment(int isEta) const
93  {
94  return m_nGood[isEta]>1;
95  }
96 
97  inline int MuonSegmentCombination::getNGoodCscLayers(int isEta) const
98  {
99  return m_nGood[isEta];
100  }
101 
102  inline bool MuonSegmentCombination::addSegments( std::unique_ptr<SegmentVec> segs )
103  {
104  m_segmentsPerStation.push_back( std::move(segs) );
105  return true;
106  }
107 
108  inline unsigned int MuonSegmentCombination::numberOfStations() const
109  {
110  return m_segmentsPerStation.size();
111  }
112 
115  {
116  if( index < numberOfStations() ) return m_segmentsPerStation[index].get();
117  return 0;
118  }
119 
121  {
122  unsigned int solutions(1);
123  SegmentVecVec::const_iterator it = m_segmentsPerStation.begin();
124  SegmentVecVec::const_iterator it_end = m_segmentsPerStation.end();
125  for( ; it!=it_end; ++it ) solutions *= (*it)->size();
126  return solutions;
127  }
128 
129 }
130 
131 #endif
Muon::MuonSegmentCombination
Definition: MuonSegmentCombination.h:30
Muon::MuonSegmentCombination::setNGoodCscLayers
void setNGoodCscLayers(int nEta, int nPhi)
Definition: MuonSegmentCombination.h:64
Trk::TrackState::Segment
@ Segment
Definition: TrackStateDefs.h:37
index
Definition: index.py:1
Muon::MuonSegmentCombination::useStripsInSegment
bool useStripsInSegment(int isEta) const
Definition: MuonSegmentCombination.h:92
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Muon::MuonSegmentCombination::stationSegments
SegmentVec * stationSegments(unsigned int index) const
Access to segments in a given station.
Definition: MuonSegmentCombination.h:114
Muon::MuonSegmentCombination::copy
void copy(const MuonSegmentCombination &segc)
copy data
Definition: MuonSegmentCombination.cxx:34
Muon::MuonSegmentCombination::SegmentVecVec
std::vector< std::unique_ptr< SegmentVec > > SegmentVecVec
Definition: MuonSegmentCombination.h:33
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
TrigVSI::AlgConsts::nPhi
constexpr int nPhi
Default bin number of phi for vertex map.
Definition: Trigger/TrigTools/TrigVrtSecInclusive/TrigVrtSecInclusive/Constants.h:27
Muon::MuonSegmentCombination::numberOfAmbiguities
unsigned int numberOfAmbiguities() const
Number of ambiguities.
Definition: MuonSegmentCombination.h:120
Muon::MuonSegmentCombination::m_nGood
int m_nGood[2]
Definition: MuonSegmentCombination.h:82
Muon::MuonSegmentCombination::~MuonSegmentCombination
~MuonSegmentCombination()
Destructor.
Definition: MuonSegmentCombination.cxx:15
Muon::MuonSegmentCombination::m_segmentsPerStation
SegmentVecVec m_segmentsPerStation
Definition: MuonSegmentCombination.h:79
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Muon::MuonSegmentCombination::operator=
MuonSegmentCombination & operator=(const MuonSegmentCombination &)
assigment operator
Definition: MuonSegmentCombination.cxx:25
Muon::MuonSegmentCombination::use2LayerSegments
bool use2LayerSegments(int isEta) const
Definition: MuonSegmentCombination.h:86
Muon::MuonSegmentCombination::addSegments
bool addSegments(std::unique_ptr< SegmentVec >)
Add a set of Segments for a give station.
Definition: MuonSegmentCombination.h:102
DeMoScan.index
string index
Definition: DeMoScan.py:362
Muon::MuonSegmentCombination::clear
void clear()
clear data
Definition: MuonSegmentCombination.cxx:48
Muon::MuonSegmentCombination::SegmentVec
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
Definition: MuonSegmentCombination.h:32
Muon::MuonSegmentCombination::MuonSegmentCombination
MuonSegmentCombination()
Default constructor.
Definition: MuonSegmentCombination.cxx:10
MuonSegment.h
TrigVSI::AlgConsts::nEta
constexpr int nEta
Default bin number of eta for vertex map.
Definition: Trigger/TrigTools/TrigVrtSecInclusive/TrigVrtSecInclusive/Constants.h:26
Muon::MuonSegmentCombination::numberOfStations
unsigned int numberOfStations() const
Number of stations with segment.
Definition: MuonSegmentCombination.h:108
Muon::MuonSegmentCombination::getNGoodCscLayers
int getNGoodCscLayers(int isEta) const
Definition: MuonSegmentCombination.h:97