void BareMet::setBranchAddresses(TTree *t){ BareP4::setBranchAddresses(t,"met"); BareFunctions::SetBranchAddress(t,"metSumEtRaw",&sumEtRaw); BareFunctions::SetBranchAddress(t,"metPtJESUP" ,&ptJESUP); BareFunctions::SetBranchAddress(t,"metPtJESDOWN",&ptJESDOWN); BareFunctions::SetBranchAddress(t,"metP4_GEN" , &genP4 ); BareFunctions::SetBranchAddress(t,"metPuppi", &metPuppi); BareFunctions::SetBranchAddress(t,"metPuppiSyst", &metPuppiSyst); BareFunctions::SetBranchAddress(t,"metSyst", &metSyst); BareFunctions::SetBranchAddress(t,"metSumEtRawPuppi",&sumEtRawPuppi); if ( IsExtend() ) { BareFunctions::SetBranchAddress(t,"metNoMu", &metNoMu); BareFunctions::SetBranchAddress(t,"metNoHF", &metNoHF); BareFunctions::SetBranchAddress(t,"metSumEtRawNoHF",&sumEtRawNoHF); BareFunctions::SetBranchAddress(t,"pfMet_e3p0", &pfMet_e3p0); BareFunctions::SetBranchAddress(t,"trackMet", &trackMet); //calo met BareFunctions::SetBranchAddress(t,"caloMet_Pt", &caloMet_Pt); BareFunctions::SetBranchAddress(t,"caloMet_Phi", &caloMet_Phi); BareFunctions::SetBranchAddress(t,"caloMet_SumEt", &caloMet_SumEt); BareFunctions::SetBranchAddress(t,"rawMet_Pt", &rawMet_Pt); BareFunctions::SetBranchAddress(t,"rawMet_Phi", &rawMet_Phi); } }
void BareTaus::defineBranches(TTree *t){ BareP4::defineBranches(t, "tau" ); // id = new vector<float>; t->Branch("tauId","vector<float>",&id); // Q = new vector<int>; t->Branch("tauQ","vector<int>",&Q); // M = new vector<float>; t->Branch("tauM","vector<float>",&M); // iso = new vector<float>; t->Branch("tauIso","vector<float>",&iso); if ( IsExtend() ) { chargedIsoPtSum = new vector<float>; t->Branch("tauChargedIsoPtSum","vector<float>",&chargedIsoPtSum); neutralIsoPtSum = new vector<float> ; t->Branch("tauNeutralIsoPtSum","vector<float>",&neutralIsoPtSum); isoDeltaBetaCorr = new vector<float>; t->Branch("tauIsoDeltaBetaCorr","vector<float>",&isoDeltaBetaCorr); againstEleLoose = new vector<int>; t->Branch("tauAgainstEleLoose","vector<int>",&againstEleLoose); againstEleMedium = new vector<int>; t->Branch("tauAgainstEleMedium","vector<int>",&againstEleMedium); againstMuLoose = new vector<int>; t->Branch("tauAgainstMuLoose","vector<int>",&againstMuLoose); againstMuTight = new vector<int> ; t->Branch("tauAgainstMuTight","vector<int>",&againstMuTight); } }
void BarePhotons::init(){ BareP4::init(); BareFunctions::New(iso); BareFunctions::New(corr); BareFunctions::New(sieie); BareFunctions::New(selBits); BareFunctions::New(chIso); BareFunctions::New(nhIso); BareFunctions::New(phoIso); BareFunctions::New(puIso); if (IsExtend()) { BareFunctions::New(rawpt); BareFunctions::New(rawScEnergy); BareFunctions::New(hOverE); BareFunctions::New(chWorstIso); BareFunctions::New(chIsoMax); BareFunctions::New(emax); BareFunctions::New(e2nd); BareFunctions::New(e33); BareFunctions::New(e55); BareFunctions::New(sipip); BareFunctions::New(sieip); BareFunctions::New(r9); BareFunctions::New(etaSC); BareFunctions::New(s4); BareFunctions::New(mipEnergy); BareFunctions::New(time); BareFunctions::New(timeSpan); BareFunctions::New(genMatched); } }
void BareMet::defineBranches(TTree *t){ // BareP4::defineBranches(t, "met" ); t->Branch("metSumEtRaw",&sumEtRaw,"metSumEtRaw/F"); // t->Branch("metPtJESUP","vector<float>",&ptJESUP); // t->Branch("metPtJESDOWN","vector<float>",&ptJESDOWN); // t->Branch("metP4_GEN","TClonesArray", &genP4, 128000, 0); // t->Branch("metPuppi","TLorentzVector",&metPuppi); t->Branch("metPuppiSyst","TClonesArray",&metPuppiSyst,128000,0); t->Branch("metSyst","TClonesArray",&metSyst,128000,0); t->Branch("metSumEtRawPuppi",&sumEtRawPuppi,"metSumEtRawPuppi/F"); if ( IsExtend() ) { t->Branch("metNoMu","TLorentzVector",&metNoMu); t->Branch("metNoHF","TLorentzVector",&metNoHF); t->Branch("metSumEtRawNoHF",&sumEtRawNoHF,"metSumEtRawNoHF/F"); // t->Branch("pfMet_e3p0","TLorentzVector",&pfMet_e3p0); // t->Branch("trackMet","TLorentzVector",&trackMet); // calo Met t->Branch("caloMet_Pt",&caloMet_Pt,"caloMet_Pt/F"); t->Branch("caloMet_Phi",&caloMet_Phi,"caloMet_Phi/F"); t->Branch("caloMet_SumEt",&caloMet_SumEt,"caloMet_SumEt/F"); t->Branch("rawMet_Pt",&rawMet_Pt,"rawMet_Pt/F"); t->Branch("rawMet_Phi",&rawMet_Phi,"rawMet_Phi/F"); } // }
void BareMet::setBranchAddresses(TTree *t){ BareP4::setBranchAddresses(t,"met"); ptJESUP = new vector<float>; t->SetBranchAddress("metPtJESUP" ,&ptJESUP); ptJESDOWN = new vector<float>; t->SetBranchAddress("metPtJESDOWN",&ptJESDOWN); genP4 = new TClonesArray("TLorentzVector", 20); t->SetBranchAddress("metP4_GEN" , &genP4 ); if ( IsExtend() ) { metNoMu = new TLorentzVector; t->SetBranchAddress("metNoMu", &metNoMu); pfMet_e3p0 = new TLorentzVector; t->SetBranchAddress("pfMet_e3p0", &pfMet_e3p0); metChargedHadron = new TLorentzVector; t->SetBranchAddress("metChargedHadron", &metChargedHadron); metNeutralHadron = new TLorentzVector; t->SetBranchAddress("metNeutralHadron", &metNeutralHadron); metNeutralEM = new TLorentzVector; t->SetBranchAddress("metNeutralEM", &metNeutralEM); } }
void BareMet::defineBranches(TTree *t){ // BareP4::defineBranches(t, "met" ); // ptJESUP = new vector<float>; t->Branch("metPtJESUP","vector<float>",&ptJESUP); // ptJESDOWN = new vector<float>; t->Branch("metPtJESDOWN","vector<float>",&ptJESDOWN); // genP4 = new TClonesArray("TLorentzVector", 20); t->Branch("metP4_GEN","TClonesArray", &p4, 128000, 0); // if ( IsExtend() ) { metNoMu = new TLorentzVector; t->Branch("metNoMu","TLorentzVector",&metNoMu); // pfMet_e3p0 = new TLorentzVector; t->Branch("pfMet_e3p0","TLorentzVector",&pfMet_e3p0); // metChargedHadron = new TLorentzVector; t->Branch("metChargedHadron","TLorentzVector",&metChargedHadron); // metNeutralHadron = new TLorentzVector; t->Branch("metNeutralHadron","TLorentzVector",&metNeutralHadron); // metNeutralEM = new TLorentzVector; t->Branch("metNeutralEM","TLorentzVector",&metNeutralEM); } // }
void BareEvent::defineBranches(TTree *t){ // t->Branch("isRealData" ,&isRealData ,"isRealData/I"); t->Branch("runNum" ,&runNum ,"runNum/I"); t->Branch("lumiNum" ,&lumiNum ,"lumiNum/I"); t->Branch("eventNum" ,&eventNum ,"eventNum/l"); t->Branch("rho" ,&rho ,"rho/F"); t->Branch("filterSelBits", &selBits, "selBits/i"); if ( IsExtend() ) { } }
void BareEvent::setBranchAddresses(TTree *t){ // BareFunctions::SetBranchAddress(t,"isRealData", &isRealData); BareFunctions::SetBranchAddress(t,"runNum", &runNum); BareFunctions::SetBranchAddress(t,"lumiNum", &lumiNum); BareFunctions::SetBranchAddress(t,"eventNum", &eventNum); BareFunctions::SetBranchAddress(t,"rho", &rho); BareFunctions::SetBranchAddress(t,"filterSelBits",&selBits); if (IsExtend() ) { } }
void BareEvent::defineBranches(TTree *t){ // t->Branch("isRealData" ,&isRealData ,"isRealData/I"); t->Branch("runNum" ,&runNum ,"runNum/I"); t->Branch("lumiNum" ,&lumiNum ,"lumiNum/I"); t->Branch("eventNum" ,&eventNum ,"eventNum/l"); t->Branch("rho" ,&rho ,"rho/F"); if ( IsExtend() ) { t->Branch("originalRun" ,&originalRun ,"originalRun/I"); t->Branch("originalLumi" ,&originalLumi ,"originalLumi/I"); t->Branch("originalEvent" ,&originalEvent ,"originalEvent/I"); } }
void BareEvent::setBranchAddresses(TTree *t){ // BareFunctions::SetBranchAddress(t,"isRealData", &isRealData); BareFunctions::SetBranchAddress(t,"runNum", &runNum); BareFunctions::SetBranchAddress(t,"lumiNum", &lumiNum); BareFunctions::SetBranchAddress(t,"eventNum", &eventNum); BareFunctions::SetBranchAddress(t,"rho", &rho); if (IsExtend() ) { BareFunctions::SetBranchAddress(t,"originalRun", &originalRun); BareFunctions::SetBranchAddress(t,"originalLumi", &originalLumi); BareFunctions::SetBranchAddress(t,"originalEvent", &originalEvent); } }
int NeroTaus::analyze(const edm::Event & iEvent) { if ( mOnlyMc ) return 0; iEvent.getByToken(token, handle); for (const pat::Tau &tau : *handle) { if (tau.pt() < 18 ) continue; if (tau.pt() < mMinPt ) continue; /// miniaod taus = decayModeFindingNewDMs if ( mMinId != "" and !(tau.tauID(mMinId)) ) continue; // minimum requirement to be saved. if ( mMaxIso >=0 and tau.tauID("byCombinedIsolationDeltaBetaCorrRaw3Hits") >= mMaxIso ) continue; if ( fabs(tau.eta()) > mMinEta ) continue; // ------------ END SELECTION float phoIso = 0.; for(auto cand : tau.isolationGammaCands() ) phoIso += cand->pt();//tau.isolationPFGammaCandsEtSum() ; float chIso = 0.; for(auto cand : tau.isolationChargedHadrCands() ) chIso += cand->pt();//tau.isolationPFChargedHadrCandsPtSum(); float nhIso = 0.; for(auto cand : tau.isolationNeutrHadrCands() ) nhIso += cand->pt(); // PF Cands not exists in miniAOD float totIso = phoIso + chIso + nhIso; //FILL new ( (*p4)[p4->GetEntriesFast()]) TLorentzVector(tau.px(), tau.py(), tau.pz(), tau.energy()); id -> push_back( tau.tauID("decayModeFinding")); Q -> push_back( tau.charge() ); M -> push_back( tau.mass() ); iso -> push_back( totIso ) ; if (IsExtend() ){ chargedIsoPtSum -> push_back( tau.tauID("chargedIsoPtSum") ); neutralIsoPtSum -> push_back( tau.tauID("neutralIsoPtSum") ); isoDeltaBetaCorr -> push_back( tau.tauID("byCombinedIsolationDeltaBetaCorrRaw3Hits")); againstEleLoose -> push_back( tau.tauID("againstElectronLooseMVA5") ); againstEleMedium -> push_back( tau.tauID("againstElectronMediumMVA5") ); againstMuLoose -> push_back( tau.tauID("againstMuonLoose3")); againstMuTight -> push_back( tau.tauID("againstMuonTight3")); } } if( int(id->size()) < mMinNtaus) return 1; return 0; }
void BareMet::init(){ BareP4::init(); BareFunctions::New(ptJESUP); BareFunctions::New(ptJESDOWN); BareFunctions::New(genP4); BareFunctions::New(metPuppi); BareFunctions::New(metPuppiSyst); BareFunctions::New(metSyst); if ( IsExtend() ) { BareFunctions::New(metNoMu); BareFunctions::New(metNoHF); BareFunctions::New(pfMet_e3p0); BareFunctions::New(trackMet); } }
void BareTaus::setBranchAddresses(TTree *t){ BareP4::setBranchAddresses(t,"tau"); id = new vector<float>; t->SetBranchAddress("tauId" ,&id); // Q = new vector<int>; t->SetBranchAddress("tauQ" ,&Q); // M = new vector<float>; t->SetBranchAddress("tauM" ,&M); // iso = new vector<float>; t->SetBranchAddress("tauIso" ,&iso); // EXTENDED VARIBALES if ( IsExtend() ) { chargedIsoPtSum = new vector<float>; t->SetBranchAddress("tauChargedIsoPtSum",&chargedIsoPtSum); neutralIsoPtSum = new vector<float> ; t->SetBranchAddress("tauNeutralIsoPtSum",&neutralIsoPtSum); isoDeltaBetaCorr = new vector<float>; t->SetBranchAddress("tauIsoDeltaBetaCorr",&isoDeltaBetaCorr); againstEleLoose = new vector<int>; t->SetBranchAddress("tauAgainstEleLoose",&againstEleLoose); againstEleMedium = new vector<int>; t->SetBranchAddress("tauAgainstEleMedium",&againstEleMedium); againstMuLoose = new vector<int>; t->SetBranchAddress("tauAgainstMuLoose",&againstMuLoose); againstMuTight = new vector<int> ; t->SetBranchAddress("tauAgainstMuTight",&againstMuTight); } }
void BarePhotons::defineBranches(TTree *t){ // BareP4::defineBranches(t, "photon" ); // t->Branch("photonIso","vector<float>",&iso); t->Branch("photonCorrections","vector<float>",&corr); // t->Branch("photonSieie","vector<float>",&sieie); // t->Branch("photonSelBits","vector<unsigned>",&selBits); // t->Branch("photonChIso","vector<float>",&chIso); t->Branch("photonNhIso","vector<float>",&nhIso); t->Branch("photonPhoIso","vector<float>",&phoIso); t->Branch("photonPuIso","vector<float>",&puIso); if (IsExtend()) { t->Branch("photonRawPt", "vector<float>", &rawpt); t->Branch("photonRawScEnergy", "vector<float>", &rawScEnergy); t->Branch("photonHOverE", "vector<float>", &hOverE); t->Branch("photonChWorstIso", "vector<float>", &chWorstIso); t->Branch("photonChIsoMax", "vector<float>", &chIsoMax); t->Branch("photonEmax", "vector<float>", &emax); t->Branch("photonE2nd", "vector<float>", &e2nd); t->Branch("photonE33", "vector<float>", &e33); t->Branch("photonE55", "vector<float>", &e55); t->Branch("photonSipip", "vector<float>", &sipip); t->Branch("photonSieip", "vector<float>", &sieip); t->Branch("photonR9", "vector<float>", &r9); t->Branch("photonEtaSC", "vector<float>", &etaSC); t->Branch("photonS4", "vector<float>", &s4); t->Branch("photonMipEnergy", "vector<float>", &mipEnergy); t->Branch("photonTime", "vector<float>", &time); t->Branch("photonTimeSpan", "vector<float>", &timeSpan); t->Branch("photonGenMatched", "vector<short>", &genMatched); } }
void BareMet::compress(){ BareP4::compress(); for(int i=0;i<genP4->GetEntries();++i) BareFunctions::Compress( * (TLorentzVector*) genP4->At(i) ); BareFunctions::Compress(*metPuppi); for(int i=0;i<metPuppiSyst->GetEntries();++i) BareFunctions::Compress( * (TLorentzVector*) metPuppiSyst->At(i) ); for(int i=0;i<metSyst->GetEntries();++i) BareFunctions::Compress( * (TLorentzVector*) metSyst->At(i) ); if ( IsExtend() ) { BareFunctions::Compress(*metNoMu); BareFunctions::Compress(*metNoHF); BareFunctions::Compress(*pfMet_e3p0); BareFunctions::Compress(*trackMet); } }
void BarePhotons::setBranchAddresses(TTree *t){ BareP4::setBranchAddresses(t,"photon"); BareFunctions::SetBranchAddress(t,"photonIso" ,&iso); BareFunctions::SetBranchAddress(t,"photonCorrections" ,&corr); BareFunctions::SetBranchAddress(t,"photonSieie" ,&sieie); BareFunctions::SetBranchAddress(t,"photonSelBits" ,&selBits); BareFunctions::SetBranchAddress(t,"photonChIso",&chIso); BareFunctions::SetBranchAddress(t,"photonNhIso",&nhIso); BareFunctions::SetBranchAddress(t,"photonPhoIso",&phoIso); BareFunctions::SetBranchAddress(t,"photonPuIso",&puIso); if (IsExtend()) { BareFunctions::SetBranchAddress(t, "photonRawPt", &rawpt); BareFunctions::SetBranchAddress(t, "photonRawScEnergy", &rawScEnergy); BareFunctions::SetBranchAddress(t, "photonHOverE", &hOverE); BareFunctions::SetBranchAddress(t, "photonChWorstIso", &chWorstIso); BareFunctions::SetBranchAddress(t, "photonChIsoMax", &chIsoMax); BareFunctions::SetBranchAddress(t, "photonEmax", &emax); BareFunctions::SetBranchAddress(t, "photonE2nd", &e2nd); BareFunctions::SetBranchAddress(t, "photonE33", &e33); BareFunctions::SetBranchAddress(t, "photonE55", &e55); BareFunctions::SetBranchAddress(t, "photonSipip", &sipip); BareFunctions::SetBranchAddress(t, "photonSieip", &sieip); BareFunctions::SetBranchAddress(t, "photonR9", &r9); BareFunctions::SetBranchAddress(t, "photonEtaSC", &etaSC); BareFunctions::SetBranchAddress(t, "photonS4", &s4); BareFunctions::SetBranchAddress(t, "photonMipEnergy", &mipEnergy); BareFunctions::SetBranchAddress(t, "photonTime", &time); BareFunctions::SetBranchAddress(t, "photonTimeSpan", &timeSpan); BareFunctions::SetBranchAddress(t, "photonGenMatched", &genMatched); } }
int NeroTaus::analyze(const edm::Event & iEvent) { if ( mOnlyMc ) return 0; iEvent.getByToken(token, handle); if ( not handle.isValid() ) cout<<"[NeroTaus]::[analyze]::[ERROR] handle is not valid"<<endl; for (const pat::Tau &tau : *handle) { if (tau.pt() < 18 ) continue; if (tau.pt() < mMinPt ) continue; /// miniaod taus = decayModeFindingNewDMs if ( mMinId != "" and !(tau.tauID(mMinId)) ) continue; // minimum requirement to be saved. if ( mMaxIso >=0 and tau.tauID("byCombinedIsolationDeltaBetaCorrRaw3Hits") >= mMaxIso ) continue; if ( fabs(tau.eta()) > mMinEta ) continue; // ------------ END SELECTION float phoIso = 0.; for(auto cand : tau.isolationGammaCands() ) phoIso += cand->pt();//tau.isolationPFGammaCandsEtSum() ; float chIso = 0.; for(auto cand : tau.isolationChargedHadrCands() ) chIso += cand->pt();//tau.isolationPFChargedHadrCandsPtSum(); float nhIso = 0.; for(auto cand : tau.isolationNeutrHadrCands() ) nhIso += cand->pt(); // PF Cands not exists in miniAOD float totIso = phoIso + chIso + nhIso; //FILL new ( (*p4)[p4->GetEntriesFast()]) TLorentzVector(tau.px(), tau.py(), tau.pz(), tau.energy()); unsigned bits = 0; bits |= bool(tau.tauID("decayModeFindingNewDMs") ) * TauDecayModeFindingNewDMs; bits |= bool(tau.tauID("decayModeFinding") ) * TauDecayModeFinding; bits |= bool(tau.tauID("againstElectronLooseMVA6") )* AgainstEleLoose ; // FIXME 76 MVA 6 bits |= bool(tau.tauID("againstElectronMediumMVA6"))* AgainstEleMedium ; bits |= bool(tau.tauID("againstMuonLoose3")) * AgainstMuLoose ; bits |= bool(tau.tauID("againstMuonTight3")) * AgainstMuTight ; // old id the following only in 76 v2 bits |= bool(tau.tauID("byLooseIsolationMVArun2v1DBoldDMwLT")) * byLooseIsolationMVArun2v1DBoldDMwLT; bits |= bool(tau.tauID("byMediumIsolationMVArun2v1DBoldDMwLT")) * byMediumIsolationMVArun2v1DBoldDMwLT; bits |= bool(tau.tauID("byTightIsolationMVArun2v1DBoldDMwLT")) * byTightIsolationMVArun2v1DBoldDMwLT; bits |= bool(tau.tauID("byVTightIsolationMVArun2v1DBoldDMwLT")) * byVTightIsolationMVArun2v1DBoldDMwLT; // new id bits |= bool(tau.tauID("byLooseIsolationMVArun2v1DBnewDMwLT")) * byLooseIsolationMVArun2v1DBnewDMwLT; bits |= bool(tau.tauID("byMediumIsolationMVArun2v1DBnewDMwLT")) * byMediumIsolationMVArun2v1DBnewDMwLT; bits |= bool(tau.tauID("byTightIsolationMVArun2v1DBnewDMwLT")) * byTightIsolationMVArun2v1DBnewDMwLT; bits |= bool(tau.tauID("byVTightIsolationMVArun2v1DBnewDMwLT")) * byVTightIsolationMVArun2v1DBnewDMwLT; // DB ISO WP bits |= bool(tau.tauID("byLooseCombinedIsolationDeltaBetaCorr3Hits")) * byLooseCombinedIsolationDeltaBetaCorr3Hits; bits |= bool(tau.tauID("byMediumCombinedIsolationDeltaBetaCorr3Hits")) * byMediumCombinedIsolationDeltaBetaCorr3Hits; bits |= bool(tau.tauID("byTightCombinedIsolationDeltaBetaCorr3Hits")) * byTightCombinedIsolationDeltaBetaCorr3Hits; switch (tau.decayMode() ) { case reco::PFTau::kOneProng0PiZero : { bits |= OneProng; bits |= ZeroPiZero; break; } case reco::PFTau::kOneProng1PiZero : { bits |= OneProng; bits |= OnePiZero; break; } case reco::PFTau::kOneProng2PiZero : { bits |= OneProng; bits |= TwoPiZero; break; } case reco::PFTau::kOneProng3PiZero : { bits |= OneProng; bits |= ThreePiZero; break; } case reco::PFTau::kOneProngNPiZero : { bits |= OneProng; bits |= ThreePiZero; break; } case reco::PFTau::kTwoProng0PiZero : { bits |= TwoProng; bits |= ZeroPiZero; break; } case reco::PFTau::kTwoProng1PiZero : { bits |= TwoProng; bits |= OnePiZero; break; } case reco::PFTau::kTwoProng2PiZero : { bits |= TwoProng; bits |= TwoPiZero; break; } case reco::PFTau::kTwoProng3PiZero : { bits |= TwoProng; bits |= ThreePiZero; break; } case reco::PFTau::kTwoProngNPiZero : { bits |= TwoProng; // three or moreY bits |= ThreePiZero; break; } case reco::PFTau::kThreeProng0PiZero : { bits |= ThreeProng; bits |= ZeroPiZero; break; } case reco::PFTau::kThreeProng1PiZero : { bits |= ThreeProng; bits |= OnePiZero; break; } case reco::PFTau::kThreeProng2PiZero : { bits |= ThreeProng; bits |= TwoPiZero; break; } case reco::PFTau::kThreeProng3PiZero : { bits |= ThreeProng; bits |= ThreePiZero; break; } case reco::PFTau::kThreeProngNPiZero : { bits |= ThreeProng; // three or moreY bits |= ThreePiZero; break; } case reco::PFTau::kNull : { break; } case reco::PFTau::kRareDecayMode : { break; } } selBits -> push_back(bits); Q -> push_back( tau.charge() ); M -> push_back( tau.mass() ); iso -> push_back( totIso ) ; if (IsExtend() ) { chargedIsoPtSum -> push_back( tau.tauID("chargedIsoPtSum") ); neutralIsoPtSum -> push_back( tau.tauID("neutralIsoPtSum") ); isoDeltaBetaCorr -> push_back( tau.tauID("byCombinedIsolationDeltaBetaCorrRaw3Hits")); //isoPileupWeightedRaw -> push_back( tau.tauID("byPileupWeightedIsolationRaw3Hits")); // not in 80X isoMva -> push_back(tau.tauID("byIsolationMVArun2v1DBnewDMwLTraw") ); } } if( int(selBits->size()) < mMinNtaus) return 1; return 0; }
int NeroMet::analyze(const edm::Event& iEvent){ if ( mOnlyMc ) return 0; // in principle I would like to have the gen met: TODO // maybe handle should be taken before iEvent.getByToken(token, handle); if ( not handle.isValid() ) cout<<"[NeroMet]::[analyze]::[ERROR] handle is not valid"<<endl; if (rerunPuppi) { iEvent.getByToken(token_puppiRerun,handle_puppiRerun); if ( not handle_puppiRerun.isValid() ) cout<<"[NeroMetRecluster]::[analyze]::[ERROR] handle_puppiRerun is not valid"<<endl; iEvent.getByToken(token_puppiRerunUncorr,handle_puppiRerunUncorr); if ( not handle_puppiRerunUncorr.isValid() ) cout<<"[NeroMetRecluster]::[analyze]::[ERROR] handle_puppiRerunUncorr is not valid"<<endl; } else { iEvent.getByToken(token_puppi,handle_puppi); if ( not handle_puppi.isValid() ) cout<<"[NeroMet]::[analyze]::[ERROR] handle_puppi is not valid"<<endl; } // -- iEvent.getByToken(token_puppiUncorr,handle_puppiUncorr); // -- if ( not handle_puppiUncorr.isValid() ) cout<<"[NeroMet]::[analyze]::[ERROR] handle_puppiUncorr is not valid"<<endl; //-- const pat::MET &met = handle->front(); caloMet_Pt = met.caloMETPt(); caloMet_Phi = met.caloMETPhi(); caloMet_SumEt = met.caloMETSumEt(); // FILL new ( (*p4)[p4->GetEntriesFast()]) TLorentzVector( met.px(),met.py(),met.pz(),met.energy() ); sumEtRaw = met.uncorSumEt(); ptJESUP -> push_back( met.shiftedPt(pat::MET::JetEnUp) ); ptJESDOWN -> push_back( met.shiftedPt(pat::MET::JetEnDown) ); rawMet_Pt = met.uncorPt(); rawMet_Phi = met.uncorPhi(); if (IsExtend()) { //MetNoMu TLorentzVector metnomu(met.px(),met.py(),met.pz(),met.energy()); TLorentzVector tkMet(0,0,0,0); TLorentzVector pfmet_3p0(0,0,0,0); if ( pf == NULL ) cout<<"[NeroMet]::[analyze]::[ERROR] PF pointer is null. Run NeroPF. "<<endl; for (unsigned int i = 0, n = pf->handle->size(); i < n; ++i) { const pat::PackedCandidate &cand = (*pf->handle)[i]; // only up to eta 3 if (std::abs(cand.pdgId()) == 13) metnomu += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); // only charge hadrons if ( cand.charge() != 0 ) tkMet += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); if (std::abs(cand.eta()) < 3.0 ) pfmet_3p0 += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); } *pfMet_e3p0 = TLorentzVector( -pfmet_3p0 ); *metNoMu = TLorentzVector(metnomu); // no minus *trackMet = TLorentzVector( -tkMet ); if (rerunPuppi) { auto &puppi = handle_puppiRerun->front(); *metPuppi = TLorentzVector( puppi.px(), puppi.py(),puppi.pz(),puppi.energy() ); sumEtRawPuppi = handle_puppiRerunUncorr->front().sumEt(); } else { auto &puppi = handle_puppi->front(); *metPuppi = TLorentzVector( puppi.px(), puppi.py(),puppi.pz(),puppi.energy() ); //sumEtRawPuppi = handle_puppiUncorr->front().sumEt(); sumEtRawPuppi = puppi.uncorSumEt(); } for(Syst mysyst = (Syst)0; mysyst < MaxSyst ; mysyst = (Syst)((int)mysyst +1 ) ) { pat::MET::METUncertainty miniAODUnc=pat::MET::METUncertaintySize; // JetResUp=0, JetResDown=1, JetEnUp=2, JetEnDown=3, // MuonEnUp=4, MuonEnDown=5, ElectronEnUp=6, ElectronEnDown=7, // TauEnUp=8, TauEnDown=9, UnclusteredEnUp=10, UnclusteredEnDown=11, // PhotonEnUp=12, PhotonEnDown=13, NoShift=14, METUncertaintySize=15, // JetResUpSmear=16, JetResDownSmear=17, METFullUncertaintySize=18 // translate switch (mysyst) { case JesUp : {miniAODUnc = pat::MET::JetEnUp; break;} case JesDown : {miniAODUnc = pat::MET::JetEnDown; break;} case JerUp : {miniAODUnc = pat::MET::JetResUp; break;} case JerDown : {miniAODUnc = pat::MET::JetResDown; break;} case UnclusterUp : {miniAODUnc = pat::MET::UnclusteredEnUp; break;} case UnclusterDown : {miniAODUnc = pat::MET::UnclusteredEnDown; break;} case TauUp : {miniAODUnc = pat::MET::TauEnUp; break;} case TauDown : {miniAODUnc = pat::MET::TauEnDown; break;} case PhotonUp : {miniAODUnc = pat::MET::PhotonEnDown; break;} case PhotonDown : {miniAODUnc = pat::MET::PhotonEnDown; break;} case ElectronUp : {miniAODUnc = pat::MET::ElectronEnUp; break;} case ElectronDown : {miniAODUnc = pat::MET::ElectronEnDown; break;} case MuonUp : {miniAODUnc = pat::MET::MuonEnUp; break;} case MuonDown : {miniAODUnc = pat::MET::MuonEnDown; break;} default : break; } if (miniAODUnc == pat::MET::METUncertaintySize) cout <<"[NeroMet]::[analyze]::[WARNING] unable to translate met syst,"<< int(mysyst) <<endl; /* new ( (*metPuppiSyst)[ mysyst ] ) TLorentzVector( puppi . shiftedP4( miniAODUnc).px(), puppi . shiftedP4(miniAODUnc).py(), puppi . shiftedP4(miniAODUnc).pz(), puppi . shiftedP4(miniAODUnc).energy() ); */ new ( (*metSyst)[ mysyst ] ) TLorentzVector( met . shiftedP4( miniAODUnc).px(), met . shiftedP4(miniAODUnc).py(), met . shiftedP4(miniAODUnc).pz(), met . shiftedP4(miniAODUnc).energy() ); }// end syst loop } // GEN INFO if ( not iEvent.isRealData () ){ new ( (*genP4)[genP4->GetEntriesFast()]) TLorentzVector( met.genMET()->px(),met.genMET()->py(),met.genMET()->pz(),met.genMET()->energy() ); } return 0; }
int NeroMet::analyze(const edm::Event& iEvent){ if ( mOnlyMc ) return 0; // in principle I would like to have the gen met: TODO // maybe handle should be taken before iEvent.getByToken(token, handle); const pat::MET &met = handle->front(); // FILL new ( (*p4)[p4->GetEntriesFast()]) TLorentzVector( met.px(),met.py(),met.pz(),met.energy() ); ptJESUP -> push_back( met.shiftedPt(pat::MET::JetEnUp) ); ptJESDOWN -> push_back( met.shiftedPt(pat::MET::JetEnDown) ); if (IsExtend()) { //MetNoMu TLorentzVector metnomu(met.px(),met.py(),met.pz(),met.energy()); TLorentzVector pfmet_e3p0(0,0,0,0); TLorentzVector chMet(0,0,0,0); TLorentzVector nhMet(0,0,0,0); TLorentzVector phoMet(0,0,0,0); if ( pf == NULL ) cout<<"[NeroMet]::[analyze]::[ERROR] PF pointer is null. Run NeroPF. "<<endl; for (unsigned int i = 0, n = pf->handle->size(); i < n; ++i) { const pat::PackedCandidate &cand = (*pf->handle)[i]; // only up to eta 3 if (std::abs(cand.eta()) < 3.0) pfmet_e3p0 += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); if (std::abs(cand.pdgId()) == 13) metnomu += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); // only charge hadrons if ( cand.charge() != 0 and cand.pdgId() > 20 ) chMet += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); if ( cand.charge() == 0 and cand.pdgId() == 22 ) phoMet += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); if ( cand.charge() == 0 and cand.pdgId() != 22 ) nhMet += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); } *metNoMu = TLorentzVector(metnomu); *metChargedHadron = TLorentzVector(chMet); *metNeutralHadron = TLorentzVector(nhMet); *metNeutralEM = TLorentzVector(phoMet); *pfMet_e3p0 = TLorentzVector(pfmet_e3p0); } // GEN INFO if ( not iEvent.isRealData () ){ new ( (*genP4)[genP4->GetEntriesFast()]) TLorentzVector( met.genMET()->px(),met.genMET()->py(),met.genMET()->pz(),met.genMET()->energy() ); } return 0; }
int NeroMetRecluster::analyze(const edm::Event& iEvent){ if ( mOnlyMc ) return 0; // in principle I would like to have the gen met: TODO // maybe handle should be taken before iEvent.getByToken(token, handle); if ( not handle.isValid() ) cout<<"[NeroMetRecluster]::[analyze]::[ERROR] handle is not valid"<<endl; iEvent.getByToken(token_puppi,handle_puppi); if ( not handle_puppi.isValid() ) cout<<"[NeroMetRecluster]::[analyze]::[ERROR] handle_puppi is not valid"<<endl; iEvent.getByToken(token_puppiUncorr,handle_puppiUncorr); if ( not handle_puppiUncorr.isValid() ) cout<<"[NeroMetRecluster]::[analyze]::[ERROR] handle_puppiUncorr is not valid"<<endl; //-- const pat::MET &met = handle->front(); caloMet_Pt = met.caloMETPt(); caloMet_Phi = met.caloMETPhi(); caloMet_SumEt = met.caloMETSumEt(); // FILL new ( (*p4)[p4->GetEntriesFast()]) TLorentzVector( met.px(),met.py(),met.pz(),met.energy() ); sumEtRaw = met.uncorSumEt(); ptJESUP -> push_back( met.shiftedPt(pat::MET::JetEnUp) ); ptJESDOWN -> push_back( met.shiftedPt(pat::MET::JetEnDown) ); rawMet_Pt = met.uncorPt(); rawMet_Phi = met.uncorPhi(); if (IsExtend()) { //MetNoMu TLorentzVector metnomu(met.px(),met.py(),met.pz(),met.energy()); TLorentzVector tkMet(0,0,0,0); TLorentzVector pfmet_3p0(0,0,0,0); if ( pf == NULL ) cout<<"[NeroMetRecluster]::[analyze]::[ERROR] PF pointer is null. Run NeroPF. "<<endl; for (unsigned int i = 0, n = pf->handle->size(); i < n; ++i) { const pat::PackedCandidate &cand = (*pf->handle)[i]; // only up to eta 3 if (std::abs(cand.pdgId()) == 13) metnomu += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); // only charge hadrons if ( cand.charge() != 0 ) tkMet += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); if (std::abs(cand.eta()) < 3.0 ) pfmet_3p0 += TLorentzVector(cand.px(),cand.py(),cand.pz(),cand.energy()); } *pfMet_e3p0 = TLorentzVector( -pfmet_3p0 ); *metNoMu = TLorentzVector(metnomu); // no minus *trackMet = TLorentzVector( -tkMet ); auto &puppi = handle_puppi->front(); *metPuppi = TLorentzVector( puppi.px(), puppi.py(),puppi.pz(),puppi.energy() ); sumEtRawPuppi = handle_puppiUncorr->front().sumEt(); } // GEN INFO if ( not iEvent.isRealData () ){ new ( (*genP4)[genP4->GetEntriesFast()]) TLorentzVector( met.genMET()->px(),met.genMET()->py(),met.genMET()->pz(),met.genMET()->energy() ); } return 0; }