diff --git a/src/AOD2NanoAOD.cc b/src/AOD2NanoAOD.cc index 6409f67..4f03eb9 100644 --- a/src/AOD2NanoAOD.cc +++ b/src/AOD2NanoAOD.cc @@ -201,6 +201,14 @@ class AOD2NanoAOD : public edm::EDAnalyzer { bool value_tau_idantimumedium[max_tau]; bool value_tau_idantimutight[max_tau]; +//added Tau IDs + float value_tau_idCombinedisoDBSumPtCorr3Hitsloose[max_tau]; + float value_tau_idCombinedisoDBSumPtCorr3Hitsmedium[max_tau]; + float value_tau_idCombinedisoDBSumPtCorr3Hitstight[max_tau]; + float value_tau_idisoMVAloose[max_tau]; + float value_tau_idisoMVAmedium[max_tau]; + float value_tau_idisoMVAtight[max_tau]; + /* // Photons const static int max_ph = 1000; @@ -325,7 +333,14 @@ AOD2NanoAOD::AOD2NanoAOD(const edm::ParameterSet &iConfig) tree->Branch("Tau_idAntiMuLoose", value_tau_idantimuloose, "Tau_idAntiMuLoose[nTau]/O"); tree->Branch("Tau_idAntiMuMedium", value_tau_idantimumedium, "Tau_idAntiMuMedium[nTau]/O"); tree->Branch("Tau_idAntiMuTight", value_tau_idantimutight, "Tau_idAntiMuTight[nTau]/O"); - + + //added Tau IDs + tree->Branch("Tau_idCombinedIsoDBSumPtCorr3HitsLoose",value_tau_idCombinedisoDBSumPtCorr3Hitsloose, "Tau_idCombinedIsoDBSumPtCorr3HitsLoose[nTau]/O"); + tree->Branch("Tau_idCombinedIsoDBSumPtCorr3HitsMedium",value_tau_idCombinedisoDBSumPtCorr3Hitsmedium, "Tau_idCombinedIsoDBSumPtCorr3HitsMedium[nTau]/O"); + tree->Branch("Tau_idCombinedIsoDBSumPtCorr3HitsTight", value_tau_idCombinedisoDBSumPtCorr3Hitstight, "Tau_idCombinedIsoDBSumPtCorr3HitsTight[nTau]/O"); + tree->Branch("Tau_idIsoMVALoose",value_tau_idisoMVAloose, "Tau_idIsoMVALoose[nTau]/O"); + tree->Branch("Tau_idIsoMVAMedium",value_tau_idisoMVAmedium, "Tau_idIsoMVAMedium[nTau]/O"); + tree->Branch("Tau_idIsoMVATight",value_tau_idisoMVAtight, "Tau_idIsoMVATight[nTau]/O"); /* // Photons tree->Branch("nPhoton", &value_ph_n, "nPhoton/i"); @@ -511,7 +526,8 @@ void AOD2NanoAOD::analyze(const edm::Event &iEvent, Handle tausLooseIso, tausVLooseIso, tausMediumIso, tausTightIso, tausDecayMode, tausLooseEleRej, tausMediumEleRej, tausTightEleRej, tausLooseMuonRej, tausMediumMuonRej, - tausTightMuonRej, tausRawIso; + tausTightMuonRej, tausRawIso, tausLooseIsoMVA, tausMediumIsoMVA, tausTightIsoMVA, + tausLooseIso3Hits, tausMediumIso3Hits, tausTightIso3Hits; iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByDecayModeFinding"), tausDecayMode); @@ -541,6 +557,21 @@ void AOD2NanoAOD::analyze(const edm::Event &iEvent, iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByTightMuonRejection"), tausTightMuonRej); +//added Tau Discriminators + + iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"), + tausLooseIso3Hits); + iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), + tausMediumIso3Hits); + iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), + tausTightIso3Hits); + iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByLooseIsolationMVA"), + tausLooseIsoMVA); + iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByMediumIsolationMVA"), + tausMediumIsoMVA); + iEvent.getByLabel(InputTag("hpsPFTauDiscriminationByTightIsolationMVA"), + tausTightIsoMVA); + const float tau_min_pt = 15; value_tau_n = 0; std::vector selectedTaus; @@ -553,6 +584,7 @@ void AOD2NanoAOD::analyze(const edm::Event &iEvent, value_tau_charge[value_tau_n] = it->charge(); value_tau_mass[value_tau_n] = it->mass(); value_tau_decaymode[value_tau_n] = it->decayMode(); + // Discriminators const auto idx = it - taus->begin(); value_tau_iddecaymode[value_tau_n] = tausDecayMode->operator[](idx).second; @@ -568,9 +600,21 @@ void AOD2NanoAOD::analyze(const edm::Event &iEvent, value_tau_idantimumedium[value_tau_n] = tausMediumMuonRej->operator[](idx).second; value_tau_idantimutight[value_tau_n] = tausTightMuonRej->operator[](idx).second; +//added TauIDs filled + + value_tau_idisoMVAloose[value_tau_n] = tausLooseIsoMVA->operator[](idx).second; + value_tau_idisoMVAmedium[value_tau_n] = tausMediumIsoMVA->operator[](idx).second; + value_tau_idisoMVAtight[value_tau_n] = tausTightIsoMVA->operator[](idx).second; + value_tau_idCombinedisoDBSumPtCorr3Hitstight[value_tau_n] = tausLooseIso3Hits->operator[](idx).second; + value_tau_idCombinedisoDBSumPtCorr3Hitsmedium[value_tau_n] = tausMediumIso3Hits->operator[](idx).second; + value_tau_idCombinedisoDBSumPtCorr3Hitsloose[value_tau_n] = tausTightIso3Hits->operator[](idx).second; + + value_tau_reliso_all[value_tau_n] = (it->isolationPFChargedHadrCandsPtSum() + it->isolationPFGammaCandsEtSum()) / it->pt(); value_tau_jetidx[value_tau_n] = -1; value_tau_genpartidx[value_tau_n] = -1; + + value_tau_n++; } }