Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1TMuonEndCap_PtAssignmentEngine_h
0002 #define L1TMuonEndCap_PtAssignmentEngine_h
0003 
0004 #include <cstdint>
0005 #include <cstdlib>
0006 #include <cmath>
0007 #include <string>
0008 #include <vector>
0009 #include <array>
0010 
0011 #include "L1Trigger/L1TMuonEndCap/interface/Common.h"
0012 #include "L1Trigger/L1TMuonEndCap/interface/PtAssignmentEngineAux.h"
0013 #include "L1Trigger/L1TMuonEndCap/interface/PtLUTReader.h"
0014 #include "L1Trigger/L1TMuonEndCap/interface/bdt/Forest.h"
0015 
0016 class PtAssignmentEngine {
0017 public:
0018   explicit PtAssignmentEngine();
0019   virtual ~PtAssignmentEngine();
0020 
0021   typedef uint64_t address_t;
0022 
0023   void read(int pt_lut_version, const std::string& xml_dir);
0024   void load(int pt_lut_version, const L1TMuonEndCapForest* payload);
0025   const std::array<emtf::Forest, 16>& getForests(void) const { return forests_; }
0026   const std::vector<int>& getAllowedModes(void) const { return allowedModes_; }
0027 
0028   int get_pt_lut_version() const { return ptLUTVersion_; }
0029 
0030   void configure(
0031       int verbose, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt);
0032 
0033   void configure_details();
0034 
0035   const PtAssignmentEngineAux& aux() const;
0036 
0037   virtual float scale_pt(const float pt, const int mode = 15) const = 0;
0038   virtual float unscale_pt(const float pt, const int mode = 15) const = 0;
0039 
0040   virtual address_t calculate_address(const EMTFTrack& track) const { return 0; }
0041 
0042   virtual float calculate_pt(const address_t& address) const;
0043   virtual float calculate_pt(const EMTFTrack& track) const;
0044 
0045   virtual float calculate_pt_lut(const address_t& address) const;
0046   virtual float calculate_pt_xml(const address_t& address) const { return 0.; }
0047   virtual float calculate_pt_xml(const EMTFTrack& track) const { return 0.; }
0048 
0049 protected:
0050   std::vector<int> allowedModes_;
0051   std::array<emtf::Forest, 16> forests_;
0052   PtLUTReader ptlut_reader_;
0053 
0054   int verbose_;
0055 
0056   int ptLUTVersion_;  // init: 0xFFFFFFFF
0057   bool readPtLUTFile_, fixMode15HighPt_;
0058   bool bug9BitDPhi_, bugMode7CLCT_, bugNegPt_;
0059 };
0060 
0061 #endif