]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/exa/publish-rawreader-data.C
CMake: removing qpythia from the depedencies
[u/mrichter/AliRoot.git] / HLT / exa / publish-rawreader-data.C
1 // $Id$
2 /**
3  * @file publish-rawreader-data.C
4  * @brief Publish data from the the RawReader provided by the AliReconstruction.
5  *
6  * Usage:
7  * <pre>
8  *   aliroot -b -q 'publish-rawreader-data.C("raw.root", 768, 769)' | tee publish-rawreader-data.log
9  * </pre>
10  *
11  * This macro runs shows a use case of the AliHLTRawReaderPublisherComponent
12  * An HLT chain is run inside the AliReconstruction and the DDL payload is
13  * extracted from the AliRawReader in a given  equipment range.
14  * Input can be either a root file or the path to the directory containing
15  * the 'rawx' sub folders.
16  *
17  * @author Matthias.Richter@ift.uib.no
18  */
19
20 const char* defaultInput="./";
21 const int defaultMinId=768;
22 const int defaultMaxId=769;
23
24 void publish_rawreader_data(const char* input, int iMinDDLno, int iMaxDDLno)
25 {
26   /////////////////////////////////////////////////////////////////////////
27   /////////////////////////////////////////////////////////////////////////
28   //
29   // some defaults
30   const char* baseName="RAW.ddl";
31
32   /////////////////////////////////////////////////////////////////////////
33   /////////////////////////////////////////////////////////////////////////
34   //
35   // setup of the reconstruction
36   if (!input) {
37     cerr << "invalid path" << endl;
38     cerr << "usage: aliroot -b -q 'publish-rawreader-data.C(\"raw.root\", 768, 769)'" << endl;
39     return;
40   }
41
42   AliReconstruction rec;
43   rec.SetInput(input);
44   rec.SetOption("HLT", "libAliHLTUtil.so loglevel=0x7c chains=sink1");
45
46   /////////////////////////////////////////////////////////////////////////
47   /////////////////////////////////////////////////////////////////////////
48   //
49   // setup of the HLT system
50   AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
51   if (!pHLT) {
52     cerr << "fatal error: can not get HLT instance" << endl;
53   }
54
55   /////////////////////////////////////////////////////////////////////////
56   /////////////////////////////////////////////////////////////////////////
57   //
58   // the configuration chain
59   TString writerInput;
60   TString arg;
61
62   arg.Form("-minid %d -maxid %d -skipempty -verbose", iMinDDLno, iMaxDDLno);
63   AliHLTConfiguration pubconf("publisher", "AliRawReaderPublisher", NULL , arg.Data());
64   if (!writerInput.IsNull()) writerInput+=" ";
65   writerInput+="publisher";
66
67   // the writer configuration
68   arg.Form("-specfmt=_%%d -subdir=out%%d -blocknofmt= -idfmt= -datafile %s", baseName);
69   AliHLTConfiguration fwconf("sink1", "FileWriter"   , writerInput.Data(), arg.Data());
70
71
72   /////////////////////////////////////////////////////////////////////////
73   /////////////////////////////////////////////////////////////////////////
74   //
75   // the reconstruction loop
76   rec.SetRunLocalReconstruction("HLT");
77   rec.SetRunReconstruction("HLT");
78   rec.SetRunTracking("");
79   rec.SetFillESD("HLT");
80   rec.SetFillTriggerESD(kFALSE);
81   rec.SetRunQA(":");
82   rec.SetRunVertexFinder(kFALSE);
83   rec.SetLoadAlignFromCDB(0);
84   rec.SetFillTriggerESD(kFALSE);
85   rec.Run();
86 }
87
88 void publish_rawreader_data()
89 {
90   cout << "runnig from defaults: input " << defaultInput << "  " << defaultMinId << "-" << defaultMaxId << endl;
91   publish_rawreader_data(defaultInput, defaultMinId, defaultMaxId);
92 }