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>
15 
16 #include <ext/pool_allocator.h>
17 // waiting for template-alias
18 //#define PoolAlloc __gnu_cxx::__pool_alloc
19 // MEC: testing whether we need all bits-and-pieces. Setting this makes GeometricDet like it used to be.
20 //#define GEOMETRICDETDEBUG
21 //class DetId;
22 class DDFilteredView;
23 
29 class GeometricDet {
30  public:
31 
34 
35  typedef std::vector< GeometricDet const *> ConstGeometricDetContainer;
36  typedef std::vector< GeometricDet const *> GeometricDetContainer;
37 
38 #ifdef PoolAlloc
39  typedef std::vector< DDExpandedNode, PoolAlloc<DDExpandedNode> > GeoHistory;
40  typedef std::vector<int, PoolAlloc<int> > nav_type;
41 #else
42  typedef std::vector<DDExpandedNode> GeoHistory;
44 #endif
47 
48  //
49  // more can be added; please add at the end!
50  //
51  typedef enum GDEnumType {unknown=100, Tracker=0, PixelBarrel=1, PixelEndCap=2,
52  TIB=3, TID=4, TOB=5, TEC=6,
53  layer=8, wheel=9, strng=10, rod=11, petal=12, ring=13,
58 #ifdef GEOMETRICDETDEBUG
59  GeometricDet(DDnav_type const & navtype, GeometricEnumType dd);
61 #endif
64 
65  /*
66  GeometricDet(const GeometricDet &);
67 
68  GeometricDet & operator=( const GeometricDet & );
69  */
70 
74  void setGeographicalID(DetId id) const {
75  _geographicalID = id;
76  //std::cout <<"setGeographicalID " << int(id) << std::endl;
77  }
78 #ifdef GEOMETRICDETDEBUG
79  void setComponents(GeometricDetContainer const & cont) {
80  _container = cont;
81  //std::cout <<"setComponents" << std::endl;
82  }
83 #endif
89  void clearComponents() {
90  _container.clear();
91  //std::cout<<"clearComponents"<<std::endl;
92  }
93 
98  void deleteComponents();
99 
100  bool isLeaf() const {
101  //std::cout <<"isLeaf() ==" <<_container.empty()<<std::endl;
102  return _container.empty();
103  }
104 
108  DDRotationMatrix const & rotation() const {
109  //std::cout<<"rotation" <<std::endl;
110  return _rot;
111  }
112  DDTranslation const & translation() const {
113  //std::cout<<"translation" <<std::endl;
114  return _trans;
115  }
116  double phi() const {
117  //std::cout<<"phi"<<std::endl;
118  return _phi;
119  }
120  double rho() const {
121  //std::cout << "rho" <<std::endl;
122  return _rho;
123  }
124 
125  DDSolidShape const & shape() const {
126  //std::cout<<"shape"<<std::endl;
127  return _shape;
128  }
130  //std::cout<<"type"<<std::endl;
131  return _type;
132  }
133  DDName const & name() const {
134  //std::cout<<"name"<<std::endl;
135  return _ddname;
136  }
137  // internal representaion
138  nav_type const & navType() const {
139  //std::cout<<"navType"<<std::endl;
140  return _ddd;
141  }
142  // representation neutral interface
143  NavRange navRange() const {
144  //std::cout<<"navRange"<<std::endl;
145  return NavRange(&_ddd.front(),_ddd.size());
146  }
147  // more meaningfull name (maybe)
148  NavRange navpos() const {
149  //std::cout<<"navpos"<<std::endl;
150  return NavRange(&_ddd.front(),_ddd.size());
151  }
152  std::vector<double> const & params() const {
153  //std::cout<<"params"<<std::endl;
154  return _params;
155  }
156 
157  ~GeometricDet();
158 
164  //std::cout << "components1" <<std::endl;
165  return _container;
166  }
168  //std::cout<<"const components2 "<<std::endl;
169  return _container;
170  }
171 
179 
180 #ifdef GEOMETRICDETDEBUG
181  //rr
185  GeoHistory const & parents() const {
186  //std::cout<<"parents"<<std::endl;
187  return _parents;
188  }
189  //rr
190 #endif
191 
196  //std::cout<<"geographicalID"<<std::endl;
197  return _geographicalID;
198  }
200  //std::cout<<"geographicalId"<<std::endl;
201  return _geographicalID;
202  }
203 
207  Position positionBounds() const;
208 
212  Rotation rotationBounds() const;
213 
217  Bounds * bounds() const;
218 #ifdef GEOMETRICDETDEBUG
219  int copyno() const {
220  //std::cout<<"copyno"<<std::endl;
221  return _copy;
222  }
223  double volume() const {
224  //std::cout<<"volume"<<std::endl;
225  return _volume;
226  }
227  double density() const {
228  //std::cout<<"density"<<std::endl;
229  return _density;
230  }
231  double weight() const {
232  //std::cout<<"weight"<<std::endl;
233  return _weight;
234  }
235  std::string const & material() const {
236  //std::cout<<"material"<<std::endl;
237  return _material;
238  }
239 #endif
240  double radLength() const {
241  //std::cout<<"radLength"<<std::endl;
242  return _radLength;
243  }
244  double xi() const {
245  //std::cout<<"xi - chi"<<std::endl;
246  return _xi;
247  }
251  double pixROCRows() const {
252  //std::cout<<"pixROCRows"<<std::endl;
253  return _pixROCRows;
254  }
255  double pixROCCols() const {
256  //std::cout<<"pixROCCols"<<std::endl;
257  return _pixROCCols;
258  }
259  double pixROCx() const {
260  //std::cout<<"pixROCx"<<std::endl;
261  return _pixROCx;
262  }
263  double pixROCy() const {
264  //std::cout<<"pixROCy"<<std::endl;
265  return _pixROCy;
266  }
267 
271  bool stereo() const {
272  //std::cout<<"stereo"<<std::endl;
273  return _stereo;
274  }
275  double siliconAPVNum() const {
276  //std::cout<<"siliconAPVNum"<<std::endl;
277  return _siliconAPVNum;
278  }
279 
283 #ifdef GEOMETRICDETDEBUG
284  bool wasBuiltFromDD() const {
285  //std::cout<<"wasBuildFromDD"<<std::endl;
286  return _fromDD;
287  }
288 #endif
289 
290  private:
291 
294  double _phi;
295  double _rho;
301  std::vector<double> _params;
302  //FIXME
304 #ifdef GEOMETRICDETDEBUG
305  GeoHistory _parents;
306  double _volume;
307  double _density;
308  double _weight;
309  int _copy;
310  std::string _material;
311 #endif
312  double _radLength;
313  double _xi;
314  double _pixROCRows;
315  double _pixROCCols;
316  double _pixROCx;
317  double _pixROCy;
318  bool _stereo;
320 #ifdef GEOMETRICDETDEBUG
321  bool _fromDD;
322 #endif
323 
324 };
325 
326 #undef PoolAlloc
327 #endif
328 
double pixROCy() const
Definition: GeometricDet.h:263
double _pixROCCols
Definition: GeometricDet.h:315
double radLength() const
Definition: GeometricDet.h:240
TPRegexp parents
Definition: eve_filter.cc:24
void setGeographicalID(DetId id) const
Definition: GeometricDet.h:74
DDName _ddname
Definition: GeometricDet.h:299
double _pixROCRows
Definition: GeometricDet.h:314
void addComponent(GeometricDet *)
nav_type const & navType() const
Definition: GeometricDet.h:138
double _pixROCy
Definition: GeometricDet.h:317
void clearComponents()
Definition: GeometricDet.h:89
DDSolidShape
Definition: DDSolidShapes.h:6
DDSolidShape const & shape() const
Definition: GeometricDet.h:125
double _siliconAPVNum
Definition: GeometricDet.h:319
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
Surface::RotationType Rotation
Definition: GeometricDet.h:46
bool isLeaf() const
Definition: GeometricDet.h:100
DDTranslation _trans
Definition: GeometricDet.h:293
GeometricEnumType _type
Definition: GeometricDet.h:300
DetId geographicalID() const
Definition: GeometricDet.h:195
Surface::PositionType Position
Definition: GeometricDet.h:45
double _pixROCx
Definition: GeometricDet.h:316
std::pair< int const *, size_t > NavRange
enum GeometricDet::GDEnumType GeometricEnumType
std::vector< GeometricDet const * > GeometricDetContainer
Definition: GeometricDet.h:36
nav_type _ddd
Definition: GeometricDet.h:298
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::vector< double > const & params() const
Definition: GeometricDet.h:152
DDName const & name() const
Definition: GeometricDet.h:133
Position positionBounds() const
GeometricDetContainer const & components() const
Definition: GeometricDet.h:167
NavRange navRange() const
Definition: GeometricDet.h:143
std::vector< double > _params
Definition: GeometricDet.h:301
GeometricDet(DDFilteredView *fv, GeometricEnumType dd)
DDTranslation const & translation() const
Definition: GeometricDet.h:112
double pixROCCols() const
Definition: GeometricDet.h:255
DDRotationMatrix const & rotation() const
Definition: GeometricDet.h:108
DetId _geographicalID
Definition: GeometricDet.h:303
void deleteComponents()
Bounds * bounds() const
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:35
DDSolidShape _shape
Definition: GeometricDet.h:297
Definition: DetId.h:20
double xi() const
Definition: GeometricDet.h:244
DetId geographicalId() const
Definition: GeometricDet.h:199
double pixROCx() const
Definition: GeometricDet.h:259
int cont
double _radLength
Definition: GeometricDet.h:312
NavRange navpos() const
Definition: GeometricDet.h:148
double phi() const
Definition: GeometricDet.h:116
ConstGeometricDetContainer deepComponents() const
GeometricDetContainer & components()
Definition: GeometricDet.h:163
void addComponents(GeometricDetContainer const &cont)
Rotation rotationBounds() const
DDRotationMatrix _rot
Definition: GeometricDet.h:296
double siliconAPVNum() const
Definition: GeometricDet.h:275
DDExpandedView::nav_type nav_type
Definition: GeometricDet.h:43
Definition: Bounds.h:22
int weight
Definition: histoStyle.py:50
bool stereo() const
Definition: GeometricDet.h:271
GeometricDetContainer _container
Definition: GeometricDet.h:292
DDExpandedView::nav_type DDnav_type
Definition: GeometricDet.h:32
double pixROCRows() const
Definition: GeometricDet.h:251
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:129
DDExpandedView::NavRange NavRange
Definition: GeometricDet.h:33
double rho() const
Definition: GeometricDet.h:120
std::vector< int > nav_type
std::vector of sibling numbers
std::vector< DDExpandedNode > GeoHistory
Definition: GeometricDet.h:42