2 void sampleRawAnalysis();
4 * @file sampleRawAnalysis.C
5 * @brief Example macro to run the AliHLTSampleRawAnalysisComponent in
8 * The component subscribes to DDL raw data published by the
9 * AliHLTRawReaderPublisherComponent. The macros requires a raw data file
10 * and a corresponding GRP entry.
13 * Usage: aliroot -b -q -l \
14 * sampleRawAnalysis.C'("rawfile", "cdb", minEvent, maxEvent)'
17 * sampleRawAnalysis.C'("raw.root", minEvent, MaxEvent)'
18 * sampleRawAnalysis.C'("./", minEvent, MaxEvent)'
19 * sampleRawAnalysis.C'("alien:///alice/data/2010/.../raw/....root")'
22 * cdb="local://$ALICE_ROOT/OCDB" -> take local OCDB from distribution
23 * minEvent=-1 -> no lower event selection
24 * maxEvent=-1 -> no upper event selection
28 * The input file can be a local raw.root file but also a file from the
29 * GRID. The separate DDL files generated in simulation can be accessed
30 * using AliRawReaderFile by speficying "directory/".
32 * Since the macro runs AliReconstruction the OCDB needs to be set up, in
33 * particular the GRP entry. If testing with a local OCDB you have to
34 * simulate some events and run the macro in the folder of the simulation.
35 * Also HLT components configure from objects in the 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 sampleRawAnalysis(const char *filename,
48 if(!gSystem->AccessPathName("galice.root")){
49 cerr << "AliReconstruction on raw data requires to delete galice.root, or run at different place." << endl;
50 cerr << "!!! DO NOT DELETE the galice.root of your simulation, but create a subfolder !!!!" << endl;
54 if (gSystem->AccessPathName(filename)) {
55 cerr << "can not find file " << filename << endl;
59 // connect to the GRID if we use a file or OCDB from the GRID
60 TString struri=cdbURI;
61 TString strfile=filename;
62 if (struri.BeginsWith("raw://") ||
63 strfile.Contains("://") && !strfile.Contains("local://")) {
64 TGrid::Connect("alien");
67 // Set the CDB storage location
68 AliCDBManager * man = AliCDBManager::Instance();
69 man->SetDefaultStorage(cdbURI);
70 if (struri.BeginsWith("local://")) {
71 // set specific storage for GRP entry
72 // search in the working directory and one level above, the latter
73 // follows the standard simulation setup like e.g. in test/ppbench
74 if (!gSystem->AccessPathName("GRP/GRP/Data")) {
75 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
76 } else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
77 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
79 cerr << "can not find a GRP entry, please run the macro in the folder" << endl;
80 cerr << "of a simulated data sample, or specify a GRID OCDB" << endl;
86 //////////////////////////////////////////////////////////////////////////////////////
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);
96 rec.SetRunReconstruction("HLT");
97 rec.SetLoadAlignFromCDB(kFALSE);
98 rec.SetWriteESDfriend(kFALSE);
100 // StopOnError needs to be disabled
101 rec.SetStopOnError(kFALSE);
102 rec.SetRunVertexFinder(kFALSE);
103 rec.SetInput(filename);
107 //rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
109 //////////////////////////////////////////////////////////////////////////////////////
111 // setup the HLT system
112 AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
114 // define a data publisher configuration
116 // 1) id of the configuartion, later used to refer to this configuration
117 // 2) id of the component to run
118 // 3) parents, no parents for publisher components
119 // 4) optional component arguments
120 // publish link #512, the first link (numbered 0) of SSD
121 AliHLTConfiguration publisher("RAW-Publisher",
122 "AliRawReaderPublisher",
125 "-datatype 'DDL_RAW ' 'ISSD' "
129 // define configuration of the SampleRawAnalyis component
131 // 1) id of the configuartion, later used to refer to this configuration
132 // 2) id of the component to run
133 // 3) parents, here the publisher configuration defined above
134 // 4) optional component arguments
135 AliHLTConfiguration rawanalysis("RAW-Analysis",
142 // set option for the HLT module in AliReconstruction
144 // - ignore-hltout : ignore the HLTOUT payload from the HLT DDLs
145 // - libraries to be used as plugins
146 // - loglevel=0x7c : Important, Info, Warning, Error, Fatal
147 // - chains=RAW-Analysis : chains to be run
150 "libAliHLTUtil.so libAliHLTSample.so "
152 "chains=RAW-Analysis "
155 rec.SetRunPlaneEff(kFALSE);
157 // switch off cleanESD
158 rec.SetCleanESD(kFALSE);
165 void sampleRawAnalysis(const char *filename,
169 sampleRawAnalysis(filename, "local://$ALICE_ROOT/OCDB", minEvent, maxEvent);
172 void sampleRawAnalysis()
174 cout << "sampleRawAnalysis: Run HLT component 'SampleRawAnalyis' in AliReconstruction" << endl;
175 cout << " Usage: aliroot -b -q -l \\" << endl;
176 cout << " sampleRawAnalysis.C'(\"file\", \"cdb\", minEvent, maxEvent)'" << endl;
178 cout << " Examples:" << endl;
179 cout << " sampleRawAnalysis.C'(\"raw.root\", minEvent, MaxEvent)'" << endl;
180 cout << " sampleRawAnalysis.C'(\"./\", minEvent, MaxEvent)'" << endl;
181 cout << " sampleRawAnalysis.C'(\"alien:///alice/data/2010/.../raw/....root\")' " << endl;
183 cout << " Defaults" << endl;
184 cout << " cdb=\"local://$ALICE_ROOT/OCDB\" -> take local OCDB" << endl;
185 cout << " minEvent=-1 -> no lower event selection" << endl;
186 cout << " maxEvent=-1 -> no upper event selection" << endl;