CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  ~TrackerGeometry() override;
59 
60  const DetTypeContainer& detTypes() const override { return theDetTypes; }
61  const DetContainer& detUnits() const override { return theDetUnits; }
62  const DetContainer& dets() const override { return theDets; }
63  const DetIdContainer& detUnitIds() const override { return theDetUnitIds; }
64  const DetIdContainer& detIds() const override { return theDetIds; }
65  const TrackerGeomDet* idToDetUnit(DetId) const override;
66  const TrackerGeomDet* idToDet(DetId) const override;
67 
69  unsigned int numberOfLayers(int subdet) const;
70  bool isThere(GeomDetEnumerators::SubDetector subdet) const;
71 
72  unsigned int offsetDU(SubDetector sid) const { return theOffsetDU[sid]; }
73  unsigned int endsetDU(SubDetector sid) const { return theEndsetDU[sid]; }
74  // Magic : better be called at the right moment...
75  void setOffsetDU(SubDetector sid) { theOffsetDU[sid] = detUnits().size(); }
76  void setEndsetDU(SubDetector sid) { theEndsetDU[sid] = detUnits().size(); }
77  void fillTestMap(const GeometricDet* gd);
78 
79  ModuleType moduleType(const std::string& name) const;
80 
81  GeometricDet const* trackerDet() const { return theTrackerDet; }
82 
83  const DetContainer& detsPXB() const;
84  const DetContainer& detsPXF() const;
85  const DetContainer& detsTIB() const;
86  const DetContainer& detsTID() const;
87  const DetContainer& detsTOB() const;
88  const DetContainer& detsTEC() const;
89 
91  float getDetectorThickness(DetId) const;
92 
93 private:
95 
97  friend class GeometryAligner;
98 
99  DetTypeContainer theDetTypes; // owns the DetTypes
100  DetContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them
101  unsigned int theOffsetDU[6]; // offsets in the above
102  unsigned int theEndsetDU[6]; // end offsets in the above
103  DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets.
106  mapIdToDetUnit theMapUnit; // does not own GeomDetUnit *
107  mapIdToDet theMap; // does not own GeomDet *
108 
109  DetContainer thePXBDets; // not owned: they're also in 'theDets'
110  DetContainer thePXFDets; // not owned: they're also in 'theDets'
111  DetContainer theTIBDets; // not owned: they're also in 'theDets'
112  DetContainer theTIDDets; // not owned: they're also in 'theDets'
113  DetContainer theTOBDets; // not owned: they're also in 'theDets'
114  DetContainer theTECDets; // not owned: they're also in 'theDets'
115 
117  unsigned int theNumberOfLayers[6];
118  std::vector<std::tuple<DetId, TrackerGeometry::ModuleType, float> > theDetTypetList;
119 };
120 
121 #endif
unsigned int theOffsetDU[6]
GeometricDet const * trackerDet() const
void addDet(GeomDet const *p)
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void setEndsetDU(SubDetector sid)
Class to update a given geometry with a set of alignments.
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
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]
DetContainer theTECDets
DetContainer theDets
unsigned int numberOfLayers(int subdet) const
TrackerGeometry(GeometricDet const *gd=nullptr)
void addDetId(DetId p)
bool isThere(GeomDetEnumerators::SubDetector subdet) const
std::vector< const GeomDet * > DetContainer
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
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList
void addDetUnit(GeomDet const *p)
ModuleType getDetectorType(DetId) const
unsigned int theEndsetDU[6]
const TrackerGeomDet * idToDet(DetId) const override
~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
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
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 DetContainer & detsTOB() const
DetContainer theDetUnits
std::vector< const GeomDetType * > DetTypeContainer
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
GeometricDet const * theTrackerDet
float getDetectorThickness(DetId) const
const DetContainer & detsTID() const