CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
11 
13 
14 // FIXME here just to allow prototyping...
15 namespace trackerTrie {
16  typedef GeomDet const* PDet;
19  typedef Node const * node_pointer; // sigh....
21 }
22 
23 
28 class TrackerGeometry final : public TrackingGeometry {
29 
30  explicit TrackerGeometry(GeometricDet const* gd=0);
31 
33 
34  void addType(GeomDetType const * p);
35  void addDetUnit(GeomDetUnit const * p);
36  void addDetUnitId(DetId p);
37  void addDet(GeomDet const * p);
38  void addDetId(DetId p);
39  void finalize();
40 
41 public:
43 
44  enum class ModuleType {
45  UNKNOWN,
46  PXB,
47  PXF,
48  IB1,
49  IB2,
50  OB1,
51  OB2,
52  W1A,
53  W2A,
54  W3A,
55  W1B,
56  W2B,
57  W3B,
58  W4,
59  W5,
60  W6,
61  W7,
62  Ph1PXB,
63  Ph1PXF,
64  Ph2PXB,
65  Ph2PXF,
66  Ph2PSP,
67  Ph2PSS,
68  Ph2SS
69  };
70 
71  virtual ~TrackerGeometry() ;
72 
73  const DetTypeContainer& detTypes() const {return theDetTypes;}
74  const DetUnitContainer& detUnits() const {return theDetUnits;}
75  const DetContainer& dets() const {return theDets;}
76  const DetIdContainer& detUnitIds() const {return theDetUnitIds;}
77  const DetIdContainer& detIds() const { return theDetIds;}
78  const TrackerGeomDet* idToDetUnit(DetId) const;
79  const TrackerGeomDet* idToDet(DetId) const;
80 
82  unsigned int numberOfLayers(int subdet) const;
83  bool isThere(GeomDetEnumerators::SubDetector subdet) const;
84 
85  unsigned int offsetDU(SubDetector sid) const { return theOffsetDU[sid];}
86  unsigned int endsetDU(SubDetector sid) const { return theEndsetDU[sid];}
87  // Magic : better be called at the right moment...
88  void setOffsetDU(SubDetector sid) { theOffsetDU[sid]=detUnits().size();}
89  void setEndsetDU(SubDetector sid) { theEndsetDU[sid]=detUnits().size();}
90  void fillTestMap(const GeometricDet* gd);
91 
92  ModuleType moduleType(const std::string& name) const;
93 
94  GeometricDet const * trackerDet() const {return theTrackerDet;}
95 
96  const DetContainer& detsPXB() const;
97  const DetContainer& detsPXF() const;
98  const DetContainer& detsTIB() const;
99  const DetContainer& detsTID() const;
100  const DetContainer& detsTOB() const;
101  const DetContainer& detsTEC() const;
102 
104  float getDetectorThickness(DetId) const;
105 
106 
107 private:
108 
110 
112  friend class GeometryAligner;
113 
114  DetTypeContainer theDetTypes; // owns the DetTypes
115  DetUnitContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them
116  unsigned int theOffsetDU[6]; // offsets in the above
117  unsigned int theEndsetDU[6]; // end offsets in the above
118  DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets.
121  mapIdToDetUnit theMapUnit; // does not own GeomDetUnit *
122  mapIdToDet theMap; // does not own GeomDet *
123 
124  DetContainer thePXBDets; // not owned: they're also in 'theDets'
125  DetContainer thePXFDets; // not owned: they're also in 'theDets'
126  DetContainer theTIBDets; // not owned: they're also in 'theDets'
127  DetContainer theTIDDets; // not owned: they're also in 'theDets'
128  DetContainer theTOBDets; // not owned: they're also in 'theDets'
129  DetContainer theTECDets; // not owned: they're also in 'theDets'
130 
132  unsigned int theNumberOfLayers[6];
133  std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float> > theDetTypetList;
134 };
135 
136 #endif
unsigned int theOffsetDU[6]
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< GeomDetType const * > DetTypeContainer
GeometricDet const * trackerDet() const
void addDet(GeomDet const *p)
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
Node const * node_pointer
edm::TrieNodeIter< PDet > node_iterator
void setEndsetDU(SubDetector sid)
this class represent the node of a trie, it contains a link to a sub node and a link to a brother (no...
Definition: Trie.h:34
Class to update a given geometry with a set of alignments.
const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
const DetTypeContainer & detTypes() const
Return a vector of all det types.
unsigned int theNumberOfLayers[6]
TrackerGeometry(GeometricDet const *gd=0)
void fillTestMap(const GeometricDet *gd)
DetIdContainer theDetIds
DetIdContainer theDetUnitIds
GeomDetEnumerators::SubDetector theSubDetTypeMap[6]
DetContainer theTECDets
DetContainer theDets
unsigned int numberOfLayers(int subdet) const
void addDetId(DetId p)
DetUnitContainer theDetUnits
bool isThere(GeomDetEnumerators::SubDetector subdet) const
void addDetUnit(GeomDetUnit const *p)
unsigned int endsetDU(SubDetector sid) const
mapIdToDetUnit theMapUnit
void setOffsetDU(SubDetector sid)
const DetContainer & detsTEC() const
const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
DetTypeContainer theDetTypes
virtual ~TrackerGeometry()
void addType(GeomDetType const *p)
unsigned int offsetDU(SubDetector sid) const
edm::Trie< PDet > DetTrie
const DetContainer & detsPXB() const
GeomDet const * PDet
ModuleType getDetectorType(DetId) const
unsigned int theEndsetDU[6]
std::unordered_map< unsigned int, GeomDetUnit const * > mapIdToDetUnit
DetContainer theTIDDets
const DetContainer & detsTIB() const
ModuleType moduleType(const std::string &name) const
std::unordered_map< unsigned int, GeomDet const * > mapIdToDet
Definition: DetId.h:18
DetContainer thePXBDets
DetContainer thePXFDets
GeomDetEnumerators::SubDetector SubDetector
void addDetUnitId(DetId p)
DetContainer theTIBDets
DetContainer theTOBDets
const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
const DetContainer & detsPXF() const
const DetContainer & detsTOB() const
edm::TrieNode< PDet > Node
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
GeometricDet const * theTrackerDet
float getDetectorThickness(DetId) const
const DetContainer & detsTID() const
std::vector< std::tuple< DetId, TrackerGeometry::ModuleType, float > > theDetTypetList
const TrackerGeomDet * idToDet(DetId) const
std::vector< DetId > DetIdContainer
const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.