]>
Commit | Line | Data |
---|---|---|
5aebebf7 | 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 | gSystem->Load("libHLTrec"); | |
51 | AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); | |
52 | if (!pHLT) { | |
53 | cerr << "fatal error: can not get HLT instance" << endl; | |
54 | } | |
55 | ||
56 | ///////////////////////////////////////////////////////////////////////// | |
57 | ///////////////////////////////////////////////////////////////////////// | |
58 | // | |
59 | // the configuration chain | |
60 | TString writerInput; | |
61 | TString arg; | |
62 | ||
63 | arg.Form("-minid %d -maxid %d -skipempty", iMinDDLno, iMaxDDLno); | |
64 | AliHLTConfiguration pubconf("publisher", "AliRawReaderPublisher", NULL , arg.Data()); | |
65 | if (!writerInput.IsNull()) writerInput+=" "; | |
66 | writerInput+="publisher"; | |
67 | ||
68 | // the writer configuration | |
69 | arg.Form("-specfmt=_%%d -subdir=raw%%d -blocknofmt= -idfmt= -datafile %s", baseName); | |
70 | AliHLTConfiguration fwconf("sink1", "FileWriter" , writerInput.Data(), arg.Data()); | |
71 | ||
72 | ||
73 | ///////////////////////////////////////////////////////////////////////// | |
74 | ///////////////////////////////////////////////////////////////////////// | |
75 | // | |
76 | // the reconstruction loop | |
77 | rec.SetRunLocalReconstruction("HLT"); | |
78 | rec.SetRunReconstruction("HLT"); | |
79 | rec.SetRunTracking(""); | |
80 | rec.SetFillESD("HLT"); | |
81 | rec.SetRunVertexFinder(kFALSE); | |
82 | rec.SetLoadAlignFromCDB(0); | |
83 | rec.Run(); | |
84 | } | |
85 | ||
86 | void publish_rawreader_data() | |
87 | { | |
88 | cout << "runnig from defaults: input " << defaultInput << " " << defaultMinId << "-" << defaultMaxId << endl; | |
89 | publish_rawreader_data(defaultInput, defaultMinId, defaultMaxId); | |
90 | } |