]>
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 | * | |
17 | * The makro asumes that raw data is available in the rawx folders, either | |
18 | * simulated or real data. | |
19 | * | |
20 | * In the first section, an analysis chain is defined. The scale of the | |
21 | * chain can be defined by choosing the range of sectors and partitions. | |
22 | * | |
23 | * The reconstruction is steered by the AliReconstruction object in the | |
24 | * usual way. | |
25 | * | |
26 | * Matthias.Richter@ift.uib.no | |
27 | */ | |
28 | void rec_hlt_tpc_offline() | |
29 | { | |
30 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
31 | // | |
32 | // init the HLT system in order to define the analysis chain below | |
33 | // | |
34 | gSystem->Load("libHLTrec.so"); | |
35 | AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); | |
36 | ||
37 | //gHLT.SwitchAliLog(0); | |
38 | ||
39 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
40 | // | |
41 | // define the analysis chain to be run | |
42 | // | |
c03e064d | 43 | |
44 | bool sectorClusterer=true; // run clusterer on sector or DDL level | |
45 | // check if the AliRawReaderMemory supports multiple buffers | |
46 | TClass* info=TClass::GetClass("AliRawReaderMemory"); | |
47 | TList* methods=info->GetListOfAllPublicMethods(); | |
48 | if (sectorClusterer && !methods->FindObject("AddBuffer")) { | |
49 | cerr << "warning: AliRawReaderMemory does not support multiple buffers, falling back to run clusterer on DDL level" << endl; | |
50 | sectorClusterer=false; | |
51 | } | |
52 | ||
aa40a4a1 | 53 | int iMinSlice=0; |
c03e064d | 54 | int iMaxSlice=17; |
aa40a4a1 | 55 | int iMinPart=0; |
56 | int iMaxPart=5; | |
57 | ||
488581c1 | 58 | int DDLNoFromSlicePatch(int, int); |
59 | ||
aa40a4a1 | 60 | TString writerInput; |
61 | TString trackerInput; | |
62 | for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { | |
c03e064d | 63 | TString arg, clustererInput; |
aa40a4a1 | 64 | for (int part=iMinPart; part<=iMaxPart; part++) { |
c03e064d | 65 | TString publisher, cf; |
aa40a4a1 | 66 | |
67 | // raw data publisher components | |
488581c1 | 68 | int ddlno=DDLNoFromSlicePatch(slice, part); |
aa40a4a1 | 69 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part); |
70 | publisher.Form("DP_%02d_%d", slice, part); | |
71 | AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
72 | ||
c03e064d | 73 | if (!sectorClusterer) { |
aa40a4a1 | 74 | // cluster finder components |
75 | cf.Form("CF_%02d_%d", slice, part); | |
76 | AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", publisher.Data(), ""); | |
77 | ||
78 | if (trackerInput.Length()>0) trackerInput+=" "; | |
79 | trackerInput+=cf; | |
80 | //if (writerInput.Length()>0) writerInput+=" "; | |
81 | //writerInput+=cf; | |
c03e064d | 82 | } else { |
83 | if (clustererInput.Length()>0) clustererInput+=" "; | |
84 | clustererInput+=publisher; | |
85 | } | |
86 | } | |
87 | if (sectorClusterer) { | |
88 | // cluster finder components | |
89 | cf.Form("CF_%02d", slice); | |
90 | AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", clustererInput.Data(), ""); | |
91 | ||
92 | if (trackerInput.Length()>0) trackerInput+=" "; | |
93 | trackerInput+=cf; | |
aa40a4a1 | 94 | } |
95 | } | |
96 | ||
97 | // one global tracker component | |
98 | TString tracker; | |
99 | tracker.Form("Global_TR"); | |
100 | AliHLTConfiguration trackerconf(tracker.Data(), "TPCOfflineTracker", trackerInput.Data(), ""); | |
101 | if (writerInput.Length()>0) writerInput+=" "; | |
102 | writerInput+=tracker; | |
103 | ||
104 | // the writer configuration | |
488581c1 | 105 | AliHLTConfiguration esdwconf("sink1", "EsdCollector" , writerInput.Data(), "-directory hlt-tpc-offline"); |
aa40a4a1 | 106 | |
107 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
108 | // | |
109 | // Init and run the reconstruction | |
110 | // All but HLT reconstructio is switched off | |
111 | // | |
112 | AliReconstruction rec; | |
113 | rec.SetInput("./"); | |
114 | rec.SetRunVertexFinder(kFALSE); | |
488581c1 | 115 | rec.SetRunLocalReconstruction("HLT"); |
aa40a4a1 | 116 | rec.SetRunTracking(""); |
117 | rec.SetLoadAlignFromCDB(0); | |
488581c1 | 118 | rec.SetFillESD(""); |
aa40a4a1 | 119 | rec.SetRunQA(kFALSE); |
120 | AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG); | |
121 | AliTracker::SetFieldMap(field,kTRUE); | |
122 | rec.SetFillTriggerESD(kFALSE); | |
123 | rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=sink1"); | |
124 | rec.Run(); | |
125 | } | |
488581c1 | 126 | |
127 | int DDLNoFromSlicePatch(int slice, int part) | |
128 | { | |
129 | int ddlno=768; | |
130 | if (part>1) ddlno+=72+4*slice+(part-2); | |
131 | else ddlno+=2*slice+part; | |
132 | ||
133 | return ddlno; | |
134 | } |