File indexing completed on 2024-04-06 12:21:15
0001 #include "L1Trigger/L1TNtuples/interface/L1AnalysisL1Extra.h"
0002
0003 L1Analysis::L1AnalysisL1Extra::L1AnalysisL1Extra() {}
0004
0005 L1Analysis::L1AnalysisL1Extra::~L1AnalysisL1Extra() {}
0006
0007 void L1Analysis::L1AnalysisL1Extra::SetIsoEm(const edm::Handle<l1extra::L1EmParticleCollection> isoEm,
0008 unsigned maxL1Extra) {
0009 for (l1extra::L1EmParticleCollection::const_iterator it = isoEm->begin();
0010 it != isoEm->end() && l1extra_.nIsoEm < maxL1Extra;
0011 it++) {
0012 l1extra_.isoEmEt.push_back(it->et());
0013 l1extra_.isoEmEta.push_back(it->eta());
0014 l1extra_.isoEmPhi.push_back(it->phi());
0015 l1extra_.isoEmBx.push_back(it->bx());
0016 l1extra_.nIsoEm++;
0017 }
0018 }
0019
0020 void L1Analysis::L1AnalysisL1Extra::SetNonIsoEm(const edm::Handle<l1extra::L1EmParticleCollection> nonIsoEm,
0021 unsigned maxL1Extra) {
0022 for (l1extra::L1EmParticleCollection::const_iterator it = nonIsoEm->begin();
0023 it != nonIsoEm->end() && l1extra_.nNonIsoEm < maxL1Extra;
0024 it++) {
0025 l1extra_.nonIsoEmEt.push_back(it->et());
0026 l1extra_.nonIsoEmEta.push_back(it->eta());
0027 l1extra_.nonIsoEmPhi.push_back(it->phi());
0028 l1extra_.nonIsoEmBx.push_back(it->bx());
0029 l1extra_.nNonIsoEm++;
0030 }
0031 }
0032
0033 void L1Analysis::L1AnalysisL1Extra::SetCenJet(const edm::Handle<l1extra::L1JetParticleCollection> cenJet,
0034 unsigned maxL1Extra) {
0035
0036
0037 for (l1extra::L1JetParticleCollection::const_iterator it = cenJet->begin();
0038 it != cenJet->end() && l1extra_.nCenJets < maxL1Extra;
0039 it++) {
0040
0041
0042 l1extra_.cenJetEt.push_back(it->et());
0043 l1extra_.cenJetEta.push_back(it->eta());
0044 l1extra_.cenJetPhi.push_back(it->phi());
0045 l1extra_.cenJetBx.push_back(it->bx());
0046 l1extra_.nCenJets++;
0047 }
0048 }
0049
0050 void L1Analysis::L1AnalysisL1Extra::SetFwdJet(const edm::Handle<l1extra::L1JetParticleCollection> fwdJet,
0051 unsigned maxL1Extra) {
0052
0053 for (l1extra::L1JetParticleCollection::const_iterator it = fwdJet->begin();
0054 it != fwdJet->end() && l1extra_.nFwdJets < maxL1Extra;
0055 it++) {
0056
0057 l1extra_.fwdJetEt.push_back(it->et());
0058 l1extra_.fwdJetEta.push_back(it->eta());
0059 l1extra_.fwdJetPhi.push_back(it->phi());
0060 l1extra_.fwdJetBx.push_back(it->bx());
0061 l1extra_.nFwdJets++;
0062 }
0063 }
0064
0065 void L1Analysis::L1AnalysisL1Extra::SetTauJet(const edm::Handle<l1extra::L1JetParticleCollection> tauJet,
0066 unsigned maxL1Extra) {
0067
0068 for (l1extra::L1JetParticleCollection::const_iterator it = tauJet->begin();
0069 it != tauJet->end() && l1extra_.nTauJets < maxL1Extra;
0070 it++) {
0071
0072 l1extra_.tauJetEt.push_back(it->et());
0073 l1extra_.tauJetEta.push_back(it->eta());
0074 l1extra_.tauJetPhi.push_back(it->phi());
0075 l1extra_.tauJetBx.push_back(it->bx());
0076 l1extra_.nTauJets++;
0077 }
0078 }
0079
0080 void L1Analysis::L1AnalysisL1Extra::SetIsoTauJet(const edm::Handle<l1extra::L1JetParticleCollection> isoTauJet,
0081 unsigned maxL1Extra) {
0082
0083 for (l1extra::L1JetParticleCollection::const_iterator it = isoTauJet->begin();
0084 it != isoTauJet->end() && l1extra_.nIsoTauJets < maxL1Extra;
0085 it++) {
0086
0087 l1extra_.isoTauJetEt.push_back(it->et());
0088 l1extra_.isoTauJetEta.push_back(it->eta());
0089 l1extra_.isoTauJetPhi.push_back(it->phi());
0090 l1extra_.isoTauJetBx.push_back(it->bx());
0091 l1extra_.nIsoTauJets++;
0092 }
0093 }
0094
0095 void L1Analysis::L1AnalysisL1Extra::SetMuon(const edm::Handle<l1extra::L1MuonParticleCollection> muon,
0096 unsigned maxL1Extra) {
0097 for (l1extra::L1MuonParticleCollection::const_iterator it = muon->begin();
0098 it != muon->end() && l1extra_.nMuons < maxL1Extra;
0099 it++) {
0100 l1extra_.muonEt.push_back(it->et());
0101 l1extra_.muonEta.push_back(it->eta());
0102 l1extra_.muonPhi.push_back(it->phi());
0103 l1extra_.muonChg.push_back(it->charge());
0104 l1extra_.muonIso.push_back(it->isIsolated());
0105 l1extra_.muonMip.push_back(it->isMip());
0106 l1extra_.muonFwd.push_back(it->isForward());
0107 l1extra_.muonRPC.push_back(it->isRPC());
0108 l1extra_.muonBx.push_back(it->bx());
0109 l1extra_.muonQuality.push_back(it->gmtMuonCand().quality());
0110
0111
0112
0113
0114
0115 l1extra_.nMuons++;
0116 }
0117 }
0118
0119 void L1Analysis::L1AnalysisL1Extra::SetMet(const edm::Handle<l1extra::L1EtMissParticleCollection> mets) {
0120 for (l1extra::L1EtMissParticleCollection::const_iterator it = mets->begin(); it != mets->end(); it++) {
0121 l1extra_.et.push_back(it->etTotal());
0122 l1extra_.met.push_back(it->et());
0123 l1extra_.metPhi.push_back(it->phi());
0124 l1extra_.metBx.push_back(it->bx());
0125 l1extra_.nMet++;
0126 }
0127 }
0128
0129 void L1Analysis::L1AnalysisL1Extra::SetMht(const edm::Handle<l1extra::L1EtMissParticleCollection> mhts) {
0130 for (l1extra::L1EtMissParticleCollection::const_iterator it = mhts->begin(); it != mhts->end(); it++) {
0131 l1extra_.ht.push_back(it->etTotal());
0132 l1extra_.mht.push_back(it->et());
0133 l1extra_.mhtPhi.push_back(it->phi());
0134 l1extra_.mhtBx.push_back(it->bx());
0135 l1extra_.nMht++;
0136 }
0137 }
0138
0139 void L1Analysis::L1AnalysisL1Extra::SetHFring(const edm::Handle<l1extra::L1HFRingsCollection> hfRings) {
0140 l1extra_.hfEtSum.resize(4);
0141 l1extra_.hfBitCnt.resize(4);
0142 l1extra_.hfBx.resize(4);
0143
0144 for (unsigned int i = 0; i < 4; ++i) {
0145 if (hfRings->empty())
0146 continue;
0147
0148 l1extra_.hfEtSum[i] = (hfRings->begin()->hfEtSum((l1extra::L1HFRings::HFRingLabels)i));
0149 l1extra_.hfBitCnt[i] = (hfRings->begin()->hfBitCount((l1extra::L1HFRings::HFRingLabels)i));
0150 l1extra_.hfBx[i] = hfRings->begin()->bx();
0151 }
0152 }