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

#include <RegSelSubDetector.h>

Inheritance diagram for RegSelSubDetector:
Collaboration diagram for RegSelSubDetector:

Public Member Functions

 RegSelSubDetector ()
 RegSelSubDetector (int ID, int Nlayers, const std::string &s)
 RegSelSubDetector (int ID, const std::string &s)
 RegSelSubDetector (int ID)
 RegSelSubDetector (double rmin, double rmax, double zmin, double zmax)
 RegSelSubDetector (double rmin, double rmax, double zmin, double zmax, const std::string &s)
void reset ()
void addModules (std::vector< RegSelModule > &modules)
void setupDisabledModules ()
void getModules (const RegSelRoI &roi, std::vector< const RegSelModule * > &modules) const
void getModules (const RegSelRoI &roi, unsigned layer, std::vector< const RegSelModule * > &modules) const
void getModules (unsigned layer, std::vector< const RegSelModule * > &modules) const
int ID () const
int Nlayers () const
void drawlayers (std::vector< const ZRObject * > &c) const
const std::vector< RegSelLayer > & getLayers () const
void disableLayer (unsigned layer)
void enableLayer (unsigned layer)
virtual bool inRoI (const RegSelRoI &roi) const
double rMin () const
double rMin (double rmin)
double rMax () const
double rMax (double rmax)
double zMin () const
double zMin (double zmin)
double zMax () const
double zMax (double zmax)
double z2Min () const
double z2Min (double zmin)
double z2Max () const
double z2Max (double zmax)
bool enabled () const
bool enable ()
bool disable ()
double _etaMin (double z=0) const
double _etaMax (double z=0) const
const std::string & getName () const

Protected Attributes

int m_ID
unsigned m_Nlayers
std::vector< RegSelLayerm_layer
std::map< unsigned, unsigned > m_layermap
bool m_mapped
double m_rMin
double m_rMax
double m_zMin
double m_zMax
double m_z2Min
double m_z2Max
bool m_enabled
std::string m_name

Detailed Description

Definition at line 44 of file RegSelSubDetector.h.

Constructor & Destructor Documentation

◆ RegSelSubDetector() [1/6]

RegSelSubDetector::RegSelSubDetector ( )
inline

Definition at line 48 of file RegSelSubDetector.h.

◆ RegSelSubDetector() [2/6]

RegSelSubDetector::RegSelSubDetector ( int ID,
int Nlayers,
const std::string & s )
inline

Definition at line 50 of file RegSelSubDetector.h.

50 :
51 ZRObject(0,0,0,0), RegSelName(s), m_ID(ID), m_Nlayers(Nlayers), m_mapped(false)
52 { } // m_layer.resize(m_Nlayers); }
RegSelName(const std::string &s="")
Definition RegSelName.h:37

◆ RegSelSubDetector() [3/6]

RegSelSubDetector::RegSelSubDetector ( int ID,
const std::string & s )
inline

Definition at line 54 of file RegSelSubDetector.h.

54 :
55 ZRObject(0,0,0,0), RegSelName(s), m_ID(ID), m_Nlayers(0), m_mapped(false)
56 { }

◆ RegSelSubDetector() [4/6]

RegSelSubDetector::RegSelSubDetector ( int ID)
inline

Definition at line 58 of file RegSelSubDetector.h.

58 :
59 ZRObject(0,0,0,0), RegSelName(""), m_ID(ID), m_Nlayers(0), m_mapped(false)
60 { }

◆ RegSelSubDetector() [5/6]

RegSelSubDetector::RegSelSubDetector ( double rmin,
double rmax,
double zmin,
double zmax )
inline

Definition at line 64 of file RegSelSubDetector.h.

65 :
66 ZRObject(rmin, rmax, zmin, zmax), m_ID(0), m_Nlayers(0), m_mapped(false)
67 { } // m_layer.resize(m_Nlayers); }

◆ RegSelSubDetector() [6/6]

RegSelSubDetector::RegSelSubDetector ( double rmin,
double rmax,
double zmin,
double zmax,
const std::string & s )
inline

Definition at line 70 of file RegSelSubDetector.h.

72 :
73 ZRObject(rmin, rmax, zmin, zmax), RegSelName(s), m_ID(0), m_Nlayers(0), m_mapped(false)
74 { }

Member Function Documentation

◆ _etaMax()

double ZRObject::_etaMax ( double z = 0) const
inlineinherited

Definition at line 109 of file ZRObject.h.

109 {
110 double eta1 = calceta( rMin(), zMax()-z);
111 double eta2 = calceta( rMax(), z2Max()-z);
112 if ( eta1>eta2 ) return eta1;
113 else return eta2;
114 }
#define z
double calceta(double r, double z)
Definition ZRObject.h:33
double rMax() const
Definition ZRObject.h:81
double rMin() const
Definition ZRObject.h:80
double zMax() const
Definition ZRObject.h:84
double z2Max() const
Definition ZRObject.h:87
setEt setPhi setE277 setWeta2 eta1

