ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/CrabScript/mkseeds.sh
Revision: 1.1.1.1 (vendor branch)
Committed: Fri Nov 30 13:10:50 2007 UTC (17 years, 5 months ago) by auterman
Content type: application/x-sh
Branch: tex, Demo, SusyScan, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
Error occurred while calculating annotation data.
Log Message:
Scripts for a SUSY parameter scan

File Contents

# Content
1 #!/bin/bash
2 # Shell script to generate random seeds
3 # C.A., 16.4.2007
4 TIME=`date +%s`
5 SEED1=$(($TIME-1195555555))
6 SEED2=$(($TIME-1195544444))
7 SEED3=$(($TIME-1195533333))
8 SEED4=$(($TIME-1195522222))
9
10 if [ -z $1 ]; then
11 FILE="crab.cfg"
12 else
13 FILE=$1
14 fi
15
16 cp -f $FILE $FILE.bkp
17
18 if [ -e $FILE ]; then
19 PREV_PY=`grep pythia_seed $FILE`
20 PREV_VT=`grep vtx_seed $FILE`
21 PREV_GE=`grep g4_seed $FILE`
22 PREV_MI=`grep mix_seed $FILE`
23 sed -e "s/$PREV_PY/pythia_seed = $SEED1/" $FILE.'bkp' > $FILE'.1'
24 sed -e "s/$PREV_VT/vtx_seed = $SEED2/" $FILE'.1' > $FILE'.2'
25 sed -e "s/$PREV_GE/g4_seed = $SEED3/" $FILE'.2' > $FILE'.3'
26 sed -e "s/$PREV_MI/mix_seed = $SEED4/" $FILE'.3' > $FILE
27 rm -f $FILE'.1' $FILE'.2' $FILE'.3' $FILE.bkp
28 echo "SUCCESS! Used pythia_seed=$SEED1 , vtx_seed=$SEED2 , g4_seed=$SEED3 and mix_seed=$SEED4 in file $FILE"
29 else
30 echo "ERROR: you have no '$FILE' file"
31 fi