ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSegmentCombination Class Reference

Class to hold a set of MuonSegments belonging together. More...

#include <MuonSegmentCombination.h>

Collaboration diagram for MuonSegmentCombination:

Public Types

typedef std::vector< std::unique_ptr< MuonSegment > > SegmentVec
typedef std::vector< std::unique_ptr< SegmentVec > > SegmentVecVec

Public Member Functions

 MuonSegmentCombination ()
 Default constructor.
 MuonSegmentCombination (const MuonSegmentCombination &)
 Copy constructor.
 ~MuonSegmentCombination ()
 Destructor.
MuonSegmentCombinationoperator= (const MuonSegmentCombination &)
 assigment operator
bool addSegments (std::unique_ptr< SegmentVec >)
 Add a set of Segments for a give station.
unsigned int numberOfStations () const
 Number of stations with segment.
SegmentVecstationSegments (unsigned int index) const
 Access to segments in a given station.
unsigned int numberOfAmbiguities () const
 Number of ambiguities.
void setNGoodCscLayers (int nEta, int nPhi)
int getNGoodCscLayers (int isEta) const
bool use2LayerSegments (int isEta) const
bool useStripsInSegment (int isEta) const

Private Member Functions

void clear ()
 clear data
void copy (const MuonSegmentCombination &segc)
 copy data

Private Attributes

SegmentVecVec m_segmentsPerStation
int m_nGood [2] {}

Detailed Description

Class to hold a set of MuonSegments belonging together.

The MuonSegments are stored per chamber, making it easier to keep track of possible ambiguities per station.

Author
niels.nosp@m..van.nosp@m..eldi.nosp@m.k@ce.nosp@m.rn.ch

Definition at line 30 of file MuonSegmentCombination.h.

Member Typedef Documentation

◆ SegmentVec

typedef std::vector< std::unique_ptr<MuonSegment> > Muon::MuonSegmentCombination::SegmentVec

Definition at line 32 of file MuonSegmentCombination.h.

◆ SegmentVecVec

typedef std::vector< std::unique_ptr<SegmentVec> > Muon::MuonSegmentCombination::SegmentVecVec

Definition at line 33 of file MuonSegmentCombination.h.

Constructor & Destructor Documentation

◆ MuonSegmentCombination() [1/2]

Muon::MuonSegmentCombination::MuonSegmentCombination ( )

Default constructor.

Definition at line 10 of file MuonSegmentCombination.cxx.

11 {
12 m_nGood[0]=4; m_nGood[1]=4;
13 }

◆ MuonSegmentCombination() [2/2]

Muon::MuonSegmentCombination::MuonSegmentCombination ( const MuonSegmentCombination & segc)

Copy constructor.

Definition at line 20 of file MuonSegmentCombination.cxx.

21 {
22 copy( segc );
23 }
void copy(const MuonSegmentCombination &segc)
copy data

◆ ~MuonSegmentCombination()

Muon::MuonSegmentCombination::~MuonSegmentCombination ( )

Destructor.

Definition at line 15 of file MuonSegmentCombination.cxx.

16 {
17 clear();
18 }

Member Function Documentation

◆ addSegments()

bool Muon::MuonSegmentCombination::addSegments ( std::unique_ptr< SegmentVec > segs)
inline

Add a set of Segments for a give station.

For now no sorting but this could be changed so the segments are stored with increasing radius. Also no check is performed whether there are already segments for the given station. This is up to the user.

Definition at line 102 of file MuonSegmentCombination.h.

103 {
104 m_segmentsPerStation.push_back( std::move(segs) );
105 return true;
106 }

◆ clear()

void Muon::MuonSegmentCombination::clear ( )
private

clear data

Definition at line 48 of file MuonSegmentCombination.cxx.

49 {
50 SegmentVecVec::iterator it = m_segmentsPerStation.begin();
51 SegmentVecVec::iterator it_end = m_segmentsPerStation.end();
52
53 for( ; it!=it_end; ++it ){
54 SegmentVec::iterator vit = (*it)->begin();
55 SegmentVec::iterator vit_end = (*it)->end();
56 for( ; vit!=vit_end; ++vit ) (*vit).reset();
57 (*it)->clear();
58 (*it).reset();
59 }
61 }

