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 {
22  public:
23 
24  GlobalTrackingGeometry(std::vector<const TrackingGeometry*>& geos);
25 
26  ~GlobalTrackingGeometry() override;
27 
28  // Return a vector of all det types.
29  const DetTypeContainer& detTypes() const override;
30 
31  // Returm a vector of all GeomDetUnit
32  const DetContainer& detUnits() const override;
33 
34  // Returm a vector of all GeomDet (including all GeomDetUnits)
35  const DetContainer& dets() const override;
36 
37  // Returm a vector of all GeomDetUnit DetIds
38  const DetIdContainer& detUnitIds() const override;
39 
40  // Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
41  const DetIdContainer& detIds() const override;
42 
43  // Return the pointer to the GeomDetUnit corresponding to a given DetId
44  const GeomDet* idToDetUnit(DetId) const override;
45 
46  // Return the pointer to the GeomDet corresponding to a given DetId
47  // (valid also for GeomDetUnits)
48  const GeomDet* idToDet(DetId) const override;
49 
51  const TrackingGeometry* slaveGeometry(DetId id) const;
52 
53  private:
54 
55  std::vector<const TrackingGeometry*> theGeometries;
56 
57  // The const methods claim to simply return these vectors,
58  // but actually, they'll fill them up the first time they
59  // are called, which is rare (or never).
60  mutable std::atomic<DetTypeContainer*> theDetTypes;
61  mutable std::atomic<DetContainer*> theDetUnits;
62  mutable std::atomic<DetContainer*> theDets;
63  mutable std::atomic<DetIdContainer*> theDetUnitIds;
64  mutable std::atomic<DetIdContainer*> theDetIds;
65 };
66 
67 #endif
68 
std::vector< const TrackingGeometry * > theGeometries
std::atomic< DetIdContainer * > theDetUnitIds
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
std::atomic< DetContainer * > theDets
std::atomic< DetIdContainer * > theDetIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
std::atomic< DetTypeContainer * > theDetTypes
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
std::atomic< DetContainer * > theDetUnits
Definition: DetId.h:18
GlobalTrackingGeometry(std::vector< const TrackingGeometry * > &geos)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< DetId > DetIdContainer
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
std::vector< const GeomDet * > DetContainer
const GeomDet * idToDet(DetId) const override
std::vector< const GeomDetType * > DetTypeContainer