Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:41

0001 #ifndef CSCTrackFinder_CSCTFPtLUT_h
0002 #define CSCTrackFinder_CSCTFPtLUT_h
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h"
0006 #include "CondFormats/L1TObjects/interface/L1MuCSCPtLut.h"
0007 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0008 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
0009 #include "CondFormats/DataRecord/interface/L1MuCSCPtLutRcd.h"
0010 #include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h"
0011 #include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h"
0012 #include "L1Trigger/CSCTrackFinder/interface/CSCTFPtMethods.h"
0013 #include "FWCore/ParameterSet/interface/FileInPath.h"
0014 ///KK
0015 #include "FWCore/Framework/interface/ConsumesCollector.h"
0016 #include "FWCore/Framework/interface/EventSetup.h"
0017 ///
0018 
0019 class CSCTFPtLUT {
0020 public:
0021   struct Tokens {
0022     edm::ESGetToken<L1MuCSCPtLut, L1MuCSCPtLutRcd> ptLUT;
0023     edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> scales;
0024     edm::ESGetToken<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd> ptScale;
0025   };
0026 
0027   static Tokens consumes(edm::ConsumesCollector iC);
0028 
0029   ///KK
0030   CSCTFPtLUT(const edm::EventSetup& c, const Tokens& tokens);
0031   ///
0032 
0033   CSCTFPtLUT(const edm::ParameterSet&, const L1MuTriggerScales* scales, const L1MuTriggerPtScale* ptScale);
0034 
0035   CSCTFPtLUT(const CSCTFPtLUT&);
0036   ~CSCTFPtLUT() {
0037     if (pt_lut)
0038       delete[] pt_lut;
0039     pt_lut = nullptr;
0040   }
0041 
0042   CSCTFPtLUT& operator=(const CSCTFPtLUT&);
0043 
0044   ptdat Pt(const ptadd&) const;
0045 
0046   ptdat Pt(const unsigned&) const;
0047 
0048   ptdat Pt(const unsigned& delta_phi_12,
0049            const unsigned& delta_phi23,
0050            const unsigned& track_eta,
0051            const unsigned& track_mode,
0052            const unsigned& track_fr,
0053            const unsigned& delta_phi_sign) const;
0054 
0055   ptdat Pt(const unsigned& delta_phi_12,
0056            const unsigned& track_eta,
0057            const unsigned& track_mode,
0058            const unsigned& track_fr,
0059            const unsigned& delta_phi_sign) const;
0060 
0061   static const int dPhiNLBMap_5bit[32];
0062   static const int dPhiNLBMap_7bit[128];
0063   static const int dPhiNLBMap_8bit[256];
0064 
0065   static const int dEtaCut_Low[24];
0066   static const int dEtaCut_Mid[24];
0067   static const int dEtaCut_High_A[24];
0068   static const int dEtaCut_High_B[24];
0069   static const int dEtaCut_High_C[24];
0070   static const int dEtaCut_Open[24];
0071 
0072   static const int getPtbyMLH;
0073 
0074 private:
0075   static ptdat* pt_lut;
0076   static bool lut_read_in;
0077   const L1MuTriggerScales* trigger_scale;
0078   const L1MuTriggerPtScale* trigger_ptscale;
0079   CSCTFPtMethods ptMethods;
0080 
0081   bool read_pt_lut, isBinary, isBeamStartConf;
0082   edm::FileInPath pt_lut_file;
0083   unsigned pt_method, lowQualityFlag;
0084 
0085   ptdat calcPt(const ptadd&) const;
0086   //unsigned trackQuality(const unsigned& eta, const unsigned& mode) const;
0087   unsigned trackQuality(const unsigned& eta, const unsigned& mode, const unsigned& fr) const;
0088   void readLUT();
0089 };
0090 
0091 #endif