◆ copy()

void Muon::MuonSegmentCombination::copy ( const MuonSegmentCombination & segc)
private

copy data

Definition at line 34 of file MuonSegmentCombination.cxx.

35 {
36 m_nGood[0]=segc.getNGoodCscLayers(0);
37 m_nGood[1]=segc.getNGoodCscLayers(1);
38 unsigned int nst( segc.numberOfStations() );
39 for( unsigned int i=0;i<nst;++i ){
40 SegmentVec::const_iterator vit = segc.stationSegments( i )->begin();
41 SegmentVec::const_iterator vit_end = segc.stationSegments( i )->end();
42 std::unique_ptr<SegmentVec> newsegs(new SegmentVec());
43 for( ; vit!=vit_end; ++vit ) newsegs->push_back( std::unique_ptr<MuonSegment>((*vit)->clone()) );
44 m_segmentsPerStation.push_back(std::move(newsegs));
45 }
46 }
int getNGoodCscLayers(int isEta) const
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
SegmentVec * stationSegments(unsigned int index) const
Access to segments in a given station.
unsigned int numberOfStations() const
Number of stations with segment.

◆ getNGoodCscLayers()

int Muon::MuonSegmentCombination::getNGoodCscLayers ( int isEta) const
inline

Definition at line 97 of file MuonSegmentCombination.h.

98 {
99 return m_nGood[isEta];
100 }

◆ numberOfAmbiguities()

unsigned int Muon::MuonSegmentCombination::numberOfAmbiguities ( ) const
inline

Number of ambiguities.

Definition at line 120 of file MuonSegmentCombination.h.

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 }

◆ numberOfStations()

unsigned int Muon::MuonSegmentCombination::numberOfStations ( ) const
inline

Number of stations with segment.

Definition at line 108 of file MuonSegmentCombination.h.

109 {
110 return m_segmentsPerStation.size();
111 }

◆ operator=()

MuonSegmentCombination & Muon::MuonSegmentCombination::operator= ( const MuonSegmentCombination & segc)

assigment operator

Definition at line 25 of file MuonSegmentCombination.cxx.

26 {
27 if( this != &segc ){
28 clear();
29 copy( segc );
30 }
31 return *this;
32 }

◆ setNGoodCscLayers()

void Muon::MuonSegmentCombination::setNGoodCscLayers ( int nEta,
int nPhi )
inline

Definition at line 64 of file MuonSegmentCombination.h.

64{m_nGood[0]=nPhi; m_nGood[1]=nEta;}
constexpr int nEta
Default bin number of eta for vertex map.
constexpr int nPhi
Default bin number of phi for vertex map.

◆ stationSegments()

MuonSegmentCombination::SegmentVec * Muon::MuonSegmentCombination::stationSegments ( unsigned int index) const
inline

Access to segments in a given station.

Definition at line 114 of file MuonSegmentCombination.h.

115 {
116 if( index < numberOfStations() ) return m_segmentsPerStation[index].get();
117 return 0;
118 }
str index
Definition DeMoScan.py:362

◆ use2LayerSegments()

bool Muon::MuonSegmentCombination::use2LayerSegments ( int isEta) const
inline

Definition at line 86 of file MuonSegmentCombination.h.

87 {
88 return m_nGood[isEta]==2;
89 }

◆ useStripsInSegment()

bool Muon::MuonSegmentCombination::useStripsInSegment ( int isEta) const
inline

Definition at line 92 of file MuonSegmentCombination.h.

93 {
94 return m_nGood[isEta]>1;
95 }

Member Data Documentation

◆ m_nGood

int Muon::MuonSegmentCombination::m_nGood[2] {}
private

Definition at line 82 of file MuonSegmentCombination.h.

82{};

◆ m_segmentsPerStation

SegmentVecVec Muon::MuonSegmentCombination::m_segmentsPerStation
private

Definition at line 79 of file MuonSegmentCombination.h.


The documentation for this class was generated from the following files: