CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~GlobalTrackingGeometry();
28 
29  // Return a vector of all det types.
30  virtual const DetTypeContainer& detTypes() const;
31 
32  // Returm a vector of all GeomDetUnit
33  virtual const DetUnitContainer& detUnits() const;
34 
35  // Returm a vector of all GeomDet (including all GeomDetUnits)
36  virtual const DetContainer& dets() const;
37 
38  // Returm a vector of all GeomDetUnit DetIds
39  virtual const DetIdContainer& detUnitIds() const;
40 
41  // Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
42  virtual const DetIdContainer& detIds() const;
43 
44  // Return the pointer to the GeomDetUnit corresponding to a given DetId
45  virtual const GeomDetUnit* idToDetUnit(DetId) const;
46 
47  // Return the pointer to the GeomDet corresponding to a given DetId
48  // (valid also for GeomDetUnits)
49  virtual const GeomDet* idToDet(DetId) const;
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< const TrackingGeometry * > theGeometries
std::atomic< DetIdContainer * > theDetUnitIds
std::vector< GeomDet * > DetContainer
std::atomic< DetContainer * > theDets
virtual const GeomDet * idToDet(DetId) const
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::atomic< DetUnitContainer * > theDetUnits
std::atomic< DetIdContainer * > theDetIds
std::vector< GeomDetUnit * > DetUnitContainer
std::atomic< DetTypeContainer * > theDetTypes
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
virtual ~GlobalTrackingGeometry()
Destructor.
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
std::vector< GeomDetType * > DetTypeContainer
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DetId.h:18
GlobalTrackingGeometry(std::vector< const TrackingGeometry * > &geos)
Constructor.
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
std::vector< DetId > DetIdContainer