]>
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 | // | |
42 | gSystem->Load("libHLTrec.so"); | |
43 | AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); | |
44 | ||
45 | //gHLT.SwitchAliLog(0); | |
46 | ||
47 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
48 | // | |
49 | // define the analysis chain to be run | |
50 | // | |
c03e064d | 51 | |
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; | |
59 | } | |
60 | ||
aa40a4a1 | 61 | int iMinSlice=0; |
dcb8a00c | 62 | int iMaxSlice=35; |
aa40a4a1 | 63 | int iMinPart=0; |
64 | int iMaxPart=5; | |
65 | ||
488581c1 | 66 | int DDLNoFromSlicePatch(int, int); |
67 | ||
aa40a4a1 | 68 | TString writerInput; |
69 | TString trackerInput; | |
70 | for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { | |
c03e064d | 71 | TString arg, clustererInput; |
aa40a4a1 | 72 | for (int part=iMinPart; part<=iMaxPart; part++) { |
c03e064d | 73 | TString publisher, cf; |
aa40a4a1 | 74 | |
75 | // raw data publisher components | |
488581c1 | 76 | int ddlno=DDLNoFromSlicePatch(slice, part); |
aa40a4a1 | 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()); | |
80 | ||
c03e064d | 81 | if (!sectorClusterer) { |
aa40a4a1 | 82 | // cluster finder components |
83 | cf.Form("CF_%02d_%d", slice, part); | |
84 | AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", publisher.Data(), ""); | |
85 | ||
86 | if (trackerInput.Length()>0) trackerInput+=" "; | |
87 | trackerInput+=cf; | |
88 | //if (writerInput.Length()>0) writerInput+=" "; | |
89 | //writerInput+=cf; | |
c03e064d | 90 | } else { |
91 | if (clustererInput.Length()>0) clustererInput+=" "; | |
92 | clustererInput+=publisher; | |
93 | } | |
94 | } | |
95 | if (sectorClusterer) { | |
96 | // cluster finder components | |
97 | cf.Form("CF_%02d", slice); | |
98 | AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", clustererInput.Data(), ""); | |
99 | ||
100 | if (trackerInput.Length()>0) trackerInput+=" "; | |
101 | trackerInput+=cf; | |
aa40a4a1 | 102 | } |
103 | } | |
104 | ||
105 | // one global tracker component | |
106 | TString tracker; | |
107 | tracker.Form("Global_TR"); | |
108 | AliHLTConfiguration trackerconf(tracker.Data(), "TPCOfflineTracker", trackerInput.Data(), ""); | |
109 | if (writerInput.Length()>0) writerInput+=" "; | |
110 | writerInput+=tracker; | |
111 | ||
112 | // the writer configuration | |
488581c1 | 113 | AliHLTConfiguration esdwconf("sink1", "EsdCollector" , writerInput.Data(), "-directory hlt-tpc-offline"); |
aa40a4a1 | 114 | |
115 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
116 | // | |
117 | // Init and run the reconstruction | |
118 | // All but HLT reconstructio is switched off | |
119 | // | |
120 | AliReconstruction rec; | |
e642ae99 | 121 | rec.SetInput(input); |
aa40a4a1 | 122 | rec.SetRunVertexFinder(kFALSE); |
488581c1 | 123 | rec.SetRunLocalReconstruction("HLT"); |
aa40a4a1 | 124 | rec.SetRunTracking(""); |
125 | rec.SetLoadAlignFromCDB(0); | |
488581c1 | 126 | rec.SetFillESD(""); |
1b56c057 | 127 | rec.SetRunQA(":"); |
128 | rec.SetRunGlobalQA(kFALSE); | |
aa40a4a1 | 129 | rec.SetFillTriggerESD(kFALSE); |
130 | rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=sink1"); | |
131 | rec.Run(); | |
132 | } | |
488581c1 | 133 | |
134 | int DDLNoFromSlicePatch(int slice, int part) | |
135 | { | |
136 | int ddlno=768; | |
137 | if (part>1) ddlno+=72+4*slice+(part-2); | |
138 | else ddlno+=2*slice+part; | |
139 | ||
140 | return ddlno; | |
141 | } |