Logo Coherent WaveBurst  
Reference Guide
Logo
 All Namespaces Files Functions Variables Macros Pages
mkpp1BIN.csh
Go to the documentation of this file.
1 #!/bin/tcsh -f
2 
3 onintr irq_ctrlc
4 
5 unsetenv CWB_MERGE_LABEL
6 unsetenv CWB_CHUNK_START
7 unsetenv CWB_CHUNK_STOP
8 unsetenv CWB_PP_OPTIONS
9 
10 if ((( $1 == '' ))) then
11  echo ""
12  echo "CWB_MERGE_LABEL not defined"
13  echo ""
14  exit 1
15 else
16  setenv CWB_MERGE_LABEL $1
17 endif
18 
19 if ((( $2 == '' ))) then
20  echo ""
21  echo "CWB_CHUNK_START not defined"
22  echo ""
23  exit 1
24 else
25  setenv CWB_CHUNK_START $2
26 endif
27 
28 if ((( $3 == '' ))) then
29  echo ""
30  echo "CWB_CHUNK_STOP not defined"
31  echo ""
32  exit 1
33 else
34  setenv CWB_CHUNK_STOP $3
35 endif
36 
37 if ((( $4 != 'merge' ) && ( $4 != 'veto' ) && ( $4 != 'cut' ) && ( $4 != 'report' ) && ( $4 != 'all' ) &&( $4 != '' ))) then
38  echo ""
39  echo \'$4\' "is a wrong cwb pp option"
40  echo ""
41  echo "available options"
42  echo " no options -> all (default)"
43  echo " merge : execute merge"
44  echo " veto : execute veto"
45  echo " cut : execute cut"
46  echo " report: execute report"
47  echo " all : execute merge+veto+cut+report"
48  echo ""
49  exit 1
50 else
51  if ((( $4 == '' ))) then
52  setenv CWB_PP_OPTIONS "all"
53  else
54  setenv CWB_PP_OPTIONS $4
55  endif
56 endif
57 
58 if ((( $CWB_PP_OPTIONS == "merge" ) || ( $CWB_PP_OPTIONS == "all" ))) then
59  ${CWB_SCRIPTS}/cwb_merge.csh $CWB_MERGE_LABEL '--nthreads 10'
60  if ( $? != 0) exit 1
61 endif
62 
63 if ((( $CWB_PP_OPTIONS == "veto" ) || ( $CWB_PP_OPTIONS == "all" ))) then
64  ${CWB_SCRIPTS}/cwb_setveto.csh $CWB_MERGE_LABEL
65  if ( $? != 0) exit 1
66 endif
67 
68 if ((( $CWB_PP_OPTIONS == "cut" ) || ( $CWB_PP_OPTIONS == "all" ))) then
69  ${CWB_SCRIPTS}/cwb_setcuts.csh $CWB_MERGE_LABEL.V_hvetoLH '--unique true'
70  if ( $? != 0) exit 1
71 endif
72 
73 if ((( $CWB_PP_OPTIONS == "report" ) || ( $CWB_PP_OPTIONS == "all" ))) then
74  @ K = $CWB_CHUNK_START
75  while ($K <= $CWB_CHUNK_STOP)
76  set KK=`echo $K | awk '{ printf "%02d\n", $0 }'`
77  if($K == $CWB_CHUNK_START) then
78  ${CWB_SCRIPTS}/cwb_setifar.csh $CWB_MERGE_LABEL.V_hvetoLH.C_U ' --tsel bin1_cut&&O2_K'$KK'_cut --label bin1_cut --file far_bin1_cut_file['$KK'] --mode exclusive'
79  if ( $? != 0) exit 1
80  else
81  ${CWB_SCRIPTS}/cwb_setifar.csh $CWB_MERGE_LABEL.V_hvetoLH.C_U.S_bin1_cut '--tsel bin1_cut&&O2_K'$KK'_cut --label same --file far_bin1_cut_file['$KK'] --mode exclusive'
82  if ( $? != 0) exit 1
83  endif
84  @ K += 1
85  end
86 
87  ${CWB_SCRIPTS}/cwb_report.csh $CWB_MERGE_LABEL.V_hvetoLH.C_U.S_bin1_cut create
88  if ( $? != 0) exit 1
89 endif
90 
91 unsetenv CWB_MERGE_LABEL
92 unsetenv CWB_CHUNK_START
93 unsetenv CWB_CHUNK_STOP
94 unsetenv CWB_PP_OPTIONS
95 
96 exit 0
97 irq_ctrlc:
98  ps T | grep root | awk '{print $1}' | xargs kill -9
99  exit 1
100 
TCut bin1_cut
Definition: PP_Cuts.hh:16
TString far_bin1_cut_file[100]