Go to the documentation of this file.00001 #ifndef Geometry_TrackerNumberingBuilder_GeometricDet_H
00002 #define Geometry_TrackerNumberingBuilder_GeometricDet_H
00003
00004 #include "CondFormats/GeometryObjects/interface/PGeometricDet.h"
00005 #include "DetectorDescription/Core/interface/DDExpandedView.h"
00006 #include "DetectorDescription/Base/interface/DDRotationMatrix.h"
00007 #include "DetectorDescription/Base/interface/DDTranslation.h"
00008 #include "DetectorDescription/Core/interface/DDSolidShapes.h"
00009 #include "DataFormats/GeometrySurface/interface/Surface.h"
00010 #include "DataFormats/GeometrySurface/interface/Bounds.h"
00011 #include "DataFormats/DetId/interface/DetId.h"
00012
00013 #include <vector>
00014 #include "FWCore/ParameterSet/interface/types.h"
00015
00016 #include <ext/pool_allocator.h>
00017
00018
00019
00020
00021
00022 class DDFilteredView;
00023
00029 class GeometricDet {
00030 public:
00031
00032 typedef DDExpandedView::nav_type DDnav_type;
00033 typedef DDExpandedView::NavRange NavRange;
00034
00035 typedef std::vector< GeometricDet const *> ConstGeometricDetContainer;
00036 typedef std::vector< GeometricDet const *> GeometricDetContainer;
00037
00038 #ifdef PoolAlloc
00039 typedef std::vector< DDExpandedNode, PoolAlloc<DDExpandedNode> > GeoHistory;
00040 typedef std::vector<int, PoolAlloc<int> > nav_type;
00041 #else
00042 typedef std::vector<DDExpandedNode> GeoHistory;
00043 typedef DDExpandedView::nav_type nav_type;
00044 #endif
00045 typedef Surface::PositionType Position;
00046 typedef Surface::RotationType Rotation;
00047
00048
00049
00050
00051 typedef enum GDEnumType {unknown=100, Tracker=0, PixelBarrel=1, PixelEndCap=2,
00052 TIB=3, TID=4, TOB=5, TEC=6,
00053 layer=8, wheel=9, strng=10, rod=11, petal=12, ring=13,
00054 ladder=14, mergedDet=15, DetUnit=16, disk=17, panel=18 } GeometricEnumType;
00058 #ifdef GEOMETRICDETDEBUG
00059 GeometricDet(DDnav_type const & navtype, GeometricEnumType dd);
00060 GeometricDet(DDExpandedView* ev, GeometricEnumType dd);
00061 #endif
00062 GeometricDet(DDFilteredView* fv, GeometricEnumType dd);
00063 GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType dd);
00064
00065
00066
00067
00068
00069
00070
00074 void setGeographicalID(DetId id) const {
00075 _geographicalID = id;
00076
00077 }
00078 #ifdef GEOMETRICDETDEBUG
00079 void setComponents(GeometricDetContainer const & cont) {
00080 _container = cont;
00081
00082 }
00083 #endif
00084 void addComponents(GeometricDetContainer const & cont);
00085 void addComponent(GeometricDet*);
00089 void clearComponents() {
00090 _container.clear();
00091
00092 }
00093
00098 void deleteComponents();
00099
00100 bool isLeaf() const {
00101
00102 return _container.empty();
00103 }
00104
00108 DDRotationMatrix const & rotation() const {
00109
00110 return _rot;
00111 }
00112 DDTranslation const & translation() const {
00113
00114 return _trans;
00115 }
00116 double phi() const {
00117
00118 return _phi;
00119 }
00120 double rho() const {
00121
00122 return _rho;
00123 }
00124
00125 DDSolidShape const & shape() const {
00126
00127 return _shape;
00128 }
00129 GeometricEnumType type() const {
00130
00131 return _type;
00132 }
00133 DDName const & name() const {
00134
00135 return _ddname;
00136 }
00137
00138 nav_type const & navType() const {
00139
00140 return _ddd;
00141 }
00142
00143 NavRange navRange() const {
00144
00145 return NavRange(&_ddd.front(),_ddd.size());
00146 }
00147
00148 NavRange navpos() const {
00149
00150 return NavRange(&_ddd.front(),_ddd.size());
00151 }
00152 std::vector<double> const & params() const {
00153
00154 return _params;
00155 }
00156
00157 ~GeometricDet();
00158
00163 GeometricDetContainer & components() {
00164
00165 return _container;
00166 }
00167 GeometricDetContainer const & components() const {
00168
00169 return _container;
00170 }
00171
00177 ConstGeometricDetContainer deepComponents() const;
00178 void deepComponents(GeometricDetContainer & cont) const;
00179
00180 #ifdef GEOMETRICDETDEBUG
00181
00185 GeoHistory const & parents() const {
00186
00187 return _parents;
00188 }
00189
00190 #endif
00191
00195 DetId geographicalID() const {
00196
00197 return _geographicalID;
00198 }
00199 DetId geographicalId() const {
00200
00201 return _geographicalID;
00202 }
00203
00207 Position positionBounds() const;
00208
00212 Rotation rotationBounds() const;
00213
00217 const Bounds * bounds() const;
00218 #ifdef GEOMETRICDETDEBUG
00219 int copyno() const {
00220
00221 return _copy;
00222 }
00223 double volume() const {
00224
00225 return _volume;
00226 }
00227 double density() const {
00228
00229 return _density;
00230 }
00231 double weight() const {
00232
00233 return _weight;
00234 }
00235 std::string const & material() const {
00236
00237 return _material;
00238 }
00239 #endif
00240 double radLength() const {
00241
00242 return _radLength;
00243 }
00244 double xi() const {
00245
00246 return _xi;
00247 }
00251 double pixROCRows() const {
00252
00253 return _pixROCRows;
00254 }
00255 double pixROCCols() const {
00256
00257 return _pixROCCols;
00258 }
00259 double pixROCx() const {
00260
00261 return _pixROCx;
00262 }
00263 double pixROCy() const {
00264
00265 return _pixROCy;
00266 }
00267
00271 bool stereo() const {
00272
00273 return _stereo;
00274 }
00275 double siliconAPVNum() const {
00276
00277 return _siliconAPVNum;
00278 }
00279
00283 #ifdef GEOMETRICDETDEBUG
00284 bool wasBuiltFromDD() const {
00285
00286 return _fromDD;
00287 }
00288 #endif
00289
00290 private:
00291
00292 GeometricDetContainer _container;
00293 DDTranslation _trans;
00294 double _phi;
00295 double _rho;
00296 DDRotationMatrix _rot;
00297 DDSolidShape _shape;
00298 nav_type _ddd;
00299 DDName _ddname;
00300 GeometricEnumType _type;
00301 std::vector<double> _params;
00302
00303 mutable DetId _geographicalID;
00304 #ifdef GEOMETRICDETDEBUG
00305 GeoHistory _parents;
00306 double _volume;
00307 double _density;
00308 double _weight;
00309 int _copy;
00310 std::string _material;
00311 #endif
00312 double _radLength;
00313 double _xi;
00314 double _pixROCRows;
00315 double _pixROCCols;
00316 double _pixROCx;
00317 double _pixROCy;
00318 bool _stereo;
00319 double _siliconAPVNum;
00320 #ifdef GEOMETRICDETDEBUG
00321 bool _fromDD;
00322 #endif
00323
00324 };
00325
00326 #undef PoolAlloc
00327 #endif
00328