◆ _etaMin()

double ZRObject::_etaMin ( double z = 0) const
inlineinherited

Definition at line 102 of file ZRObject.h.

102 {
103 double eta1 = calceta( rMin(), zMin()-z);
104 double eta2 = calceta( rMax(), z2Min()-z);
105 if ( eta1<eta2 ) return eta1;
106 else return eta2;
107 }
double z2Min() const
Definition ZRObject.h:86
double zMin() const
Definition ZRObject.h:83

◆ addModules()

void RegSelSubDetector::addModules ( std::vector< RegSelModule > & modules)

Definition at line 90 of file RegSelSubDetector.cxx.

91{
92 // barrel
93 // make the layer vector have the correct number of layers
94
95 // calculate the number of layers, and get the map of logical
96 // layer number to physical layer number
97
98 std::set<unsigned> layerset;
99
100 std::vector<RegSelModule>::iterator mptr(modules.begin());
101
102 for ( ; mptr!=modules.end() ; ++mptr ) {
103 int layer = mptr->layer();
104 int detector = mptr->detector();
105
106 if ( !mptr->enabled() ) continue;
107
108 if ( detector == ID() ) layerset.insert(layer);
109 }
110
111 // if no modules, don't need to do anything...
112
113 m_Nlayers = layerset.size();
114
115 if ( m_Nlayers==0 ) return;
116
117 // set up the layer map, the variable m_mapped will be used
118 // to know whether to use logical, or physical layer numbers
119 // in subsequent lookups
120
121 std::set<unsigned>::iterator litr = layerset.begin();
122 std::set<unsigned>::iterator lend = layerset.end();
123
124 m_mapped = false;
125 for ( unsigned i=0 ; litr!=lend ; ++litr, i++ ) {
126 // std::cout << "\t\tRegSelSubDetector::addModules() layer " << *litr << " -> " << i << std::endl;
127 if ( *litr!=i ) m_mapped = true;
128 m_layermap.insert( std::map<unsigned, unsigned>::value_type( *litr, i ) );
129 }
130
131 // now actually create and set up the layers for this subdetector
132
133 // std::cout << "\t\tRegSelSubDetector::addModules() created with " << m_Nlayers << " layers\tmapped " << m_mapped << std::endl;
134
135 m_layer.resize(m_Nlayers);
136
137 for ( mptr=modules.begin() ; mptr!=modules.end() ; ++mptr ) {
138
139 int detector = mptr->detector();
140
141 if ( detector == ID() ) {
142
143 if ( !mptr->enabled() ) continue;
144
145 if ( !m_mapped ) m_layer[mptr->layer()].addModule(*mptr);
146 else {
147 std::map<unsigned, unsigned>::iterator litr = m_layermap.find(mptr->layer());
148 // if ( litr!=m_layermap.end() )
149 m_layer[litr->second].addModule(*mptr);
150 // else std::cerr << "module - layer mismatch " << *mptr << std::endl;
151 }
152
153 }
154 }
155
156 // std::cout << "RegSelSubDetector::addModules() detector extent" << std::endl;
157
158 for ( unsigned i=0 ; i<m_Nlayers ; i++ ) {
159 m_layer[i].ID(i);
160
161 if ( i==0 ) {
162 rMin(m_layer[i].rMin());
163 rMax(m_layer[i].rMax());
164
165 zMin(m_layer[i].zMin());
166 zMax(m_layer[i].zMax());
167 }
168 else {
169 if ( m_layer[i].rMin()<rMin() ) rMin(m_layer[i].rMin());
170 if ( m_layer[i].rMax()>rMax() ) rMax(m_layer[i].rMax());
171
172 if ( m_layer[i].zMin()<zMin() ) zMin(m_layer[i].zMin());
173 if ( m_layer[i].zMax()>zMax() ) zMax(m_layer[i].zMax());
174 }
175
176 // std::cout << m_layer[i] << std::endl;
177 m_layer[i].createMaps();
178
179 }
180
181 // std::cout << "Detector " << getName()
182 // << "\tr=" << rMin() << " - " << rMax()
183 // << ",\tz=" << zMin() << " - " << zMax()
184 // << std::endl;
185
186}
std::map< unsigned, unsigned > m_layermap
std::vector< RegSelLayer > m_layer
@ layer
Definition HitInfo.h:79

◆ disable()

bool ZRObject::disable ( )
inlineinherited

Definition at line 100 of file ZRObject.h.

100{ return m_enabled=false; }
bool m_enabled
Definition ZRObject.h:122

◆ disableLayer()

void RegSelSubDetector::disableLayer ( unsigned layer)

