Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:23

0001 #ifndef TrackingGeometry_h
0002 #define TrackingGeometry_h
0003 
0004 /** \class TrackingGeometry
0005  *
0006  *  Base class for the geometry of tracking detectors.
0007  *  A geometry contains both the GeomDetUnit s and bigger composite 
0008  *  structures, which are concrete GeomDet s.
0009  *
0010  *  There are therefore 2 kind of methods in the interface: 
0011  *   - the generic ones, i.e.
0012  *  dets(), detIds(), idToDet(), do not distinguish between 
0013  *  GeomDet and GeomDetUnit, and can be used blindly for the typical use
0014  *  of accessing the reference frame transformation of the det. 
0015  *   - Those specific to GeomDetUnit s, i.e. detUnits(),  detUnitIds(), 
0016  *  idToDetUnit(), are useful when it is necessary to deal with the 
0017  *  extended interface of GeomDetUnit. 
0018  *
0019  */
0020 
0021 #include "DataFormats/DetId/interface/DetId.h"
0022 #include "Geometry/CommonTopologies/interface/GeomDet.h"
0023 #include <vector>
0024 #include <unordered_map>
0025 
0026 class TrackingGeometry {
0027 public:
0028   using DetTypeContainer = std::vector<const GeomDetType*>;
0029   using DetContainer = std::vector<const GeomDet*>;
0030   using DetIdContainer = std::vector<DetId>;
0031   using mapIdToDetUnit = std::unordered_map<unsigned int, const GeomDet*>;
0032   using mapIdToDet = std::unordered_map<unsigned int, const GeomDet*>;
0033 
0034   /// Destructor.
0035   virtual ~TrackingGeometry() {}
0036 
0037   /// Return a vector of all det types.
0038   virtual const DetTypeContainer& detTypes() const = 0;
0039 
0040   /// Returm a vector of all GeomDet
0041   virtual const DetContainer& detUnits() const = 0;
0042 
0043   /// Returm a vector of all GeomDet (including all GeomDetUnits)
0044   virtual const DetContainer& dets() const = 0;
0045 
0046   /// Returm a vector of all GeomDetUnit DetIds
0047   virtual const DetIdContainer& detUnitIds() const = 0;
0048 
0049   /// Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
0050   virtual const DetIdContainer& detIds() const = 0;
0051 
0052   /// Return the pointer to the GeomDetUnit corresponding to a given DetId
0053   virtual const GeomDet* idToDetUnit(DetId) const = 0;
0054 
0055   /// Return the pointer to the GeomDet corresponding to a given DetId
0056   /// (valid also for GeomDetUnits)
0057   virtual const GeomDet* idToDet(DetId) const = 0;
0058 };
0059 
0060 #endif