]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/bash | |
2 | ||
3 | run=137161 | |
4 | pass=pass1_5plus | |
5 | mc=0 | |
6 | mode="full" | |
7 | nev=1234566789 | |
8 | workers=26 | |
9 | ROPT="" | |
10 | listfile="" | |
11 | offset=0 | |
12 | debug=kTRUE | |
13 | option="SAVE" #FIXME:set option | |
14 | suffix="" | |
15 | ||
16 | give_help() { | |
17 | ||
18 | cat <<ENDOFGUIDE | |
19 | This scripts runs the the physics selection and centrality on a specified run/dataset | |
20 | ||
21 | Available options: | |
22 | Mode control, at least one of the following options should be used | |
23 | -r <mode> Run the task | |
24 | Modes (compulsory): | |
25 | 0 local | |
26 | 1 caf | |
27 | 2 grid | |
28 | -d <run or dataset> Run number(s) (grid) or dataset (caf) or file name (local) | |
29 | Local filename can be an xml collection of files on alies, | |
30 | a single esd, or a text file with an ESD filename per line | |
31 | -m Set if runnning on MC | |
32 | -t <rootopt> Options passed to root | |
33 | -l <list.txt> Process sequentially all runs/dataset listed in the file | |
34 | (one entry per line). If you use this option you don't | |
35 | need the -d. in the case you are running on CAF, they | |
36 | must have the same path | |
37 | Grid only options | |
38 | -g <gridmode> Plugin Mode [default=$mode] | |
39 | -p <recopass> Reconstruction pass [default=$pass] | |
40 | CAF only options | |
41 | -p <path> Data set path | |
42 | -n <nev> Number of events | |
43 | -w <workers> Number of workers [default=$workers] | |
44 | ENDOFGUIDE | |
45 | ||
46 | } | |
47 | ||
48 | while getopts "r:hd:mg:p:n:w:t:l:" opt; do | |
49 | case $opt in | |
50 | r) | |
51 | runMode=$OPTARG | |
52 | ;; | |
53 | d) | |
54 | run=$OPTARG | |
55 | ;; | |
56 | l) | |
57 | listfile=$OPTARG | |
58 | ;; | |
59 | t) | |
60 | ROPT=$OPTARG | |
61 | ;; | |
62 | n) | |
63 | nev=$OPTARG | |
64 | ;; | |
65 | w) | |
66 | workers=$OPTARG | |
67 | ;; | |
68 | m) | |
69 | mc=kTRUE | |
70 | ;; | |
71 | g) | |
72 | mode=$OPTARG | |
73 | ;; | |
74 | p) | |
75 | pass=$OPTARG | |
76 | ;; | |
77 | h) | |
78 | give_help | |
79 | exit 1 | |
80 | ;; | |
81 | \?) | |
82 | echo "Invalid option: -$OPTARG" >&2 | |
83 | give_help | |
84 | exit 1 | |
85 | ;; | |
86 | :) | |
87 | echo "Option -$OPTARG requires an argument." >&2 | |
88 | give_help | |
89 | exit 1 | |
90 | ;; | |
91 | esac | |
92 | done | |
93 | ||
94 | ||
95 | runlist=$run | |
96 | if [ "$listfile" != "" ] | |
97 | then | |
98 | runlist="" | |
99 | while read line | |
100 | do | |
101 | runlist="$runlist $line" | |
102 | done < $listfile | |
103 | ||
104 | fi | |
105 | ||
106 | echo "Run list: $runlist" | |
107 | ||
108 | ||
109 | if [ "$runMode" = "2" ] | |
110 | then | |
111 | echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$option,$suffix,$workers,\"$mode\"\) | |
112 | root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,\"$option\",\"$suffix\",$workers,\"$mode\"\) | |
113 | else | |
114 | for run in $runlist | |
115 | do | |
116 | echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$option,$suffix,$workers,\"$mode\"\) | |
117 | root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,\"$option\",\"$suffix\",$workers,\"$mode\"\) | |
118 | done | |
119 | fi |