From 9bad21a769b97d35feb0de829dab3982d40f5bcb Mon Sep 17 00:00:00 2001 From: Michele Selvaggi Date: Thu, 24 Oct 2019 12:33:42 +0200 Subject: [PATCH 1/4] added skeleton for HFNose sample production --- ...tons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100755 templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh diff --git a/templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh b/templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh new file mode 100755 index 0000000..c7bf0f6 --- /dev/null +++ b/templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh @@ -0,0 +1,109 @@ +#!/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="1" + + # parse arguments + for arg in "$@"; do + if [ "$arg" = "ticl" ]; then + inject_ticl="1" + elif [ "$arg" = "no-ticl" ]; then + inject_ticl="0" + else + 2>&1 echo "unknown argument: $arg" + return "1" + fi + done + + pileup_input='/eos/cms/store/cmst3/group/hgcal/CMG_studies/Production//MinBias_14TeV_Extended2026D44_Phase2C6_timing_layer_bar_v0/GEN-SIM/' + 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 + + + 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 +} +action "$@" From a6e913702e80385971ae19eb09c42e6368f5ee2c Mon Sep 17 00:00:00 2001 From: Michele Selvaggi Date: Thu, 24 Oct 2019 13:27:52 +0200 Subject: [PATCH 2/4] added instructions for HFNose configuration --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 7e19c8a..7f208f1 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -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): From fc60e88398e76acc4119e12929d21d39ec8153b0 Mon Sep 17 00:00:00 2001 From: Michele Selvaggi Date: Tue, 5 Nov 2019 18:14:47 +0100 Subject: [PATCH 3/4] added switch for HFNose --- templates/python/inject_nose.sh | 27 +++++++++++++++++++ ...tons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh | 21 ++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100755 templates/python/inject_nose.sh diff --git a/templates/python/inject_nose.sh b/templates/python/inject_nose.sh new file mode 100755 index 0000000..df09608 --- /dev/null +++ b/templates/python/inject_nose.sh @@ -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 "$@" diff --git a/templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh b/templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh index c7bf0f6..9a4a2d4 100755 --- a/templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh +++ b/templates/python/produceSkeletons_D44Nose_NoSmear_PU_AVE_200_BX_25ns.sh @@ -34,7 +34,8 @@ action() { # default arguments - local inject_ticl="1" + local inject_ticl="0" + local inject_nose="1" # parse arguments for arg in "$@"; do @@ -42,16 +43,19 @@ action() { 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_14TeV_Extended2026D44_Phase2C6_timing_layer_bar_v0/GEN-SIM/' + 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 \ @@ -67,7 +71,6 @@ action() { --no_exec \ --python_filename=GSD_fragment.py - cmsDriver.py step3 \ --conditions auto:phase2_realistic_T14 \ -n 10 \ @@ -92,6 +95,7 @@ action() { fi fi +# Customisation from command line cmsDriver.py step3 \ --conditions auto:phase2_realistic_T14 \ @@ -105,5 +109,14 @@ action() { --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 "$@" From b1e7d790c8085f1bc3b31595582debdfb19f4a34 Mon Sep 17 00:00:00 2001 From: Michele Selvaggi Date: Wed, 6 Nov 2019 13:25:40 +0100 Subject: [PATCH 4/4] adding missing commit --- templates/partGun_NTUP_template.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/partGun_NTUP_template.py b/templates/partGun_NTUP_template.py index 90486ea..ec69f3a 100644 --- a/templates/partGun_NTUP_template.py +++ b/templates/partGun_NTUP_template.py @@ -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) @@ -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