Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCT.h"
0002 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTLookupTables.h"
0003 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0004 
0005 #include <time.h>
0006 #include <iostream>
0007 using namespace std;
0008 #include <vector>
0009 
0010 int main (){
0011   // For testing use 1:1 LUT
0012   std::vector<double> eGammaECalScaleFactors(32, 1.0);
0013   std::vector<double> eGammaHCalScaleFactors(32, 1.0);
0014   std::vector<double> jetMETECalScaleFactors(32, 1.0);
0015   std::vector<double> jetMETHCalScaleFactors(32, 1.0);
0016   std::vector<double> c,d,e,f,g,h;
0017   L1RCTParameters* rctParameters = 
0018     new L1RCTParameters(1.0,                       // eGammaLSB
0019             1.0,                       // jetMETLSB
0020             3.0,                       // eMinForFGCut
0021             40.0,                      // eMaxForFGCut
0022             0.5,                       // hOeCut
0023             1.0,                       // eMinForHoECut
0024             50.0,                      // eMaxForHoECut
0025             1.0,                       // hMinForHoECut
0026             2.0,                       // eActivityCut
0027             3.0,                       // hActivityCut
0028             3,                         // eicIsolationThreshold
0029                         3,                         // jscQuietThresholdBarrel
0030                         3,                         // jscQuietThresholdEndcap
0031             false,                     // noiseVetoHB
0032             false,                     // noiseVetoHEplus
0033             false,                     // noiseVetoHEminus
0034             false,                     // use Lindsey
0035             eGammaECalScaleFactors,
0036             eGammaHCalScaleFactors,
0037             jetMETECalScaleFactors,
0038             jetMETHCalScaleFactors,
0039             c,
0040             d,
0041             e,
0042             f,
0043             g,
0044             h
0045             );
0046   L1RCTLookupTables* lut = new L1RCTLookupTables();
0047   lut->setRCTParameters(rctParameters);  // transcoder and etScale are not used
0048   L1RCT rct(lut);
0049   std::vector<std::vector<unsigned short> > hf(18,std::vector<unsigned short>(8));
0050   std::vector<std::vector<std::vector<unsigned short> > > barrel(18,std::vector<std::vector<unsigned short> >(7,std::vector<unsigned short>(64)));
0051   time_t s1 = time (NULL);
0052   for(int i=0;i<10000;i++){
0053     rct.input(barrel,hf);
0054     rct.processEvent();
0055     std::cout << ".";
0056     if(!(i % 100)) std::cout << " " << i << " ";
0057   }
0058   time_t s2 = time (NULL);
0059   double diff =difftime (s2,s1);
0060   std::cout << diff << std::endl;
0061 }