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 void L1RCTCrate::input(std::vector<std::vector<unsigned short> > RCInput,
00017 std::vector<unsigned short> HFInput)
00018 {
00019
00020 for(int i =0; i<7; i++){
00021
00022 receiverCards.at(i).fillInput(RCInput.at(i));
00023
00024 }
00025
00026 jetSummaryCard.fillHFRegionSums(HFInput);
00027
00028 }
00029 void L1RCTCrate::processReceiverCards(){
00030 for(int i=0; i<7;i++){
00031 receiverCards.at(i).fillTauBits();
00032 receiverCards.at(i).fillRegionSums();
00033 receiverCards.at(i).fillMuonBits();
00034 }
00035 }
00036 void L1RCTCrate::fillElectronIsolationCards(){
00037 for(int i = 0; i<7; i++){
00038 for(int j = 0; j<2; j++){
00039 electronCards.at(i).setRegion(j,receiverCards.at(i).getRegion(j));
00040 }
00041 }
00042 }
00043 void L1RCTCrate::processElectronIsolationCards(){
00044 for(int i = 0; i<7;i++)
00045 electronCards.at(i).fillElectronCandidates();
00046 }
00047 void L1RCTCrate::fillJetSummaryCard(){
00048 std::vector<unsigned short> barrelSums(14);
00049 std::vector<unsigned short> isoElectrons(14);
00050 std::vector<unsigned short> nonIsoElectrons(14);
00051 std::vector<unsigned short> mipBits(14);
00052 std::vector<unsigned short> overFlowBits(14);
00053 std::vector<unsigned short> tauBits(14);
00054 for(int i = 0; i<7;i++){
00055 mipBits.at(2*i) = receiverCards.at(i).getMuonBitRegion(0);
00056 mipBits.at(2*i+1) = receiverCards.at(i).getMuonBitRegion(1);
00057 isoElectrons.at(2*i) = electronCards.at(i).getIsoElectrons(0);
00058 isoElectrons.at(2*i+1) = electronCards.at(i).getIsoElectrons(1) + 1;
00059 nonIsoElectrons.at(2*i) = electronCards.at(i).getNonIsoElectrons(0);
00060 nonIsoElectrons.at(2*i+1) = electronCards.at(i).getNonIsoElectrons(1) + 1;
00061 barrelSums.at(2*i) = receiverCards.at(i).getEtIn10BitsRegion(0);
00062 barrelSums.at(2*i+1) = receiverCards.at(i).getEtIn10BitsRegion(1);
00063 overFlowBits.at(2*i) = receiverCards.at(i).getOverFlowBitRegion(0);
00064 overFlowBits.at(2*i+1) = receiverCards.at(i).getOverFlowBitRegion(1);
00065 tauBits.at(2*i) = receiverCards.at(i).getTauBitRegion(0);
00066 tauBits.at(2*i+1) = receiverCards.at(i).getTauBitRegion(1);
00067 }
00068 jetSummaryCard.fillIsolatedEGObjects(isoElectrons);
00069 jetSummaryCard.fillNonIsolatedEGObjects(nonIsoElectrons);
00070 jetSummaryCard.fillRegionSums(barrelSums);
00071 jetSummaryCard.fillMIPBits(mipBits);
00072 jetSummaryCard.fillTauBits(tauBits);
00073 jetSummaryCard.fillOverFlowBits(overFlowBits);
00074 }
00075 void L1RCTCrate::processJetSummaryCard(){
00076 jetSummaryCard.fillJetRegions();
00077 jetSummaryCard.fillQuietBits();
00078 }
00079
00080 void L1RCTCrate::print(){
00081 for(int i=0;i<7;i++){
00082 receiverCards.at(i).print();
00083 electronCards.at(i).print();
00084 }
00085 jetSummaryCard.print();
00086 }