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
MTDGeometry(GeometricTimingDet const *gd=0)
Definition: MTDGeometry.cc:40
void setEndsetDU(unsigned sid)
Definition: MTDGeometry.h:42
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
Class to update a given geometry with a set of alignments.
const DetContainer & detsETL() const
Definition: MTDGeometry.cc:150
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: MTDGeometry.h:27
DetContainer theDetUnits
Definition: MTDGeometry.h:73
void addType(GeomDetType const *p)
Definition: MTDGeometry.cc:115
unsigned int theNumberOfLayers[2]
Definition: MTDGeometry.h:86
unsigned int theOffsetDU[2]
Definition: MTDGeometry.h:74
unsigned int endsetDU(unsigned sid) const
Definition: MTDGeometry.h:39
void addDetId(DetId p)
Definition: MTDGeometry.cc:146
DetContainer theDets
Definition: MTDGeometry.h:76
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: MTDGeometry.h:28
mapIdToDet theMap
Definition: MTDGeometry.h:80
std::vector< const GeomDet * > DetContainer
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:160
unsigned int offsetDU(unsigned sid) const
Definition: MTDGeometry.h:38
DetIdContainer theDetIds
Definition: MTDGeometry.h:78
ModuleType moduleType(const std::string &name) const
Definition: MTDGeometry.cc:231
void finalize()
Definition: MTDGeometry.cc:104
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: MTDGeometry.h:29
mapIdToDetUnit theMapUnit
Definition: MTDGeometry.h:79
bool isThere(GeomDetEnumerators::SubDetector subdet) const
Definition: MTDGeometry.cc:184
unsigned int numberOfLayers(int subdet) const
Definition: MTDGeometry.cc:176
const DetContainer & detsBTL() const
Definition: MTDGeometry.cc:148
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
Definition: DetId.h:17
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
Definition: MTDGeometry.cc:168
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: MTDGeometry.h:30
std::unordered_map< unsigned int, const GeomDet * > mapIdToDetUnit
void addDet(GeomDet const *p)
Definition: MTDGeometry.cc:128
std::vector< DetId > DetIdContainer
void addDetUnitId(DetId p)
Definition: MTDGeometry.cc:126
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: MTDGeometry.h:26
void fillTestMap(const GeometricTimingDet *gd)
Definition: MTDGeometry.cc:192
GeomDetEnumerators::SubDetector theSubDetTypeMap[2]
Definition: MTDGeometry.h:85
std::vector< std::tuple< DetId, MTDGeometry::ModuleType, float > > theDetTypetList
Definition: MTDGeometry.h:87
~MTDGeometry() override
Definition: MTDGeometry.cc:97
GeometricTimingDet const * trackerDet() const
Definition: MTDGeometry.h:47
float getDetectorThickness(DetId) const
Definition: MTDGeometry.cc:222
std::vector< const GeomDetType * > DetTypeContainer
DetContainer theETLDets
Definition: MTDGeometry.h:83
void setOffsetDU(unsigned sid)
Definition: MTDGeometry.h:41
ModuleType getDetectorType(DetId) const
Definition: MTDGeometry.cc:212
void addDetUnit(GeomDet const *p)
Definition: MTDGeometry.cc:119
unsigned int theEndsetDU[2]
Definition: MTDGeometry.h:75
const MTDGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: MTDGeometry.cc:152