Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:13

0001 #ifndef MuonDetLayerMap_h
0002 #define MuonDetLayerMap_h
0003 
0004 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
0005 #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
0006 #include "RecoMuon/Navigation/interface/MuonEtaRange.h"
0007 
0008 #include <map>
0009 #include <functional>
0010 
0011 /** \class MuonDetLayerComp
0012  *
0013  * Sort the of BarrelDetLayers by radius, ForwardDetLayer by |Z|.
0014  *
0015  *
0016  * \author : Stefano Lacaprara, Nicola Amapane
0017  *
0018  *
0019  */
0020 
0021 struct MuonDetLayerComp {
0022   bool operator()(const BarrelDetLayer* l1, const BarrelDetLayer* l2) const {
0023     if (l1->specificSurface().radius() < l2->specificSurface().radius())
0024       return true;
0025     return false;
0026   }
0027 
0028   bool operator()(const ForwardDetLayer* l1, const ForwardDetLayer* l2) const {
0029     if (fabs(l1->surface().position().z()) < fabs(l2->surface().position().z()))
0030       return true;
0031     return false;
0032   }
0033 };
0034 
0035 // FIXME: these names are too generic...
0036 typedef std::map<const BarrelDetLayer*, MuonEtaRange, MuonDetLayerComp> MapB;
0037 typedef std::map<const ForwardDetLayer*, MuonEtaRange, MuonDetLayerComp> MapE;
0038 typedef MapB::const_iterator MapBI;
0039 typedef MapE::const_iterator MapEI;
0040 
0041 #endif