Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include <vector>
0002 
0003 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTReceiverCard.h"
0004 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTLookupTables.h"
0005 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0006 
0007 #include <vector>
0008 using std::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   L1RCTReceiverCard flip(9,0,lut);
0049   L1RCTReceiverCard card(0,0,lut);
0050   L1RCTReceiverCard six(0,6,lut);
0051   std::vector<unsigned short> input1(64);
0052   std::vector<unsigned short> input2(64);
0053   std::vector<unsigned short> input3(64);
0054   std::vector<unsigned short> input4(64);
0055   input1.at(0) = 100;
0056   input1.at(1) = 100;
0057   input1.at(7) = 100;
0058   //All these inputs should go into the ecal.
0059   //They should be at positions 
0060   //0  0  0    100
0061   //0  0  0    100
0062   //0  0  0    0
0063   //0  0  100  0
0064   //The energy sum should be 300 and
0065   //the tau bit should be set to on because
0066   //the phi pattern is 1101
0067   card.fillInput(input1);
0068   card.fillTauBits();
0069   card.fillRegionSums();
0070   card.fillMuonBits();
0071   card.print();
0072   
0073 
0074   //The following should look like
0075   //0 0 0 100
0076   //0 0 0 0
0077   //0 0 0 0
0078   //0 0 0 0
0079   //The tau bit should be off.
0080   input2.at(0) = 50;
0081   input2.at(32) = 50;
0082   card.fillInput(input2);
0083   card.fillTauBits();
0084   card.fillRegionSums();
0085   card.fillMuonBits();
0086   card.print();
0087   
0088   //The following should look like
0089   //0 0 0 100
0090   //0 0 0 100
0091   //0 0 0 0
0092   //0 0 0 0
0093   //and have the muon bit on at tower 0
0094   //and have the fg bit on at tower 1 and the he bit on at tower 0
0095   //because the h is greater than the e.  The muon bit for region 0
0096   //should be on and the tau bit should be off.
0097   input3.at(32) = 356;
0098   input3.at(1) = 356;
0099   card.fillInput(input3);
0100   card.fillTauBits();
0101   card.fillRegionSums();
0102   card.fillMuonBits();
0103   card.print();
0104   
0105   //Let's make sure that everything can be set correctly in all the regions
0106   //We'll set the energies to be the same as the tower number+1 and
0107   //make sure it matches with the layout of the receiver card that
0108   //we want, kthnx.
0109 
0110   for(int i =0;i<32;i++)
0111     input4.at(i)=i+1;
0112   card.fillInput(input4);
0113   card.fillMuonBits();
0114   card.fillTauBits();
0115   card.fillRegionSums();
0116   card.print();
0117 
0118   flip.fillInput(input4);
0119   flip.fillMuonBits();
0120   flip.fillTauBits();
0121   flip.fillRegionSums();
0122   flip.print();
0123 
0124   six.fillInput(input4);
0125   six.fillMuonBits();
0126   six.fillTauBits();
0127   six.fillRegionSums();
0128   six.print();
0129 
0130 }