diff --git a/Core/interface/BareLeptons.hpp b/Core/interface/BareLeptons.hpp index 56d3dba..555a2a6 100644 --- a/Core/interface/BareLeptons.hpp +++ b/Core/interface/BareLeptons.hpp @@ -79,6 +79,11 @@ class BareLeptons : virtual public BareP4 vector *kinfitPtErr{0}; TClonesArray *fsrP4{0}; // at most 1. + vector *dxy{0}; + vector *dz{0}; + + vector *dxybs{0}; + vector *dzbs{0}; }; diff --git a/Core/src/BareLeptons.cpp b/Core/src/BareLeptons.cpp index 4cf3e5f..c16770a 100644 --- a/Core/src/BareLeptons.cpp +++ b/Core/src/BareLeptons.cpp @@ -26,6 +26,10 @@ BareLeptons::~BareLeptons(){ BareFunctions::Delete(kinfitP4); BareFunctions::Delete(kinfitPtErr); BareFunctions::Delete(fsrP4); + BareFunctions::Delete(dxy); + BareFunctions::Delete(dz); + BareFunctions::Delete(dxybs); + BareFunctions::Delete(dzbs); } void BareLeptons::init(){ @@ -53,6 +57,11 @@ void BareLeptons::init(){ BareFunctions::New(kinfitP4); BareFunctions::New(kinfitPtErr); BareFunctions::New(fsrP4); + BareFunctions::New(dxy); + BareFunctions::New(dz); + + BareFunctions::New(dxybs); + BareFunctions::New(dzbs); } void BareLeptons::clear(){ @@ -84,6 +93,11 @@ void BareLeptons::clear(){ kinfitPtErr->clear(); fsrP4->Clear(); + dxy->clear(); + dz->clear(); + dxybs->clear(); + dzbs->clear(); + } void BareLeptons::defineBranches(TTree*t){ @@ -123,6 +137,10 @@ void BareLeptons::defineBranches(TTree*t){ t->Branch( "lepKinfitP4","TClonesArray", &kinfitP4, 128000, 0); t->Branch( "lepFsrP4","TClonesArray", &fsrP4, 128000, 0); + t->Branch("lepDxy","vector",&dxy); + t->Branch("lepDz","vector",&dz); + t->Branch("lepDxyBS","vector",&dxybs); + t->Branch("lepDzBS","vector",&dzbs); } @@ -155,6 +173,12 @@ void BareLeptons::setBranchAddresses(TTree*t){ BareFunctions::SetBranchAddress(t,"lepKinfitPtErr",&kinfitPtErr); BareFunctions::SetBranchAddress(t,"lepKinfitP4",&kinfitP4); BareFunctions::SetBranchAddress(t,"lepFsrP4",&fsrP4); + + BareFunctions::SetBranchAddress(t,"lepDxy",&dxy); + BareFunctions::SetBranchAddress(t,"lepDz",&dz); + + BareFunctions::SetBranchAddress(t,"lepDxyBS",&dxybs); + BareFunctions::SetBranchAddress(t,"lepDzBS",&dzbs); } BAREREGISTER(BareLeptons); diff --git a/Nero/interface/NeroLeptons.hpp b/Nero/interface/NeroLeptons.hpp index 1c6c7fb..a9b5a8c 100644 --- a/Nero/interface/NeroLeptons.hpp +++ b/Nero/interface/NeroLeptons.hpp @@ -9,6 +9,7 @@ // Electron corrector #include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h" +#include "DataFormats/BeamSpot/interface/BeamSpot.h" class NeroLeptons : virtual public NeroCollection, virtual public BareLeptons @@ -26,7 +27,7 @@ class NeroLeptons : virtual public NeroCollection, public: myLepton(){ chiso=-999; nhiso=-999; phoiso=-999; puiso=-999;mva = -999; miniiso=-999; etasc=0; sieie=0; sipip=0; sieip=0; r9=0; ecorr=1; - resolution =-999; nlayers=-999; + resolution =-999; nlayers=-999; kinfitP4.SetPxPyPzE(0,0,0,0); kinfitPtErr=-999; fsrP4.SetPxPyPzE(0,0,0,0); @@ -57,6 +58,11 @@ class NeroLeptons : virtual public NeroCollection, float resolution; int nlayers; + + float dxy{-999}; + float dz{-999}; + float dxy2{-999}; + float dz2{-999}; }; @@ -68,6 +74,7 @@ class NeroLeptons : virtual public NeroCollection, // --- Token edm::EDGetTokenT vtx_token; edm::EDGetTokenT token_pf; + edm::EDGetTokenT beamspot_token; // Token edm::EDGetTokenT mu_token; @@ -106,6 +113,7 @@ class NeroLeptons : virtual public NeroCollection, edm::Handle vtx_handle; edm::Handle handle_pf; + edm::Handle beamspot_handle; // for miniiso edm::Handle rho_handle; diff --git a/Nero/script/duplicate_removal.py b/Nero/script/duplicate_removal.py index 4735e1a..eaefe16 100755 --- a/Nero/script/duplicate_removal.py +++ b/Nero/script/duplicate_removal.py @@ -10,7 +10,7 @@ from subprocess import call, check_output import re import math -EOS = "/afs/cern.ch/project/eos/installation/0.3.84-aquamarine/bin/eos.select" +EOS = "/usr/bin/eos" usage = ''' script to remove duplicates when running on data. The script is meant for multiple submission, diff --git a/Nero/src/NeroLeptons.cpp b/Nero/src/NeroLeptons.cpp index 664b800..b7a154d 100644 --- a/Nero/src/NeroLeptons.cpp +++ b/Nero/src/NeroLeptons.cpp @@ -57,6 +57,7 @@ NeroLeptons::NeroLeptons(edm::ConsumesCollector & cc,edm::ParameterSet iConfig): #endif vtx_token = cc.consumes(iConfig.getParameter("vertices")); + beamspot_token = cc.consumes(edm::InputTag("offlineBeamSpot")); token_pf = cc.consumes(iConfig.getParameter("pfCands")); ea_ . reset (new EffectiveAreas( edm::FileInPath(iConfig.getParameter("eleEA")).fullPath () ) ); mu_token = cc.consumes(iConfig.getParameter("muons")); @@ -121,6 +122,9 @@ int NeroLeptons::analyze(const edm::Event & iEvent) const reco::Vertex *pv = &vtx_handle->front(); iEvent.getByToken(token_pf, handle_pf); + iEvent.getByToken(beamspot_token, beamspot_handle); + const reco::BeamSpot *bs = &(*beamspot_handle); // recast + iEvent.getByToken(mu_token,mu_handle); iEvent.getByToken(el_token,el_handle); @@ -234,11 +238,22 @@ int NeroLeptons::analyze(const edm::Event & iEvent) l.selBits |= unsigned(LepHighPt * myid::isHighPtMuon(mu,*pv)) ; l.pfPt = mu.pfP4().pt(); + + // + if (not mu.innerTrack().isNull()) + { + l.dz = mu.innerTrack()->dz(pv->position()); + l.dxy = mu.innerTrack()->dxy(pv->position()); + //offlineBeamSpot + l.dz2 = mu.innerTrack()->dz(bs->position()); + l.dxy2 = mu.innerTrack()->dxy(bs->position()); + } if (mu.hasUserCand("cutBasedFsrPhoton")) { pat::PFParticle *pho = (pat::PFParticle *)(mu.userCand("cutBasedFsrPhoton").get()); - l.fsrP4.SetPtEtaPhiM(pho->pt(),pho->eta(),pho->phi(),0.); + //l.fsrP4.SetPtEtaPhiM(pho->pt(),pho->eta(),pho->phi(),0.); + l.fsrP4.SetPtEtaPhiM(pho->userFloat("correctedPt"),pho->eta(),pho->phi(),0.); } l.chiso = chiso; @@ -378,6 +393,14 @@ int NeroLeptons::analyze(const edm::Event & iEvent) l.sieip = el.full5x5_sigmaIetaIphi(); l.r9 = el.r9(); + if ( not el.gsfTrack().isNull()){ + l.dz = el.gsfTrack()->dz(pv->position()); + l.dxy = el.gsfTrack()->dxy(pv->position()); + //offlineBeamSpot + l.dz2 = el.gsfTrack()->dz(bs->position()); + l.dxy2 = el.gsfTrack()->dxy(bs->position()); + } + // float chIso = el.chargedHadronIso(); // float nhIso = el.neutralHadronIso(); // float phoIso = el.photonIso(); @@ -530,6 +553,11 @@ int NeroLeptons::analyze(const edm::Event & iEvent) resolution -> push_back(l.resolution); nLayers -> push_back(l.nlayers); + dxy -> push_back(l.dxy); + dz -> push_back(l.dz); + dxybs -> push_back(l.dxy2); + dzbs -> push_back(l.dz2); + //kinfit new ( (*kinfitP4)[kinfitP4->GetEntriesFast()]) TLorentzVector(l.kinfitP4); kinfitPtErr -> push_back(l.kinfitPtErr); diff --git a/Nero/test/crabNero.py b/Nero/test/crabNero.py index 30f3b79..18732f4 100644 --- a/Nero/test/crabNero.py +++ b/Nero/test/crabNero.py @@ -483,8 +483,13 @@ def submitDatasets(datasetNames): config.General.requestName = 'DYJetsToLL2' config.Data.inputDataset = '/DYJetsToLL_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + submit(config)\ + + config.General.requestName = 'DYJetsToMuMu_105_160' + config.Data.inputDataset='/DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' submit(config) + #config.General.requestName = 'QCD-15-700-hpp' #config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETHS1_Flat_13TeV_herwigpp/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' #submit(config) @@ -519,9 +524,29 @@ def submitDatasets(datasetNames): #config.Data.inputDataset = '/GluGluToHHTo2B2G_node_4_13TeV-madgraph/amarini-Fall17_94X_Apr2018_MINIAOD-18783c0a07109245951450a1a4f55409/USER' #submit(config) + config.General.requestName = 'GGZZ2e2mu' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2mu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2mu2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2e2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM' + submit(config) + config.General.requestName = 'GGZZ4mu' + config.Data.inputDataset = '/GluGluToContinToZZTo4mu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + submit(config) + config.General.requestName = 'GGZZ4tau' + config.Data.inputDataset = '/GluGluToContinToZZTo4tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14_ext1-v2/MINIAODSIM' + submit(config) + config.General.requestName = 'GGZZ2mu2nu' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2nu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM' + submit(config) # Local Variables: # mode:python diff --git a/Nero/test/crabNero2016.py b/Nero/test/crabNero2016.py new file mode 100644 index 0000000..6f927fc --- /dev/null +++ b/Nero/test/crabNero2016.py @@ -0,0 +1,455 @@ +from CRABClient.UserUtilities import config, getUsernameFromSiteDB +from subprocess import call, check_output + +import sys, os, re + +### CHECK THAT CMS env and it is correct +pwd = os.environ['PWD'] +if 'CMSSW_VERSION' not in os.environ: + print "Do cmsenv!" + exit(0) +version = os.environ['CMSSW_VERSION'] +ok = False +for dir in reversed(pwd.split('/')): + if version == dir : + ok = True + break +if not ok: + print "Do (redo) cmsenv (2) !" + exit(0) + + +config = config() + +config.General.requestName = 'Nero_request_XXX' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = False + +## JobType +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'testNero.py' +#config.JobType.psetName = 'testNero_twomu.py' +config.JobType.pyCfgParams=['isGrid=True','isData=False','nerohead='+check_output("git rev-parse HEAD",shell=True), 'nerotag='+check_output('git describe --tags',shell=True),'isRun=2016B'] + +# request shipping of the JEC V4 -- local +#config.JobType.inputFiles=['jec/Summer15_50nsV4_DATA.db','jec/Summer15_50nsV4_MC.db'] +config.JobType.inputFiles=['jec','qg','jer'] + +### DATA configuration +config.Data.inputDataset = '/HplusToTauNu-M500/amarini-amarini_PrivateMC_HPlusToTauNu_June2015-16aa19d591b8b49c55c4508e7a7c9233/USER' +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.ignoreLocality = False + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 10 +config.Data.totalUnits = -1 + +tag = check_output("git describe --tags | cut -d'-' -f 1 | tr -d '\n' ",shell=True) +print "-> current tag is '"+tag + "'" +#config.Data.outLFNDirBase = '/store/user/%s/Nero/%s/' % (getUsernameFromSiteDB(), tag) +config.Data.outLFNDirBase = '/store/group/phys_higgs/cmshmm/%s/Nero/%s/year2016/' % (getUsernameFromSiteDB(), tag) +config.Data.publication = False +config.Data.outputDatasetTag ='NeroNtuples' +config.Data.allowNonValidInputDataset = True + +config.Site.storageSite = 'T2_CH_CERN' +#config.Site.blacklist = [ 'T2_US_Florida','T2_US_Vanderbilt'] + + +if __name__ == '__main__': + + from CRABAPI.RawCommand import crabCommand + from CRABClient.ClientExceptions import ClientException + from httplib import HTTPException + + # We want to put all the CRAB project directories from the tasks we submit here into one common directory. + # That's why we need to set this parameter (here or above in the configuration file, it does not matter, we will not overwrite it). + config.General.workArea = 'NeroSubmission2016_v2' + + def submit(config): + ### for some reason only the first dataset is submitted correctly, work around + if len(sys.argv) ==1: + ## book the command and run python + cmd = "python " + sys.argv[0] + " '" + config.General.requestName + "'" + print "calling: "+cmd + call(cmd,shell=True) + return + if len(sys.argv) > 1: + ## if it is not in the request try the next + if sys.argv[1] != config.General.requestName: return + ### + if '*' in config.Data.inputDataset: + print "-> Figuring out dataset from *" + cmd="dasgoclient -query='%s'"%config.Data.inputDataset + print "Running cmd '"+cmd+"'" + dataset=check_output(cmd,shell=True).split('\n')[0].split()[0] + config.Data.inputDataset=dataset + #config.Data.inputDataset = '/SingleMuon/Run2017B-31Mar2018-v1/MINIAOD' + if 'Run2017' in config.Data.inputDataset or 'Run2016' in config.Data.inputDataset or 'Run2018' in config.Data.inputDataset: + run=config.Data.inputDataset.split('/')[2].split('-')[0] + setrun(run) + print "--- Submitting " + "\033[01;32m" + config.Data.inputDataset.split('/')[1] + "\033[00m" + " ---" + config.Data.outputDatasetTag = config.General.requestName + print "lumi-mask is",config.Data.lumiMask + try: + crabCommand('submit', config = config) + except HTTPException as hte: + print "Failed submitting task: %s" % (hte.headers) + except ClientException as cle: + print "Failed submitting task: %s" % (cle) + + def setdata(value="True"): + if value=='True': + config.Data.splitting = 'LumiBased' + #config.Data.lumiMask=None + #url = "https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions17/13TeV/Final" + #config.Data.lumiMask = url + "/Cert_294927-306462_13TeV_PromptReco_Collisions17_JSON.txt" + url = "https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions16/13TeV/ReReco/Final/" + #config.Data.lumiMask = url + "/Cert_294927-306462_13TeV_EOY2017ReReco_Collisions17_JSON.txt" + config.Data.lumiMask = url + "Cert_271036-284044_13TeV_23Sep2016ReReco_Collisions16_JSON.txt" + else: + config.Data.lumiMask = None + config.Data.splitting = 'FileBased' + + for idx,par in enumerate(config.JobType.pyCfgParams): + if "isData" in par: + config.JobType.pyCfgParams[idx] = "isData=" + value + return + + def setrun(value='Run2017B'): + print "-> Setting run Option to:", value + for idx,par in enumerate(config.JobType.pyCfgParams): + if "isRun" in par: + config.JobType.pyCfgParams[idx] = "isRun=" + value + + def submitDatasets(datasetNames): + usedNames = {} + for datasetName in datasetNames: + basename = datasetName.split('/')[1] + datasetNum = usedNames.get(basename, 0) + config.General.requestName = '{0}_{1}'.format(basename,datasetNum) + config.Data.inputDataset = datasetName + submit(config) + usedNames[basename] = datasetNum + 1 + + ############################################################################################# + ## From now on that's what users should modify: this is the a-la-CRAB2 configuration part. ## + ############################################################################################# + + ################################################### + ######## 25ns 2017 ######## + ################################################### + setdata("True") + ################################################### + config.Data.unitsPerJob = 100 + + config.General.requestName = 'SingleMuon-Run2016B_ver1' + config.Data.inputDataset = '/SingleMuon/Run2016B-17Jul2018_ver1-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016B_ver2' + config.Data.inputDataset = '/SingleMuon/Run2016B-17Jul2018_ver2-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016C' + config.Data.inputDataset = '/SingleMuon/Run2016C-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016D' + config.Data.inputDataset = '/SingleMuon/Run2016D-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016E' + config.Data.inputDataset = '/SingleMuon/Run2016E-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016F' + config.Data.inputDataset = '/SingleMuon/Run2016F-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016G' + config.Data.inputDataset = '/SingleMuon/Run2016G-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016H' + config.Data.inputDataset = '/SingleMuon/Run2016H-17Jul2018-v1/MINIAOD' + submit(config) + + ######################################## DOUBLE MUON + + config.General.requestName = 'DoubleMuon-Run2016B_ver1' + config.Data.inputDataset = '/DoubleMuon/Run2016B-17Jul2018_ver1-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016B_ver2' + config.Data.inputDataset = '/DoubleMuon/Run2016B-17Jul2018_ver2-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016C' + config.Data.inputDataset = '/DoubleMuon/Run2016C-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016D' + config.Data.inputDataset = '/DoubleMuon/Run2016D-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016E' + config.Data.inputDataset = '/DoubleMuon/Run2016E-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016F' + config.Data.inputDataset = '/DoubleMuon/Run2016F-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016G' + config.Data.inputDataset = '/DoubleMuon/Run2016G-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016H' + config.Data.inputDataset = '/DoubleMuon/Run2016H-17Jul2018-v1/MINIAOD' + submit(config) + + ################################################### + + ##################################################### + ##setdata("False") + ##################################################### + + ##config.General.requestName = 'WZ-pythia8' + ##config.Data.inputDataset = '/WZ_TuneCUETP8M1_13TeV-pythia8/RunIIFall15MiniAODv2-PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/MINIAODSIM' + ##submit(config) + + #################################### + ##config.Data.unitsPerJob = 10 + #################################### + + ##config.General.requestName = 'QCD-15-30' + ##config.Data.inputDataset = '/QCD_Pt_15to30_TuneCUETP8M1_13TeV_pythia8/RunIIFall15MiniAODv2-PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/MINIAODSIM' + ##submit(config) + + ################################################### + setdata("False") + setrun("Run2016B") + ################################################### + + ################################## + config.Data.unitsPerJob = 1 + ################################## + #$dasgoclient -query='dataset=/TT*/*12Apr2018_94X*/MINIAODSIM' + #config.JobType.pyCfgParams.append('isParticleGun=True') + #config.General.requestName = 'JPsiToMuMu' + #config.Data.inputDataset = '/JPsiToMuMu_Pt20to100-pythia8-gun/RunIIFall17MiniAODv2-PU2017RECOSIMstep_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + + #### HMM + for mh in [120,125,130]: + #for mh in [120]: + config.General.requestName = 'ttH_%d'%mh + config.Data.inputDataset = '/ttHToMuMu_M%d_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + + config.General.requestName = 'ZH_%d'%mh + config.Data.inputDataset = '/ZH_HToMuMu_ZToAll_M%d_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + + config.General.requestName = 'WPlusH_%d'%mh + config.Data.inputDataset='/WplusH_HToMuMu_WToAll_M%d_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + + config.General.requestName = 'WMinusH_%d'%mh + config.Data.inputDataset="/WminusH_HToMuMu_WToAll_M%d_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM"%mh + submit(config) + + config.General.requestName = 'GluGluH_%d'%mh + config.Data.inputDataset = '/GluGluHToMuMu_M%d_TuneCP5_PSweights_13TeV_amcatnloFXFX_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + #/GluGluHToMuMu_M-125_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM + + config.General.requestName = 'VBFH_%d'%mh + config.Data.inputDataset = '/VBFHToMuMu_M%d_TuneCP5_PSweights_13TeV_amcatnlo_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + #/VBFHToMuMu_M-125_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM + + #config.Data.inputDBS = 'phys03' + #config.Data.unitsPerJob = 10 + #config.General.requestName = 'VBFH_HToMuMu_M125_13TeV_powheg_pythia8' + #config.Data.inputDataset = '/VBFH_HToMuMu_M125_13TeV_powheg_pythia8/amarini-Fall17_94X-MINIAODSIM-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + + #config.Data.inputDBS = 'phys03' + #config.Data.unitsPerJob = 10 + #config.General.requestName = 'GluGluH_HToMuMu_M125_13TeV_powheg_pythia8' + #config.Data.inputDataset = '/GluGlu_HToMuMu_M125_13TeV_powheg_pythia8/amarini-Fall17_94X-MINIAODSIM-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + #config.Data.inputDBS = 'global' + + config.General.requestName = 'TTTo2L2Nu' + config.Data.inputDataset = '/TTTo2L2Nu_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_s-channel' + config.Data.inputDataset = '/ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_t-channel_antitop' + config.Data.inputDataset = '/ST_t-channel_antitop_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_t-channel_top' + config.Data.inputDataset = '/ST_t-channel_top_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_tW_antitop' + config.Data.inputDataset = '/ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_tW_top' + config.Data.inputDataset = '/ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTZToQQ' + config.Data.inputDataset = '/TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTZToLL_M-1to10' + config.Data.inputDataset = '/TTZToLL_M-1to10_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISummer16MiniAODv3-94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTZToLLNuNu_M-10' + config.Data.inputDataset = '/TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTWToQQ' + config.Data.inputDataset = '/TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTWToLNu' + config.Data.inputDataset = '/TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWTo1L1Nu2Q' + config.Data.inputDataset = '/WWTo1L1Nu2Q_13TeV_amcatnloFXFX_madspin_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWTo2L2Nu' + config.Data.inputDataset = '/WWTo2L2Nu_13TeV-powheg/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWW' + config.Data.inputDataset = '/WWW_4F_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWZ' + config.Data.inputDataset = '/WWZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WZTo2L2Q' + config.Data.inputDataset = '/WZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WZTo3LNu' + config.Data.inputDataset = '/WZTo3LNu_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WZZ' + config.Data.inputDataset = '/WZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ZZTo2L2Q' + config.Data.inputDataset = '/ZZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ZZTo4L' + config.Data.inputDataset = '/ZZTo4L_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ZZZ' + config.Data.inputDataset = '/TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + + config.General.requestName = 'TTTT' + config.Data.inputDataset = '/TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'DYJetsToLL' + config.Data.inputDataset = '/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v1/MINIAODSIM' + submit(config) + + + config.General.requestName = 'DYJetsToMuMu_105_160' + config.Data.inputDataset='/DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'DYJetsToMuMu_105_160_ext' + config.Data.inputDataset = '/DYJetsToLL_M-105To160_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v1/MINIAODSIM' + submit(config) + + #config.General.requestName = 'QCD-15-700-hpp' + #config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETHS1_Flat_13TeV_herwigpp/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-100-200' + #config.Data.inputDataset = '/QCD_HT100to200_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-200-300' + #config.Data.inputDataset = '/QCD_HT200to300_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-300-500' + #config.Data.inputDataset = '/QCD_HT300to500_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-500-700' + #config.Data.inputDataset = '/QCD_HT500to700_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-700-1000' + #config.Data.inputDataset = '/QCD_HT700to1000_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + #config.Data.inputDBS = 'phys03' + #config.General.requestName = 'VBFHHTo2B2Mu_CV_1_C2V_1_C3_1_13TeV-madgraph' + #config.Data.inputDataset = '/VBFHHTo2B2Mu_CV_1_C2V_1_C3_1_13TeV-madgraph/amarini-Fall17_94X_Apr2018_MINIAOD-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + + #config.Data.inputDBS = 'phys03' + #config.General.requestName = 'GluGluToHHTo2B2M_node_4_13TeV-madgraph' + #config.Data.inputDataset = '/GluGluToHHTo2B2G_node_4_13TeV-madgraph/amarini-Fall17_94X_Apr2018_MINIAOD-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + + config.General.requestName = 'GGZZ2e2mu' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2mu_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2mu2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2tau_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2e2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2tau_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ4mu' + config.Data.inputDataset = '/GluGluToContinToZZTo4mu_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ4tau' + config.Data.inputDataset = '/GluGluToContinToZZTo4tau_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2mu2nu' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2nu_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + +# Local Variables: +# mode:python +# indent-tabs-mode:nil +# tab-width:4 +# c-basic-offset:4 +# End: +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 diff --git a/Nero/test/testNero.py b/Nero/test/testNero.py index 00be1ac..c3846cb 100644 --- a/Nero/test/testNero.py +++ b/Nero/test/testNero.py @@ -107,9 +107,15 @@ process.load('NeroProducer.Nero.Nero_cfi') from RecoEgamma.EgammaTools.EgammaPostRecoTools import setupEgammaPostRecoSeq -setupEgammaPostRecoSeq(process, - runVID=True, - era='2017-Nov17ReReco') +if isYear==2017: + setupEgammaPostRecoSeq(process, + runVID=True, + era='2017-Nov17ReReco') +if isYear==2016: + setupEgammaPostRecoSeq(process, + runVID=True, + runEnergyCorrections=False, + era='2016-Legacy') ############################### JEC ##################### #### Load from a sqlite db, if not read from the global tag @@ -274,15 +280,16 @@ from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncFromMiniAOD runMetCorAndUncFromMiniAOD ( - process, - isData = isData, # false for MC - reclusterJets = True, - pfCandColl=cms.InputTag("packedPFCandidates"), - CHS = True, - fixEE2017 = True, - #fixEE2017Params = {'userawPt': True, 'PtThreshold':50.0, 'MinEtaThreshold':2.65, 'MaxEtaThreshold': 3.139} , ## default have modified names - postfix = "ModifiedMET" -) + process, + isData = isData, # false for MC + reclusterJets = True, + pfCandColl=cms.InputTag("packedPFCandidates"), + CHS = True, + fixEE2017 = (isYear==2017), + #fixEE2017Params = {'userawPt': True, 'PtThreshold':50.0, 'MinEtaThreshold':2.65, 'MaxEtaThreshold': 3.139} , ## default have modified names + postfix = "ModifiedMET" if isYear==2017 else "" + ) + print "-> Ecal Bad " @@ -310,14 +317,24 @@ print "-> Updating the jets collection to run on to 'updatedPatJetsUpdatedJEC' with the new jec in the GT/or DB" process.nero.NeroJets.jets=cms.InputTag('updatedPatJetsUpdatedJEC') process.nero.NeroFatJets.chsAK8=cms.InputTag('updatedPatJetsUpdatedJECAK8') -process.nero.NeroMet.mets=cms.InputTag("slimmedMETsModifiedMET") -process.jecSequence = cms.Sequence( - #process.patJetCorrFactorsReapplyJEC + process.patJetsReapplyJEC - process.patJetCorrFactorsUpdatedJEC* process.updatedPatJetsUpdatedJEC - * process.patJetCorrFactorsUpdatedJECAK8* process.updatedPatJetsUpdatedJECAK8 - * process.fullPatMetSequenceModifiedMET - * process.ecalBadCalibReducedMINIAODFilter - ) +if isYear==2017: + process.nero.NeroMet.mets=cms.InputTag("slimmedMETsModifiedMET") + process.jecSequence = cms.Sequence( + #process.patJetCorrFactorsReapplyJEC + process.patJetsReapplyJEC + process.patJetCorrFactorsUpdatedJEC* process.updatedPatJetsUpdatedJEC + * process.patJetCorrFactorsUpdatedJECAK8* process.updatedPatJetsUpdatedJECAK8 + * process.fullPatMetSequenceModifiedMET + * process.ecalBadCalibReducedMINIAODFilter + ) +else: + process.nero.NeroMet.mets=cms.InputTag("slimmedMETs") + process.jecSequence = cms.Sequence( + #process.patJetCorrFactorsReapplyJEC + process.patJetsReapplyJEC + process.patJetCorrFactorsUpdatedJEC* process.updatedPatJetsUpdatedJEC + * process.patJetCorrFactorsUpdatedJECAK8* process.updatedPatJetsUpdatedJECAK8 + * process.fullPatMetSequence + * process.ecalBadCalibReducedMINIAODFilter + ) #-----------------------ELECTRON ID------------------------------- @@ -417,6 +434,8 @@ PhotonMVA="FSRPhotonRecovery/FSRPhotons/data/PhotonMVAv5_BDTG1000TreesDY.weights.xml" PhotonMVA="FSRPhotonRecovery/FSRPhotons/data/PhotonMVAv9_BDTG800TreesDY.weights.xml" addFSRphotonSequence(process, process.nero.NeroLeptons.muons.value(), PhotonMVA) +#electrons = cms.InputTag("slimmedElectrons","","nero"), +process.FSRRecovery.patphotons= cms.InputTag("slimmedPhotons","","nero") ###############################################################