]>
Commit | Line | Data |
---|---|---|
51e9ec2a | 1 | // $Id$ |
5578cf60 | 2 | |
0efebbac | 3 | //************************************************************************** |
4 | //* This file is property of and copyright by the ALICE HLT Project * | |
5 | //* ALICE Experiment at CERN, All rights reserved. * | |
6 | //* * | |
7 | //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> * | |
8 | //* for The ALICE HLT Project. * | |
9 | //* * | |
10 | //* Permission to use, copy, modify and distribute this software and its * | |
11 | //* documentation strictly for non-commercial purposes is hereby granted * | |
12 | //* without fee, provided that the above copyright notice appears in all * | |
13 | //* copies and that both the copyright notice and this permission notice * | |
14 | //* appear in the supporting documentation. The authors make no claims * | |
15 | //* about the suitability of this software for any purpose. It is * | |
16 | //* provided "as is" without express or implied warranty. * | |
17 | //************************************************************************** | |
5578cf60 | 18 | |
51e9ec2a | 19 | // @file AliHLTTPCAgent.cxx |
20 | // @author Matthias Richter | |
21 | // @date | |
22 | // @brief Agent of the libAliHLTTPC library | |
23 | // @note | |
5578cf60 | 24 | |
25 | #include "AliHLTTPCAgent.h" | |
626bfcc1 | 26 | #include "AliHLTTPCDefinitions.h" |
27 | #include "AliHLTOUT.h" | |
73449074 | 28 | #include "AliHLTOUTHandlerChain.h" |
352670bf | 29 | #include "AliRunLoader.h" |
286c9940 | 30 | #include "AliCDBManager.h" |
31 | #include "AliCDBEntry.h" | |
32 | #include "AliTPCParam.h" | |
5578cf60 | 33 | |
34 | /** global instance for agent registration */ | |
35 | AliHLTTPCAgent gAliHLTTPCAgent; | |
36 | ||
e1440dab | 37 | // component headers |
672f8b8c | 38 | #include "AliHLTTPCCompModelInflaterComponent.h" |
39 | #include "AliHLTTPCCompModelDeflaterComponent.h" | |
40 | #include "AliHLTTPCCompModelDeconverterComponent.h" | |
41 | #include "AliHLTTPCCompModelConverterComponent.h" | |
42 | #include "AliHLTTPCCompDumpComponent.h" | |
32e0c022 | 43 | //#include "AliHLTTPCCalibCEComponent.h" |
44 | //#include "AliHLTTPCCalibPulserComponent.h" | |
45 | //#include "AliHLTTPCCalibPedestalComponent.h" | |
751d16ac | 46 | #include "AliHLTTPCCAInputDataCompressorComponent.h" |
400d857a | 47 | #include "AliHLTTPCCATrackerComponent.h" |
ae481371 | 48 | #include "AliHLTTPCCATrackerOutputConverter.h" |
a6fb14f5 | 49 | #include "AliHLTTPCTrackMCMarkerComponent.h" |
400d857a | 50 | #include "AliHLTTPCCAGlobalMergerComponent.h" |
0973c527 | 51 | #include "AliHLTTPCdEdxComponent.h" |
672f8b8c | 52 | #include "AliHLTTPCGlobalMergerComponent.h" |
53 | #include "AliHLTTPCSliceTrackerComponent.h" | |
672f8b8c | 54 | #include "AliHLTTPCClusterFinderComponent.h" |
55 | #include "AliHLTTPCRawDataUnpackerComponent.h" | |
56 | #include "AliHLTTPCDigitPublisherComponent.h" | |
e1440dab | 57 | #include "AliHLTTPCDigitDumpComponent.h" |
0efebbac | 58 | #include "AliHLTTPCClusterDumpComponent.h" |
f32b83e1 | 59 | #include "AliHLTTPCEsdWriterComponent.h" |
1ac82ce6 | 60 | #include "AliHLTTPCOfflineClustererComponent.h" |
61 | #include "AliHLTTPCOfflineTrackerComponent.h" | |
0e442a0a | 62 | #include "AliHLTTPCOfflineTrackerCalibComponent.h" |
32e0c022 | 63 | #include "AliHLTTPCOfflineCalibrationComponent.h" // to be added to the calibration library agent |
0efebbac | 64 | #include "AliHLTTPCClusterHistoComponent.h" |
3a3550fa | 65 | #include "AliHLTTPCHistogramHandlerComponent.h" |
32e0c022 | 66 | //#include "AliHLTTPCCalibTracksComponent.h" |
22f34176 | 67 | #include "AliHLTTPCTrackHistoComponent.h" |
68 | #include "AliHLTTPCTrackDumpComponent.h" | |
a912b63b | 69 | #include "AliHLTTPCHWCFDataReverterComponent.h" |
6af4f584 | 70 | #include "AliHLTTPCHWClusterTransformComponent.h" |
cfe8311c | 71 | #include "AliHLTTPCCFComparisonComponent.h" |
32e0c022 | 72 | // #include "AliHLTTPCCalibSeedMakerComponent.h" |
73 | // #include "AliHLTTPCCalibTimeComponent.h" | |
74 | // #include "AliHLTTPCCalibTimeGainComponent.h" | |
75 | // #include "AliHLTTPCCalibrationComponent.h" | |
098c0d28 | 76 | #include "AliHLTTPCDataCheckerComponent.h" |
c012881c | 77 | #include "AliHLTTPCHWCFEmulatorComponent.h" |
78 | #include "AliHLTTPCHWCFConsistencyControlComponent.h" | |
9703a636 | 79 | #include "AliHLTTPCDataCompressionComponent.h" |
e1440dab | 80 | |
5578cf60 | 81 | /** ROOT macro for the implementation of ROOT specific class methods */ |
82 | ClassImp(AliHLTTPCAgent) | |
83 | ||
84 | AliHLTTPCAgent::AliHLTTPCAgent() | |
51e9ec2a | 85 | : AliHLTModuleAgent("TPC") |
86 | , fRawDataHandler(NULL) | |
87 | , fTracksegsDataHandler(NULL) | |
88 | , fClustersDataHandler(NULL) | |
5578cf60 | 89 | { |
90 | // see header file for class documentation | |
91 | // or | |
92 | // refer to README to build package | |
93 | // or | |
94 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
95 | } | |
96 | ||
97 | AliHLTTPCAgent::~AliHLTTPCAgent() | |
98 | { | |
99 | // see header file for class documentation | |
100 | } | |
101 | ||
102 | int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, | |
4fc08fff | 103 | AliRawReader* rawReader, |
7c6a3cd3 | 104 | AliRunLoader* runloader) const |
5578cf60 | 105 | { |
106 | // see header file for class documentation | |
107 | if (handler) { | |
672f8b8c | 108 | |
109 | // This the tracking configuration for the full TPC | |
110 | // - 216 clusterfinders (1 per partition) | |
111 | // - 36 slice trackers | |
112 | // - one global merger | |
113 | // - the esd converter | |
114 | // The ESD is shipped embedded into a TTree | |
dfa1592e | 115 | int iMinSlice=0; |
672f8b8c | 116 | int iMaxSlice=35; |
dfa1592e | 117 | int iMinPart=0; |
672f8b8c | 118 | int iMaxPart=5; |
119 | TString mergerInput; | |
84bb5f35 | 120 | TString sinkClusterInput; |
4dd739b4 | 121 | TString sinkHWClusterInput; |
5090799b | 122 | TString dEdXInput; |
9703a636 | 123 | TString compressorInput; |
dfa1592e | 124 | for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { |
125 | TString trackerInput; | |
126 | for (int part=iMinPart; part<=iMaxPart; part++) { | |
127 | TString arg, publisher, cf; | |
128 | ||
129 | // digit publisher components | |
0ba35c53 | 130 | publisher.Form("TPC-DP_%02d_%d", slice, part); |
7c6a3cd3 | 131 | if (rawReader || !runloader) { |
132 | // AliSimulation: use the AliRawReaderPublisher if the raw reader is available | |
133 | // Alireconstruction: indicated by runloader==NULL, run always on raw data | |
4fc08fff | 134 | int ddlno=768; |
135 | if (part>1) ddlno+=72+4*slice+(part-2); | |
136 | else ddlno+=2*slice+part; | |
137 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x -silent", ddlno, slice, slice, part, part); | |
138 | handler->CreateConfiguration(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
7c6a3cd3 | 139 | } else { |
140 | arg.Form("-slice %d -partition %d", slice, part); | |
141 | handler->CreateConfiguration(publisher.Data(), "TPCDigitPublisher", NULL , arg.Data()); | |
4fc08fff | 142 | } |
dfa1592e | 143 | |
144 | // cluster finder components | |
0ba35c53 | 145 | cf.Form("TPC-CF_%02d_%d", slice, part); |
5e75f4e0 | 146 | arg="-release-memory -publish-raw"; |
9c790772 | 147 | if (!rawReader && runloader) { |
fc7c0369 | 148 | arg+=" -do-mc"; |
286c9940 | 149 | handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), arg.Data()); |
4fc08fff | 150 | } else { |
3c788ec7 | 151 | handler->CreateConfiguration(cf.Data(), "TPCClusterFinder32Bit", publisher.Data(),arg.Data()); |
4fc08fff | 152 | } |
4dd739b4 | 153 | |
154 | // Hardware CF emulator | |
155 | // soon going to replace the software clusterfinder | |
156 | TString hwcfemu; | |
157 | hwcfemu.Form("TPC-HWCFEmu_%02d_%d", slice, part); | |
b45d27f2 | 158 | handler->CreateConfiguration(hwcfemu.Data(), "TPCHWClusterFinderEmulator", publisher.Data(), "-do-mc 1"); |
9703a636 | 159 | if (compressorInput.Length()>0) compressorInput+=" "; |
160 | compressorInput+=hwcfemu; | |
161 | ||
4dd739b4 | 162 | TString hwcf; |
163 | hwcf.Form("TPC-HWCF_%02d_%d", slice, part); | |
29a4c9f5 | 164 | handler->CreateConfiguration(hwcf.Data(), "TPCHWClusterTransform",hwcfemu.Data(), "-publish-raw"); |
4dd739b4 | 165 | |
dfa1592e | 166 | if (trackerInput.Length()>0) trackerInput+=" "; |
4a1d41f3 | 167 | trackerInput+=hwcf; |
5090799b | 168 | if (dEdXInput.Length()>0) dEdXInput+=" "; |
4a1d41f3 | 169 | dEdXInput+=hwcf; |
84bb5f35 | 170 | if (sinkClusterInput.Length()>0) sinkClusterInput+=" "; |
171 | sinkClusterInput+=cf; | |
4dd739b4 | 172 | if (sinkHWClusterInput.Length()>0) sinkHWClusterInput+=" "; |
173 | sinkHWClusterInput+=hwcf; | |
dfa1592e | 174 | } |
175 | TString tracker; | |
176 | // tracker finder components | |
0ba35c53 | 177 | tracker.Form("TPC-TR_%02d", slice); |
80c9df1b | 178 | handler->CreateConfiguration(tracker.Data(), "TPCCATracker", trackerInput.Data(), ""); |
dfa1592e | 179 | |
672f8b8c | 180 | if (mergerInput.Length()>0) mergerInput+=" "; |
181 | mergerInput+=tracker; | |
dfa1592e | 182 | |
dfa1592e | 183 | } |
5578cf60 | 184 | |
672f8b8c | 185 | // GlobalMerger component |
fc7c0369 | 186 | handler->CreateConfiguration("TPC-globalmerger","TPCCAGlobalMerger",mergerInput.Data(),""); |
672f8b8c | 187 | |
9703a636 | 188 | // dEdx component |
5090799b | 189 | if (dEdXInput.Length()>0) dEdXInput+=" "; |
190 | dEdXInput+="TPC-globalmerger"; | |
191 | ||
192 | handler->CreateConfiguration("TPC-dEdx","TPCdEdx",dEdXInput.Data(),""); | |
193 | ||
9703a636 | 194 | // compression component |
195 | if (compressorInput.Length()>0) compressorInput+=" "; | |
196 | compressorInput+="TPC-globalmerger"; | |
197 | handler->CreateConfiguration("TPC-compression", "TPCDataCompressor", compressorInput.Data(),""); | |
198 | ||
672f8b8c | 199 | // the esd converter configuration |
791fbeb7 | 200 | TString converterInput="TPC-globalmerger"; |
9c790772 | 201 | if (!rawReader && runloader) { |
791fbeb7 | 202 | // propagate cluster info to the esd converter in order to fill the MC information |
8ee277c5 | 203 | handler->CreateConfiguration("TPC-clustermc-info", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLMCINFO' 'TPC '"); |
6595fdc6 | 204 | handler->CreateConfiguration("TPC-mcTrackMarker","TPCTrackMCMarker","TPC-globalmerger TPC-clustermc-info","" ); |
791fbeb7 | 205 | converterInput+=" "; |
6595fdc6 | 206 | converterInput+="TPC-mcTrackMarker"; |
791fbeb7 | 207 | } |
208 | handler->CreateConfiguration("TPC-esd-converter", "TPCEsdConverter" , converterInput.Data(), ""); | |
73449074 | 209 | |
84bb5f35 | 210 | // cluster dump collection |
5e75f4e0 | 211 | handler->CreateConfiguration("TPC-clusters", "BlockFilter" , sinkClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC ' -datatype 'CLMCINFO' 'TPC '"); |
212 | handler->CreateConfiguration("TPC-raw-clusters", "BlockFilter" , sinkClusterInput.Data(), "-datatype 'CLUSTRAW' 'TPC ' -datatype 'CLMCINFO' 'TPC '"); | |
4dd739b4 | 213 | handler->CreateConfiguration("TPC-hwclusters", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC ' -datatype 'CLMCINFO' 'TPC '"); |
214 | handler->CreateConfiguration("TPC-raw-hwclusters", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLUSTRAW' 'TPC ' -datatype 'CLMCINFO' 'TPC '"); | |
84bb5f35 | 215 | |
73449074 | 216 | ///////////////////////////////////////////////////////////////////////////////////// |
217 | // | |
218 | // a kChain HLTOUT configuration for processing of {'TRAKSEGS':'TPC '} data blocks | |
219 | // collects the data blocks, merges the tracks and produces an ESD object | |
220 | ||
221 | // publisher component | |
222 | handler->CreateConfiguration("TPC-hltout-tracksegs-publisher", "AliHLTOUTPublisher" , NULL, ""); | |
223 | ||
224 | // GlobalMerger component | |
225 | handler->CreateConfiguration("TPC-hltout-tracksegs-merger", "TPCGlobalMerger", "TPC-hltout-tracksegs-publisher", ""); | |
226 | ||
227 | // the esd converter configuration | |
228 | handler->CreateConfiguration("TPC-hltout-tracksegs-esd-converter", "TPCEsdConverter", "TPC-hltout-tracksegs-merger", ""); | |
229 | ||
230 | ///////////////////////////////////////////////////////////////////////////////////// | |
231 | // | |
232 | // a kChain HLTOUT configuration for processing of {'TRACKS ':'TPC '} data blocks | |
233 | // produces an ESD object from the track structure | |
234 | ||
235 | // publisher component | |
236 | handler->CreateConfiguration("TPC-hltout-tracks-publisher", "AliHLTOUTPublisher" , NULL, ""); | |
237 | ||
238 | // the esd converter configuration | |
239 | handler->CreateConfiguration("TPC-hltout-tracks-esd-converter", "TPCEsdConverter", "TPC-hltout-tracks-publisher", ""); | |
51e9ec2a | 240 | |
241 | ///////////////////////////////////////////////////////////////////////////////////// | |
242 | // | |
243 | // a kChain HLTOUT configuration for processing of {'CLUSTERS':'TPC '} data blocks | |
244 | // stores the blocks in file HLT.TPC.Clusters.root in HOMER format | |
245 | ||
246 | // publisher component | |
247 | handler->CreateConfiguration("TPC-hltout-cluster-publisher", "AliHLTOUTPublisher" , NULL, ""); | |
248 | ||
249 | // the HLTOUT component collects the blocks and stores the file | |
250 | handler->CreateConfiguration("TPC-hltout-cluster-dump", "HLTOUT", "TPC-hltout-cluster-publisher", "-digitfile HLT.TPC.Clusters.root -rawout=off -links 2"); | |
5578cf60 | 251 | } |
51e9ec2a | 252 | |
5578cf60 | 253 | return 0; |
254 | } | |
255 | ||
dee38f1b | 256 | const char* AliHLTTPCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/, |
ff6648de | 257 | AliRunLoader* runloader) const |
5578cf60 | 258 | { |
259 | // see header file for class documentation | |
ff6648de | 260 | if (runloader) { |
261 | // reconstruction chains for AliRoot simulation | |
262 | // Note: run loader is only available while running embedded into | |
263 | // AliRoot simulation | |
6595fdc6 | 264 | //if (runloader->GetLoader("TPCLoader") != NULL) |
265 | //return "TPC-esd-converter TPC-clusters"; | |
e9f84626 | 266 | |
267 | // 2010-10-26 TPC clusters not written to HLTOUT in order to make the simulation | |
268 | // closer to the real data | |
269 | //return "TPC-clusters"; | |
ff6648de | 270 | } |
271 | return NULL; | |
5578cf60 | 272 | } |
273 | ||
274 | const char* AliHLTTPCAgent::GetRequiredComponentLibraries() const | |
275 | { | |
276 | // see header file for class documentation | |
5ad1e184 | 277 | |
278 | // actually, the TPC library has dependencies to Util and RCU | |
279 | // so the two has to be loaded anyhow before we get here | |
280 | //return "libAliHLTUtil.so libAliHLTRCU.so"; | |
9c790772 | 281 | return "libAliHLTUtil.so"; |
5578cf60 | 282 | } |
f3506ea2 | 283 | |
e1440dab | 284 | int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const |
f3506ea2 | 285 | { |
e1440dab | 286 | // see header file for class documentation |
287 | if (!pHandler) return -EINVAL; | |
672f8b8c | 288 | |
32e0c022 | 289 | // pHandler->AddComponent(new AliHLTTPCCalibCEComponent); |
290 | // pHandler->AddComponent(new AliHLTTPCCalibPulserComponent); | |
291 | // pHandler->AddComponent(new AliHLTTPCCalibPedestalComponent); | |
672f8b8c | 292 | pHandler->AddComponent(new AliHLTTPCCompModelInflaterComponent); |
293 | pHandler->AddComponent(new AliHLTTPCCompModelDeflaterComponent); | |
294 | pHandler->AddComponent(new AliHLTTPCCompModelDeconverterComponent); | |
295 | pHandler->AddComponent(new AliHLTTPCCompModelConverterComponent); | |
296 | pHandler->AddComponent(new AliHLTTPCCompDumpComponent); | |
751d16ac | 297 | pHandler->AddComponent(new AliHLTTPCCAInputDataCompressorComponent); |
400d857a | 298 | pHandler->AddComponent(new AliHLTTPCCATrackerComponent); |
ae481371 | 299 | pHandler->AddComponent(new AliHLTTPCCATrackerOutputConverter); |
400d857a | 300 | pHandler->AddComponent(new AliHLTTPCCAGlobalMergerComponent); |
a6fb14f5 | 301 | pHandler->AddComponent(new AliHLTTPCTrackMCMarkerComponent); |
672f8b8c | 302 | pHandler->AddComponent(new AliHLTTPCGlobalMergerComponent); |
0973c527 | 303 | pHandler->AddComponent(new AliHLTTPCdEdxComponent); |
672f8b8c | 304 | pHandler->AddComponent(new AliHLTTPCSliceTrackerComponent); |
672f8b8c | 305 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderPacked)); |
306 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderUnpacked)); | |
307 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderDecoder)); | |
6f23f6cc | 308 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinder32Bit)); |
672f8b8c | 309 | pHandler->AddComponent(new AliHLTTPCRawDataUnpackerComponent); |
310 | pHandler->AddComponent(new AliHLTTPCDigitPublisherComponent); | |
e1440dab | 311 | pHandler->AddComponent(new AliHLTTPCDigitDumpComponent); |
0efebbac | 312 | pHandler->AddComponent(new AliHLTTPCClusterDumpComponent); |
f32b83e1 | 313 | pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliWriter); |
314 | pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliConverter); | |
1ac82ce6 | 315 | pHandler->AddComponent(new AliHLTTPCOfflineClustererComponent); |
316 | pHandler->AddComponent(new AliHLTTPCOfflineTrackerComponent); | |
0e442a0a | 317 | pHandler->AddComponent(new AliHLTTPCOfflineTrackerCalibComponent); |
e642ae99 | 318 | pHandler->AddComponent(new AliHLTTPCOfflineCalibrationComponent); |
0efebbac | 319 | pHandler->AddComponent(new AliHLTTPCClusterHistoComponent); |
3a3550fa | 320 | pHandler->AddComponent(new AliHLTTPCHistogramHandlerComponent); |
32e0c022 | 321 | //pHandler->AddComponent(new AliHLTTPCCalibTracksComponent); |
22f34176 | 322 | pHandler->AddComponent(new AliHLTTPCTrackHistoComponent); |
323 | pHandler->AddComponent(new AliHLTTPCTrackDumpComponent); | |
a912b63b | 324 | pHandler->AddComponent(new AliHLTTPCHWCFDataReverterComponent); |
6af4f584 | 325 | pHandler->AddComponent(new AliHLTTPCHWClusterTransformComponent); |
cfe8311c | 326 | pHandler->AddComponent(new AliHLTTPCCFComparisonComponent); |
32e0c022 | 327 | // pHandler->AddComponent(new AliHLTTPCCalibSeedMakerComponent); |
328 | // pHandler->AddComponent(new AliHLTTPCCalibTimeComponent); | |
329 | // pHandler->AddComponent(new AliHLTTPCCalibTimeGainComponent); | |
330 | // pHandler->AddComponent(new AliHLTTPCCalibrationComponent); | |
098c0d28 | 331 | pHandler->AddComponent(new AliHLTTPCDataCheckerComponent); |
c012881c | 332 | pHandler->AddComponent(new AliHLTTPCHWCFEmulatorComponent); |
f42d2ad3 | 333 | // pHandler->AddComponent(new AliHLTTPCHWCFConsistencyControlComponent); //FIXME: Causes crash: https://savannah.cern.ch/bugs/?83677 |
9703a636 | 334 | pHandler->AddComponent(new AliHLTTPCDataCompressionComponent); |
f3506ea2 | 335 | return 0; |
336 | } | |
626bfcc1 | 337 | |
338 | int AliHLTTPCAgent::GetHandlerDescription(AliHLTComponentDataType dt, | |
339 | AliHLTUInt32_t spec, | |
340 | AliHLTOUTHandlerDesc& desc) const | |
341 | { | |
342 | // see header file for class documentation | |
73449074 | 343 | |
344 | // raw data blocks to be fed into offline reconstruction | |
626bfcc1 | 345 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC)) { |
346 | int slice=AliHLTTPCDefinitions::GetMinSliceNr(spec); | |
347 | int part=AliHLTTPCDefinitions::GetMinPatchNr(spec); | |
348 | if (slice==AliHLTTPCDefinitions::GetMaxSliceNr(spec) && | |
349 | part==AliHLTTPCDefinitions::GetMaxPatchNr(spec)) { | |
350 | desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId()); | |
351 | return 1; | |
352 | } else { | |
353 | HLTWarning("handler can not process merged data from multiple ddls:" | |
354 | " min slice %d, max slice %d, min part %d, max part %d", | |
355 | slice, AliHLTTPCDefinitions::GetMaxSliceNr(spec), | |
356 | part, AliHLTTPCDefinitions::GetMaxPatchNr(spec)); | |
357 | return 0; | |
358 | } | |
359 | } | |
73449074 | 360 | |
51e9ec2a | 361 | // dump for {'CLUSTERS':'TPC '} blocks stored in a 'digit' file |
84bb5f35 | 362 | if (dt==AliHLTTPCDefinitions::fgkClustersDataType) { |
51e9ec2a | 363 | desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId()); |
84bb5f35 | 364 | return 1; |
365 | } | |
366 | ||
5e75f4e0 | 367 | // {'CLUSTRAW':'TPC '} |
368 | if (dt==AliHLTTPCDefinitions::fgkRawClustersDataType) { | |
369 | desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId()); | |
370 | return 1; | |
371 | } | |
372 | ||
373 | // {'CLMCINFO':'TPC '} | |
374 | if (dt==AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo) { | |
375 | desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId()); | |
376 | return 1; | |
377 | } | |
378 | ||
73449074 | 379 | // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format |
380 | if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) { | |
381 | desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId()); | |
382 | return 1; | |
383 | } | |
384 | ||
385 | // afterburner for {'TRACKS ':'TPC '} block to be converted to ESD format | |
386 | // there is only one data block | |
387 | if (dt==AliHLTTPCDefinitions::fgkTracksDataType) { | |
388 | desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId()); | |
389 | return 1; | |
390 | } | |
626bfcc1 | 391 | return 0; |
392 | } | |
393 | ||
394 | AliHLTOUTHandler* AliHLTTPCAgent::GetOutputHandler(AliHLTComponentDataType dt, | |
b0914d2e | 395 | AliHLTUInt32_t /*spec*/) |
626bfcc1 | 396 | { |
397 | // see header file for class documentation | |
73449074 | 398 | |
399 | // raw data blocks to be fed into offline reconstruction | |
626bfcc1 | 400 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC)) { |
401 | if (!fRawDataHandler) { | |
402 | fRawDataHandler=new AliHLTTPCAgent::AliHLTTPCRawDataHandler; | |
403 | } | |
626bfcc1 | 404 | return fRawDataHandler; |
405 | } | |
73449074 | 406 | |
51e9ec2a | 407 | // dump for {'CLUSTERS':'TPC '}, stored in a file HLT.TPC.Clusters.root in HOMER format |
408 | if (dt==AliHLTTPCDefinitions::fgkClustersDataType) { | |
409 | if (fClustersDataHandler==NULL) | |
410 | fClustersDataHandler=new AliHLTOUTHandlerChain("chains=TPC-hltout-cluster-dump libHLTsim.so libAliHLTUtil.so"); | |
411 | return fClustersDataHandler; | |
412 | } | |
413 | ||
73449074 | 414 | // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format |
415 | // in a kChain HLTOUT handler | |
416 | if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) { | |
417 | if (fTracksegsDataHandler==NULL) | |
418 | fTracksegsDataHandler=new AliHLTOUTHandlerChain("chains=TPC-hltout-tracksegs-esd-converter"); | |
419 | return fTracksegsDataHandler; | |
420 | } | |
421 | ||
422 | // afterburner for {'TRACKS ':'TPC '} block to be converted to ESD format | |
423 | // there is only one data block | |
424 | if (dt==AliHLTTPCDefinitions::fgkTracksDataType) { | |
425 | return new AliHLTOUTHandlerChain("chains=TPC-hltout-tracks-esd-converter"); | |
426 | } | |
427 | ||
626bfcc1 | 428 | return NULL; |
429 | } | |
430 | ||
431 | int AliHLTTPCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) | |
432 | { | |
433 | // see header file for class documentation | |
434 | if (pInstance==NULL) return -EINVAL; | |
435 | ||
436 | if (pInstance==fRawDataHandler) { | |
73449074 | 437 | delete fRawDataHandler; |
438 | fRawDataHandler=NULL; | |
439 | } | |
440 | ||
441 | if (pInstance==fTracksegsDataHandler) { | |
442 | delete fTracksegsDataHandler; | |
443 | fTracksegsDataHandler=NULL; | |
626bfcc1 | 444 | } |
51e9ec2a | 445 | |
446 | if (pInstance==fClustersDataHandler) { | |
447 | delete fClustersDataHandler; | |
448 | fClustersDataHandler=NULL; | |
449 | } | |
450 | ||
626bfcc1 | 451 | return 0; |
452 | } | |
453 | ||
454 | AliHLTTPCAgent::AliHLTTPCRawDataHandler::AliHLTTPCRawDataHandler() | |
455 | { | |
456 | // see header file for class documentation | |
457 | } | |
458 | ||
459 | AliHLTTPCAgent::AliHLTTPCRawDataHandler::~AliHLTTPCRawDataHandler() | |
460 | { | |
461 | // see header file for class documentation | |
462 | } | |
463 | ||
464 | int AliHLTTPCAgent::AliHLTTPCRawDataHandler::ProcessData(AliHLTOUT* pData) | |
465 | { | |
466 | // see header file for class documentation | |
467 | if (!pData) return -EINVAL; | |
468 | AliHLTComponentDataType dt=kAliHLTVoidDataType; | |
469 | AliHLTUInt32_t spec=kAliHLTVoidDataSpec; | |
470 | int iResult=pData->GetDataBlockDescription(dt, spec); | |
471 | if (iResult>=0) { | |
472 | int slice=AliHLTTPCDefinitions::GetMinSliceNr(spec); | |
473 | int part=AliHLTTPCDefinitions::GetMinPatchNr(spec); | |
474 | if (slice==AliHLTTPCDefinitions::GetMaxSliceNr(spec) && | |
475 | part==AliHLTTPCDefinitions::GetMaxPatchNr(spec)) { | |
476 | iResult=768; | |
477 | if (part>1) iResult+=72+4*slice+(part-2); | |
478 | else iResult+=2*slice+part; | |
479 | } else { | |
480 | HLTError("handler can not process merged data from multiple ddls:" | |
481 | " min slice %d, max slice %d, min part %d, max part %d", | |
482 | slice, AliHLTTPCDefinitions::GetMaxSliceNr(spec), | |
483 | part, AliHLTTPCDefinitions::GetMaxPatchNr(spec)); | |
484 | iResult=-EBADMSG; | |
485 | } | |
486 | } | |
487 | return iResult; | |
488 | } |