Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-24 04:45:01

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   // runs the CCLUT procedure
0033   void run(CSCCLCTDigi& digi, unsigned numCFEBs, const CSCL1TPLookupTableCCLUT* lookupTableCCLUT) const;
0034 
0035 private:
0036   //calculates the id based on location of hits
0037   int calculateComparatorCode(const pattern& halfStripPattern) const;
0038 
0039   unsigned convertSlopeToRun2Pattern(const unsigned slope) const;
0040 
0041   // sets the 1/4 and 1/8 strip bits given a floating point position offset
0042   void assignPositionCC(const unsigned offset, std::tuple<int16_t, bool, bool>& returnValue) const;
0043 
0044   // actual LUT used
0045   CSCPatternBank::LCTPatterns clct_pattern_ = {};
0046 
0047   // verbosity level
0048   unsigned infoV_ = 0;
0049 };
0050 
0051 #endif