ATLAS Offline Software
Loading...
Searching...
No Matches
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
12namespace Trk {
13 class Segment;
14}
15
16#include <vector>
17#include <memory>
19
20namespace 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
64 void setNGoodCscLayers(int nEta, int nPhi){m_nGood[0]=nPhi; m_nGood[1]=nEta;}
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
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
Class to hold a set of MuonSegments belonging together.
MuonSegmentCombination()
Default constructor.
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
std::vector< std::unique_ptr< SegmentVec > > SegmentVecVec
SegmentVec * stationSegments(unsigned int index) const
Access to segments in a given station.
bool use2LayerSegments(int isEta) const
unsigned int numberOfAmbiguities() const
Number of ambiguities.
void setNGoodCscLayers(int nEta, int nPhi)
void copy(const MuonSegmentCombination &segc)
copy data
bool addSegments(std::unique_ptr< SegmentVec >)
Add a set of Segments for a give station.
bool useStripsInSegment(int isEta) const
MuonSegmentCombination & operator=(const MuonSegmentCombination &)
assigment operator
unsigned int numberOfStations() const
Number of stations with segment.
Base class for all TrackSegment implementations, extends the common MeasurementBase.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Ensure that the ATLAS eigen extensions are properly loaded.
Definition index.py:1