Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:37

0001 #include <vector>
0002 #include <iostream>
0003 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTLookupTables.h"
0004 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0005 using std::cout;
0006 using std::endl;
0007 int main() {
0008   // For testing use 1:1 LUT
0009   std::vector<double> eGammaECalScaleFactors(32, 1.0);
0010   std::vector<double> eGammaHCalScaleFactors(32, 1.0);
0011   std::vector<double> jetMETECalScaleFactors(32, 1.0);
0012   std::vector<double> jetMETHCalScaleFactors(32, 1.0);
0013   std::vector<double> c,d,e,f,g,h;
0014   L1RCTParameters* rctParameters = 
0015     new L1RCTParameters(1.0,                       // eGammaLSB
0016             1.0,                       // jetMETLSB
0017             3.0,                       // eMinForFGCut
0018             40.0,                      // eMaxForFGCut
0019             0.5,                       // hOeCut
0020             1.0,                       // eMinForHoECut
0021             50.0,                      // eMaxForHoECut
0022             1.0,                       // hMinForHoECut
0023             2.0,                       // eActivityCut
0024             3.0,                       // hActivityCut
0025             3,                         // eicIsolationThreshold
0026                         3,                         // jscQuietThresholdBarrel
0027                         3,                         // jscQuietThresholdEndcap
0028             false,                     // noiseVetoHB
0029             false,                     // noiseVetoHEplus
0030             false,                     // noiseVetoHEminus
0031             false,                     // use Lindsey
0032             eGammaECalScaleFactors,
0033             eGammaHCalScaleFactors,
0034             jetMETECalScaleFactors,
0035             jetMETHCalScaleFactors,
0036             c,
0037             d,
0038             e,
0039             f,
0040             g,
0041             h
0042             );
0043   L1RCTLookupTables* lut = new L1RCTLookupTables();
0044   lut->setRCTParameters(rctParameters);  // transcoder and etScale are not used
0045   std::cout << lut->lookup(0,0,0,0,0,0) << " should equal 0" << std::endl;
0046   std::cout << lut->lookup(2,0,0,0,0,0) << " should equal 514" << std::endl;
0047   std::cout << lut->lookup(10,0,0,0,0,0) << " should equal 133642 " << std::endl;
0048   std::cout << lut->lookup(10,0,1,0,0,0) << " should equal 133770 " << std::endl;
0049   std::cout << lut->lookup(0,10,0,0,0,0) << " should equal 133770 " << std::endl;
0050   std::cout << lut->lookup(0,10,1,0,0,0) << " should equal 133770 " << std::endl;
0051   std::cout << lut->lookup(255,0,0,0,0,0) << " should equal 196479 " << std::endl;
0052 }
0053