Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:11

0001 #ifndef Navigation_MuonNavigationSchool_H
0002 #define Navigation_MuonNavigationSchool_H
0003 
0004 /** \class MuonNavigationSchool
0005  *
0006  * Description:
0007  *  Navigation school for the muon system
0008  *  This class defines which DetLayers are reacheable from each Muon DetLayer
0009  *  (DT, CSC and RPC). The reacheableness is based on an eta range criteria.
0010  *
0011  *
0012  * \author : Stefano Lacaprara - INFN Padova <stefano.lacaprara@pd.infn.it>
0013  *
0014  * Modification:
0015  *
0016  * Chang Liu:
0017  * The class links maps for nextLayers and compatibleLayers in the same time.
0018  *
0019  * Cesare Calabria:
0020  * GEMs implementation.
0021  *
0022  * David Nash:
0023  * ME0s implementation.
0024  */
0025 
0026 #include "RecoMuon/Navigation/interface/MuonDetLayerMap.h"
0027 #include "TrackingTools/DetLayers/interface/NavigationSchool.h"
0028 #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h"
0029 #include <vector>
0030 #include <map>
0031 
0032 class MuonBarrelNavigableLayer;
0033 class MuonForwardNavigableLayer;
0034 class MuonEtaRange;
0035 class BarrelDetLayer;
0036 class ForwardDetLayer;
0037 
0038 class MuonNavigationSchool : public NavigationSchool {
0039 public:
0040   ///Constructor
0041   MuonNavigationSchool(const MuonDetLayerGeometry*,
0042                        bool enableRPC = true,
0043                        bool enableCSC = true,
0044                        bool enableGEM = false,
0045                        bool enableME0 = false);
0046   /// Destructor
0047   ~MuonNavigationSchool() override;
0048   /// return navigable layers, from base class
0049   StateType navigableLayers() override;
0050 
0051 private:
0052   /// add barrel layer
0053   void addBarrelLayer(const BarrelDetLayer*);
0054   /// add endcap layer (backward and forward)
0055   void addEndcapLayer(const ForwardDetLayer*);
0056   /// link barrel layers
0057   void linkBarrelLayers();
0058   /// link endcap layers
0059   void linkEndcapLayers(const MapE&, std::vector<MuonForwardNavigableLayer*>&);
0060   /// establish inward links
0061   void createInverseLinks();
0062   float calculateEta(const float&, const float&) const;
0063 
0064 private:
0065   struct delete_layer {
0066     template <typename T>
0067     void operator()(T*& p) {
0068       if (p) {
0069         delete p;
0070         p = nullptr;
0071       }
0072     }
0073   };
0074 
0075   MapB theBarrelLayers;    /// barrel
0076   MapE theForwardLayers;   /// +z endcap
0077   MapE theBackwardLayers;  /// -z endcap
0078 
0079   std::vector<MuonBarrelNavigableLayer*> theBarrelNLC;
0080   std::vector<MuonForwardNavigableLayer*> theForwardNLC;
0081   std::vector<MuonForwardNavigableLayer*> theBackwardNLC;
0082 
0083   const MuonDetLayerGeometry* theMuonDetLayerGeometry;
0084 };
0085 #endif