00001 #ifndef Geometry_TrackerGeometryBuilder_TrackerGeometry_H 00002 #define Geometry_TrackerGeometryBuilder_TrackerGeometry_H 00003 00004 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h" 00005 #include "Geometry/CommonDetUnit/interface/GeomDetEnumerators.h" 00006 00007 class GeometricDet; 00008 00009 #include "Geometry/TrackerGeometryBuilder/interface/trackerHierarchy.h" 00010 00011 #include "DataFormats/Common/interface/Trie.h" 00012 00013 // FIXME here just to allow prototyping... 00014 namespace trackerTrie { 00015 typedef GeomDet const* PDet; 00016 typedef edm::Trie<PDet> DetTrie; 00017 typedef edm::TrieNode<PDet> Node; 00018 typedef Node const * node_pointer; // sigh.... 00019 typedef edm::TrieNodeIter<PDet> node_iterator; 00020 } 00021 00022 00027 class TrackerGeometry : public TrackingGeometry { 00028 public: 00029 typedef GeomDetEnumerators::SubDetector SubDetector; 00030 00031 explicit TrackerGeometry(GeometricDet const* gd=0); 00032 00033 virtual ~TrackerGeometry() ; 00034 00035 virtual const DetTypeContainer& detTypes() const; 00036 virtual const DetUnitContainer& detUnits() const; 00037 virtual const DetContainer& dets() const; 00038 virtual const DetIdContainer& detUnitIds() const; 00039 virtual const DetIdContainer& detIds() const; 00040 virtual const GeomDetUnit* idToDetUnit(DetId) const; 00041 virtual const GeomDet* idToDet(DetId) const; 00042 00043 00044 void addType(GeomDetType* p); 00045 void addDetUnit(GeomDetUnit* p); 00046 void addDetUnitId(DetId p); 00047 void addDet(GeomDet* p); 00048 void addDetId(DetId p); 00049 00050 unsigned int offsetDU(SubDetector sid) const { return theOffsetDU[sid];} 00051 unsigned int endsetDU(SubDetector sid) const { return theEndsetDU[sid];} 00052 // Magic : better be called at the right moment... 00053 void setOffsetDU(SubDetector sid) { theOffsetDU[sid]=detUnits().size();} 00054 void setEndsetDU(SubDetector sid) { theEndsetDU[sid]=detUnits().size();} 00055 00056 GeometricDet const * trackerDet() const; 00057 00058 const DetContainer& detsPXB() const; 00059 const DetContainer& detsPXF() const; 00060 const DetContainer& detsTIB() const; 00061 const DetContainer& detsTID() const; 00062 const DetContainer& detsTOB() const; 00063 const DetContainer& detsTEC() const; 00064 00065 private: 00066 00067 GeometricDet const * theTrackerDet; 00068 00070 friend class GeometryAligner; 00071 00072 DetTypeContainer theDetTypes; // owns the DetTypes 00073 DetUnitContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them 00074 unsigned int theOffsetDU[6]; // offsets in the above 00075 unsigned int theEndsetDU[6]; // end offsets in the above 00076 DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets. 00077 DetIdContainer theDetUnitIds; 00078 DetIdContainer theDetIds; 00079 mapIdToDetUnit theMapUnit; // does not own GeomDetUnit * 00080 mapIdToDet theMap; // does not own GeomDet * 00081 00082 DetContainer thePXBDets; // not owned: they're also in 'theDets' 00083 DetContainer thePXFDets; // not owned: they're also in 'theDets' 00084 DetContainer theTIBDets; // not owned: they're also in 'theDets' 00085 DetContainer theTIDDets; // not owned: they're also in 'theDets' 00086 DetContainer theTOBDets; // not owned: they're also in 'theDets' 00087 DetContainer theTECDets; // not owned: they're also in 'theDets' 00088 00089 00090 }; 00091 00092 #endif