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,
59 #ifdef GEOMETRICDETDEBUG
60  GeometricDet(DDnav_type const & navtype, GeometricEnumType dd);
62 #endif
65 
66  /*
67  GeometricDet(const GeometricDet &);
68 
69  GeometricDet & operator=( const GeometricDet & );
70  */
71 
76  _geographicalID = id;
77  //std::cout <<"setGeographicalID " << int(id) << std::endl;
78  }
79 #ifdef GEOMETRICDETDEBUG
80  void setComponents(GeometricDetContainer const & cont) {
81  _container = cont;
82  //std::cout <<"setComponents" << std::endl;
83  }
84 #endif
91  void clearComponents() {
92  _container.clear();
93  //std::cout<<"clearComponents"<<std::endl;
94  }
95 
100  void deleteComponents();
101 
102  bool isLeaf() const {
103  //std::cout <<"isLeaf() ==" <<_container.empty()<<std::endl;
104  return _container.empty();
105  }
106 
108  return const_cast<GeometricDet*>(_container[index]);
109  }
110 
114  DDRotationMatrix const & rotation() const {
115  //std::cout<<"rotation" <<std::endl;
116  return _rot;
117  }
118  DDTranslation const & translation() const {
119  //std::cout<<"translation" <<std::endl;
120  return _trans;
121  }
122  double phi() const {
123  //std::cout<<"phi"<<std::endl;
124  return _phi;
125  }
126  double rho() const {
127  //std::cout << "rho" <<std::endl;
128  return _rho;
129  }
130 
131  DDSolidShape const & shape() const {
132  //std::cout<<"shape"<<std::endl;
133  return _shape;
134  }
136  //std::cout<<"type"<<std::endl;
137  return _type;
138  }
139  DDName const & name() const {
140  //std::cout<<"name"<<std::endl;
141  return _ddname;
142  }
143  // internal representaion
144  nav_type const & navType() const {
145  //std::cout<<"navType"<<std::endl;
146  return _ddd;
147  }
148  // representation neutral interface
149  NavRange navRange() const {
150  //std::cout<<"navRange"<<std::endl;
151  return NavRange(&_ddd.front(),_ddd.size());
152  }
153  // more meaningfull name (maybe)
154  NavRange navpos() const {
155  //std::cout<<"navpos"<<std::endl;
156  return NavRange(&_ddd.front(),_ddd.size());
157  }
158  std::vector<double> const & params() const {
159  //std::cout<<"params"<<std::endl;
160  return _params;
161  }
162 
163  ~GeometricDet();
164 
170  //std::cout << "components1" <<std::endl;
171  return _container;
172  }
174  //std::cout<<"const components2 "<<std::endl;
175  return _container;
176  }
177 
185 
186 #ifdef GEOMETRICDETDEBUG
187  //rr
191  GeoHistory const & parents() const {
192  //std::cout<<"parents"<<std::endl;
193  return _parents;
194  }
195  //rr
196 #endif
197 
202  //std::cout<<"geographicalID"<<std::endl;
203  return _geographicalID;
204  }
206  //std::cout<<"geographicalId"<<std::endl;
207  return _geographicalID;
208  }
209 
213  Position positionBounds() const;
214 
218  Rotation rotationBounds() const;
219 
223  std::unique_ptr<Bounds> bounds() const;
224 #ifdef GEOMETRICDETDEBUG
225  int copyno() const {
226  //std::cout<<"copyno"<<std::endl;
227  return _copy;
228  }
229  double volume() const {
230  //std::cout<<"volume"<<std::endl;
231  return _volume;
232  }
233  double density() const {
234  //std::cout<<"density"<<std::endl;
235  return _density;
236  }
237  double weight() const {
238  //std::cout<<"weight"<<std::endl;
239  return _weight;
240  }
241  std::string const & material() const {
242  //std::cout<<"material"<<std::endl;
243  return _material;
244  }
245 #endif
246  double radLength() const {
247  //std::cout<<"radLength"<<std::endl;
248  return _radLength;
249  }
250  double xi() const {
251  //std::cout<<"xi - chi"<<std::endl;
252  return _xi;
253  }
257  double pixROCRows() const {
258  //std::cout<<"pixROCRows"<<std::endl;
259  return _pixROCRows;
260  }
261  double pixROCCols() const {
262  //std::cout<<"pixROCCols"<<std::endl;
263  return _pixROCCols;
264  }
265  double pixROCx() const {
266  //std::cout<<"pixROCx"<<std::endl;
267  return _pixROCx;
268  }
269  double pixROCy() const {
270  //std::cout<<"pixROCy"<<std::endl;
271  return _pixROCy;
272  }
273 
277  bool stereo() const {
278  //std::cout<<"stereo"<<std::endl;
279  return _stereo;
280  }
281  double siliconAPVNum() const {
282  //std::cout<<"siliconAPVNum"<<std::endl;
283  return _siliconAPVNum;
284  }
285 
289 #ifdef GEOMETRICDETDEBUG
290  bool wasBuiltFromDD() const {
291  //std::cout<<"wasBuildFromDD"<<std::endl;
292  return _fromDD;
293  }
294 #endif
295 
296  private:
297 
300  double _phi;
301  double _rho;
307  std::vector<double> _params;
308 
310 #ifdef GEOMETRICDETDEBUG
311  GeoHistory _parents;
312  double _volume;
313  double _density;
314  double _weight;
315  int _copy;
316  std::string _material;
317 #endif
318  double _radLength;
319  double _xi;
320  double _pixROCRows;
321  double _pixROCCols;
322  double _pixROCx;
323  double _pixROCy;
324  bool _stereo;
326 #ifdef GEOMETRICDETDEBUG
327  bool _fromDD;
328 #endif
329 
330 };
331 
332 #undef PoolAlloc
333 #endif
334 
ConstGeometricDetContainer _container
Definition: GeometricDet.h:298
double pixROCy() const
Definition: GeometricDet.h:269
double _pixROCCols
Definition: GeometricDet.h:321
double radLength() const
Definition: GeometricDet.h:246
TPRegexp parents
Definition: eve_filter.cc:24
DDName _ddname
Definition: GeometricDet.h:305
double _pixROCRows
Definition: GeometricDet.h:320
void addComponent(GeometricDet *)
nav_type const & navType() const
Definition: GeometricDet.h:144
double _pixROCy
Definition: GeometricDet.h:323
void clearComponents()
Definition: GeometricDet.h:91
DDSolidShape
Definition: DDSolidShapes.h:6
DDSolidShape const & shape() const
Definition: GeometricDet.h:131
double _siliconAPVNum
Definition: GeometricDet.h:325
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
void setGeographicalID(DetId id)
Definition: GeometricDet.h:75
Surface::RotationType Rotation
Definition: GeometricDet.h:47
bool isLeaf() const
Definition: GeometricDet.h:102
bool ev
DDTranslation _trans
Definition: GeometricDet.h:299
GeometricEnumType _type
Definition: GeometricDet.h:306
DetId geographicalID() const
Definition: GeometricDet.h:201
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:37
Surface::PositionType Position
Definition: GeometricDet.h:46
double _pixROCx
Definition: GeometricDet.h:322
std::pair< int const *, size_t > NavRange
enum GeometricDet::GDEnumType GeometricEnumType
nav_type _ddd
Definition: GeometricDet.h:304
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:169
std::vector< double > const & params() const
Definition: GeometricDet.h:158
DDName const & name() const
Definition: GeometricDet.h:139
Position positionBounds() const
NavRange navRange() const
Definition: GeometricDet.h:149
std::vector< double > _params
Definition: GeometricDet.h:307
GeometricDet(DDFilteredView *fv, GeometricEnumType dd)
std::unique_ptr< Bounds > bounds() const
DDTranslation const & translation() const
Definition: GeometricDet.h:118
double pixROCCols() const
Definition: GeometricDet.h:261
DDRotationMatrix const & rotation() const
Definition: GeometricDet.h:114
GeometricDet * component(size_t index)
Definition: GeometricDet.h:107
DetId _geographicalID
Definition: GeometricDet.h:309
void deleteComponents()
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
DDSolidShape _shape
Definition: GeometricDet.h:303
Definition: DetId.h:18
ConstGeometricDetContainer const & components() const
Definition: GeometricDet.h:173
double xi() const
Definition: GeometricDet.h:250
DetId geographicalId() const
Definition: GeometricDet.h:205
double pixROCx() const
Definition: GeometricDet.h:265
int cont
double _radLength
Definition: GeometricDet.h:318
NavRange navpos() const
Definition: GeometricDet.h:154
double phi() const
Definition: GeometricDet.h:122
ConstGeometricDetContainer deepComponents() const
void addComponents(GeometricDetContainer const &cont)
Rotation rotationBounds() const
DDRotationMatrix _rot
Definition: GeometricDet.h:302
double siliconAPVNum() const
Definition: GeometricDet.h:281
DDExpandedView::nav_type nav_type
Definition: GeometricDet.h:44
int weight
Definition: histoStyle.py:50
bool stereo() const
Definition: GeometricDet.h:277
DDExpandedView::nav_type DDnav_type
Definition: GeometricDet.h:33
double pixROCRows() const
Definition: GeometricDet.h:257
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:135
DDExpandedView::NavRange NavRange
Definition: GeometricDet.h:34
double rho() const
Definition: GeometricDet.h:126
std::vector< int > nav_type
std::vector of sibling numbers
std::vector< DDExpandedNode > GeoHistory
Definition: GeometricDet.h:43