]>
Commit | Line | Data |
---|---|---|
aa40a4a1 | 1 | // $Id$ |
2 | /** | |
3 | * @file rec-hlt-tpc-offline.C | |
4 | * @brief Test macro for the HLT TPC offline reco wrappers. | |
5 | * | |
6 | * The macro runs an HLT chain of TPC analysis, using the offline | |
7 | * algorithms ans appropriate wrappers. | |
8 | * | |
9 | * Usage: | |
10 | * <pre> | |
11 | * aliroot -b -q rec-hlt-tpc-offline.C | tee rec-hlt-tpc-offline.log | |
12 | * </pre> | |
13 | * | |
14 | * The chain to be run is defined by the macro given to the parameter | |
15 | * 'config=' | |
16 | * | |
e642ae99 | 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 | |
19 | * <pre> | |
20 | * aliroot -b -q cal-hlt-tpc-offline.C'("input.root")' | |
21 | * </pre> | |
aa40a4a1 | 22 | * |
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. | |
25 | * | |
26 | * The reconstruction is steered by the AliReconstruction object in the | |
27 | * usual way. | |
28 | * | |
e642ae99 | 29 | * @ingroup alihlt_tpc |
30 | * @author Matthias.Richter@ift.uib.no | |
aa40a4a1 | 31 | */ |
e642ae99 | 32 | void rec_hlt_tpc_offline(const char* input="./") |
aa40a4a1 | 33 | { |
e642ae99 | 34 | if (!input) { |
35 | cerr << "please specify input or run without arguments" << endl; | |
36 | return; | |
37 | } | |
aa40a4a1 | 38 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
39 | // | |
40 | // init the HLT system in order to define the analysis chain below | |
41 | // | |
7bf6c76d | 42 | AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); |
aa40a4a1 | 43 | |
44 | //gHLT.SwitchAliLog(0); | |
45 | ||
46 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
47 | // | |
48 | // define the analysis chain to be run | |
49 | // | |
c03e064d | 50 | |
51 | bool sectorClusterer=true; // run clusterer on sector or DDL level | |
52 | // check if the AliRawReaderMemory supports multiple buffers | |
53 | TClass* info=TClass::GetClass("AliRawReaderMemory"); | |
54 | TList* methods=info->GetListOfAllPublicMethods(); | |
55 | if (sectorClusterer && !methods->FindObject("AddBuffer")) { | |
56 | cerr << "warning: AliRawReaderMemory does not support multiple buffers, falling back to run clusterer on DDL level" << endl; | |
57 | sectorClusterer=false; | |
58 | } | |
59 | ||
aa40a4a1 | 60 | int iMinSlice=0; |
dcb8a00c | 61 | int iMaxSlice=35; |
aa40a4a1 | 62 | int iMinPart=0; |
63 | int iMaxPart=5; | |
64 | ||
488581c1 | 65 | int DDLNoFromSlicePatch(int, int); |
66 | ||
aa40a4a1 | 67 | TString writerInput; |
68 | TString trackerInput; | |
69 | for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { | |
c03e064d | 70 | TString arg, clustererInput; |
aa40a4a1 | 71 | for (int part=iMinPart; part<=iMaxPart; part++) { |
c03e064d | 72 | TString publisher, cf; |
aa40a4a1 | 73 | |
74 | // raw data publisher components | |
488581c1 | 75 | int ddlno=DDLNoFromSlicePatch(slice, part); |
aa40a4a1 | 76 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part); |
77 | publisher.Form("DP_%02d_%d", slice, part); | |
78 | AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
79 | ||
c03e064d | 80 | if (!sectorClusterer) { |
aa40a4a1 | 81 | // cluster finder components |
82 | cf.Form("CF_%02d_%d", slice, part); | |
83 | AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", publisher.Data(), ""); | |
84 | ||
85 | if (trackerInput.Length()>0) trackerInput+=" "; | |
86 | trackerInput+=cf; | |
87 | //if (writerInput.Length()>0) writerInput+=" "; | |
88 | //writerInput+=cf; | |
c03e064d | 89 | } else { |
90 | if (clustererInput.Length()>0) clustererInput+=" "; | |
91 | clustererInput+=publisher; | |
92 | } | |
93 | } | |
94 | if (sectorClusterer) { | |
95 | // cluster finder components | |
96 | cf.Form("CF_%02d", slice); | |
97 | AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", clustererInput.Data(), ""); | |
98 | ||
99 | if (trackerInput.Length()>0) trackerInput+=" "; | |
100 | trackerInput+=cf; | |
aa40a4a1 | 101 | } |
102 | } | |
103 | ||
104 | // one global tracker component | |
105 | TString tracker; | |
106 | tracker.Form("Global_TR"); | |
107 | AliHLTConfiguration trackerconf(tracker.Data(), "TPCOfflineTracker", trackerInput.Data(), ""); | |
108 | if (writerInput.Length()>0) writerInput+=" "; | |
109 | writerInput+=tracker; | |
110 | ||
111 | // the writer configuration | |
488581c1 | 112 | AliHLTConfiguration esdwconf("sink1", "EsdCollector" , writerInput.Data(), "-directory hlt-tpc-offline"); |
aa40a4a1 | 113 | |
114 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
115 | // | |
116 | // Init and run the reconstruction | |
117 | // All but HLT reconstructio is switched off | |
118 | // | |
119 | AliReconstruction rec; | |
e642ae99 | 120 | rec.SetInput(input); |
aa40a4a1 | 121 | rec.SetRunVertexFinder(kFALSE); |
488581c1 | 122 | rec.SetRunLocalReconstruction("HLT"); |
aa40a4a1 | 123 | rec.SetRunTracking(""); |
124 | rec.SetLoadAlignFromCDB(0); | |
488581c1 | 125 | rec.SetFillESD(""); |
1b56c057 | 126 | rec.SetRunQA(":"); |
127 | rec.SetRunGlobalQA(kFALSE); | |
aa40a4a1 | 128 | rec.SetFillTriggerESD(kFALSE); |
129 | rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=sink1"); | |
130 | rec.Run(); | |
131 | } | |
488581c1 | 132 | |
133 | int DDLNoFromSlicePatch(int slice, int part) | |
134 | { | |
135 | int ddlno=768; | |
136 | if (part>1) ddlno+=72+4*slice+(part-2); | |
137 | else ddlno+=2*slice+part; | |
138 | ||
139 | return ddlno; | |
140 | } |