Definition at line 192 of file RegSelSubDetector.cxx.

192 {
193 if ( !m_mapped ) {
194 if ( layer<m_Nlayers ) m_layer[layer].disable();
195 }
196 else {
197 std::map<unsigned, unsigned>::iterator litr = m_layermap.find(layer);
198 if ( litr!=m_layermap.end() ) m_layer[litr->second].disable();
199 }
200}

◆ drawlayers()

void RegSelSubDetector::drawlayers ( std::vector< const ZRObject * > & c) const
inline

Definition at line 92 of file RegSelSubDetector.h.

92 {
93 for ( unsigned i=0 ; i<m_Nlayers ; i++ ) c.push_back(&m_layer[i]);
94 }

◆ enable()

bool ZRObject::enable ( )
inlineinherited

Definition at line 99 of file ZRObject.h.

99{ return m_enabled=true; }

◆ enabled()

bool ZRObject::enabled ( ) const
inlineinherited

Definition at line 98 of file ZRObject.h.

98{ return m_enabled; }

◆ enableLayer()

void RegSelSubDetector::enableLayer ( unsigned layer)

Definition at line 202 of file RegSelSubDetector.cxx.

202 {
203 if ( !m_mapped ) {
204 if ( layer<m_Nlayers ) m_layer[layer].enable();
205 }
206 else {
207 std::map<unsigned, unsigned>::iterator litr = m_layermap.find(layer);
208 if ( litr!=m_layermap.end() ) m_layer[litr->second].enable();
209 }
210}

◆ getLayers()

const std::vector< RegSelLayer > & RegSelSubDetector::getLayers ( ) const
inline

Definition at line 96 of file RegSelSubDetector.h.

96{ return m_layer; }

◆ getModules() [1/3]

void RegSelSubDetector::getModules ( const RegSelRoI & roi,
std::vector< const RegSelModule * > & modules ) const

Definition at line 31 of file RegSelSubDetector.cxx.

31 {
32 for ( unsigned i=m_layer.size() ; i-- ; ) {
33 if ( m_layer[i].inRoI(roi) ) m_layer[i].getModules(roi, modules);
34 }
35}
virtual bool inRoI(const RegSelRoI &roi) const
Definition ZRObject.h:71

◆ getModules() [2/3]

void RegSelSubDetector::getModules ( const RegSelRoI & roi,
unsigned layer,
std::vector< const RegSelModule * > & modules ) const

Definition at line 39 of file RegSelSubDetector.cxx.

39 {
40
41 // if mapping between logical and physical layers is needed...
42 if ( m_mapped ) {
43 std::map<unsigned, unsigned>::const_iterator litr = m_layermap.find(layer);
44 if ( litr==m_layermap.end() ) return;
45 else layer = litr->second;
46 }
47
48 if ( layer<m_layer.size() ) {
49 if ( m_layer[layer].inRoI(roi) ) m_layer[layer].getModules(roi, modules);
50 }
51
52}

◆ getModules() [3/3]

void RegSelSubDetector::getModules ( unsigned layer,
std::vector< const RegSelModule * > & modules ) const

Definition at line 57 of file RegSelSubDetector.cxx.

57 {
58
59 // if mapping between logical and physical layers is needed...
60 if ( m_mapped ) {
61 std::map<unsigned, unsigned>::const_iterator litr = m_layermap.find(layer);
62 if ( litr==m_layermap.end() ) return;
63 else layer = litr->second;
64 }
65
66 if ( layer<m_layer.size() ) {
67 m_layer[layer].getModules(modules);
68 }
69
70}

◆ getName()

const std::string & RegSelName::getName ( ) const
inlineinherited

Definition at line 39 of file RegSelName.h.

39{ return m_name; }
std::string m_name
Definition RegSelName.h:45

◆ ID()

int RegSelSubDetector::ID ( ) const
inline

Definition at line 88 of file RegSelSubDetector.h.

88{ return m_ID; }

◆ inRoI()

virtual bool ZRObject::inRoI ( const RegSelRoI & roi) const
inlinevirtualinherited

Reimplemented in RegSelModule.

Definition at line 71 of file ZRObject.h.

71 {
72 if ( !enabled() ) return false;
73 if ( (roi.getzMax(rMin())<zMin() && roi.getzMax(rMax())<z2Min()) ||
74 (roi.getzMin(rMin())>zMax() && roi.getzMin(rMax())>z2Max()) ) {
75 return false;
76 }
77 return true;
78 }
double getzMin() const
Definition RegSelRoI.h:44
double getzMax() const
Definition RegSelRoI.h:45
bool enabled() const
Definition ZRObject.h:98

◆ Nlayers()

int RegSelSubDetector::Nlayers ( ) const
inline

Definition at line 89 of file RegSelSubDetector.h.

89{ return m_Nlayers; }

◆ reset()

