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