CMS 3D CMS Logo

MTDGeometry.h
Go to the documentation of this file.
1 #ifndef Geometry_MTDGeometryBuilder_MTDGeometry_H
2 #define Geometry_MTDGeometryBuilder_MTDGeometry_H
3 
7 
9 
14 class MTDGeometry final : public TrackingGeometry {
15 public:
17 
18  enum class ModuleType {
19  UNKNOWN,
20  BTL,
21  ETL,
22  };
23 
24  ~MTDGeometry() override;
25 
26  const DetTypeContainer& detTypes() const override { return theDetTypes; }
27  const DetContainer& detUnits() const override { return theDetUnits; }
28  const DetContainer& dets() const override { return theDets; }
29  const DetIdContainer& detUnitIds() const override { return theDetUnitIds; }
30  const DetIdContainer& detIds() const override { return theDetIds; }
31  const MTDGeomDet* idToDetUnit(DetId) const override;
32  const MTDGeomDet* idToDet(DetId) const override;
33 
35  unsigned int numberOfLayers(int subdet) const;
36  bool isThere(GeomDetEnumerators::SubDetector subdet) const;
37 
38  unsigned int offsetDU(unsigned sid) const { return theOffsetDU[sid]; }
39  unsigned int endsetDU(unsigned sid) const { return theEndsetDU[sid]; }
40  // Magic : better be called at the right moment...
41  void setOffsetDU(unsigned sid) { theOffsetDU[sid] = detUnits().size(); }
42  void setEndsetDU(unsigned sid) { theEndsetDU[sid] = detUnits().size(); }
43  void fillTestMap(const GeometricTimingDet* gd);
44 
45  ModuleType moduleType(const std::string& name) const;
46 
47  GeometricTimingDet const* trackerDet() const { return theTrackerDet; }
48 
49  const DetContainer& detsBTL() const;
50  const DetContainer& detsETL() const;
51 
53  float getDetectorThickness(DetId) const;
54 
55 private:
56  explicit MTDGeometry(GeometricTimingDet const* gd = nullptr);
57 
59 
60  void addType(GeomDetType const* p);
61  void addDetUnit(GeomDet const* p);
62  void addDetUnitId(DetId p);
63  void addDet(GeomDet const* p);
64  void addDetId(DetId p);
65  void finalize();
66 
68 
70  friend class GeometryAligner;
71 
72  DetTypeContainer theDetTypes; // owns the DetTypes
73  DetContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them
74  unsigned int theOffsetDU[2]; // offsets in the above
75  unsigned int theEndsetDU[2]; // end offsets in the above
76  DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets.
79  mapIdToDetUnit theMapUnit; // does not own GeomDetUnit *
80  mapIdToDet theMap; // does not own GeomDet *
81 
82  DetContainer theBTLDets; // not owned: they're also in 'theDets'
83  DetContainer theETLDets; // not owned: they're also in 'theDets'
84 
86  unsigned int theNumberOfLayers[2];
87  std::vector<std::tuple<DetId, MTDGeometry::ModuleType, float> > theDetTypetList;
88 };
89 
90 #endif
void setEndsetDU(unsigned sid)
Definition: MTDGeometry.h:42
unsigned int numberOfLayers(int subdet) const
Definition: MTDGeometry.cc:187
GeometricTimingDet const * theTrackerDet
Definition: MTDGeometry.h:67
DetIdContainer theDetUnitIds
Definition: MTDGeometry.h:77
DetContainer theBTLDets
Definition: MTDGeometry.h:82
DetTypeContainer theDetTypes
Definition: MTDGeometry.h:72
const DetContainer & detsBTL() const
Definition: MTDGeometry.cc:159
Class to update a given geometry with a set of alignments.
const DetContainer & detsETL() const
Definition: MTDGeometry.cc:161
DetContainer theDetUnits
Definition: MTDGeometry.h:73
float getDetectorThickness(DetId) const
Definition: MTDGeometry.cc:233
ModuleType moduleType(const std::string &name) const
Definition: MTDGeometry.cc:242
void addType(GeomDetType const *p)
Definition: MTDGeometry.cc:126
unsigned int theNumberOfLayers[2]
Definition: MTDGeometry.h:86
unsigned int theOffsetDU[2]
Definition: MTDGeometry.h:74
void addDetId(DetId p)
Definition: MTDGeometry.cc:157
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: MTDGeometry.h:30
DetContainer theDets
Definition: MTDGeometry.h:76
const MTDGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: MTDGeometry.cc:163
mapIdToDet theMap
Definition: MTDGeometry.h:80
bool isThere(GeomDetEnumerators::SubDetector subdet) const
Definition: MTDGeometry.cc:195
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: MTDGeometry.h:27
std::vector< const GeomDet * > DetContainer
GeometricTimingDet const * trackerDet() const
Definition: MTDGeometry.h:47
DetIdContainer theDetIds
Definition: MTDGeometry.h:78
void finalize()
Definition: MTDGeometry.cc:115
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
Definition: MTDGeometry.cc:179
mapIdToDetUnit theMapUnit
Definition: MTDGeometry.h:79
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: MTDGeometry.h:26
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:171
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: MTDGeometry.h:28
MTDGeometry(GeometricTimingDet const *gd=nullptr)
Definition: MTDGeometry.cc:42
ModuleType getDetectorType(DetId) const
Definition: MTDGeometry.cc:223
unsigned int endsetDU(unsigned sid) const
Definition: MTDGeometry.h:39
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
Definition: DetId.h:17
std::unordered_map< unsigned int, const GeomDet * > mapIdToDetUnit
void addDet(GeomDet const *p)
Definition: MTDGeometry.cc:139
std::vector< DetId > DetIdContainer
void addDetUnitId(DetId p)
Definition: MTDGeometry.cc:137
void fillTestMap(const GeometricTimingDet *gd)
Definition: MTDGeometry.cc:203
GeomDetEnumerators::SubDetector theSubDetTypeMap[2]
Definition: MTDGeometry.h:85
std::vector< std::tuple< DetId, MTDGeometry::ModuleType, float > > theDetTypetList
Definition: MTDGeometry.h:87
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: MTDGeometry.h:29
~MTDGeometry() override
Definition: MTDGeometry.cc:108
std::vector< const GeomDetType * > DetTypeContainer
DetContainer theETLDets
Definition: MTDGeometry.h:83
void setOffsetDU(unsigned sid)
Definition: MTDGeometry.h:41
unsigned int offsetDU(unsigned sid) const
Definition: MTDGeometry.h:38
void addDetUnit(GeomDet const *p)
Definition: MTDGeometry.cc:130
unsigned int theEndsetDU[2]
Definition: MTDGeometry.h:75