Fork me on GitHub

Changeset 03d2c3f in git for validation


Ignore:
Timestamp:
Apr 13, 2017, 1:30:01 PM (8 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
54ba29e
Parents:
65dc4e7
Message:

move validation scripts to validation directory

Location:
validation
Files:
1 added
2 moved

Legend:

Unmodified
Added
Removed
  • validation/validation.sh

    r65dc4e7 r03d2c3f  
    11#!/bin/sh
    2 ##############################################################################################
     2################################################################################
    33#
    44# This code produces at set of validation plots for a given detector card.
     
    1919# This said, 500k events should be ok for most cases.
    2020#
    21 ############################################################################################
     21################################################################################
    2222
    2323EXPECTED_ARGS=2
     
    3232
    3333cardbase=$(basename $1)
    34 carddir=$(dirname $1)
    3534nEvents=$2
    36 validationCard=$carddir/validation_$cardbase
    3735output=validation_${cardbase%.*}.root
    3836mainoutputdir=report_${cardbase%.*}
    39 outputroot=report_${cardbase%.*}/root
     37outputrootdir=report_${cardbase%.*}/root
    4038cardlabel=${cardbase%.*}
    4139version=$(cat VERSION)
    4240outpdf=$mainoutputdir/${output%.*}.pdf
    43 qcdPgLocation="/home/fynu/mselvaggi/storage/DelphesValidationSamples"
     41cardsdir=validation/cards
     42samplesdir=validation/samples
     43validationcard=$cardsdir/validation_$cardbase
    4444
    45 mkdir -p $outputroot
     45mkdir -p $cardsdir
     46mkdir -p $samplesdir
     47mkdir -p $outputrootdir
    4648mkdir -p $mainoutputdir/www/fig
    4749
    48 sed 's/delphes_card_CMS.tcl/'$cardbase'/g' cards/validation_card.tcl  > $validationCard
    49 sed -i "1i set MaxEvents ${nEvents}" "$validationCard"
     50sed "s/delphes_card_CMS.tcl/$cardbase/g" cards/validation_card.tcl > $validationcard
     51sed -i "1i set MaxEvents $nEvents" $validationcard
    5052
    5153function runParticleGun {
    5254  name=$1
    5355  pid=$2
    54   cmnd="examples/Pythia8/configParticleGun_$name.cmnd"
    55   rootfile="particleGun_${name}_${cardlabel}.root"
    56   sed '/Main:spareMode1/s/=[[:space:]]*[0-9]*/= '$pid'/' examples/Pythia8/configParticleGun.cmnd > examples/Pythia8/tmp.cmnd
    57   sed '/Main:numberOfEvents/s/=[[:space:]]*[0-9]*/= '$nEvents'/' examples/Pythia8/tmp.cmnd  > $cmnd
    58   ./DelphesPythia8 $validationCard $cmnd $outputroot/$rootfile
    59  
     56  cmnd=$cardsdir/configParticleGun_$name.cmnd
     57  outputroot=particleGun_${name}_${cardlabel}.root
     58  sed "/Main:spareMode1/s/=[[:space:]]*[0-9]*/= $pid/; /Main:numberOfEvents/s/=[[:space:]]*[0-9]*/= $nEvents/" examples/Pythia8/configParticleGun.cmnd > $cmnd
     59  ./DelphesPythia8 $validationcard $cmnd $outputrootdir/$outputroot
    6060}
    6161
     
    6464  name=$1
    6565  pid=$2
    66   inputroot="${qcdPgLocation}/${pid}.root"
    67   rootfile="particleGun_${name}_${cardlabel}.root"
    68   ./DelphesROOT $validationCard $outputroot/$rootfile $inputroot
    69   echo "./DelphesROOT $validationCard $outputroot/$rootfile $inputroot"
     66  cmnd=$cardsdir/configLHE_$pid.cmnd
     67  inputroot=$samplesdir/$pid.root
     68  outputroot=particleGun_${name}_${cardlabel}.root
     69
     70  if [ ! -f $inputroot ]
     71  then
     72    python FlatGunLHEventProducer.py --pdg $pid --ptmin 1 --ptmax 50000 --etamin -6 --etamax 6 --size $nEvents --seed 1 --output $samplesdir/events_$pid.lhe --log --ecm 100000
     73
     74    cp examples/Pythia8/configLHE.cmnd $cmnd
     75    echo "Beams:LHEF = $samplesdir/events_$pid.lhe" >> $cmnd
     76    echo "Main:numberOfEvents = $nEvents" >> $cmnd
     77
     78    ./DelphesPythia8 cards/gen_card.tcl $cmnd $inputroot
     79  fi
     80
     81  ./DelphesROOT $validationcard $outputrootdir/$outputroot $inputroot
    7082}
    7183
     
    8597
    8698
    87 ./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 $version
     99./Validation $outputrootdir/particleGun_pion_$cardlabel.root $outputrootdir/particleGun_electron_$cardlabel.root $outputrootdir/particleGun_muon_$cardlabel.root $outputrootdir/particleGun_photon_$cardlabel.root $outputrootdir/particleGun_neutron_$cardlabel.root $outputrootdir/particleGun_jet_$cardlabel.root $outputrootdir/particleGun_bjet_$cardlabel.root $outputrootdir/particleGun_cjet_$cardlabel.root $outputrootdir/particleGun_taujet_$cardlabel.root $mainoutputdir/$output $version
    88100
    89101
     
    98110mv HCal.png $mainoutputdir/www/fig/img_hcal.png
    99111
    100 
    101 
    102 
Note: See TracChangeset for help on using the changeset viewer.