4 * @brief Run reconstruction of raw data locally
7 * Usage: aliroot -b -q -l \
8 * recraw-local.C'("file", "cdb", minEvent, maxEvent, modules)'
11 * recraw-local.C'("alien:///alice/data/2009/.../....root")'
12 * recraw-local.C'("raw://run12345")'
13 * recraw-local.C'("raw://run12345", minEvent, MaxEvent)'
14 * recraw-local.C'("raw.root", "local://$PWD", minEvent, MaxEvent)'
15 * recraw-local.C'("10000135031045.10..root", "raw://", -1, -1)'
16 * recraw-local.C'("alien:///alice/data/2010/LHC10f/000135031/raw/10000135031045.10.root", "raw://", -1, -1)'
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
23 * hltOption="loglevel=0x7c" -> logging level info and above
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.
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
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"
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.
50 * ignore-hltout chains=GLOBAL-esd-converter,TPC-clusters
53 * Note: You need a valid GRID token, use 'alien-token-init' of your
56 * @author Matthias.Richter@ift.uib.no
59 void recraw_local(const char *filename,
63 const char *modules="ALL",
64 const char *hltOptions="loglevel=0x7c")
66 // connect to the GRID if we use a file or OCDB from the GRID
67 TString struri=cdbURI;
68 TString strfile=filename;
69 if (struri.BeginsWith("raw://") ||
70 strfile.Contains("://") && !strfile.Contains("local://")) {
71 TGrid::Connect("alien");
74 // Set the CDB storage location
75 AliCDBManager * man = AliCDBManager::Instance();
76 man->SetDefaultStorage(cdbURI);
77 if (struri.BeginsWith("local://")) {
78 // set specific storage for GRP entry
79 // search in the working directory and one level above, the latter
80 // follows the standard simulation setup like e.g. in test/ppbench
81 if (!gSystem->AccessPathName("GRP/GRP/Data")) {
82 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
83 } else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
84 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
88 // Reconstruction settings
89 AliReconstruction rec;
91 if (minEvent>=0 || maxEvent>minEvent) {
92 if (minEvent<0) minEvent=0;
93 if (maxEvent<minEvent) maxEvent=minEvent;
94 rec.SetEventRange(minEvent,maxEvent);
97 TString strModules=modules;
99 rec.SetRunReconstruction(modules);
101 rec.SetRunReconstruction("ALL");
104 TString qaOptions="HLT TPC";
105 if (!strModules.Contains("TPC")) qaOptions.ReplaceAll("TPC", "");
107 rec.SetRunQA(qaOptions) ;
108 //rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
110 // AliReconstruction settings
111 rec.SetWriteESDfriend(kTRUE);
112 rec.SetRunVertexFinder(strModules.Contains("ITS"));
113 rec.SetRunMultFinder(strModules.Contains("ITS"));
114 rec.SetInput(filename);
115 rec.SetOption("HLT", hltOptions);
117 rec.SetRunPlaneEff(kFALSE);
119 // switch off cleanESD
120 rec.SetCleanESD(kFALSE);
127 void recraw_local(const char *filename,
130 const char *modules="ALL",
131 const char *hltOptions="loglevel=0x7f")
133 recraw_local(filename, "raw://", minEvent, maxEvent, modules, hltOptions);
138 cout << "recraw-local: Run AliRoot reconstruction locally" << endl;
139 cout << " Usage: aliroot -b -q -l \\" << endl;
140 cout << " recraw-local.C'(\"file\", \"cdb\", minEvent, maxEvent, modules, hltOptions)'" << endl;
142 cout << " Examples:" << endl;
143 cout << " recraw-local.C'(\"alien:///alice/data/2009/.../....root\")' " << endl;
144 cout << " recraw-local.C'(\"raw://run12345\")'" << endl;
145 cout << " recraw-local.C'(\"raw://run12345\", minEvent, MaxEvent)'" << endl;
146 cout << " recraw-local.C'(\"raw.root\", \"local://$PWD\", minEvent, MaxEvent)'" << endl;
148 cout << " Defaults" << endl;
149 cout << " cdb=\"raw://\" -> take OCDB from GRID" << endl;
150 cout << " minEvent=-1 -> no lower event selection" << endl;
151 cout << " maxEvent=-1 -> no upper event selection" << endl;
152 cout << " modules=\"ALL\" -> all modules" << endl;
153 cout << " hltOption=\"loglevel=0x7c\" -> logging level info and above" << endl;