From 464aa98159f41f4f09b7874871e4091f70f0a352 Mon Sep 17 00:00:00 2001 From: Claudio Date: Fri, 23 Oct 2015 18:46:36 +0200 Subject: [PATCH] Improving SyncTreeProduce 1.1 TreeProduction ntuple successfully integrated Added a new process in the electronID_cfg --- TreeProduction/interface/Tau.h | 2 +- .../plugins/SyncTreeProducer.cc | 27 ++++++++++--------- microAODProduction/python/electronID_cfg.py | 24 ++++++++++++++++- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/TreeProduction/interface/Tau.h b/TreeProduction/interface/Tau.h index 6dd969c6..bb9025fe 100644 --- a/TreeProduction/interface/Tau.h +++ b/TreeProduction/interface/Tau.h @@ -96,7 +96,7 @@ /* Trigger match information */ \ VECTOR_VAR(std::string, matchedTriggerPaths) \ /* tau discriminators */ \ - NEW_TAU_DISCRIMINATOR_DATA() \ + TAU_DISCRIMINATOR_DATA() \ /**/ // new TauID diff --git a/microAODProduction/plugins/SyncTreeProducer.cc b/microAODProduction/plugins/SyncTreeProducer.cc index 1434a205..1bd94612 100755 --- a/microAODProduction/plugins/SyncTreeProducer.cc +++ b/microAODProduction/plugins/SyncTreeProducer.cc @@ -53,7 +53,7 @@ //HHbbTauTau Framework #include "HHbbTauTau/AnalysisBase/include/SyncTree.h" -#include "TreeProduction/interface/Tau.h" +#include "HHbbTauTau/TreeProduction/interface/Tau.h" #include "TTree.h" #include "Math/VectorUtil.h" @@ -110,7 +110,7 @@ class SyncTreeProducer : public edm::EDAnalyzer { //Tau Tag edm::EDGetToken tausMiniAODToken_; - std::shared_ptr syncTree; + ntuple::SyncTree syncTree; }; // @@ -158,12 +158,12 @@ SyncTreeProducer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu using namespace reco; // Save global info right away - syncTree->run() = iEvent.id().run(); - syncTree->lumi() = iEvent.id().luminosityBlock(); - syncTree->evt() = iEvent.id().event(); + syncTree.run() = iEvent.id().run(); + syncTree.lumi() = iEvent.id().luminosityBlock(); + syncTree.evt() = iEvent.id().event(); // Get the MC collection - iEvent.getByToken(genParticlesMiniAODToken_,genParticles); +// iEvent.getByToken(genParticlesMiniAODToken_,genParticles); //Get Tau collection edm::Handle > taus; @@ -177,19 +177,22 @@ SyncTreeProducer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu //pat::PackedCandidate const* packedLeadTauCand = dynamic_cast(src.leadChargedHadrCand().get()); //fabs(packedLeadTauCand->dz()) < 0.2; // The PackedCandidate::dz() method is wrt. the first PV by default - if(!(tau.pt() > 20 && fabs(tau.eta()) < 2.3 && tau.tauID('decayModeFindingNewDMs') > 0.5)) continue; + if(!(tau.pt() > 20 && fabs(tau.eta()) < 2.3 && tau.tauID("decayModeFindingNewDMs") > 0.5)) continue; tmp_tau.eta = tau.eta(); tmp_tau.pt = tau.pt(); tmp_tau.phi = tau.phi(); - tmp_tau.againstElectronLooseMVA5 = tau.tauID('againstElectronLooseMVA5'); - tmp_tau.againstElectronMediumMVA5 = tau.tauID('againstElectronMediumMVA5'); - tmp_tau.againstElectronTightMVA5 = tau.tauID('againstElectronTightMVA5'); - tmp_tau.againstElectronVTightMVA5 = tau.tauID('againstElectronVTightMVA5'); + // tmp_tau.againstElectronLooseMVA5 = tau.tauID('againstElectronLooseMVA5'); + // tmp_tau.againstElectronMediumMVA5 = tau.tauID('againstElectronMediumMVA5'); + // tmp_tau.againstElectronTightMVA5 = tau.tauID('againstElectronTightMVA5'); + // tmp_tau.againstElectronVTightMVA5 = tau.tauID('againstElectronVTightMVA5'); tausV.push_back(tmp_tau); - } + } + if(!tausV.size()) return; + std::cout<<"Taus size: "<