]>
Commit | Line | Data |
---|---|---|
94430cc1 | 1 | // $Id$ |
2 | /** | |
3 | * @file recraw-local.C | |
4 | * @brief Run reconstruction of raw data locally | |
5 | * | |
6 | * <pre> | |
7 | * Usage: aliroot -b -q -l \ | |
dd347dca | 8 | * recraw-local.C'("file", "cdb", minEvent, maxEvent, modules)' |
94430cc1 | 9 | * |
10 | * Examples: | |
dd347dca | 11 | * recraw-local.C'("alien:///alice/data/2009/.../....root")' |
94430cc1 | 12 | * recraw-local.C'("raw://run12345")' |
13 | * recraw-local.C'("raw://run12345", minEvent, MaxEvent)' | |
14 | * recraw-local.C'("raw.root", "local://$PWD", minEvent, MaxEvent)' | |
043ef395 | 15 | * recraw-local.C'("10000135031045.10..root", "raw://", -1, -1)' |
cac76657 | 16 | * recraw-local.C'("alien:///alice/data/2010/LHC10f/000135031/raw/10000135031045.10.root", "raw://", -1, -1)' |
94430cc1 | 17 | * |
18 | * Defaults | |
dd347dca | 19 | * cdb="raw://" -> take OCDB from GRID |
20 | * minEvent=-1 -> no lower event selection | |
21 | * maxEvent=-1 -> no upper event selection | |
22 | * modules="ALL" -> all modules | |
deb17658 | 23 | * hltOption="loglevel=0x7c" -> logging level info and above |
94430cc1 | 24 | * |
25 | * </pre> | |
26 | * | |
27 | * The input file can be a file on the grid, indicated by the tag | |
28 | * 'alien://' indicates. By default also the OCDB is set to the GRID. | |
29 | * If either the file or the OCDB is taken from the GRID, the macros | |
30 | * connects to the Grid in the beginning. | |
31 | * | |
32 | * Input files can be specified via te run number when using the tag | |
33 | * 'raw://' followed by the string 'run12345' where the number needs | |
34 | * to be adjusted. | |
deb17658 | 35 | * |
36 | * As for the OCDB it is always a good idea to use the OCDB from the | |
37 | * Grid as this will contain all the necessary objects and the latest | |
38 | * calibration. The special URI 'raw://' is most advisable as it selects | |
39 | * the storage automatically from the run number. Other options are e.g. | |
40 | * - "alien://folder=/alice/data/2010/OCDB" | |
41 | * - "local://$ALICE_ROOT/OCDB" | |
42 | * | |
43 | * Re-running the HLT reconstruction | |
44 | * By specifying the hlt options, the HLT chain can be re-run instead | |
45 | * of just extracting the online result. E.g. the following options | |
46 | * specify to ignore the HLTOUT payload and run the two chains defined | |
47 | * in the agents. The translation of the online configuration into | |
48 | * an HLT offline chain is under development. | |
49 | * <pre> | |
50 | * ignore-hltout chains=GLOBAL-esd-converter,TPC-clusters | |
51 | * <pre> | |
52 | * | |
dd347dca | 53 | * Note: You need a valid GRID token, use 'alien-token-init' of your |
54 | * alien installation. | |
94430cc1 | 55 | * |
56 | * @author Matthias.Richter@ift.uib.no | |
57 | * @ingroup alihlt_qa | |
58 | */ | |
59 | void recraw_local(const char *filename, | |
60 | const char *cdbURI, | |
61 | int minEvent=-1, | |
dd347dca | 62 | int maxEvent=-1, |
deb17658 | 63 | const char *modules="ALL", |
64 | const char *hltOptions="loglevel=0x7c") | |
94430cc1 | 65 | { |
6ba88420 | 66 | if(!gSystem->AccessPathName("galice.root")){ |
67 | cerr << "AliReconstruction on raw data requires to delete galice.root, or run at different place." << endl; | |
68 | cerr << "!!! DO NOT DELETE the galice.root of your simulation, but create a subfolder !!!!" << endl; | |
69 | return; | |
70 | } | |
71 | ||
94430cc1 | 72 | // connect to the GRID if we use a file or OCDB from the GRID |
73 | TString struri=cdbURI; | |
74 | TString strfile=filename; | |
75 | if (struri.BeginsWith("raw://") || | |
76 | strfile.Contains("://") && !strfile.Contains("local://")) { | |
77 | TGrid::Connect("alien"); | |
78 | } | |
79 | ||
80 | // Set the CDB storage location | |
81 | AliCDBManager * man = AliCDBManager::Instance(); | |
82 | man->SetDefaultStorage(cdbURI); | |
84d998ff | 83 | if (struri.BeginsWith("local://")) { |
84 | // set specific storage for GRP entry | |
85 | // search in the working directory and one level above, the latter | |
86 | // follows the standard simulation setup like e.g. in test/ppbench | |
87 | if (!gSystem->AccessPathName("GRP/GRP/Data")) { | |
88 | man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD"); | |
89 | } else if (!gSystem->AccessPathName("../GRP/GRP/Data")) { | |
90 | man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/.."); | |
91 | } | |
92 | } | |
94430cc1 | 93 | |
94 | // Reconstruction settings | |
95 | AliReconstruction rec; | |
96 | ||
97 | if (minEvent>=0 || maxEvent>minEvent) { | |
98 | if (minEvent<0) minEvent=0; | |
99 | if (maxEvent<minEvent) maxEvent=minEvent; | |
100 | rec.SetEventRange(minEvent,maxEvent); | |
101 | } | |
102 | ||
8382b388 | 103 | TString strModules=modules; |
dd347dca | 104 | if (modules) |
105 | rec.SetRunReconstruction(modules); | |
106 | else | |
107 | rec.SetRunReconstruction("ALL"); | |
94430cc1 | 108 | |
109 | // QA options | |
8382b388 | 110 | TString qaOptions="HLT TPC"; |
111 | if (!strModules.Contains("TPC")) qaOptions.ReplaceAll("TPC", ""); | |
112 | qaOptions+=":ALL"; | |
113 | rec.SetRunQA(qaOptions) ; | |
dd347dca | 114 | //rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ; |
94430cc1 | 115 | |
116 | // AliReconstruction settings | |
117 | rec.SetWriteESDfriend(kTRUE); | |
8382b388 | 118 | rec.SetRunVertexFinder(strModules.Contains("ITS")); |
12fe5aa8 | 119 | rec.SetRunMultFinder(strModules.Contains("ITS")); |
94430cc1 | 120 | rec.SetInput(filename); |
deb17658 | 121 | rec.SetOption("HLT", hltOptions); |
94430cc1 | 122 | |
123 | rec.SetRunPlaneEff(kFALSE); | |
124 | ||
125 | // switch off cleanESD | |
126 | rec.SetCleanESD(kFALSE); | |
127 | ||
128 | AliLog::Flush(); | |
129 | rec.Run(); | |
130 | ||
131 | } | |
132 | ||
dd347dca | 133 | void recraw_local(const char *filename, |
94430cc1 | 134 | int minEvent=-1, |
dd347dca | 135 | int maxEvent=-1, |
deb17658 | 136 | const char *modules="ALL", |
137 | const char *hltOptions="loglevel=0x7f") | |
dd347dca | 138 | { |
deb17658 | 139 | recraw_local(filename, "raw://", minEvent, maxEvent, modules, hltOptions); |
dd347dca | 140 | } |
141 | ||
142 | void recraw_local() | |
94430cc1 | 143 | { |
dd347dca | 144 | cout << "recraw-local: Run AliRoot reconstruction locally" << endl; |
145 | cout << " Usage: aliroot -b -q -l \\" << endl; | |
deb17658 | 146 | cout << " recraw-local.C'(\"file\", \"cdb\", minEvent, maxEvent, modules, hltOptions)'" << endl; |
dd347dca | 147 | cout << "" << endl; |
148 | cout << " Examples:" << endl; | |
149 | cout << " recraw-local.C'(\"alien:///alice/data/2009/.../....root\")' " << endl; | |
150 | cout << " recraw-local.C'(\"raw://run12345\")'" << endl; | |
151 | cout << " recraw-local.C'(\"raw://run12345\", minEvent, MaxEvent)'" << endl; | |
152 | cout << " recraw-local.C'(\"raw.root\", \"local://$PWD\", minEvent, MaxEvent)'" << endl; | |
153 | cout << "" << endl; | |
154 | cout << " Defaults" << endl; | |
155 | cout << " cdb=\"raw://\" -> take OCDB from GRID" << endl; | |
156 | cout << " minEvent=-1 -> no lower event selection" << endl; | |
157 | cout << " maxEvent=-1 -> no upper event selection" << endl; | |
158 | cout << " modules=\"ALL\" -> all modules" << endl; | |
deb17658 | 159 | cout << " hltOption=\"loglevel=0x7c\" -> logging level info and above" << endl; |
94430cc1 | 160 | } |