From e80e90660859fe4883603d96e0547c62d61b94ae Mon Sep 17 00:00:00 2001 From: gourab saha Date: Tue, 20 Feb 2024 15:22:45 +0100 Subject: [PATCH 1/4] Tau offline validation with data --- .../RecoTau/interface/TauValidationMiniAOD.h | 3 + Validation/RecoTau/plugins/BuildFile.xml | 1 + .../RecoTau/plugins/ElectronFromPVSelector.cc | 18 +- Validation/RecoTau/plugins/IsoTracks.cc | 17 +- .../RecoTau/plugins/MuonFromPVSelector.cc | 17 +- .../RecoTau/plugins/ObjectViewCleaner.cc | 21 +- Validation/RecoTau/plugins/Selectors.cc | 28 +++ .../RecoTau/plugins/TrackFromPVSelector.cc | 19 +- .../python/RecoTauValidationMiniAOD_cfi.py | 206 +++++++++--------- .../RecoTau/python/RecoTauValidation_cff.py | 49 ++++- .../dataTypes/ValidateTausOnRealData_cff.py | 38 +++- .../ValidateTausOnRealElectronsData_cff.py | 85 +++++--- .../ValidateTausOnRealMuonsData_cff.py | 62 ++++-- .../RecoTau/src/TauValidationMiniAOD.cc | 151 ++++++++----- Validation/RecoTau/test/config.py | 96 +++++--- Validation/RecoTau/test/harvesting.py | 5 +- 16 files changed, 540 insertions(+), 276 deletions(-) diff --git a/Validation/RecoTau/interface/TauValidationMiniAOD.h b/Validation/RecoTau/interface/TauValidationMiniAOD.h index 9e8d323c9f153..f88b3cfb00162 100644 --- a/Validation/RecoTau/interface/TauValidationMiniAOD.h +++ b/Validation/RecoTau/interface/TauValidationMiniAOD.h @@ -91,6 +91,8 @@ class TauValidationMiniAOD : public DQMEDAnalyzer { std::map dmMigrationMap, ntau_vs_dmMap; std::map pTOverProng_dm0Map, pTOverProng_dm1p2Map, pTOverProng_dm5Map, pTOverProng_dm6Map, pTOverProng_dm10Map, pTOverProng_dm11Map; + std::map fracMap; + edm::ParameterSet histoSettings_; std::string extensionName_; std::vector discriminators_; @@ -102,6 +104,7 @@ class TauValidationMiniAOD : public DQMEDAnalyzer { std::string ztt; std::string zee; std::string zmm; + bool isMC_; }; #endif diff --git a/Validation/RecoTau/plugins/BuildFile.xml b/Validation/RecoTau/plugins/BuildFile.xml index c0ad016e96435..89845fdd148e5 100644 --- a/Validation/RecoTau/plugins/BuildFile.xml +++ b/Validation/RecoTau/plugins/BuildFile.xml @@ -7,6 +7,7 @@ + diff --git a/Validation/RecoTau/plugins/ElectronFromPVSelector.cc b/Validation/RecoTau/plugins/ElectronFromPVSelector.cc index 0cbf063eab028..bcc631c632c33 100644 --- a/Validation/RecoTau/plugins/ElectronFromPVSelector.cc +++ b/Validation/RecoTau/plugins/ElectronFromPVSelector.cc @@ -18,6 +18,9 @@ #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" +// -- new -- [GS] +#include "DataFormats/PatCandidates/interface/Electron.h" + #include #include #include @@ -35,7 +38,8 @@ class GsfElectronFromPVSelector : public edm::global::EDProducer<> { double max_dxy_; double max_dz_; edm::EDGetTokenT> v_recoVertexToken_; - edm::EDGetTokenT> v_recoGsfElectronToken_; + //edm::EDGetTokenT> v_recoGsfElectronToken_; + edm::EDGetTokenT v_recoGsfElectronToken_; }; //////////////////////////////////////////////////////////////////////////////// @@ -47,8 +51,10 @@ GsfElectronFromPVSelector::GsfElectronFromPVSelector(edm::ParameterSet const& iC max_dz_{iConfig.getParameter("max_dz")}, v_recoVertexToken_{consumes>(iConfig.getParameter("srcVertex"))}, v_recoGsfElectronToken_{ - consumes>(iConfig.getParameter("srcElectron"))} { - produces>(); + //consumes>(iConfig.getParameter("srcElectron"))} { + consumes(iConfig.getParameter("srcElectron"))} { + //produces>(); + produces(); } //////////////////////////////////////////////////////////////////////////////// @@ -59,10 +65,12 @@ void GsfElectronFromPVSelector::produce(edm::StreamID, edm::Event& iEvent, edm:: edm::Handle> vertices; iEvent.getByToken(v_recoVertexToken_, vertices); - edm::Handle> gsfElectrons; + //edm::Handle> gsfElectrons; + edm::Handle gsfElectrons; iEvent.getByToken(v_recoGsfElectronToken_, gsfElectrons); - auto goodGsfElectrons = std::make_unique>(); + //auto goodGsfElectrons = std::make_unique>(); + auto goodGsfElectrons = std::make_unique(); if (!vertices->empty() && !gsfElectrons->empty()) { auto const& pv = vertices->front(); diff --git a/Validation/RecoTau/plugins/IsoTracks.cc b/Validation/RecoTau/plugins/IsoTracks.cc index 7854cde447e26..4372dec238b25 100644 --- a/Validation/RecoTau/plugins/IsoTracks.cc +++ b/Validation/RecoTau/plugins/IsoTracks.cc @@ -7,6 +7,8 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" + #include #include @@ -21,7 +23,8 @@ class IsoTracks : public edm::global::EDProducer<> { private: double coneRadius_; double threshold_; - edm::EDGetTokenT> v_recoTrackToken_; + //edm::EDGetTokenT> v_recoTrackToken_; + edm::EDGetTokenT> v_recoTrackToken_; }; //////////////////////////////////////////////////////////////////////////////// @@ -31,8 +34,10 @@ class IsoTracks : public edm::global::EDProducer<> { IsoTracks::IsoTracks(edm::ParameterSet const& iConfig) : coneRadius_{iConfig.getParameter("radius")}, threshold_{iConfig.getParameter("SumPtFraction")}, - v_recoTrackToken_{consumes>(iConfig.getParameter("src"))} { - produces>(); + //v_recoTrackToken_{consumes>(iConfig.getParameter("src"))} { + v_recoTrackToken_{consumes>(iConfig.getParameter("src"))} { + //produces>(); + produces>(); } //////////////////////////////////////////////////////////////////////////////// @@ -41,9 +46,11 @@ IsoTracks::IsoTracks(edm::ParameterSet const& iConfig) //______________________________________________________________________________ void IsoTracks::produce(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { - auto isoTracks = std::make_unique>(); + //auto isoTracks = std::make_unique>(); + auto isoTracks = std::make_unique>(); - edm::Handle> dirtyTracks; + //edm::Handle> dirtyTracks; + edm::Handle> dirtyTracks; iEvent.getByToken(v_recoTrackToken_, dirtyTracks); if (dirtyTracks->empty()) { diff --git a/Validation/RecoTau/plugins/MuonFromPVSelector.cc b/Validation/RecoTau/plugins/MuonFromPVSelector.cc index 5ce44c112ae1a..f2f85094d69f4 100644 --- a/Validation/RecoTau/plugins/MuonFromPVSelector.cc +++ b/Validation/RecoTau/plugins/MuonFromPVSelector.cc @@ -12,6 +12,9 @@ #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" +// -- new -- [GS] +#include "DataFormats/PatCandidates/interface/Muon.h" + #include #include #include @@ -28,7 +31,8 @@ class MuonFromPVSelector : public edm::global::EDProducer<> { double max_dxy_; double max_dz_; edm::EDGetTokenT> v_recoVertexToken_; - edm::EDGetTokenT> v_recoMuonToken_; + //edm::EDGetTokenT> v_recoMuonToken_; + edm::EDGetTokenT v_recoMuonToken_; }; //////////////////////////////////////////////////////////////////////////////// @@ -39,8 +43,9 @@ MuonFromPVSelector::MuonFromPVSelector(edm::ParameterSet const& iConfig) : max_dxy_{iConfig.getParameter("max_dxy")}, max_dz_{iConfig.getParameter("max_dz")}, v_recoVertexToken_{consumes>(iConfig.getParameter("srcVertex"))}, - v_recoMuonToken_{consumes>(iConfig.getParameter("srcMuon"))} { - produces>(); + //v_recoMuonToken_{consumes>(iConfig.getParameter("srcMuon"))} { + v_recoMuonToken_{consumes(iConfig.getParameter("srcMuon"))} { + produces(); } //////////////////////////////////////////////////////////////////////////////// @@ -48,12 +53,14 @@ MuonFromPVSelector::MuonFromPVSelector(edm::ParameterSet const& iConfig) //////////////////////////////////////////////////////////////////////////////// void MuonFromPVSelector::produce(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { - auto goodMuons = std::make_unique>(); + //auto goodMuons = std::make_unique>(); + auto goodMuons = std::make_unique(); edm::Handle> vertices; iEvent.getByToken(v_recoVertexToken_, vertices); - edm::Handle> muons; + //edm::Handle> muons; + edm::Handle muons; iEvent.getByToken(v_recoMuonToken_, muons); if (!vertices->empty()) { diff --git a/Validation/RecoTau/plugins/ObjectViewCleaner.cc b/Validation/RecoTau/plugins/ObjectViewCleaner.cc index 16abc1df9e404..591a24b9af9ca 100644 --- a/Validation/RecoTau/plugins/ObjectViewCleaner.cc +++ b/Validation/RecoTau/plugins/ObjectViewCleaner.cc @@ -30,6 +30,10 @@ #include "FWCore/Utilities/interface/EDGetToken.h" #include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/PatCandidates/interface/Jet.h" // new +#include "DataFormats/PatCandidates/interface/Electron.h" // new +#include "DataFormats/PatCandidates/interface/Muon.h" // new + #include #include #include @@ -83,7 +87,9 @@ namespace { ? iConfig.getParameter("srcObjectsToRemoveSelection") : "", true} { - produces>(); + // produces>(); + // need to write a class_def.xml?? + produces>(); } //______________________________________________________________________________ @@ -93,11 +99,13 @@ namespace { iEvent.getByToken(srcCands_, candidates); globalCache()->nObjectsTot += candidates->size(); - auto cleanObjects = std::make_unique>(); + //auto cleanObjects = std::make_unique>(); + auto cleanObjects = std::make_unique>(); for (unsigned int iCand{}; iCand < candidates->size(); ++iCand) { auto const& candidate = candidates->at(iCand); if (objKeepCut_(candidate) && isIsolated(iEvent, candidate)) { - cleanObjects->push_back(candidates->refAt(iCand)); + //cleanObjects->push_back(candidates->refAt(iCand)); + cleanObjects->push_back(candidate); } } globalCache()->nObjectsClean += cleanObjects->size(); @@ -152,7 +160,7 @@ namespace { //////////////////////////////////////////////////////////////////////////////// // plugin definitions //////////////////////////////////////////////////////////////////////////////// - +/* typedef ObjectViewCleaner TauValCandViewCleaner; typedef ObjectViewCleaner TauValJetViewCleaner; typedef ObjectViewCleaner TauValMuonViewCleaner; @@ -168,3 +176,8 @@ DEFINE_FWK_MODULE(TauValGsfElectronViewCleaner); DEFINE_FWK_MODULE(TauValElectronViewCleaner); DEFINE_FWK_MODULE(TauValPhotonViewCleaner); DEFINE_FWK_MODULE(TauValTrackViewCleaner); +*/ + +// -- new -- // +typedef ObjectViewCleaner TauValPatJetViewCleaner; +DEFINE_FWK_MODULE(TauValPatJetViewCleaner); diff --git a/Validation/RecoTau/plugins/Selectors.cc b/Validation/RecoTau/plugins/Selectors.cc index e9975b9bd632f..4d8319edba673 100644 --- a/Validation/RecoTau/plugins/Selectors.cc +++ b/Validation/RecoTau/plugins/Selectors.cc @@ -35,6 +35,16 @@ #include "DataFormats/HepMCCandidate/interface/GenParticle.h" #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" +//#include "DataFormats/PatCandidates/interface/CandKinResolution.h" // new +//#include "DataFormats/PatCandidates/interface/CompositeCandidate.h" // new + +#include "DataFormats/PatCandidates/interface/Jet.h" // new +#include "DataFormats/PatCandidates/interface/Electron.h" // new +#include "DataFormats/PatCandidates/interface/Muon.h" // new +#include "DataFormats/TrackReco/interface/Track.h" // new +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" +#include "CommonTools/RecoAlgos/interface/CandidateProducer.h" + #include #include @@ -50,6 +60,22 @@ typedef SingleObjectSelector, reco::GsfElectronCollection> TauValElectronSelector; +// -- new -- [GS] // +typedef SingleObjectSelector > TauValPatJetSelector; +typedef SingleObjectSelector, pat::ElectronCollection> + TauValPatElectronSelector; +typedef SingleObjectSelector > TauValPatMuonSelector; +typedef SingleObjectSelector, StringCutObjectSelector > + PFTrackSelector; +//typedef CandidateProducer, std::vector > +// ConcreteChargedPFCandidateProducer; +DEFINE_FWK_MODULE(TauValPatJetSelector); +DEFINE_FWK_MODULE(TauValPatElectronSelector); +DEFINE_FWK_MODULE(TauValPatMuonSelector); +DEFINE_FWK_MODULE(PFTrackSelector); +//DEFINE_FWK_MODULE(ConcreteChargedPFCandidateProducer); +// -------------- // + DEFINE_FWK_MODULE(TauValPFJetSelector); DEFINE_FWK_MODULE(TauValJetSelector); DEFINE_FWK_MODULE(TauValMuonSelector); @@ -94,12 +120,14 @@ bool ElectronIdFilter::filter(edm::StreamID, edm::Event& iEvent, const edm::Even // Loop over electrons for (unsigned int i = 0; i < electrons->size(); i++) { edm::Ref electronRef(electrons, i); + //edm::Ref electronRef(electrons, i); if ((eIDmap[electronRef]) == eid_) product->push_back((*electrons)[i]); } //cout << "Putting in the event" << endl; std::unique_ptr collection(product); + //std::unique_ptr collection(product); iEvent.put(std::move(collection)); return true; } diff --git a/Validation/RecoTau/plugins/TrackFromPVSelector.cc b/Validation/RecoTau/plugins/TrackFromPVSelector.cc index 3ff8ae1425a78..379a1ca75bc9f 100644 --- a/Validation/RecoTau/plugins/TrackFromPVSelector.cc +++ b/Validation/RecoTau/plugins/TrackFromPVSelector.cc @@ -14,6 +14,10 @@ #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" +// -- new -- [GS] +//#include "DataFormats/PatCandidates/interface/IsolatedTrack.h" +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" + #include #include #include @@ -32,7 +36,8 @@ class TrackFromPVSelector : public edm::global::EDProducer<> { double max_dxy_; double max_dz_; edm::EDGetTokenT> v_recoVertexToken_; - edm::EDGetTokenT> v_recoTrackToken_; + //edm::EDGetTokenT> v_recoTrackToken_; + edm::EDGetTokenT> v_recoTrackToken_; }; //////////////////////////////////////////////////////////////////////////////// @@ -44,8 +49,10 @@ TrackFromPVSelector::TrackFromPVSelector(edm::ParameterSet const& iConfig) : max_dxy_{iConfig.getParameter("max_dxy")}, max_dz_{iConfig.getParameter("max_dz")}, v_recoVertexToken_{consumes>(iConfig.getParameter("srcVertex"))}, - v_recoTrackToken_{consumes>(iConfig.getParameter("srcTrack"))} { - produces>(); + //v_recoTrackToken_{consumes>(iConfig.getParameter("srcTrack"))} { + v_recoTrackToken_{consumes>(iConfig.getParameter("srcTrack"))} { + //produces>(); + produces>(); } //////////////////////////////////////////////////////////////////////////////// @@ -57,10 +64,12 @@ void TrackFromPVSelector::produce(edm::StreamID, edm::Event& iEvent, edm::EventS edm::Handle> vertices; iEvent.getByToken(v_recoVertexToken_, vertices); - edm::Handle> tracks; + //edm::Handle> tracks; + edm::Handle> tracks; iEvent.getByToken(v_recoTrackToken_, tracks); - auto goodTracks = std::make_unique>(); + //auto goodTracks = std::make_unique>(); + auto goodTracks = std::make_unique>(); if (!vertices->empty() && !tracks->empty()) { auto const& vtxPos = vertices->front().position(); std::copy_if( diff --git a/Validation/RecoTau/python/RecoTauValidationMiniAOD_cfi.py b/Validation/RecoTau/python/RecoTauValidationMiniAOD_cfi.py index a5c31f91f4c2d..fa5d29975a778 100644 --- a/Validation/RecoTau/python/RecoTauValidationMiniAOD_cfi.py +++ b/Validation/RecoTau/python/RecoTauValidationMiniAOD_cfi.py @@ -3,107 +3,109 @@ from Validation.RecoTau.dataTypes.ValidateTausOnZTT_cff import * -tauValidationMiniAOD = DQMEDAnalyzer("TauValidationMiniAOD", - tauCollection = cms.InputTag("slimmedTaus"), - RefCollection = cms.InputTag("kinematicSelectedTauValDenominatorZTT"), - ExtensionName = cms.string('ZTT'), - PVCollection = cms.InputTag("offlineSlimmedPrimaryVertices"), - GenCollection = cms.InputTag("prunedGenParticles"), - discriminators = cms.VPSet( - cms.PSet(discriminator = cms.string("decayModeFinding"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("decayModeFindingNewDMs"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byLooseCombinedIsolationDeltaBetaCorr3Hits"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byMediumCombinedIsolationDeltaBetaCorr3Hits"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byTightCombinedIsolationDeltaBetaCorr3Hits"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("againstMuonLoose3"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("againstMuonTight3"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("againstElectronVLooseMVA6"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("againstElectronLooseMVA6"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("againstElectronMediumMVA6"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("againstElectronTightMVA6"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("againstElectronVTightMVA6"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), - #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)) - #DeepTauID vs jet - cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byMediumDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byTightDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVTightDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVTightDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), - #DeepTauID vs e - cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byMediumDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byTightDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVTightDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVTightDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), - #DeepTauID vs mu - cms.PSet(discriminator = cms.string("byVLooseDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byLooseDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byMediumDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byTightDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), - #New - #DeepTauID vs jet - cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byMediumDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byTightDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVTightDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVTightDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), - #DeepTauID vs e - cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byMediumDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byTightDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVTightDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byVVTightDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), - #DeepTauID vs mu - cms.PSet(discriminator = cms.string("byVLooseDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byLooseDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byMediumDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), - cms.PSet(discriminator = cms.string("byTightDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), +tauValidationMiniAOD = DQMEDAnalyzer( + "TauValidationMiniAOD", + tauCollection = cms.InputTag("slimmedTaus"), + RefCollection = cms.InputTag("kinematicSelectedTauValDenominatorZTT"), + ExtensionName = cms.string('ZTT'), + PVCollection = cms.InputTag("offlineSlimmedPrimaryVertices"), + GenCollection = cms.InputTag("prunedGenParticles"), + isMC = cms.bool(True), + discriminators = cms.VPSet( + cms.PSet(discriminator = cms.string("decayModeFinding"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("decayModeFindingNewDMs"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byLooseCombinedIsolationDeltaBetaCorr3Hits"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byMediumCombinedIsolationDeltaBetaCorr3Hits"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byTightCombinedIsolationDeltaBetaCorr3Hits"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("againstMuonLoose3"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("againstMuonTight3"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("againstElectronVLooseMVA6"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("againstElectronLooseMVA6"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("againstElectronMediumMVA6"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("againstElectronTightMVA6"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("againstElectronVTightMVA6"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVLooseIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byLooseIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byMediumIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)), + #cms.PSet(discriminator = cms.string("byVVTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5)) + #DeepTauID vs jet + cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byLooseDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byMediumDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byTightDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVTightDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVTightDeepTau2017v2p1VSjet"),selectionCut = cms.double(0.5)), + #DeepTauID vs e + cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byLooseDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byMediumDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byTightDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVTightDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVTightDeepTau2017v2p1VSe"),selectionCut = cms.double(0.5)), + #DeepTauID vs mu + cms.PSet(discriminator = cms.string("byVLooseDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byLooseDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byMediumDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byTightDeepTau2017v2p1VSmu"),selectionCut = cms.double(0.5)), + #New + #DeepTauID vs jet + cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byLooseDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byMediumDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byTightDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVTightDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVTightDeepTau2018v2p5VSjet"),selectionCut = cms.double(0.5)), + #DeepTauID vs e + cms.PSet(discriminator = cms.string("byVVVLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byLooseDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byMediumDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byTightDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVTightDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byVVTightDeepTau2018v2p5VSe"),selectionCut = cms.double(0.5)), + #DeepTauID vs mu + cms.PSet(discriminator = cms.string("byVLooseDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byLooseDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byMediumDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), + cms.PSet(discriminator = cms.string("byTightDeepTau2018v2p5VSmu"),selectionCut = cms.double(0.5)), ), ) diff --git a/Validation/RecoTau/python/RecoTauValidation_cff.py b/Validation/RecoTau/python/RecoTauValidation_cff.py index b791b536096e5..2af02c5df5265 100644 --- a/Validation/RecoTau/python/RecoTauValidation_cff.py +++ b/Validation/RecoTau/python/RecoTauValidation_cff.py @@ -30,16 +30,19 @@ ExtensionName = 'QCD' ) tauValidationMiniAODRealData = tauValidationMiniAODZTT.clone( - RefCollection = "CleanedPFJets", - ExtensionName = 'JETHT' + RefCollection = "CleanedPFJets", #"kinematicSelectedPFJets", + ExtensionName = 'JETHT', + isMC = False ) tauValidationMiniAODRealElectronsData = tauValidationMiniAODZTT.clone( RefCollection = "ElZLegs:theProbeLeg", - ExtensionName = 'DoubleElectron' + ExtensionName = 'DoubleElectron', + isMC = False ) tauValidationMiniAODRealMuonsData = tauValidationMiniAODZTT.clone( RefCollection = "MuZLegs:theProbeLeg", - ExtensionName = 'DoubleMuon' + ExtensionName = 'DoubleMuon', + isMC = False ) @@ -123,17 +126,55 @@ ) tauValidationSequenceMiniAOD = cms.Sequence( + # --ZTT produceDenominatorZTT *tauValidationMiniAODZTT + # --ZEE *produceDenominatorZEE *tauValidationMiniAODZEE + # --ZMM *produceDenominatorZMM *tauValidationMiniAODZMM + # --QCD *produceDenominatorQCD *tauValidationMiniAODQCD + # --RealData + *produceDenominatorRealData *tauValidationMiniAODRealData + # --RealElectronData + *produceDenominatorRealElectronsData *tauValidationMiniAODRealElectronsData + # --RealMuonData + *produceDenominatorRealMuonsData *tauValidationMiniAODRealMuonsData ) + +tauValidationSequenceMiniAODonMC = cms.Sequence( + # --ZTT + produceDenominatorZTT + *tauValidationMiniAODZTT + # --ZEE + *produceDenominatorZEE + *tauValidationMiniAODZEE + # --ZMM + *produceDenominatorZMM + *tauValidationMiniAODZMM + # --QCD + *produceDenominatorQCD + *tauValidationMiniAODQCD +) + +tauValidationSequenceMiniAODonDATA = cms.Sequence( + # --RealData + produceDenominatorRealData + *tauValidationMiniAODRealData + # --RealElectronData + *produceDenominatorRealElectronsData + *tauValidationMiniAODRealElectronsData + # --RealMuonData + *produceDenominatorRealMuonsData + *tauValidationMiniAODRealMuonsData +) + from Configuration.Eras.Modifier_fastSim_cff import fastSim fastSim.toReplaceWith(tauValidationSequenceMiniAOD,tauValidationSequenceMiniAOD.copyAndExclude([tauValidationMiniAODRealData,tauValidationMiniAODRealElectronsData,tauValidationMiniAODRealMuonsData])) diff --git a/Validation/RecoTau/python/dataTypes/ValidateTausOnRealData_cff.py b/Validation/RecoTau/python/dataTypes/ValidateTausOnRealData_cff.py index 6193f5e615eb3..d20bd2a794cf4 100644 --- a/Validation/RecoTau/python/dataTypes/ValidateTausOnRealData_cff.py +++ b/Validation/RecoTau/python/dataTypes/ValidateTausOnRealData_cff.py @@ -3,11 +3,17 @@ import copy from RecoJets.Configuration.RecoPFJets_cff import * +#from RecoJets.Configuration.RecoJets_cff import * +#from RecoHI.HiJetAlgos.HiRecoJets_cff import * +#from RecoJets.JetProducers.fixedGridRhoProducerFastjet_cfi import * + import PhysicsTools.PatAlgos.tools.helpers as helpers +""" kinematicSelectedPFJets = cms.EDFilter( "TauValPFJetSelector", - src = cms.InputTag('ak4PFJets'), + #src = cms.InputTag('ak4PFJets'), + src = cms.InputTag('slimmedJets'), cut = cms.string("pt > 15 & abs(eta) < 2.5"), filter = cms.bool(False) ) @@ -24,6 +30,28 @@ srcObjectsToRemove = cms.VInputTag( cms.InputTag("muons"), cms.InputTag("gedGsfElectrons") ), deltaRMin = cms.double(0.15) ) +""" +kinematicSelectedPFJets = cms.EDFilter( + "TauValPatJetSelector", + src = cms.InputTag('slimmedJets'), + cut = cms.string("pt > 15 & abs(eta) < 2.5"), + filter = cms.bool(False) +) + +PFJetsId = cms.EDFilter( + "TauValPatJetSelector", + src = cms.InputTag('kinematicSelectedPFJets'), + cut = cms.string("chargedHadronEnergyFraction > 0.0 & neutralHadronEnergyFraction < 0.99 & neutralHadronEnergyFraction < 0.99 & chargedEmEnergyFraction < 0.99 & chargedEmEnergyFraction < 0.99 & neutralEmEnergyFraction < 0.99 & chargedMultiplicity > 0 & nConstituents > 1"), + filter = cms.bool(False) +) + +CleanedPFJets = cms.EDProducer( + "TauValPatJetViewCleaner", + srcObject = cms.InputTag( "kinematicSelectedPFJets" ), + #srcObjectsToRemove = cms.VInputTag( cms.InputTag("muons"), cms.InputTag("gedGsfElectrons") ), + srcObjectsToRemove = cms.VInputTag( cms.InputTag("slimmedMuons"), cms.InputTag("slimmedElectrons") ), + deltaRMin = cms.double(0.15) +) procAttributes = dir(proc) #Takes a snapshot of what there in the process helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'RealData') #clones the sequence inside the process with RealData postfix @@ -72,10 +100,10 @@ produceDenominatorRealData = cms.Sequence( - cms.ignore(kinematicSelectedPFJets) * - cms.ignore(PFJetsId) * - CleanedPFJets - ) + cms.ignore(kinematicSelectedPFJets) + * cms.ignore(PFJetsId) + * CleanedPFJets +) produceDenominator = cms.Sequence(produceDenominatorRealData) diff --git a/Validation/RecoTau/python/dataTypes/ValidateTausOnRealElectronsData_cff.py b/Validation/RecoTau/python/dataTypes/ValidateTausOnRealElectronsData_cff.py index f57216dcb0716..d73ea46c3474e 100644 --- a/Validation/RecoTau/python/dataTypes/ValidateTausOnRealElectronsData_cff.py +++ b/Validation/RecoTau/python/dataTypes/ValidateTausOnRealElectronsData_cff.py @@ -7,22 +7,25 @@ ElPrimaryVertexFilter = cms.EDFilter( "VertexSelector", - src = cms.InputTag("offlinePrimaryVertices"), + #src = cms.InputTag("offlinePrimaryVertices"), + src = cms.InputTag("offlineSlimmedPrimaryVertices"), cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), filter = cms.bool(False) - ) +) ElBestPV = cms.EDProducer( "HighestSumP4PrimaryVertexSelector", src = cms.InputTag("ElPrimaryVertexFilter") - ) +) selectedElectrons = cms.EDFilter( - "TauValElectronSelector", - src = cms.InputTag('gedGsfElectrons'), + #"TauValElectronSelector", + "TauValPatElectronSelector", + #src = cms.InputTag('gedGsfElectrons'), + src = cms.InputTag('slimmedElectrons'), cut = cms.string("pt > 25.0 && abs(eta) < 2.4 && isElectron"), filter = cms.bool(False) - ) +) ElectronsFromPV = cms.EDProducer( "GsfElectronFromPVSelector", @@ -30,38 +33,43 @@ srcVertex = cms.InputTag("ElBestPV"), max_dxy = cms.double(0.01), max_dz = cms.double(0.1) - ) +) idElectrons = cms.EDFilter( - "TauValElectronSelector", + #"TauValElectronSelector", + "TauValPatElectronSelector", src = cms.InputTag('ElectronsFromPV'), cut = cms.string('ecalDrivenSeed & isGsfCtfScPixChargeConsistent & isGsfScPixChargeConsistent & isGsfCtfChargeConsistent & !isEBEEGap & (isEB & sigmaIetaIeta<0.01 & abs(deltaPhiSuperClusterTrackAtVtx)<0.06 & abs(deltaEtaSuperClusterTrackAtVtx)<0.006 & hadronicOverEm<0.04 | isEE & sigmaIetaIeta<0.03 & abs(deltaPhiSuperClusterTrackAtVtx)<0.04 & abs(deltaEtaSuperClusterTrackAtVtx)<0.007 & hadronicOverEm<0.025)'), filter = cms.bool(False) ) trackElectrons = cms.EDFilter( - "TauValElectronSelector", + #"TauValElectronSelector", + "TauValPatElectronSelector", src = cms.InputTag('idElectrons'), cut = cms.string('gsfTrack.isNonnull && 0.7 < eSuperClusterOverP < 1.5'), -# cut = cms.string('gsfTrack.isNonnull && gsfTrack.hitPattern().numberOfLostHits(\'MISSING_INNER_HITS\') = 0 && 0.7 < eSuperClusterOverP < 1.5'), + #cut = cms.string('gsfTrack.isNonnull && gsfTrack.hitPattern().numberOfLostHits(\'MISSING_INNER_HITS\') = 0 && 0.7 < eSuperClusterOverP < 1.5'), filter = cms.bool(False) ) isolatedElectrons = cms.EDFilter( - "TauValElectronSelector", + #"TauValElectronSelector", + "TauValPatElectronSelector", src = cms.InputTag('trackElectrons'), cut = cms.string("(isEB & (dr04TkSumPt/pt + max(0.,dr04EcalRecHitSumEt-2.)/pt + dr04HcalTowerSumEt/pt < 0.10)) | (isEE & (dr04TkSumPt/pt + dr04EcalRecHitSumEt/pt + dr04HcalTowerSumEt/pt < 0.09))"), filter = cms.bool(False) - ) +) from SimGeneral.HepPDTESSource.pythiapdt_cfi import * ElGoodTracks = cms.EDFilter( - "TrackSelector", - src = cms.InputTag("generalTracks"), + #"TrackSelector", + "PFTrackSelector", + #src = cms.InputTag("generalTracks"), + src = cms.InputTag("packedPFCandidates"), cut = cms.string("pt > 5 && abs(eta) < 2.5"), filter = cms.bool(False) - ) +) ElIsoTracks = cms.EDProducer( "IsoTracks", @@ -73,32 +81,35 @@ ElTrackFromPV = cms.EDProducer( "TrackFromPVSelector", srcTrack = cms.InputTag("ElIsoTracks"), + #srcTrack = cms.InputTag("packedPFCandidates"), srcVertex = cms.InputTag("ElBestPV"), max_dxy = cms.double(0.01), max_dz = cms.double(0.1) - ) +) -ElTrackCands = cms.EDProducer( - "ConcreteChargedCandidateProducer", - src = cms.InputTag("ElTrackFromPV"), - particleType = cms.string("e+") # this is needed to define a mass do not trust the sign, it is dummy - ) +#ElTrackCands = cms.EDProducer( +# #"ConcreteChargedCandidateProducer", +# "ConcreteChargedPFCandidateProducer", +# src = cms.InputTag("ElTrackFromPV"), +# particleType = cms.string("e+") # this is needed to define a mass do not trust the sign, it is dummy +#) ZeeCandElectronTrack = cms.EDProducer( "CandViewShallowCloneCombiner", - decay = cms.string("isolatedElectrons@+ ElTrackCands@-"), # it takes opposite sign collection, no matter if +- or -+ + #decay = cms.string("isolatedElectrons@+ ElTrackCands@-"), # it takes opposite sign collection, no matter if +- or -+ + decay = cms.string("isolatedElectrons@+ ElTrackFromPV@-"), # it takes opposite sign collection, no matter if +- or -+ cut = cms.string("80 < mass < 100") - ) +) BestZee = cms.EDProducer( "BestMassZArbitrationProducer", # returns the Z with mass closest to 91.18 GeV ZCandidateCollection = cms.InputTag("ZeeCandElectronTrack") - ) +) ElZLegs = cms.EDProducer( "CollectionFromZLegProducer", ZCandidateCollection = cms.InputTag("BestZee"), - ) +) procAttributes = dir(proc) #Takes a snapshot of what there in the process helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'RealElectronsData') #clones the sequence inside the process with RealElectronsData postfix @@ -145,13 +156,23 @@ for newAttr in newProcAttributes: locals()[newAttr] = getattr(proc,newAttr) -produceDenominatorRealElectronsData = cms.Sequence( cms.ignore(ElPrimaryVertexFilter) * ElBestPV * - ( (cms.ignore(selectedElectrons) * ElectronsFromPV * cms.ignore(idElectrons) * cms.ignore(trackElectrons) * cms.ignore(isolatedElectrons)) + - (cms.ignore(ElGoodTracks) * ElIsoTracks * ElTrackFromPV * ElTrackCands) ) * - ZeeCandElectronTrack * - BestZee * - ElZLegs - ) +produceDenominatorRealElectronsData = cms.Sequence( + cms.ignore(ElPrimaryVertexFilter) + * ElBestPV + * ( (cms.ignore(selectedElectrons) + * ElectronsFromPV + * cms.ignore(idElectrons) + * cms.ignore(trackElectrons) + * cms.ignore(isolatedElectrons)) + + ( + cms.ignore(ElGoodTracks) + * ElIsoTracks + * ElTrackFromPV )) +# * ElTrackCands )) + * ZeeCandElectronTrack + * BestZee + * ElZLegs +) produceDenominator = cms.Sequence(produceDenominatorRealElectronsData) diff --git a/Validation/RecoTau/python/dataTypes/ValidateTausOnRealMuonsData_cff.py b/Validation/RecoTau/python/dataTypes/ValidateTausOnRealMuonsData_cff.py index 29657eae8fe8f..a6ed9c0ce744e 100644 --- a/Validation/RecoTau/python/dataTypes/ValidateTausOnRealMuonsData_cff.py +++ b/Validation/RecoTau/python/dataTypes/ValidateTausOnRealMuonsData_cff.py @@ -7,7 +7,8 @@ MuPrimaryVertexFilter = cms.EDFilter( "VertexSelector", - src = cms.InputTag("offlinePrimaryVertices"), + #src = cms.InputTag("offlinePrimaryVertices"), + src = cms.InputTag("offlineSlimmedPrimaryVertices"), cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), filter = cms.bool(False) ) @@ -15,21 +16,24 @@ MuBestPV = cms.EDProducer( "HighestSumP4PrimaryVertexSelector", src = cms.InputTag("MuPrimaryVertexFilter") - ) +) selectedMuons = cms.EDFilter( - "MuonSelector", - src = cms.InputTag('muons'), + #"MuonSelector", + "TauValPatMuonSelector", + #src = cms.InputTag('muons'), + src = cms.InputTag('slimmedMuons'), cut = cms.string("pt > 20.0 && abs(eta) < 2.1 && isGlobalMuon = 1 && isTrackerMuon = 1"), filter = cms.bool(False) - ) +) selectedMuonsIso = cms.EDFilter( - "MuonSelector", + #"MuonSelector", + "TauValPatMuonSelector", src = cms.InputTag('selectedMuons'), cut = cms.string('(isolationR03().emEt + isolationR03().hadEt + isolationR03().sumPt)/pt < 0.15'), filter = cms.bool(False) - ) +) MuonsFromPV = cms.EDProducer( "MuonFromPVSelector", @@ -41,11 +45,14 @@ from SimGeneral.HepPDTESSource.pythiapdt_cfi import * -MuGoodTracks = cms.EDFilter("TrackSelector", - src = cms.InputTag("generalTracks"), +MuGoodTracks = cms.EDFilter( + #"TrackSelector", + "PFTrackSelector", + #src = cms.InputTag("generalTracks"), + src = cms.InputTag("packedPFCandidates"), cut = cms.string("pt > 5 && abs(eta) < 2.5"), filter = cms.bool(False) - ) +) MuIsoTracks = cms.EDProducer( "IsoTracks", @@ -62,17 +69,18 @@ max_dz = cms.double(0.1) ) -MuTrackCands = cms.EDProducer( - "ConcreteChargedCandidateProducer", - src = cms.InputTag("MuTrackFromPV"), - particleType = cms.string("mu+") # this is needed to define a mass - ) +#MuTrackCands = cms.EDProducer( +# "ConcreteChargedCandidateProducer", +# src = cms.InputTag("MuTrackFromPV"), +# particleType = cms.string("mu+") # this is needed to define a mass +# ) ZmmCandMuonTrack = cms.EDProducer( "CandViewShallowCloneCombiner", - decay = cms.string("MuonsFromPV@+ MuTrackCands@-"), # it takes opposite sign collection, no matter if +- or -+ + #decay = cms.string("MuonsFromPV@+ MuTrackCands@-"), # it takes opposite sign collection, no matter if +- or -+ + decay = cms.string("MuonsFromPV@+ MuTrackFromPV@-"), # it takes opposite sign collection, no matter if +- or -+ cut = cms.string("80 < mass < 100") - ) +) BestZmm = cms.EDProducer("BestMassZArbitrationProducer", # returns the Z with mass closer to 91.18 GeV ZCandidateCollection = cms.InputTag("ZmmCandMuonTrack") @@ -128,13 +136,19 @@ locals()[newAttr] = getattr(proc,newAttr) produceDenominatorRealMuonsData = cms.Sequence( - cms.ignore(MuPrimaryVertexFilter) * MuBestPV * - ( ( cms.ignore(selectedMuons) * cms.ignore(selectedMuonsIso) * MuonsFromPV ) + - ( cms.ignore(MuGoodTracks) * MuIsoTracks * MuTrackFromPV * MuTrackCands ) ) * - ZmmCandMuonTrack * - BestZmm * - MuZLegs - ) + cms.ignore(MuPrimaryVertexFilter) + * MuBestPV + * ( ( cms.ignore(selectedMuons) + * cms.ignore(selectedMuonsIso) + * MuonsFromPV ) + + ( cms.ignore(MuGoodTracks) + * MuIsoTracks + * MuTrackFromPV ) ) + #* MuTrackCands ) ) + * ZmmCandMuonTrack + * BestZmm + * MuZLegs +) produceDenominator = cms.Sequence(produceDenominatorRealMuonsData) diff --git a/Validation/RecoTau/src/TauValidationMiniAOD.cc b/Validation/RecoTau/src/TauValidationMiniAOD.cc index 92238a803248c..4090783001ad0 100644 --- a/Validation/RecoTau/src/TauValidationMiniAOD.cc +++ b/Validation/RecoTau/src/TauValidationMiniAOD.cc @@ -19,6 +19,8 @@ // Date: April 6th, 2020 // Updated By: Gourab Saha // Date: July 4th, 2023 +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" + #include "Validation/RecoTau/interface/TauValidationMiniAOD.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -39,6 +41,8 @@ TauValidationMiniAOD::TauValidationMiniAOD(const edm::ParameterSet &iConfig) { primaryVertexCollectionToken_ = consumes>(iConfig.getParameter("PVCollection")); // Input genetated particle collection: prunedGenToken_ = consumes>(iConfig.getParameter("GenCollection")); + // MC or Data + isMC_ = iConfig.getParameter("isMC"); } TauValidationMiniAOD::~TauValidationMiniAOD() {} @@ -62,6 +66,7 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, MonitorElement *dmMigration, *ntau_vs_dm; MonitorElement *pTOverProng_dm0, *pTOverProng_dm1p2, *pTOverProng_dm5, *pTOverProng_dm6, *pTOverProng_dm10, *pTOverProng_dm11; + MonitorElement *fractemp; // ---------------------------- Book, Map Summary Histograms ------------------------------- @@ -105,11 +110,12 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, mtau_dm11 = ibooker.book1D("mtau_dm11", "mtau: DM = 11", mtauHinfo.nbins, mtauHinfo.min, mtauHinfo.max); mtau_dm11Map.insert(std::make_pair("", mtau_dm11)); - dmMigration = ibooker.book2D("dmMigration", "DM Migration", 15, -0.5, 14.5, 15, -0.5, 14.5); - dmMigration->setXTitle("Generated tau DM"); - dmMigration->setYTitle("Reconstructed tau DM"); - dmMigrationMap.insert(std::make_pair("", dmMigration)); - + if (isMC_) { + dmMigration = ibooker.book2D("dmMigration", "DM Migration", 15, -0.5, 14.5, 15, -0.5, 14.5); + dmMigration->setXTitle("Generated tau DM"); + dmMigration->setYTitle("Reconstructed tau DM"); + dmMigrationMap.insert(std::make_pair("", dmMigration)); + } histoInfo pTOverProngHinfo = (histoSettings_.exists("pTOverProng")) ? histoInfo(histoSettings_.getParameter("pTOverProng")) : histoInfo(50, 0, 1000); @@ -268,10 +274,11 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, decayModeHinfo.max); decayModeMap.insert(std::make_pair("pftau", decayModeTemp)); - decayModeTemp = ibooker.book1D( - "tau_decayMode_gen", "DecayMode: Generated tau", decayModeHinfo.nbins, decayModeHinfo.min, decayModeHinfo.max); - decayModeMap.insert(std::make_pair("gentau", decayModeTemp)); - + if (isMC_) { + decayModeTemp = ibooker.book1D( + "tau_decayMode_gen", "DecayMode: Generated tau", decayModeHinfo.nbins, decayModeHinfo.min, decayModeHinfo.max); + decayModeMap.insert(std::make_pair("gentau", decayModeTemp)); + } // book the deepTau histograms byDeepTau2018v2p5VSerawTemp = ibooker.book1D("tau_byDeepTau2018v2p5VSeraw", "byDeepTau2018v2p5VSeraw", @@ -294,13 +301,34 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, byDeepTau2018v2p5VSjetrawMap.insert(std::make_pair("", byDeepTau2018v2p5VSjetrawTemp)); byDeepTau2018v2p5VSmurawMap.insert(std::make_pair("", byDeepTau2018v2p5VSmurawTemp)); + histoInfo fracInfo = histoInfo(25, 0.0, 1.0); + fractemp = ibooker.book1D("tau_emFraction", "EM Energy Fraction", fracInfo.nbins, fracInfo.min, fracInfo.max); + fracMap.insert( + std::make_pair("em", fractemp)); // TMath::Max(tau.ecalEnergy()/(tau.ecalEnergy() + tau.hcalEnergy()), float(0.)) + fractemp = ibooker.book1D("tau_hcFraction", "HCal Energy Fraction", fracInfo.nbins, fracInfo.min, fracInfo.max); + fracMap.insert( + std::make_pair("hc", fractemp)); // TMath::Max(tau.hcalEnergy()/(tau.ecalEnergy() + tau.hcalEnergy()), float(0.)) + //fractemp = ibooker.book1D("tau_emFraction_2", "EM Energy Fraction", fracInfo.nbins, fracInfo.min, fracInfo.max); + //fracMap.insert(std::make_pair("em_2", fractemp)); // tau.emFraction() + //fractemp = ibooker.book1D("tau_emFraction_3", "EM Energy Fraction", fracInfo.nbins, fracInfo.min, fracInfo.max); + //fracMap.insert(std::make_pair("em_3", fractemp)); // tau.emFraction_MVA() + + fractemp = ibooker.book1D("tau_hadrEoP", "", 50, 0.0, 5.0); + fracMap.insert(std::make_pair("hadrEoP", fractemp)); // tau.hcalEnergyLeadChargedHadrCand()/packedLeadTauCand->p() + + ptTemp = ibooker.book1D("tau_leadTrkPt", "Leading track pt", ptHinfo.nbins, ptHinfo.min, ptHinfo.max); + ptMap.insert(std::make_pair("leadTrkPt", ptTemp)); // tau.leadChargedHadrCand.pt() + qcd = "QCD"; - real_data = "RealData"; - real_eledata = "RealElectronsData"; - real_mudata = "RealMuonsData"; ztt = "ZTT"; zee = "ZEE"; zmm = "ZMM"; + real_data = "JETHT"; + real_eledata = "DoubleElectron"; + real_mudata = "DoubleMuon"; + //real_data = "RealData"; + //real_eledata = "RealElectronsData"; + //real_mudata = "RealMuonsData"; // ---------------------------- /vsJet/ --------------------------------------------- if (extensionName_.compare(qcd) == 0 || extensionName_.compare(real_data) == 0 || extensionName_.compare(ztt) == 0) { @@ -476,6 +504,7 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, } } void TauValidationMiniAOD::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { + std::cout<<" >>> TauValidationMiniAOD >>>"< taus; bool isTau = iEvent.getByToken(tauCollection_, taus); @@ -506,9 +535,10 @@ void TauValidationMiniAOD::analyze(const edm::Event &iEvent, const edm::EventSet std::vector GenTaus; // dR match reference object to tau - for (refCandidateCollection::const_iterator RefJet = ReferenceCollection->begin(); - RefJet != ReferenceCollection->end(); - RefJet++) { + //for (refCandidateCollection::const_iterator RefJet = ReferenceCollection->begin(); + // RefJet != ReferenceCollection->end(); + // RefJet++) { + for (const auto &RefJet : *ReferenceCollection) { float dRmin = 0.15; int matchedTauIndex = -99; float gendRmin = 0.15; @@ -518,12 +548,14 @@ void TauValidationMiniAOD::analyze(const edm::Event &iEvent, const edm::EventSet for (unsigned iTau = 0; iTau < taus->size(); iTau++) { pat::TauRef tau(taus, iTau); - float dR = deltaR2(tau->eta(), tau->phi(), RefJet->eta(), RefJet->phi()); + float dR = deltaR2(tau->eta(), tau->phi(), RefJet.eta(), RefJet.phi()); + //std::cout<second->Fill(taus->size(), matchedTau->decayMode()); + // energy fractions + fracMap.find("em")->second->Fill(matchedTau->ecalEnergy() / + (matchedTau->ecalEnergy() + matchedTau->hcalEnergy())); + //fracMap.find("em2")->second->Fill(matchedTau->emFraction()); + //fracMap.find("em3")->second->Fill(matchedTau->emFraction_MVA()); + fracMap.find("hc")->second->Fill(matchedTau->hcalEnergy() / + (matchedTau->ecalEnergy() + matchedTau->hcalEnergy())); + pat::PackedCandidate const *packedLeadTauCand = + dynamic_cast(matchedTau->leadChargedHadrCand().get()); + fracMap.find("hadrEoP")->second->Fill(matchedTau->hcalEnergyLeadChargedHadrCand() / packedLeadTauCand->p()); + ptMap.find("leadTrkPt")->second->Fill(matchedTau->leadChargedHadrCand()->pt()); + //Fill decay mode migration 2D histogragms //First do a gen Matching - unsigned genindex = 0; - for (const auto &genParticle : *genParticles) { - if (abs(genParticle.pdgId()) == 15) { - float gendR = deltaR2(matchedTau->eta(), matchedTau->phi(), genParticle.eta(), genParticle.phi()); - if (gendR < gendRmin) { - gendRmin = gendR; - genmatchedTauIndex = genindex; + if (isMC_) { + unsigned genindex = 0; + for (const auto &genParticle : *genParticles) { + if (abs(genParticle.pdgId()) == 15) { + float gendR = deltaR2(matchedTau->eta(), matchedTau->phi(), genParticle.eta(), genParticle.phi()); + if (gendR < gendRmin) { + gendRmin = gendR; + genmatchedTauIndex = genindex; + } } + genindex = genindex + 1; } - genindex = genindex + 1; - } - if (gendRmin < 0.15) { - int nPi0s = 0; - int nPis = 0; - auto &gentau = genParticles->at(genmatchedTauIndex); - for (unsigned idtr = 0; idtr < gentau.numberOfDaughters(); idtr++) { - const reco::GenParticle *dtr = dynamic_cast(gentau.daughter(idtr)); - int dtrpdgID = std::abs(dtr->pdgId()); - int dtrstatus = dtr->status(); - if (dtrpdgID == 12 || dtrpdgID == 14 || dtrpdgID == 16) - continue; - if (dtrpdgID == 111 || dtrpdgID == 311) - nPi0s++; - else if (dtrpdgID == 211 || dtrpdgID == 321) - nPis++; - else if (dtrpdgID == 15 && dtrstatus == 2 /*&& dtr->isLastCopy()*/) { - for (unsigned idtr2 = 0; idtr2 < dtr->numberOfDaughters(); idtr2++) { - const reco::GenParticle *dtr2 = dynamic_cast(dtr->daughter(idtr2)); - int dtr2pdgID = std::abs(dtr2->pdgId()); - if (dtr2pdgID == 12 || dtr2pdgID == 14 || dtr2pdgID == 16) - continue; - if (dtr2pdgID == 111 || dtr2pdgID == 311) - nPi0s++; - else if (dtr2pdgID == 211 || dtr2pdgID == 321) - nPis++; + if (gendRmin < 0.15) { + int nPi0s = 0; + int nPis = 0; + auto &gentau = genParticles->at(genmatchedTauIndex); + for (unsigned idtr = 0; idtr < gentau.numberOfDaughters(); idtr++) { + const reco::GenParticle *dtr = dynamic_cast(gentau.daughter(idtr)); + int dtrpdgID = std::abs(dtr->pdgId()); + int dtrstatus = dtr->status(); + if (dtrpdgID == 12 || dtrpdgID == 14 || dtrpdgID == 16) + continue; + if (dtrpdgID == 111 || dtrpdgID == 311) + nPi0s++; + else if (dtrpdgID == 211 || dtrpdgID == 321) + nPis++; + else if (dtrpdgID == 15 && dtrstatus == 2 /*&& dtr->isLastCopy()*/) { + for (unsigned idtr2 = 0; idtr2 < dtr->numberOfDaughters(); idtr2++) { + const reco::GenParticle *dtr2 = dynamic_cast(dtr->daughter(idtr2)); + int dtr2pdgID = std::abs(dtr2->pdgId()); + if (dtr2pdgID == 12 || dtr2pdgID == 14 || dtr2pdgID == 16) + continue; + if (dtr2pdgID == 111 || dtr2pdgID == 311) + nPi0s++; + else if (dtr2pdgID == 211 || dtr2pdgID == 321) + nPis++; + } } } + int genTau_dm = findDecayMode(nPis, nPi0s); + decayModeMap.find("gentau")->second->Fill(genTau_dm); + dmMigrationMap.find("")->second->Fill(genTau_dm, matchedTau->decayMode()); } - int genTau_dm = findDecayMode(nPis, nPi0s); - decayModeMap.find("gentau")->second->Fill(genTau_dm); - dmMigrationMap.find("")->second->Fill(genTau_dm, matchedTau->decayMode()); } - // count number of taus passing each discriminator's selection cut unsigned j = 0; for (const auto &it : discriminators_) { diff --git a/Validation/RecoTau/test/config.py b/Validation/RecoTau/test/config.py index 4845fbca03b1a..ffe5d6f963562 100644 --- a/Validation/RecoTau/test/config.py +++ b/Validation/RecoTau/test/config.py @@ -10,57 +10,92 @@ process = cms.Process('DQM',Run3_2023) # import of standard configurations -#process.load('Configuration.StandardSequences.Services_cff') -#process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') -#process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -#process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Validation.RecoTau.RecoTauValidation_cff') process.load('DQMServices.Core.DQMStoreNonLegacy_cff') process.load('DQMOffline.Configuration.DQMOfflineMC_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') - -#process.load("Configuration.Generator.ZTT_Tauola_All_hadronic_cfi") -#process.load("Configuration.Generator.QCDForPF_cfi") - -#process.load('Validation.RecoJets.JetValidation_cff') process.load('RecoJets.Configuration.RecoGenJets_cff') process.load('RecoJets.Configuration.GenJetParticles_cff') -#process.load('Validation.RecoMET.METRelValForDQM_cff') -#process.load('Validation.RecoParticleFlow.miniAODValidation_cff') -#process.load('Validation.EventGenerator.BasicGenValidation_cff') -#process.load('Validation.RecoTau.dataTypes.ValidateTausOnQCD_cff') - -#process.load('Configuration.StandardSequences.Validation_cff') process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(8500), + input = cms.untracked.int32(100), #-1 output = cms.optional.untracked.allowed(cms.int32,cms.PSet) ) -process.options = cms.untracked.PSet( - TryToContinue = cms.untracked.vstring('ProductNotFound') -) - -process_name='ZTT' - -process_dict = { -'ZMM':'/store/relval/CMSSW_11_0_0_pre10/RelValZMM_13/MINIAODSIM/110X_mcRun2_asymptotic_v2-v1/10000/2085AB00-3B9C-664F-A31A-32852CE6F284.root', -'ZEE':'/store/relval/CMSSW_11_0_0_pre10/RelValZEE_13/MINIAODSIM/110X_mcRun2_asymptotic_v2-v1/10000/639D8BE1-8DCC-9145-A38B-7B3CCEE0333A.root', -'ZTT':'/store/relval/CMSSW_13_1_0_pre1/RelValZTT_13p6/MINIAODSIM/130X_mcRun3_2022_realistic_withNewBSFromEOY2022Data_v2_RV186-v1/00000/8b30e3ad-da95-4256-894f-d5bc3a4e26af.root', # new -'QCD':'/store/relval/CMSSW_11_0_0_pre10/RelValQCD_FlatPt_15_3000HS_13/MINIAODSIM/110X_mcRun2_asymptotic_v2-v1/10000/91461CFA-8CEF-8C4E-864D-FFC1760FAC67.root' +#https://github.com/cms-sw/cmssw/issues/43793#issuecomment-1912388830 +#process.options = cms.untracked.PSet( +# TryToContinue = cms.untracked.vstring('ProductNotFound') +#) + +#process_name='QCD' +#process_name='ZTT' +#process_name='ZEE' +#process_name='ZMM' +process_name='JETHT' +#process_name='DoubleElectron' +#process_name='DoubleMuon' + +process_dict ={ + 'ZMM':[ + #'/store/relval/CMSSW_13_0_11/RelValZMM_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/c1f4789f-0143-4c1c-8c5b-4737ece99548.root', + '/store/relval/CMSSW_13_0_11/RelValZMM_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/6fb27712-4897-4b5c-8eea-4d04f9f88fca.root', + '/store/relval/CMSSW_13_0_11/RelValZMM_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/ddb0422f-d759-40ec-888c-82dfddc8d2d3.root', + ], + 'ZEE':[ + #'/store/relval/CMSSW_13_0_11/RelValZEE_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/98dd45f2-b2a6-4037-9d12-850dee82abff.root', + '/store/relval/CMSSW_13_0_11/RelValZEE_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/ba2f4c0e-a874-42cb-8750-5bce8a6a86f8.root', + '/store/relval/CMSSW_13_0_11/RelValZEE_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/f3e2bb4d-5988-42fa-800c-06556f1f02bd.root', + ], + 'ZTT':[ + #ttbar_relval_23_v1 + #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v1/2590000/69c3b054-bd07-4178-9481-14f04f79ca95.root", + #ttbar_relval_23_v2 + "/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/02c835ae-8352-4759-b908-0aca15feb36d.root", + #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/3f2b92d6-3fb1-456b-92db-e1c65ad0d29e.root", + #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/9f2d1acd-f33a-4199-b800-92076e327deb.root", + #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/d6e551c5-462a-4466-9689-77e665bd25df.root", + #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/e24e6546-95b7-4125-90b3-d33b56ffad25.root", + ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/433751c7-b9a1-4036-b1c8-668e679db182.root', + ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/c048525f-000d-4fb5-9694-78d73e9e15f5.root', + ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/2ced95d2-ebcc-4456-abaa-736aade50b0f.root', + ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/39aac844-e272-4df6-b354-2e07de7039eb.root', + ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/713106b9-62a3-40ea-a541-a2bad98e1171.root', + ], + 'QCD':[ + '/store/relval/CMSSW_11_0_0_pre10/RelValQCD_FlatPt_15_3000HS_13/MINIAODSIM/110X_mcRun2_asymptotic_v2-v1/10000/91461CFA-8CEF-8C4E-864D-FFC1760FAC67.root' + ], + 'JETHT':[ + "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/277b3a14-ab60-49c6-bcb1-81eedf109f5d.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/7ceb4e30-fb58-4de1-823d-0178aca37c46.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/9387a49c-c7f5-4109-9be1-4412b1dcb92f.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/96bb89e2-2cba-4fd3-9141-89796e992f4c.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/e7a4213b-a29b-40ca-8cce-f60bb318caae.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/24a6b480-1c8d-44f8-b164-6c1aca5747a9.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/5d43bdf0-616a-42c6-9453-5450733c9760.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/cffa86eb-c969-4115-beaa-d45ffb3ff872.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/da5b4f4c-1e45-41de-8021-8f62f4277bcf.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/ff03336f-2497-4992-8e85-927366556650.root", + #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/790/00000/7e8d23ef-950b-41d6-8c6b-1806ee265c03.root", + ], + 'DoubleElectron':[ + "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/9387a49c-c7f5-4109-9be1-4412b1dcb92f.root", + ], + 'DoubleMuon':[ + "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/9387a49c-c7f5-4109-9be1-4412b1dcb92f.root", + ], } # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring(process_dict[process_name]), + fileNames = cms.untracked.vstring(*process_dict[process_name]), secondaryFileNames = cms.untracked.vstring() ) # Production Info process.configurationMetadata = cms.untracked.PSet( - annotation = cms.untracked.string('PAT nevts:9000'), + annotation = cms.untracked.string('PAT nevts:100'), name = cms.untracked.string('Applications'), version = cms.untracked.string('$Revision: 1.19 $') ) @@ -83,7 +118,8 @@ # Path and EndPath definitions #process.prevalidation_step = cms.Path(process.prevalidationMiniAOD) #process.validation_step = cms.EndPath(process.validationMiniAOD) -process.validation_step = cms.EndPath(process.tauValidationSequenceMiniAOD) +#process.validation_step = cms.EndPath(process.tauValidationSequenceMiniAOD) +process.validation_step = cms.EndPath(process.tauValidationSequenceMiniAODonMC) if process_name in ["ZTT", "ZMM", "ZEE", "QCD"] else cms.EndPath(process.tauValidationSequenceMiniAODonDATA) #process.validation_step = cms.EndPath(process.tauValidationMiniAODRealData) #process.validation_step = cms.EndPath(process.tauValidationMiniAODZMM) #process.dqmoffline_step = cms.EndPath(process.DQMOfflineMiniAOD) diff --git a/Validation/RecoTau/test/harvesting.py b/Validation/RecoTau/test/harvesting.py index 55a4f67944d16..796bf9e41778a 100644 --- a/Validation/RecoTau/test/harvesting.py +++ b/Validation/RecoTau/test/harvesting.py @@ -9,7 +9,7 @@ process = cms.Process('HARVESTING',Run3_2023) -process_name = 'ZTT' +process_name = 'JETHT' # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -34,9 +34,10 @@ ) process.options = cms.untracked.PSet( + #FailPath = cms.untracked.vstring(), IgnoreCompletely = cms.untracked.vstring(), Rethrow = cms.untracked.vstring('ProductNotFound'), - TryToContinue = cms.untracked.vstring(), + #SkipEvent = cms.untracked.vstring(), accelerators = cms.untracked.vstring('*'), allowUnscheduled = cms.obsolete.untracked.bool, canDeleteEarly = cms.untracked.vstring(), From 2ca87f87fcb64e79399743a004967d17781a071a Mon Sep 17 00:00:00 2001 From: gourab saha Date: Tue, 20 Feb 2024 15:41:02 +0100 Subject: [PATCH 2/4] remove cout --- Validation/RecoTau/src/TauValidationMiniAOD.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/Validation/RecoTau/src/TauValidationMiniAOD.cc b/Validation/RecoTau/src/TauValidationMiniAOD.cc index 4090783001ad0..59404b3eb82db 100644 --- a/Validation/RecoTau/src/TauValidationMiniAOD.cc +++ b/Validation/RecoTau/src/TauValidationMiniAOD.cc @@ -504,7 +504,6 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, } } void TauValidationMiniAOD::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { - std::cout<<" >>> TauValidationMiniAOD >>>"< taus; bool isTau = iEvent.getByToken(tauCollection_, taus); From 7b562f93b00353cf9489b496737b876d7ca5f1d5 Mon Sep 17 00:00:00 2001 From: gourab saha Date: Sat, 22 Jun 2024 00:00:20 +0200 Subject: [PATCH 3/4] TauValidation for Data in dqm and MC in validation --- .../python/Validation_cff.py | 6 ++- .../Configuration/python/DQMOfflineFS_cff.py | 6 +-- .../Configuration/python/DQMOfflineMC_cff.py | 3 ++ .../python/DQMOffline_SecondStep_cff.py | 2 +- .../Configuration/python/DQMOffline_cff.py | 28 ++++++++------ .../RecoTau/python/DQMMCValidation_cfi.py | 37 ++----------------- Validation/RecoTau/python/DQMSequences_cfi.py | 19 +++------- .../RecoTau/python/RecoTauValidation_cff.py | 14 +++---- .../RecoTau/src/TauValidationMiniAOD.cc | 5 +-- 9 files changed, 45 insertions(+), 75 deletions(-) diff --git a/Configuration/StandardSequences/python/Validation_cff.py b/Configuration/StandardSequences/python/Validation_cff.py index 066c33013fca0..2f76a66c20c26 100644 --- a/Configuration/StandardSequences/python/Validation_cff.py +++ b/Configuration/StandardSequences/python/Validation_cff.py @@ -84,7 +84,11 @@ validationLiteTracking.replace(globalValidation,globalValidationLiteTracking) validationLiteTracking.remove(condDataValidation) -validationMiniAOD = cms.Sequence(type0PFMEtCorrectionPFCandToVertexAssociationForValidationMiniAOD * JetValidationMiniAOD * METValidationMiniAOD * tauValidationSequenceMiniAOD * bTagMiniValidationSource) +validationMiniAOD = cms.Sequence(type0PFMEtCorrectionPFCandToVertexAssociationForValidationMiniAOD + * JetValidationMiniAOD + * METValidationMiniAOD + * tauValidationSequenceMiniAODonMC + * bTagMiniValidationSource) prevalidation_preprod = cms.Sequence( preprodPrevalidation ) diff --git a/DQMOffline/Configuration/python/DQMOfflineFS_cff.py b/DQMOffline/Configuration/python/DQMOfflineFS_cff.py index ca3c0b0ade521..fc5182035bd90 100644 --- a/DQMOffline/Configuration/python/DQMOfflineFS_cff.py +++ b/DQMOffline/Configuration/python/DQMOfflineFS_cff.py @@ -11,10 +11,8 @@ DQMOfflinePrePOG = cms.Sequence( pvMonitor * bTagPlotsDATA * - dqmPhysics * - produceDenomsData * - pfTauRunDQMValidation - ) + dqmPhysics +) # Fix Jet Corrector in FastSim topSingleMuonMediumDQM.setup.jetExtras.jetCorrector = cms.InputTag("ak4PFCHSL1FastL2L3Corrector") diff --git a/DQMOffline/Configuration/python/DQMOfflineMC_cff.py b/DQMOffline/Configuration/python/DQMOfflineMC_cff.py index 29786e5d0d0de..1747c24c7ba0b 100644 --- a/DQMOffline/Configuration/python/DQMOfflineMC_cff.py +++ b/DQMOffline/Configuration/python/DQMOfflineMC_cff.py @@ -35,3 +35,6 @@ #PostDQMOfflineNanoAOD.replace(nanoDQM, nanoDQMMC) from PhysicsTools.NanoAOD.nanojmeDQM_cff import nanojmeDQMMC DQMOfflineNanoJME.replace(nanojmeDQM, nanojmeDQMMC) + +# Remove data seq for MC [already in Validation] +PostDQMOfflineMiniAOD.remove(DQMOfflineTAU) diff --git a/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py b/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py index e35df7d8f08a7..e9374ac5fa11b 100644 --- a/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py +++ b/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py @@ -271,6 +271,6 @@ from Validation.RecoParticleFlow.DQMForPF_MiniAOD_cff import * from DQMOffline.RecoB.bTagMiniDQM_cff import * -DQMHarvestMiniAOD = cms.Sequence( dataCertificationJetMETSequence * muonQualityTests_miniAOD * DQMHarvestPF * bTagMiniDQMHarvesting) +DQMHarvestMiniAOD = cms.Sequence( dataCertificationJetMETSequence * muonQualityTests_miniAOD * DQMHarvestPF * bTagMiniDQMHarvesting * DQMHarvestTAU) DQMHarvestNanoAOD = cms.Sequence( nanoHarvest ) diff --git a/DQMOffline/Configuration/python/DQMOffline_cff.py b/DQMOffline/Configuration/python/DQMOffline_cff.py index 1adbfe40a9677..6f8141315eced 100644 --- a/DQMOffline/Configuration/python/DQMOffline_cff.py +++ b/DQMOffline/Configuration/python/DQMOffline_cff.py @@ -208,7 +208,6 @@ #DQMOfflineCommon from DQM.TrackingMonitorSource.pixelTracksMonitoring_cff import * from DQMOffline.RecoB.PixelVertexMonitor_cff import * -from Validation.RecoTau.DQMSequences_cfi import * DQMOfflinePixelTracking = cms.Sequence( pixelTracksMonitoring * pixelPVMonitor * @@ -222,9 +221,6 @@ DQMOfflineTrackerPhase2 = cms.Sequence( trackerphase2DQMSource ) -DQMOfflineTAU = cms.Sequence( produceDenomsData * - pfTauRunDQMValidation ) - DQMOfflineTrackerStripCommon = cms.Sequence( SiStripDQMTier0Common ) DQMOfflineTrackerPixel = cms.Sequence( siPixelOfflineDQM_source ) @@ -237,8 +233,7 @@ DQMOfflineTrigger * DQMOfflineBeam * DQMOfflineCASTOR * - DQMOfflinePhysics * - DQMOfflineTAU + DQMOfflinePhysics ) DQMOfflineCommonFakeHLT = cms.Sequence( DQMOfflineCommon ) @@ -282,11 +277,6 @@ _run3_GEM_DQMOfflineMuon += gemSources run3_GEM.toReplaceWith(DQMOfflineMuon, _run3_GEM_DQMOfflineMuon) -#Taus not created in pp conditions for HI -from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA -_DQMOfflineTAU = cms.Sequence() -pp_on_AA.toReplaceWith(DQMOfflineTAU, _DQMOfflineTAU) - # miniAOD DQM validation from Validation.RecoParticleFlow.miniAODDQM_cff import * # On MiniAOD vs RECO @@ -295,13 +285,27 @@ from DQMOffline.RecoB.bTagMiniDQM_cff import * from DQMOffline.Muon.miniAOD_cff import * from DQM.Physics.DQMTopMiniAOD_cff import * +from Validation.RecoTau.DQMSequences_cfi import * + +DQMOfflineTAU = cms.Sequence( produceDenomsData * + pfTauRunDQMValidation ) + +#Taus not created in pp conditions for HI +from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA +_DQMOfflineTAU = cms.Sequence() +pp_on_AA.toReplaceWith(DQMOfflineTAU, _DQMOfflineTAU) + DQMOfflineMiniAOD = cms.Sequence(jetMETDQMOfflineRedoProductsMiniAOD*bTagMiniDQMSource*muonMonitors_miniAOD*MuonMiniAOD*DQMOfflinePF) #Post sequences are automatically placed in the EndPath by ConfigBuilder if PAT is run. #miniAOD DQM sequences need to access the filter results. -PostDQMOfflineMiniAOD = cms.Sequence(miniAODDQMSequence*jetMETDQMOfflineSourceMiniAOD*tracksDQMMiniAOD*topPhysicsminiAOD) +PostDQMOfflineMiniAOD = cms.Sequence(miniAODDQMSequence + * jetMETDQMOfflineSourceMiniAOD + * tracksDQMMiniAOD + * topPhysicsminiAOD + * DQMOfflineTAU) PostDQMOffline = cms.Sequence() from Configuration.Eras.Modifier_run3_HB_cff import run3_HB diff --git a/Validation/RecoTau/python/DQMMCValidation_cfi.py b/Validation/RecoTau/python/DQMMCValidation_cfi.py index 71e8a1421a331..925036bc2bd79 100644 --- a/Validation/RecoTau/python/DQMMCValidation_cfi.py +++ b/Validation/RecoTau/python/DQMMCValidation_cfi.py @@ -23,9 +23,9 @@ produceDenoms = cms.Sequence( produceDenominatorQCD+ - produceDenominatorRealData+ - produceDenominatorRealElectronsData+ - produceDenominatorRealMuonsData+ + #produceDenominatorRealData+ + #produceDenominatorRealElectronsData+ + #produceDenominatorRealMuonsData+ produceDenominatorZEE+ produceDenominatorZMM+ produceDenominatorZTT @@ -34,40 +34,11 @@ fastSim.toReplaceWith(produceDenoms,produceDenoms.copyAndExclude([produceDenominatorRealData,produceDenominatorRealElectronsData,produceDenominatorRealMuonsData])) runTauEff = cms.Sequence( - #efficienciesQCD+ - #efficienciesQCDSummary+ - #efficienciesRealData+ - #efficienciesRealDataSummary+ - #efficienciesRealElectronsData+ - #efficienciesRealElectronsDataSummary+ - #efficienciesRealMuonsData+ - #efficienciesRealMuonsDataSummary+ - #efficienciesZEE+ - #efficienciesZEESummary+ - #efficienciesZMM+ - #efficienciesZMMSummary+ - #efficienciesZTT+ - #efficienciesZTTSummary+ efficienciesTauValidationMiniAODZTT+ efficienciesTauValidationMiniAODZEE+ efficienciesTauValidationMiniAODZMM+ - efficienciesTauValidationMiniAODQCD+ - efficienciesTauValidationMiniAODRealData+ - efficienciesTauValidationMiniAODRealElectronsData+ - efficienciesTauValidationMiniAODRealMuonsData + efficienciesTauValidationMiniAODQCD #normalizePlotsZTT ) -##Full sequences, including normalizations -## TauEfficienciesQCD+ -## TauEfficienciesRealData+ -## TauEfficienciesRealElectronsData+ -## TauEfficienciesRealMuonsData+ -## TauEfficienciesZEEFastSim+ -## TauEfficienciesZEE+ -## TauEfficienciesZMM+ -## TauEfficienciesZTTFastSim+ -## TauEfficienciesZTT - - makeBetterPlots = cms.Sequence() #Not used anymore/by now diff --git a/Validation/RecoTau/python/DQMSequences_cfi.py b/Validation/RecoTau/python/DQMSequences_cfi.py index 44a743f12acfe..04fce78f9ba11 100644 --- a/Validation/RecoTau/python/DQMSequences_cfi.py +++ b/Validation/RecoTau/python/DQMSequences_cfi.py @@ -9,7 +9,6 @@ subSystemFolder = cms.untracked.string('RecoTauV') ) - produceDenomsData = cms.Sequence( produceDenominatorRealData+ produceDenominatorRealElectronsData+ @@ -27,19 +26,11 @@ # Standard validation is not required anymore pfTauRunDQMValidation = cms.Sequence( - #TauValNumeratorAndDenominatorRealData+ - #TauValNumeratorAndDenominatorRealElectronsData+ - #TauValNumeratorAndDenominatorRealMuonsData+ + tauValidationSequenceMiniAODonDATA #dqmInfoTauV ) runTauEff = cms.Sequence( - #efficienciesRealData+ - #efficienciesRealDataSummary+ - #efficienciesRealElectronsData+ - #efficienciesRealElectronsDataSummary+ - #efficienciesRealMuonsData+ - #efficienciesRealMuonsDataSummary+ efficienciesTauValidationMiniAODRealData +efficienciesTauValidationMiniAODRealElectronsData +efficienciesTauValidationMiniAODRealMuonsData @@ -53,6 +44,7 @@ ## produceDenominatorRealData+ ## produceDenominatorRealMuonsData ## ) +""" produceDenomsSingleMu = cms.Sequence( produceDenominatorRealData+ produceDenominatorRealMuonsData @@ -62,12 +54,12 @@ produceDenomsDoubleElectron = cms.Sequence(produceDenominatorRealElectronsData) produceDenomsTauPlusX = cms.Sequence(produceDenomsDoubleElectron) - +""" #---------------------------------------------------------------------------------------------------------------------------------------- # Main modules according to dataset #---------------------------------------------------------------------------------------------------------------------------------------- -proc.GeneralMuSequence = cms.Sequence( proc.TauValNumeratorAndDenominatorRealData * proc.TauValNumeratorAndDenominatorRealMuonsData ) +#proc.GeneralMuSequence = cms.Sequence( proc.TauValNumeratorAndDenominatorRealData * proc.TauValNumeratorAndDenominatorRealMuonsData ) #Mu Dataset ## procAttributes = dir(proc) #Takes a snapshot of what there in the process @@ -85,7 +77,7 @@ ## TauValNumeratorAndDenominatorRealMuonsDataAtMu+ ## dqmInfoTauV ## ) - +""" #SingleMu Dataset procAttributes = dir(proc) #Takes a snapshot of what there in the process helpers.cloneProcessingSnippet( proc, proc.GeneralMuSequence, 'AtSingleMu') #clones the sequence inside the process with AtSingleMu postfix @@ -190,3 +182,4 @@ ## TauEfficienciesRealData+ ## TauEfficienciesRealElectronsData+ ## TauEfficienciesRealMuonsData +""" diff --git a/Validation/RecoTau/python/RecoTauValidation_cff.py b/Validation/RecoTau/python/RecoTauValidation_cff.py index 2af02c5df5265..2f761001a54e1 100644 --- a/Validation/RecoTau/python/RecoTauValidation_cff.py +++ b/Validation/RecoTau/python/RecoTauValidation_cff.py @@ -126,25 +126,25 @@ ) tauValidationSequenceMiniAOD = cms.Sequence( - # --ZTT + ## --ZTT produceDenominatorZTT *tauValidationMiniAODZTT - # --ZEE + ## --ZEE *produceDenominatorZEE *tauValidationMiniAODZEE - # --ZMM + ## --ZMM *produceDenominatorZMM *tauValidationMiniAODZMM - # --QCD + ## --QCD *produceDenominatorQCD *tauValidationMiniAODQCD - # --RealData + ## --RealData *produceDenominatorRealData *tauValidationMiniAODRealData - # --RealElectronData + ## --RealElectronData *produceDenominatorRealElectronsData *tauValidationMiniAODRealElectronsData - # --RealMuonData + ## --RealMuonData *produceDenominatorRealMuonsData *tauValidationMiniAODRealMuonsData ) diff --git a/Validation/RecoTau/src/TauValidationMiniAOD.cc b/Validation/RecoTau/src/TauValidationMiniAOD.cc index 59404b3eb82db..63ba94f454335 100644 --- a/Validation/RecoTau/src/TauValidationMiniAOD.cc +++ b/Validation/RecoTau/src/TauValidationMiniAOD.cc @@ -211,7 +211,7 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, // pt, eta, phi, mass, pileup histoInfo ptHinfo = (histoSettings_.exists("pt")) ? histoInfo(histoSettings_.getParameter("pt")) - : histoInfo(200, 0., 1000.); + : histoInfo(300, 0., 1500.); histoInfo etaHinfo = (histoSettings_.exists("eta")) ? histoInfo(histoSettings_.getParameter("eta")) : histoInfo(60, -3, 3.); histoInfo phiHinfo = (histoSettings_.exists("phi")) ? histoInfo(histoSettings_.getParameter("phi")) @@ -326,9 +326,6 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, real_data = "JETHT"; real_eledata = "DoubleElectron"; real_mudata = "DoubleMuon"; - //real_data = "RealData"; - //real_eledata = "RealElectronsData"; - //real_mudata = "RealMuonsData"; // ---------------------------- /vsJet/ --------------------------------------------- if (extensionName_.compare(qcd) == 0 || extensionName_.compare(real_data) == 0 || extensionName_.compare(ztt) == 0) { From 9e45bf60bc10955f9b36ea1dfad4f30a5626b266 Mon Sep 17 00:00:00 2001 From: gourab saha Date: Sun, 23 Jun 2024 16:31:23 +0200 Subject: [PATCH 4/4] change binning --- Validation/RecoTau/src/TauValidationMiniAOD.cc | 12 ++++++------ Validation/RecoTau/test/config.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Validation/RecoTau/src/TauValidationMiniAOD.cc b/Validation/RecoTau/src/TauValidationMiniAOD.cc index 63ba94f454335..9abbd14b0f888 100644 --- a/Validation/RecoTau/src/TauValidationMiniAOD.cc +++ b/Validation/RecoTau/src/TauValidationMiniAOD.cc @@ -118,7 +118,7 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, } histoInfo pTOverProngHinfo = (histoSettings_.exists("pTOverProng")) ? histoInfo(histoSettings_.getParameter("pTOverProng")) - : histoInfo(50, 0, 1000); + : histoInfo(200, 0, 1000); pTOverProng_dm0 = ibooker.book2D("pTOverProng_dm0", "pTOverProng: DM = 0", @@ -213,9 +213,9 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, histoInfo ptHinfo = (histoSettings_.exists("pt")) ? histoInfo(histoSettings_.getParameter("pt")) : histoInfo(300, 0., 1500.); histoInfo etaHinfo = (histoSettings_.exists("eta")) ? histoInfo(histoSettings_.getParameter("eta")) - : histoInfo(60, -3, 3.); + : histoInfo(30, -3, 3.); histoInfo phiHinfo = (histoSettings_.exists("phi")) ? histoInfo(histoSettings_.getParameter("phi")) - : histoInfo(60, -3, 3.); + : histoInfo(30, -3, 3.); histoInfo massHinfo = (histoSettings_.exists("mass")) ? histoInfo(histoSettings_.getParameter("mass")) : histoInfo(200, 0, 10.); @@ -235,15 +235,15 @@ void TauValidationMiniAOD::bookHistograms(DQMStore::IBooker &ibooker, histoInfo byDeepTau2018v2p5VSerawHinfo = (histoSettings_.exists("byDeepTau2018v2p5VSeraw")) ? histoInfo(histoSettings_.getParameter("byDeepTau2018v2p5VSeraw")) - : histoInfo(200, 0., 1.); + : histoInfo(50, 0., 1.); histoInfo byDeepTau2018v2p5VSjetrawHinfo = (histoSettings_.exists("byDeepTau2018v2p5VSjetraw")) ? histoInfo(histoSettings_.getParameter("byDeepTau2018v2p5VSjetraw")) - : histoInfo(200, 0., 1.); + : histoInfo(50, 0., 1.); histoInfo byDeepTau2018v2p5VSmurawHinfo = (histoSettings_.exists("byDeepTau2018v2p5VSmuraw")) ? histoInfo(histoSettings_.getParameter("byDeepTau2018v2p5VSmuraw")) - : histoInfo(200, 0., 1.); + : histoInfo(50, 0., 1.); // book the temp histograms ptTemp = ibooker.book1D("tau_pt", "tau pt", ptHinfo.nbins, ptHinfo.min, ptHinfo.max); diff --git a/Validation/RecoTau/test/config.py b/Validation/RecoTau/test/config.py index ffe5d6f963562..579b85468ddc7 100644 --- a/Validation/RecoTau/test/config.py +++ b/Validation/RecoTau/test/config.py @@ -21,7 +21,7 @@ process.load('RecoJets.Configuration.GenJetParticles_cff') process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(100), #-1 + input = cms.untracked.int32(-1), #100 output = cms.optional.untracked.allowed(cms.int32,cms.PSet) ) @@ -53,13 +53,13 @@ #ttbar_relval_23_v1 #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v1/2590000/69c3b054-bd07-4178-9481-14f04f79ca95.root", #ttbar_relval_23_v2 - "/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/02c835ae-8352-4759-b908-0aca15feb36d.root", + #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/02c835ae-8352-4759-b908-0aca15feb36d.root", #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/3f2b92d6-3fb1-456b-92db-e1c65ad0d29e.root", #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/9f2d1acd-f33a-4199-b800-92076e327deb.root", #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/d6e551c5-462a-4466-9689-77e665bd25df.root", #"/store/relval/CMSSW_13_0_11/RelValTTbar_14TeV/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV204-v2/2590000/e24e6546-95b7-4125-90b3-d33b56ffad25.root", - ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/433751c7-b9a1-4036-b1c8-668e679db182.root', - ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/c048525f-000d-4fb5-9694-78d73e9e15f5.root', + '/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/433751c7-b9a1-4036-b1c8-668e679db182.root', + '/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v1/2580000/c048525f-000d-4fb5-9694-78d73e9e15f5.root', ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/2ced95d2-ebcc-4456-abaa-736aade50b0f.root', ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/39aac844-e272-4df6-b354-2e07de7039eb.root', ##'/store/relval/CMSSW_13_0_11/RelValZTT_14/MINIAODSIM/PU_130X_mcRun3_2023_realistic_relvals2023D_v1_RV208-v2/2580000/713106b9-62a3-40ea-a541-a2bad98e1171.root', @@ -69,10 +69,10 @@ ], 'JETHT':[ "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/277b3a14-ab60-49c6-bcb1-81eedf109f5d.root", - #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/7ceb4e30-fb58-4de1-823d-0178aca37c46.root", - #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/9387a49c-c7f5-4109-9be1-4412b1dcb92f.root", - #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/96bb89e2-2cba-4fd3-9141-89796e992f4c.root", - #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/e7a4213b-a29b-40ca-8cce-f60bb318caae.root", + "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/7ceb4e30-fb58-4de1-823d-0178aca37c46.root", + "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/9387a49c-c7f5-4109-9be1-4412b1dcb92f.root", + "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/96bb89e2-2cba-4fd3-9141-89796e992f4c.root", + "/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/775/00000/e7a4213b-a29b-40ca-8cce-f60bb318caae.root", #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/24a6b480-1c8d-44f8-b164-6c1aca5747a9.root", #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/5d43bdf0-616a-42c6-9453-5450733c9760.root", #"/store/data/Run2023D/Tau/MINIAOD/PromptReco-v2/000/370/776/00000/cffa86eb-c969-4115-beaa-d45ffb3ff872.root",