6 $CWB_SCRIPTS/cwb_help.csh cwb_obchunk
12 echo
'cwb_obchunk --run="..." --search="..." --bin="..." --wlabel="..." --list="..." --trials="..." --bbh="..." --chunk="..." --lag="..." --slag="..." --merge="..." --opt="..."'
14 echo
"run : O1, O2, O3 (def=O2)"
15 echo
"search : BurstLF, BurstHF, BurstLD, IMBHB, BBH (def=BBH)"
16 echo
"bin : 1,2,... -> bin1_cut, bin2_cut, ..."
17 echo
"wlabel : working directory label -> O2_K03_C00_LH_BurstLF_BKG_dev1"
18 echo
"list : list of root files used to merge together the chunks"
19 echo
"trials : trials to applied to the detected events"
20 echo
"bbh : true/false (def=true)"
21 echo
"chunk : chunk number: integer number, Ex 02,03,...,15 "
22 echo
"merge : merge id: integer number"
23 echo
"mlabel : post merge label: Used when non standard labels are used in post-production"
24 echo
" Ex: for M1.V_hvetoLH.C_bin1_cut it is V_hvetoLH.C_bin1_cut"
25 echo
"rlabel : report label: Used when non standard labels are used in post-production reports"
26 echo
" Ex: for M1.V_hvetoLH.C_bin1_cut.R_rMRA_hveto_i0cc00_i1rho0_freq16_512 it is R_rMRA_hveto_i0cc00_i1rho0_freq16_512"
27 echo
"lag : lag number: integer number"
28 echo
"slag : slag number: integer number"
31 echo
" no options -> disable (default)"
32 echo
" mkdir : creates open box directory"
33 echo
" report : creates report for lag e slag"
34 echo
" ced : submit CEDs"
35 echo
" plot : creates plots"
36 echo
" html : creates chunk html report"
37 echo
" all : mkdir+report+ced+plot+html"
39 echo
"question: if not blank then skip question -> Open Box Result, do you want to procede (y/n)? "
41 echo
'Ex: cwb_obchunk --wlabel="O2_K03_C00_LH_BurstLF_BKG_dev1" --chunk="03" --lag="1" --slag="0" --merge="1" --opt="create"'
46 setenv CWB_OBCHUNK_RUN
"O2"
47 setenv CWB_OBCHUNK_NET
""
48 setenv CWB_OBCHUNK_SEARCH
"BBH"
49 setenv CWB_OBCHUNK_BIN 1
50 setenv CWB_OBCHUNK_WLABEL
""
51 setenv CWB_OBCHUNK_LIST
""
52 setenv CWB_OBCHUNK_TRIALS 1
53 setenv CWB_OBCHUNK_BBH
"true"
54 setenv CWB_OBCHUNK_CHUNK
""
55 setenv CWB_OBCHUNK_LAG
""
56 setenv CWB_OBCHUNK_SLAG
""
57 setenv CWB_OBCHUNK_MERGE
""
58 setenv CWB_OBCHUNK_MLABEL
""
59 setenv CWB_OBCHUNK_RLABEL
""
60 setenv CWB_OBCHUNK_OPTIONS
""
61 setenv CWB_OBCHUNK_QUESTION
""
63 set cmd_line=
"$0 $argv"
65 set temp=(`getopt -
s tcsh -
o r:
n:
S:
b:
w:
c:
l:
s:
m:
M:
R:
o:
q:
B:
L:
T: --
long run:,net:,
search:,bin:,wlabel:,chunk:,lag:,slag:,merge:,mlabel:,rlabel:,opt:,question:,bbh:,list:,trials: -- $argv:
q`)
67 echo
"Terminating..." >/dev/stderr
70 eval set argv=\($temp:
q\)
76 setenv CWB_OBCHUNK_RUN $2:
q
81 setenv CWB_OBCHUNK_NET $2:
q
86 setenv CWB_OBCHUNK_SEARCH $2:
q
91 setenv CWB_OBCHUNK_BIN $2:
q
96 setenv CWB_OBCHUNK_WLABEL $2:
q
101 setenv CWB_OBCHUNK_LIST $2:
q
106 setenv CWB_OBCHUNK_TRIALS $2:
q
111 setenv CWB_OBCHUNK_CHUNK $2:
q
116 setenv CWB_OBCHUNK_LAG $2:
q
121 setenv CWB_OBCHUNK_SLAG $2:
q
126 setenv CWB_OBCHUNK_MERGE $2:
q
131 setenv CWB_OBCHUNK_MLABEL $2:
q
136 setenv CWB_OBCHUNK_RLABEL $2:
q
141 setenv CWB_OBCHUNK_OPTIONS $2:
q
146 setenv CWB_OBCHUNK_QUESTION $2:
q
151 setenv CWB_OBCHUNK_BBH $2:
q
158 echo
"error - missing parameters!" ;
exit 1
162 if ((( $CWB_OBCHUNK_RUN !=
'O1' ) && ( $CWB_OBCHUNK_RUN !=
'O2' ) && ( $CWB_OBCHUNK_RUN !=
'O3' ))) then
164 echo --
run=\
'$CWB_OBCHUNK_RUN\' "is a wrong cwb_obchunk option\n"
165 echo "type cwb_obchunk to list the available options"
170 if ((( $CWB_OBCHUNK_SEARCH != 'BurstLF
' ) && ( $CWB_OBCHUNK_SEARCH != 'BurstHF
' ) && ( $CWB_OBCHUNK_SEARCH != 'BurstLD
' ) && ( $CWB_OBCHUNK_SEARCH != 'IMBHB
' ) && ( $CWB_OBCHUNK_SEARCH != 'BBH
' ))) then
172 echo --search=\'$CWB_OBCHUNK_SEARCH\' "is a wrong cwb_obchunk option\n"
173 echo "type cwb_obchunk to list the available options"
178 if ( $CWB_OBCHUNK_BIN !~ ^[0-9]+$ ) then
180 echo --bin=\'$CWB_OBCHUNK_BIN\' "is a wrong cwb_obchunk option\n"
181 echo "type cwb_obchunk to list the available options"
186 if ( $CWB_OBCHUNK_TRIALS !~ ^[0-9]+$ ) then
188 echo --trials=\'$CWB_OBCHUNK_TRIALS\' "is a wrong cwb_obchunk option\n"
189 echo "type cwb_obchunk to list the available options"
194 if (! -d $CWB_OBCHUNK_WLABEL ) then
196 echo --wlabel=\'$CWB_OBCHUNK_WLABEL\' "working directory do not exist\n"
197 echo "type cwb_obchunk to list the available options"
202 if ((( $CWB_OBCHUNK_BBH != 'true' ) && ( $CWB_OBCHUNK_BBH != 'false' ))) then
204 echo --run=\'$CWB_OBCHUNK_BBH\' "is a wrong cwb_obchunk option\n"
205 echo "type cwb_obchunk to list the available options"
210 if ( $CWB_OBCHUNK_CHUNK !~ ^[0-9]+$ ) then
212 echo --chunk=\'$CWB_OBCHUNK_CHUNK\' "is a wrong cwb_obchunk option\n"
213 echo "type cwb_obchunk to list the available options"
218 if ( $CWB_OBCHUNK_MERGE !~ ^[0-9]+$ ) then
220 echo --merge=\'$CWB_OBCHUNK_MERGE\' "is not an integer\n"
221 echo "type cwb_obchunk to list the available options"
226 if ( $CWB_OBCHUNK_LAG !~ ^[0-9]+$ ) then
228 echo --lag=\'$CWB_OBCHUNK_LAG\' "is not an integer\n"
229 echo "type cwb_obchunk to list the available options"
234 if ( $CWB_OBCHUNK_SLAG !~ ^[0-9]+$ ) then
236 echo --slag=\'$CWB_OBCHUNK_SLAG\' "is not an integer\n"
237 echo "type cwb_obchunk to list the available options"
242 if ((( $CWB_OBCHUNK_OPTIONS != 'mkdir
' ) && ( $CWB_OBCHUNK_OPTIONS != 'plot
' ) && ( $CWB_OBCHUNK_OPTIONS != 'report
' ) && ( $CWB_OBCHUNK_OPTIONS != 'ced
' ) && ( $CWB_OBCHUNK_OPTIONS != 'html
' ) && ( $CWB_OBCHUNK_OPTIONS != 'all
' ))) then
244 echo --opt=\'$CWB_OBCHUNK_OPTIONS\' "is a wrong cwb_obchunk option\n"
245 echo "type cwb_obchunk to list the available options"
250 if (( $CWB_OBCHUNK_LAG == 0 ) && ( $CWB_OBCHUNK_SLAG == 0 ) && ( $CWB_OBCHUNK_QUESTION == "" )) then
251 echo "Open Box Result, do you want to procede (y/n)?"
253 if ( $answer == "n" ) then
259 if ( $CWB_OBCHUNK_MLABEL == '' ) then
260 set PMERGE_LABEL = V_hvetoLH.C_bin$CWB_OBCHUNK_BIN\_cut
262 set PMERGE_LABEL = $CWB_OBCHUNK_MLABEL
265 if ( $CWB_OBCHUNK_SEARCH == 'BurstLF
' ) then
266 if ( $CWB_OBCHUNK_RLABEL == '' ) then
267 set PP_LABEL = $PMERGE_LABEL.R_rMRA_hveto_i0cc00_i0rho0_freq16_1024
269 set PP_LABEL = $PMERGE_LABEL.$CWB_OBCHUNK_RLABEL
271 set DIR_REP = report/dump/M$CWB_OBCHUNK_MERGE.$PMERGE_LABEL.Box_Result_Bin$CWB_OBCHUNK_BIN\_Lag$CWB_OBCHUNK_LAG\_Slag$CWB_OBCHUNK_SLAG
274 if ( $CWB_OBCHUNK_SEARCH == 'BurstHF
' ) then
275 if ( $CWB_OBCHUNK_RLABEL == '' ) then
276 set PP_LABEL = $PMERGE_LABEL.R_rMRA_hveto_i0cc00_i0rho0_freq512_4096
278 set PP_LABEL = $PMERGE_LABEL.$CWB_OBCHUNK_RLABEL
280 set DIR_REP = report/dump/M$CWB_OBCHUNK_MERGE.$PMERGE_LABEL.Box_Result_Bin$CWB_OBCHUNK_BIN\_Lag$CWB_OBCHUNK_LAG\_Slag$CWB_OBCHUNK_SLAG
283 if ( $CWB_OBCHUNK_SEARCH == 'BurstLD
' ) then
284 if ( $CWB_OBCHUNK_RLABEL == '' ) then
285 set PP_LABEL = $PMERGE_LABEL.R_rMRA_hveto_i0cc00_i0rho0_freq16_2048
287 set PP_LABEL = $PMERGE_LABEL.$CWB_OBCHUNK_RLABEL
289 set DIR_REP = report/dump/M$CWB_OBCHUNK_MERGE.$PMERGE_LABEL.Box_Result_Bin$CWB_OBCHUNK_BIN\_Lag$CWB_OBCHUNK_LAG\_Slag$CWB_OBCHUNK_SLAG
292 if (( $CWB_OBCHUNK_SEARCH == 'IMBHB
' ) || ( $CWB_OBCHUNK_SEARCH == 'BBH
' )) then
293 if ( $CWB_OBCHUNK_RLABEL == '' ) then
294 set PP_LABEL = $PMERGE_LABEL.R_rMRA_hveto_i0cc00_i1rho0_freq16_512
296 set PP_LABEL = $PMERGE_LABEL.$CWB_OBCHUNK_RLABEL
298 set DIR_REP = report/dump/M$CWB_OBCHUNK_MERGE.$PMERGE_LABEL.Box_Result_Lag$CWB_OBCHUNK_LAG\_Slag$CWB_OBCHUNK_SLAG
304 if (( $CWB_OBCHUNK_OPTIONS == 'plot
' ) && ( $CWB_OBCHUNK_LIST != '' ) && ( $CWB_OBCHUNK_CHUNK == 99 )) then # create IFAR plots using a list of output root files
305 root -l -b -q $CWB_CONFIG/MACROS/Make_PP_IFAR.C\(\"$CWB_OBCHUNK_LIST\",\"--search=$CWB_OBCHUNK_SEARCH\:bin$CWB_OBCHUNK_BIN\ --run=$CWB_OBCHUNK_RUN\ --bbh=true\ --trials=$CWB_OBCHUNK_TRIALS\ --lag=$CWB_OBCHUNK_LAG\ --slag=$CWB_OBCHUNK_SLAG\ --chunk=$CWB_OBCHUNK_CHUNK\ --pfname=$DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP/CumulativeNumberVsIFAR.png\"\)
306 root -l -b -q $CWB_CONFIG/MACROS/Make_PP_IFAR.C\(\"$CWB_OBCHUNK_LIST\",\"--search=$CWB_OBCHUNK_SEARCH\:bin$CWB_OBCHUNK_BIN\ --run=$CWB_OBCHUNK_RUN\ --bbh=false\ --trials=$CWB_OBCHUNK_TRIALS\ --lag=$CWB_OBCHUNK_LAG\ --slag=$CWB_OBCHUNK_SLAG\ --chunk=$CWB_OBCHUNK_CHUNK\ --pfname=$DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP/CumulativeNumberVsIFAR.png\"\)
309 if (( $CWB_OBCHUNK_OPTIONS == 'html
' ) && ( $CWB_OBCHUNK_LIST != '' ) && ( $CWB_OBCHUNK_CHUNK == 99 )) then # create html using a list of output root files
310 root -l -b -q $CWB_CONFIG/MACROS/cwb_mkhtml_all.C\(\"$CWB_OBCHUNK_LIST\",\"$CWB_OBCHUNK_RUN\",\"$CWB_OBCHUNK_RUN\:$CWB_OBCHUNK_NET\:$CWB_OBCHUNK_SEARCH\:Bin$CWB_OBCHUNK_BIN\",$CWB_OBCHUNK_LAG,$CWB_OBCHUNK_SLAG,\"$CWB_OBCHUNK_WLABEL\",\"$DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP/CumulativeNumberVsIFAR.png\"\)
315 set DIR_BKG = postprod/M$CWB_OBCHUNK_MERGE.$PP_LABEL
316 set DIR_FRG = postprod/M$CWB_OBCHUNK_MERGE.$PP_LABEL\_lag$CWB_OBCHUNK_LAG\_slag$CWB_OBCHUNK_SLAG
318 if ("$PMERGE_LABEL" !~ "*.S_*") then
319 set WAVE_FILE = ../../../merge/wave_$CWB_OBCHUNK_WLABEL.M$CWB_OBCHUNK_MERGE.$PMERGE_LABEL.S_ifar.root
321 set WAVE_FILE = ../../../merge/wave_$CWB_OBCHUNK_WLABEL.M$CWB_OBCHUNK_MERGE.$PMERGE_LABEL.root
323 set RHO_FREQ_FILE = ../../$DIR_BKG/data/rho_frequency.gif
324 set RHO_TIME_FILE = ../../$DIR_BKG/data/rho_time.gif
326 if (( $CWB_OBCHUNK_OPTIONS == 'mkdir
' ) || ( $CWB_OBCHUNK_OPTIONS == 'all
' )) then
327 echo $CWB_OBCHUNK_WLABEL/$DIR_REP
328 mkdir $CWB_OBCHUNK_WLABEL/$DIR_REP
331 if (( $CWB_OBCHUNK_OPTIONS == 'report
' ) || ( $CWB_OBCHUNK_OPTIONS == 'all
' )) then
332 cd $CWB_OBCHUNK_WLABEL
333 ${CWB_SCRIPTS}/cwb_report.csh M$CWB_OBCHUNK_MERGE.$PMERGE_LABEL create $CWB_OBCHUNK_LAG $CWB_OBCHUNK_SLAG
336 set CED_DAG = condor/$CWB_OBCHUNK_WLABEL.M$CWB_OBCHUNK_MERGE.$PP_LABEL.ced.dag
338 if (( $CWB_OBCHUNK_OPTIONS == 'ced
' ) || ( $CWB_OBCHUNK_OPTIONS == 'all
' )) then
339 cd $DIR_PWD/$CWB_OBCHUNK_WLABEL
341 echo "do you wat to force submit (y/n)?"
343 if ( $answer == "n" ) then
349 ${CWB_SCRIPTS}/cwb_condor.csh submit $CED_DAG
352 if (( $CWB_OBCHUNK_OPTIONS == 'plot
' ) || ( $CWB_OBCHUNK_OPTIONS == 'all
' )) then
354 if (! -f $DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP/$WAVE_FILE ) then
356 echo $DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP/$WAVE_FILE " not exist\n"
361 cd $DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP
362 ln -sf $RHO_TIME_FILE
363 ln -sf $RHO_FREQ_FILE
365 root -l -b $CWB_CONFIG/MACROS/Make_PP_IFAR.C\(\"$WAVE_FILE\",\"--search=$CWB_OBCHUNK_SEARCH\:bin$CWB_OBCHUNK_BIN\ --run=$CWB_OBCHUNK_RUN\ --bbh=$CWB_OBCHUNK_BBH\ --lag=$CWB_OBCHUNK_LAG\ --slag=$CWB_OBCHUNK_SLAG\ --chunk=$CWB_OBCHUNK_CHUNK\ --pfname=CumulativeNumberVsIFAR.png\"\)
366 root -l -b $CWB_CONFIG/MACROS/Draw_FARvsRHO.C\(\"../../$DIR_BKG/data/far_rho.txt\",\"../../$DIR_FRG/data/far_rho.txt\",\"FARvsRank\"\)
369 if (( $CWB_OBCHUNK_OPTIONS == 'html
' ) || ( $CWB_OBCHUNK_OPTIONS == 'all
' )) then
370 cd $DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP
372 # Remove leading zeroes from CWB_OBCHUNK_CHUNK (08 -> 8)
373 set CWB_OBCHUNK_XCHUNK=`echo $CWB_OBCHUNK_CHUNK | sed 's/^0*
375 root -
l -
b $CWB_CONFIG/MACROS/
cwb_mkhtml_chunk.C\(\
"$CWB_OBCHUNK_RUN\",\"$CWB_OBCHUNK_SEARCH\",\"$CWB_OBCHUNK_BIN\",$CWB_OBCHUNK_XCHUNK,$CWB_OBCHUNK_BBH,\"$DIR_BKG\",\"$DIR_FRG\",\"$DIR_PWD/$CWB_OBCHUNK_WLABEL/$DIR_REP\",\"$CWB_OBCHUNK_WLABEL\",\"$WAVE_FILE\",$CWB_OBCHUNK_LAG,$CWB_OBCHUNK_SLAG,2\)
378 # create cWB_config.log file
379 # make -f $CWB_CONFIG/Makefile.log CMD_LINE="$cmd_line
" git >& /dev/null
383 unsetenv CWB_OBCHUNK_RUN
384 unsetenv CWB_OBCHUNK_NET
385 unsetenv CWB_OBCHUNK_SEARCH
386 unsetenv CWB_OBCHUNK_BIN
387 unsetenv CWB_OBCHUNK_WLABEL
388 unsetenv CWB_OBCHUNK_CHUNK
389 unsetenv CWB_OBCHUNK_LAG
390 unsetenv CWB_OBCHUNK_SLAG
391 unsetenv CWB_OBCHUNK_MERGE
392 unsetenv CWB_OBCHUNK_MLABEL
393 unsetenv CWB_OBCHUNK_RLABEL
394 unsetenv CWB_OBCHUNK_OPTIONS
395 unsetenv CWB_OBCHUNK_QUESTION
399 ps T | grep root | awk '{print $1}' | xargs kill -9
void cwb_mkhtml_chunk(TString run, TString search, TString ibin, int ichunk, bool bbh, TString dir_bkg, TString dir_frg, TString odir, TString wlabel, TString net_file_name, int lag, int slag, int nIFO)