Skip to content

Commit

Permalink
Merge pull request #1 from thaarres/nanoAOD
Browse files Browse the repository at this point in the history
Adapted to 94X, moved modules to Python dir
  • Loading branch information
UBParker authored Jan 31, 2018
2 parents 2e77faf + b99ada0 commit b31b16d
Show file tree
Hide file tree
Showing 18 changed files with 449 additions and 215 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ git checkout -b TTbarResHad remotes/sal/TTbarResHad
## getting the code

```
cd python/
cd $CMSSW_base/src
git clone -b nanoAOD [email protected]:BoostedScalefactors/WTopScalefactorProducer.git
cd WTopScalefactorProducer
Expand Down
5 changes: 5 additions & 0 deletions Skimmer/crab/92Xdatasets_data_2017.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/SingleMuon/thaarres-SingleMuon_Run2017B-17Nov2017-v1-351ed72508aa977f1c65d26f45752bf7/USER
/SingleMuon/thaarres-SingleMuon_Run2017C-17Nov2017-v1-351ed72508aa977f1c65d26f45752bf7/USER
/SingleMuon/thaarres-SingleMuon_Run2017D-17Nov2017-v1-351ed72508aa977f1c65d26f45752bf7/USER
/SingleMuon/thaarres-SingleMuon_Run2017E-17Nov2017-v1-351ed72508aa977f1c65d26f45752bf7/USER
/SingleMuon/thaarres-SingleMuon_Run2017F-17Nov2017-v1-351ed72508aa977f1c65d26f45752bf7/USER
1 change: 1 addition & 0 deletions Skimmer/crab/94Xdatasets_MC_2017.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/TTToSemiLeptonic_TuneCP5_PSweights_13TeV-powheg-pythia8/asparker-TTToSemiLeptonicTuneCP5PSweights13TeV-powheg-pythia8-09681bffa4a69220709beadfe75c6062/USER
2 changes: 1 addition & 1 deletion Skimmer/crab/Pset_nanoSkim.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

process.options = cms.untracked.PSet()

process.output = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string('80XNanoV0-TTbar_SemiLep.root'), fakeNameForCrab =cms.untracked.bool(True))
process.output = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string('94XNanoV0-TTbar_SemiLep.root'), fakeNameForCrab =cms.untracked.bool(True))
process.out = cms.EndPath(process.output)
15 changes: 8 additions & 7 deletions Skimmer/crab/crab_script_SFs.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/Usr-/bin/env python
import os
import os,sys
from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import *

#this takes care of converting the input files from CRAB
from PhysicsTools.NanoAODTools.postprocessing.framework.crabhelper import inputFiles,runsAndLumis
from WTopScalefactorProducer.Skimmer.TTSkimmer import *


from PhysicsTools.NanoAODTools.WTopScalefactorProducer.Skimmer.TTbar_SemiLep import *

# NOTE : This file is configured to Process MC.
# If you want to process Data then ADD "jsonInput='Cert_271036-284044_13TeV_PromptReco_Collisions16_JSON.txt'"
# If you want to process Data then ADD "jsonInput='/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions17/13TeV/PromptReco/Cert_294927-306462_13TeV_PromptReco_Collisions17_JSON.txt'"
# to the PostProcessor arguement below
#

p=PostProcessor(".", inputFiles() ,"nFatJet>0&&FatJet_msoftdrop>30&&FatJet_pt>200&&MET_sumEt>40&& ( (nElectron > 0 && HLT_Ele115_CaloIdVT_GsfTrkIdT) || (nMuon > 0 && HLT_Mu50))" ,modules=[TTbar_SemiLep()],provenance=True,fwkJobReport=True ,histFileName= 'TTbar_SemiLep_hists.root', histDirName='ttbar_semilep' , haddFileName= '80XNanoV0-TTbar_SemiLep.root' )
# p=PostProcessor(".", inputFiles(), # --> to submit with crab, use this
p=PostProcessor(".", ["root://cms-xrd-global.cern.ch//store/user/asparker/TTToSemiLeptonic_TuneCP5_PSweights_13TeV-powheg-pythia8/TTToSemiLeptonicTuneCP5PSweights13TeV-powheg-pythia8/180130_175206/0000/80XNanoV0-TTbar_SemiLep_1.root"], # --> for local tests, use this
"nFatJet>0&&FatJet_msoftdrop>30&&FatJet_pt>200&&MET_sumEt>40&& ( (nElectron > 0 && HLT_Ele115_CaloIdVT_GsfTrkIdT) || (nMuon > 0 && HLT_Mu50))" ,"keep_and_drop.txt",
modules=[TTbar_SemiLep()],provenance=False,fwkJobReport=False ,
haddFileName= '94XNanoV0-TTbar_SemiLep.root' )

p.run()

print "DONE"
os.system("ls -lR")
27 changes: 27 additions & 0 deletions Skimmer/crab/keep_and_drop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
drop *
keep HLT_Mu50*
keep HLT_Ele115_*
keep FatJet_*
keep Jet_*
keep SubGenJetAK8*
keep SubJet*
keep Muon_*
keep Electron_*
keep MET*
keep PuppiMET*
keep GenPart*
keep GenDressed*
keep run*
keep luminosityBlock*
keep genWeight*
keep event*
keep Pileup*
keep Flag_BadChargedCandidateFilter
keep Flag_BadPFMuonFilter
keep Flag_EcalDeadCellTriggerPrimitiveFilter
keep Flag_HBHENoiseFilter
keep Flag_HBHENoiseIsoFilter
keep Flag_METFilters
keep Flag_ecalBadCalibFilter
keep Flag_globalTightHalo2016Filter
keep Flag_goodVertices
6 changes: 3 additions & 3 deletions Skimmer/crab/submit_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def main():
# If running on Sal or Ashley's Nano datasets you can set this to False
# and comment out the whitelist below

#config.Data.publication = True
config.Data.publication = True

config.Data.publishDBS = 'phys03'

Expand Down Expand Up @@ -106,7 +106,7 @@ def submit(config):
ptbin = job.split('/')[1]
cond = job.split('/')[2]
datatier = job.split('/')[3]
requestname = ptbin + '_' + cond
requestname = 'skim_'+ptbin + '_' + cond
if len(requestname) > 100: requestname = ''.join((requestname[:100-len(requestname)]).split('_')[:-1])
print 'requestname = ', requestname
config.General.requestName = requestname
Expand All @@ -116,7 +116,7 @@ def submit(config):
if datatier == 'USER':

config.JobType.scriptExe = 'crab_script_SFs.sh'
config.JobType.inputFiles = [options.cfg ,'crab_script_SFs.sh', 'crab_script_SFs.py' ,'../../../../scripts/haddnano.py', '../Cert_271036-284044_13TeV_PromptReco_Collisions16_JSON.txt'] #hadd nano will not be needed once nano tools are in cmssw
config.JobType.inputFiles = [options.cfg ,'crab_script_SFs.sh', 'crab_script_SFs.py' ,'../haddnano.py', '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions17/13TeV/PromptReco/Cert_294927-306462_13TeV_PromptReco_Collisions17_JSON.txt'] #hadd nano will not be needed once nano tools are in cmssw
config.JobType.sendPythonFolder = True

config.Data.inputDataset = job
Expand Down
13 changes: 0 additions & 13 deletions Skimmer/keep_and_drop.txt

This file was deleted.

Loading

0 comments on commit b31b16d

Please sign in to comment.