]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/exa/recraw-local.C
- something went wrong with previous commit...
[u/mrichter/AliRoot.git] / HLT / exa / recraw-local.C
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 \
8  *     recraw-local.C'("file", "cdb", minEvent, maxEvent, modules)'
9  *
10  * Examples:
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  *
16  * Defaults
17  *     cdb="raw://"  -> take OCDB from GRID
18  *     minEvent=-1   -> no lower event selection
19  *     maxEvent=-1   -> no upper event selection
20  *     modules="ALL" -> all modules
21  *
22  * </pre>
23  *
24  * The input file can be a file on the grid, indicated by the tag
25  * 'alien://' indicates. By default also the OCDB is set to the GRID.
26  * If either the file or the OCDB is taken from the GRID, the macros
27  * connects to the Grid in the beginning.
28  *
29  * Input files can be specified via te run number when using the tag
30  * 'raw://' followed by the string 'run12345' where the number needs
31  * to be adjusted.
32  * 
33  * Note: You need a valid GRID token, use 'alien-token-init' of your
34  * alien installation.
35  *
36  * @author Matthias.Richter@ift.uib.no
37  * @ingroup alihlt_qa
38  */
39 void recraw_local(const char *filename,
40                   const char *cdbURI,
41                   int minEvent=-1,
42                   int maxEvent=-1,
43                   const char *modules="ALL")
44 {
45   // connect to the GRID if we use a file or OCDB from the GRID
46   TString struri=cdbURI;
47   TString strfile=filename;
48   if (struri.BeginsWith("raw://") ||
49       strfile.Contains("://") && !strfile.Contains("local://")) {
50     TGrid::Connect("alien");
51   }
52
53   // Set the CDB storage location
54   AliCDBManager * man = AliCDBManager::Instance();
55   man->SetDefaultStorage(cdbURI);
56
57   // Reconstruction settings
58   AliReconstruction rec;
59
60   if (minEvent>=0 || maxEvent>minEvent) {
61     if (minEvent<0) minEvent=0;
62     if (maxEvent<minEvent) maxEvent=minEvent;
63     rec.SetEventRange(minEvent,maxEvent);
64   }
65
66   if (modules)
67     rec.SetRunReconstruction(modules);
68   else
69     rec.SetRunReconstruction("ALL");
70
71   // QA options
72   rec.SetRunQA("HLT TPC:ALL") ;
73   //rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
74
75   // AliReconstruction settings
76   rec.SetWriteESDfriend(kTRUE);
77   rec.SetInput(filename);
78   rec.SetOption("HLT","loglevel=0x3f");
79
80   rec.SetRunPlaneEff(kFALSE);
81
82   // switch off cleanESD
83   rec.SetCleanESD(kFALSE);
84
85   AliLog::Flush();
86   rec.Run();
87
88 }
89
90 void recraw_local(const char *filename,
91                   int minEvent=-1,
92                   int maxEvent=-1,
93                   const char *modules="ALL")
94 {
95   recraw_local(filename, "raw://", minEvent, maxEvent, modules);
96 }
97
98 void recraw_local()
99 {
100   cout << "recraw-local: Run AliRoot reconstruction locally" << endl;
101   cout << " Usage: aliroot -b -q -l \\" << endl;
102   cout << "     recraw-local.C'(\"file\", \"cdb\", minEvent, maxEvent, modules)'" << endl;
103   cout << "" << endl;
104   cout << " Examples:" << endl;
105   cout << "     recraw-local.C'(\"alien:///alice/data/2009/.../....root\")' " << endl;
106   cout << "     recraw-local.C'(\"raw://run12345\")'" << endl;
107   cout << "     recraw-local.C'(\"raw://run12345\", minEvent, MaxEvent)'" << endl;
108   cout << "     recraw-local.C'(\"raw.root\", \"local://$PWD\", minEvent, MaxEvent)'" << endl;
109   cout << "" << endl;
110   cout << " Defaults" << endl;
111   cout << "     cdb=\"raw://\"  -> take OCDB from GRID" << endl;
112   cout << "     minEvent=-1   -> no lower event selection" << endl;
113   cout << "     maxEvent=-1   -> no upper event selection" << endl;
114   cout << "     modules=\"ALL\" -> all modules" << endl;
115 }