From 250350d24edccc31cb95abcfbb5e2a5b426842e8 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Fri, 30 Sep 2022 02:05:22 -0400 Subject: [PATCH] fix: use common `s3tools/make-fastsim-S3-config.sh` for fastsim tutorials (#183) --- s3tools/make-fastsim-S3-config.sh | 2 +- tutorial/README.md | 22 +++++++++--- tutorial/makeSampleDelphesFiles.sh | 55 ------------------------------ 3 files changed, 18 insertions(+), 61 deletions(-) delete mode 100755 tutorial/makeSampleDelphesFiles.sh diff --git a/s3tools/make-fastsim-S3-config.sh b/s3tools/make-fastsim-S3-config.sh index 5409b88f..7034432b 100755 --- a/s3tools/make-fastsim-S3-config.sh +++ b/s3tools/make-fastsim-S3-config.sh @@ -67,7 +67,7 @@ fi if [ "$mode" == "f" -o "$mode" == "a" ]; then status "clean Delphes output directories" for Q2min in ${Q2minima[@]}; do - rm -rv $recDir/minQ2=$Q2min + rm -rvf $recDir/minQ2=$Q2min done status "running Delphes (one thread per Q2min)" function runDelphes { diff --git a/tutorial/README.md b/tutorial/README.md index f3173bf0..915b9b8f 100644 --- a/tutorial/README.md +++ b/tutorial/README.md @@ -18,11 +18,23 @@ To run tutorials, you need to generate or obtain ROOT files, from fast or full s the login and password; follow [s3tools documentation](../s3tools/README.md) for guidance ### Fast Simulation -- run `tutorial/makeSampleDelphesFiles.sh` to download HEPMC files from S3, - and run them through Delphes - - edit the settings in this script, such as beam energy - - change the maximum number of files to process, to limit disk space - consumption +- to download sample HEPMC files from S3, and run them through Delphes, run: + ```bash + s3tools/make-fastsim-S3-config.sh 10x100 tutorial a 4 + ``` + - run `s3tools/make-fastsim-S3-config.sh` for an explaination of the + arguments for this script + - by default, Delphes output files will be written to `datarec/tutorial` + (and the HEPMC files will be in `datagen/tutorial`) +- copy the resulting top-level `delphes.config` file to the `tutorial/` + directory. If you ran `s3tools/make-fastsim-S3-config.sh` with the above + settings, run + ```bash + cp datarec/tutorial/10x100/delphes.config tutorial/ + ``` + By default, all of the tutorial macros for fast simulations assume the + `config` file is `tutorial/delphes.config`. + ### Full Simulation - full simulation files are streamed from S3 using `tutorial/s3files.*.config` diff --git a/tutorial/makeSampleDelphesFiles.sh b/tutorial/makeSampleDelphesFiles.sh deleted file mode 100755 index fa946d04..00000000 --- a/tutorial/makeSampleDelphesFiles.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# produce sample delphes files, for tutorials - -# SETTINGS -------------------------------------------------------------------- -minQ2=1 # minimum Q2 -ebeamEn=10 # electron energy -pbeamEn=100 # proton energy -maxNumFiles=10 # maximum number of hepmc files to process -genDir=datagen/forTutorial # directory of pythia output hepmc files -recDir=datarec/forTutorial # directory of delphes output trees -configFile=tutorial/delphes.config # config file location -# ----------------------------------------------------------------------------- - -if [ -z "$S3_SECRET_KEY" -o -z "$S3_ACCESS_KEY" ]; then - echo "ERROR: need to set env vars S3_SECRET_KEY and S3_ACCESS_KEY" - exit 1 -fi -s3tools/add-host.sh - -mkdir -p $genDir $recDir - -function sep { echo "----- $1 -----"; } - -sep "build list" -s3tools/generate-hepmc-list.sh ${ebeamEn}x${pbeamEn} $minQ2 $maxNumFiles | tee hepmc.list.tmp - -sep "download" -while read hepmc; do mc cp $hepmc $genDir/; done < hepmc.list.tmp -sep "list $genDir/" -ls -lh $genDir - -sep "run delphes" -for hepmc in $genDir/*.hepmc.gz; do deps/run_delphes.sh $hepmc; done -sep "list $recDir/" -ls -lh $recDir - -sep "make config file" -s3tools/make-fastsim-local-config.sh ${ebeamEn}x${pbeamEn} $minQ2 $recDir $configFile -echo ">> config file:" -cat $configFile - -rm hepmc.list.tmp - -echo "" -echo "" -sep "DONE" -echo "" -echo "-> HEPMC FILES in $genDir/:" -ls -lh $genDir -echo "" -echo "-> DELPHES OUTPUT TREES in $recDir/:" -ls -lh $recDir -echo "" -echo "-> CONFIG FILE: $configFile" -echo ""