test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GeometricDet.h
Go to the documentation of this file.
1 #ifndef Geometry_TrackerNumberingBuilder_GeometricDet_H
2 #define Geometry_TrackerNumberingBuilder_GeometricDet_H
3 
12 
13 #include <vector>
14 #include <memory>
16 
17 #include <ext/pool_allocator.h>
18 // waiting for template-alias
19 //#define PoolAlloc __gnu_cxx::__pool_alloc
20 // MEC: testing whether we need all bits-and-pieces. Setting this makes GeometricDet like it used to be.
21 //#define GEOMETRICDETDEBUG
22 //class DetId;
23 class DDFilteredView;
24 
30 class GeometricDet {
31  public:
32 
35 
36  typedef std::vector< GeometricDet const *> ConstGeometricDetContainer;
37  typedef std::vector< GeometricDet *> GeometricDetContainer;
38 
39 #ifdef PoolAlloc
40  typedef std::vector< DDExpandedNode, PoolAlloc<DDExpandedNode> > GeoHistory;
41  typedef std::vector<int, PoolAlloc<int> > nav_type;
42 #else
43  typedef std::vector<DDExpandedNode> GeoHistory;
45 #endif
48 
49  //
50  // more can be added; please add at the end!
51  //
52  typedef enum GDEnumType {unknown=100, Tracker=0, PixelBarrel=1, PixelEndCap=2,
53  TIB=3, TID=4, TOB=5, TEC=6,
54  layer=8, wheel=9, strng=10, rod=11, petal=12, ring=13,
55  ladder=14, mergedDet=15, DetUnit=16, disk=17, panel=18,
64 #ifdef GEOMETRICDETDEBUG
65  GeometricDet(DDnav_type const & navtype, GeometricEnumType dd);
67 #endif
70 
71  /*
72  GeometricDet(const GeometricDet &);
73 
74  GeometricDet & operator=( const GeometricDet & );
75  */
76 
81  _geographicalID = id;
82  //std::cout <<"setGeographicalID " << int(id) << std::endl;
83  }
84 #ifdef GEOMETRICDETDEBUG
85  void setComponents(GeometricDetContainer const & cont) {
86  _container = cont;
87  //std::cout <<"setComponents" << std::endl;
88  }
89 #endif
96  void clearComponents() {
97  _container.clear();
98  //std::cout<<"clearComponents"<<std::endl;
99  }
100 
105  void deleteComponents();
106 
107  bool isLeaf() const {
108  //std::cout <<"isLeaf() ==" <<_container.empty()<<std::endl;
109  return _container.empty();
110  }
111 
113  return const_cast<GeometricDet*>(_container[index]);
114  }
115 
119  DDRotationMatrix const & rotation() const {
120  //std::cout<<"rotation" <<std::endl;
121  return _rot;
122  }
123  DDTranslation const & translation() const {
124  //std::cout<<"translation" <<std::endl;
125  return _trans;
126  }
127  double phi() const {
128  //std::cout<<"phi"<<std::endl;
129  return _phi;
130  }
131  double rho() const {
132  //std::cout << "rho" <<std::endl;
133  return _rho;
134  }
135 
136  DDSolidShape const & shape() const {
137  //std::cout<<"shape"<<std::endl;
138  return _shape;
139  }
141  //std::cout<<"type"<<std::endl;
142  return _type;
143  }
144  DDName const & name() const {
145  //std::cout<<"name"<<std::endl;
146  return _ddname;
147  }
148  // internal representaion
149  nav_type const & navType() const {
150  //std::cout<<"navType"<<std::endl;
151  return _ddd;
152  }
153  // representation neutral interface
154  NavRange navRange() const {
155  //std::cout<<"navRange"<<std::endl;
156  return NavRange(&_ddd.front(),_ddd.size());
157  }
158  // more meaningfull name (maybe)
159  NavRange navpos() const {
160  //std::cout<<"navpos"<<std::endl;
161  return NavRange(&_ddd.front(),_ddd.size());
162  }
163  std::vector<double> const & params() const {
164  //std::cout<<"params"<<std::endl;
165  return _params;
166  }
167 
168  ~GeometricDet();
169 
175  //std::cout << "components1" <<std::endl;
176  return _container;
177  }
179  //std::cout<<"const components2 "<<std::endl;
180  return _container;
181  }
182 
190 
191 #ifdef GEOMETRICDETDEBUG
192  //rr
196  GeoHistory const & parents() const {
197  //std::cout<<"parents"<<std::endl;
198  return _parents;
199  }
200  //rr
201 #endif
202 
207  //std::cout<<"geographicalID"<<std::endl;
208  return _geographicalID;
209  }
211  //std::cout<<"geographicalId"<<std::endl;
212  return _geographicalID;
213  }
214 
218  Position positionBounds() const;
219 
223  Rotation rotationBounds() const;
224 
228  std::unique_ptr<Bounds> bounds() const;
229 #ifdef GEOMETRICDETDEBUG
230  int copyno() const {
231  //std::cout<<"copyno"<<std::endl;
232  return _copy;
233  }
234  double volume() const {
235  //std::cout<<"volume"<<std::endl;
236  return _volume;
237  }
238  double density() const {
239  //std::cout<<"density"<<std::endl;
240  return _density;
241  }
242  double weight() const {
243  //std::cout<<"weight"<<std::endl;
244  return _weight;
245  }
246  std::string const & material() const {
247  //std::cout<<"material"<<std::endl;
248  return _material;
249  }
250 #endif
251  double radLength() const {
252  //std::cout<<"radLength"<<std::endl;
253  return _radLength;
254  }
255  double xi() const {
256  //std::cout<<"xi - chi"<<std::endl;
257  return _xi;
258  }
262  double pixROCRows() const {
263  //std::cout<<"pixROCRows"<<std::endl;
264  return _pixROCRows;
265  }
266  double pixROCCols() const {
267  //std::cout<<"pixROCCols"<<std::endl;
268  return _pixROCCols;
269  }
270  double pixROCx() const {
271  //std::cout<<"pixROCx"<<std::endl;
272  return _pixROCx;
273  }
274  double pixROCy() const {
275  //std::cout<<"pixROCy"<<std::endl;
276  return _pixROCy;
277  }
278 
282  bool stereo() const {
283  //std::cout<<"stereo"<<std::endl;
284  return _stereo;
285  }
286  double siliconAPVNum() const {
287  //std::cout<<"siliconAPVNum"<<std::endl;
288  return _siliconAPVNum;
289  }
290 
294 #ifdef GEOMETRICDETDEBUG
295  bool wasBuiltFromDD() const {
296  //std::cout<<"wasBuildFromDD"<<std::endl;
297  return _fromDD;
298  }
299 #endif
300 
301  private:
302 
305  double _phi;
306  double _rho;
312  std::vector<double> _params;
313 
315 #ifdef GEOMETRICDETDEBUG
316  GeoHistory _parents;
317  double _volume;
318  double _density;
319  double _weight;
320  int _copy;
321  std::string _material;
322 #endif
323  double _radLength;
324  double _xi;
325  double _pixROCRows;
326  double _pixROCCols;
327  double _pixROCx;
328  double _pixROCy;
329  bool _stereo;
331 #ifdef GEOMETRICDETDEBUG
332  bool _fromDD;
333 #endif
334 
335 };
336 
337 #undef PoolAlloc
338 #endif
339 
ConstGeometricDetContainer _container
Definition: GeometricDet.h:303
double pixROCy() const
Definition: GeometricDet.h:274
double _pixROCCols
Definition: GeometricDet.h:326
double radLength() const
Definition: GeometricDet.h:251
TPRegexp parents
Definition: eve_filter.cc:21
DDName _ddname
Definition: GeometricDet.h:310
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
double _pixROCRows
Definition: GeometricDet.h:325
void addComponent(GeometricDet *)
nav_type const & navType() const
Definition: GeometricDet.h:149
double _pixROCy
Definition: GeometricDet.h:328
void clearComponents()
Definition: GeometricDet.h:96
DDSolidShape
Definition: DDSolidShapes.h:6
DDSolidShape const & shape() const
Definition: GeometricDet.h:136
double _siliconAPVNum
Definition: GeometricDet.h:330
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
void setGeographicalID(DetId id)
Definition: GeometricDet.h:80
Surface::RotationType Rotation
Definition: GeometricDet.h:47
bool isLeaf() const
Definition: GeometricDet.h:107
bool ev
DDTranslation _trans
Definition: GeometricDet.h:304
GeometricEnumType _type
Definition: GeometricDet.h:311
DetId geographicalID() const
Definition: GeometricDet.h:206
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:37
Surface::PositionType Position
Definition: GeometricDet.h:46
double _pixROCx
Definition: GeometricDet.h:327
std::pair< int const *, size_t > NavRange
enum GeometricDet::GDEnumType GeometricEnumType
nav_type _ddd
Definition: GeometricDet.h:309
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
std::vector< double > const & params() const
Definition: GeometricDet.h:163
DDName const & name() const
Definition: GeometricDet.h:144
Position positionBounds() const
NavRange navRange() const
Definition: GeometricDet.h:154
std::vector< double > _params
Definition: GeometricDet.h:312
GeometricDet(DDFilteredView *fv, GeometricEnumType dd)
std::unique_ptr< Bounds > bounds() const
DDTranslation const & translation() const
Definition: GeometricDet.h:123
double pixROCCols() const
Definition: GeometricDet.h:266
DDRotationMatrix const & rotation() const
Definition: GeometricDet.h:119
GeometricDet * component(size_t index)
Definition: GeometricDet.h:112
DetId _geographicalID
Definition: GeometricDet.h:314
void deleteComponents()
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
DDSolidShape _shape
Definition: GeometricDet.h:308
Definition: DetId.h:18
ConstGeometricDetContainer const & components() const
Definition: GeometricDet.h:178
double xi() const
Definition: GeometricDet.h:255
DetId geographicalId() const
Definition: GeometricDet.h:210
double pixROCx() const
Definition: GeometricDet.h:270
double _radLength
Definition: GeometricDet.h:323
NavRange navpos() const
Definition: GeometricDet.h:159
double phi() const
Definition: GeometricDet.h:127
ConstGeometricDetContainer deepComponents() const
void addComponents(GeometricDetContainer const &cont)
Rotation rotationBounds() const
DDRotationMatrix _rot
Definition: GeometricDet.h:307
double siliconAPVNum() const
Definition: GeometricDet.h:286
DDExpandedView::nav_type nav_type
Definition: GeometricDet.h:44
bool stereo() const
Definition: GeometricDet.h:282
DDExpandedView::nav_type DDnav_type
Definition: GeometricDet.h:33
double pixROCRows() const
Definition: GeometricDet.h:262
Provides an exploded view of the detector (tree-view)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
GeometricEnumType type() const
Definition: GeometricDet.h:140
DDExpandedView::NavRange NavRange
Definition: GeometricDet.h:34
double rho() const
Definition: GeometricDet.h:131
std::vector< int > nav_type
std::vector of sibling numbers
std::vector< DDExpandedNode > GeoHistory
Definition: GeometricDet.h:43