Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:23:25

0001 #ifndef ANGLECONVERTER_H
0002 #define ANGLECONVERTER_H
0003 
0004 #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
0005 #include "FWCore/Utilities/interface/ESGetToken.h"
0006 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0007 
0008 #include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
0009 
0010 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0011 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0012 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0013 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0014 
0015 #include <memory>
0016 
0017 class CSCLayer;
0018 
0019 class L1MuDTChambPhDigi;
0020 class L1MuDTChambThContainer;
0021 class CSCCorrelatedLCTDigi;
0022 class RPCDigi;
0023 class CSCDetId;
0024 class RPCDetId;
0025 
0026 class AngleConverter {
0027 public:
0028   AngleConverter(edm::ConsumesCollector &, bool getDuringEvent = true);
0029   ~AngleConverter();
0030 
0031   ///Update the Geometry with current Event Setup
0032   void checkAndUpdateGeometry(const edm::EventSetup &, unsigned int);
0033 
0034   /// get phi of DT,CSC and RPC azimutal angle digi in processor scale, used by OMTF algorithm.
0035   /// in case of wrong phi returns OMTFConfiguration::instance()->nPhiBins
0036   int getProcessorPhi(unsigned int iProcessor, l1t::tftype part, const L1MuDTChambPhDigi &digi) const;
0037   int getProcessorPhi(unsigned int iProcessor,
0038                       l1t::tftype part,
0039                       const CSCDetId &csc,
0040                       const CSCCorrelatedLCTDigi &digi) const;
0041   int getProcessorPhi(unsigned int iProcessor, l1t::tftype part, const RPCDetId &rollId, const unsigned int &digi) const;
0042   int getProcessorPhi(unsigned int iProcessor,
0043                       l1t::tftype part,
0044                       const RPCDetId &rollId,
0045                       const unsigned int &digi1,
0046                       const unsigned int &digi2) const;
0047 
0048   ///Convert local eta coordinate to global digital microGMT scale.
0049   int getGlobalEta(unsigned int rawid, const L1MuDTChambPhDigi &aDigi, const L1MuDTChambThContainer *dtThDigis);
0050 
0051   ///Convert local eta coordinate to global digital microGMT scale.
0052   int getGlobalEta(unsigned int rawid, const CSCCorrelatedLCTDigi &aDigi);
0053 
0054   ///Convert local eta coordinate to global digital microGMT scale.
0055   int getGlobalEta(unsigned int rawid, const unsigned int &aDigi);
0056 
0057 private:
0058   ///Check orientation of strips in given CSC chamber
0059   bool isCSCCounterClockwise(const std::unique_ptr<const CSCLayer> &layer) const;
0060 
0061   ///Find BTI group
0062   const int findBTIgroup(const L1MuDTChambPhDigi &aDigi, const L1MuDTChambThContainer *dtThDigis);
0063 
0064   edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeometryToken_;
0065   edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeometryToken_;
0066   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeometryToken_;
0067 
0068   // pointers to the current geometry records
0069   unsigned long long _geom_cache_id;
0070   RPCGeometry const *_georpc;
0071   CSCGeometry const *_geocsc;
0072   DTGeometry const *_geodt;
0073 
0074   ///Number of phi bins along 2Pi.
0075   unsigned int nPhiBins;
0076 };
0077 
0078 #endif