Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "L1Trigger/L1TNtuples/interface/L1AnalysisL1Upgrade.h"
0002 
0003 L1Analysis::L1AnalysisL1Upgrade::L1AnalysisL1Upgrade() {}
0004 
0005 L1Analysis::L1AnalysisL1Upgrade::~L1AnalysisL1Upgrade() {}
0006 
0007 void L1Analysis::L1AnalysisL1Upgrade::SetEm(const l1t::EGammaBxCollection& em, unsigned maxL1Upgrade) {
0008   for (int ibx = em.getFirstBX(); ibx <= em.getLastBX(); ++ibx) {
0009     for (l1t::EGammaBxCollection::const_iterator it = em.begin(ibx);
0010          it != em.end(ibx) && l1upgrade_.nEGs < maxL1Upgrade;
0011          it++) {
0012       if (it->pt() > 0) {
0013         l1upgrade_.egEt.push_back(it->pt());
0014         l1upgrade_.egEta.push_back(it->eta());
0015         l1upgrade_.egPhi.push_back(it->phi());
0016         l1upgrade_.egIEt.push_back(it->hwPt());
0017         l1upgrade_.egIEta.push_back(it->hwEta());
0018         l1upgrade_.egIPhi.push_back(it->hwPhi());
0019         l1upgrade_.egIso.push_back(it->hwIso());
0020         l1upgrade_.egBx.push_back(ibx);
0021         l1upgrade_.egTowerIPhi.push_back(it->towerIPhi());
0022         l1upgrade_.egTowerIEta.push_back(it->towerIEta());
0023         l1upgrade_.egRawEt.push_back(it->rawEt());
0024         l1upgrade_.egIsoEt.push_back(it->isoEt());
0025         l1upgrade_.egFootprintEt.push_back(it->footprintEt());
0026         l1upgrade_.egNTT.push_back(it->nTT());
0027         l1upgrade_.egShape.push_back(it->shape());
0028         l1upgrade_.egTowerHoE.push_back(it->towerHoE());
0029         l1upgrade_.egHwQual.push_back(it->hwQual());
0030         l1upgrade_.nEGs++;
0031       }
0032     }
0033   }
0034 }
0035 
0036 void L1Analysis::L1AnalysisL1Upgrade::SetTau(const l1t::TauBxCollection& tau, unsigned maxL1Upgrade) {
0037   for (int ibx = tau.getFirstBX(); ibx <= tau.getLastBX(); ++ibx) {
0038     for (l1t::TauBxCollection::const_iterator it = tau.begin(ibx);
0039          it != tau.end(ibx) && l1upgrade_.nTaus < maxL1Upgrade;
0040          it++) {
0041       if (it->pt() > 0) {
0042         l1upgrade_.tauEt.push_back(it->et());
0043         l1upgrade_.tauEta.push_back(it->eta());
0044         l1upgrade_.tauPhi.push_back(it->phi());
0045         l1upgrade_.tauIEt.push_back(it->hwPt());
0046         l1upgrade_.tauIEta.push_back(it->hwEta());
0047         l1upgrade_.tauIPhi.push_back(it->hwPhi());
0048         l1upgrade_.tauIso.push_back(it->hwIso());
0049         l1upgrade_.tauBx.push_back(ibx);
0050         l1upgrade_.tauTowerIPhi.push_back(it->towerIPhi());
0051         l1upgrade_.tauTowerIEta.push_back(it->towerIEta());
0052         l1upgrade_.tauRawEt.push_back(it->rawEt());
0053         l1upgrade_.tauIsoEt.push_back(it->isoEt());
0054         l1upgrade_.tauNTT.push_back(it->nTT());
0055         l1upgrade_.tauHasEM.push_back(it->hasEM());
0056         l1upgrade_.tauIsMerged.push_back(it->isMerged());
0057         l1upgrade_.tauHwQual.push_back(it->hwQual());
0058         l1upgrade_.nTaus++;
0059       }
0060     }
0061   }
0062 }
0063 
0064 void L1Analysis::L1AnalysisL1Upgrade::SetJet(const l1t::JetBxCollection& jet, unsigned maxL1Upgrade) {
0065   for (int ibx = jet.getFirstBX(); ibx <= jet.getLastBX(); ++ibx) {
0066     for (l1t::JetBxCollection::const_iterator it = jet.begin(ibx);
0067          it != jet.end(ibx) && l1upgrade_.nJets < maxL1Upgrade;
0068          it++) {
0069       if (it->pt() > 0) {
0070         l1upgrade_.jetEt.push_back(it->et());
0071         l1upgrade_.jetEta.push_back(it->eta());
0072         l1upgrade_.jetPhi.push_back(it->phi());
0073         l1upgrade_.jetIEt.push_back(it->hwPt());
0074         l1upgrade_.jetIEta.push_back(it->hwEta());
0075         l1upgrade_.jetIPhi.push_back(it->hwPhi());
0076         l1upgrade_.jetHwQual.push_back(it->hwQual());
0077         l1upgrade_.jetBx.push_back(ibx);
0078         l1upgrade_.jetRawEt.push_back(it->rawEt());
0079         l1upgrade_.jetSeedEt.push_back(it->seedEt());
0080         l1upgrade_.jetTowerIEta.push_back(it->towerIEta());
0081         l1upgrade_.jetTowerIPhi.push_back(it->towerIPhi());
0082         l1upgrade_.jetPUEt.push_back(it->puEt());
0083         l1upgrade_.jetPUDonutEt0.push_back(it->puDonutEt(0));
0084         l1upgrade_.jetPUDonutEt1.push_back(it->puDonutEt(1));
0085         l1upgrade_.jetPUDonutEt2.push_back(it->puDonutEt(2));
0086         l1upgrade_.jetPUDonutEt3.push_back(it->puDonutEt(3));
0087         l1upgrade_.nJets++;
0088       }
0089     }
0090   }
0091 }
0092 
0093 void L1Analysis::L1AnalysisL1Upgrade::SetMuon(const l1t::MuonBxCollection& muon, unsigned maxL1Upgrade) {
0094   for (int ibx = muon.getFirstBX(); ibx <= muon.getLastBX(); ++ibx) {
0095     for (l1t::MuonBxCollection::const_iterator it = muon.begin(ibx);
0096          it != muon.end(ibx) && l1upgrade_.nMuons < maxL1Upgrade;
0097          it++) {
0098       if (it->pt() > 0) {
0099         l1upgrade_.muonEt.push_back(it->et());
0100         l1upgrade_.muonEtUnconstrained.push_back(it->ptUnconstrained());
0101         l1upgrade_.muonEta.push_back(it->eta());
0102         l1upgrade_.muonPhi.push_back(it->phi());
0103         l1upgrade_.muonEtaAtVtx.push_back(it->etaAtVtx());
0104         l1upgrade_.muonPhiAtVtx.push_back(it->phiAtVtx());
0105         l1upgrade_.muonIEt.push_back(it->hwPt());
0106         l1upgrade_.muonIEtUnconstrained.push_back(it->hwPtUnconstrained());
0107         l1upgrade_.muonIEta.push_back(it->hwEta());
0108         l1upgrade_.muonIPhi.push_back(it->hwPhi());
0109         l1upgrade_.muonIEtaAtVtx.push_back(it->hwEtaAtVtx());
0110         l1upgrade_.muonIPhiAtVtx.push_back(it->hwPhiAtVtx());
0111         l1upgrade_.muonIDEta.push_back(it->hwDEtaExtra());
0112         l1upgrade_.muonIDPhi.push_back(it->hwDPhiExtra());
0113         l1upgrade_.muonChg.push_back(it->charge());
0114         l1upgrade_.muonIso.push_back(it->hwIso());
0115         l1upgrade_.muonQual.push_back(it->hwQual());
0116         l1upgrade_.muonDxy.push_back(it->hwDXY());
0117         l1upgrade_.muonTfMuonIdx.push_back(it->tfMuonIndex());
0118         l1upgrade_.muonBx.push_back(ibx);
0119         l1upgrade_.nMuons++;
0120       }
0121     }
0122   }
0123 }
0124 
0125 void L1Analysis::L1AnalysisL1Upgrade::SetMuonShower(const l1t::MuonShowerBxCollection& muonShower,
0126                                                     unsigned maxL1Upgrade) {
0127   for (int ibx = muonShower.getFirstBX(); ibx <= muonShower.getLastBX(); ++ibx) {
0128     for (l1t::MuonShowerBxCollection::const_iterator it = muonShower.begin(ibx);
0129          it != muonShower.end(ibx) && l1upgrade_.nMuonShowers < maxL1Upgrade;
0130          it++) {
0131       if (it->isValid()) {
0132         l1upgrade_.muonShowerBx.push_back(ibx);
0133         l1upgrade_.muonShowerOneNominal.push_back(it->isOneNominalInTime());
0134         l1upgrade_.muonShowerOneTight.push_back(it->isOneTightInTime());
0135         l1upgrade_.muonShowerTwoLoose.push_back(it->isTwoLooseInTime());
0136         l1upgrade_.muonShowerTwoLooseDiffSectors.push_back(it->isTwoLooseDiffSectorsInTime());
0137         l1upgrade_.nMuonShowers++;
0138       }
0139     }
0140   }
0141 }
0142 
0143 void L1Analysis::L1AnalysisL1Upgrade::SetSum(const l1t::EtSumBxCollection& sums, unsigned maxL1Upgrade) {
0144   for (int ibx = sums.getFirstBX(); ibx <= sums.getLastBX(); ++ibx) {
0145     for (l1t::EtSumBxCollection::const_iterator it = sums.begin(ibx);
0146          it != sums.end(ibx) && l1upgrade_.nSums < maxL1Upgrade;
0147          it++) {
0148       int type = static_cast<int>(it->getType());
0149       l1upgrade_.sumType.push_back(type);
0150       l1upgrade_.sumEt.push_back(it->et());
0151       l1upgrade_.sumPhi.push_back(it->phi());
0152       l1upgrade_.sumIEt.push_back(it->hwPt());
0153       l1upgrade_.sumIPhi.push_back(it->hwPhi());
0154       l1upgrade_.sumBx.push_back(ibx);
0155       l1upgrade_.nSums++;
0156     }
0157   }
0158 }
0159 
0160 void L1Analysis::L1AnalysisL1Upgrade::SetSumZDC(const l1t::EtSumBxCollection& sumsZDC, unsigned maxL1Upgrade) {
0161   for (int ibx = sumsZDC.getFirstBX(); ibx <= sumsZDC.getLastBX(); ++ibx) {
0162     for (l1t::EtSumBxCollection::const_iterator it = sumsZDC.begin(ibx);
0163          it != sumsZDC.end(ibx) && l1upgrade_.nSumsZDC < maxL1Upgrade;
0164          it++) {
0165       int type = static_cast<int>(it->getType());
0166       l1upgrade_.sumZDCType.push_back(type);
0167       l1upgrade_.sumZDCEt.push_back(it->et());
0168       l1upgrade_.sumZDCPhi.push_back(it->phi());
0169       l1upgrade_.sumZDCIEt.push_back(it->hwPt());
0170       l1upgrade_.sumZDCIPhi.push_back(it->hwPhi());
0171       l1upgrade_.sumZDCBx.push_back(ibx);
0172       l1upgrade_.nSumsZDC++;
0173     }
0174   }
0175 }