Logo coherent WaveBurst  
Config Reference Guide
Logo
cwb_ppchunk.csh
Go to the documentation of this file.
1 #!/bin/tcsh -f
2 
3 onintr irq_ctrlc
4 
5 if ( $1 == '' ) then
6  $CWB_SCRIPTS/cwb_help.csh cwb_ppchunk
7  exit
8 endif
9 
10 if ($1 == '') then
11  echo ""
12  echo 'cwb_ppchunk --run="..." --chunk="..." --cal="..." --net="..." --search="..." --type="..." --tag="..." --mlabel="..." --opt="..."'
13  echo ""
14  echo "run : O1, O2, O3"
15  echo "chunk : integer number"
16  echo "cal : C00, C00c, C01, C01c, C02, C02c"
17  echo "net : LH LHV"
18  echo "search : BurstLF, BurstHF, BurstLD, IMBHB, BBH"
19  echo "type : BKG, SIM"
20  echo "tag : user string (Ex: run1, tst1, dev1)"
21  echo 'mlabel : merge label, default="M1"'
22  echo ""
23  echo "options : optional"
24  echo " no options -> report (default)"
25  echo " merge : execute merge"
26  echo " veto : execute veto"
27  echo " cut : execute cut"
28  echo " ifar : execute ifar"
29  echo " report: execute report"
30  echo " all : execute merge + veto + cut + report"
31  echo ""
32  echo 'Ex: cwb_ppchunk --run="O2" --chunk="03" --cal="C00" --net="LH" --search="BurstLF" --type="BKG" --tag="dev1" --mlabel="M1"'
33  echo "or"
34  echo 'Ex: cwb_ppchunk --run=O2 --chunk=03 --cal=C00 --net=LH --search=BurstLF --type=BKG --tag=dev1 --mlabel=M1'
35  echo "or"
36  echo 'Ex: cwb_ppchunk --run O2 --chunk 03 --cal C00 --net LH --search BurstLF --type BKG --tag dev1 --mlabel M1'
37  echo ""
38  exit 1
39 endif
40 
41 setenv CWB_PPCHUNK_OPTIONS ""
42 setenv CWB_PPCHUNK_RUN ""
43 setenv CWB_PPCHUNK_CHUNK ""
44 setenv CWB_PPCHUNK_CAL ""
45 setenv CWB_PPCHUNK_NET ""
46 setenv CWB_PPCHUNK_SEARCH ""
47 setenv CWB_PPCHUNK_TYPE ""
48 setenv CWB_PPCHUNK_TAG ""
49 setenv CWB_PPCHUNK_MLABEL "M1"
50 setenv CWB_PPCHUNK_OPTIONS "all"
51 
52 set cmd_line="$0 $argv"
53 
54 set temp=(`getopt -s tcsh -o r:c:C:n:s:t:T:m:o: --long run:,chunk:,cal:,net:,search:,type:,tag:,mlabel:,opt: -- $argv:q`)
55 if ($? != 0) then
56  echo "Terminating..." >/dev/stderr
57  exit 1
58 endif
59 eval set argv=\‍($temp:q\‍)
60 
61 while (1)
62  switch($1:q)
63  case -r:
64  case --run:
65  setenv CWB_PPCHUNK_RUN $2:q
66  shift ; shift
67  breaksw
68  case -c:
69  case --chunk:
70  setenv CWB_PPCHUNK_CHUNK $2:q
71  shift ; shift
72  breaksw
73  case -C:
74  case --cal:
75  setenv CWB_PPCHUNK_CAL $2:q
76  shift ; shift
77  breaksw
78  case -n:
79  case --net:
80  setenv CWB_PPCHUNK_NET $2:q
81  shift ; shift
82  breaksw
83  case -s:
84  case --search:
85  setenv CWB_PPCHUNK_SEARCH $2:q
86  shift ; shift
87  breaksw
88  case -t:
89  case --type:
90  setenv CWB_PPCHUNK_TYPE $2:q
91  shift ; shift
92  breaksw
93  case -T:
94  case --tag:
95  setenv CWB_PPCHUNK_TAG $2:q
96  shift ; shift
97  breaksw
98  case -m:
99  case --mlabel:
100  setenv CWB_PPCHUNK_MLABEL $2:q
101  shift ; shift
102  breaksw
103  case -o:
104  case --opt:
105  setenv CWB_PPCHUNK_OPTIONS $2:q
106  shift ; shift
107  breaksw
108  case --:
109  shift
110  break
111  default:
112  echo "error - missing parameters!" ; exit 1
113  endsw
114 end
115 
116 if ((( $CWB_PPCHUNK_RUN != 'O1' ) && ( $CWB_PPCHUNK_RUN != 'O2' ) && ( $CWB_PPCHUNK_RUN != 'O3' ))) then
117  echo ""
118  echo --run=\'$CWB_PPCHUNK_RUN\' "is a wrong cwb_ppchunk option\n"
119  echo "type cwb_ppchunk to list the available options"
120  echo ""
121  exit 1
122 endif
123 
124 if ( $CWB_PPCHUNK_CHUNK !~ ^[0-9]+$ ) then
125  echo ""
126  echo --chunk=\'$CWB_PPCHUNK_CHUNK\' "is a wrong cwb_ppchunk option\n"
127  echo "type cwb_ppchunk to list the available options"
128  echo ""
129  exit 1
130 else
131  if ( $CWB_PPCHUNK_CHUNK == 99 ) then
132  if ( $CWB_PPCHUNK_RUN == 'O1' ) then
133  @ CHUNK_START = $O1_CHUNK_START
134  @ CHUNK_STOP = $O1_CHUNK_STOP
135  endif
136  if ( $CWB_PPCHUNK_RUN == 'O2' ) then
137  @ CHUNK_START = $O2_CHUNK_START
138  @ CHUNK_STOP = $O2_CHUNK_STOP
139  endif
140  if ( $CWB_PPCHUNK_RUN == 'O3' ) then
141  @ CHUNK_START = $O3_CHUNK_START
142  @ CHUNK_STOP = $O3_CHUNK_STOP
143  endif
144  else
145  @ CHUNK_START = $CWB_PPCHUNK_CHUNK
146  @ CHUNK_STOP = $CWB_PPCHUNK_CHUNK
147  endif
148 endif
149 
150 if ((( $CWB_PPCHUNK_CAL != 'C00' ) && ( $CWB_PPCHUNK_CAL != 'C00c' ) && ( $CWB_PPCHUNK_CAL != 'C01' ) && ( $CWB_PPCHUNK_CAL != 'C01c' ) && ( $CWB_PPCHUNK_CAL != 'C02' ) && ( $CWB_PPCHUNK_CAL != 'C02c' ))) then
151  echo ""
152  echo --cal=\'$CWB_PPCHUNK_CAL\' "is a wrong cwb_ppchunk option\n"
153  echo "type cwb_ppchunk to list the available options"
154  echo ""
155  exit 1
156 endif
157 
158 if ((( $CWB_PPCHUNK_NET != 'LH' ) && ( $CWB_PPCHUNK_NET != 'LV' ) && ( $CWB_PPCHUNK_NET != 'HV' ) &&( $CWB_PPCHUNK_NET != 'LHV' ))) then
159  echo ""
160  echo --net=\'$CWB_PPCHUNK_NET\' "is a wrong cwb_ppchunk option\n"
161  echo "type cwb_ppchunk to list the available options"
162  echo ""
163  exit 1
164 endif
165 
166 if ((( $CWB_PPCHUNK_SEARCH != 'BurstLF' ) && ( $CWB_PPCHUNK_SEARCH != 'BurstHF' ) && ( $CWB_PPCHUNK_SEARCH != 'BurstLD' ) && ( $CWB_PPCHUNK_SEARCH != 'IMBHB' ) && ( $CWB_PPCHUNK_SEARCH != 'BBH' ))) then
167  echo ""
168  echo --search=\'$CWB_PPCHUNK_SEARCH\' "is a wrong cwb_ppchunk option\n"
169  echo "type cwb_ppchunk to list the available options"
170  echo ""
171  exit 1
172 endif
173 
174 if ((( $CWB_PPCHUNK_TYPE == 'BKG' ) || ( $CWB_PPCHUNK_TYPE =~ 'SIM/*' ))) then
175  setenv CWB_PPCHUNK_TYPE $CWB_PPCHUNK_TYPE
176  set CWB_PPCHUNK_SIM=$CWB_PPCHUNK_TYPE
177  set CWB_PPCHUNK_SIM_DIR=`echo $CWB_PPCHUNK_SIM | awk '{print substr($0, 5, length($0)-1)}'`
178 else
179  echo ""
180  echo --type=\'$CWB_PPCHUNK_TYPE\' "is a wrong cwb_ppchunk option\n"
181  echo "type cwb_ppchunk to list the available options"
182  echo ""
183  exit 1
184 endif
185 
186 if ((( $CWB_PPCHUNK_TAG == '' ))) then
187  echo ""
188  echo --tag=\'$CWB_PPCHUNK_TAG\' "is a wrong cwb_ppchunk option\n"
189  echo "type cwb_ppchunk to list the available options"
190  echo ""
191  exit 1
192 endif
193 
194 if ((( $CWB_PPCHUNK_MLABEL == 'M0' ))) then
195  echo ""
196  echo --mlabel=\'$CWB_PPCHUNK_MLABEL\' "is a wrong cwb_ppchunk option\n"
197  echo "type cwb_ppchunk to list the available options"
198  echo ""
199  exit 1
200 endif
201 
202 # check if config stuff exist in the input config repository
203 ${CWB_CONFIG}/SCRIPTS/cwb_ckchunk.csh --run=$CWB_PPCHUNK_RUN --chunk=$CWB_PPCHUNK_CHUNK --cal=$CWB_PPCHUNK_CAL --net=$CWB_PPCHUNK_NET --search=$CWB_PPCHUNK_SEARCH --type=$CWB_PPCHUNK_TYPE
204 if ( $? != 0) exit 1
205 
206 if (( $CWB_PPCHUNK_OPTIONS != 'merge' ) && ( $CWB_PPCHUNK_OPTIONS != 'veto' ) && ( $CWB_PPCHUNK_OPTIONS != 'cut' ) && ( $CWB_PPCHUNK_OPTIONS != 'ifar' ) && ( $CWB_PPCHUNK_OPTIONS != 'pe' ) && ( $CWB_PPCHUNK_OPTIONS != 'report' ) && ( $CWB_PPCHUNK_OPTIONS != 'all' )) then
207  echo ""
208  echo --opt=\'$CWB_PPCHUNK_OPTIONS\' "is a wrong cwb_ppchunk option\n"
209  echo "type cwb_ppchunk to list the available options"
210  echo ""
211  exit 1
212 endif
213 
214 if (( $CWB_PPCHUNK_TYPE =~ 'SIM/*' )) then
215  setenv CWB_PPCHUNK_DIR $CWB_PPCHUNK_RUN\_K$CWB_PPCHUNK_CHUNK\_$CWB_PPCHUNK_CAL\_$CWB_PPCHUNK_NET\_$CWB_PPCHUNK_SEARCH\_SIM\_$CWB_PPCHUNK_SIM_DIR\_$CWB_PPCHUNK_TAG
216 else
217  setenv CWB_PPCHUNK_DIR $CWB_PPCHUNK_RUN\_K$CWB_PPCHUNK_CHUNK\_$CWB_PPCHUNK_CAL\_$CWB_PPCHUNK_NET\_$CWB_PPCHUNK_SEARCH\_$CWB_PPCHUNK_TYPE\_$CWB_PPCHUNK_TAG
218 endif
219 
220 
221 cd $CWB_PPCHUNK_DIR
222 $CWB_CONFIG/$CWB_PPCHUNK_RUN/SEARCHES/OFFLINE/$CWB_PPCHUNK_SEARCH/$CWB_PPCHUNK_NET/$CWB_PPCHUNK_TYPE/mkpp.csh $CWB_PPCHUNK_MLABEL $CHUNK_START $CHUNK_STOP $CWB_PPCHUNK_OPTIONS $CWB_PPCHUNK_SEARCH
223 if ( $? != 0) exit 1
224 # create cWB_config.log file
225 make -f $CWB_CONFIG/Makefile.log CMD_LINE="$cmd_line" git >& /dev/null
226 
227 cd ..
228 
229 
230 unsetenv CWB_PPCHUNK_RUN
231 unsetenv CWB_PPCHUNK_CHUNK
232 unsetenv CWB_PPCHUNK_CAL
233 unsetenv CWB_PPCHUNK_NET
234 unsetenv CWB_PPCHUNK_SEARCH
235 unsetenv CWB_PPCHUNK_TYPE
236 unsetenv CWB_PPCHUNK_TAG
237 unsetenv CWB_PPCHUNK_MLABEL
238 unsetenv CWB_PPCHUNK_OPTIONS
239 unsetenv CWB_PPCHUNK_DIR
240 
241 exit 0
242 irq_ctrlc:
243  ps T | grep root | awk '{print $1}' | xargs kill -9
244  exit 1
shift breaksw case r
Definition: cwb_clchunk.csh:60
shift breaksw case q
shift breaksw case t
Definition: cwb_ppchunk.csh:91
shift breaksw case o
shift breaksw case T
Definition: cwb_ppchunk.csh:96
shift breaksw case n
Definition: cwb_ppchunk.csh:81
shift breaksw case s
Definition: cwb_ppchunk.csh:86
shift breaksw case m
shift breaksw case c
Definition: cwb_ppchunk.csh:71
shift breaksw case C
Definition: cwb_ppchunk.csh:76
string search
Definition: cWB_conf.py:63
string run
Definition: cWB_conf.py:6