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