6 |
|
fi |
7 |
|
|
8 |
|
echo -e "Have been supplied with the following arguments \n $1 \n $2 \n $3" |
9 |
< |
ORIGDIR=`pwd` |
9 |
> |
ORIGDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
10 |
> |
|
11 |
|
cd ~/final_production_2011/CMSSW_4_2_8/src/HiggsAnalysis/ |
12 |
|
origscramarch=$SCRAM_ARCH |
13 |
|
origbase=$CMSSW_BASE |
54 |
|
#$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M HybridNew --frequentist --testStat LHC $1/model.root -H ProfileLikelihood |
55 |
|
|
56 |
|
echo "Ready to run limit!" |
57 |
+ |
|
58 |
+ |
modelsource="model.root" |
59 |
+ |
if [[ $5 -gt 0 ]]; then |
60 |
+ |
modelsource="susydatacard.txt" |
61 |
+ |
fi |
62 |
+ |
|
63 |
|
if [[ $3 -gt 1 ]]; then |
64 |
|
echo "Asymptotic is $3 (0) therefore doing FULL LIMITS" |
65 |
|
# command="$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M HybridNew -t1 --frequentist --testStat LHC $1/model.root -H ProfileLikelihood" |
66 |
< |
command="$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M HybridNew --rule CLs --testStat LHC --rMin $5 --rMax $6 --freq -T 1000 -i 8 --saveHybridResult --saveToys -v 1 -s 0 $1/model.root " |
66 |
> |
command="$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M HybridNew --rule CLs --testStat LHC -H ProfileLikelihood --freq -T 1000 -i 8 --saveHybridResult --saveToys -v 1 -s 0 $1/${modelsource} " |
67 |
|
else |
68 |
|
if [[ $3 -lt 1 ]]; then |
69 |
|
echo "Asymptotic is $3 (0) therefore doing ASYMPTOTIC LIMITS" |
70 |
< |
command="$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M Asymptotic -t1 $1/model.root -H ProfileLikelihood" |
70 |
> |
command="$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M Asymptotic -t1 $1/${modelsource} -H ProfileLikelihood" |
71 |
|
else |
72 |
|
echo "Asymptotic is $3 (0) therefore doing ASYMPTOTIC LIMITS but WITH initial guess" |
73 |
< |
command="$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M Asymptotic --rMax $6 -t1 $1/model.root -H ProfileLikelihood" |
73 |
> |
command="$CMSSW_BASE/bin/$SCRAM_ARCH/combine -M Asymptotic -t1 $1/${modelsource} -H ProfileLikelihood" |
74 |
|
fi |
75 |
|
fi |
76 |
|
|
77 |
|
echo "Going to run $command" |
78 |
< |
time eval $command |
78 |
> |
#time eval $command 3>&1 >&2 2>&3 3>&- | tee $1/log.txt |
79 |
> |
time eval $command 2>&1 | tee $1/log.txt |
80 |
|
echo "Done running limits" |
81 |
+ |
errorsencountered=`cat $1/log.txt | grep nan | wc -l` |
82 |
+ |
echo "DURING LIMIT COMPUTATOIN, AN ERROR LOG HAS BEEN WRITTEN TO $1/errorlog.txt which contains $errorsencountered not-a-value's" |
83 |
+ |
if [[ $errorsencountered -gt 20 ]]; then |
84 |
+ |
# something is seriously wrong, there's no point in continuing |
85 |
+ |
exit -1 |
86 |
+ |
fi |
87 |
+ |
|
88 |
|
outfile="INVALID" |
89 |
|
echo `pwd` |
90 |
|
for i in `ls -ltrh | grep root | grep ombine | awk '{ print $9 }'`; do |
101 |
|
if [[ $3 -gt 1 ]]; then |
102 |
|
startfile=$outfile |
103 |
|
outfile="allmerged.root" |
104 |
< |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/model.root -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.16 |
105 |
< |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/model.root -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.025 |
106 |
< |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/model.root -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.5 |
107 |
< |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/model.root -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.84 |
108 |
< |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/model.root -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.975 |
109 |
< |
hadd $outfile *.root |
104 |
> |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/${modelsource} -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.16 |
105 |
> |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/${modelsource} -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.025 |
106 |
> |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/${modelsource} -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.5 |
107 |
> |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/${modelsource} -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.84 |
108 |
> |
$CMSSW_BASE/bin/$SCRAM_ARCH/combine $1/${modelsource} -M HybridNew --freq --grid=$startfile --expectedFromGrid 0.975 |
109 |
> |
hadd $outfile higgs*.root |
110 |
|
fi |
111 |
|
|
112 |
|
./ReadAndSave.exec $1/$outfile $1/ShapeDropletResult.txt |