Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:32

0001 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCT.h"
0002 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTLookupTables.h"
0003 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0004 
0005 #include <vector>
0006 #include <iostream>
0007 using std::vector;
0008 using std::cout;
0009 using std::endl;
0010 
0011 vector<std::vector<std::vector<unsigned short> > > zeroVec(){
0012   std::vector<std::vector<std::vector<unsigned short> > > v(18,std::vector<std::vector<unsigned short> >(7,
0013                            std::vector<unsigned short>(64)));
0014   return v;
0015 } 
0016 
0017 int main(){
0018   // For testing use 1:1 LUT
0019   std::vector<double> eGammaECalScaleFactors(32, 1.0);
0020   std::vector<double> eGammaHCalScaleFactors(32, 1.0);
0021   std::vector<double> jetMETECalScaleFactors(32, 1.0);
0022   std::vector<double> jetMETHCalScaleFactors(32, 1.0);
0023   std::vector<double> c,d,e,f,g,h;
0024   L1RCTParameters* rctParameters = 
0025     new L1RCTParameters(1.0,                       // eGammaLSB
0026             1.0,                       // jetMETLSB
0027             3.0,                       // eMinForFGCut
0028             40.0,                      // eMaxForFGCut
0029             0.5,                       // hOeCut
0030             1.0,                       // eMinForHoECut
0031             50.0,                      // eMaxForHoECut
0032             1.0,                       // hMinForHoECut
0033             2.0,                       // eActivityCut
0034             3.0,                       // hActivityCut
0035             3,                         // eicIsolationThreshold
0036                         3,                         // jscQuietThresholdBarrel
0037                         3,                         // jscQuietThresholdEndcap
0038             false,                     // noiseVetoHB
0039             false,                     // noiseVetoHEplus
0040             false,                     // noiseVetoHEminus
0041             false,                     // use Lindsey
0042             eGammaECalScaleFactors,
0043             eGammaHCalScaleFactors,
0044             jetMETECalScaleFactors,
0045             jetMETHCalScaleFactors,
0046             c,
0047             d,
0048             e,
0049             f,
0050             g,
0051             h
0052             );
0053   L1RCTLookupTables* lut = new L1RCTLookupTables();
0054   lut->setRCTParameters(rctParameters);  // transcoder and etScale are not used
0055   L1RCT rct(lut);
0056   std::vector<std::vector<unsigned short> > hf(18,std::vector<unsigned short>(8));
0057   std::vector<std::vector<std::vector<unsigned short> > > barrel(18,std::vector<std::vector<unsigned short> >(7,
0058                         std::vector<unsigned short>(64)));
0059   for(int j = 0; j<4; j++){
0060     for(int i = 0; i<8; i++){
0061       barrel = zeroVec();
0062       barrel.at(0).at(0).at(j+4*i) = 10;
0063       rct.input(barrel,hf);
0064       rct.processEvent();
0065       //rct.printEIC(0,0);
0066       
0067       barrel = zeroVec();
0068       barrel.at(0).at(0).at(j+4*i) = 5;
0069       if(i<7)
0070     barrel.at(0).at(0).at(j+4*(i+1)) = 5;
0071       else
0072     barrel.at(0).at(2).at(j) = 5;
0073       rct.input(barrel,hf);
0074       rct.processEvent();
0075       rct.printEIC(0,0);
0076       //rct.printEICEdges(0,0);
0077       rct.printEIC(0,2);
0078       
0079     }
0080   }
0081   
0082 }