3 * @file sampleCalibrationProcessor.C
4 * @brief Run the SampleCalibration component (AliHLTSampleCalibrationComponent)
7 * Usage: aliroot -b -q -l \
8 * sampleCalibrationProcessor.C'("file", "cdb", minEvent, maxEvent)'
11 * sampleCalibrationProcessor.C'("alien:///alice/data/2009/.../....root")'
12 * sampleCalibrationProcessor.C'("raw.root", "local://$PWD", minEvent, MaxEvent)'
15 * cdb="local://$ALICE_ROOT/OCDB" -> take local OCDB
16 * minEvent=-1 -> no lower event selection
17 * maxEvent=-1 -> no upper event selection
21 * An HLT chain is set up with one publisher for raw data which the calibration
22 * component subscribes to. The output of the component is directed to a
23 * ROOTFileWriter producing the file 'calibdata.root'. Another FileWriter
24 * writes the data block designated for storage in the FXS.
25 * The HLT chain is run in the context of AliReconstruction.
27 * The input file can be a file on the grid, indicated by the tag
29 * If either the file or the OCDB is taken from the GRID, the macros
30 * connects to the Grid in the beginning.
31 * Note: You need a valid GRID token, use 'alien-token-init' of your
34 * This example uses the local OCDB as default, but other locations can
35 * be specified, like e.g. "raw://".
37 * @author Matthias.Richter@ift.uib.no
38 * @ingroup alihlt_tutorial
40 void sampleCalibrationProcessor(const char *filename,
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");
53 // Set the CDB storage location
54 AliCDBManager * man = AliCDBManager::Instance();
55 man->SetDefaultStorage(cdbURI);
56 if (struri.BeginsWith("local://")) {
57 // set specific storage for GRP entry
58 // search in the working directory and one level above, the latter
59 // follows the standard simulation setup like e.g. in test/ppbench
60 if (!gSystem->AccessPathName("GRP/GRP/Data")) {
61 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
62 } else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
63 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
65 cerr << "can not find a GRP entry, please run the macro in the folder" << endl;
66 cerr << "of a simulated data sample, or specify a GRID OCDB" << endl;
72 // Reconstruction settings
73 AliReconstruction rec;
75 if (minEvent>=0 || maxEvent>minEvent) {
76 if (minEvent<0) minEvent=0;
77 if (maxEvent<minEvent) maxEvent=minEvent;
78 rec.SetEventRange(minEvent,maxEvent);
81 rec.SetRunReconstruction("HLT");
86 // AliReconstruction settings
87 rec.SetWriteESDfriend(kFALSE);
88 rec.SetInput(filename);
90 rec.SetRunPlaneEff(kFALSE);
91 rec.SetRunVertexFinder(kFALSE);
92 rec.SetRunMultFinder(kFALSE);
94 // switch off cleanESD
95 rec.SetCleanESD(kFALSE);
97 // setup the HLT chain
98 AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
100 // publisher for raw data
101 AliHLTConfiguration rawpub("rawpub", "AliRawReaderPublisher", "", "-minid 768 -maxid 983 -datatype 'DDL_RAW ' SMPL");
103 // the configuration of the calibration component
104 // send the produced object not more than once every 2 sec
105 AliHLTConfiguration smplcalib("smplcalib", "SampleCalibration", "rawpub", "-pushback-period=2");
107 // writer for data objects produced by the calibration component during
108 // ProcessCalibration,
109 AliHLTConfiguration eventwriter("eventwriter", "ROOTFileWriter", "smplcalib", "-datafile calibdata.root -concatenate-events -overwrite -write-all-events");
111 // filter the output of the smplcalib component and forward only the blocks
112 // of type 'FXS_CAL ' designated for storage by the FXSSubscriber
113 AliHLTConfiguration fxsfilter("fxsfilter", "BlockFilter", "smplcalib", "-typeid 'FXS_CAL ' ");
114 // write the block, a file like 'EOR_*HLT:FXS_CAL' will be written containing the
115 // binary data block of the FXS header and the streamed object
116 AliHLTConfiguration fxswriter("fxswriter", "FileWriter", "fxsfilter", "-write-all-events");
118 rec.SetOption("HLT", "loglevel=0x7c ignore-hltout libAliHLTUtil.so libAliHLTSample.so chains=fxswriter,eventwriter");
125 void sampleCalibrationProcessor(const char *filename,
129 sampleCalibrationProcessor(filename, "local://$ALICE_ROOT/OCDB", minEvent, maxEvent);
132 void sampleCalibrationProcessor()
134 cout << "sampleCalibrationProcessor: Run AliRoot reconstruction locally" << endl;
135 cout << " Usage: aliroot -b -q -l \\" << endl;
136 cout << " sampleCalibrationProcessor.C'(\"file\", \"cdb\", minEvent, maxEvent)'" << endl;
138 cout << " Examples:" << endl;
139 cout << " sampleCalibrationProcessor.C'(\"alien:///alice/data/2009/.../....root\")' " << endl;
140 cout << " sampleCalibrationProcessor.C'(\"raw.root\", \"local://$PWD\", minEvent, MaxEvent)'" << endl;
142 cout << " Defaults" << endl;
143 cout << " cdb=\"local://$ALICE_ROOT/OCDB\" -> take local OCDB " << endl;
144 cout << " minEvent=-1 -> no lower event selection" << endl;
145 cout << " maxEvent=-1 -> no upper event selection" << endl;