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  Ph2PXB3D,
52  Ph2PXF3D,
53  Ph2PSP,
54  Ph2PSS,
55  Ph2SS
56  };
57 
58  // deleted copy constructor and copy assignment operators
59  TrackerGeometry(TrackerGeometry const&) = delete;
60  TrackerGeometry& operator=(TrackerGeometry const&) = delete;
61 
62  // defaulted move constructor and move assignment operators
63  TrackerGeometry(TrackerGeometry&&) = default;
65 
66  ~TrackerGeometry() override;
67 
68  const DetTypeContainer& detTypes() const override { return theDetTypes; }
69  const DetContainer& detUnits() const override { return theDetUnits; }
70  const DetContainer& dets() const override { return theDets; }
71  const DetIdContainer& detUnitIds() const override { return theDetUnitIds; }
72  const DetIdContainer& detIds() const override { return theDetIds; }
73  const TrackerGeomDet* idToDetUnit(DetId) const override;
74  const TrackerGeomDet* idToDet(DetId) const override;
75 
77  unsigned int numberOfLayers(int subdet) const;
78  bool isThere(GeomDetEnumerators::SubDetector subdet) const;
79 
80  unsigned int offsetDU(SubDetector sid) const { return theOffsetDU[sid]; }
81  unsigned int endsetDU(SubDetector sid) const { return theEndsetDU[sid]; }
82  // Magic : better be called at the right moment...
83  void setOffsetDU(SubDetector sid) { theOffsetDU[sid] = detUnits().size(); }
84  void setEndsetDU(SubDetector sid) { theEndsetDU[sid] = detUnits().size(); }
85  void fillTestMap(const GeometricDet* gd);
86 
87  ModuleType moduleType(const std::string& name) const;
88 
89  GeometricDet const* trackerDet() const { return theTrackerDet; }
90 
91  const DetContainer& detsPXB() const;
92  const DetContainer& detsPXF() const;
93  const DetContainer& detsTIB() const;
94  const DetContainer& detsTID() const;
95  const DetContainer& detsTOB() const;
96  const DetContainer& detsTEC() const;
97 
99  float getDetectorThickness(DetId) const;
100 
101 private:
103 
105  friend class GeometryAligner;
106 
107  DetTypeContainer theDetTypes; // owns the DetTypes
108  DetContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them
109  unsigned int theOffsetDU[6]; // offsets in the above
110  unsigned int theEndsetDU[6]; // end offsets in the above
111  DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets.
114  mapIdToDetUnit theMapUnit; // does not own GeomDetUnit *
115  mapIdToDet theMap; // does not own GeomDet *
116 
117  DetContainer thePXBDets; // not owned: they're also in 'theDets'
118  DetContainer thePXFDets; // not owned: they're also in 'theDets'
119  DetContainer theTIBDets; // not owned: they're also in 'theDets'
120  DetContainer theTIDDets; // not owned: they're also in 'theDets'
121  DetContainer theTOBDets; // not owned: they're also in 'theDets'
122  DetContainer theTECDets; // not owned: they're also in 'theDets'
123 
125  unsigned int theNumberOfLayers[6];
126  std::vector<std::tuple<DetId, TrackerGeometry::ModuleType, float> > theDetTypetList;
127 };
128 
129 #endif
float getDetectorThickness(DetId) const
const DetContainer & detsTIB() const
unsigned int theOffsetDU[6]
void addDet(GeomDet const *p)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void setEndsetDU(SubDetector sid)
const DetContainer & detsPXB() const
Class to update a given geometry with a set of alignments.
unsigned int numberOfLayers(int subdet) const
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
unsigned int offsetDU(SubDetector sid) const
const DetContainer & detsPXF() const
unsigned int theNumberOfLayers[6]
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
void fillTestMap(const GeometricDet *gd)
DetIdContainer theDetIds
DetIdContainer theDetUnitIds
GeomDetEnumerators::SubDetector theSubDetTypeMap[6]
GeometricDet const * trackerDet() const
DetContainer theTECDets
DetContainer theDets
TrackerGeometry(GeometricDet const *gd=nullptr)
void addDetId(DetId p)
std::vector< const GeomDet * > DetContainer
mapIdToDetUnit theMapUnit
void setOffsetDU(SubDetector sid)
const DetContainer & detsTOB() const
DetTypeContainer theDetTypes
bool isThere(GeomDetEnumerators::SubDetector subdet) const
ModuleType getDetectorType(DetId) const
void addType(GeomDetType const *p)
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList
void addDetUnit(GeomDet const *p)
unsigned int endsetDU(SubDetector sid) const
unsigned int theEndsetDU[6]
const TrackerGeomDet * idToDet(DetId) const override
~TrackerGeometry() override
DetContainer theTIDDets
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
Definition: DetId.h:17
DetContainer thePXBDets
DetContainer thePXFDets
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
GeomDetEnumerators::SubDetector SubDetector
void addDetUnitId(DetId p)
TrackerGeometry & operator=(TrackerGeometry const &)=delete
std::unordered_map< unsigned int, const GeomDet * > mapIdToDetUnit
DetContainer theTIBDets
std::vector< DetId > DetIdContainer
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
DetContainer theTOBDets
DetContainer theDetUnits
const DetContainer & detsTEC() const
std::vector< const GeomDetType * > DetTypeContainer
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
GeometricDet const * theTrackerDet
ModuleType moduleType(const std::string &name) const
const DetContainer & detsTID() const