Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:49

0001 #ifndef RecoMTD_DetLayers_MTDDetLayerGeometry_h
0002 #define RecoMTD_DetLayers_MTDDetLayerGeometry_h
0003 
0004 /** \class MTDDetLayerGeometry
0005  *
0006  *  Provide access to the DetLayers of mip timing detectors.
0007  *
0008  *  \author L. Gray - FNAL
0009  *  
0010  */
0011 
0012 #include "DataFormats/DetId/interface/DetId.h"
0013 #include "TrackingTools/DetLayers/interface/DetLayerGeometry.h"
0014 #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h"
0015 #include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h"
0016 
0017 #include <vector>
0018 #include <map>
0019 
0020 class DetLayer;
0021 
0022 class MTDDetLayerGeometry : public DetLayerGeometry {
0023 public:
0024   /// Constructor
0025   MTDDetLayerGeometry();
0026 
0027   friend class MTDDetLayerGeometryESProducer;
0028 
0029   /// Destructor
0030   ~MTDDetLayerGeometry() override;
0031 
0032   /// return all barrel layers
0033   const std::vector<const DetLayer*>& allBarrelLayers() const;
0034 
0035   /// return all endcap layers
0036   const std::vector<const DetLayer*>& allEndcapLayers() const;
0037 
0038   /// return all endcap layers
0039   const std::vector<const DetLayer*>& allForwardLayers() const;
0040 
0041   /// return all endcap layers
0042   const std::vector<const DetLayer*>& allBackwardLayers() const;
0043 
0044   /// return the BTL DetLayers (barrel), inside-out
0045   const std::vector<const DetLayer*>& allBTLLayers() const;
0046 
0047   /// return the ETL DetLayers (endcap), -Z to +Z
0048   const std::vector<const DetLayer*>& allETLLayers() const;
0049 
0050   /// return all DetLayers (barrel + endcap), -Z to +Z
0051   const std::vector<const DetLayer*>& allLayers() const;
0052 
0053   /// return the DetLayer which correspond to a certain DetId
0054   const DetLayer* idToLayer(const DetId& detId) const override;
0055 
0056   // Added to allow building the MTDDetLayer from external plugins
0057   void buildLayers(const MTDGeometry* geo, const MTDTopology* mtopo);
0058 
0059   void sortLayers();
0060 
0061 private:
0062   /// Add ETL layers
0063   /// etllayers.first=forward (+Z), etllayers.second=backward (-Z)
0064   /// both vectors are ASSUMED to be sorted inside-out
0065   void addETLLayers(const std::pair<std::vector<DetLayer*>, std::vector<DetLayer*> >& etllayers);
0066 
0067   //. Add BTL layers; dtlayers is ASSUMED to be sorted inside-out
0068   void addBTLLayers(const std::vector<DetLayer*>& btllayers);
0069 
0070   DetId makeDetLayerId(const DetLayer* detLayer) const;
0071 
0072   std::vector<const DetLayer*> etlLayers_fw;
0073   std::vector<const DetLayer*> etlLayers_bk;
0074   std::vector<const DetLayer*> etlLayers_all;
0075 
0076   //////////////////////////////
0077   std::vector<const DetLayer*> btlLayers;
0078   std::vector<const DetLayer*> allForward;
0079   std::vector<const DetLayer*> allBackward;
0080   std::vector<const DetLayer*> allEndcap;
0081   std::vector<const DetLayer*> allBarrel;
0082   std::vector<const DetLayer*> allDetLayers;
0083 
0084   std::map<DetId, const DetLayer*> detLayersMap;
0085 };
0086 #endif