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
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::vector< const TrackingGeometry * > theGeometries
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
std::atomic< DetIdContainer * > theDetUnitIds
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
GlobalTrackingGeometry(std::vector< const TrackingGeometry *> &geos)
const GeomDet * idToDet(DetId) const override
std::atomic< DetContainer * > theDets
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
std::vector< const GeomDet * > DetContainer
std::atomic< DetIdContainer * > theDetIds
std::atomic< DetTypeContainer * > theDetTypes
std::atomic< DetContainer * > theDetUnits
Definition: DetId.h:17
std::vector< DetId > DetIdContainer
std::vector< const GeomDetType * > DetTypeContainer
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.