3 * @file rec-hlt-tpc-offline.C
4 * @brief Test macro for the HLT TPC offline reco wrappers.
6 * The macro runs an HLT chain of TPC analysis, using the offline
7 * algorithms ans appropriate wrappers.
11 * aliroot -b -q rec-hlt-tpc-offline.C | tee rec-hlt-tpc-offline.log
14 * The chain to be run is defined by the macro given to the parameter
17 * The macro asumes raw data to be available in the rawx folders, either
18 * simulated or real data. A different input can be specified as parameter
20 * aliroot -b -q cal-hlt-tpc-offline.C'("input.root")'
23 * In the first section, an analysis chain is defined. The scale of the
24 * chain can be defined by choosing the range of sectors and partitions.
26 * The reconstruction is steered by the AliReconstruction object in the
30 * @author Matthias.Richter@ift.uib.no
32 void rec_hlt_tpc_offline(const char* input="./")
35 cerr << "please specify input or run without arguments" << endl;
38 ///////////////////////////////////////////////////////////////////////////////////////////////////
40 // init the HLT system in order to define the analysis chain below
42 gSystem->Load("libHLTrec.so");
43 AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance();
45 //gHLT.SwitchAliLog(0);
47 ///////////////////////////////////////////////////////////////////////////////////////////////////
49 // define the analysis chain to be run
52 bool sectorClusterer=true; // run clusterer on sector or DDL level
53 // check if the AliRawReaderMemory supports multiple buffers
54 TClass* info=TClass::GetClass("AliRawReaderMemory");
55 TList* methods=info->GetListOfAllPublicMethods();
56 if (sectorClusterer && !methods->FindObject("AddBuffer")) {
57 cerr << "warning: AliRawReaderMemory does not support multiple buffers, falling back to run clusterer on DDL level" << endl;
58 sectorClusterer=false;
66 int DDLNoFromSlicePatch(int, int);
70 for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
71 TString arg, clustererInput;
72 for (int part=iMinPart; part<=iMaxPart; part++) {
73 TString publisher, cf;
75 // raw data publisher components
76 int ddlno=DDLNoFromSlicePatch(slice, part);
77 arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part);
78 publisher.Form("DP_%02d_%d", slice, part);
79 AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
81 if (!sectorClusterer) {
82 // cluster finder components
83 cf.Form("CF_%02d_%d", slice, part);
84 AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", publisher.Data(), "");
86 if (trackerInput.Length()>0) trackerInput+=" ";
88 //if (writerInput.Length()>0) writerInput+=" ";
91 if (clustererInput.Length()>0) clustererInput+=" ";
92 clustererInput+=publisher;
95 if (sectorClusterer) {
96 // cluster finder components
97 cf.Form("CF_%02d", slice);
98 AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", clustererInput.Data(), "");
100 if (trackerInput.Length()>0) trackerInput+=" ";
105 // one global tracker component
107 tracker.Form("Global_TR");
108 AliHLTConfiguration trackerconf(tracker.Data(), "TPCOfflineTracker", trackerInput.Data(), "");
109 if (writerInput.Length()>0) writerInput+=" ";
110 writerInput+=tracker;
112 // the writer configuration
113 AliHLTConfiguration esdwconf("sink1", "EsdCollector" , writerInput.Data(), "-directory hlt-tpc-offline");
115 ///////////////////////////////////////////////////////////////////////////////////////////////////
117 // Init and run the reconstruction
118 // All but HLT reconstructio is switched off
120 AliReconstruction rec;
122 rec.SetRunVertexFinder(kFALSE);
123 rec.SetRunLocalReconstruction("HLT");
124 rec.SetRunTracking("");
125 rec.SetLoadAlignFromCDB(0);
128 rec.SetRunGlobalQA(kFALSE);
129 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
130 AliTracker::SetFieldMap(field,kFALSE);
131 rec.SetFillTriggerESD(kFALSE);
132 rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=sink1");
136 int DDLNoFromSlicePatch(int slice, int part)
139 if (part>1) ddlno+=72+4*slice+(part-2);
140 else ddlno+=2*slice+part;