File indexing completed on 2024-04-06 12:21:36
0001 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTCrate.h"
0002 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTLookupTables.h"
0003
0004 L1RCTCrate::L1RCTCrate(int crtNo, const L1RCTLookupTables *rctLookupTables)
0005 : jetSummaryCard(crtNo, rctLookupTables), crtNo(crtNo), rctLookupTables_(rctLookupTables) {
0006 for (int i = 0; i < 7; i++) {
0007 L1RCTReceiverCard rc(crtNo, i, rctLookupTables);
0008 L1RCTElectronIsolationCard eic(crtNo, i, rctLookupTables);
0009 receiverCards.push_back(rc);
0010 electronCards.push_back(eic);
0011 }
0012 }
0013
0014 L1RCTCrate::~L1RCTCrate() {}
0015
0016 void L1RCTCrate::input(const std::vector<std::vector<unsigned short>> &RCInput,
0017 const std::vector<unsigned short> &HFInput) {
0018
0019 for (int i = 0; i < 7; i++) {
0020
0021 receiverCards.at(i).fillInput(RCInput.at(i));
0022
0023 }
0024
0025 jetSummaryCard.fillHFRegionSums(HFInput);
0026
0027 }
0028 void L1RCTCrate::processReceiverCards() {
0029 for (int i = 0; i < 7; i++) {
0030 receiverCards.at(i).fillTauBits();
0031 receiverCards.at(i).fillRegionSums();
0032 receiverCards.at(i).fillMuonBits();
0033 }
0034 }
0035 void L1RCTCrate::fillElectronIsolationCards() {
0036 for (int i = 0; i < 7; i++) {
0037 for (int j = 0; j < 2; j++) {
0038 electronCards.at(i).setRegion(j, *receiverCards.at(i).getRegion(j));
0039 }
0040 }
0041 }
0042 void L1RCTCrate::processElectronIsolationCards() {
0043 for (int i = 0; i < 7; i++)
0044 electronCards.at(i).fillElectronCandidates();
0045 }
0046 void L1RCTCrate::fillJetSummaryCard() {
0047 std::vector<unsigned short> barrelSums(14);
0048 std::vector<unsigned short> isoElectrons(14);
0049 std::vector<unsigned short> nonIsoElectrons(14);
0050 std::vector<unsigned short> mipBits(14);
0051 std::vector<unsigned short> overFlowBits(14);
0052 std::vector<unsigned short> tauBits(14);
0053 for (int i = 0; i < 7; i++) {
0054 mipBits.at(2 * i) = receiverCards.at(i).getMuonBitRegion(0);
0055 mipBits.at(2 * i + 1) = receiverCards.at(i).getMuonBitRegion(1);
0056 isoElectrons.at(2 * i) = electronCards.at(i).getIsoElectrons(0);
0057 isoElectrons.at(2 * i + 1) = electronCards.at(i).getIsoElectrons(1) + 1;
0058 nonIsoElectrons.at(2 * i) = electronCards.at(i).getNonIsoElectrons(0);
0059 nonIsoElectrons.at(2 * i + 1) = electronCards.at(i).getNonIsoElectrons(1) + 1;
0060 barrelSums.at(2 * i) = receiverCards.at(i).getEtIn10BitsRegion(0);
0061 barrelSums.at(2 * i + 1) = receiverCards.at(i).getEtIn10BitsRegion(1);
0062 overFlowBits.at(2 * i) = receiverCards.at(i).getOverFlowBitRegion(0);
0063 overFlowBits.at(2 * i + 1) = receiverCards.at(i).getOverFlowBitRegion(1);
0064 tauBits.at(2 * i) = receiverCards.at(i).getTauBitRegion(0);
0065 tauBits.at(2 * i + 1) = receiverCards.at(i).getTauBitRegion(1);
0066 }
0067 jetSummaryCard.fillIsolatedEGObjects(isoElectrons);
0068 jetSummaryCard.fillNonIsolatedEGObjects(nonIsoElectrons);
0069 jetSummaryCard.fillRegionSums(barrelSums);
0070 jetSummaryCard.fillMIPBits(mipBits);
0071 jetSummaryCard.fillTauBits(tauBits);
0072 jetSummaryCard.fillOverFlowBits(overFlowBits);
0073 }
0074 void L1RCTCrate::processJetSummaryCard() {
0075 jetSummaryCard.fillJetRegions();
0076 jetSummaryCard.fillQuietBits();
0077 }
0078
0079 void L1RCTCrate::print() {
0080 for (int i = 0; i < 7; i++) {
0081 receiverCards.at(i).print();
0082 electronCards.at(i).print();
0083 }
0084 jetSummaryCard.print();
0085 }