CMS 3D CMS Logo

TrackerGeometry.h
Go to the documentation of this file.
1 #ifndef Geometry_TrackerGeometryBuilder_TrackerGeometry_H
2 #define Geometry_TrackerGeometryBuilder_TrackerGeometry_H
3 
7 
8 class GeometricDet;
9 
14 class TrackerGeometry final : public TrackingGeometry {
15 
16  explicit TrackerGeometry(GeometricDet const* gd=0);
17 
19 
20  void addType(GeomDetType const * p);
21  void addDetUnit(GeomDetUnit const * p);
22  void addDetUnitId(DetId p);
23  void addDet(GeomDet const * p);
24  void addDetId(DetId p);
25  void finalize();
26 
27 public:
29 
30  enum class ModuleType {
31  UNKNOWN,
32  PXB,
33  PXF,
34  IB1,
35  IB2,
36  OB1,
37  OB2,
38  W1A,
39  W2A,
40  W3A,
41  W1B,
42  W2B,
43  W3B,
44  W4,
45  W5,
46  W6,
47  W7,
48  Ph1PXB,
49  Ph1PXF,
50  Ph2PXB,
51  Ph2PXF,
52  Ph2PSP,
53  Ph2PSS,
54  Ph2SS
55  };
56 
57  virtual ~TrackerGeometry() ;
58 
59  const DetTypeContainer& detTypes() const {return theDetTypes;}
60  const DetUnitContainer& detUnits() const {return theDetUnits;}
61  const DetContainer& dets() const {return theDets;}
62  const DetIdContainer& detUnitIds() const {return theDetUnitIds;}
63  const DetIdContainer& detIds() const { return theDetIds;}
64  const TrackerGeomDet* idToDetUnit(DetId) const;
65  const TrackerGeomDet* idToDet(DetId) const;
66 
68  unsigned int numberOfLayers(int subdet) const;
69  bool isThere(GeomDetEnumerators::SubDetector subdet) const;
70 
71  unsigned int offsetDU(SubDetector sid) const { return theOffsetDU[sid];}
72  unsigned int endsetDU(SubDetector sid) const { return theEndsetDU[sid];}
73  // Magic : better be called at the right moment...
74  void setOffsetDU(SubDetector sid) { theOffsetDU[sid]=detUnits().size();}
75  void setEndsetDU(SubDetector sid) { theEndsetDU[sid]=detUnits().size();}
76  void fillTestMap(const GeometricDet* gd);
77 
78  ModuleType moduleType(const std::string& name) const;
79 
80  GeometricDet const * trackerDet() const {return theTrackerDet;}
81 
82  const DetContainer& detsPXB() const;
83  const DetContainer& detsPXF() const;
84  const DetContainer& detsTIB() const;
85  const DetContainer& detsTID() const;
86  const DetContainer& detsTOB() const;
87  const DetContainer& detsTEC() const;
88 
90  float getDetectorThickness(DetId) const;
91 
92 
93 private:
94 
96 
98  friend class GeometryAligner;
99 
100  DetTypeContainer theDetTypes; // owns the DetTypes
101  DetUnitContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them
102  unsigned int theOffsetDU[6]; // offsets in the above
103  unsigned int theEndsetDU[6]; // end offsets in the above
104  DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets.
107  mapIdToDetUnit theMapUnit; // does not own GeomDetUnit *
108  mapIdToDet theMap; // does not own GeomDet *
109 
110  DetContainer thePXBDets; // not owned: they're also in 'theDets'
111  DetContainer thePXFDets; // not owned: they're also in 'theDets'
112  DetContainer theTIBDets; // not owned: they're also in 'theDets'
113  DetContainer theTIDDets; // not owned: they're also in 'theDets'
114  DetContainer theTOBDets; // not owned: they're also in 'theDets'
115  DetContainer theTECDets; // not owned: they're also in 'theDets'
116 
118  unsigned int theNumberOfLayers[6];
119  std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float> > theDetTypetList;
120 };
121 
122 #endif
unsigned int theOffsetDU[6]
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< GeomDetType const * > DetTypeContainer
GeometricDet const * trackerDet() const
void addDet(GeomDet const *p)
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
void setEndsetDU(SubDetector sid)
Class to update a given geometry with a set of alignments.
const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
const DetTypeContainer & detTypes() const
Return a vector of all det types.
unsigned int theNumberOfLayers[6]
TrackerGeometry(GeometricDet const *gd=0)
void fillTestMap(const GeometricDet *gd)
DetIdContainer theDetIds
DetIdContainer theDetUnitIds
GeomDetEnumerators::SubDetector theSubDetTypeMap[6]
DetContainer theTECDets
DetContainer theDets
unsigned int numberOfLayers(int subdet) const
void addDetId(DetId p)
DetUnitContainer theDetUnits
bool isThere(GeomDetEnumerators::SubDetector subdet) const
void addDetUnit(GeomDetUnit const *p)
unsigned int endsetDU(SubDetector sid) const
mapIdToDetUnit theMapUnit
void setOffsetDU(SubDetector sid)
const DetContainer & detsTEC() const
const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
DetTypeContainer theDetTypes
virtual ~TrackerGeometry()
void addType(GeomDetType const *p)
unsigned int offsetDU(SubDetector sid) const
const DetContainer & detsPXB() const
ModuleType getDetectorType(DetId) const
unsigned int theEndsetDU[6]
std::unordered_map< unsigned int, GeomDetUnit const * > mapIdToDetUnit
DetContainer theTIDDets
const DetContainer & detsTIB() const
ModuleType moduleType(const std::string &name) const
std::unordered_map< unsigned int, GeomDet const * > mapIdToDet
Definition: DetId.h:18
DetContainer thePXBDets
DetContainer thePXFDets
GeomDetEnumerators::SubDetector SubDetector
void addDetUnitId(DetId p)
DetContainer theTIBDets
DetContainer theTOBDets
const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
const DetContainer & detsPXF() const
const DetContainer & detsTOB() const
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
GeometricDet const * theTrackerDet
float getDetectorThickness(DetId) const
const DetContainer & detsTID() const
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList
const TrackerGeomDet * idToDet(DetId) const
std::vector< DetId > DetIdContainer
const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.