File indexing completed on 2024-04-06 12:14:26
0001 #ifndef DTGeometry_DTGeometry_h
0002 #define DTGeometry_DTGeometry_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <DataFormats/DetId/interface/DetId.h>
0015 #include <Geometry/CommonDetUnit/interface/TrackingGeometry.h>
0016 #include "Geometry/DTGeometry/interface/DTChamber.h"
0017 #include "Geometry/DTGeometry/interface/DTSuperLayer.h"
0018 #include "Geometry/DTGeometry/interface/DTLayer.h"
0019 #include <vector>
0020 #include <map>
0021
0022 class GeomDetType;
0023
0024 namespace cms {
0025 class DTGeometryBuilder;
0026 }
0027
0028 class DTGeometry : public TrackingGeometry {
0029 typedef std::map<DetId, GeomDet*> DTDetMap;
0030
0031 public:
0032
0033 DTGeometry();
0034
0035
0036 ~DTGeometry() override;
0037
0038 void clear();
0039
0040
0041
0042
0043 const DetTypeContainer& detTypes() const override;
0044
0045
0046 const DetContainer& detUnits() const override;
0047
0048
0049 const DetContainer& dets() const override;
0050
0051
0052 const DetIdContainer& detUnitIds() const override;
0053
0054
0055 const DetIdContainer& detIds() const override;
0056
0057
0058 const GeomDet* idToDetUnit(DetId) const override;
0059
0060
0061 const GeomDet* idToDet(DetId) const override;
0062
0063
0064
0065
0066 const std::vector<const DTChamber*>& chambers() const;
0067
0068
0069 const std::vector<const DTSuperLayer*>& superLayers() const;
0070
0071
0072 const std::vector<const DTLayer*>& layers() const;
0073
0074
0075 const DTChamber* chamber(const DTChamberId& id) const;
0076
0077
0078 const DTSuperLayer* superLayer(const DTSuperLayerId& id) const;
0079
0080
0081 const DTLayer* layer(const DTLayerId& id) const;
0082
0083 private:
0084 friend class cms::DTGeometryBuilder;
0085 friend class DTGeometryBuilderFromDDD;
0086 friend class DTGeometryBuilderFromDD4hep;
0087 friend class DTGeometryBuilderFromCondDB;
0088
0089 friend class GeometryAligner;
0090
0091 void deallocate();
0092
0093
0094 void add(DTChamber* ch);
0095
0096
0097 void add(DTSuperLayer* sl);
0098
0099
0100 void add(DTLayer* l);
0101
0102
0103
0104 std::vector<const DTChamber*> theChambers;
0105
0106
0107
0108
0109 std::vector<const DTSuperLayer*> theSuperLayers;
0110 std::vector<const DTLayer*> theLayers;
0111
0112
0113 DTDetMap theMap;
0114
0115
0116
0117 DetContainer theDetUnits;
0118 DetContainer theDets;
0119
0120
0121
0122 DetTypeContainer theDetTypes;
0123 DetIdContainer theDetUnitIds;
0124 DetIdContainer theDetIds;
0125 };
0126
0127 #endif