Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-03 22:28:26

0001 #ifndef L1Trigger_CSCTriggerPrimitives_ComparatorCodeLUT
0002 #define L1Trigger_CSCTriggerPrimitives_ComparatorCodeLUT
0003 
0004 /** \class ComparatorCodeLUT
0005  *
0006  * Helper class to calculate for the comparator code
0007  * algorithm for Phase-2.
0008  *
0009  * \author Sven Dildick (Rice University)
0010  *
0011  */
0012 
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "DataFormats/CSCDigi/interface/CSCConstants.h"
0016 #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h"
0017 #include "L1Trigger/CSCTriggerPrimitives/interface/CSCPatternBank.h"
0018 #include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h"
0019 
0020 #include <vector>
0021 #include <string>
0022 
0023 class CSCCLCTDigi;
0024 
0025 class ComparatorCodeLUT {
0026 public:
0027   typedef std::array<std::array<int, 3>, CSCConstants::NUM_LAYERS> pattern;
0028 
0029   // constructor
0030   ComparatorCodeLUT(const edm::ParameterSet& conf);
0031 
0032   void setESLookupTables(const CSCL1TPLookupTableCCLUT* conf);
0033 
0034   // runs the CCLUT procedure
0035   void run(CSCCLCTDigi& digi, unsigned numCFEBs) const;
0036 
0037 private:
0038   //calculates the id based on location of hits
0039   int calculateComparatorCode(const pattern& halfStripPattern) const;
0040 
0041   unsigned convertSlopeToRun2Pattern(const unsigned slope) const;
0042 
0043   // sets the 1/4 and 1/8 strip bits given a floating point position offset
0044   void assignPositionCC(const unsigned offset, std::tuple<int16_t, bool, bool>& returnValue) const;
0045 
0046   // actual LUT used
0047   CSCPatternBank::LCTPatterns clct_pattern_ = {};
0048 
0049   // verbosity level
0050   unsigned infoV_;
0051 
0052   // access to lookup tables via eventsetup
0053   const CSCL1TPLookupTableCCLUT* lookupTableCCLUT_;
0054 };
0055 
0056 #endif