CMS 3D CMS Logo

GeometricTimingDet.h
Go to the documentation of this file.
1 #ifndef Geometry_MTDNumberingBuilder_GeometricTimingDet_H
2 #define Geometry_MTDNumberingBuilder_GeometricTimingDet_H
3 
12 
13 #include <vector>
14 #include <memory>
16 
17 #include <ext/pool_allocator.h>
18 
19 class DDFilteredView;
20 
27  public:
28 
31 
32  typedef std::vector< GeometricTimingDet const *> ConstGeometricTimingDetContainer;
33  typedef std::vector< GeometricTimingDet *> GeometricTimingDetContainer;
34 
35 #ifdef PoolAlloc
36  typedef std::vector< DDExpandedNode, PoolAlloc<DDExpandedNode> > GeoHistory;
37  typedef std::vector<int, PoolAlloc<int> > nav_type;
38 #else
39  typedef std::vector<DDExpandedNode> GeoHistory;
41 #endif
44 
45  //
46  // more can be added; please add at the end!
47  //
48  typedef enum GTDEnumType {unknown=100, MTD=0, BTL=1, BTLLayer=2, BTLTray=3,
50  ETL=7, ETLDisc=8, ETLRing=9, ETLModule=10,
52 
56 #ifdef GEOMETRICDETDEBUG
57  GeometricTimingDet(DDnav_type const & navtype, GeometricTimingEnumType dd);
59 #endif
62 
63 
69  //std::cout <<"setGeographicalID " << int(id) << std::endl;
70  }
71 #ifdef GEOMETRICDETDEBUG
72  void setComponents(GeometricTimingDetContainer const & cont) {
73  container_ = cont;
74  //std::cout <<"setComponents" << std::endl;
75  }
76 #endif
77  void addComponents(GeometricTimingDetContainer const & cont);
78  void addComponents(ConstGeometricTimingDetContainer const & cont);
83  void clearComponents() {
84  container_.clear();
85  }
86 
91  void deleteComponents();
92 
93  bool isLeaf() const {
94  return container_.empty();
95  }
96 
98  return const_cast<GeometricTimingDet*>(container_[index]);
99  }
100 
104  DDRotationMatrix const & rotation() const {
105  return rot_;
106  }
107  DDTranslation const & translation() const {
108  return trans_;
109  }
110  double phi() const {
111  return phi_;
112  }
113  double rho() const {
114  return rho_;
115  }
116 
117  DDSolidShape const & shape() const {
118  return shape_;
119  }
121  return type_;
122  }
123  DDName const & name() const {
124  return ddname_;
125  }
126  // internal representaion
127  nav_type const & navType() const {
128  return ddd_;
129  }
130  // representation neutral interface
131  NavRange navRange() const {
132  return NavRange(&ddd_.front(),ddd_.size());
133  }
134  // more meaningfull name (maybe)
135  NavRange navpos() const {
136  return NavRange(&ddd_.front(),ddd_.size());
137  }
138  std::vector<double> const & params() const {
139  //std::cout<<"params"<<std::endl;
140  return params_;
141  }
142 
144 
149  ConstGeometricTimingDetContainer & components() {
150  return container_;
151  }
152  ConstGeometricTimingDetContainer const & components() const {
153  return container_;
154  }
155 
161  ConstGeometricTimingDetContainer deepComponents() const;
162  void deepComponents(ConstGeometricTimingDetContainer & cont) const;
163 
164 #ifdef GEOMETRICDETDEBUG
165 
168  GeoHistory const & parents() const {
169  return parents_;
170  }
171  //rr
172 #endif
173 
178  return geographicalID_;
179  }
181  return geographicalID_;
182  }
183 
187  Position positionBounds() const;
188 
192  Rotation rotationBounds() const;
193 
197  std::unique_ptr<Bounds> bounds() const;
198 #ifdef GEOMETRICDETDEBUG
199  int copyno() const {
200  return copy_;
201  }
202  double volume() const {
203  return volume_;
204  }
205  double density() const {
206  return density_;
207  }
208  double weight() const {
209  return weight_;
210  }
211  std::string const & material() const {
212  return material_;
213  }
214 #endif
215  double radLength() const {
216  return radLength_;
217  }
218  double xi() const {
219  return xi_;
220  }
224  double pixROCRows() const {
225  return pixROCRows_;
226  }
227  double pixROCCols() const {
228  return pixROCCols_;
229  }
230  double pixROCx() const {
231  return pixROCx_;
232  }
233  double pixROCy() const {
234  return pixROCy_;
235  }
236 
240  bool stereo() const {
241  return stereo_;
242  }
243  double siliconAPVNum() const {
244  return siliconAPVNum_;
245  }
246 
250 #ifdef GEOMETRICDETDEBUG
251  bool wasBuiltFromDD() const {
252  return fromDD_;
253  }
254 #endif
255 
256  private:
257 
258  ConstGeometricTimingDetContainer container_;
260  double phi_;
261  double rho_;
264  nav_type ddd_;
267  std::vector<double> params_;
268 
270 #ifdef GEOMETRICDETDEBUG
271  GeoHistory parents_;
272  double volume_;
273  double density_;
274  double weight_;
275  int copy_;
276  std::string _material;
277 #endif
278  double radLength_;
279  double xi_;
280  double pixROCRows_;
281  double pixROCCols_;
282  double pixROCx_;
283  double pixROCy_;
284  bool stereo_;
286 #ifdef GEOMETRICDETDEBUG
287  bool fromDD_;
288 #endif
289 
290 };
291 
292 #undef PoolAlloc
293 #endif
294 
std::vector< GeometricTimingDet * > GeometricTimingDetContainer
TPRegexp parents
Definition: eve_filter.cc:21
GeometricTimingEnumType type_
std::vector< DDExpandedNode > GeoHistory
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
DDSolidShape
Definition: DDSolidShapes.h:6
DetId geographicalId() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
bool ev
GeometricTimingEnumType type() const
void addComponents(GeometricTimingDetContainer const &cont)
Position positionBounds() const
std::pair< int const *, size_t > NavRange
double siliconAPVNum() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
double pixROCCols() const
NavRange navRange() const
std::vector< double > params_
double radLength() const
ConstGeometricTimingDetContainer & components()
std::unique_ptr< Bounds > bounds() const
DDTranslation const & translation() const
Surface::PositionType Position
ConstGeometricTimingDetContainer deepComponents() const
void addComponent(GeometricTimingDet *)
GeometricTimingDet(DDFilteredView *fv, GeometricTimingEnumType dd)
GeometricTimingDet * component(size_t index)
DDExpandedView::nav_type nav_type
NavRange navpos() const
DDExpandedView::NavRange NavRange
void setGeographicalID(DetId id)
double pixROCRows() const
DDExpandedView::nav_type DDnav_type
nav_type const & navType() const
enum GeometricTimingDet::GTDEnumType GeometricTimingEnumType
Definition: DetId.h:18
DetId geographicalID() const
std::vector< double > const & params() const
DDName const & name() const
double pixROCx() const
DDRotationMatrix const & rotation() const
ConstGeometricTimingDetContainer const & components() const
Surface::RotationType Rotation
DDSolidShape const & shape() const
double pixROCy() const
Provides an exploded view of the detector (tree-view)
DDRotationMatrix rot_
ConstGeometricTimingDetContainer container_
Rotation rotationBounds() const
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer
std::vector< int > nav_type
std::vector of sibling numbers