|
| 1 | +#!/bin/bash |
| 2 | +# This script runs all the steps of the embedding workflow |
| 3 | +# author: Christian Winter ([email protected]) |
| 4 | +# TODO: move the dataset to a more persistent and for cmssw accessible place than a private EOS user folder |
| 5 | + |
| 6 | +# print the exit status before exiting |
| 7 | +function die { |
| 8 | + echo $1: status $2 |
| 9 | + exit $2 |
| 10 | +} |
| 11 | + |
| 12 | +## This is a PRE SKIMED dataset |
| 13 | +dataset="root://eoscms.cern.ch//store/group/phys_tau/embedding_test_files/2022_G_RAW.root" |
| 14 | + |
| 15 | +echo "################ Selection ################" |
| 16 | +cmsDriver.py RECO \ |
| 17 | + --step RAW2DIGI,L1Reco,RECO,PAT \ |
| 18 | + --data \ |
| 19 | + --scenario pp \ |
| 20 | + --conditions auto:run3_data \ |
| 21 | + --era Run3 \ |
| 22 | + --eventcontent RAWRECO \ |
| 23 | + --datatier RAWRECO \ |
| 24 | + --customise TauAnalysis/MCEmbeddingTools/customisers.customiseSelecting \ |
| 25 | + --filein $dataset \ |
| 26 | + --fileout file:selection.root \ |
| 27 | + -n -1 \ |
| 28 | + --python_filename selection.py || die 'Failure during selecting step' $? |
| 29 | + |
| 30 | +echo "################ LHE production and cleaning ################" |
| 31 | +cmsDriver.py LHEprodandCLEAN \ |
| 32 | + --step RAW2DIGI,RECO,PAT \ |
| 33 | + --data \ |
| 34 | + --scenario pp \ |
| 35 | + --conditions auto:run3_data \ |
| 36 | + --era Run3 \ |
| 37 | + --eventcontent RAWRECO \ |
| 38 | + --datatier RAWRECO \ |
| 39 | + --customise Configuration/DataProcessing/RecoTLR.customisePostEra_Run2_2018,TauAnalysis/MCEmbeddingTools/customisers.customiseLHEandCleaning \ |
| 40 | + --filein file:selection.root \ |
| 41 | + --fileout file:lhe_and_cleaned.root \ |
| 42 | + -n -1 \ |
| 43 | + --python_filename lheprodandcleaning.py || die 'Failure during LHE and Cleaning step' $? |
| 44 | + |
| 45 | +# Simulation (MC & Detector) |
| 46 | +echo "################ Simulation (MC & Detector) ################" |
| 47 | +cmsDriver.py TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py \ |
| 48 | + --step GEN,SIM,DIGI,L1,DIGI2RAW \ |
| 49 | + --mc \ |
| 50 | + --beamspot Realistic25ns13p6TeVEarly2022Collision \ |
| 51 | + --geometry DB:Extended \ |
| 52 | + --era Run3 \ |
| 53 | + --conditions auto:phase1_2022_realistic_postEE \ |
| 54 | + --eventcontent RAWSIM \ |
| 55 | + --datatier RAWSIM \ |
| 56 | + --customise \ |
| 57 | + TauAnalysis/MCEmbeddingTools/customisers.customiseGenerator_preHLT \ |
| 58 | + --customise_commands 'process.generator.HepMCFilter.filterParameters.MuMuCut = cms.string("(Mu.Pt > 18 && Had.Pt > 18 && Mu.Eta < 2.2 && Had.Eta < 2.4)");process.generator.HepMCFilter.filterParameters.Final_States = cms.vstring("MuHad");process.generator.nAttempts = cms.uint32(1000);' \ |
| 59 | + --filein file:lhe_and_cleaned.root \ |
| 60 | + --fileout file:simulated_and_cleaned_prehlt.root \ |
| 61 | + -n -1 \ |
| 62 | + --python_filename generator_preHLT.py || die 'Failure during MC & Detector simulation step' $? |
| 63 | + |
| 64 | +# Simulation (Trigger) |
| 65 | +echo "################ Simulation (Trigger) ################" |
| 66 | +cmsDriver.py TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py \ |
| 67 | + --step HLT:Fake2 \ |
| 68 | + --mc \ |
| 69 | + --beamspot Realistic25ns13p6TeVEarly2022Collision \ |
| 70 | + --geometry DB:Extended \ |
| 71 | + --era Run3 \ |
| 72 | + --conditions auto:phase1_2022_realistic_postEE \ |
| 73 | + --eventcontent RAWSIM \ |
| 74 | + --datatier RAWSIM \ |
| 75 | + --customise \ |
| 76 | + TauAnalysis/MCEmbeddingTools/customisers.customiseGenerator_HLT \ |
| 77 | + --customise_commands 'process.source.bypassVersionCheck = cms.untracked.bool(True);' \ |
| 78 | + --filein file:simulated_and_cleaned_prehlt.root \ |
| 79 | + --fileout file:simulated_and_cleaned_hlt.root \ |
| 80 | + -n -1 \ |
| 81 | + --python_filename generator_HLT.py || die 'Failure during Fake Trigger simulation step' $? |
| 82 | + |
| 83 | +# Simulation (Reconstruction) |
| 84 | +echo "################ Simulation (Reconstruction) ################" |
| 85 | +cmsDriver.py TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py \ |
| 86 | + --step RAW2DIGI,L1Reco,RECO,RECOSIM \ |
| 87 | + --mc \ |
| 88 | + --beamspot Realistic25ns13p6TeVEarly2022Collision \ |
| 89 | + --geometry DB:Extended \ |
| 90 | + --era Run3 \ |
| 91 | + --conditions auto:phase1_2022_realistic_postEE \ |
| 92 | + --eventcontent RAWRECOSIMHLT \ |
| 93 | + --datatier RAW-RECO-SIM \ |
| 94 | + --customise \ |
| 95 | + TauAnalysis/MCEmbeddingTools/customisers.customiseGenerator_postHLT \ |
| 96 | + --customise_commands 'process.source.bypassVersionCheck = cms.untracked.bool(True);' \ |
| 97 | + --filein file:simulated_and_cleaned_hlt.root \ |
| 98 | + --fileout file:simulated_and_cleaned_posthlt.root \ |
| 99 | + -n -1 \ |
| 100 | + --python_filename generator_postHLT.py || die 'Failure during reconstruction simulation step' $? |
| 101 | + |
| 102 | +# Merging |
| 103 | +echo "################ Merging ################" |
| 104 | +cmsDriver.py PAT \ |
| 105 | + --step PAT \ |
| 106 | + --data \ |
| 107 | + --scenario pp \ |
| 108 | + --conditions auto:run3_data \ |
| 109 | + --era Run3 \ |
| 110 | + --eventcontent MINIAODSIM \ |
| 111 | + --datatier USER \ |
| 112 | + --customise \ |
| 113 | + TauAnalysis/MCEmbeddingTools/customisers.customiseMerging \ |
| 114 | + --filein file:simulated_and_cleaned_posthlt.root \ |
| 115 | + --fileout file:merged.root \ |
| 116 | + -n -1 \ |
| 117 | + --python_filename merging.py || die 'Failure during the merging step' $? |
| 118 | + |
| 119 | +# NanoAOD Production |
| 120 | +echo "################ NanoAOD Production ################" |
| 121 | +cmsDriver.py \ |
| 122 | + --step NANO \ |
| 123 | + --data \ |
| 124 | + --conditions auto:run3_data \ |
| 125 | + --era Run3 \ |
| 126 | + --eventcontent NANOAODSIM \ |
| 127 | + --datatier NANOAODSIM \ |
| 128 | + --customise TauAnalysis/MCEmbeddingTools/customisers.customiseNanoAOD \ |
| 129 | + --filein file:merged.root \ |
| 130 | + --fileout file:merged_nano.root \ |
| 131 | + -n -1 \ |
| 132 | + --python_filename embedding_nanoAOD.py || die 'Failure during the nanoAOD step' $? |
0 commit comments