void RegSelSubDetector::reset ( )

Definition at line 85 of file RegSelSubDetector.cxx.

85 {
86 for ( unsigned i=0 ; i<m_Nlayers ; i++ ) m_layer[i].reset();
87}

◆ rMax() [1/2]

double ZRObject::rMax ( ) const
inlineinherited

Definition at line 81 of file ZRObject.h.

81{ return m_rMax; }
double m_rMax
Definition ZRObject.h:118

◆ rMax() [2/2]

double ZRObject::rMax ( double rmax)
inlineinherited

Definition at line 90 of file ZRObject.h.

90{ m_rMax = rmax; return m_rMax; }

◆ rMin() [1/2]

double ZRObject::rMin ( ) const
inlineinherited

Definition at line 80 of file ZRObject.h.

80{ return m_rMin; }
double m_rMin
Definition ZRObject.h:118

◆ rMin() [2/2]

double ZRObject::rMin ( double rmin)
inlineinherited

Definition at line 89 of file ZRObject.h.

89{ m_rMin = rmin; return m_rMin; }

◆ setupDisabledModules()

void RegSelSubDetector::setupDisabledModules ( )

Definition at line 76 of file RegSelSubDetector.cxx.

76 {
77 std::vector<RegSelLayer>::iterator litr(m_layer.begin());
78 std::vector<RegSelLayer>::iterator lend(m_layer.end());
79 while ( litr!=lend ) {
80 (*litr++).setupDisabledModuleList();
81 }
82}

◆ z2Max() [1/2]

double ZRObject::z2Max ( ) const
inlineinherited

Definition at line 87 of file ZRObject.h.

87{ return m_z2Max; }
double m_z2Max
Definition ZRObject.h:120

◆ z2Max() [2/2]

double ZRObject::z2Max ( double zmax)
inlineinherited

Definition at line 96 of file ZRObject.h.

◆ z2Min() [1/2]

double ZRObject::z2Min ( ) const
inlineinherited

Definition at line 86 of file ZRObject.h.

86{ return m_z2Min; }
double m_z2Min
Definition ZRObject.h:120

◆ z2Min() [2/2]

double ZRObject::z2Min ( double zmin)
inlineinherited

Definition at line 95 of file ZRObject.h.

◆ zMax() [1/2]

double ZRObject::zMax ( ) const
inlineinherited

Definition at line 84 of file ZRObject.h.

84{ return m_zMax; }
double m_zMax
Definition ZRObject.h:119

◆ zMax() [2/2]

double ZRObject::zMax ( double zmax)
inlineinherited

Definition at line 93 of file ZRObject.h.

93{ m_zMax = zmax; return m_zMax; }

◆ zMin() [1/2]

double ZRObject::zMin ( ) const
inlineinherited

Definition at line 83 of file ZRObject.h.

83{ return m_zMin; }
double m_zMin
Definition ZRObject.h:119

◆ zMin() [2/2]

double ZRObject::zMin ( double zmin)
inlineinherited

Definition at line 92 of file ZRObject.h.

92{ m_zMin = zmin; return m_zMin; }

Member Data Documentation

◆ m_enabled

bool ZRObject::m_enabled
protectedinherited

Definition at line 122 of file ZRObject.h.

◆ m_ID

int RegSelSubDetector::m_ID
protected

Definition at line 103 of file RegSelSubDetector.h.

◆ m_layer

std::vector<RegSelLayer> RegSelSubDetector::m_layer
protected

Definition at line 106 of file RegSelSubDetector.h.

◆ m_layermap

std::map<unsigned, unsigned> RegSelSubDetector::m_layermap
protected

Definition at line 108 of file RegSelSubDetector.h.

◆ m_mapped

bool RegSelSubDetector::m_mapped
protected

Definition at line 109 of file RegSelSubDetector.h.

◆ m_name

std::string RegSelName::m_name
protectedinherited

Definition at line 45 of file RegSelName.h.

◆ m_Nlayers

unsigned RegSelSubDetector::m_Nlayers
protected

Definition at line 105 of file RegSelSubDetector.h.

◆ m_rMax

double ZRObject::m_rMax
protectedinherited

Definition at line 118 of file ZRObject.h.

◆ m_rMin

double ZRObject::m_rMin
protectedinherited

Definition at line 118 of file ZRObject.h.

◆ m_z2Max

double ZRObject::m_z2Max
protectedinherited

Definition at line 120 of file ZRObject.h.

◆ m_z2Min

double ZRObject::m_z2Min
protectedinherited

Definition at line 120 of file ZRObject.h.

◆ m_zMax

double ZRObject::m_zMax
protectedinherited

Definition at line 119 of file ZRObject.h.

◆ m_zMin

double ZRObject::m_zMin
protectedinherited

Definition at line 119 of file ZRObject.h.


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