-
Notifications
You must be signed in to change notification settings - Fork 1
/
qSystGeantAdder.csh
executable file
·88 lines (70 loc) · 3.17 KB
/
qSystGeantAdder.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
#!/usr/bin/env csh
set ExecPath = `pwd`
#set RMod = ""
set RMod = R0.6_
#set RMod = Pt1_
#### -- Run12
set inbase = ${RMod}SystGeant12_NoEff_NoBg_JP2
set outbase = ${RMod}SystGeant12_NoEff_NoBg_JP2
set fileroot = Cleanpp12Pico
set datapath = Data/AddedEmbedPythiaRun12pp200
# set inbase = ${RMod}SystGeant12_HC50_NoEff_NoBg_JP2
# set outbase = ${RMod}SystGeant12_HC50_NoEff_NoBg_JP2
# set fileroot = Cleanpp12Pico
# set datapath = Data/AddedEmbedPythiaRun12pp200
# set inbase = ${RMod}SystGeant12_MIP_NoEff_NoBg_JP2
# set outbase = ${RMod}SystGeant12_MIP_NoEff_NoBg_JP2
# set fileroot = Cleanpp12Pico
# set datapath = Data/AddedEmbedPythiaRun12pp200
#### -- Run6
# set inbase = ${RMod}SystGeant_NoEff_NoBg_HT54
# set outbase = ${RMod}SystGeant_NoEff_NoBg_HT54
# set fileroot = picoDst
# set datapath = Data/AddedGeantPythia
# set inbase = ${RMod}SystGeant_MIP_NoEff_NoBg_HT54
# set outbase = ${RMod}SystGeant_MIP_NoEff_NoBg_HT54
# set fileroot = picoDst
# set datapath = Data/AddedGeantPythia
foreach Tow ( 0 -1 1 )
foreach Smear ( 0 1 )
foreach Eff ( 0 -1 )
# foreach Tow ( 0 )
# foreach Smear ( 0 )
# foreach Eff ( 0 )
@ TowEff = $Tow * $Eff
@ TowSmear = $Tow * $Smear
@ SmearEff = $Eff * $Smear
# Only combinations where at most 1 is !=0
# echo Tow = $Tow Smear = $Smear Eff = $Eff
# echo TowEff = $TowEff TowSmear = $TowSmear SmearEff = $SmearEff
if ( $TowEff != 0 || $TowSmear != 0 || $SmearEff != 0 ) continue;
# Except also allow Tow=1, Eff=-1
# if ( ( $TowEff != 0 && $TowEff != -1 ) || $TowSmear != 0 || $SmearEff != 0 ) continue;
# Allow all combinations...
set binjobs=''
set binouts=''
# obscure shall magic to get pt bins here
if ( $fileroot == Cleanpp12Pico ) then
set bins = `find $datapath -name "${fileroot}*root" | grep -o 'pt[0-9]*_[0-9]*' |sort|uniq `
else if ( $fileroot == picoDst ) then
set bins = `find $datapath -name "${fileroot}*root"| sed 's/Dst_/Dst_XX/g' | grep -o 'XX[0-9]*_[0-9]*' |sed 's/XX//g'|sort|uniq`
else
echo "Can't deal with fileroot " $fileroot
endif
foreach bin ( $bins)
set In = Results/Pieces/AEff${Eff}_PtSmear${Smear}_ATow${Tow}_${inbase}_${fileroot}_${bin}*.root
set Out = Results/SysStuff/AEff${Eff}_PtSmear${Smear}_ATow${Tow}_${outbase}_${bin}.root
# Logfiles.
set LogFile = logs/Add_AEff${Eff}_PtSmear${Smear}_ATow${Tow}_${inbase}_${fileroot}_${bin}.out
set ErrFile = logs/Add_AEff${Eff}_PtSmear${Smear}_ATow${Tow}_${inbase}_${fileroot}_${bin}.err
set binjobs=${binjobs}:`qsub -V -p 10 -q erhiq -l mem=2gb -W umask=0022 -N AddGeantPart -o $LogFile -e $ErrFile -- ${ExecPath}/qwrap.sh ${ExecPath} hadd -f ${Out} ${In}`
set binouts="${binouts} $Out"
end
# finalize
set Out = Results/AEff${Eff}_PtSmear${Smear}_ATow${Tow}_${outbase}.root
set LogFile = logs/Add_AEff${Eff}_PtSmear${Smear}_ATow${Tow}_${inbase}.out
set ErrFile = logs/Add_AEff${Eff}_PtSmear${Smear}_ATow${Tow}_${inbase}.err
qsub -W depend=afterok${binjobs} -V -p 10 -q erhiq -l mem=2gb -W umask=0022 -N AddGeant -o $LogFile -e $ErrFile -- ${ExecPath}/qwrap.sh ${ExecPath} hadd -f ${Out} ${binouts}
end
end
end