Skip to content

Commit

Permalink
Merge pull request #1 from kdlong/addMWCustomize
Browse files Browse the repository at this point in the history
Add Suvankar's customize function to prod
  • Loading branch information
kdlong committed Nov 25, 2020
2 parents 0d99e16 + 56f0c33 commit c9d57c0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
13 changes: 13 additions & 0 deletions PhysicsTools/NanoAOD/python/nano_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,19 @@ def nanoAOD_customizeMC(process):
modifier.toModify(process, lambda p: nanoAOD_runMETfixEE2017(p,isData=False))
return process

###Customizations needed for Wmass analysis
###increasing the precision of selected GenParticles.
def nanoGenWmassCustomize(process):
pdgSelection="?(abs(pdgId) == 11|| abs(pdgId)==13 || abs(pdgId)==15 ||abs(pdgId)== 12 || abs(pdgId)== 14 || abs(pdgId)== 16|| abs(pdgId)== 6|| abs(pdgId)== 24|| pdgId== 23|| pdgId== 25)"
# Keep precision same as default RECO for selected particles
ptPrecision="{}?{}:{}".format(pdgSelection, CandVars.pt.precision.value(),genParticleTable.variables.pt.precision.value())
process.genParticleTable.variables.pt.precision=cms.string(ptPrecision)
phiPrecision="{} ? {} : {}".format(pdgSelection, CandVars.phi.precision.value(), genParticleTable.variables.phi.precision.value())
process.genParticleTable.variables.phi.precision=cms.string(phiPrecision)
etaPrecision="{} ? {} : {}".format(pdgSelection, CandVars.eta.precision.value(), genParticleTable.variables.eta.precision.value())
process.genParticleTable.variables.pt.precision=cms.string(etaPrecision)
return process

### Era dependent customization
_80x_sequence = nanoSequenceCommon.copy()
#remove stuff
Expand Down
28 changes: 28 additions & 0 deletions PhysicsTools/NanoAOD/test/driver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
echo $1
if [ $1 -eq '0' ] ; then
cmsDriver.py --python_filename SMP-RunIISummer16NanoAODv8-defaultNano_cfg.py \
--eventcontent NANOAODSIM \
--datatier NANOAODSIM \
--fileout file:SMP-RunIISummer16NanoAODv8-default.root \
--conditions 102X_mcRun2_asymptotic_v8 \
--step NANO \
--filein "dbs:/WplusJetsToMuNu_TuneCP5_13TeV-powhegMiNNLO-pythia8-photos/RunIISummer20UL16MiniAODAPV-106X_mcRun2_asymptotic_preVFP_v8-v2/MINIAODSIM" \
--era Run2_2016,run2_nanoAOD_106Xv1 \
--nThreads 4 --no_exec --mc \
-n 1000 \
--customise Configuration/DataProcessing/Utils.addMonitoring
else
cmsDriver.py --python_filename SMP-RunIISummer16NanoAODv8-wmassNano_cfg.py \
--eventcontent NANOAODSIM \
--datatier NANOAODSIM \
--fileout file:SMP-RunIISummer16NanoAODv8-wmassNano.root \
--conditions 102X_mcRun2_asymptotic_v8 \
--step NANO \
--filein "dbs:/WplusJetsToMuNu_TuneCP5_13TeV-powhegMiNNLO-pythia8-photos/RunIISummer20UL16MiniAODAPV-106X_mcRun2_asymptotic_preVFP_v8-v2/MINIAODSIM" \
--era Run2_2016,run2_nanoAOD_106Xv1 \
--nThreads 4 --no_exec --mc \
-n 1000 \
--customise Configuration/DataProcessing/Utils.addMonitoring,PhysicsTools/NanoAOD/nano_cff.nanoGenWmassCustomize
fi

0 comments on commit c9d57c0

Please sign in to comment.