Skip to content

Commit

Permalink
Merge pull request cms-sw#86 from selvaggi/master
Browse files Browse the repository at this point in the history
Added HF+Nose option
  • Loading branch information
clelange authored Nov 7, 2019
2 parents ebdc67b + b1e7d79 commit 7a69bb2
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ For details on the pileup scenario, please see [Configuration/StandardSequences/
| [produceSkeletons_D41_NoSmear_noPU.sh](templates/python/produceSkeletons_D41_NoSmear_noPU.sh) | Phase2C8 | D41 | NoSmear | none |
| [produceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns.sh](templates/python/produceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns.sh) | Phase2C8 | D41 | NoSmear | AVE_200_BX_25ns |
| [produceSkeletons_D41_VtxSmearedHLLHC_noPU.sh](templates/python/produceSkeletons_D41_VtxSmearedHLLHC_noPU.sh) | Phase2C8 | D41 | VtxSmearedHLLHC | none |
| [produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh](templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh) | Phase2C6_timing_layer_bar | D44 | NoSmear | AVE_200_BX_25ns |

Whenever you would like to change configuration, change to the `reco_prodtools/templates/python` directory and execute the corresponding script. Then make sure to run `scram b`.

Expand All @@ -61,6 +62,12 @@ Other options like changing the pileup source, calling --customise on cmsDriver
geometry=Extended2026D46
```

The following script produces the configuration for producing samples with the HFNose sub-detector.
```shell
./produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh
```
In order to store HF+Nose hits (and switch off HGCAL hits) in the NTUP step, you need to set the option ```detector = cms.string("HFNose")``` in the ```templates/partGun_NTUP_template.py``` configuration file.

## Available guns and processes

The production tools allow you to generate a plethora of processes (links lead to implementation in CMSSW):
Expand Down
7 changes: 6 additions & 1 deletion templates/partGun_NTUP_template.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FWCore.ParameterSet.Config as cms

import reco_prodtools.templates.NTUP_fragment as ntup_frag
from reco_prodtools.templates.NTUP_fragment import process

process.maxEvents.input = cms.untracked.int32(DUMMYEVTSPERJOB)
Expand Down Expand Up @@ -33,10 +34,14 @@
process.ana.TestParticleFilter.protonEMin = cms.double(100000)
process.ana.TestParticleFilter.etaMax = cms.double(3.1)

# customisation occurs here
if hasattr(ntup_frag, 'doNose'):
if ntup_frag.doNose:
process.ana.detector = cms.string("HFNose")
process.ana.TestParticleFilter.etaMax = cms.double(6.0)

process.TFileService = cms.Service("TFileService",
fileName = cms.string("file:DUMMYFILENAME")

)

reRunClustering = DUMMYRECLUST
Expand Down
27 changes: 27 additions & 0 deletions templates/python/inject_nose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#
# Arguments:
# 1. fragment_file: The file to update inline.

action() {
# get and check arguments
local fragment_file="$1"
local nose_bool="$2"

if [ -z "$fragment_file" ]; then
2>&1 echo "please pass a fragment file as argument 1"
return "1"
fi
if [ ! -f "$fragment_file" ]; then
2>&1 echo "the fragment file '$fragment_file' does not exist"
return "2"
fi

# customisation occurs here
local hook="# Customisation from command line"
local content="# customisation for nose\ndoNose = ${nose_bool}"

# do the injection
sed "/$hook/a $content" -i "$fragment_file"
}
action "$@"
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#!/bin/sh

# This is the shell script that will generate all the skeletons using cmsDriver commands.
# The commands included have been taken from runTheMatrix with the following command:
#
# runTheMatrix.py -w upgrade -l 21234.0 --command="--no_exec" --dryRun
#
# The reconstruction as part of the ticl framework is injected into the RECO_fragment.
#
# For all commands remove --filein and --fileout options.
# Add python_filename option
#
# The first command combines step1 and step2 (GSD):
# - mix in pileup
# - run up to DIGI...HLT:@fake2
# The following changes are implemented on top:
# --beamspot HLLHC14TeV ➜ --beamspot NoSmear
# --eventcontent FEVTDEBUG ➜ --eventcontent FEVTDEBUGHLT
# Removed --relval option.
#
# The second command is step3 removing overlap with step2 (RECO):
# - remove pileup part
# - remove MINIAODSIM from event content and data tier
# - remove PAT from steps (-s)
# - remove @miniAODValidation from VALIDATION step
# - remove @miniAODDQM from DQM step
#
# The third command is a copy of the second only re-running RECO (for NTUP):
# - remove DQM from event content
# - remove DQMIO from data tier
# - add --processName=NTUP option
#
# Those commands should be regularly checked and, in case of changes, propagated into this script!

action() {
# default arguments
local inject_ticl="0"
local inject_nose="1"

# parse arguments
for arg in "$@"; do
if [ "$arg" = "ticl" ]; then
inject_ticl="1"
elif [ "$arg" = "no-ticl" ]; then
inject_ticl="0"
elif [ "$arg" = "nose" ]; then
inject_nose="1"
elif [ "$arg" = "no-nose" ]; then
inject_nose="0"
else
2>&1 echo "unknown argument: $arg"
return "1"
fi
done

pileup_input='/eos/cms/store/cmst3/group/hgcal/CMG_studies/Production/minbias_V9Nose_20191024/GSD/'
pileup_input=`find ${pileup_input} -iname "*.root" -printf "file:%h/%f,"`
pileup_input=${pileup_input::-1}

cmsDriver.py TTbar_14TeV_TuneCUETP8M1_cfi \
--conditions auto:phase2_realistic_T14 \
-n 10 \
--era Phase2C6_timing_layer_bar \
--eventcontent FEVTDEBUGHLT \
-s GEN,SIM,DIGI:pdigi_valid,L1,L1TrackTrigger,DIGI2RAW,HLT:@fake2 \
--datatier GEN-SIM \
--beamspot NoSmear \
--geometry Extended2026D44 \
--pileup AVE_200_BX_25ns \
--pileup_input ${pileup_input} \
--no_exec \
--python_filename=GSD_fragment.py

cmsDriver.py step3 \
--conditions auto:phase2_realistic_T14 \
-n 10 \
--era Phase2C6_timing_layer_bar \
--eventcontent FEVTDEBUGHLT,DQM \
--runUnscheduled \
-s RAW2DIGI,L1Reco,RECO,RECOSIM,VALIDATION:@phase2Validation,DQM:@phase2 \
--datatier GEN-SIM-RECO,DQMIO \
--geometry Extended2026D44 \
--no_exec \
--python_filename=RECO_fragment.py


if [ "$inject_ticl" = "1" ]; then
echo -e "\ninject ticl into RECO_fragment.py"
./inject_ticl.sh RECO_fragment.py
if [ "$?" = "0" ]; then
echo
else
2>&1 echo "ticl injection failed"
return "2"
fi
fi

# Customisation from command line

cmsDriver.py step3 \
--conditions auto:phase2_realistic_T14 \
-n 10 \
--era Phase2C6_timing_layer_bar \
--eventcontent FEVTDEBUGHLT \
--runUnscheduled \
-s RAW2DIGI,L1Reco,RECO,RECOSIM \
--datatier GEN-SIM-RECO \
--geometry Extended2026D44 \
--no_exec \
--processName=NTUP \
--python_filename=NTUP_fragment.py

echo -e "\ninject nose into NTUP_fragment.py"
./inject_nose.sh NTUP_fragment.py ${inject_nose}
if [ "$?" = "0" ]; then
echo
else
2>&1 echo "nose injection failed"
return "2"
fi
}
action "$@"

0 comments on commit 7a69bb2

Please sign in to comment.