-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunNPE18.csh
executable file
·96 lines (76 loc) · 2.81 KB
/
RunNPE18.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env csh
### Combine with
# foreach n ( `seq 1 3` )
# hadd -f AjResults/rndm$n/R0.2_HC30_Presel.root AjResults/rndm$n/R0.2_HC30_Small_Clean8*root
# end
set Exec = "./bin/PicoAj"
# make sure executable exists
make $Exec || exit
# choose R or Pt options
set RMod = ""
# set RMod = R0.2_
# set RMod = Pt1_
# Input files
# set base = SmallAuAu/Small_Clean8
set base = Data/SmallNPE18/Small_AuAu11*
#set base = Data/SmallNPE18/Small_AuAu11PicoNPE18_Cent8_[0-9].root
#foreach randomoff ( `seq 0 9 ` )
#end # foreach randomoff
# choose random seed offset
set randomoff = 0
if { ( echo $1 | egrep -q '^[0-9]$' ) } then
set randomoff = $1
else if ( $#argv > 0 ) then
echo illegal arguments $argv
exit -1
endif
if ( $randomoff < 0 || $randomoff > 9 ) then
echo illegal randomoff $randomoff
exit -1
endif
set rndname = ""
if ( $randomoff > 0 ) then
set rndname = rndm${randomoff}
mkdir -pv AjResults/${rndname}
mkdir -pv logs/${rndname}
endif
####### Initialize condor file
echo "" > CondorFile
echo "Universe = vanilla" >> CondorFile
echo "Executable = ${Exec}" >> CondorFile
echo "getenv = true" >>CondorFile
# Notification doesn't seem to work, and is spammy anyway
# echo "Notification = Complete" >> CondorFile
# echo "Notify_user = [email protected]" >> CondorFile
foreach input ( ${base}* )
# arguments
set OutBase=`basename $input | sed 's/.root//g'`
#set OutName = AjResults/${rndname}/${RMod}Presel_AuAuAj_${OutBase}.root
#set OutName = AjResults/${rndname}/${RMod}NewCode_HC100_${OutBase}.root
#set OutName = AjResults/${rndname}/${RMod}FixedTowers_${OutBase}.root
set OutName = AjResults/${rndname}/${RMod}NPE18_HC100_${OutBase}.root
set TriggerName = HT
set Files = ${input}
# Logfiles.
# set LogFile = logs/${rndname}/${RMod}Presel_AuAuAj_${OutBase}.out
# set ErrFile = logs/${rndname}/${RMod}Presel_AuAuAj_${OutBase}.err
# set LogFile = logs/${rndname}/${RMod}NewCode_HC100_${OutBase}.out
# set ErrFile = logs/${rndname}/${RMod}NewCode_HC100_${OutBase}.err
# set LogFile = logs/${rndname}/${RMod}FixedTowers_${OutBase}.out
# set ErrFile = logs/${rndname}/${RMod}FixedTowers_${OutBase}.err
set LogFile = logs/${rndname}/${RMod}NPE18_HC100_${OutBase}.out
set ErrFile = logs/${rndname}/${RMod}NPE18_HC100_${OutBase}.err
### hand to condor
set Args = ( $OutName $TriggerName $Files 0 0 )
echo "" >> CondorFile
echo "Output = ${LogFile}" >> CondorFile
echo "Error = ${ErrFile}" >> CondorFile
echo "Arguments = ${Args}" >> CondorFile
echo "Queue" >> CondorFile
echo Submitting:
echo $Exec $Args
echo "Logging output to " $LogFile
echo "Logging errors to " $ErrFile
echo
end # foreach input
condor_submit CondorFile