Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-20 03:45:56

0001 #!/bin/bash
0002 # This script runs all the steps of the embedding workflow
0003 # author: Christian Winter (christian.winter@cern.ch)
0004 # TODO: move the dataset to a more persistent and for cmssw accessible place than a private EOS user folder
0005 
0006 # print the exit status before exiting
0007 function die {
0008     echo $1: status $2
0009     exit $2
0010 }
0011 
0012 ## This is a PRE SKIMED dataset
0013 dataset="root://eoscms.cern.ch//store/group/phys_tau/embedding_test_files/2022_G_RAW.root"
0014 
0015 echo "################ Selection ################"
0016 cmsDriver.py RECO \
0017     --step RAW2DIGI,L1Reco,RECO,PAT \
0018     --data \
0019     --scenario pp \
0020     --conditions auto:run3_data \
0021     --era Run3 \
0022     --eventcontent RAWRECO \
0023     --datatier RAWRECO \
0024     --customise TauAnalysis/MCEmbeddingTools/customisers.customiseSelecting \
0025     --filein $dataset \
0026     --fileout file:selection.root \
0027     -n -1 \
0028     --python_filename selection.py || die 'Failure during selecting step' $?
0029 
0030 echo "################ LHE production and cleaning ################"
0031 cmsDriver.py LHEprodandCLEAN \
0032     --step RAW2DIGI,RECO,PAT \
0033     --data \
0034     --scenario pp \
0035     --conditions auto:run3_data \
0036     --era Run3 \
0037     --eventcontent RAWRECO \
0038     --datatier RAWRECO \
0039     --customise Configuration/DataProcessing/RecoTLR.customisePostEra_Run2_2018,TauAnalysis/MCEmbeddingTools/customisers.customiseLHEandCleaning \
0040     --filein file:selection.root \
0041     --fileout file:lhe_and_cleaned.root \
0042     -n -1 \
0043     --python_filename lheprodandcleaning.py || die 'Failure during LHE and Cleaning step' $?
0044 
0045 # Simulation (MC & Detector)
0046 echo "################ Simulation (MC & Detector) ################"
0047 cmsDriver.py TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py \
0048     --step GEN,SIM,DIGI,L1,DIGI2RAW \
0049     --mc \
0050     --beamspot Realistic25ns13p6TeVEarly2022Collision \
0051     --geometry DB:Extended \
0052     --era Run3 \
0053     --conditions auto:phase1_2022_realistic_postEE \
0054     --eventcontent RAWSIM \
0055     --datatier RAWSIM \
0056     --customise \
0057     TauAnalysis/MCEmbeddingTools/customisers.customiseGenerator_preHLT \
0058     --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);' \
0059     --filein file:lhe_and_cleaned.root \
0060     --fileout file:simulated_and_cleaned_prehlt.root \
0061     -n -1 \
0062     --python_filename generator_preHLT.py || die 'Failure during MC & Detector simulation step' $?
0063 
0064 # Simulation (Trigger)
0065 echo "################ Simulation (Trigger) ################"
0066 cmsDriver.py TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py \
0067     --step HLT:Fake2 \
0068     --mc \
0069     --beamspot Realistic25ns13p6TeVEarly2022Collision \
0070     --geometry DB:Extended \
0071     --era Run3 \
0072     --conditions auto:phase1_2022_realistic_postEE \
0073     --eventcontent RAWSIM \
0074     --datatier RAWSIM \
0075     --customise \
0076     TauAnalysis/MCEmbeddingTools/customisers.customiseGenerator_HLT \
0077     --customise_commands 'process.source.bypassVersionCheck = cms.untracked.bool(True);' \
0078     --filein file:simulated_and_cleaned_prehlt.root \
0079     --fileout file:simulated_and_cleaned_hlt.root \
0080     -n -1 \
0081     --python_filename generator_HLT.py || die 'Failure during Fake Trigger simulation step' $?
0082 
0083 # Simulation (Reconstruction)
0084 echo "################ Simulation (Reconstruction) ################"
0085 cmsDriver.py TauAnalysis/MCEmbeddingTools/python/EmbeddingPythia8Hadronizer_cfi.py \
0086     --step RAW2DIGI,L1Reco,RECO,RECOSIM \
0087     --mc \
0088     --beamspot Realistic25ns13p6TeVEarly2022Collision \
0089     --geometry DB:Extended \
0090     --era Run3 \
0091     --conditions auto:phase1_2022_realistic_postEE \
0092     --eventcontent RAWRECOSIMHLT \
0093     --datatier RAW-RECO-SIM \
0094     --customise \
0095     TauAnalysis/MCEmbeddingTools/customisers.customiseGenerator_postHLT \
0096     --customise_commands 'process.source.bypassVersionCheck = cms.untracked.bool(True);' \
0097     --filein file:simulated_and_cleaned_hlt.root \
0098     --fileout file:simulated_and_cleaned_posthlt.root \
0099     -n -1 \
0100     --python_filename generator_postHLT.py || die 'Failure during reconstruction simulation step' $?
0101 
0102 # Merging
0103 echo "################ Merging ################"
0104 cmsDriver.py PAT \
0105     --step PAT \
0106     --data \
0107     --scenario pp \
0108     --conditions auto:run3_data \
0109     --era Run3 \
0110     --eventcontent MINIAODSIM \
0111     --datatier USER \
0112     --customise \
0113     TauAnalysis/MCEmbeddingTools/customisers.customiseMerging \
0114     --filein file:simulated_and_cleaned_posthlt.root \
0115     --fileout file:merged.root \
0116     -n -1 \
0117     --python_filename merging.py || die 'Failure during the merging step' $?
0118 
0119 # NanoAOD Production
0120 echo "################ NanoAOD Production ################"
0121 cmsDriver.py \
0122     --step NANO \
0123     --data \
0124     --conditions auto:run3_data \
0125     --era Run3 \
0126     --eventcontent NANOAODSIM \
0127     --datatier NANOAODSIM \
0128     --customise TauAnalysis/MCEmbeddingTools/customisers.customiseNanoAOD \
0129     --filein file:merged.root \
0130     --fileout file:merged_nano.root \
0131     -n -1 \
0132     --python_filename embedding_nanoAOD.py || die 'Failure during the nanoAOD step' $?