[fa068d3] | 1 | ##############################################################################################
|
---|
| 2 | #
|
---|
| 3 | # This code produces at set of validation plots for a given detector card.
|
---|
| 4 | #
|
---|
| 5 | # In order to run this you need to compile Delphes with Pythia8 first, see:
|
---|
| 6 | #
|
---|
| 7 | # https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/Pythia8
|
---|
| 8 | #
|
---|
| 9 | # After you (re-)compiled Delphes with Pythia8 you are ready to go, execute from Delphes main dir:
|
---|
| 10 | #
|
---|
| 11 | # ./examples/validation.sh [detector_card] [number_of_events]
|
---|
| 12 | #
|
---|
| 13 | # e.g.
|
---|
| 14 | #
|
---|
[e9971a7] | 15 | # ./examples/validation.sh cards/delphes_card_CMS.tcl 100000
|
---|
[fa068d3] | 16 | #
|
---|
| 17 | # Note that the more events you specify, the more accurate the controls plots will be ...
|
---|
| 18 | #
|
---|
| 19 | ############################################################################################
|
---|
| 20 |
|
---|
[360d17e] | 21 | #! /bin/sh
|
---|
[fa068d3] | 22 |
|
---|
| 23 | EXPECTED_ARGS=2
|
---|
| 24 | E_BADARGS=65
|
---|
| 25 |
|
---|
| 26 | if [ $# -ne $EXPECTED_ARGS ]
|
---|
| 27 | then
|
---|
| 28 | echo "Usage: ./examples/validation.sh [detector_card] [number_of_events]"
|
---|
[e9971a7] | 29 | echo "for instance: ./examples/validation.sh cards/delphes_card_CMS.tcl 10000"
|
---|
[fa068d3] | 30 | exit $E_BADARGS
|
---|
| 31 | fi
|
---|
| 32 |
|
---|
[e9971a7] | 33 | card=$(basename $1)
|
---|
[fa068d3] | 34 | nEvents=$2
|
---|
| 35 | validationCard=cards/validation_$card
|
---|
| 36 | output=validation_${card%.*}.root
|
---|
[6387aea] | 37 | mainoutputdir=report_${card%.*}
|
---|
| 38 | outputroot=report_${card%.*}/root
|
---|
[db8be5f] | 39 | cardlabel=${card%.*}
|
---|
[fa068d3] | 40 |
|
---|
[6387aea] | 41 | mkdir -p $outputroot
|
---|
| 42 | mkdir -p $mainoutputdir/www/fig
|
---|
| 43 |
|
---|
[fa068d3] | 44 | sed 's/delphes_card_CMS.tcl/'$card'/g' cards/validation_card.tcl > $validationCard
|
---|
| 45 |
|
---|
[9f8d4e7] | 46 | function runParticleGun {
|
---|
[360d17e] | 47 | name=$1
|
---|
| 48 | pid=$2
|
---|
| 49 | cmnd="examples/Pythia8/configParticleGun_$name.cmnd"
|
---|
[db8be5f] | 50 | rootfile="particleGun_${name}_${cardlabel}.root"
|
---|
[e9971a7] | 51 | sed '/Main:spareMode1/s/=[[:space:]]*[0-9]*/= '$pid'/' examples/Pythia8/configParticleGun.cmnd > examples/Pythia8/tmp.cmnd
|
---|
| 52 | sed '/Main:numberOfEvents/s/=[[:space:]]*[0-9]*/= '$nEvents'/' examples/Pythia8/tmp.cmnd > $cmnd
|
---|
[6387aea] | 53 | ./DelphesPythia8 $validationCard $cmnd $outputroot/$rootfile
|
---|
[db8be5f] | 54 |
|
---|
[9f8d4e7] | 55 | }
|
---|
| 56 |
|
---|
[6387aea] | 57 | runParticleGun pion 211
|
---|
[360d17e] | 58 | runParticleGun electron 11
|
---|
| 59 | runParticleGun muon 13
|
---|
| 60 | runParticleGun photon 22
|
---|
[6387aea] | 61 | runParticleGun neutron 2112
|
---|
[360d17e] | 62 | runParticleGun jet 1
|
---|
| 63 | runParticleGun bjet 5
|
---|
[6387aea] | 64 | runParticleGun cjet 4
|
---|
[360d17e] | 65 | runParticleGun taujet 15
|
---|
[629e819] | 66 |
|
---|
[6387aea] | 67 | ./Validation $outputroot/particleGun_pion_$cardlabel.root $outputroot/particleGun_electron_$cardlabel.root $outputroot/particleGun_muon_$cardlabel.root $outputroot/particleGun_photon_$cardlabel.root $outputroot/particleGun_neutron_$cardlabel.root $outputroot/particleGun_jet_$cardlabel.root $outputroot/particleGun_bjet_$cardlabel.root $outputroot/particleGun_cjet_$cardlabel.root $outputroot/particleGun_taujet_$cardlabel.root $mainoutputdir/$output
|
---|