3 * @file sampleEsdAnalysis.C
4 * @brief Example macro to run the AliHLTSampleESDAnalysisComponent in
7 * The component subscribes to the output of the default HLT reconstruction
8 * chain and extracts the ESD from the input.
11 * Usage: aliroot -b -q -l \
12 * sampleEsdAnalysis.C'("file", "cdb", minEvent, maxEvent)'
15 * sampleEsdAnalysis.C'("alien:///alice/data/2009/.../....root")'
16 * sampleEsdAnalysis.C'("raw.root", "local://$PWD", minEvent, MaxEvent)'
19 * cdb="raw://" -> take OCDB from GRID
20 * minEvent=-1 -> no lower event selection
21 * maxEvent=-1 -> no upper event selection
25 * The input file can be a file on the grid, indicated by the tag
26 * 'alien://' indicates. By default also the OCDB is set to the GRID.
27 * If either the file or the OCDB is taken from the GRID, the macros
28 * connects to the Grid in the beginning.
30 * As for the OCDB it is always a good idea to use the OCDB from the
31 * Grid as this will contain all the necessary objects and the latest
32 * calibration. The special URI 'raw://' is most advisable as it selects
33 * the storage automatically from the run number. Other options are e.g.
34 * - "alien://folder=/alice/data/2010/OCDB"
35 * - "local://$ALICE_ROOT/OCDB"
37 * Note: You need a valid GRID token, if you want to access files directly
38 * from the Grid, use 'alien-token-init' of your alien installation.
40 * @author Matthias.Richter@ift.uib.no
41 * @ingroup alihlt_tutorial
43 void sampleEsdAnalysis(const char *filename,
48 // connect to the GRID if we use a file or OCDB from the GRID
49 TString struri=cdbURI;
50 TString strfile=filename;
51 if (struri.BeginsWith("raw://") ||
52 strfile.Contains("://") && !strfile.Contains("local://")) {
53 TGrid::Connect("alien");
56 // Set the CDB storage location
57 AliCDBManager * man = AliCDBManager::Instance();
58 man->SetDefaultStorage(cdbURI);
59 if (struri.BeginsWith("local://") && !gSystem->AccessPathName("GRP/GRP/Data")) {
60 // set specific storage for GRP entry
61 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
64 //////////////////////////////////////////////////////////////////////////////////////
66 // Reconstruction settings
67 AliReconstruction rec;
69 if (minEvent>=0 || maxEvent>minEvent) {
70 if (minEvent<0) minEvent=0;
71 if (maxEvent<minEvent) maxEvent=minEvent;
72 rec.SetEventRange(minEvent,maxEvent);
74 rec.SetRunReconstruction("HLT ITS TPC");
75 rec.SetWriteESDfriend(kFALSE);
76 rec.SetInput(filename);
80 //rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
82 //////////////////////////////////////////////////////////////////////////////////////
84 // setup the HLT system
85 AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
87 // define a configuration for the SampleESDAnalysis component
89 // 1) id of the configuartion, later used to refer to this configuration
90 // 2) id of the component to run
91 // 3) parents, here the configuration 'GLOBAL-esd-converter' of the libAliHLTGlobal
92 // 4) optional component arguments
93 AliHLTConfiguration esdanalysis("ESD-Analysis", "SampleESDAnalysis", "GLOBAL-esd-converter", "");
95 // set option for the HLT module in AliReconstruction
97 // - ignore-hltout : ignore the HLTOUT payload from the HLT DDLs
98 // - libraries to be used as plugins
99 // - loglevel=0x79 : Important, Warning, Error, Fatal
100 // - chains=ESD-Analysis : chains to be run
103 "libAliHLTUtil.so libAliHLTGlobal.so libAliHLTSample.so "
105 "chains=ESD-Analysis "
108 rec.SetRunPlaneEff(kFALSE);
110 // switch off cleanESD
111 rec.SetCleanESD(kFALSE);
118 void sampleEsdAnalysis(const char *filename,
122 sampleEsdAnalysis(filename, "raw://", minEvent, maxEvent, modules, hltOptions);
125 void sampleEsdAnalysis()
127 cout << "sampleEsdAnalysis: Run HLT component 'SampleESDAnalyis' in AliReconstruction" << endl;
128 cout << " Usage: aliroot -b -q -l \\" << endl;
129 cout << " sampleEsdAnalysis.C'(\"file\", \"cdb\", minEvent, maxEvent)'" << endl;
131 cout << " Examples:" << endl;
132 cout << " sampleEsdAnalysis.C'(\"alien:///alice/data/2009/.../....root\")' " << endl;
133 cout << " sampleEsdAnalysis.C'(\"raw.root\", \"local://$PWD\", minEvent, MaxEvent)'" << endl;
135 cout << " Defaults" << endl;
136 cout << " cdb=\"raw://\" -> take OCDB from GRID" << endl;
137 cout << " minEvent=-1 -> no lower event selection" << endl;
138 cout << " maxEvent=-1 -> no upper event selection" << endl;