CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/L1Trigger/RegionalCaloTrigger/src/L1RCTCrate.cc

Go to the documentation of this file.
00001 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTCrate.h"
00002 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTLookupTables.h"
00003 
00004 L1RCTCrate::L1RCTCrate(int crtNo, const L1RCTLookupTables* rctLookupTables) : 
00005   jetSummaryCard(crtNo, rctLookupTables),
00006   crtNo(crtNo),
00007   rctLookupTables_(rctLookupTables)
00008 {
00009   for(int i = 0; i <7; i++){
00010     L1RCTReceiverCard rc(crtNo,i,rctLookupTables);
00011     L1RCTElectronIsolationCard eic(crtNo,i,rctLookupTables);
00012     receiverCards.push_back(rc);
00013     electronCards.push_back(eic);
00014   }
00015 }
00016 
00017 L1RCTCrate::~L1RCTCrate()
00018 {
00019 
00020 }
00021 
00022 void L1RCTCrate::input(std::vector<std::vector<unsigned short> > RCInput,
00023                        std::vector<unsigned short> HFInput)
00024 {
00025   //std::cout << "Crate.input() entered" << std::endl;
00026   for(int i =0; i<7; i++){
00027     //std::cout << "calling RC.fillInput() for RC " << i << std::endl;
00028     receiverCards.at(i).fillInput(RCInput.at(i));
00029     //std::cout << "RC " << i << " filled" << std::endl;
00030   }
00031   //std::cout << "calling JSC.fillHFRegionSums()" << std::endl;
00032   jetSummaryCard.fillHFRegionSums(HFInput);
00033   //std::cout << "JSC.fillHF called" << std::endl;
00034 } 
00035 void L1RCTCrate::processReceiverCards(){
00036   for(int i=0; i<7;i++){
00037     receiverCards.at(i).fillTauBits();
00038     receiverCards.at(i).fillRegionSums();
00039     receiverCards.at(i).fillMuonBits();
00040   }
00041 }
00042 void L1RCTCrate::fillElectronIsolationCards(){
00043   for(int i = 0; i<7; i++){
00044     for(int j = 0; j<2; j++){
00045       electronCards.at(i).setRegion(j,*receiverCards.at(i).getRegion(j));
00046     }
00047   }
00048 }
00049 void L1RCTCrate::processElectronIsolationCards(){
00050   for(int i = 0; i<7;i++)
00051     electronCards.at(i).fillElectronCandidates();
00052 }
00053 void L1RCTCrate::fillJetSummaryCard(){
00054   std::vector<unsigned short> barrelSums(14);
00055   std::vector<unsigned short> isoElectrons(14);
00056   std::vector<unsigned short> nonIsoElectrons(14);
00057   std::vector<unsigned short> mipBits(14);
00058   std::vector<unsigned short> overFlowBits(14);
00059   std::vector<unsigned short> tauBits(14);
00060   for(int i = 0; i<7;i++){
00061     mipBits.at(2*i) = receiverCards.at(i).getMuonBitRegion(0);
00062     mipBits.at(2*i+1) = receiverCards.at(i).getMuonBitRegion(1);
00063     isoElectrons.at(2*i) = electronCards.at(i).getIsoElectrons(0);
00064     isoElectrons.at(2*i+1) = electronCards.at(i).getIsoElectrons(1) + 1;  // the +1 adds region info
00065     nonIsoElectrons.at(2*i) = electronCards.at(i).getNonIsoElectrons(0);
00066     nonIsoElectrons.at(2*i+1) = electronCards.at(i).getNonIsoElectrons(1) + 1;  // +1 adds region info
00067     barrelSums.at(2*i) = receiverCards.at(i).getEtIn10BitsRegion(0);
00068     barrelSums.at(2*i+1) = receiverCards.at(i).getEtIn10BitsRegion(1);
00069     overFlowBits.at(2*i) = receiverCards.at(i).getOverFlowBitRegion(0);
00070     overFlowBits.at(2*i+1) = receiverCards.at(i).getOverFlowBitRegion(1);
00071     tauBits.at(2*i) = receiverCards.at(i).getTauBitRegion(0);
00072     tauBits.at(2*i+1) = receiverCards.at(i).getTauBitRegion(1);
00073   }
00074   jetSummaryCard.fillIsolatedEGObjects(isoElectrons);
00075   jetSummaryCard.fillNonIsolatedEGObjects(nonIsoElectrons);
00076   jetSummaryCard.fillRegionSums(barrelSums);
00077   jetSummaryCard.fillMIPBits(mipBits);
00078   jetSummaryCard.fillTauBits(tauBits);
00079   jetSummaryCard.fillOverFlowBits(overFlowBits);
00080 }
00081 void L1RCTCrate::processJetSummaryCard(){
00082   jetSummaryCard.fillJetRegions();
00083   jetSummaryCard.fillQuietBits();
00084 }
00085 
00086 void L1RCTCrate::print(){
00087   for(int i=0;i<7;i++){
00088     receiverCards.at(i).print();
00089     electronCards.at(i).print();
00090   }
00091   jetSummaryCard.print();
00092 }