ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
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 63 of file RegSelSubDetector.h.

65 :
66  ZRObject(rmin, rmax, zmin, zmax), m_ID(0), m_Nlayers(0), m_mapped(false)

◆ RegSelSubDetector() [2/6]

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

Definition at line 65 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() [3/6]

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

Definition at line 69 of file RegSelSubDetector.h.

◆ RegSelSubDetector() [4/6]

RegSelSubDetector::RegSelSubDetector ( int  ID)
inline

Definition at line 73 of file RegSelSubDetector.h.

74  { }
75 

◆ RegSelSubDetector() [5/6]

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

Definition at line 79 of file RegSelSubDetector.h.

◆ RegSelSubDetector() [6/6]

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

Definition at line 85 of file RegSelSubDetector.h.

88  { return m_ID; }
89  int Nlayers() const { return m_Nlayers; }

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  }

◆ _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  }

◆ 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 }

◆ disable()

bool ZRObject::disable ( )
inlineinherited

Definition at line 100 of file ZRObject.h.

100 { return m_enabled=false; }

◆ 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 {
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 107 of file RegSelSubDetector.h.

◆ 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 {
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 111 of file RegSelSubDetector.h.

◆ 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 }

◆ 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 54 of file RegSelName.h.

◆ ID()

int RegSelSubDetector::ID ( ) const
inline

Definition at line 103 of file RegSelSubDetector.h.

◆ 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  }

◆ Nlayers()

int RegSelSubDetector::Nlayers ( ) const
inline

Definition at line 104 of file RegSelSubDetector.h.

◆ 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; }

◆ 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; }

◆ 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  {
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; }

◆ z2Max() [2/2]

double ZRObject::z2Max ( double  zmax)
inlineinherited

Definition at line 96 of file ZRObject.h.

96 { m_z2Max = zmax; return m_z2Max; }

◆ z2Min() [1/2]

double ZRObject::z2Min ( ) const
inlineinherited

Definition at line 86 of file ZRObject.h.

86 { return m_z2Min; }

◆ z2Min() [2/2]

double ZRObject::z2Min ( double  zmin)
inlineinherited

Definition at line 95 of file ZRObject.h.

95 { m_z2Min = zmin; return m_z2Min; }

◆ zMax() [1/2]

double ZRObject::zMax ( ) const
inlineinherited

Definition at line 84 of file ZRObject.h.

84 { return m_zMax; }

◆ 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; }

◆ 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 118 of file RegSelSubDetector.h.

◆ m_layer

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

Definition at line 121 of file RegSelSubDetector.h.

◆ m_layermap

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

Definition at line 123 of file RegSelSubDetector.h.

◆ m_mapped

bool RegSelSubDetector::m_mapped
protected

Definition at line 124 of file RegSelSubDetector.h.

◆ m_name

std::string RegSelName::m_name
protectedinherited

Definition at line 60 of file RegSelName.h.

◆ m_Nlayers

unsigned RegSelSubDetector::m_Nlayers
protected

Definition at line 120 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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
RegSelSubDetector::m_Nlayers
unsigned m_Nlayers
Definition: RegSelSubDetector.h:120
ZRObject::z2Min
double z2Min() const
Definition: ZRObject.h:86
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
ZRObject::ZRObject
ZRObject()
Definition: ZRObject.h:45
RegSelSubDetector::m_mapped
bool m_mapped
Definition: RegSelSubDetector.h:124
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
TRTCalib_cfilter.detector
detector
Definition: TRTCalib_cfilter.py:241
ZRObject::m_zMax
double m_zMax
Definition: ZRObject.h:119
ZRObject::m_z2Max
double m_z2Max
Definition: ZRObject.h:120
ZRObject::m_enabled
bool m_enabled
Definition: ZRObject.h:122
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
ZRObject::rMin
double rMin() const
Definition: ZRObject.h:80
calceta
double calceta(double r, double z)
Definition: ZRObject.h:33
RegSelSubDetector::m_ID
int m_ID
Definition: RegSelSubDetector.h:118
RegSelSubDetector::reset
void reset()
Definition: RegSelSubDetector.cxx:85
RegSelSubDetector::m_layer
std::vector< RegSelLayer > m_layer
Definition: RegSelSubDetector.h:121
ZRObject::rMax
double rMax() const
Definition: ZRObject.h:81
ZRObject::m_rMax
double m_rMax
Definition: ZRObject.h:118
ZRObject::zMin
double zMin() const
Definition: ZRObject.h:83
RegSelSubDetector::ID
int ID() const
Definition: RegSelSubDetector.h:103
RegSelSubDetector::Nlayers
int Nlayers() const
Definition: RegSelSubDetector.h:104
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
RegSelRoI::getzMax
double getzMax() const
Definition: RegSelRoI.h:60
ZRObject::m_z2Min
double m_z2Min
Definition: ZRObject.h:120
RegSelRoI::getzMin
double getzMin() const
Definition: RegSelRoI.h:59
ZRObject::z2Max
double z2Max() const
Definition: ZRObject.h:87
ZRObject::zMax
double zMax() const
Definition: ZRObject.h:84
ZRObject::m_zMin
double m_zMin
Definition: ZRObject.h:119
ZRObject::m_rMin
double m_rMin
Definition: ZRObject.h:118
RegSelSubDetector::m_layermap
std::map< unsigned, unsigned > m_layermap
Definition: RegSelSubDetector.h:123
ZRObject::enabled
bool enabled() const
Definition: ZRObject.h:98
ZRObject::inRoI
virtual bool inRoI(const RegSelRoI &roi) const
Definition: ZRObject.h:71