CMS 3D CMS Logo

GlobalTrackingGeometry.h
Go to the documentation of this file.
1 #ifndef GlobalTrackingGeometry_h
2 #define GlobalTrackingGeometry_h
3 
17 #include <vector>
18 #include <atomic>
19 
21 public:
22  GlobalTrackingGeometry(std::vector<const TrackingGeometry*>& geos);
23 
24  ~GlobalTrackingGeometry() override;
25 
26  // Return a vector of all det types.
27  const DetTypeContainer& detTypes() const override;
28 
29  // Returm a vector of all GeomDetUnit
30  const DetContainer& detUnits() const override;
31 
32  // Returm a vector of all GeomDet (including all GeomDetUnits)
33  const DetContainer& dets() const override;
34 
35  // Returm a vector of all GeomDetUnit DetIds
36  const DetIdContainer& detUnitIds() const override;
37 
38  // Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
39  const DetIdContainer& detIds() const override;
40 
41  // Return the pointer to the GeomDetUnit corresponding to a given DetId
42  const GeomDet* idToDetUnit(DetId) const override;
43 
44  // Return the pointer to the GeomDet corresponding to a given DetId
45  // (valid also for GeomDetUnits)
46  const GeomDet* idToDet(DetId) const override;
47 
49  const TrackingGeometry* slaveGeometry(DetId id) const;
50 
51 private:
52  std::vector<const TrackingGeometry*> theGeometries;
53 
54  // The const methods claim to simply return these vectors,
55  // but actually, they'll fill them up the first time they
56  // are called, which is rare (or never).
57  mutable std::atomic<DetTypeContainer*> theDetTypes;
58  mutable std::atomic<DetContainer*> theDetUnits;
59  mutable std::atomic<DetContainer*> theDets;
60  mutable std::atomic<DetIdContainer*> theDetUnitIds;
61  mutable std::atomic<DetIdContainer*> theDetIds;
62 };
63 
64 #endif
GlobalTrackingGeometry::theDetUnitIds
std::atomic< DetIdContainer * > theDetUnitIds
Definition: GlobalTrackingGeometry.h:60
TrackingGeometry.h
GlobalTrackingGeometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: GlobalTrackingGeometry.cc:149
TrackingGeometry
Definition: TrackingGeometry.h:26
GeomDet
Definition: GeomDet.h:27
GlobalTrackingGeometry::theGeometries
std::vector< const TrackingGeometry * > theGeometries
Definition: GlobalTrackingGeometry.h:52
GlobalTrackingGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: GlobalTrackingGeometry.cc:109
GlobalTrackingGeometry::theDetIds
std::atomic< DetIdContainer * > theDetIds
Definition: GlobalTrackingGeometry.h:61
GlobalTrackingGeometry::theDets
std::atomic< DetContainer * > theDets
Definition: GlobalTrackingGeometry.h:59
GlobalTrackingGeometry::theDetTypes
std::atomic< DetTypeContainer * > theDetTypes
Definition: GlobalTrackingGeometry.h:57
DetId
Definition: DetId.h:17
GlobalTrackingGeometry
Definition: GlobalTrackingGeometry.h:20
GlobalTrackingGeometry::detUnitIds
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: GlobalTrackingGeometry.cc:129
TrackingGeometry::DetTypeContainer
std::vector< const GeomDetType * > DetTypeContainer
Definition: TrackingGeometry.h:28
TrackingGeometry::DetIdContainer
std::vector< DetId > DetIdContainer
Definition: TrackingGeometry.h:30
TrackingGeometry::DetContainer
std::vector< const GeomDet * > DetContainer
Definition: TrackingGeometry.h:29
GlobalTrackingGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: GlobalTrackingGeometry.cc:89
GlobalTrackingGeometry::theDetUnits
std::atomic< DetContainer * > theDetUnits
Definition: GlobalTrackingGeometry.h:58
GlobalTrackingGeometry::slaveGeometry
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
Definition: GlobalTrackingGeometry.cc:54
GlobalTrackingGeometry::GlobalTrackingGeometry
GlobalTrackingGeometry(std::vector< const TrackingGeometry * > &geos)
Definition: GlobalTrackingGeometry.cc:13
GlobalTrackingGeometry::~GlobalTrackingGeometry
~GlobalTrackingGeometry() override
Definition: GlobalTrackingGeometry.cc:21
GlobalTrackingGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GlobalTrackingGeometry.cc:34
GlobalTrackingGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: GlobalTrackingGeometry.cc:69
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44