Logo coherent WaveBurst  
Config Reference Guide
Logo
mkpp.csh
Go to the documentation of this file.
1 #!/bin/tcsh -f
2 
3 set called=($_)
4 
5 if ( "$called" != "" ) then ### called by source
6  echo "branch 1"
7  set script_fn=`readlink -f $called[2]`
8 else ### called by direct excution of the script
9  echo "branch 2"
10  set script_fn=`readlink -f $0`
11 endif
12 
13 echo "A:$0"
14 echo "B:$called"
15 set script_dir=`dirname $script_fn`
16 
17 echo "script file name=$script_fn"
18 echo "script dir=$script_dir"
19 
20 
21 onintr irq_ctrlc
22 
23 unsetenv CWB_MERGE_LABEL
24 unsetenv CWB_CHUNK_START
25 unsetenv CWB_CHUNK_STOP
26 unsetenv CWB_PP_OPTIONS
27 unsetenv CWB_CHUNK_SEARCH
28 
29 if ((( $1 == '' ))) then
30  echo ""
31  echo "CWB_MERGE_LABEL not defined"
32  echo ""
33  exit 1
34 else
35  setenv CWB_MERGE_LABEL $1
36 endif
37 
38 if ((( $2 == '' ))) then
39  echo ""
40  echo "CWB_CHUNK_START not defined"
41  echo ""
42  exit 1
43 else
44  setenv CWB_CHUNK_START $2
45 endif
46 
47 if ((( $3 == '' ))) then
48  echo ""
49  echo "CWB_CHUNK_STOP not defined"
50  echo ""
51  exit 1
52 else
53  setenv CWB_CHUNK_STOP $3
54 endif
55 
56 if ((( $4 != 'merge' ) && ( $4 != 'veto' ) && ( $4 != 'cut' ) && ( $4 != 'ifar' ) && ( $4 != 'pe' ) && ( $4 != 'report' ) && ( $4 != 'all' ) &&( $4 != '' ))) then
57  echo ""
58  echo \'$4\' "is a wrong cwb pp option"
59  echo ""
60  echo "available options"
61  echo " no options -> all (default)"
62  echo " merge : execute merge"
63  echo " veto : execute veto"
64  echo " cut : execute cut"
65  echo " ifar : execute ifar"
66  echo " pe : execute pe"
67  echo " report: execute report"
68  echo " all : execute merge+veto+cut+ifar+pe+report"
69  echo ""
70  exit 1
71 else
72  if ((( $4 == '' ))) then
73  setenv CWB_PP_OPTIONS "all"
74  else
75  setenv CWB_PP_OPTIONS $4
76  endif
77 endif
78 
79 if ((( $5 == '' ))) then
80  setenv CWB_CHUNK_SEARCH "BBH"
81 else
82  setenv CWB_CHUNK_SEARCH $5
83 endif
84 
85 if ((( $CWB_PP_OPTIONS == "merge" ) || ( $CWB_PP_OPTIONS == "all" ))) then
86  ${CWB_SCRIPTS}/cwb_merge.csh $CWB_MERGE_LABEL '--nthreads 8'
87  if ( $? != 0) exit 1
88 endif
89 
90 if ((( $CWB_PP_OPTIONS == "veto" ) || ( $CWB_PP_OPTIONS == "all" ))) then
91  ${CWB_SCRIPTS}/cwb_setveto.csh $CWB_MERGE_LABEL
92  if ( $? != 0) exit 1
93 endif
94 
95 if ((( $CWB_PP_OPTIONS == "cut" ) || ( $CWB_PP_OPTIONS == "all" ))) then
96  ${CWB_SCRIPTS}/cwb_setcuts.csh $CWB_MERGE_LABEL.V_hvetoLH '--unique true'
97  if ( $? != 0) exit 1
98 endif
99 
100 if ((( $CWB_PP_OPTIONS == "ifar" ) || ( $CWB_PP_OPTIONS == "all" ))) then
101  @ K = $CWB_CHUNK_START
102  while ($K <= $CWB_CHUNK_STOP)
103  set KK=`echo $K | awk '{ printf "%02d\n", $0 }'`
104  if($K == $CWB_CHUNK_START) then
105  ${CWB_SCRIPTS}/cwb_setifar.csh $CWB_MERGE_LABEL.V_hvetoLH.C_U ' --tsel bin1_cut&&O1_K'$KK'_cut --label bin1_cut --file far_bin1_cut_file['$KK'] --mode exclusive'
106  if ( $? != 0) exit 1
107  else
108  ${CWB_SCRIPTS}/cwb_setifar.csh $CWB_MERGE_LABEL.V_hvetoLH.C_U.S_bin1_cut '--tsel bin1_cut&&O1_K'$KK'_cut --label same --file far_bin1_cut_file['$KK'] --mode exclusive'
109  if ( $? != 0) exit 1
110  endif
111  @ K += 1
112  end
113 endif
114 
115 if ((( $CWB_PP_OPTIONS == "pe" ) || ( $CWB_PP_OPTIONS == "all" ))) then
116  ${CWB_SCRIPTS}/cwb_report.csh $CWB_MERGE_LABEL.V_hvetoLH.C_U.S_bin1_cut pe
117  if ( $? != 0) exit 1
118 endif
119 
120 if ((( $CWB_PP_OPTIONS == "report" ) || ( $CWB_PP_OPTIONS == "all" ))) then
121  ${CWB_SCRIPTS}/cwb_report_cbc.csh $CWB_MERGE_LABEL.V_hvetoLH.C_U.S_bin1_cut $CWB_CHUNK_SEARCH
122  if ( $? != 0) exit 1
123 endif
124 
125 unsetenv CWB_MERGE_LABEL
126 unsetenv CWB_CHUNK_START
127 unsetenv CWB_CHUNK_STOP
128 unsetenv CWB_PP_OPTIONS
129 unsetenv CWB_CHUNK_SEARCH
130 
131 exit 0
132 irq_ctrlc:
133  ps T | grep root | awk '{print $1}' | xargs kill -9
134  exit 1
135 
shift breaksw case T
Definition: cwb_clchunk.csh:90