diff --git a/DesyTauAnalyses/EventCount/.svn/all-wcprops b/DesyTauAnalyses/EventCount/.svn/all-wcprops new file mode 100644 index 0000000..8f01289 --- /dev/null +++ b/DesyTauAnalyses/EventCount/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 42 +/reps/H2to2H1to4Taus/!svn/ver/7/EventCount +END +eventcount_cfg.py +K 25 +svn:wc:ra_dav:version-url +V 60 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/eventcount_cfg.py +END +BuildFile.xml +K 25 +svn:wc:ra_dav:version-url +V 56 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/BuildFile.xml +END diff --git a/DesyTauAnalyses/EventCount/.svn/entries b/DesyTauAnalyses/EventCount/.svn/entries new file mode 100644 index 0000000..9ae9277 --- /dev/null +++ b/DesyTauAnalyses/EventCount/.svn/entries @@ -0,0 +1,111 @@ +10 + +dir +89 +https://svn.cern.ch/reps/H2to2H1to4Taus/EventCount +https://svn.cern.ch/reps/H2to2H1to4Taus + + + +2013-11-13T15:37:21.254154Z +7 +agbet + + + + + + + + + + + + + + +4525493e-7705-40b1-a816-d608a930855b + +test +dir + +interface +dir + +eventcount_cfg.py +file + + + + +2013-11-27T11:42:24.000000Z +d393fc1452449b91d7732ff8dce8b1e2 +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + + + + + + + + +469 + +python +dir + +doc +dir + +src +dir + +BuildFile.xml +file + + + + +2013-11-27T11:42:24.000000Z +b706b6ad72f940fc2235bf7930d38155 +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + + + + + + + + +255 + diff --git a/DesyTauAnalyses/EventCount/.svn/text-base/BuildFile.xml.svn-base b/DesyTauAnalyses/EventCount/.svn/text-base/BuildFile.xml.svn-base new file mode 100644 index 0000000..ebf538d --- /dev/null +++ b/DesyTauAnalyses/EventCount/.svn/text-base/BuildFile.xml.svn-base @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/DesyTauAnalyses/EventCount/.svn/text-base/eventcount_cfg.py.svn-base b/DesyTauAnalyses/EventCount/.svn/text-base/eventcount_cfg.py.svn-base new file mode 100644 index 0000000..3d8172a --- /dev/null +++ b/DesyTauAnalyses/EventCount/.svn/text-base/eventcount_cfg.py.svn-base @@ -0,0 +1,20 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("Demo") + +process.load("FWCore.MessageService.MessageLogger_cfi") + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) + +process.source = cms.Source("PoolSource", + # replace 'myfile.root' with the source file you want to use + fileNames = cms.untracked.vstring( + 'file:myfile.root' + ) +) + +process.demo = cms.EDAnalyzer('EventCount' +) + + +process.p = cms.Path(process.demo) diff --git a/DesyTauAnalyses/EventCount/BuildFile.xml b/DesyTauAnalyses/EventCount/BuildFile.xml new file mode 100644 index 0000000..13ac732 --- /dev/null +++ b/DesyTauAnalyses/EventCount/BuildFile.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/DesyTauAnalyses/EventCount/doc/.svn/all-wcprops b/DesyTauAnalyses/EventCount/doc/.svn/all-wcprops new file mode 100644 index 0000000..78d1b2c --- /dev/null +++ b/DesyTauAnalyses/EventCount/doc/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 46 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/doc +END diff --git a/DesyTauAnalyses/EventCount/doc/.svn/entries b/DesyTauAnalyses/EventCount/doc/.svn/entries new file mode 100644 index 0000000..69154e1 --- /dev/null +++ b/DesyTauAnalyses/EventCount/doc/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +89 +https://svn.cern.ch/reps/H2to2H1to4Taus/EventCount/doc +https://svn.cern.ch/reps/H2to2H1to4Taus + + + +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + +4525493e-7705-40b1-a816-d608a930855b + diff --git a/DesyTauAnalyses/EventCount/eventcount_cfg.py b/DesyTauAnalyses/EventCount/eventcount_cfg.py new file mode 100644 index 0000000..3d8172a --- /dev/null +++ b/DesyTauAnalyses/EventCount/eventcount_cfg.py @@ -0,0 +1,20 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("Demo") + +process.load("FWCore.MessageService.MessageLogger_cfi") + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) + +process.source = cms.Source("PoolSource", + # replace 'myfile.root' with the source file you want to use + fileNames = cms.untracked.vstring( + 'file:myfile.root' + ) +) + +process.demo = cms.EDAnalyzer('EventCount' +) + + +process.p = cms.Path(process.demo) diff --git a/DesyTauAnalyses/EventCount/interface/.svn/all-wcprops b/DesyTauAnalyses/EventCount/interface/.svn/all-wcprops new file mode 100644 index 0000000..a641cc3 --- /dev/null +++ b/DesyTauAnalyses/EventCount/interface/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 52 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/interface +END diff --git a/DesyTauAnalyses/EventCount/interface/.svn/entries b/DesyTauAnalyses/EventCount/interface/.svn/entries new file mode 100644 index 0000000..5d8807c --- /dev/null +++ b/DesyTauAnalyses/EventCount/interface/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +89 +https://svn.cern.ch/reps/H2to2H1to4Taus/EventCount/interface +https://svn.cern.ch/reps/H2to2H1to4Taus + + + +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + +4525493e-7705-40b1-a816-d608a930855b + diff --git a/DesyTauAnalyses/EventCount/python/.svn/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/__init__.pyc new file mode 100644 index 0000000..01b5525 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/.svn/all-wcprops b/DesyTauAnalyses/EventCount/python/.svn/all-wcprops new file mode 100644 index 0000000..ae92e72 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 49 +/reps/H2to2H1to4Taus/!svn/ver/7/EventCount/python +END +eventcount_cfi.py +K 25 +svn:wc:ra_dav:version-url +V 67 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/python/eventcount_cfi.py +END +__init__.py +K 25 +svn:wc:ra_dav:version-url +V 61 +/reps/H2to2H1to4Taus/!svn/ver/7/EventCount/python/__init__.py +END diff --git a/DesyTauAnalyses/EventCount/python/.svn/entries b/DesyTauAnalyses/EventCount/python/.svn/entries new file mode 100644 index 0000000..58d292b --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +89 +https://svn.cern.ch/reps/H2to2H1to4Taus/EventCount/python +https://svn.cern.ch/reps/H2to2H1to4Taus + + + +2013-11-13T15:37:21.254154Z +7 +agbet + + + + + + + + + + + + + + +4525493e-7705-40b1-a816-d608a930855b + +eventcount_cfi.py +file + + + + +2013-11-27T11:42:23.000000Z +49090e8e5fbaaf91c5d3e6615ea35f26 +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + + + + + + + + +79 + +__init__.py +file + + + + +2013-11-27T11:42:23.000000Z +dd2198926127130b4ffb2231b0651049 +2013-11-13T15:37:21.254154Z +7 +agbet + + + + + + + + + + + + + + + + + + + + + +202 + diff --git a/DesyTauAnalyses/EventCount/python/.svn/prop-base/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/prop-base/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/prop-base/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/prop-base/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/prop-base/__init__.pyc new file mode 100644 index 0000000..483f9f2 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/prop-base/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/.svn/props/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/props/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/props/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/props/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/props/__init__.pyc new file mode 100644 index 0000000..b26d231 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/props/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.py.svn-base b/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.py.svn-base new file mode 100644 index 0000000..a6d2785 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.py.svn-base @@ -0,0 +1,3 @@ +#Automatically created by SCRAM +import os +__path__.append(os.path.dirname(os.path.abspath(__file__).rsplit('/H2to2H1to4Taus/EventCount/',1)[0])+'/cfipython/slc5_amd64_gcc462/H2to2H1to4Taus/EventCount') diff --git a/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.pyc new file mode 100644 index 0000000..2541c52 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/text-base/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/.svn/text-base/eventcount_cfi.py.svn-base b/DesyTauAnalyses/EventCount/python/.svn/text-base/eventcount_cfi.py.svn-base new file mode 100644 index 0000000..1332e10 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/text-base/eventcount_cfi.py.svn-base @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +demo = cms.EDAnalyzer('EventCount' +) diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/tmp/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/tmp/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/tmp/__init__.pyc new file mode 100644 index 0000000..ecb0b0c Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/tmp/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/prop-base/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/tmp/prop-base/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/tmp/prop-base/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/prop-base/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/tmp/prop-base/__init__.pyc new file mode 100644 index 0000000..268b214 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/tmp/prop-base/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/props/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/tmp/props/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/tmp/props/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/props/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/tmp/props/__init__.pyc new file mode 100644 index 0000000..f0ec99b Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/tmp/props/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/text-base/__init__.py b/DesyTauAnalyses/EventCount/python/.svn/tmp/text-base/__init__.py new file mode 100644 index 0000000..13a1f71 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/.svn/tmp/text-base/__init__.py @@ -0,0 +1 @@ +#Automatically created by SCRAM diff --git a/DesyTauAnalyses/EventCount/python/.svn/tmp/text-base/__init__.pyc b/DesyTauAnalyses/EventCount/python/.svn/tmp/text-base/__init__.pyc new file mode 100644 index 0000000..5c3e687 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/.svn/tmp/text-base/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/__init__.py b/DesyTauAnalyses/EventCount/python/__init__.py new file mode 100644 index 0000000..a6d2785 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/__init__.py @@ -0,0 +1,3 @@ +#Automatically created by SCRAM +import os +__path__.append(os.path.dirname(os.path.abspath(__file__).rsplit('/H2to2H1to4Taus/EventCount/',1)[0])+'/cfipython/slc5_amd64_gcc462/H2to2H1to4Taus/EventCount') diff --git a/DesyTauAnalyses/EventCount/python/__init__.pyc b/DesyTauAnalyses/EventCount/python/__init__.pyc new file mode 100644 index 0000000..ba1cec6 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/__init__.pyc differ diff --git a/DesyTauAnalyses/EventCount/python/eventcount_cfi.py b/DesyTauAnalyses/EventCount/python/eventcount_cfi.py new file mode 100644 index 0000000..1332e10 --- /dev/null +++ b/DesyTauAnalyses/EventCount/python/eventcount_cfi.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +demo = cms.EDAnalyzer('EventCount' +) diff --git a/DesyTauAnalyses/EventCount/python/eventcount_cfi.pyc b/DesyTauAnalyses/EventCount/python/eventcount_cfi.pyc new file mode 100644 index 0000000..90c1a39 Binary files /dev/null and b/DesyTauAnalyses/EventCount/python/eventcount_cfi.pyc differ diff --git a/DesyTauAnalyses/EventCount/src/.svn/all-wcprops b/DesyTauAnalyses/EventCount/src/.svn/all-wcprops new file mode 100644 index 0000000..253b666 --- /dev/null +++ b/DesyTauAnalyses/EventCount/src/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 46 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/src +END +EventCount.cc +K 25 +svn:wc:ra_dav:version-url +V 60 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/src/EventCount.cc +END diff --git a/DesyTauAnalyses/EventCount/src/.svn/entries b/DesyTauAnalyses/EventCount/src/.svn/entries new file mode 100644 index 0000000..5378e92 --- /dev/null +++ b/DesyTauAnalyses/EventCount/src/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +89 +https://svn.cern.ch/reps/H2to2H1to4Taus/EventCount/src +https://svn.cern.ch/reps/H2to2H1to4Taus + + + +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + +4525493e-7705-40b1-a816-d608a930855b + +EventCount.cc +file + + + + +2013-11-27T11:42:23.000000Z +45f8d8b0843adeed079de29258a2ea8c +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + + + + + + + + +3771 + diff --git a/DesyTauAnalyses/EventCount/src/.svn/text-base/EventCount.cc.svn-base b/DesyTauAnalyses/EventCount/src/.svn/text-base/EventCount.cc.svn-base new file mode 100644 index 0000000..9fd3fe3 --- /dev/null +++ b/DesyTauAnalyses/EventCount/src/.svn/text-base/EventCount.cc.svn-base @@ -0,0 +1,166 @@ +// -*- C++ -*- +// +// Package: EventCount +// Class: EventCount +// +/**\class EventCount EventCount.cc TrackAnalyzer/EventCount/src/EventCount.cc + + Description: [one line class summary] + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Aliaksei Raspiareza,,, +// Created: Tue Feb 2 09:28:11 CET 2010 +// $Id$ +// +// + + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include + +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/HepMCCandidate/interface/GenParticle.h" +#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" + +// +// class declaration +// + +class EventCount : public edm::EDAnalyzer { + public: + explicit EventCount(const edm::ParameterSet&); + ~EventCount(); + + + private: + virtual void beginJob() ; + virtual void analyze(const edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + + // ----------member data --------------------------- + + TH1F * _eventCount; + TH1F * _eventCountJetBins; + bool _doMC; + edm::InputTag _genParticleSrc; + + +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +EventCount::EventCount(const edm::ParameterSet& iConfig) + +{ + //now do what ever initialization is needed + + _doMC = iConfig.getParameter ( "DoMC" ); + _genParticleSrc = iConfig.getParameter ( "GenParticleSource" ); + + + edm::Service fs; + + _eventCount = fs->make("EventCount","number of events",1,-0.5,0.5); + if (_doMC) + _eventCountJetBins = fs->make("EventCountJetBins","number of events in jet bins",11,-0.5,10.5); + + +} + + +EventCount::~EventCount() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} + + +// +// member functions +// + +// ------------ method called to for each event ------------ +void +EventCount::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + using namespace reco; + + float dummy = 0.; + _eventCount->Fill(dummy); + + if (_doMC) { + Handle genParticles; + iEvent.getByLabel(_genParticleSrc,genParticles); + int nParticles = genParticles->size(); + // Counting jets ---> + int Npartons = 0; + bool count_jets = false; + for (int iP=0;iPstatus() != 3) continue; + int pdg = abs(part->pdgId()); + if (count_jets) { + if (pdg == 1 || pdg == 2 || pdg == 3 || pdg == 4 || pdg == 5 || pdg == 6 || pdg == 21) Npartons++; + } + if (pdg == 23) count_jets = true; // Start counting partons after we find the Z + + } + // end of counting jets + _eventCountJetBins->Fill(float(Npartons)); + } + + +#ifdef THIS_IS_AN_EVENT_EXAMPLE + Handle pIn; + iEvent.getByLabel("example",pIn); +#endif + +#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE + ESHandle pSetup; + iSetup.get().get(pSetup); +#endif +} + + +// ------------ method called once each job just before starting event loop ------------ +void +EventCount::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ +void +EventCount::endJob() { +} + +//define this as a plug-in +DEFINE_FWK_MODULE(EventCount); diff --git a/DesyTauAnalyses/EventCount/src/EventCount.cc b/DesyTauAnalyses/EventCount/src/EventCount.cc new file mode 100644 index 0000000..34060cb --- /dev/null +++ b/DesyTauAnalyses/EventCount/src/EventCount.cc @@ -0,0 +1,179 @@ +// -*- C++ -*- +// +// Package: EventCount +// Class: EventCount +// +/**\class EventCount EventCount.cc TrackAnalyzer/EventCount/src/EventCount.cc + + Description: [one line class summary] + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Aliaksei Raspiareza,,, +// Created: Tue Feb 2 09:28:11 CET 2010 +// $Id$ +// +// + + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include + +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/HepMCCandidate/interface/GenParticle.h" +#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" + +#include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h" +#include "SimDataFormats/GeneratorProducts/interface/GenFilterInfo.h" +#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" + +// +// class declaration +// + +class EventCount : public edm::EDAnalyzer { + public: + explicit EventCount(const edm::ParameterSet&); + ~EventCount(); + + + private: + virtual void beginJob() ; + virtual void analyze(const edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + + // ----------member data --------------------------- + + TH1D * _eventCount; + // TH1D * _eventCountJetBins; + TH1D * _eventWeights; + bool _doMC; + // edm::InputTag _genParticleSrc; + edm::InputTag _hepMcSrc; + + +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +EventCount::EventCount(const edm::ParameterSet& iConfig) + +{ + //now do what ever initialization is needed + + _doMC = iConfig.getParameter ( "DoMC" ); + // _genParticleSrc = iConfig.getParameter ( "GenParticleSource" ); + _hepMcSrc = iConfig.getParameter ( "HepMcSource" ); + + edm::Service fs; + + _eventCount = fs->make("EventCount","number of events",1,-0.5,0.5); + if (_doMC) { + // _eventCountJetBins = fs->make("EventCountJetBins","number of events in jet bins",11,-0.5,10.5); + _eventWeights = fs->make("EventWeights","sum of generator weights",1,-0.5,0.5); + } + + +} + + +EventCount::~EventCount() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} + + +// +// member functions +// + +// ------------ method called to for each event ------------ +void +EventCount::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + using namespace reco; + + double dummy = 0.; + _eventCount->Fill(dummy); + + if (_doMC) { + // Handle genParticles; + // iEvent.getByLabel(_genParticleSrc,genParticles); + // int nParticles = genParticles->size(); + // Counting partons ---> + // int Npartons = 0; + // bool count_jets = false; + // for (int iP=0;iPstatus() != 3) continue; + // int pdg = abs(part->pdgId()); + // if (count_jets) { + // if (pdg == 1 || pdg == 2 || pdg == 3 || pdg == 4 || pdg == 5 || pdg == 6 || pdg == 21) Npartons++; + // } + // if (pdg == 23 || pdg == 24 || pdg ==-24 || pdg == 25 || pdg == 35 || pdg == 36) + // count_jets = true; // Start counting partons after we find the Z + // + // } + // end of counting jets + // _eventCountJetBins->Fill(double(Npartons)); + edm::Handle HEPMC; + iEvent.getByLabel(_hepMcSrc, HEPMC); + double genweight = HEPMC->weight(); + _eventWeights->Fill(0.0,genweight); + } + + +#ifdef THIS_IS_AN_EVENT_EXAMPLE + Handle pIn; + iEvent.getByLabel("example",pIn); +#endif + +#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE + ESHandle pSetup; + iSetup.get().get(pSetup); +#endif +} + + +// ------------ method called once each job just before starting event loop ------------ +void +EventCount::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ +void +EventCount::endJob() { +} + +//define this as a plug-in +DEFINE_FWK_MODULE(EventCount); diff --git a/DesyTauAnalyses/EventCount/test/.svn/all-wcprops b/DesyTauAnalyses/EventCount/test/.svn/all-wcprops new file mode 100644 index 0000000..14d1480 --- /dev/null +++ b/DesyTauAnalyses/EventCount/test/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 47 +/reps/H2to2H1to4Taus/!svn/ver/5/EventCount/test +END diff --git a/DesyTauAnalyses/EventCount/test/.svn/entries b/DesyTauAnalyses/EventCount/test/.svn/entries new file mode 100644 index 0000000..36a202d --- /dev/null +++ b/DesyTauAnalyses/EventCount/test/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +89 +https://svn.cern.ch/reps/H2to2H1to4Taus/EventCount/test +https://svn.cern.ch/reps/H2to2H1to4Taus + + + +2013-11-11T16:24:53.038914Z +5 +agbet + + + + + + + + + + + + + + +4525493e-7705-40b1-a816-d608a930855b + diff --git a/DesyTauAnalyses/NTupleMaker/test/PlotDimuons.C b/DesyTauAnalyses/NTupleMaker/test/PlotDimuons.C new file mode 100644 index 0000000..f1331c6 --- /dev/null +++ b/DesyTauAnalyses/NTupleMaker/test/PlotDimuons.C @@ -0,0 +1,272 @@ +#include "HttStylesNew.cc" +#include "HtoH.h" + +void PlotDimuons(TString histName = "massSelH", + TString xtitle = "dimuon mass [GeV]", + TString ytitle = "Events", + float xLower = 41, + float xUpper = 200, + bool logY = true) { + + SetStyle(); + + TFile * file = new TFile("SingleMu_Run2015B.root"); + + TString samples[7] = {"ZZ_PY8_50ns", + "WZ_PY8_50ns", + "WW_PY8_50ns", + "WJetsToLNu_aMCatNLO_50ns", + "TTJets_aMCatNLO_50ns", + "DYJetsToLL_M-10_50_aMCatNLO_50ns", + "DYJetsToLL_M-50_aMCatNLO_50ns" + }; + + float xsec[7] = {10.3,22.8,63.2,61526,832,18610,6025}; + + float lumi = 40; + + TH1F * histDataOld = (TH1F*)file->Get(histName); + + int nBins = histDataOld->GetNbinsX(); + float xMin = histDataOld->GetBinLowEdge(1); + float xMax = histDataOld->GetBinLowEdge(nBins+1); + + std::cout << std::endl; + std::cout << "Histogram " << histName << " : " << "nbins = " << nBins + << " , min = " << xMin + << " , max = " << xMax << std::endl; + std::cout << std::endl; + + float bins[100]; + int nBinsNew = nBins; + std::cout << "New number of bins : "; + std::cin >> nBinsNew; + + if (nBins % nBinsNew >0) { + std::cout << "new number of bins = " << nBinsNew + << " not multiple of " << nBins << std::endl; + return; + } + float binWidth = (xMax-xMin)/float(nBinsNew); + for (int iB=0; iB<=nBinsNew; ++iB) + bins[iB] = xMin + float(iB)*binWidth; + + TH1F * histData = TH1toTH1(histDataOld,nBinsNew,bins,true,"_Data_new"); + + TH1F * ewkHist = new TH1F("ewkHist","",nBinsNew,bins); + TH1F * ttHist = new TH1F("ttHist","",nBinsNew,bins); + TH1F * qcdHist = new TH1F("qcdHist","",nBinsNew,bins); + TH1F * zHist = new TH1F("zHist","",nBinsNew,bins); + + int nSamples = 7; + + // return; + + for (int iS=0; iSGet(histName); + TH1F * hist = TH1toTH1(histOld,nBinsNew,bins,true,"_new_"+samples[iS]); + TH1F * eventCount = (TH1F*)fileMC->Get("histWeightsH"); + float nGen = eventCount->GetSumOfWeights(); + float norm = xsec[iS]*lumi/nGen; + TH1F * tempHist = ewkHist; + if (iS==3) + tempHist = qcdHist; + if (iS==4) + tempHist = ttHist; + if (iS==5 || iS==6) + tempHist = zHist; + tempHist->Add(tempHist,hist,1.,norm); + + } + + // float dataEvents = 0; + // float ttEvents = 0; + + qcdHist->Add(qcdHist,ewkHist); + ttHist->Add(ttHist,qcdHist); + zHist->Add(zHist,ttHist); + + TH1F * bkgdErr = (TH1F*)qcdHist->Clone("bkgdErr"); + bkgdErr->SetFillStyle(3013); + bkgdErr->SetFillColor(1); + bkgdErr->SetMarkerStyle(21); + bkgdErr->SetMarkerSize(0); + + for (int iB=1; iB<=nBinsNew; ++iB) { + ewkHist->SetBinError(iB,0); + ttHist->SetBinError(iB,0); + qcdHist->SetBinError(iB,0); + zHist->SetBinError(iB,0); + } + + InitData(histData); + InitHist(qcdHist,"","",kMagenta,1001); + InitHist(ttHist,"","",kCyan,1001); + InitHist(ewkHist,"","",kBlue-4,1001); + InitHist(zHist,"","",kYellow,1001); + histData->GetXaxis()->SetTitle(xtitle); + histData->GetYaxis()->SetTitle(ytitle); + histData->GetYaxis()->SetTitleOffset(1.3); + histData->GetYaxis()->SetTitleSize(0.06); + histData->GetXaxis()->SetRangeUser(xLower,xUpper); + float yUpper = histData->GetMaximum(); + if (logY) + histData->GetYaxis()->SetRangeUser(0.5,2*yUpper); + else + histData->GetYaxis()->SetRangeUser(0,1.2*yUpper); + + histData->SetMarkerSize(1.5); + histData->GetXaxis()->SetLabelSize(0); + histData->GetYaxis()->SetLabelSize(0.06); + + // nData = histData->GetSum(); + // float nMC = ttHist->GetSum(); + // float eData = TMath::Sqrt(nData); + + + TCanvas * canv1 = MakeCanvas("canv1", "", 700, 800); + TPad *upper = new TPad("upper", "pad",0,0.31,1,1); + upper->Draw(); + upper->cd(); + upper->SetFillColor(0); + upper->SetBorderMode(0); + upper->SetBorderSize(10); + upper->SetTickx(1); + upper->SetTicky(1); + upper->SetLeftMargin(0.17); + upper->SetRightMargin(0.05); + upper->SetBottomMargin(0.02); + upper->SetFrameFillStyle(0); + upper->SetFrameLineStyle(0); + upper->SetFrameLineWidth(2); + upper->SetFrameBorderMode(0); + upper->SetFrameBorderSize(10); + upper->SetFrameFillStyle(0); + upper->SetFrameLineStyle(0); + upper->SetFrameLineWidth(2); + upper->SetFrameBorderMode(0); + upper->SetFrameBorderSize(10); + + histData->Draw("e1"); + zHist->Draw("sameh"); + ttHist->Draw("sameh"); + qcdHist->Draw("sameh"); + ewkHist->Draw("sameh"); + histData->Draw("e1same"); + + float chi2 = 0; + for (int iB=1; iB<=nBinsNew; ++iB) { + float xData = histData->GetBinContent(iB); + float xMC = zHist->GetBinContent(iB); + if (xMC>1e-1) { + float diff2 = (xData-xMC)*(xData-xMC); + chi2 += diff2/xMC; + } + } + std::cout << std::endl; + std::cout << "Chi2 = " << chi2 << std::endl; + std::cout << std::endl; + + TLegend * leg = new TLegend(0.65,0.6,0.9,0.88); + SetLegendStyle(leg); + leg->SetTextSize(0.05); + leg->AddEntry(histData,"Data","lp"); + leg->AddEntry(ewkHist,"dibosons","f"); + leg->AddEntry(qcdHist,"W+Jets","f"); + leg->AddEntry(ttHist,"t#bar{t}","f"); + leg->AddEntry(zHist,"Z#rightarrow#mu#mu","f"); + leg->Draw(); + + TLatex * cms = new TLatex(0.25,0.94,"CMS Preliminary L = 41 pb^{-1} at #sqrt{s} = 13 TeV"); + + cms->SetNDC(); + cms->SetTextSize(0.05); + cms->Draw(); + + if (logY) upper->SetLogy(true); + + upper->Draw("SAME"); + upper->RedrawAxis(); + upper->Modified(); + upper->Update(); + canv1->cd(); + + TH1F * ratioH = (TH1F*)histData->Clone("ratioH"); + ratioH->SetMarkerColor(1); + ratioH->SetMarkerStyle(20); + ratioH->SetMarkerSize(1.5); + ratioH->SetLineColor(1); + ratioH->GetYaxis()->SetRangeUser(0,2.2); + ratioH->GetYaxis()->SetNdivisions(505); + ratioH->GetXaxis()->SetLabelFont(42); + ratioH->GetXaxis()->SetLabelOffset(0.04); + ratioH->GetXaxis()->SetLabelSize(0.14); + ratioH->GetXaxis()->SetTitleSize(0.13); + ratioH->GetXaxis()->SetTitleOffset(1.2); + ratioH->GetYaxis()->SetTitle("obs/exp"); + ratioH->GetYaxis()->SetLabelFont(42); + ratioH->GetYaxis()->SetLabelOffset(0.015); + ratioH->GetYaxis()->SetLabelSize(0.13); + ratioH->GetYaxis()->SetTitleSize(0.14); + ratioH->GetYaxis()->SetTitleOffset(0.5); + ratioH->GetXaxis()->SetTickLength(0.07); + ratioH->GetYaxis()->SetTickLength(0.04); + ratioH->GetYaxis()->SetLabelOffset(0.01); + + for (int iB=1; iB<=nBinsNew; ++iB) { + float x1 = histData->GetBinContent(iB); + float x2 = zHist->GetBinContent(iB); + if (x1>0&&x2>0) { + float e1 = histData->GetBinError(iB); + float ratio = x1/x2; + float eratio = e1/x2; + ratioH->SetBinContent(iB,ratio); + ratioH->SetBinError(iB,eratio); + } + else { + ratioH->SetBinContent(iB,1000); + } + } + + + // ------------>Primitives in pad: lower + lower = new TPad("lower", "pad",0,0,1,0.30); + lower->Draw(); + lower->cd(); + lower->SetFillColor(0); + lower->SetBorderMode(0); + lower->SetBorderSize(10); + lower->SetGridy(); + lower->SetTickx(1); + lower->SetTicky(1); + lower->SetLeftMargin(0.17); + lower->SetRightMargin(0.05); + lower->SetTopMargin(0.026); + lower->SetBottomMargin(0.35); + lower->SetFrameFillStyle(0); + lower->SetFrameLineStyle(0); + lower->SetFrameLineWidth(2); + lower->SetFrameBorderMode(0); + lower->SetFrameBorderSize(10); + lower->SetFrameFillStyle(0); + lower->SetFrameLineStyle(0); + lower->SetFrameLineWidth(2); + lower->SetFrameBorderMode(0); + lower->SetFrameBorderSize(10); + + ratioH->Draw("e1"); + + lower->Modified(); + lower->RedrawAxis(); + canv1->cd(); + canv1->Modified(); + canv1->cd(); + canv1->SetSelected(canv1); + + canv1->Print(histName+".png"); + canv1->Print(histName+".pdf","Portrait pdf"); + + +} diff --git a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Data_noMVAMet.py b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Data_noMVAMet.py index f07773c..9a456f2 100644 --- a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Data_noMVAMet.py +++ b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Data_noMVAMet.py @@ -34,16 +34,16 @@ #process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9::Al') process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) + input = cms.untracked.int32(10000) ) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( # Single Muon Run2015B - '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/164/00000/544E58CD-A226-E511-834E-02163E0134D6.root', - '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/167/00000/EE9594B8-A826-E511-A18B-02163E011A7D.root', - '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/4E8E390B-EA26-E511-9EDA-02163E013567.root', - '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/60FF8405-EA26-E511-A892-02163E01387D.root' +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/164/00000/544E58CD-A226-E511-834E-02163E0134D6.root', +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/167/00000/EE9594B8-A826-E511-A18B-02163E011A7D.root', +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/4E8E390B-EA26-E511-9EDA-02163E013567.root', +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/60FF8405-EA26-E511-A892-02163E01387D.root' # Single Electron Run2015B # '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/096/00000/22D22D7F-5626-E511-BDE3-02163E011FAB.root', # '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/161/00000/7019DC27-9C26-E511-84FF-02163E011CC2.root', @@ -52,12 +52,20 @@ # '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/167/00000/E661FBF2-A726-E511-8B8B-02163E01207C.root', # '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/168/00000/FCB6CB61-BC26-E511-8858-02163E01375B.root' # Double EG Run2015B -# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/096/00000/8A2D533C-5626-E511-AF3C-02163E011FAB.root', -# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/161/00000/AC857A3B-9C26-E511-B32E-02163E012704.root', -# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/163/00000/9CB965BF-9F26-E511-8FB1-02163E012040.root', -# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/164/00000/2CA2349A-A526-E511-A371-02163E0138D0.root', -# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/167/00000/C446EC67-A726-E511-81C1-02163E0119E7.root', -# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/168/00000/747F782A-BB26-E511-BA24-02163E011EE9.root' + '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/096/00000/8A2D533C-5626-E511-AF3C-02163E011FAB.root', + '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/161/00000/AC857A3B-9C26-E511-B32E-02163E012704.root', + '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/163/00000/9CB965BF-9F26-E511-8FB1-02163E012040.root', + '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/164/00000/2CA2349A-A526-E511-A371-02163E0138D0.root', + '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/167/00000/C446EC67-A726-E511-81C1-02163E0119E7.root', + '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/168/00000/747F782A-BB26-E511-BA24-02163E011EE9.root' + # MuonEG Run2015B +# '/store/data/Run2015B/MuonEG/MINIAOD/PromptReco-v1/000/251/162/00000/427789C7-4127-E511-979F-02163E012096.root', +# '/store/data/Run2015B/MuonEG/MINIAOD/PromptReco-v1/000/251/164/00000/0270BD14-A426-E511-9857-02163E01182A.root', +# '/store/data/Run2015B/MuonEG/MINIAOD/PromptReco-v1/000/251/167/00000/F668ECD1-A726-E511-901F-02163E011D57.root', +# '/store/data/Run2015B/MuonEG/MINIAOD/PromptReco-v1/000/251/168/00000/F8F3DF28-BC26-E511-B98D-02163E0135AC.root', +# '/store/data/Run2015B/MuonEG/MINIAOD/PromptReco-v1/000/251/244/00000/10C5D0A8-7527-E511-BFE2-02163E0140E1.root', +# '/store/data/Run2015B/MuonEG/MINIAOD/PromptReco-v1/000/251/251/00000/88361DDE-7827-E511-94C3-02163E0127DF.root', +# '/store/data/Run2015B/MuonEG/MINIAOD/PromptReco-v1/000/251/252/00000/E09EA71E-9D27-E511-B478-02163E014558.root' ) ) @@ -683,10 +691,10 @@ # process.egmGsfElectronIDSequence * # process.mvaTrigV025nsCSA14 * # process.mvaNonTrigV025nsCSA14 * - #process.ak4PFJets* -# process.mvaMetSequence* -# process.puJetIdSequence* - process.makeroottree + process.ak4PFJets* + process.mvaMetSequence* + process.puJetIdSequence* + process.makeroottree ) diff --git a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_MC_Dimuon.py b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_MC_Dimuon.py new file mode 100644 index 0000000..34a99e7 --- /dev/null +++ b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_MC_Dimuon.py @@ -0,0 +1,750 @@ +import FWCore.ParameterSet.Config as cms + +isData = False +#skim = 0 +year = 2015 +#period = 'Run2015B' +period = "Spring15" +#sampleName = 'MonteCarlo' +# sampleName = 'TTJets', "QCD", "DYJetsToLL_M50" + +#if "@SKIM@".lower()=="0": +# skim = 0 + +#sampleName = "@SAMPLE_NAME@" + +process = cms.Process("TreeProducer") + +process.load('FWCore/MessageService/MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.MessageLogger.cerr.threshold = cms.untracked.string('INFO') +#process.load('Configuration.StandardSequences.Geometry_cff') +#process.load('Configuration.Geometry.GeometryIdeal_cff') +#process.load('Configuration.StandardSequences.MagneticField_cff') +#process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff') + +process.load('Configuration/StandardSequences/Services_cff') +process.load("Configuration.Geometry.GeometryDB_cff") +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff') +process.load("Configuration.StandardSequences.MagneticField_cff") + +from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V7C', '') +process.GlobalTag = GlobalTag(process.GlobalTag, '74X_dataRun2_Prompt_v0', '') + +#process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9::Al') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( +# DYJets (25 ns) + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/009D49A5-7314-E511-84EF-0025905A605E.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/00C0BECF-6F14-E511-96F8-0025904B739A.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/0260F225-7614-E511-A79F-00A0D1EE8EB4.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/02B810EA-7214-E511-BDAB-0025905964C2.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/02CEA7DD-7714-E511-A93E-00266CFAEA68.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/0453351C-7014-E511-A296-0025905B85AA.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/0679BC6F-7714-E511-945E-0025905B8562.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/0823BF6F-7814-E511-8E48-00A0D1EE8B08.root', + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/08271551-9714-E511-B209-0025907FD2DA.root' +# DYJets (50 ns) +# '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/00000/02DE3B74-6C08-E511-ABE3-0025905A60D0.root' +# /JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v2/MINIAODSIM +# '/store/mc/RunIISpring15DR74/JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/20000/02AD184C-B527-E511-A654-0025905A612C.root', +# '/store/mc/RunIISpring15DR74/JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/20000/06660B0D-132C-E511-8440-0CC47A13CEAC.root', +# '/store/mc/RunIISpring15DR74/JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/20000/0AA97DB6-F62B-E511-8A3F-20CF3027A594.root', +# '/store/mc/RunIISpring15DR74/JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/20000/0C7C6DA1-B427-E511-B640-0025905C2CD0.root', +# '/store/mc/RunIISpring15DR74/JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/20000/0CDA43E5-B427-E511-BEB7-0025905A48FC.root', +# '/store/mc/RunIISpring15DR74/JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/20000/0E12C74A-F72B-E511-A866-20CF300E9EC1.root', +# '/store/mc/RunIISpring15DR74/JpsiToMuMu_OniaMuonFilter_TuneCUEP8M1_13TeV-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/20000/14386780-BD27-E511-B94B-0025904C656A.root' + ) +) + +##################################################### + + +#-------------------------------------------------------------------------------- +# produce PAT-tuple +process.load("PhysicsTools/PatAlgos/patSequences_cff") +# configure pat::Jet production +# (enable L2L3Residual corrections in case running on Data) +#jetCorrections = ( 'L1FastJet', 'L2Relative', 'L3Absolute') +#from PhysicsTools.PatAlgos.tools.jetTools import * +#switchJetCollection( +# process, +# jetSource = cms.InputTag('ak4PFJetsCHS'), +# jetCorrections = ( 'AK4PFchs', jetCorrections, "" ), +# outputModules = [] +#) + +#process.patJets.addTagInfos = cms.bool(True) +#process.patJets.tagInfoSources = cms.VInputTag("impactParameterTagInfosAOD","secondaryVertexTagInfosAOD","softMuonTagInfosAOD") +#process.patJets.tagInfoSources = cms.VInputTag("secondaryVertexTagInfosEI") + + +#-------------------------------------------------------------------------------- +# switch to HPS PFTaus (and disable all "cleaning" cuts) +#from PhysicsTools.PatAlgos.tools.tauTools import * +#switchToPFTauHPS(process) + +#-------------------------------------------------------------------------------- +# select "good" reconstructed vertices +#process.load("TauAnalysis/RecoTools/recoVertexSelection_cff") + +#-------------------------------------------------------------------------------- +# electron Id (CSA14) -> +# input tags for electron id are hardcoded +# in class MyRootMaker +#process.load("EgammaAnalysis.ElectronTools.electronIdMVAProducer_CSA14_cfi") +#process.load("RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cff") + +# specify correct sources for MVA electron Id. +#process.electronIDValueMapProducer.ebReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEB") +#process.electronIDValueMapProducer.eeReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEE") +#process.electronIDValueMapProducer.esReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsES") + +#---------------------------------------------------------------------------------- +# produce PU Jet Ids & MVA MET +#---------------------------------------------------------------------------------- + +""" +process.skimOutputModule = cms.OutputModule("PoolOutputModule", + ##goldenZmumuEventContent, + outputCommands = cms.untracked.vstring( + 'drop *', + 'keep *_l1extraParticles_*_*' + ) +) +""" + + +process.tauPreSelectionDiTau = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 40. && abs(eta) < 2.5 && tauID("decayModeFindingNewDMs") > 0.5') +) + + +process.tauPreSelectionTauEle = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + + +process.tauPreSelectionTauMu = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + +process.muonPreSelectionMuEle = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 9. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + + +process.muonPreSelectionTauMu = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + +process.electronPreSelectionMuEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 13. && abs(eta) < 2.5') +) + + +process.electronPreSelectionTauEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5') +) + +process.leptonSkimSequence = cms.Sequence(process.electronPreSelectionMuEle + process.electronPreSelectionTauEle + process.muonPreSelectionTauMu + process.muonPreSelectionMuEle + process.tauPreSelectionTauMu + process.tauPreSelectionTauEle + process.tauPreSelectionDiTau) + +process.ak4PFJets = cms.EDProducer("FastjetJetProducer", + Active_Area_Repeats = cms.int32(1), + doAreaFastjet = cms.bool(True), + voronoiRfact = cms.double(-0.9), + maxBadHcalCells = cms.uint32(9999999), + doAreaDiskApprox = cms.bool(False), + maxRecoveredEcalCells = cms.uint32(9999999), + jetType = cms.string('PFJet'), + minSeed = cms.uint32(14327), + Ghost_EtaMax = cms.double(5.0), + doRhoFastjet = cms.bool(False), + jetAlgorithm = cms.string('AntiKt'), + nSigmaPU = cms.double(1.0), + GhostArea = cms.double(0.01), + Rho_EtaMax = cms.double(4.4), + maxBadEcalCells = cms.uint32(9999999), + useDeterministicSeed = cms.bool(True), + doPVCorrection = cms.bool(False), + maxRecoveredHcalCells = cms.uint32(9999999), + rParam = cms.double(0.4), + maxProblematicHcalCells = cms.uint32(9999999), + doOutputJets = cms.bool(True), + src = cms.InputTag("packedPFCandidates"), + inputEtMin = cms.double(0.0), + srcPVs = cms.InputTag(""), + jetPtMin = cms.double(3.0), + radiusPU = cms.double(0.5), + maxProblematicEcalCells = cms.uint32(9999999), + doPUOffsetCorr = cms.bool(False), + inputEMin = cms.double(0.0) +) + +process.calibratedAK4PFJetsForPFMVAMEt = cms.EDProducer("PFJetCorrectionProducer", + src = cms.InputTag("ak4PFJets"), + correctors = cms.vstring('ak4PFL1FastL2L3') +) + +process.puJetIdForPFMVAMEt = cms.EDProducer("PileupJetIdProducer", + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'jetPt', + 'jetEta', + 'jetPhi', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetID'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring(), + label = cms.string('full'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.3, 0.4, 0.7, 0.8), + Pt2030_Loose = cms.vdouble(0.0, 0.0, 0.2, 0.6), + Pt3050_Medium = cms.vdouble(0.3, 0.2, 0.7, 0.8), + Pt1020_Tight = cms.vdouble(-0.2, 0.2, 0.2, 0.6), + Pt2030_Medium = cms.vdouble(0.2, 0.2, 0.5, 0.7), + Pt010_Tight = cms.vdouble(0.5, 0.6, 0.6, 0.9), + Pt1020_Loose = cms.vdouble(-0.4, -0.4, -0.4, 0.4), + Pt010_Medium = cms.vdouble(0.2, 0.4, 0.2, 0.6), + Pt1020_Medium = cms.vdouble(-0.3, 0.0, 0.0, 0.5), + Pt010_Loose = cms.vdouble(0.0, 0.0, 0.0, 0.2), + Pt3050_Loose = cms.vdouble(0.0, 0.0, 0.6, 0.2), + Pt3050_Tight = cms.vdouble(0.5, 0.4, 0.8, 0.9) + ), + impactParTkThreshold = cms.double(0.0) + )), + inputIsCorrected = cms.bool(True), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + produceJetIds = cms.bool(True), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag("pileupJetIdCalculator"), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + runMvas = cms.bool(True) +) + +process.mvaMETDiTau = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionDiTau"), cms.InputTag("tauPreSelectionDiTau")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauMu = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauMu"), cms.InputTag("muonPreSelectionTauMu")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauEle"), cms.InputTag("electronPreSelectionTauEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETMuEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("muonPreSelectionMuEle"), cms.InputTag("electronPreSelectionMuEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.patMvaMetDiTau = process.patMETs.clone( + metSource = cms.InputTag('mvaMETDiTau'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauMu = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauMu'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetMuEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETMuEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) + +process.mvaMetSequence = cms.Sequence(process.leptonSkimSequence* process.ak4PFJets * process.calibratedAK4PFJetsForPFMVAMEt * + process.puJetIdForPFMVAMEt * process.mvaMETDiTau * process.mvaMETTauMu * + process.mvaMETTauEle * process.mvaMETMuEle * process.patMvaMetDiTau * + process.patMvaMetTauMu * process.patMvaMetTauEle * process.patMvaMetMuEle) + +process.pileupJetIdFull = cms.EDProducer("PileupJetIdProducer", + produceJetIds = cms.bool(True), + runMvas = cms.bool(True), + inputIsCorrected = cms.bool(False), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + residualsTxt = cms.FileInPath('RecoJets/JetProducers/data/download.url'), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag(""), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("ak4PFJets"), + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetIDMVAHighPt'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('CondFormats/JetMETObjects/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml'), + #tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring('jetPt', + 'jetEta', + 'jetPhi'), + label = cms.string('full53x'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42), + Pt2030_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt1020_MET = cms.vdouble(0.3, -0.2, -0.4, -0.4), + Pt2030_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt010_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt1020_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt3050_MET = cms.vdouble(0.0, 0.0, -0.1, -0.2), + Pt010_MET = cms.vdouble(0.0, -0.6, -0.4, -0.4), + Pt1020_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt010_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt1020_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt2030_MET = cms.vdouble(0.0, 0.0, 0.0, 0.0), + Pt010_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt3050_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42) + ), + impactParTkThreshold = cms.double(1.0) + )) +) +process.puJetIdSequence = cms.Sequence(process.pileupJetIdFull) +''' +process.load("PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff") +from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag +massSearchReplaceAnyInputTag(process.makePatJets, + "ak4PFJetsCHS", + "ak4PFJets", + verbose=True) +massSearchReplaceAnyInputTag(process.makePatJets, + 'offlinePrimaryVertices', + 'offlineSlimmedPrimaryVertices', + verbose=True) +process.patJetCorrFactors.payload = cms.string('AK4PF') +process.puJetIdSequence += process.makePatJets +''' +################################################## +# Main +process.makeroottree = cms.EDAnalyzer("NTupleMaker", +# data, year, period, skim +IsData = cms.untracked.bool(isData), +Year = cms.untracked.uint32(year), +Period = cms.untracked.string(period), +Skim = cms.untracked.uint32(0), +# switches of collections +GenParticles = cms.untracked.bool(True), +Trigger = cms.untracked.bool(True), +RecPrimVertex = cms.untracked.bool(True), +RecBeamSpot = cms.untracked.bool(True), +RecTrack = cms.untracked.bool(False), +RecPFMet = cms.untracked.bool(True), +RecMvaMet = cms.untracked.bool(True), +RecMuon = cms.untracked.bool(True), +RecPhoton = cms.untracked.bool(False), +RecElectron = cms.untracked.bool(True), +RecTau = cms.untracked.bool(True), +RecJet = cms.untracked.bool(True), +# collections +L1MuonCollectionTag = cms.InputTag("l1extraParticles"), +MuonCollectionTag = cms.InputTag("slimmedMuons"), +ElectronCollectionTag = cms.InputTag("slimmedElectrons"), +TauCollectionTag = cms.InputTag("slimmedTaus"), +JetCollectionTag = cms.InputTag("slimmedJets"), +MetCollectionTag = cms.InputTag("slimmedMETs"), +MvaMetCollectionsTag = cms.VInputTag("patMvaMetDiTau", "patMvaMetTauMu", "patMvaMetTauEle", "patMvaMetMuEle"), +TrackCollectionTag = cms.InputTag("generalTracks"), +GenParticleCollectionTag = cms.InputTag("prunedGenParticles"), +TriggerObjectCollectionTag = cms.InputTag("selectedPatTrigger"), +BeamSpotCollectionTag = cms.InputTag("offlineBeamSpot"), +PVCollectionTag = cms.InputTag("offlineSlimmedPrimaryVertices"), +# trigger info +HLTriggerPaths = cms.untracked.vstring( +'HLT_IsoMu24_eta2p1_v', +'HLT_Mu24_v', +'HLT_Mu24_eta2p1_v', +'HLT_Mu27_v', +'HLT_Mu34_v', +'HLT_Mu45_eta2p1_v', +'HLT_Mu17_Mu8_v', +'HLT_Mu17_Mu8_DZ_v', +'HLT_Mu17_Mu8_SameSign_v', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v' +), +TriggerProcess = cms.untracked.string("HLT"), +# tracks +RecTrackPtMin = cms.untracked.double(0.5), +RecTrackEtaMax = cms.untracked.double(2.4), +RecTrackNum = cms.untracked.int32(0), +# muons +RecMuonPtMin = cms.untracked.double(5.), +RecMuonEtaMax = cms.untracked.double(2.5), +RecMuonHLTriggerMatching = cms.untracked.vstring( +'HLT_IsoMu24_eta2p1_v.*:hltL3crIsoL1sMu20Eta2p1L1f0L2f10QL3f24QL3trkIsoFiltered0p09', +'HLT_Mu24_v.*:hltL3fL1sMu16L1f0L2f16L3Filtered24', +'HLT_Mu24_eta2p1_v.*:hltL3fL1sMu20Eta2p1L1f0L2f10QL3Filtered24Q', +'HLT_Mu27_v.*:hltL3fL1sMu25L1f0L2f10QL3Filtered27Q', +'HLT_Mu34_v.*:hltL3fL1sMu20L1f0L2f20L3Filtered34', +'HLT_Mu45_eta2p1_v.*:hltL3fL1sMu16orMu25L1f0L2f16QL3Filtered45e2p1Q', +'HLT_Mu17_Mu8_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_DZ_v.*:hltDiMuonGlb17Glb8DzFiltered0p2', +'HLT_Mu17_Mu8_SameSign_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_SameSign_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_SameSign_v.*:hltDiMuonGlb17Glb8DzFiltered0p2', +'HLT_Mu17_Mu8_SameSign_v.*:hltDiMuonGlb17Glb8DzFiltered0p2SameSign', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltDiMuonGlb17Glb8RelTrkIsoFiltered0p4DzFiltered0p2', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17' +), +RecMuonNum = cms.untracked.int32(0), +# photons +RecPhotonPtMin = cms.untracked.double(20.), +RecPhotonEtaMax = cms.untracked.double(10000.), +RecPhotonHLTriggerMatching = cms.untracked.vstring(), +RecPhotonNum = cms.untracked.int32(0), +# electrons +RecElectronPtMin = cms.untracked.double(8.), +RecElectronEtaMax = cms.untracked.double(2.6), +RecElectronHLTriggerMatching = cms.untracked.vstring( +), +RecElectronNum = cms.untracked.int32(0), +# taus +RecTauPtMin = cms.untracked.double(18), +RecTauEtaMax = cms.untracked.double(2.4), +RecTauHLTriggerMatching = cms.untracked.vstring( +), +RecTauFloatDiscriminators = cms.untracked.vstring( +#'againstElectronLoose', +#'againstElectronLooseMVA5', +#'againstElectronMVA5category', +#'againstElectronMVA5raw', +#'againstElectronMedium', +#'againstElectronMediumMVA5', +#'againstElectronTight', +#'againstElectronTightMVA5', +#'againstElectronVLooseMVA5', +#'againstElectronVTightMVA5', +#'againstMuonLoose', +#'againstMuonLoose2', +#'againstMuonLoose3', +#'againstMuonLooseMVA', +#'againstMuonMVAraw', +#'againstMuonMedium', +#'againstMuonMedium2', +#'againstMuonMediumMVA', +#'againstMuonTight', +#'againstMuonTight2', +#'againstMuonTight3', +#'againstMuonTightMVA', +#'byCombinedIsolationDeltaBetaCorrRaw3Hits', +#'byIsolationMVA3newDMwLTraw', +#'byIsolationMVA3newDMwoLTraw', +#'byIsolationMVA3oldDMwLTraw', +#'byIsolationMVA3oldDMwoLTraw', +#'byLooseCombinedIsolationDeltaBetaCorr3Hits', +#'byLooseIsolationMVA3newDMwLT', +#'byLooseIsolationMVA3newDMwoLT', +#'byLooseIsolationMVA3oldDMwLT', +#'byLooseIsolationMVA3oldDMwoLT', +#'byMediumCombinedIsolationDeltaBetaCorr3Hits', +#'byMediumIsolationMVA3newDMwLT', +#'byMediumIsolationMVA3newDMwoLT', +#'byMediumIsolationMVA3oldDMwLT', +#'byMediumIsolationMVA3oldDMwoLT', +#'byTightCombinedIsolationDeltaBetaCorr3Hits', +#'byTightIsolationMVA3newDMwLT', +#'byTightIsolationMVA3newDMwoLT', +#'byTightIsolationMVA3oldDMwLT', +#'byTightIsolationMVA3oldDMwoLT', +#'byVLooseIsolationMVA3newDMwLT', +#'byVLooseIsolationMVA3newDMwoLT', +#'byVLooseIsolationMVA3oldDMwLT', +#'byVLooseIsolationMVA3oldDMwoLT', +#'byVTightIsolationMVA3newDMwLT', +#'byVTightIsolationMVA3newDMwoLT', +#'byVTightIsolationMVA3oldDMwLT', +#'byVTightIsolationMVA3oldDMwoLT', +#'byVVTightIsolationMVA3newDMwLT', +#'byVVTightIsolationMVA3newDMwoLT', +#'byVVTightIsolationMVA3oldDMwLT', +#'byVVTightIsolationMVA3oldDMwoLT', +#'chargedIsoPtSum', +#'decayModeFinding', +#'decayModeFindingNewDMs', +#'neutralIsoPtSum', +#'puCorrPtSum' +), +RecTauBinaryDiscriminators = cms.untracked.vstring(), +RecTauNum = cms.untracked.int32(0), +# jets +RecJetPtMin = cms.untracked.double(18.), +RecJetEtaMax = cms.untracked.double(5.2), +RecJetHLTriggerMatching = cms.untracked.vstring(), +RecJetBtagDiscriminators = cms.untracked.vstring( +'jetBProbabilityBJetTags', +'jetProbabilityBJetTags', +'trackCountingHighPurBJetTags', +'trackCountingHighEffBJetTags', +'simpleSecondaryVertexHighEffBJetTags', +'simpleSecondaryVertexHighPurBJetTags', +'combinedInclusiveSecondaryVertexV2BJetTags', +'pfCombinedSecondaryVertexBJetTags', +'combinedMVABJetTags' +), +RecJetNum = cms.untracked.int32(0), +SampleName = cms.untracked.string("Data") +) + +#process.patJets.addBTagInfo = cms.bool(True) + + +process.p = cms.Path( +# process.particleFlowPtrs + +# process.makePatElectrons + +# process.makePatMuons + +# process.makePatJets + +# process.selectPrimaryVertex * +# process.patDefaultSequence * +# process.egmGsfElectronIDSequence * +# process.mvaTrigV025nsCSA14 * +# process.mvaNonTrigV025nsCSA14 * + #process.ak4PFJets* +# process.mvaMetSequence* +# process.puJetIdSequence* + process.makeroottree + ) + + +process.TFileService = cms.Service("TFileService", + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_4_6/src/DesyTauAnalyses/NTupleMaker/test/Ntuple74.root"), + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_2_3_patch1/src/DesyTauAnalyses/NTupleMaker/test/Staus/${1}_NTuple.root"), + fileName = cms.string("output.root") + ) + + +#process.end = cms.EndPath(process.Out*process.TFileService) + +#processDumpFile = open('MyRootMaker.dump', 'w') +#print >> processDumpFile, process.dumpPython() + + + + + +def customise_for_gc(process): + import FWCore.ParameterSet.Config as cms + from IOMC.RandomEngine.RandomServiceHelper import RandomNumberServiceHelper + + try: + maxevents = __MAX_EVENTS__ + process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(max(-1, maxevents)) + ) + except: + pass + + # Dataset related setup + try: + primaryFiles = [__FILE_NAMES__] + process.source = cms.Source('PoolSource', + skipEvents = cms.untracked.uint32(__SKIP_EVENTS__), + fileNames = cms.untracked.vstring(primaryFiles) + ) + try: + secondaryFiles = [__FILE_NAMES2__] + process.source.secondaryFileNames = cms.untracked.vstring(secondaryFiles) + except: + pass + try: + lumirange = [__LUMI_RANGE__] + if len(lumirange) > 0: + process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(lumirange) + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) + except: + pass + except: + pass + + if hasattr(process, 'RandomNumberGeneratorService'): + randSvc = RandomNumberServiceHelper(process.RandomNumberGeneratorService) + randSvc.populate() + + process.AdaptorConfig = cms.Service('AdaptorConfig', + enable = cms.untracked.bool(True), + stats = cms.untracked.bool(True), + ) + + # Generator related setup + try: + if hasattr(process, 'generator') and process.source.type_() != 'PoolSource': + process.source.firstLuminosityBlock = cms.untracked.uint32(1 + __MY_JOBID__) + print 'Generator random seed:', process.RandomNumberGeneratorService.generator.initialSeed + except: + pass + + return (process) + +process = customise_for_gc(process) + +# grid-control: https://ekptrac.physik.uni-karlsruhe.de/trac/grid-control + + + diff --git a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Run2015B_Dimuon.py b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Run2015B_Dimuon.py new file mode 100644 index 0000000..31a996f --- /dev/null +++ b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Run2015B_Dimuon.py @@ -0,0 +1,758 @@ +import FWCore.ParameterSet.Config as cms + +isData = True +#skim = 0 +year = 2015 +period = 'Run2015B' +#sampleName = 'MonteCarlo' +# sampleName = 'TTJets', "QCD", "DYJetsToLL_M50" + +#if "@SKIM@".lower()=="0": +# skim = 0 + +#sampleName = "@SAMPLE_NAME@" + +process = cms.Process("TreeProducer") + +process.load('FWCore/MessageService/MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.MessageLogger.cerr.threshold = cms.untracked.string('INFO') +#process.load('Configuration.StandardSequences.Geometry_cff') +#process.load('Configuration.Geometry.GeometryIdeal_cff') +#process.load('Configuration.StandardSequences.MagneticField_cff') +#process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff') + +process.load('Configuration/StandardSequences/Services_cff') +process.load("Configuration.Geometry.GeometryDB_cff") +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff') +process.load("Configuration.StandardSequences.MagneticField_cff") + +from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V7C', '') +process.GlobalTag = GlobalTag(process.GlobalTag, '74X_dataRun2_Prompt_v0', '') + +#process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9::Al') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + # Single Muon Run2015B + '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/164/00000/544E58CD-A226-E511-834E-02163E0134D6.root', + '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/167/00000/EE9594B8-A826-E511-A18B-02163E011A7D.root', + '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/4E8E390B-EA26-E511-9EDA-02163E013567.root', + '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/60FF8405-EA26-E511-A892-02163E01387D.root' + # Double Muon Run2015B +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/162/00000/12284DB9-4227-E511-A438-02163E013674.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/164/00000/402F0995-A326-E511-86BB-02163E013948.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/167/00000/70C4A781-A826-E511-95B4-02163E013414.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/627E9C65-DD26-E511-87FB-02163E013576.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/244/00000/E42FEF61-6E27-E511-B93A-02163E0143C0.root' + # Single Electron Run2015B +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/096/00000/22D22D7F-5626-E511-BDE3-02163E011FAB.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/161/00000/7019DC27-9C26-E511-84FF-02163E011CC2.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/163/00000/9C435096-9F26-E511-A1D7-02163E012AB6.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/164/00000/4633CC68-A326-E511-95D0-02163E0124EA.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/167/00000/E661FBF2-A726-E511-8B8B-02163E01207C.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/168/00000/FCB6CB61-BC26-E511-8858-02163E01375B.root' + # Double EG Run2015B +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/096/00000/8A2D533C-5626-E511-AF3C-02163E011FAB.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/161/00000/AC857A3B-9C26-E511-B32E-02163E012704.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/163/00000/9CB965BF-9F26-E511-8FB1-02163E012040.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/164/00000/2CA2349A-A526-E511-A371-02163E0138D0.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/167/00000/C446EC67-A726-E511-81C1-02163E0119E7.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/168/00000/747F782A-BB26-E511-BA24-02163E011EE9.root' + ) +) + +##################################################### + + +#-------------------------------------------------------------------------------- +# produce PAT-tuple +process.load("PhysicsTools/PatAlgos/patSequences_cff") +# configure pat::Jet production +# (enable L2L3Residual corrections in case running on Data) +#jetCorrections = ( 'L1FastJet', 'L2Relative', 'L3Absolute') +#from PhysicsTools.PatAlgos.tools.jetTools import * +#switchJetCollection( +# process, +# jetSource = cms.InputTag('ak4PFJetsCHS'), +# jetCorrections = ( 'AK4PFchs', jetCorrections, "" ), +# outputModules = [] +#) + +#process.patJets.addTagInfos = cms.bool(True) +#process.patJets.tagInfoSources = cms.VInputTag("impactParameterTagInfosAOD","secondaryVertexTagInfosAOD","softMuonTagInfosAOD") +#process.patJets.tagInfoSources = cms.VInputTag("secondaryVertexTagInfosEI") + + +#-------------------------------------------------------------------------------- +# switch to HPS PFTaus (and disable all "cleaning" cuts) +#from PhysicsTools.PatAlgos.tools.tauTools import * +#switchToPFTauHPS(process) + +#-------------------------------------------------------------------------------- +# select "good" reconstructed vertices +#process.load("TauAnalysis/RecoTools/recoVertexSelection_cff") + +#-------------------------------------------------------------------------------- +# electron Id (CSA14) -> +# input tags for electron id are hardcoded +# in class MyRootMaker +#process.load("EgammaAnalysis.ElectronTools.electronIdMVAProducer_CSA14_cfi") +#process.load("RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cff") + +# specify correct sources for MVA electron Id. +#process.electronIDValueMapProducer.ebReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEB") +#process.electronIDValueMapProducer.eeReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEE") +#process.electronIDValueMapProducer.esReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsES") + +#---------------------------------------------------------------------------------- +# produce PU Jet Ids & MVA MET +#---------------------------------------------------------------------------------- + +""" +process.skimOutputModule = cms.OutputModule("PoolOutputModule", + ##goldenZmumuEventContent, + outputCommands = cms.untracked.vstring( + 'drop *', + 'keep *_l1extraParticles_*_*' + ) +) +""" + + +process.tauPreSelectionDiTau = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 40. && abs(eta) < 2.5 && tauID("decayModeFindingNewDMs") > 0.5') +) + + +process.tauPreSelectionTauEle = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + + +process.tauPreSelectionTauMu = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + +process.muonPreSelectionMuEle = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 9. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + + +process.muonPreSelectionTauMu = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + +process.electronPreSelectionMuEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 13. && abs(eta) < 2.5') +) + + +process.electronPreSelectionTauEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5') +) + +process.leptonSkimSequence = cms.Sequence(process.electronPreSelectionMuEle + process.electronPreSelectionTauEle + process.muonPreSelectionTauMu + process.muonPreSelectionMuEle + process.tauPreSelectionTauMu + process.tauPreSelectionTauEle + process.tauPreSelectionDiTau) + +process.ak4PFJets = cms.EDProducer("FastjetJetProducer", + Active_Area_Repeats = cms.int32(1), + doAreaFastjet = cms.bool(True), + voronoiRfact = cms.double(-0.9), + maxBadHcalCells = cms.uint32(9999999), + doAreaDiskApprox = cms.bool(False), + maxRecoveredEcalCells = cms.uint32(9999999), + jetType = cms.string('PFJet'), + minSeed = cms.uint32(14327), + Ghost_EtaMax = cms.double(5.0), + doRhoFastjet = cms.bool(False), + jetAlgorithm = cms.string('AntiKt'), + nSigmaPU = cms.double(1.0), + GhostArea = cms.double(0.01), + Rho_EtaMax = cms.double(4.4), + maxBadEcalCells = cms.uint32(9999999), + useDeterministicSeed = cms.bool(True), + doPVCorrection = cms.bool(False), + maxRecoveredHcalCells = cms.uint32(9999999), + rParam = cms.double(0.4), + maxProblematicHcalCells = cms.uint32(9999999), + doOutputJets = cms.bool(True), + src = cms.InputTag("packedPFCandidates"), + inputEtMin = cms.double(0.0), + srcPVs = cms.InputTag(""), + jetPtMin = cms.double(3.0), + radiusPU = cms.double(0.5), + maxProblematicEcalCells = cms.uint32(9999999), + doPUOffsetCorr = cms.bool(False), + inputEMin = cms.double(0.0) +) + +process.calibratedAK4PFJetsForPFMVAMEt = cms.EDProducer("PFJetCorrectionProducer", + src = cms.InputTag("ak4PFJets"), + correctors = cms.vstring('ak4PFL1FastL2L3') +) + +process.puJetIdForPFMVAMEt = cms.EDProducer("PileupJetIdProducer", + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'jetPt', + 'jetEta', + 'jetPhi', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetID'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring(), + label = cms.string('full'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.3, 0.4, 0.7, 0.8), + Pt2030_Loose = cms.vdouble(0.0, 0.0, 0.2, 0.6), + Pt3050_Medium = cms.vdouble(0.3, 0.2, 0.7, 0.8), + Pt1020_Tight = cms.vdouble(-0.2, 0.2, 0.2, 0.6), + Pt2030_Medium = cms.vdouble(0.2, 0.2, 0.5, 0.7), + Pt010_Tight = cms.vdouble(0.5, 0.6, 0.6, 0.9), + Pt1020_Loose = cms.vdouble(-0.4, -0.4, -0.4, 0.4), + Pt010_Medium = cms.vdouble(0.2, 0.4, 0.2, 0.6), + Pt1020_Medium = cms.vdouble(-0.3, 0.0, 0.0, 0.5), + Pt010_Loose = cms.vdouble(0.0, 0.0, 0.0, 0.2), + Pt3050_Loose = cms.vdouble(0.0, 0.0, 0.6, 0.2), + Pt3050_Tight = cms.vdouble(0.5, 0.4, 0.8, 0.9) + ), + impactParTkThreshold = cms.double(0.0) + )), + inputIsCorrected = cms.bool(True), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + produceJetIds = cms.bool(True), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag("pileupJetIdCalculator"), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + runMvas = cms.bool(True) +) + +process.mvaMETDiTau = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionDiTau"), cms.InputTag("tauPreSelectionDiTau")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauMu = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauMu"), cms.InputTag("muonPreSelectionTauMu")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauEle"), cms.InputTag("electronPreSelectionTauEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETMuEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("muonPreSelectionMuEle"), cms.InputTag("electronPreSelectionMuEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.patMvaMetDiTau = process.patMETs.clone( + metSource = cms.InputTag('mvaMETDiTau'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauMu = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauMu'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetMuEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETMuEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) + +process.mvaMetSequence = cms.Sequence(process.leptonSkimSequence* process.ak4PFJets * process.calibratedAK4PFJetsForPFMVAMEt * + process.puJetIdForPFMVAMEt * process.mvaMETDiTau * process.mvaMETTauMu * + process.mvaMETTauEle * process.mvaMETMuEle * process.patMvaMetDiTau * + process.patMvaMetTauMu * process.patMvaMetTauEle * process.patMvaMetMuEle) + +process.pileupJetIdFull = cms.EDProducer("PileupJetIdProducer", + produceJetIds = cms.bool(True), + runMvas = cms.bool(True), + inputIsCorrected = cms.bool(False), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + residualsTxt = cms.FileInPath('RecoJets/JetProducers/data/download.url'), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag(""), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("ak4PFJets"), + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetIDMVAHighPt'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('CondFormats/JetMETObjects/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml'), + #tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring('jetPt', + 'jetEta', + 'jetPhi'), + label = cms.string('full53x'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42), + Pt2030_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt1020_MET = cms.vdouble(0.3, -0.2, -0.4, -0.4), + Pt2030_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt010_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt1020_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt3050_MET = cms.vdouble(0.0, 0.0, -0.1, -0.2), + Pt010_MET = cms.vdouble(0.0, -0.6, -0.4, -0.4), + Pt1020_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt010_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt1020_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt2030_MET = cms.vdouble(0.0, 0.0, 0.0, 0.0), + Pt010_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt3050_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42) + ), + impactParTkThreshold = cms.double(1.0) + )) +) +process.puJetIdSequence = cms.Sequence(process.pileupJetIdFull) +''' +process.load("PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff") +from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag +massSearchReplaceAnyInputTag(process.makePatJets, + "ak4PFJetsCHS", + "ak4PFJets", + verbose=True) +massSearchReplaceAnyInputTag(process.makePatJets, + 'offlinePrimaryVertices', + 'offlineSlimmedPrimaryVertices', + verbose=True) +process.patJetCorrFactors.payload = cms.string('AK4PF') +process.puJetIdSequence += process.makePatJets +''' +################################################## +# Main +process.makeroottree = cms.EDAnalyzer("NTupleMaker", +# data, year, period, skim +IsData = cms.untracked.bool(isData), +Year = cms.untracked.uint32(year), +Period = cms.untracked.string(period), +Skim = cms.untracked.uint32(0), +# switches of collections +GenParticles = cms.untracked.bool(True), +Trigger = cms.untracked.bool(True), +RecPrimVertex = cms.untracked.bool(True), +RecBeamSpot = cms.untracked.bool(True), +RecTrack = cms.untracked.bool(False), +RecPFMet = cms.untracked.bool(True), +RecMvaMet = cms.untracked.bool(True), +RecMuon = cms.untracked.bool(True), +RecPhoton = cms.untracked.bool(False), +RecElectron = cms.untracked.bool(True), +RecTau = cms.untracked.bool(True), +RecJet = cms.untracked.bool(True), +# collections +L1MuonCollectionTag = cms.InputTag("l1extraParticles"), +MuonCollectionTag = cms.InputTag("slimmedMuons"), +ElectronCollectionTag = cms.InputTag("slimmedElectrons"), +TauCollectionTag = cms.InputTag("slimmedTaus"), +JetCollectionTag = cms.InputTag("slimmedJets"), +MetCollectionTag = cms.InputTag("slimmedMETs"), +MvaMetCollectionsTag = cms.VInputTag("patMvaMetDiTau", "patMvaMetTauMu", "patMvaMetTauEle", "patMvaMetMuEle"), +TrackCollectionTag = cms.InputTag("generalTracks"), +GenParticleCollectionTag = cms.InputTag("prunedGenParticles"), +TriggerObjectCollectionTag = cms.InputTag("selectedPatTrigger"), +BeamSpotCollectionTag = cms.InputTag("offlineBeamSpot"), +PVCollectionTag = cms.InputTag("offlineSlimmedPrimaryVertices"), +# trigger info +HLTriggerPaths = cms.untracked.vstring( +'HLT_IsoMu24_eta2p1_v', +'HLT_Mu24_v', +'HLT_Mu24_eta2p1_v', +'HLT_Mu27_v', +'HLT_Mu34_v', +'HLT_Mu45_eta2p1_v', +'HLT_Mu17_Mu8_v', +'HLT_Mu17_Mu8_DZ_v', +'HLT_Mu17_Mu8_SameSign_DZ_v', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v' +), +TriggerProcess = cms.untracked.string("HLT"), +# tracks +RecTrackPtMin = cms.untracked.double(0.5), +RecTrackEtaMax = cms.untracked.double(2.4), +RecTrackNum = cms.untracked.int32(0), +# muons +RecMuonPtMin = cms.untracked.double(5.), +RecMuonEtaMax = cms.untracked.double(2.5), +RecMuonHLTriggerMatching = cms.untracked.vstring( +'HLT_IsoMu24_eta2p1_v.*:hltL3crIsoL1sMu20Eta2p1L1f0L2f10QL3f24QL3trkIsoFiltered0p09', +'HLT_Mu24_v.*:hltL3fL1sMu16L1f0L2f16L3Filtered24', +'HLT_Mu24_eta2p1_v.*:hltL3fL1sMu20Eta2p1L1f0L2f10QL3Filtered24Q', +'HLT_Mu27_v.*:hltL3fL1sMu25L1f0L2f10QL3Filtered27Q', +'HLT_Mu34_v.*:hltL3fL1sMu20L1f0L2f20L3Filtered34', +'HLT_Mu45_eta2p1_v.*:hltL3fL1sMu16orMu25L1f0L2f16QL3Filtered45e2p1Q', +'HLT_Mu17_Mu8_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_DZ_v.*:hltDiMuonGlb17Glb8DzFiltered0p2', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltDiMuonGlb17Glb8DzFiltered0p2', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltDiMuonGlb17Glb8DzFiltered0p2SameSign', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltDiMuonGlb17Glb8RelTrkIsoFiltered0p4DzFiltered0p2', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17' +), +RecMuonNum = cms.untracked.int32(0), +# photons +RecPhotonPtMin = cms.untracked.double(20.), +RecPhotonEtaMax = cms.untracked.double(10000.), +RecPhotonHLTriggerMatching = cms.untracked.vstring(), +RecPhotonNum = cms.untracked.int32(0), +# electrons +RecElectronPtMin = cms.untracked.double(8.), +RecElectronEtaMax = cms.untracked.double(2.6), +RecElectronHLTriggerMatching = cms.untracked.vstring( +), +RecElectronNum = cms.untracked.int32(0), +# taus +RecTauPtMin = cms.untracked.double(18), +RecTauEtaMax = cms.untracked.double(2.4), +RecTauHLTriggerMatching = cms.untracked.vstring( +), +RecTauFloatDiscriminators = cms.untracked.vstring( +#'againstElectronLoose', +#'againstElectronLooseMVA5', +#'againstElectronMVA5category', +#'againstElectronMVA5raw', +#'againstElectronMedium', +#'againstElectronMediumMVA5', +#'againstElectronTight', +#'againstElectronTightMVA5', +#'againstElectronVLooseMVA5', +#'againstElectronVTightMVA5', +#'againstMuonLoose', +#'againstMuonLoose2', +#'againstMuonLoose3', +#'againstMuonLooseMVA', +#'againstMuonMVAraw', +#'againstMuonMedium', +#'againstMuonMedium2', +#'againstMuonMediumMVA', +#'againstMuonTight', +#'againstMuonTight2', +#'againstMuonTight3', +#'againstMuonTightMVA', +#'byCombinedIsolationDeltaBetaCorrRaw3Hits', +#'byIsolationMVA3newDMwLTraw', +#'byIsolationMVA3newDMwoLTraw', +#'byIsolationMVA3oldDMwLTraw', +#'byIsolationMVA3oldDMwoLTraw', +#'byLooseCombinedIsolationDeltaBetaCorr3Hits', +#'byLooseIsolationMVA3newDMwLT', +#'byLooseIsolationMVA3newDMwoLT', +#'byLooseIsolationMVA3oldDMwLT', +#'byLooseIsolationMVA3oldDMwoLT', +#'byMediumCombinedIsolationDeltaBetaCorr3Hits', +#'byMediumIsolationMVA3newDMwLT', +#'byMediumIsolationMVA3newDMwoLT', +#'byMediumIsolationMVA3oldDMwLT', +#'byMediumIsolationMVA3oldDMwoLT', +#'byTightCombinedIsolationDeltaBetaCorr3Hits', +#'byTightIsolationMVA3newDMwLT', +#'byTightIsolationMVA3newDMwoLT', +#'byTightIsolationMVA3oldDMwLT', +#'byTightIsolationMVA3oldDMwoLT', +#'byVLooseIsolationMVA3newDMwLT', +#'byVLooseIsolationMVA3newDMwoLT', +#'byVLooseIsolationMVA3oldDMwLT', +#'byVLooseIsolationMVA3oldDMwoLT', +#'byVTightIsolationMVA3newDMwLT', +#'byVTightIsolationMVA3newDMwoLT', +#'byVTightIsolationMVA3oldDMwLT', +#'byVTightIsolationMVA3oldDMwoLT', +#'byVVTightIsolationMVA3newDMwLT', +#'byVVTightIsolationMVA3newDMwoLT', +#'byVVTightIsolationMVA3oldDMwLT', +#'byVVTightIsolationMVA3oldDMwoLT', +#'chargedIsoPtSum', +#'decayModeFinding', +#'decayModeFindingNewDMs', +#'neutralIsoPtSum', +#'puCorrPtSum' +), +RecTauBinaryDiscriminators = cms.untracked.vstring(), +RecTauNum = cms.untracked.int32(0), +# jets +RecJetPtMin = cms.untracked.double(18.), +RecJetEtaMax = cms.untracked.double(5.2), +RecJetHLTriggerMatching = cms.untracked.vstring(), +RecJetBtagDiscriminators = cms.untracked.vstring( +'jetBProbabilityBJetTags', +'jetProbabilityBJetTags', +'trackCountingHighPurBJetTags', +'trackCountingHighEffBJetTags', +'simpleSecondaryVertexHighEffBJetTags', +'simpleSecondaryVertexHighPurBJetTags', +'combinedInclusiveSecondaryVertexV2BJetTags', +'pfCombinedSecondaryVertexBJetTags', +'combinedMVABJetTags' +), +RecJetNum = cms.untracked.int32(0), +SampleName = cms.untracked.string("Data") +) + +#process.patJets.addBTagInfo = cms.bool(True) + + +process.p = cms.Path( +# process.particleFlowPtrs + +# process.makePatElectrons + +# process.makePatMuons + +# process.makePatJets + +# process.selectPrimaryVertex * +# process.patDefaultSequence * +# process.egmGsfElectronIDSequence * +# process.mvaTrigV025nsCSA14 * +# process.mvaNonTrigV025nsCSA14 * + #process.ak4PFJets* +# process.mvaMetSequence* +# process.puJetIdSequence* + process.makeroottree + ) + + + + + + +process.TFileService = cms.Service("TFileService", + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_4_6/src/DesyTauAnalyses/NTupleMaker/test/Ntuple74.root"), + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_2_3_patch1/src/DesyTauAnalyses/NTupleMaker/test/Staus/${1}_NTuple.root"), + fileName = cms.string("output.root") + ) + + +#process.end = cms.EndPath(process.Out*process.TFileService) + +#processDumpFile = open('MyRootMaker.dump', 'w') +#print >> processDumpFile, process.dumpPython() + + + + + +def customise_for_gc(process): + import FWCore.ParameterSet.Config as cms + from IOMC.RandomEngine.RandomServiceHelper import RandomNumberServiceHelper + + try: + maxevents = __MAX_EVENTS__ + process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(max(-1, maxevents)) + ) + except: + pass + + # Dataset related setup + try: + primaryFiles = [__FILE_NAMES__] + process.source = cms.Source('PoolSource', + skipEvents = cms.untracked.uint32(__SKIP_EVENTS__), + fileNames = cms.untracked.vstring(primaryFiles) + ) + try: + secondaryFiles = [__FILE_NAMES2__] + process.source.secondaryFileNames = cms.untracked.vstring(secondaryFiles) + except: + pass + try: + lumirange = [__LUMI_RANGE__] + if len(lumirange) > 0: + process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(lumirange) + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) + except: + pass + except: + pass + + if hasattr(process, 'RandomNumberGeneratorService'): + randSvc = RandomNumberServiceHelper(process.RandomNumberGeneratorService) + randSvc.populate() + + process.AdaptorConfig = cms.Service('AdaptorConfig', + enable = cms.untracked.bool(True), + stats = cms.untracked.bool(True), + ) + + # Generator related setup + try: + if hasattr(process, 'generator') and process.source.type_() != 'PoolSource': + process.source.firstLuminosityBlock = cms.untracked.uint32(1 + __MY_JOBID__) + print 'Generator random seed:', process.RandomNumberGeneratorService.generator.initialSeed + except: + pass + + return (process) + +process = customise_for_gc(process) + +# grid-control: https://ekptrac.physik.uni-karlsruhe.de/trac/grid-control + + + diff --git a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Run2015C_Dimuon.py b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Run2015C_Dimuon.py new file mode 100644 index 0000000..bd4a948 --- /dev/null +++ b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_Run2015C_Dimuon.py @@ -0,0 +1,762 @@ +import FWCore.ParameterSet.Config as cms + +isData = True +#skim = 0 +year = 2015 +period = 'Run2015B' +#sampleName = 'MonteCarlo' +# sampleName = 'TTJets', "QCD", "DYJetsToLL_M50" + +#if "@SKIM@".lower()=="0": +# skim = 0 + +#sampleName = "@SAMPLE_NAME@" + +process = cms.Process("TreeProducer") + +process.load('FWCore/MessageService/MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.MessageLogger.cerr.threshold = cms.untracked.string('INFO') +#process.load('Configuration.StandardSequences.Geometry_cff') +#process.load('Configuration.Geometry.GeometryIdeal_cff') +#process.load('Configuration.StandardSequences.MagneticField_cff') +#process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff') + +process.load('Configuration/StandardSequences/Services_cff') +process.load("Configuration.Geometry.GeometryDB_cff") +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff') +process.load("Configuration.StandardSequences.MagneticField_cff") + +from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V7C', '') +process.GlobalTag = GlobalTag(process.GlobalTag, '74X_dataRun2_Prompt_v0', '') + +#process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9::Al') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + # Single Muon Run2015B +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/164/00000/544E58CD-A226-E511-834E-02163E0134D6.root', +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/167/00000/EE9594B8-A826-E511-A18B-02163E011A7D.root', +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/4E8E390B-EA26-E511-9EDA-02163E013567.root', +# '/store/data/Run2015B/SingleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/60FF8405-EA26-E511-A892-02163E01387D.root' + # Double Muon Run2015B +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/162/00000/12284DB9-4227-E511-A438-02163E013674.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/164/00000/402F0995-A326-E511-86BB-02163E013948.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/167/00000/70C4A781-A826-E511-95B4-02163E013414.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/168/00000/627E9C65-DD26-E511-87FB-02163E013576.root', +# '/store/data/Run2015B/DoubleMuon/MINIAOD/PromptReco-v1/000/251/244/00000/E42FEF61-6E27-E511-B93A-02163E0143C0.root' + # Single Electron Run2015B +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/096/00000/22D22D7F-5626-E511-BDE3-02163E011FAB.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/161/00000/7019DC27-9C26-E511-84FF-02163E011CC2.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/163/00000/9C435096-9F26-E511-A1D7-02163E012AB6.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/164/00000/4633CC68-A326-E511-95D0-02163E0124EA.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/167/00000/E661FBF2-A726-E511-8B8B-02163E01207C.root', +# '/store/data/Run2015B/SingleElectron/MINIAOD/PromptReco-v1/000/251/168/00000/FCB6CB61-BC26-E511-8858-02163E01375B.root' + # Double EG Run2015B +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/096/00000/8A2D533C-5626-E511-AF3C-02163E011FAB.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/161/00000/AC857A3B-9C26-E511-B32E-02163E012704.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/163/00000/9CB965BF-9F26-E511-8FB1-02163E012040.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/164/00000/2CA2349A-A526-E511-A371-02163E0138D0.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/167/00000/C446EC67-A726-E511-81C1-02163E0119E7.root', +# '/store/data/Run2015B/DoubleEG/MINIAOD/PromptReco-v1/000/251/168/00000/747F782A-BB26-E511-BA24-02163E011EE9.root' + # Single Muon Run2015C + '/store/data/Run2015C/SingleMuon/MINIAOD/PromptReco-v1/000/253/888/00000/DA473838-0941-E511-9644-02163E014405.root', + '/store/data/Run2015C/SingleMuon/MINIAOD/PromptReco-v1/000/253/890/00000/B0BE6B62-0941-E511-8FBB-02163E014499.root', + '/store/data/Run2015C/SingleMuon/MINIAOD/PromptReco-v1/000/253/944/00000/BA286EB7-5141-E511-8829-02163E01437D.root', + '/store/data/Run2015C/SingleMuon/MINIAOD/PromptReco-v1/000/253/952/00000/C6F1C99F-4241-E511-A877-02163E01439D.root', + '/store/data/Run2015C/SingleMuon/MINIAOD/PromptReco-v1/000/253/954/00000/824EBBD8-4541-E511-BDA3-02163E014419.root' + ) +) + +##################################################### + + +#-------------------------------------------------------------------------------- +# produce PAT-tuple +process.load("PhysicsTools/PatAlgos/patSequences_cff") +# configure pat::Jet production +# (enable L2L3Residual corrections in case running on Data) +#jetCorrections = ( 'L1FastJet', 'L2Relative', 'L3Absolute') +#from PhysicsTools.PatAlgos.tools.jetTools import * +#switchJetCollection( +# process, +# jetSource = cms.InputTag('ak4PFJetsCHS'), +# jetCorrections = ( 'AK4PFchs', jetCorrections, "" ), +# outputModules = [] +#) + +#process.patJets.addTagInfos = cms.bool(True) +#process.patJets.tagInfoSources = cms.VInputTag("impactParameterTagInfosAOD","secondaryVertexTagInfosAOD","softMuonTagInfosAOD") +#process.patJets.tagInfoSources = cms.VInputTag("secondaryVertexTagInfosEI") + + +#-------------------------------------------------------------------------------- +# switch to HPS PFTaus (and disable all "cleaning" cuts) +#from PhysicsTools.PatAlgos.tools.tauTools import * +#switchToPFTauHPS(process) + +#-------------------------------------------------------------------------------- +# select "good" reconstructed vertices +#process.load("TauAnalysis/RecoTools/recoVertexSelection_cff") + +#-------------------------------------------------------------------------------- +# electron Id (CSA14) -> +# input tags for electron id are hardcoded +# in class MyRootMaker +#process.load("EgammaAnalysis.ElectronTools.electronIdMVAProducer_CSA14_cfi") +#process.load("RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cff") + +# specify correct sources for MVA electron Id. +#process.electronIDValueMapProducer.ebReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEB") +#process.electronIDValueMapProducer.eeReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEE") +#process.electronIDValueMapProducer.esReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsES") + +#---------------------------------------------------------------------------------- +# produce PU Jet Ids & MVA MET +#---------------------------------------------------------------------------------- + +""" +process.skimOutputModule = cms.OutputModule("PoolOutputModule", + ##goldenZmumuEventContent, + outputCommands = cms.untracked.vstring( + 'drop *', + 'keep *_l1extraParticles_*_*' + ) +) +""" + + +process.tauPreSelectionDiTau = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 40. && abs(eta) < 2.5 && tauID("decayModeFindingNewDMs") > 0.5') +) + + +process.tauPreSelectionTauEle = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + + +process.tauPreSelectionTauMu = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + +process.muonPreSelectionMuEle = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 9. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + + +process.muonPreSelectionTauMu = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + +process.electronPreSelectionMuEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 13. && abs(eta) < 2.5') +) + + +process.electronPreSelectionTauEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5') +) + +process.leptonSkimSequence = cms.Sequence(process.electronPreSelectionMuEle + process.electronPreSelectionTauEle + process.muonPreSelectionTauMu + process.muonPreSelectionMuEle + process.tauPreSelectionTauMu + process.tauPreSelectionTauEle + process.tauPreSelectionDiTau) + +process.ak4PFJets = cms.EDProducer("FastjetJetProducer", + Active_Area_Repeats = cms.int32(1), + doAreaFastjet = cms.bool(True), + voronoiRfact = cms.double(-0.9), + maxBadHcalCells = cms.uint32(9999999), + doAreaDiskApprox = cms.bool(False), + maxRecoveredEcalCells = cms.uint32(9999999), + jetType = cms.string('PFJet'), + minSeed = cms.uint32(14327), + Ghost_EtaMax = cms.double(5.0), + doRhoFastjet = cms.bool(False), + jetAlgorithm = cms.string('AntiKt'), + nSigmaPU = cms.double(1.0), + GhostArea = cms.double(0.01), + Rho_EtaMax = cms.double(4.4), + maxBadEcalCells = cms.uint32(9999999), + useDeterministicSeed = cms.bool(True), + doPVCorrection = cms.bool(False), + maxRecoveredHcalCells = cms.uint32(9999999), + rParam = cms.double(0.4), + maxProblematicHcalCells = cms.uint32(9999999), + doOutputJets = cms.bool(True), + src = cms.InputTag("packedPFCandidates"), + inputEtMin = cms.double(0.0), + srcPVs = cms.InputTag(""), + jetPtMin = cms.double(3.0), + radiusPU = cms.double(0.5), + maxProblematicEcalCells = cms.uint32(9999999), + doPUOffsetCorr = cms.bool(False), + inputEMin = cms.double(0.0) +) + +process.calibratedAK4PFJetsForPFMVAMEt = cms.EDProducer("PFJetCorrectionProducer", + src = cms.InputTag("ak4PFJets"), + correctors = cms.vstring('ak4PFL1FastL2L3') +) + +process.puJetIdForPFMVAMEt = cms.EDProducer("PileupJetIdProducer", + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'jetPt', + 'jetEta', + 'jetPhi', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetID'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring(), + label = cms.string('full'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.3, 0.4, 0.7, 0.8), + Pt2030_Loose = cms.vdouble(0.0, 0.0, 0.2, 0.6), + Pt3050_Medium = cms.vdouble(0.3, 0.2, 0.7, 0.8), + Pt1020_Tight = cms.vdouble(-0.2, 0.2, 0.2, 0.6), + Pt2030_Medium = cms.vdouble(0.2, 0.2, 0.5, 0.7), + Pt010_Tight = cms.vdouble(0.5, 0.6, 0.6, 0.9), + Pt1020_Loose = cms.vdouble(-0.4, -0.4, -0.4, 0.4), + Pt010_Medium = cms.vdouble(0.2, 0.4, 0.2, 0.6), + Pt1020_Medium = cms.vdouble(-0.3, 0.0, 0.0, 0.5), + Pt010_Loose = cms.vdouble(0.0, 0.0, 0.0, 0.2), + Pt3050_Loose = cms.vdouble(0.0, 0.0, 0.6, 0.2), + Pt3050_Tight = cms.vdouble(0.5, 0.4, 0.8, 0.9) + ), + impactParTkThreshold = cms.double(0.0) + )), + inputIsCorrected = cms.bool(True), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + produceJetIds = cms.bool(True), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag("pileupJetIdCalculator"), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + runMvas = cms.bool(True) +) + +process.mvaMETDiTau = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionDiTau"), cms.InputTag("tauPreSelectionDiTau")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauMu = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauMu"), cms.InputTag("muonPreSelectionTauMu")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauEle"), cms.InputTag("electronPreSelectionTauEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETMuEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("muonPreSelectionMuEle"), cms.InputTag("electronPreSelectionMuEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.patMvaMetDiTau = process.patMETs.clone( + metSource = cms.InputTag('mvaMETDiTau'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauMu = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauMu'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetMuEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETMuEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) + +process.mvaMetSequence = cms.Sequence(process.leptonSkimSequence* process.ak4PFJets * process.calibratedAK4PFJetsForPFMVAMEt * + process.puJetIdForPFMVAMEt * process.mvaMETDiTau * process.mvaMETTauMu * + process.mvaMETTauEle * process.mvaMETMuEle * process.patMvaMetDiTau * + process.patMvaMetTauMu * process.patMvaMetTauEle * process.patMvaMetMuEle) + +process.pileupJetIdFull = cms.EDProducer("PileupJetIdProducer", + produceJetIds = cms.bool(True), + runMvas = cms.bool(True), + inputIsCorrected = cms.bool(False), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + residualsTxt = cms.FileInPath('RecoJets/JetProducers/data/download.url'), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag(""), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("ak4PFJets"), + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetIDMVAHighPt'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('CondFormats/JetMETObjects/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml'), + #tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring('jetPt', + 'jetEta', + 'jetPhi'), + label = cms.string('full53x'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42), + Pt2030_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt1020_MET = cms.vdouble(0.3, -0.2, -0.4, -0.4), + Pt2030_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt010_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt1020_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt3050_MET = cms.vdouble(0.0, 0.0, -0.1, -0.2), + Pt010_MET = cms.vdouble(0.0, -0.6, -0.4, -0.4), + Pt1020_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt010_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt1020_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt2030_MET = cms.vdouble(0.0, 0.0, 0.0, 0.0), + Pt010_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt3050_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42) + ), + impactParTkThreshold = cms.double(1.0) + )) +) +process.puJetIdSequence = cms.Sequence(process.pileupJetIdFull) +''' +process.load("PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff") +from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag +massSearchReplaceAnyInputTag(process.makePatJets, + "ak4PFJetsCHS", + "ak4PFJets", + verbose=True) +massSearchReplaceAnyInputTag(process.makePatJets, + 'offlinePrimaryVertices', + 'offlineSlimmedPrimaryVertices', + verbose=True) +process.patJetCorrFactors.payload = cms.string('AK4PF') +process.puJetIdSequence += process.makePatJets +''' +################################################## +# Main +process.makeroottree = cms.EDAnalyzer("NTupleMaker", +# data, year, period, skim +IsData = cms.untracked.bool(isData), +Year = cms.untracked.uint32(year), +Period = cms.untracked.string(period), +Skim = cms.untracked.uint32(0), +# switches of collections +GenParticles = cms.untracked.bool(True), +Trigger = cms.untracked.bool(True), +RecPrimVertex = cms.untracked.bool(True), +RecBeamSpot = cms.untracked.bool(True), +RecTrack = cms.untracked.bool(False), +RecPFMet = cms.untracked.bool(True), +RecMvaMet = cms.untracked.bool(True), +RecMuon = cms.untracked.bool(True), +RecPhoton = cms.untracked.bool(False), +RecElectron = cms.untracked.bool(True), +RecTau = cms.untracked.bool(True), +RecJet = cms.untracked.bool(True), +# collections +L1MuonCollectionTag = cms.InputTag("l1extraParticles"), +MuonCollectionTag = cms.InputTag("slimmedMuons"), +ElectronCollectionTag = cms.InputTag("slimmedElectrons"), +TauCollectionTag = cms.InputTag("slimmedTaus"), +JetCollectionTag = cms.InputTag("slimmedJets"), +MetCollectionTag = cms.InputTag("slimmedMETs"), +MvaMetCollectionsTag = cms.VInputTag("patMvaMetDiTau", "patMvaMetTauMu", "patMvaMetTauEle", "patMvaMetMuEle"), +TrackCollectionTag = cms.InputTag("generalTracks"), +GenParticleCollectionTag = cms.InputTag("prunedGenParticles"), +TriggerObjectCollectionTag = cms.InputTag("selectedPatTrigger"), +BeamSpotCollectionTag = cms.InputTag("offlineBeamSpot"), +PVCollectionTag = cms.InputTag("offlineSlimmedPrimaryVertices"), +# trigger info +HLTriggerPaths = cms.untracked.vstring( +'HLT_IsoMu24_eta2p1_v', +'HLT_Mu24_v', +'HLT_Mu24_eta2p1_v', +'HLT_Mu27_v', +'HLT_Mu34_v', +'HLT_Mu17_Mu8_v', +'HLT_Mu17_Mu8_DZ_v', +'HLT_Mu17_Mu8_SameSign_DZ_v', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v' +), +TriggerProcess = cms.untracked.string("HLT"), +# tracks +RecTrackPtMin = cms.untracked.double(0.5), +RecTrackEtaMax = cms.untracked.double(2.4), +RecTrackNum = cms.untracked.int32(0), +# muons +RecMuonPtMin = cms.untracked.double(5.), +RecMuonEtaMax = cms.untracked.double(2.5), +RecMuonHLTriggerMatching = cms.untracked.vstring( +'HLT_IsoMu24_eta2p1_v.*:hltL3crIsoL1sMu20Eta2p1L1f0L2f10QL3f24QL3trkIsoFiltered0p09', +'HLT_Mu24_v.*:hltL3fL1sMu16L1f0L2f16L3Filtered24', +'HLT_Mu24_eta2p1_v.*:hltL3fL1sMu20Eta2p1L1f0L2f10QL3Filtered24Q', +'HLT_Mu27_v.*:hltL3fL1sMu25L1f0L2f10QL3Filtered27Q', +'HLT_Mu34_v.*:hltL3fL1sMu20L1f0L2f20L3Filtered34', +'HLT_Mu17_Mu8_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_DZ_v.*:hltDiMuonGlb17Glb8DzFiltered0p2', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltDiMuonGlb17Glb8DzFiltered0p2', +'HLT_Mu17_Mu8_SameSign_DZ_v.*:hltDiMuonGlb17Glb8DzFiltered0p2SameSign', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v.*:hltDiMuonGlb17Glb8RelTrkIsoFiltered0p4DzFiltered0p2', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v.*:hltL3pfL1sDoubleMu103p5L1f0L2pf0L3PreFiltered8', +'HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v.*:hltL3fL1sDoubleMu103p5L1f0L2f10OneMuL3Filtered17' +), +RecMuonNum = cms.untracked.int32(0), +# photons +RecPhotonPtMin = cms.untracked.double(20.), +RecPhotonEtaMax = cms.untracked.double(10000.), +RecPhotonHLTriggerMatching = cms.untracked.vstring(), +RecPhotonNum = cms.untracked.int32(0), +# electrons +RecElectronPtMin = cms.untracked.double(8.), +RecElectronEtaMax = cms.untracked.double(2.6), +RecElectronHLTriggerMatching = cms.untracked.vstring( +), +RecElectronNum = cms.untracked.int32(0), +# taus +RecTauPtMin = cms.untracked.double(18), +RecTauEtaMax = cms.untracked.double(2.4), +RecTauHLTriggerMatching = cms.untracked.vstring( +), +RecTauFloatDiscriminators = cms.untracked.vstring( +#'againstElectronLoose', +#'againstElectronLooseMVA5', +#'againstElectronMVA5category', +#'againstElectronMVA5raw', +#'againstElectronMedium', +#'againstElectronMediumMVA5', +#'againstElectronTight', +#'againstElectronTightMVA5', +#'againstElectronVLooseMVA5', +#'againstElectronVTightMVA5', +#'againstMuonLoose', +#'againstMuonLoose2', +#'againstMuonLoose3', +#'againstMuonLooseMVA', +#'againstMuonMVAraw', +#'againstMuonMedium', +#'againstMuonMedium2', +#'againstMuonMediumMVA', +#'againstMuonTight', +#'againstMuonTight2', +#'againstMuonTight3', +#'againstMuonTightMVA', +#'byCombinedIsolationDeltaBetaCorrRaw3Hits', +#'byIsolationMVA3newDMwLTraw', +#'byIsolationMVA3newDMwoLTraw', +#'byIsolationMVA3oldDMwLTraw', +#'byIsolationMVA3oldDMwoLTraw', +#'byLooseCombinedIsolationDeltaBetaCorr3Hits', +#'byLooseIsolationMVA3newDMwLT', +#'byLooseIsolationMVA3newDMwoLT', +#'byLooseIsolationMVA3oldDMwLT', +#'byLooseIsolationMVA3oldDMwoLT', +#'byMediumCombinedIsolationDeltaBetaCorr3Hits', +#'byMediumIsolationMVA3newDMwLT', +#'byMediumIsolationMVA3newDMwoLT', +#'byMediumIsolationMVA3oldDMwLT', +#'byMediumIsolationMVA3oldDMwoLT', +#'byTightCombinedIsolationDeltaBetaCorr3Hits', +#'byTightIsolationMVA3newDMwLT', +#'byTightIsolationMVA3newDMwoLT', +#'byTightIsolationMVA3oldDMwLT', +#'byTightIsolationMVA3oldDMwoLT', +#'byVLooseIsolationMVA3newDMwLT', +#'byVLooseIsolationMVA3newDMwoLT', +#'byVLooseIsolationMVA3oldDMwLT', +#'byVLooseIsolationMVA3oldDMwoLT', +#'byVTightIsolationMVA3newDMwLT', +#'byVTightIsolationMVA3newDMwoLT', +#'byVTightIsolationMVA3oldDMwLT', +#'byVTightIsolationMVA3oldDMwoLT', +#'byVVTightIsolationMVA3newDMwLT', +#'byVVTightIsolationMVA3newDMwoLT', +#'byVVTightIsolationMVA3oldDMwLT', +#'byVVTightIsolationMVA3oldDMwoLT', +#'chargedIsoPtSum', +#'decayModeFinding', +#'decayModeFindingNewDMs', +#'neutralIsoPtSum', +#'puCorrPtSum' +), +RecTauBinaryDiscriminators = cms.untracked.vstring(), +RecTauNum = cms.untracked.int32(0), +# jets +RecJetPtMin = cms.untracked.double(18.), +RecJetEtaMax = cms.untracked.double(5.2), +RecJetHLTriggerMatching = cms.untracked.vstring(), +RecJetBtagDiscriminators = cms.untracked.vstring( +'jetBProbabilityBJetTags', +'jetProbabilityBJetTags', +'trackCountingHighPurBJetTags', +'trackCountingHighEffBJetTags', +'simpleSecondaryVertexHighEffBJetTags', +'simpleSecondaryVertexHighPurBJetTags', +'combinedInclusiveSecondaryVertexV2BJetTags', +'pfCombinedSecondaryVertexBJetTags', +'combinedMVABJetTags' +), +RecJetNum = cms.untracked.int32(0), +SampleName = cms.untracked.string("Data") +) + +#process.patJets.addBTagInfo = cms.bool(True) + + +process.p = cms.Path( +# process.particleFlowPtrs + +# process.makePatElectrons + +# process.makePatMuons + +# process.makePatJets + +# process.selectPrimaryVertex * +# process.patDefaultSequence * +# process.egmGsfElectronIDSequence * +# process.mvaTrigV025nsCSA14 * +# process.mvaNonTrigV025nsCSA14 * + #process.ak4PFJets* +# process.mvaMetSequence* +# process.puJetIdSequence* + process.makeroottree + ) + + + + + + +process.TFileService = cms.Service("TFileService", + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_4_6/src/DesyTauAnalyses/NTupleMaker/test/Ntuple74.root"), + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_2_3_patch1/src/DesyTauAnalyses/NTupleMaker/test/Staus/${1}_NTuple.root"), + fileName = cms.string("output.root") + ) + + +#process.end = cms.EndPath(process.Out*process.TFileService) + +#processDumpFile = open('MyRootMaker.dump', 'w') +#print >> processDumpFile, process.dumpPython() + + + + + +def customise_for_gc(process): + import FWCore.ParameterSet.Config as cms + from IOMC.RandomEngine.RandomServiceHelper import RandomNumberServiceHelper + + try: + maxevents = __MAX_EVENTS__ + process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(max(-1, maxevents)) + ) + except: + pass + + # Dataset related setup + try: + primaryFiles = [__FILE_NAMES__] + process.source = cms.Source('PoolSource', + skipEvents = cms.untracked.uint32(__SKIP_EVENTS__), + fileNames = cms.untracked.vstring(primaryFiles) + ) + try: + secondaryFiles = [__FILE_NAMES2__] + process.source.secondaryFileNames = cms.untracked.vstring(secondaryFiles) + except: + pass + try: + lumirange = [__LUMI_RANGE__] + if len(lumirange) > 0: + process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(lumirange) + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) + except: + pass + except: + pass + + if hasattr(process, 'RandomNumberGeneratorService'): + randSvc = RandomNumberServiceHelper(process.RandomNumberGeneratorService) + randSvc.populate() + + process.AdaptorConfig = cms.Service('AdaptorConfig', + enable = cms.untracked.bool(True), + stats = cms.untracked.bool(True), + ) + + # Generator related setup + try: + if hasattr(process, 'generator') and process.source.type_() != 'PoolSource': + process.source.firstLuminosityBlock = cms.untracked.uint32(1 + __MY_JOBID__) + print 'Generator random seed:', process.RandomNumberGeneratorService.generator.initialSeed + except: + pass + + return (process) + +process = customise_for_gc(process) + +# grid-control: https://ekptrac.physik.uni-karlsruhe.de/trac/grid-control + + + diff --git a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_eventWeights.py b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_eventWeights.py new file mode 100644 index 0000000..6f03862 --- /dev/null +++ b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_eventWeights.py @@ -0,0 +1,770 @@ +import FWCore.ParameterSet.Config as cms + +isData = False +#skim = 0 +year = 2015 +#period = 'Spring15' +#sampleName = 'MonteCarlo' +# sampleName = 'TTJets', "QCD", "DYJetsToLL_M50" + +#if "@SKIM@".lower()=="0": +# skim = 0 + +#sampleName = "@SAMPLE_NAME@" + +process = cms.Process("TreeProducer") + +process.load('FWCore/MessageService/MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.MessageLogger.cerr.threshold = cms.untracked.string('INFO') +#process.load('Configuration.StandardSequences.Geometry_cff') +#process.load('Configuration.Geometry.GeometryIdeal_cff') +#process.load('Configuration.StandardSequences.MagneticField_cff') +#process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff') + +process.load('Configuration/StandardSequences/Services_cff') +process.load("Configuration.Geometry.GeometryDB_cff") +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff') +process.load("Configuration.StandardSequences.MagneticField_cff") + +from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V7C', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V9A', '') +#process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V9', '') +#process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9::Al') +#process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1000) +) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + # SUSYGluGluToBBHToTauTau_M-160 +# '/store/mc/RunIISpring15DR74/SUSYGluGluToBBHToTauTau_M-160_TuneCUETP8M1_13TeV-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v2/50000/1A81092B-1A11-E511-B683-002618943849.root' + # SUSYGluGluToHToTauTau_M-160 +# '/store/mc/RunIISpring15DR74/SUSYGluGluToHToTauTau_M-160_TuneCUETP8M1_13TeV-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v1/10000/2A3929AE-5303-E511-9EFE-0025905A48C0.root' + # DYJetsToLL_M-50 (aMC@NLO 25ns) + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/009D49A5-7314-E511-84EF-0025905A605E.root' + # DYJetsToLL_M-50 (aMC@NLO 50ns) +# '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/00000/02DE3B74-6C08-E511-ABE3-0025905A60D0.root' + # TTJets +# '/store/mc/RunIISpring15DR74/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v1/00000/00466730-F801-E511-9594-549F35AF450A.root' + ) +## dropDescendantsOfDroppedBranches=cms.untracked.bool(False), +## inputCommands=cms.untracked.vstring( +## 'keep *', +## 'drop patTaus_*_*_*', +## 'drop *PFTau*_*_*_*' +## ) +) + +##################################################### + + +#-------------------------------------------------------------------------------- +# produce PAT-tuple +process.load("PhysicsTools/PatAlgos/patSequences_cff") +# configure pat::Jet production +# (enable L2L3Residual corrections in case running on Data) +#jetCorrections = ( 'L1FastJet', 'L2Relative', 'L3Absolute') +#from PhysicsTools.PatAlgos.tools.jetTools import * +#switchJetCollection( +# process, +# jetSource = cms.InputTag('ak4PFJetsCHS'), +# jetCorrections = ( 'AK4PFchs', jetCorrections, "" ), +# outputModules = [] +#) + +#process.patJets.addTagInfos = cms.bool(True) +#process.patJets.tagInfoSources = cms.VInputTag("impactParameterTagInfosAOD","secondaryVertexTagInfosAOD","softMuonTagInfosAOD") +#process.patJets.tagInfoSources = cms.VInputTag("secondaryVertexTagInfosEI") + + +#-------------------------------------------------------------------------------- +# switch to HPS PFTaus (and disable all "cleaning" cuts) +#from PhysicsTools.PatAlgos.tools.tauTools import * +#switchToPFTauHPS(process) + +#-------------------------------------------------------------------------------- +# select "good" reconstructed vertices +#process.load("TauAnalysis/RecoTools/recoVertexSelection_cff") + +#-------------------------------------------------------------------------------- +# electron Id (CSA14) -> +# input tags for electron id are hardcoded +# in class MyRootMaker +#process.load("EgammaAnalysis.ElectronTools.electronIdMVAProducer_CSA14_cfi") +#process.load("RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cff") + +# specify correct sources for MVA electron Id. +#process.electronIDValueMapProducer.ebReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEB") +#process.electronIDValueMapProducer.eeReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsEE") +#process.electronIDValueMapProducer.esReducedRecHitCollection = cms.InputTag("reducedEcalRecHitsES") + +#---------------------------------------------------------------------------------- +# produce PU Jet Ids & MVA MET +#---------------------------------------------------------------------------------- + +""" +process.skimOutputModule = cms.OutputModule("PoolOutputModule", + ##goldenZmumuEventContent, + outputCommands = cms.untracked.vstring( + 'drop *', + 'keep *_l1extraParticles_*_*' + ) +) +""" + + +process.tauPreSelectionDiTau = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 40. && abs(eta) < 2.5 && tauID("decayModeFindingNewDMs") > 0.5') +) + + +process.tauPreSelectionTauEle = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + + +process.tauPreSelectionTauMu = cms.EDFilter("PATTauSelector", + src = cms.InputTag("slimmedTaus"), + cut = cms.string('pt > 15. && abs(eta) < 2.5 && tauID("decayModeFinding") > 0.5') +) + +process.muonPreSelectionMuEle = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 9. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + + +process.muonPreSelectionTauMu = cms.EDFilter("PATMuonSelector", + src = cms.InputTag("slimmedMuons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5 && isPFMuon && (isGlobalMuon || isTrackerMuon)') +) + +process.electronPreSelectionMuEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 13. && abs(eta) < 2.5') +) + + +process.electronPreSelectionTauEle = cms.EDFilter("PATElectronSelector", + src = cms.InputTag("slimmedElectrons"), + cut = cms.string('pt > 20. && abs(eta) < 2.5') +) + +process.leptonSkimSequence = cms.Sequence(process.electronPreSelectionMuEle + process.electronPreSelectionTauEle + process.muonPreSelectionTauMu + process.muonPreSelectionMuEle + process.tauPreSelectionTauMu + process.tauPreSelectionTauEle + process.tauPreSelectionDiTau) + +process.ak4PFJets = cms.EDProducer("FastjetJetProducer", + Active_Area_Repeats = cms.int32(1), + doAreaFastjet = cms.bool(True), + voronoiRfact = cms.double(-0.9), + maxBadHcalCells = cms.uint32(9999999), + doAreaDiskApprox = cms.bool(False), + maxRecoveredEcalCells = cms.uint32(9999999), + jetType = cms.string('PFJet'), + minSeed = cms.uint32(14327), + Ghost_EtaMax = cms.double(5.0), + doRhoFastjet = cms.bool(False), + jetAlgorithm = cms.string('AntiKt'), + nSigmaPU = cms.double(1.0), + GhostArea = cms.double(0.01), + Rho_EtaMax = cms.double(4.4), + maxBadEcalCells = cms.uint32(9999999), + useDeterministicSeed = cms.bool(True), + doPVCorrection = cms.bool(False), + maxRecoveredHcalCells = cms.uint32(9999999), + rParam = cms.double(0.4), + maxProblematicHcalCells = cms.uint32(9999999), + doOutputJets = cms.bool(True), + src = cms.InputTag("packedPFCandidates"), + inputEtMin = cms.double(0.0), + srcPVs = cms.InputTag(""), + jetPtMin = cms.double(3.0), + radiusPU = cms.double(0.5), + maxProblematicEcalCells = cms.uint32(9999999), + doPUOffsetCorr = cms.bool(False), + inputEMin = cms.double(0.0) +) + +process.calibratedAK4PFJetsForPFMVAMEt = cms.EDProducer("PFJetCorrectionProducer", + src = cms.InputTag("ak4PFJets"), + correctors = cms.vstring('ak4PFL1FastL2L3') +) + +process.puJetIdForPFMVAMEt = cms.EDProducer("PileupJetIdProducer", + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'jetPt', + 'jetEta', + 'jetPhi', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetID'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring(), + label = cms.string('full'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.3, 0.4, 0.7, 0.8), + Pt2030_Loose = cms.vdouble(0.0, 0.0, 0.2, 0.6), + Pt3050_Medium = cms.vdouble(0.3, 0.2, 0.7, 0.8), + Pt1020_Tight = cms.vdouble(-0.2, 0.2, 0.2, 0.6), + Pt2030_Medium = cms.vdouble(0.2, 0.2, 0.5, 0.7), + Pt010_Tight = cms.vdouble(0.5, 0.6, 0.6, 0.9), + Pt1020_Loose = cms.vdouble(-0.4, -0.4, -0.4, 0.4), + Pt010_Medium = cms.vdouble(0.2, 0.4, 0.2, 0.6), + Pt1020_Medium = cms.vdouble(-0.3, 0.0, 0.0, 0.5), + Pt010_Loose = cms.vdouble(0.0, 0.0, 0.0, 0.2), + Pt3050_Loose = cms.vdouble(0.0, 0.0, 0.6, 0.2), + Pt3050_Tight = cms.vdouble(0.5, 0.4, 0.8, 0.9) + ), + impactParTkThreshold = cms.double(0.0) + )), + inputIsCorrected = cms.bool(True), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + produceJetIds = cms.bool(True), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag("pileupJetIdCalculator"), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + runMvas = cms.bool(True) +) + +process.mvaMETDiTau = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionDiTau"), cms.InputTag("tauPreSelectionDiTau")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauMu = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauMu"), cms.InputTag("muonPreSelectionTauMu")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETTauEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("tauPreSelectionTauEle"), cms.InputTag("electronPreSelectionTauEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.mvaMETMuEle = cms.EDProducer("PFMETProducerMVA", + useType1 = cms.bool(True), + srcLeptons = cms.VInputTag(cms.InputTag("muonPreSelectionMuEle"), cms.InputTag("electronPreSelectionMuEle")), + verbosity = cms.int32(0), + srcCorrJets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"), + srcVertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + corrector = cms.string('ak4PFL1Fastjet'), + loadMVAfromDB = cms.bool(False), + dZcut = cms.double(0.1), + inputFileNames = cms.PSet( + DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrphi_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_7_2_X_MINIAOD_BX25PU20_Mar2015.root'), + CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_7_2_X_MINIAOD_BX25PU20_Mar2015.root') + ), + srcRho = cms.InputTag("fixedGridRhoFastjetAll"), + srcMVAPileupJetId = cms.InputTag("puJetIdForPFMVAMEt","fullDiscriminant"), + srcUncorrJets = cms.InputTag("ak4PFJets"), + minNumLeptons = cms.int32(0), + globalThreshold = cms.double(-1.0), + permuteLeptons = cms.bool(True), + minCorrJetPt = cms.double(-1.0), + inputRecords = cms.PSet( + DPhi = cms.string('PhiCor'), + CovU2 = cms.string('CovU2'), + U = cms.string('RecoilCor'), + CovU1 = cms.string('CovU1') + ), + srcPFCandidates = cms.InputTag("packedPFCandidates") +) + +process.patMvaMetDiTau = process.patMETs.clone( + metSource = cms.InputTag('mvaMETDiTau'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauMu = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauMu'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetTauEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETTauEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) +process.patMvaMetMuEle = process.patMETs.clone( + metSource = cms.InputTag('mvaMETMuEle'), + addMuonCorrections = cms.bool(False), + genMETSource = cms.InputTag('genMetTrue'), + addGenMET = cms.bool(False) + ) + +process.mvaMetSequence = cms.Sequence(process.leptonSkimSequence* process.ak4PFJets * process.calibratedAK4PFJetsForPFMVAMEt * + process.puJetIdForPFMVAMEt * process.mvaMETDiTau * process.mvaMETTauMu * + process.mvaMETTauEle * process.mvaMETMuEle * process.patMvaMetDiTau * + process.patMvaMetTauMu * process.patMvaMetTauEle * process.patMvaMetMuEle) + +process.pileupJetIdFull = cms.EDProducer("PileupJetIdProducer", + produceJetIds = cms.bool(True), + runMvas = cms.bool(True), + inputIsCorrected = cms.bool(False), + vertexes = cms.InputTag("offlineSlimmedPrimaryVertices"), + residualsTxt = cms.FileInPath('RecoJets/JetProducers/data/download.url'), + jec = cms.string('AK4PF'), + residualsFromTxt = cms.bool(False), + applyJec = cms.bool(True), + jetids = cms.InputTag(""), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + jets = cms.InputTag("ak4PFJets"), + algos = cms.VPSet(cms.PSet( + tmvaVariables = cms.vstring('nvtx', + 'dZ', + 'beta', + 'betaStar', + 'nCharged', + 'nNeutrals', + 'dR2Mean', + 'ptD', + 'frac01', + 'frac02', + 'frac03', + 'frac04', + 'frac05'), + tmvaMethod = cms.string('JetIDMVAHighPt'), + cutBased = cms.bool(False), + tmvaWeights = cms.string('CondFormats/JetMETObjects/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml'), + #tmvaWeights = cms.string('RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_53X_Dec2012.weights.xml.gz'), + tmvaSpectators = cms.vstring('jetPt', + 'jetEta', + 'jetPhi'), + label = cms.string('full53x'), + version = cms.int32(-1), + JetIdParams = cms.PSet( + Pt2030_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42), + Pt2030_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt1020_MET = cms.vdouble(0.3, -0.2, -0.4, -0.4), + Pt2030_Medium = cms.vdouble(0.1, -0.36, -0.54, -0.54), + Pt010_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt1020_Tight = cms.vdouble(-0.83, -0.81, -0.74, -0.81), + Pt3050_MET = cms.vdouble(0.0, 0.0, -0.1, -0.2), + Pt010_MET = cms.vdouble(0.0, -0.6, -0.4, -0.4), + Pt1020_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt010_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt1020_Medium = cms.vdouble(-0.83, -0.92, -0.9, -0.92), + Pt2030_MET = cms.vdouble(0.0, 0.0, 0.0, 0.0), + Pt010_Loose = cms.vdouble(-0.95, -0.96, -0.94, -0.95), + Pt3050_Loose = cms.vdouble(-0.63, -0.6, -0.55, -0.45), + Pt3050_Tight = cms.vdouble(0.73, 0.05, -0.26, -0.42) + ), + impactParTkThreshold = cms.double(1.0) + )) +) +process.puJetIdSequence = cms.Sequence(process.pileupJetIdFull) +''' +process.load("PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff") +from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag +massSearchReplaceAnyInputTag(process.makePatJets, + "ak4PFJetsCHS", + "ak4PFJets", + verbose=True) +massSearchReplaceAnyInputTag(process.makePatJets, + 'offlinePrimaryVertices', + 'offlineSlimmedPrimaryVertices', + verbose=True) +process.patJetCorrFactors.payload = cms.string('AK4PF') +process.puJetIdSequence += process.makePatJets +''' +################################################## +# Main + +#process.patJets.addBTagInfo = cms.bool(True) +process.makeroottree = cms.EDAnalyzer("NTupleMaker", +# data, year, period, skim +IsData = cms.untracked.bool(isData), +Year = cms.untracked.uint32(year), +Period = cms.untracked.string("Spring15"), +Skim = cms.untracked.uint32(0), +# switches of collections +GenParticles = cms.untracked.bool(True), +Trigger = cms.untracked.bool(True), +RecPrimVertex = cms.untracked.bool(True), +RecBeamSpot = cms.untracked.bool(True), +RecTrack = cms.untracked.bool(False), +RecPFMet = cms.untracked.bool(True), +RecMvaMet = cms.untracked.bool(True), +RecMuon = cms.untracked.bool(True), +RecPhoton = cms.untracked.bool(False), +RecElectron = cms.untracked.bool(True), +RecTau = cms.untracked.bool(True), +RecJet = cms.untracked.bool(True), +# collections +MuonCollectionTag = cms.InputTag("slimmedMuons"), +L1MuonCollectionTag = cms.InputTag("l1extraParticles"), +ElectronCollectionTag = cms.InputTag("slimmedElectrons"), +TauCollectionTag = cms.InputTag("slimmedTaus"), +JetCollectionTag = cms.InputTag("slimmedJets"), +MetCollectionTag = cms.InputTag("slimmedMETs"), +MvaMetCollectionsTag = cms.VInputTag("patMvaMetDiTau", "patMvaMetTauMu", "patMvaMetTauEle", "patMvaMetMuEle"), +TrackCollectionTag = cms.InputTag("generalTracks"), +GenParticleCollectionTag = cms.InputTag("prunedGenParticles"), +TriggerObjectCollectionTag = cms.InputTag("selectedPatTrigger"), +BeamSpotCollectionTag = cms.InputTag("offlineBeamSpot"), +PVCollectionTag = cms.InputTag("offlineSlimmedPrimaryVertices"), +# trigger info +HLTriggerPaths = cms.untracked.vstring( +'HLT_Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_v', +'HLT_Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v', +'HLT_IsoMu24_eta2p1_v', +'HLT_IsoMu27_v', +'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v', +'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v', +'HLT_Ele23_WPLoose_Gsf_v', +'HLT_Ele22_eta2p1_WP75_Gsf_v', +'HLT_Ele27_eta2p1_WP75_Gsf_v', +'HLT_Ele32_eta2p1_WP75_Gsf_v', +'HLT_Ele22_eta2p1_WPLoose_Gsf_v', +'HLT_Ele27_eta2p1_WPLoose_Gsf_v', +'HLT_Ele32_eta2p1_WPLoose_Gsf_v', +'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v', +), +TriggerProcess = cms.untracked.string("HLT"), +# tracks +RecTrackPtMin = cms.untracked.double(0.5), +RecTrackEtaMax = cms.untracked.double(2.4), +RecTrackNum = cms.untracked.int32(0), +# muons +RecMuonPtMin = cms.untracked.double(8.), +RecMuonEtaMax = cms.untracked.double(2.5), +RecMuonHLTriggerMatching = cms.untracked.vstring( +'HLT_Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_v.*:hltMu8TrkIsoVVLEle23CaloIdLTrackIdLIsoVLMuonlegL3IsoFiltered8', +'HLT_Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v.*:hltMu23TrkIsoVVLEle12CaloIdLTrackIdLIsoVLMuonlegL3IsoFiltered23', +'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltL3crIsoL1sMu16erTauJet20erL1f0L2f10QL3f17QL3trkIsoFiltered0p09', +'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltOverlapFilterIsoMu17LooseIsoPFTau20', +'HLT_IsoMu24_eta2p1_v.*:hltL3crIsoL1sMu20Eta2p1L1f0L2f10QL3f24QL3trkIsoFiltered0p09', +'HLT_IsoMu27_v.*:hltL3crIsoL1sMu25L1f0L2f10QL3f27QL3trkIsoFiltered0p09' +), +RecMuonNum = cms.untracked.int32(0), +# photons +RecPhotonPtMin = cms.untracked.double(20.), +RecPhotonEtaMax = cms.untracked.double(10000.), +RecPhotonHLTriggerMatching = cms.untracked.vstring(), +RecPhotonNum = cms.untracked.int32(0), +# electrons +RecElectronPtMin = cms.untracked.double(8.), +RecElectronEtaMax = cms.untracked.double(2.6), +RecElectronHLTriggerMatching = cms.untracked.vstring( +'HLT_Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v.*:hltMu23TrkIsoVVLEle12CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter', +'HLT_Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_v.*:hltMu8TrkIsoVVLEle23CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLDZFilter', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltSingleEle22WP75GsfTrackIsoFilter', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', +'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltSingleEle22WPLooseGsfTrackIsoFilter', +'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WPLooseGsfLooseIsoPFTau20', +'HLT_Ele22_eta2p1_WP75_Gsf_v.*:hltSingleEle22WP75GsfTrackIsoFilter', +'HLT_Ele27_eta2p1_WP75_Gsf_v.*:hltEle27WP75GsfTrackIsoFilter', +'HLT_Ele32_eta2p1_WP75_Gsf_v.*:hltEle32WP75GsfTrackIsoFilter', +'HLT_Ele23_WPLoose_Gsf_v.*:hltEle23WPLooseGsfTrackIsoFilter', +'HLT_Ele22_eta2p1_WPLoose_Gsf_v.*:hltEle22WPLooseGsfTrackIsoFilter', +'HLT_Ele27_eta2p1_WPLoose_Gsf_v.*:hltEle27WPLooseGsfTrackIsoFilter', +'HLT_Ele32_eta2p1_WPLoose_Gsf_v.*:hltEle32WPLooseGsfTrackIsoFilter' +), +RecElectronNum = cms.untracked.int32(0), +# taus +RecTauPtMin = cms.untracked.double(18), +RecTauEtaMax = cms.untracked.double(2.4), +RecTauHLTriggerMatching = cms.untracked.vstring( +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', +#'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', +#'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WPLooseGsfLooseIsoPFTau20', +#'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIsoAgainstMuon', +#'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltOverlapFilterIsoMu17LooseIsoPFTau20', +#'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v.*:hltDoublePFTau40TrackPt1MediumIsolationDz02Reg' +), +RecTauFloatDiscriminators = cms.untracked.vstring( +#'againstElectronLoose', +#'againstElectronLooseMVA5', +#'againstElectronMVA5category', +#'againstElectronMVA5raw', +#'againstElectronMedium', +#'againstElectronMediumMVA5', +#'againstElectronTight', +#'againstElectronTightMVA5', +#'againstElectronVLooseMVA5', +#'againstElectronVTightMVA5', +#'againstMuonLoose', +#'againstMuonLoose2', +#'againstMuonLoose3', +#'againstMuonLooseMVA', +#'againstMuonMVAraw', +#'againstMuonMedium', +#'againstMuonMedium2', +#'againstMuonMediumMVA', +#'againstMuonTight', +#'againstMuonTight2', +#'againstMuonTight3', +#'againstMuonTightMVA', +#'byCombinedIsolationDeltaBetaCorrRaw3Hits', +#'byIsolationMVA3newDMwLTraw', +#'byIsolationMVA3newDMwoLTraw', +#'byIsolationMVA3oldDMwLTraw', +#'byIsolationMVA3oldDMwoLTraw', +#'byLooseCombinedIsolationDeltaBetaCorr3Hits', +#'byLooseIsolationMVA3newDMwLT', +#'byLooseIsolationMVA3newDMwoLT', +#'byLooseIsolationMVA3oldDMwLT', +#'byLooseIsolationMVA3oldDMwoLT', +#'byMediumCombinedIsolationDeltaBetaCorr3Hits', +#'byMediumIsolationMVA3newDMwLT', +#'byMediumIsolationMVA3newDMwoLT', +#'byMediumIsolationMVA3oldDMwLT', +#'byMediumIsolationMVA3oldDMwoLT', +#'byTightCombinedIsolationDeltaBetaCorr3Hits', +#'byTightIsolationMVA3newDMwLT', +#'byTightIsolationMVA3newDMwoLT', +#'byTightIsolationMVA3oldDMwLT', +#'byTightIsolationMVA3oldDMwoLT', +#'byVLooseIsolationMVA3newDMwLT', +#'byVLooseIsolationMVA3newDMwoLT', +#'byVLooseIsolationMVA3oldDMwLT', +#'byVLooseIsolationMVA3oldDMwoLT', +#'byVTightIsolationMVA3newDMwLT', +#'byVTightIsolationMVA3newDMwoLT', +#'byVTightIsolationMVA3oldDMwLT', +#'byVTightIsolationMVA3oldDMwoLT', +#'byVVTightIsolationMVA3newDMwLT', +#'byVVTightIsolationMVA3newDMwoLT', +#'byVVTightIsolationMVA3oldDMwLT', +#'byVVTightIsolationMVA3oldDMwoLT', +#'chargedIsoPtSum', +#'decayModeFinding', +#'decayModeFindingNewDMs', +#'neutralIsoPtSum', +#'puCorrPtSum' +), +RecTauBinaryDiscriminators = cms.untracked.vstring(), +RecTauNum = cms.untracked.int32(0), +# jets +RecJetPtMin = cms.untracked.double(18.), +RecJetEtaMax = cms.untracked.double(5.2), +RecJetHLTriggerMatching = cms.untracked.vstring(), +RecJetBtagDiscriminators = cms.untracked.vstring( +'jetBProbabilityBJetTags', +'jetProbabilityBJetTags', +'trackCountingHighPurBJetTags', +'trackCountingHighEffBJetTags', +'simpleSecondaryVertexHighEffBJetTags', +'simpleSecondaryVertexHighPurBJetTags', +'combinedInclusiveSecondaryVertexV2BJetTags', +'pfCombinedSecondaryVertexBJetTags', +'pfCombinedInclusiveSecondaryVertexV2BJetTags', +'combinedMVABJetTags' +), +RecJetNum = cms.untracked.int32(0), +SampleName = cms.untracked.string("MC") +) + +process.eventCount = cms.EDAnalyzer("EventCount", +DoMC = cms.bool(True), +HepMcSource = cms.InputTag("generator") +) + +process.p = cms.Path( +# process.particleFlowPtrs + +# process.makePatElectrons + +# process.makePatMuons + +# process.makePatJets + +# process.selectPrimaryVertex * +# process.patDefaultSequence * +# process.egmGsfElectronIDSequence * +# process.mvaTrigV025nsCSA14 * +# process.mvaNonTrigV025nsCSA14 * + #process.ak4PFJets* +# process.mvaMetSequence* +# process.puJetIdSequence* + process.eventCount* + process.makeroottree + ) + + + + + + +process.TFileService = cms.Service("TFileService", + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_4_6/src/DesyTauAnalyses/NTupleMaker/test/Ntuple74.root"), + #fileName = cms.string("/nfs/dust/cms/user/alkaloge/TauAnalysis/new/CMSSW_7_2_3_patch1/src/DesyTauAnalyses/NTupleMaker/test/Staus/${1}_NTuple.root"), + fileName = cms.string("output.root") + ) + + +#process.end = cms.EndPath(process.Out*process.TFileService) + +#processDumpFile = open('MyRootMaker.dump', 'w') +#print >> processDumpFile, process.dumpPython() + + + + + +def customise_for_gc(process): + import FWCore.ParameterSet.Config as cms + from IOMC.RandomEngine.RandomServiceHelper import RandomNumberServiceHelper + + try: + maxevents = __MAX_EVENTS__ + process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(max(-1, maxevents)) + ) + except: + pass + + # Dataset related setup + try: + primaryFiles = [__FILE_NAMES__] + process.source = cms.Source('PoolSource', + skipEvents = cms.untracked.uint32(__SKIP_EVENTS__), + fileNames = cms.untracked.vstring(primaryFiles) + ) + try: + secondaryFiles = [__FILE_NAMES2__] + process.source.secondaryFileNames = cms.untracked.vstring(secondaryFiles) + except: + pass + try: + lumirange = [__LUMI_RANGE__] + if len(lumirange) > 0: + process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange(lumirange) + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) + except: + pass + except: + pass + + if hasattr(process, 'RandomNumberGeneratorService'): + randSvc = RandomNumberServiceHelper(process.RandomNumberGeneratorService) + randSvc.populate() + + process.AdaptorConfig = cms.Service('AdaptorConfig', + enable = cms.untracked.bool(True), + stats = cms.untracked.bool(True), + ) + + # Generator related setup + try: + if hasattr(process, 'generator') and process.source.type_() != 'PoolSource': + process.source.firstLuminosityBlock = cms.untracked.uint32(1 + __MY_JOBID__) + print 'Generator random seed:', process.RandomNumberGeneratorService.generator.initialSeed + except: + pass + + return (process) + +process = customise_for_gc(process) + +# grid-control: https://ekptrac.physik.uni-karlsruhe.de/trac/grid-control + + + diff --git a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_25ns.py b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_25ns.py index 6dd3eaf..6d000b1 100644 --- a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_25ns.py +++ b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_25ns.py @@ -29,13 +29,13 @@ from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag #process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V7C', '') -#process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V9A', '') -process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V9', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V9A', '') +#process.GlobalTag = GlobalTag(process.GlobalTag, 'MCRUN2_74_V9', '') #process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9::Al') #process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9') process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(50) + input = cms.untracked.int32(1000) ) process.source = cms.Source("PoolSource", @@ -45,10 +45,11 @@ # SUSYGluGluToHToTauTau_M-160 # '/store/mc/RunIISpring15DR74/SUSYGluGluToHToTauTau_M-160_TuneCUETP8M1_13TeV-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v1/10000/2A3929AE-5303-E511-9EFE-0025905A48C0.root' # DYJetsToLL_M-50 (aMC@NLO 25ns) -# '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/009D49A5-7314-E511-84EF-0025905A605E.root' + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/009D49A5-7314-E511-84EF-0025905A605E.root' # DYJetsToLL_M-50 (aMC@NLO 50ns) # '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/00000/02DE3B74-6C08-E511-ABE3-0025905A60D0.root' - '/store/mc/RunIISpring15DR74/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v1/00000/022B08C4-C702-E511-9995-D4856459AC30.root' + # TTJets +# '/store/mc/RunIISpring15DR74/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v1/00000/00466730-F801-E511-9594-549F35AF450A.root' ) ## dropDescendantsOfDroppedBranches=cms.untracked.bool(False), ## inputCommands=cms.untracked.vstring( @@ -496,6 +497,7 @@ RecJet = cms.untracked.bool(True), # collections MuonCollectionTag = cms.InputTag("slimmedMuons"), +L1MuonCollectionTag = cms.InputTag("l1extraParticles"), ElectronCollectionTag = cms.InputTag("slimmedElectrons"), TauCollectionTag = cms.InputTag("slimmedTaus"), JetCollectionTag = cms.InputTag("slimmedJets"), @@ -510,10 +512,11 @@ HLTriggerPaths = cms.untracked.vstring( 'HLT_Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_v', 'HLT_Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v', 'HLT_IsoMu24_eta2p1_v', 'HLT_IsoMu27_v', 'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v', -'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v', 'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v', 'HLT_Ele23_WPLoose_Gsf_v', 'HLT_Ele22_eta2p1_WP75_Gsf_v', @@ -522,7 +525,7 @@ 'HLT_Ele22_eta2p1_WPLoose_Gsf_v', 'HLT_Ele27_eta2p1_WPLoose_Gsf_v', 'HLT_Ele32_eta2p1_WPLoose_Gsf_v', -'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v' +'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v', ), TriggerProcess = cms.untracked.string("HLT"), # tracks @@ -552,8 +555,11 @@ RecElectronHLTriggerMatching = cms.untracked.vstring( 'HLT_Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v.*:hltMu23TrkIsoVVLEle12CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter', 'HLT_Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_v.*:hltMu8TrkIsoVVLEle23CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter', -'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltEle22WP75L1IsoEG20erTau20erGsfTrackIsoFilter', -'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLDZFilter', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltSingleEle22WP75GsfTrackIsoFilter', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', 'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltSingleEle22WPLooseGsfTrackIsoFilter', 'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WPLooseGsfLooseIsoPFTau20', 'HLT_Ele22_eta2p1_WP75_Gsf_v.*:hltSingleEle22WP75GsfTrackIsoFilter', @@ -569,13 +575,13 @@ RecTauPtMin = cms.untracked.double(18), RecTauEtaMax = cms.untracked.double(2.4), RecTauHLTriggerMatching = cms.untracked.vstring( -'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', -'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', -'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', -'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WPLooseGsfLooseIsoPFTau20', -'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIsoAgainstMuon', -'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltOverlapFilterIsoMu17LooseIsoPFTau20', -'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v.*:hltDoublePFTau40TrackPt1MediumIsolationDz02Reg' +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', +#'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', +#'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WPLooseGsfLooseIsoPFTau20', +#'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIsoAgainstMuon', +#'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltOverlapFilterIsoMu17LooseIsoPFTau20', +#'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v.*:hltDoublePFTau40TrackPt1MediumIsolationDz02Reg' ), RecTauFloatDiscriminators = cms.untracked.vstring( #'againstElectronLoose', @@ -672,8 +678,8 @@ # process.mvaTrigV025nsCSA14 * # process.mvaNonTrigV025nsCSA14 * #process.ak4PFJets* - #process.mvaMetSequence* - #process.puJetIdSequence* +# process.mvaMetSequence* +# process.puJetIdSequence* process.makeroottree ) diff --git a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_50ns.py b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_50ns.py index d501ad7..9a5ec93 100644 --- a/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_50ns.py +++ b/DesyTauAnalyses/NTupleMaker/test/TreeProducerFromMiniAOD_74x_noMVAMet_50ns.py @@ -35,7 +35,7 @@ #process.GlobalTag.globaltag = cms.string('MCRUN2_74_V9') process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(100) + input = cms.untracked.int32(1000) ) process.source = cms.Source("PoolSource", @@ -45,10 +45,11 @@ # SUSYGluGluToHToTauTau_M-160 # '/store/mc/RunIISpring15DR74/SUSYGluGluToHToTauTau_M-160_TuneCUETP8M1_13TeV-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v1/10000/2A3929AE-5303-E511-9EFE-0025905A48C0.root' # DYJetsToLL_M-50 (aMC@NLO 25ns) -# '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/009D49A5-7314-E511-84EF-0025905A605E.root' + '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v3/10000/009D49A5-7314-E511-84EF-0025905A605E.root' # DYJetsToLL_M-50 (aMC@NLO 50ns) # '/store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/00000/02DE3B74-6C08-E511-ABE3-0025905A60D0.root' - '/store/mc/RunIISpring15DR74/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v1/00000/00466730-F801-E511-9594-549F35AF450A.root' + # TTJets +# '/store/mc/RunIISpring15DR74/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v1/00000/00466730-F801-E511-9594-549F35AF450A.root' ) ## dropDescendantsOfDroppedBranches=cms.untracked.bool(False), ## inputCommands=cms.untracked.vstring( @@ -496,6 +497,7 @@ RecJet = cms.untracked.bool(True), # collections MuonCollectionTag = cms.InputTag("slimmedMuons"), +L1MuonCollectionTag = cms.InputTag("l1extraParticles"), ElectronCollectionTag = cms.InputTag("slimmedElectrons"), TauCollectionTag = cms.InputTag("slimmedTaus"), JetCollectionTag = cms.InputTag("slimmedJets"), @@ -510,6 +512,7 @@ HLTriggerPaths = cms.untracked.vstring( 'HLT_Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_v', 'HLT_Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v', 'HLT_IsoMu24_eta2p1_v', 'HLT_IsoMu27_v', 'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v', @@ -522,7 +525,7 @@ 'HLT_Ele22_eta2p1_WPLoose_Gsf_v', 'HLT_Ele27_eta2p1_WPLoose_Gsf_v', 'HLT_Ele32_eta2p1_WPLoose_Gsf_v', -'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v' +'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v', ), TriggerProcess = cms.untracked.string("HLT"), # tracks @@ -552,6 +555,9 @@ RecElectronHLTriggerMatching = cms.untracked.vstring( 'HLT_Mu23_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v.*:hltMu23TrkIsoVVLEle12CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter', 'HLT_Mu8_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL_v.*:hltMu8TrkIsoVVLEle23CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter', +'HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v.*:hltEle23Ele12CaloIdLTrackIdLIsoVLDZFilter', 'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltSingleEle22WP75GsfTrackIsoFilter', 'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', 'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltSingleEle22WPLooseGsfTrackIsoFilter', @@ -569,13 +575,13 @@ RecTauPtMin = cms.untracked.double(18), RecTauEtaMax = cms.untracked.double(2.4), RecTauHLTriggerMatching = cms.untracked.vstring( -'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', -'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', -'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', -'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WPLooseGsfLooseIsoPFTau20', -'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIsoAgainstMuon', -'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltOverlapFilterIsoMu17LooseIsoPFTau20', -'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v.*:hltDoublePFTau40TrackPt1MediumIsolationDz02Reg' +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', +#'HLT_Ele22_eta2p1_WP75_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WP75GsfLooseIsoPFTau20', +#'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIso', +#'HLT_Ele22_eta2p1_WPLoose_Gsf_LooseIsoPFTau20_v.*:hltOverlapFilterIsoEle22WPLooseGsfLooseIsoPFTau20', +#'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltPFTau20TrackLooseIsoAgainstMuon', +#'HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v.*:hltOverlapFilterIsoMu17LooseIsoPFTau20', +#'HLT_DoubleMediumIsoPFTau40_Trk1_eta2p1_Reg_v.*:hltDoublePFTau40TrackPt1MediumIsolationDz02Reg' ), RecTauFloatDiscriminators = cms.untracked.vstring( #'againstElectronLoose',