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 
16 public:
18 
19  enum class ModuleType {
20  UNKNOWN,
21  BTL,
22  ETL,
23  };
24 
25  ~MTDGeometry() override ;
26 
27  const DetTypeContainer& detTypes() const override {return theDetTypes;}
28  const DetContainer& detUnits() const override {return theDetUnits;}
29  const DetContainer& dets() const override {return theDets;}
30  const DetIdContainer& detUnitIds() const override {return theDetUnitIds;}
31  const DetIdContainer& detIds() const override {return theDetIds;}
32  const MTDGeomDet* idToDetUnit(DetId) const override;
33  const MTDGeomDet* idToDet(DetId) const override;
34 
36  unsigned int numberOfLayers(int subdet) const;
37  bool isThere(GeomDetEnumerators::SubDetector subdet) const;
38 
39  unsigned int offsetDU(unsigned sid) const { return theOffsetDU[sid];}
40  unsigned int endsetDU(unsigned sid) const { return theEndsetDU[sid];}
41  // Magic : better be called at the right moment...
42  void setOffsetDU(unsigned sid) { theOffsetDU[sid]=detUnits().size();}
43  void setEndsetDU(unsigned sid) { theEndsetDU[sid]=detUnits().size();}
44  void fillTestMap(const GeometricTimingDet* gd);
45 
46  ModuleType moduleType(const std::string& name) const;
47 
48  GeometricTimingDet const * trackerDet() const {return theTrackerDet;}
49 
50  const DetContainer& detsBTL() const;
51  const DetContainer& detsETL() const;
52 
54  float getDetectorThickness(DetId) const;
55 
56 
57 private:
58 
59  explicit MTDGeometry(GeometricTimingDet const* gd=nullptr);
60 
62 
63  void addType(GeomDetType const * p);
64  void addDetUnit(GeomDet const * p);
65  void addDetUnitId(DetId p);
66  void addDet(GeomDet const * p);
67  void addDetId(DetId p);
68  void finalize();
69 
71 
73  friend class GeometryAligner;
74 
75  DetTypeContainer theDetTypes; // owns the DetTypes
76  DetContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them
77  unsigned int theOffsetDU[2]; // offsets in the above
78  unsigned int theEndsetDU[2]; // end offsets in the above
79  DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets.
82  mapIdToDetUnit theMapUnit; // does not own GeomDetUnit *
83  mapIdToDet theMap; // does not own GeomDet *
84 
85  DetContainer theBTLDets; // not owned: they're also in 'theDets'
86  DetContainer theETLDets; // not owned: they're also in 'theDets'
87 
89  unsigned int theNumberOfLayers[2];
90  std::vector< std::tuple< DetId, MTDGeometry::ModuleType, float> > theDetTypetList;
91 };
92 
93 #endif
MTDGeometry(GeometricTimingDet const *gd=0)
Definition: MTDGeometry.cc:39
void setEndsetDU(unsigned sid)
Definition: MTDGeometry.h:43
GeometricTimingDet const * theTrackerDet
Definition: MTDGeometry.h:70
DetIdContainer theDetUnitIds
Definition: MTDGeometry.h:80
DetContainer theBTLDets
Definition: MTDGeometry.h:85
DetTypeContainer theDetTypes
Definition: MTDGeometry.h:75
Class to update a given geometry with a set of alignments.
const DetContainer & detsETL() const
Definition: MTDGeometry.cc:168
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: MTDGeometry.h:28
DetContainer theDetUnits
Definition: MTDGeometry.h:76
void addType(GeomDetType const *p)
Definition: MTDGeometry.cc:123
unsigned int theNumberOfLayers[2]
Definition: MTDGeometry.h:89
unsigned int theOffsetDU[2]
Definition: MTDGeometry.h:77
unsigned int endsetDU(unsigned sid) const
Definition: MTDGeometry.h:40
void addDetId(DetId p)
Definition: MTDGeometry.cc:156
DetContainer theDets
Definition: MTDGeometry.h:79
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: MTDGeometry.h:29
mapIdToDet theMap
Definition: MTDGeometry.h:83
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:184
unsigned int offsetDU(unsigned sid) const
Definition: MTDGeometry.h:39
DetIdContainer theDetIds
Definition: MTDGeometry.h:81
ModuleType moduleType(const std::string &name) const
Definition: MTDGeometry.cc:256
void finalize()
Definition: MTDGeometry.cc:112
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: MTDGeometry.h:30
mapIdToDetUnit theMapUnit
Definition: MTDGeometry.h:82
bool isThere(GeomDetEnumerators::SubDetector subdet) const
Definition: MTDGeometry.cc:212
unsigned int numberOfLayers(int subdet) const
Definition: MTDGeometry.cc:203
const DetContainer & detsBTL() const
Definition: MTDGeometry.cc:162
Definition: DetId.h:18
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
Definition: MTDGeometry.cc:194
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: MTDGeometry.h:31
std::vector< DetId > DetIdContainer
void addDet(GeomDet const *p)
Definition: MTDGeometry.cc:138
void addDetUnitId(DetId p)
Definition: MTDGeometry.cc:134
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: MTDGeometry.h:27
void fillTestMap(const GeometricTimingDet *gd)
Definition: MTDGeometry.cc:219
GeomDetEnumerators::SubDetector theSubDetTypeMap[2]
Definition: MTDGeometry.h:88
std::vector< const GeomDet * > DetContainer
~MTDGeometry() override
Definition: MTDGeometry.cc:107
GeometricTimingDet const * trackerDet() const
Definition: MTDGeometry.h:48
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
float getDetectorThickness(DetId) const
Definition: MTDGeometry.cc:247
DetContainer theETLDets
Definition: MTDGeometry.h:86
void setOffsetDU(unsigned sid)
Definition: MTDGeometry.h:42
ModuleType getDetectorType(DetId) const
Definition: MTDGeometry.cc:238
std::vector< const GeomDetType * > DetTypeContainer
std::vector< std::tuple< DetId, MTDGeometry::ModuleType, float > > theDetTypetList
Definition: MTDGeometry.h:90
void addDetUnit(GeomDet const *p)
Definition: MTDGeometry.cc:127
unsigned int theEndsetDU[2]
Definition: MTDGeometry.h:78
std::unordered_map< unsigned int, const GeomDet * > mapIdToDetUnit
const MTDGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: MTDGeometry.cc:174