Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DetLayers_MuonDetLayerGeometry_h
0002 #define DetLayers_MuonDetLayerGeometry_h
0003 
0004 /** \class MuonDetLayerGeometry
0005  *
0006  *  Provide access to the DetLayers of muon detectors.
0007  *
0008  *  \author N. Amapane - CERN
0009  *  
0010  *  \modified by R. Radogna & C. Calabria & A. Sharma
0011  *  \modified by D. Nash
0012  */
0013 
0014 #include "DataFormats/DetId/interface/DetId.h"
0015 #include "TrackingTools/DetLayers/interface/DetLayerGeometry.h"
0016 #include <vector>
0017 #include <map>
0018 
0019 class DetLayer;
0020 
0021 class MuonDetLayerGeometry : public DetLayerGeometry {
0022 public:
0023   /// Constructor
0024   MuonDetLayerGeometry();
0025 
0026   friend class MuonDetLayerGeometryESProducer;
0027 
0028   /// Destructor
0029   ~MuonDetLayerGeometry() override;
0030 
0031   /// return the DT DetLayers (barrel), inside-out
0032   const std::vector<const DetLayer*>& allDTLayers() const;
0033 
0034   /// return the CSC DetLayers (endcap), -Z to +Z
0035   const std::vector<const DetLayer*>& allCSCLayers() const;
0036 
0037   /// return the forward (+Z) CSC DetLayers, inside-out
0038   const std::vector<const DetLayer*>& forwardCSCLayers() const;
0039 
0040   /// return the backward (-Z) CSC DetLayers, inside-out
0041   const std::vector<const DetLayer*>& backwardCSCLayers() const;
0042 
0043   /////////////////////////////// GEMs
0044 
0045   /// return the GEM DetLayers (endcap), -Z to +Z
0046   const std::vector<const DetLayer*>& allGEMLayers() const;
0047 
0048   /// return the forward (+Z) GEM DetLayers, inside-out
0049   const std::vector<const DetLayer*>& forwardGEMLayers() const;
0050 
0051   /// return the backward (-Z) GEM DetLayers, inside-out
0052   const std::vector<const DetLayer*>& backwardGEMLayers() const;
0053 
0054   //////////////////////////////
0055 
0056   /////////////////////////////// ME0s
0057 
0058   /// return the ME0 DetLayers (endcap), -Z to +Z
0059   const std::vector<const DetLayer*>& allME0Layers() const;
0060 
0061   /// return the forward (+Z) ME0 DetLayers, inside-out
0062   const std::vector<const DetLayer*>& forwardME0Layers() const;
0063 
0064   /// return the backward (-Z) ME0 DetLayers, inside-out
0065   const std::vector<const DetLayer*>& backwardME0Layers() const;
0066 
0067   //////////////////////////////
0068 
0069   /// return all RPC DetLayers, order: backward, barrel, forward
0070   const std::vector<const DetLayer*>& allRPCLayers() const;
0071 
0072   /// return the barrel RPC DetLayers, inside-out
0073   const std::vector<const DetLayer*>& barrelRPCLayers() const;
0074 
0075   /// return the endcap RPC DetLayers, -Z to +Z
0076   const std::vector<const DetLayer*>& endcapRPCLayers() const;
0077 
0078   /// return the forward (+Z) RPC DetLayers, inside-out
0079   const std::vector<const DetLayer*>& forwardRPCLayers() const;
0080 
0081   /// return the backward (-Z) RPC DetLayers, inside-out
0082   const std::vector<const DetLayer*>& backwardRPCLayers() const;
0083 
0084   /// return all layers (DT+CSC+RPC+GEM), order: backward, barrel, forward
0085   const std::vector<const DetLayer*>& allLayers() const;
0086 
0087   /// return all barrel DetLayers (DT+RPC), inside-out
0088   const std::vector<const DetLayer*>& allBarrelLayers() const;
0089 
0090   /// return all endcap DetLayers (CSC+RPC+GEM+ME0), -Z to +Z
0091   const std::vector<const DetLayer*>& allEndcapLayers() const;
0092 
0093   /// return all forward (+Z) layers (CSC+RPC+GEM+ME0), inside-out
0094   const std::vector<const DetLayer*>& allForwardLayers() const;
0095 
0096   /// return all backward (-Z) layers (CSC+RPC+GEM+ME0), inside-out
0097   const std::vector<const DetLayer*>& allBackwardLayers() const;
0098 
0099   /////////////////////////////// GEMs
0100 
0101   /// return all endcap DetLayers (CSC+GEM), -Z to +Z
0102   const std::vector<const DetLayer*>& allEndcapCscGemLayers() const;
0103 
0104   /// return all endcap DetLayers (CSC+GEM), -Z to +Z
0105   const std::vector<const DetLayer*>& allCscGemForwardLayers() const;
0106 
0107   /// return all endcap DetLayers (CSC+GEM), -Z to +Z
0108   const std::vector<const DetLayer*>& allCscGemBackwardLayers() const;
0109 
0110   //////////////////////////////
0111 
0112   /////////////////////////////// ME0s
0113 
0114   /// return all endcap DetLayers (CSC+ME0), -Z to +Z
0115   const std::vector<const DetLayer*>& allEndcapCscME0Layers() const;
0116 
0117   /// return all endcap DetLayers (CSC+ME0), -Z to +Z
0118   const std::vector<const DetLayer*>& allCscME0ForwardLayers() const;
0119 
0120   /// return all endcap DetLayers (CSC+ME0), -Z to +Z
0121   const std::vector<const DetLayer*>& allCscME0BackwardLayers() const;
0122 
0123   //////////////////////////////
0124 
0125   /// return the DetLayer which correspond to a certain DetId
0126   const DetLayer* idToLayer(const DetId& detId) const override;
0127 
0128 private:
0129   /// Add CSC layers
0130   /// csclayers.first=forward (+Z), csclayers.second=backward (-Z)
0131   /// both vectors are ASSUMED to be sorted inside-out
0132   void addCSCLayers(const std::pair<std::vector<DetLayer*>, std::vector<DetLayer*> >& csclayers);
0133 
0134   //. Add DT layers; dtlayers is ASSUMED to be sorted inside-out
0135   void addDTLayers(const std::vector<DetLayer*>& dtlayers);
0136 
0137   /// Add RPC layers
0138   /// endcapRPCLayers.first=forward (+Z), endcapRPCLayers.second=backward (-Z)
0139   /// All three vectors are ASSUMED to be sorted inside-out
0140   void addRPCLayers(const std::vector<DetLayer*>& barrelRPCLayers,
0141                     const std::pair<std::vector<DetLayer*>, std::vector<DetLayer*> >& endcapRPCLayers);
0142 
0143   /////////////////////////////// GEMs
0144 
0145   /// Add GEM layers
0146   /// gemlayers.first=forward (+Z), gemlayers.second=backward (-Z)
0147   /// both vectors are ASSUMED to be sorted inside-out
0148   void addGEMLayers(const std::pair<std::vector<DetLayer*>, std::vector<DetLayer*> >& gemlayers);
0149   //////////////////////////////
0150 
0151   /////////////////////////////// ME0s
0152 
0153   /// Add ME0 layers
0154   /// gemlayers.first=forward (+Z), gemlayers.second=backward (-Z)
0155   /// both vectors are ASSUMED to be sorted inside-out
0156   void addME0Layers(const std::pair<std::vector<DetLayer*>, std::vector<DetLayer*> >& gemlayers);
0157 
0158   //////////////////////////////
0159 
0160   DetId makeDetLayerId(const DetLayer* detLayer) const;
0161 
0162   void sortLayers();
0163 
0164   std::vector<const DetLayer*> cscLayers_fw;
0165   std::vector<const DetLayer*> cscLayers_bk;
0166   std::vector<const DetLayer*> cscLayers_all;
0167 
0168   /////////////////////////////// GEMs
0169 
0170   std::vector<const DetLayer*> gemLayers_fw;
0171   std::vector<const DetLayer*> gemLayers_bk;
0172   std::vector<const DetLayer*> gemLayers_all;
0173 
0174   /////////////////////////////// ME0s
0175 
0176   std::vector<const DetLayer*> me0Layers_fw;
0177   std::vector<const DetLayer*> me0Layers_bk;
0178   std::vector<const DetLayer*> me0Layers_all;
0179 
0180   //////////////////////////////
0181   //////////////////////////////
0182   std::vector<const DetLayer*> rpcLayers_all;
0183   std::vector<const DetLayer*> rpcLayers_endcap;
0184   std::vector<const DetLayer*> rpcLayers_fw;
0185   std::vector<const DetLayer*> rpcLayers_bk;
0186   std::vector<const DetLayer*> rpcLayers_barrel;
0187   std::vector<const DetLayer*> dtLayers;
0188   std::vector<const DetLayer*> allForward;
0189   std::vector<const DetLayer*> allBackward;
0190   std::vector<const DetLayer*> allEndcap;
0191   std::vector<const DetLayer*> allBarrel;
0192   std::vector<const DetLayer*> allDetLayers;
0193 
0194   /////////////////////////////// GEMs
0195 
0196   std::vector<const DetLayer*> allEndcapCscGem;
0197   std::vector<const DetLayer*> allCscGemForward;
0198   std::vector<const DetLayer*> allCscGemBackward;
0199 
0200   //////////////////////////////
0201 
0202   /////////////////////////////// ME0s
0203 
0204   std::vector<const DetLayer*> allEndcapCscME0;
0205   std::vector<const DetLayer*> allCscME0Forward;
0206   std::vector<const DetLayer*> allCscME0Backward;
0207 
0208   //////////////////////////////
0209 
0210   std::map<DetId, const DetLayer*> detLayersMap;
0211 };
0212 #endif