Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:06

0001 #ifndef Geometry_TrackerGeometryBuilder_TrackerGeometry_H
0002 #define Geometry_TrackerGeometryBuilder_TrackerGeometry_H
0003 
0004 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0005 #include "Geometry/CommonDetUnit/interface/GeomDetEnumerators.h"
0006 #include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h"
0007 
0008 class GeometricDet;
0009 
0010 /**
0011  * A specific Tracker Builder which builds a Tracker from a list of DetUnits. 
0012  * Pattern recognition is used to discover layers, rings etc.
0013  */
0014 class TrackerGeometry final : public TrackingGeometry {
0015   explicit TrackerGeometry(GeometricDet const* gd = nullptr);
0016 
0017   friend class TrackerGeomBuilderFromGeometricDet;
0018 
0019   void addType(GeomDetType const* p);
0020   void addDetUnit(GeomDet const* p);
0021   void addDetUnitId(DetId p);
0022   void addDet(GeomDet const* p);
0023   void addDetId(DetId p);
0024   void finalize();
0025 
0026 public:
0027   typedef GeomDetEnumerators::SubDetector SubDetector;
0028 
0029   enum class ModuleType {
0030     UNKNOWN,
0031     PXB,
0032     PXF,
0033     IB1,
0034     IB2,
0035     OB1,
0036     OB2,
0037     W1A,
0038     W2A,
0039     W3A,
0040     W1B,
0041     W2B,
0042     W3B,
0043     W4,
0044     W5,
0045     W6,
0046     W7,
0047     Ph1PXB,
0048     Ph1PXF,
0049     Ph2PXB,
0050     Ph2PXF,
0051     Ph2PXB3D,
0052     Ph2PXF3D,
0053     Ph2PSP,
0054     Ph2PSS,
0055     Ph2SS
0056   };
0057 
0058   ~TrackerGeometry() override;
0059 
0060   const DetTypeContainer& detTypes() const override { return theDetTypes; }
0061   const DetContainer& detUnits() const override { return theDetUnits; }
0062   const DetContainer& dets() const override { return theDets; }
0063   const DetIdContainer& detUnitIds() const override { return theDetUnitIds; }
0064   const DetIdContainer& detIds() const override { return theDetIds; }
0065   const TrackerGeomDet* idToDetUnit(DetId) const override;
0066   const TrackerGeomDet* idToDet(DetId) const override;
0067 
0068   const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const;
0069   unsigned int numberOfLayers(int subdet) const;
0070   bool isThere(GeomDetEnumerators::SubDetector subdet) const;
0071 
0072   unsigned int offsetDU(SubDetector sid) const { return theOffsetDU[sid]; }
0073   unsigned int endsetDU(SubDetector sid) const { return theEndsetDU[sid]; }
0074   // Magic : better be called at the right moment...
0075   void setOffsetDU(SubDetector sid) { theOffsetDU[sid] = detUnits().size(); }
0076   void setEndsetDU(SubDetector sid) { theEndsetDU[sid] = detUnits().size(); }
0077   void fillTestMap(const GeometricDet* gd);
0078 
0079   ModuleType moduleType(const std::string& name) const;
0080 
0081   GeometricDet const* trackerDet() const { return theTrackerDet; }
0082 
0083   const DetContainer& detsPXB() const;
0084   const DetContainer& detsPXF() const;
0085   const DetContainer& detsTIB() const;
0086   const DetContainer& detsTID() const;
0087   const DetContainer& detsTOB() const;
0088   const DetContainer& detsTEC() const;
0089 
0090   ModuleType getDetectorType(DetId) const;
0091   float getDetectorThickness(DetId) const;
0092 
0093 private:
0094   GeometricDet const* theTrackerDet;
0095 
0096   /// Aligner has access to map
0097   friend class GeometryAligner;
0098 
0099   DetTypeContainer theDetTypes;  // owns the DetTypes
0100   DetContainer theDetUnits;      // they're all also into 'theDets', so we assume 'theDets' owns them
0101   unsigned int theOffsetDU[6];   // offsets in the above
0102   unsigned int theEndsetDU[6];   // end offsets in the above
0103   DetContainer theDets;          // owns *ONLY* the GeomDet * corresponding to GluedDets.
0104   DetIdContainer theDetUnitIds;
0105   DetIdContainer theDetIds;
0106   mapIdToDetUnit theMapUnit;  // does not own GeomDetUnit *
0107   mapIdToDet theMap;          // does not own GeomDet *
0108 
0109   DetContainer thePXBDets;  // not owned: they're also in 'theDets'
0110   DetContainer thePXFDets;  // not owned: they're also in 'theDets'
0111   DetContainer theTIBDets;  // not owned: they're also in 'theDets'
0112   DetContainer theTIDDets;  // not owned: they're also in 'theDets'
0113   DetContainer theTOBDets;  // not owned: they're also in 'theDets'
0114   DetContainer theTECDets;  // not owned: they're also in 'theDets'
0115 
0116   GeomDetEnumerators::SubDetector theSubDetTypeMap[6];
0117   unsigned int theNumberOfLayers[6];
0118   std::vector<std::tuple<DetId, TrackerGeometry::ModuleType, float> > theDetTypetList;
0119 };
0120 
0121 #endif