]>
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 "AliHLTTPCRunStatisticsProducerComponent.h" |
39 | #include "AliHLTTPCEventStatisticsProducerComponent.h" | |
40 | #include "AliHLTTPCCompModelInflaterComponent.h" | |
41 | #include "AliHLTTPCCompModelDeflaterComponent.h" | |
42 | #include "AliHLTTPCCompModelDeconverterComponent.h" | |
43 | #include "AliHLTTPCCompModelConverterComponent.h" | |
44 | #include "AliHLTTPCCompDumpComponent.h" | |
32e0c022 | 45 | //#include "AliHLTTPCCalibCEComponent.h" |
46 | //#include "AliHLTTPCCalibPulserComponent.h" | |
47 | //#include "AliHLTTPCCalibPedestalComponent.h" | |
751d16ac | 48 | #include "AliHLTTPCCAInputDataCompressorComponent.h" |
400d857a | 49 | #include "AliHLTTPCCATrackerComponent.h" |
ae481371 | 50 | #include "AliHLTTPCCATrackerOutputConverter.h" |
a6fb14f5 | 51 | #include "AliHLTTPCTrackMCMarkerComponent.h" |
400d857a | 52 | #include "AliHLTTPCCAGlobalMergerComponent.h" |
0973c527 | 53 | #include "AliHLTTPCdEdxComponent.h" |
672f8b8c | 54 | #include "AliHLTTPCGlobalMergerComponent.h" |
55 | #include "AliHLTTPCSliceTrackerComponent.h" | |
56 | #include "AliHLTTPCVertexFinderComponent.h" | |
57 | #include "AliHLTTPCClusterFinderComponent.h" | |
58 | #include "AliHLTTPCRawDataUnpackerComponent.h" | |
59 | #include "AliHLTTPCDigitPublisherComponent.h" | |
60 | #include "AliHLTTPCZeroSuppressionComponent.h" | |
e1440dab | 61 | #include "AliHLTTPCDigitDumpComponent.h" |
0efebbac | 62 | #include "AliHLTTPCClusterDumpComponent.h" |
f32b83e1 | 63 | #include "AliHLTTPCEsdWriterComponent.h" |
1ac82ce6 | 64 | #include "AliHLTTPCOfflineClustererComponent.h" |
65 | #include "AliHLTTPCOfflineTrackerComponent.h" | |
0e442a0a | 66 | #include "AliHLTTPCOfflineTrackerCalibComponent.h" |
32e0c022 | 67 | #include "AliHLTTPCOfflineCalibrationComponent.h" // to be added to the calibration library agent |
0efebbac | 68 | #include "AliHLTTPCClusterHistoComponent.h" |
3a3550fa | 69 | #include "AliHLTTPCNoiseMapComponent.h" |
70 | #include "AliHLTTPCHistogramHandlerComponent.h" | |
32e0c022 | 71 | //#include "AliHLTTPCCalibTracksComponent.h" |
22f34176 | 72 | #include "AliHLTTPCTrackHistoComponent.h" |
73 | #include "AliHLTTPCTrackDumpComponent.h" | |
a912b63b | 74 | #include "AliHLTTPCHWCFDataReverterComponent.h" |
6af4f584 | 75 | #include "AliHLTTPCHWClusterTransformComponent.h" |
cfe8311c | 76 | #include "AliHLTTPCCFComparisonComponent.h" |
32e0c022 | 77 | // #include "AliHLTTPCCalibSeedMakerComponent.h" |
78 | // #include "AliHLTTPCCalibTimeComponent.h" | |
79 | // #include "AliHLTTPCCalibTimeGainComponent.h" | |
80 | // #include "AliHLTTPCCalibrationComponent.h" | |
098c0d28 | 81 | #include "AliHLTTPCDataCheckerComponent.h" |
e1440dab | 82 | |
5578cf60 | 83 | /** ROOT macro for the implementation of ROOT specific class methods */ |
84 | ClassImp(AliHLTTPCAgent) | |
85 | ||
86 | AliHLTTPCAgent::AliHLTTPCAgent() | |
51e9ec2a | 87 | : AliHLTModuleAgent("TPC") |
88 | , fRawDataHandler(NULL) | |
89 | , fTracksegsDataHandler(NULL) | |
90 | , fClustersDataHandler(NULL) | |
5578cf60 | 91 | { |
92 | // see header file for class documentation | |
93 | // or | |
94 | // refer to README to build package | |
95 | // or | |
96 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
97 | } | |
98 | ||
99 | AliHLTTPCAgent::~AliHLTTPCAgent() | |
100 | { | |
101 | // see header file for class documentation | |
102 | } | |
103 | ||
104 | int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, | |
4fc08fff | 105 | AliRawReader* rawReader, |
7c6a3cd3 | 106 | AliRunLoader* runloader) const |
5578cf60 | 107 | { |
108 | // see header file for class documentation | |
109 | if (handler) { | |
672f8b8c | 110 | |
111 | // This the tracking configuration for the full TPC | |
112 | // - 216 clusterfinders (1 per partition) | |
113 | // - 36 slice trackers | |
114 | // - one global merger | |
115 | // - the esd converter | |
116 | // The ESD is shipped embedded into a TTree | |
dfa1592e | 117 | int iMinSlice=0; |
672f8b8c | 118 | int iMaxSlice=35; |
dfa1592e | 119 | int iMinPart=0; |
672f8b8c | 120 | int iMaxPart=5; |
121 | TString mergerInput; | |
84bb5f35 | 122 | TString sinkClusterInput; |
5090799b | 123 | TString dEdXInput; |
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); |
3c788ec7 | 146 | arg="-release-memory"; |
9c790772 | 147 | if (!rawReader && runloader) { |
fc7c0369 | 148 | arg+=" -do-mc"; |
286c9940 | 149 | handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), arg.Data()); |
4fc08fff | 150 | } else { |
9c790772 | 151 | #ifndef HAVE_NOT_ALTRORAWSTREAMV3 |
3c788ec7 | 152 | handler->CreateConfiguration(cf.Data(), "TPCClusterFinder32Bit", publisher.Data(),arg.Data()); |
9c790772 | 153 | #else |
154 | // using the AltroDecoder if the official V3 decoder is not | |
155 | // available in the offline code | |
286c9940 | 156 | handler->CreateConfiguration(cf.Data(), "TPCClusterFinderDecoder", publisher.Data(), arg.Data()); |
9c790772 | 157 | #endif |
4fc08fff | 158 | } |
dfa1592e | 159 | if (trackerInput.Length()>0) trackerInput+=" "; |
160 | trackerInput+=cf; | |
5090799b | 161 | if (dEdXInput.Length()>0) dEdXInput+=" "; |
162 | dEdXInput+=cf; | |
84bb5f35 | 163 | if (sinkClusterInput.Length()>0) sinkClusterInput+=" "; |
164 | sinkClusterInput+=cf; | |
dfa1592e | 165 | } |
166 | TString tracker; | |
167 | // tracker finder components | |
0ba35c53 | 168 | tracker.Form("TPC-TR_%02d", slice); |
fc7c0369 | 169 | handler->CreateConfiguration(tracker.Data(), "TPCCATracker", trackerInput.Data(), ""); |
dfa1592e | 170 | |
672f8b8c | 171 | if (mergerInput.Length()>0) mergerInput+=" "; |
172 | mergerInput+=tracker; | |
dfa1592e | 173 | |
dfa1592e | 174 | } |
5578cf60 | 175 | |
672f8b8c | 176 | // GlobalMerger component |
fc7c0369 | 177 | handler->CreateConfiguration("TPC-globalmerger","TPCCAGlobalMerger",mergerInput.Data(),""); |
672f8b8c | 178 | |
5090799b | 179 | if (dEdXInput.Length()>0) dEdXInput+=" "; |
180 | dEdXInput+="TPC-globalmerger"; | |
181 | ||
182 | handler->CreateConfiguration("TPC-dEdx","TPCdEdx",dEdXInput.Data(),""); | |
183 | ||
672f8b8c | 184 | // the esd converter configuration |
791fbeb7 | 185 | TString converterInput="TPC-globalmerger"; |
9c790772 | 186 | if (!rawReader && runloader) { |
791fbeb7 | 187 | // propagate cluster info to the esd converter in order to fill the MC information |
6595fdc6 | 188 | handler->CreateConfiguration("TPC-clustermc-info", "BlockFilter" , sinkClusterInput.Data(), "-datatype 'CLMCINFO' 'TPC '"); |
189 | handler->CreateConfiguration("TPC-mcTrackMarker","TPCTrackMCMarker","TPC-globalmerger TPC-clustermc-info","" ); | |
791fbeb7 | 190 | converterInput+=" "; |
6595fdc6 | 191 | converterInput+="TPC-mcTrackMarker"; |
791fbeb7 | 192 | } |
193 | handler->CreateConfiguration("TPC-esd-converter", "TPCEsdConverter" , converterInput.Data(), ""); | |
73449074 | 194 | |
84bb5f35 | 195 | // cluster dump collection |
196 | handler->CreateConfiguration("TPC-clusters", "BlockFilter" , sinkClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC '"); | |
197 | ||
73449074 | 198 | ///////////////////////////////////////////////////////////////////////////////////// |
199 | // | |
200 | // a kChain HLTOUT configuration for processing of {'TRAKSEGS':'TPC '} data blocks | |
201 | // collects the data blocks, merges the tracks and produces an ESD object | |
202 | ||
203 | // publisher component | |
204 | handler->CreateConfiguration("TPC-hltout-tracksegs-publisher", "AliHLTOUTPublisher" , NULL, ""); | |
205 | ||
206 | // GlobalMerger component | |
207 | handler->CreateConfiguration("TPC-hltout-tracksegs-merger", "TPCGlobalMerger", "TPC-hltout-tracksegs-publisher", ""); | |
208 | ||
209 | // the esd converter configuration | |
210 | handler->CreateConfiguration("TPC-hltout-tracksegs-esd-converter", "TPCEsdConverter", "TPC-hltout-tracksegs-merger", ""); | |
211 | ||
212 | ///////////////////////////////////////////////////////////////////////////////////// | |
213 | // | |
214 | // a kChain HLTOUT configuration for processing of {'TRACKS ':'TPC '} data blocks | |
215 | // produces an ESD object from the track structure | |
216 | ||
217 | // publisher component | |
218 | handler->CreateConfiguration("TPC-hltout-tracks-publisher", "AliHLTOUTPublisher" , NULL, ""); | |
219 | ||
220 | // the esd converter configuration | |
221 | handler->CreateConfiguration("TPC-hltout-tracks-esd-converter", "TPCEsdConverter", "TPC-hltout-tracks-publisher", ""); | |
51e9ec2a | 222 | |
223 | ///////////////////////////////////////////////////////////////////////////////////// | |
224 | // | |
225 | // a kChain HLTOUT configuration for processing of {'CLUSTERS':'TPC '} data blocks | |
226 | // stores the blocks in file HLT.TPC.Clusters.root in HOMER format | |
227 | ||
228 | // publisher component | |
229 | handler->CreateConfiguration("TPC-hltout-cluster-publisher", "AliHLTOUTPublisher" , NULL, ""); | |
230 | ||
231 | // the HLTOUT component collects the blocks and stores the file | |
232 | handler->CreateConfiguration("TPC-hltout-cluster-dump", "HLTOUT", "TPC-hltout-cluster-publisher", "-digitfile HLT.TPC.Clusters.root -rawout=off -links 2"); | |
5578cf60 | 233 | } |
51e9ec2a | 234 | |
5578cf60 | 235 | return 0; |
236 | } | |
237 | ||
dee38f1b | 238 | const char* AliHLTTPCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/, |
ff6648de | 239 | AliRunLoader* runloader) const |
5578cf60 | 240 | { |
241 | // see header file for class documentation | |
ff6648de | 242 | if (runloader) { |
243 | // reconstruction chains for AliRoot simulation | |
244 | // Note: run loader is only available while running embedded into | |
245 | // AliRoot simulation | |
6595fdc6 | 246 | //if (runloader->GetLoader("TPCLoader") != NULL) |
247 | //return "TPC-esd-converter TPC-clusters"; | |
248 | return "TPC-clusters"; | |
ff6648de | 249 | } |
250 | return NULL; | |
5578cf60 | 251 | } |
252 | ||
253 | const char* AliHLTTPCAgent::GetRequiredComponentLibraries() const | |
254 | { | |
255 | // see header file for class documentation | |
5ad1e184 | 256 | |
257 | // actually, the TPC library has dependencies to Util and RCU | |
258 | // so the two has to be loaded anyhow before we get here | |
259 | //return "libAliHLTUtil.so libAliHLTRCU.so"; | |
9c790772 | 260 | return "libAliHLTUtil.so"; |
5578cf60 | 261 | } |
f3506ea2 | 262 | |
e1440dab | 263 | int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const |
f3506ea2 | 264 | { |
e1440dab | 265 | // see header file for class documentation |
266 | if (!pHandler) return -EINVAL; | |
672f8b8c | 267 | |
268 | pHandler->AddComponent(new AliHLTTPCRunStatisticsProducerComponent); | |
269 | pHandler->AddComponent(new AliHLTTPCEventStatisticsProducerComponent); | |
32e0c022 | 270 | // pHandler->AddComponent(new AliHLTTPCCalibCEComponent); |
271 | // pHandler->AddComponent(new AliHLTTPCCalibPulserComponent); | |
272 | // pHandler->AddComponent(new AliHLTTPCCalibPedestalComponent); | |
672f8b8c | 273 | pHandler->AddComponent(new AliHLTTPCCompModelInflaterComponent); |
274 | pHandler->AddComponent(new AliHLTTPCCompModelDeflaterComponent); | |
275 | pHandler->AddComponent(new AliHLTTPCCompModelDeconverterComponent); | |
276 | pHandler->AddComponent(new AliHLTTPCCompModelConverterComponent); | |
277 | pHandler->AddComponent(new AliHLTTPCCompDumpComponent); | |
751d16ac | 278 | pHandler->AddComponent(new AliHLTTPCCAInputDataCompressorComponent); |
400d857a | 279 | pHandler->AddComponent(new AliHLTTPCCATrackerComponent); |
ae481371 | 280 | pHandler->AddComponent(new AliHLTTPCCATrackerOutputConverter); |
400d857a | 281 | pHandler->AddComponent(new AliHLTTPCCAGlobalMergerComponent); |
a6fb14f5 | 282 | pHandler->AddComponent(new AliHLTTPCTrackMCMarkerComponent); |
672f8b8c | 283 | pHandler->AddComponent(new AliHLTTPCGlobalMergerComponent); |
0973c527 | 284 | pHandler->AddComponent(new AliHLTTPCdEdxComponent); |
672f8b8c | 285 | pHandler->AddComponent(new AliHLTTPCSliceTrackerComponent); |
286 | pHandler->AddComponent(new AliHLTTPCVertexFinderComponent); | |
287 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderPacked)); | |
288 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderUnpacked)); | |
289 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderDecoder)); | |
6f23f6cc | 290 | pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinder32Bit)); |
672f8b8c | 291 | pHandler->AddComponent(new AliHLTTPCRawDataUnpackerComponent); |
292 | pHandler->AddComponent(new AliHLTTPCDigitPublisherComponent); | |
293 | pHandler->AddComponent(new AliHLTTPCZeroSuppressionComponent); | |
e1440dab | 294 | pHandler->AddComponent(new AliHLTTPCDigitDumpComponent); |
0efebbac | 295 | pHandler->AddComponent(new AliHLTTPCClusterDumpComponent); |
f32b83e1 | 296 | pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliWriter); |
297 | pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliConverter); | |
1ac82ce6 | 298 | pHandler->AddComponent(new AliHLTTPCOfflineClustererComponent); |
299 | pHandler->AddComponent(new AliHLTTPCOfflineTrackerComponent); | |
0e442a0a | 300 | pHandler->AddComponent(new AliHLTTPCOfflineTrackerCalibComponent); |
e642ae99 | 301 | pHandler->AddComponent(new AliHLTTPCOfflineCalibrationComponent); |
0efebbac | 302 | pHandler->AddComponent(new AliHLTTPCClusterHistoComponent); |
3a3550fa | 303 | pHandler->AddComponent(new AliHLTTPCNoiseMapComponent); |
304 | pHandler->AddComponent(new AliHLTTPCHistogramHandlerComponent); | |
32e0c022 | 305 | //pHandler->AddComponent(new AliHLTTPCCalibTracksComponent); |
22f34176 | 306 | pHandler->AddComponent(new AliHLTTPCTrackHistoComponent); |
307 | pHandler->AddComponent(new AliHLTTPCTrackDumpComponent); | |
a912b63b | 308 | pHandler->AddComponent(new AliHLTTPCHWCFDataReverterComponent); |
6af4f584 | 309 | pHandler->AddComponent(new AliHLTTPCHWClusterTransformComponent); |
cfe8311c | 310 | pHandler->AddComponent(new AliHLTTPCCFComparisonComponent); |
32e0c022 | 311 | // pHandler->AddComponent(new AliHLTTPCCalibSeedMakerComponent); |
312 | // pHandler->AddComponent(new AliHLTTPCCalibTimeComponent); | |
313 | // pHandler->AddComponent(new AliHLTTPCCalibTimeGainComponent); | |
314 | // pHandler->AddComponent(new AliHLTTPCCalibrationComponent); | |
098c0d28 | 315 | pHandler->AddComponent(new AliHLTTPCDataCheckerComponent); |
a912b63b | 316 | |
f3506ea2 | 317 | return 0; |
318 | } | |
626bfcc1 | 319 | |
320 | int AliHLTTPCAgent::GetHandlerDescription(AliHLTComponentDataType dt, | |
321 | AliHLTUInt32_t spec, | |
322 | AliHLTOUTHandlerDesc& desc) const | |
323 | { | |
324 | // see header file for class documentation | |
73449074 | 325 | |
326 | // raw data blocks to be fed into offline reconstruction | |
626bfcc1 | 327 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC)) { |
328 | int slice=AliHLTTPCDefinitions::GetMinSliceNr(spec); | |
329 | int part=AliHLTTPCDefinitions::GetMinPatchNr(spec); | |
330 | if (slice==AliHLTTPCDefinitions::GetMaxSliceNr(spec) && | |
331 | part==AliHLTTPCDefinitions::GetMaxPatchNr(spec)) { | |
332 | desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId()); | |
333 | return 1; | |
334 | } else { | |
335 | HLTWarning("handler can not process merged data from multiple ddls:" | |
336 | " min slice %d, max slice %d, min part %d, max part %d", | |
337 | slice, AliHLTTPCDefinitions::GetMaxSliceNr(spec), | |
338 | part, AliHLTTPCDefinitions::GetMaxPatchNr(spec)); | |
339 | return 0; | |
340 | } | |
341 | } | |
73449074 | 342 | |
51e9ec2a | 343 | // dump for {'CLUSTERS':'TPC '} blocks stored in a 'digit' file |
84bb5f35 | 344 | if (dt==AliHLTTPCDefinitions::fgkClustersDataType) { |
51e9ec2a | 345 | desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId()); |
84bb5f35 | 346 | return 1; |
347 | } | |
348 | ||
73449074 | 349 | // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format |
350 | if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) { | |
351 | desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId()); | |
352 | return 1; | |
353 | } | |
354 | ||
355 | // afterburner for {'TRACKS ':'TPC '} block to be converted to ESD format | |
356 | // there is only one data block | |
357 | if (dt==AliHLTTPCDefinitions::fgkTracksDataType) { | |
358 | desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId()); | |
359 | return 1; | |
360 | } | |
626bfcc1 | 361 | return 0; |
362 | } | |
363 | ||
364 | AliHLTOUTHandler* AliHLTTPCAgent::GetOutputHandler(AliHLTComponentDataType dt, | |
b0914d2e | 365 | AliHLTUInt32_t /*spec*/) |
626bfcc1 | 366 | { |
367 | // see header file for class documentation | |
73449074 | 368 | |
369 | // raw data blocks to be fed into offline reconstruction | |
626bfcc1 | 370 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC)) { |
371 | if (!fRawDataHandler) { | |
372 | fRawDataHandler=new AliHLTTPCAgent::AliHLTTPCRawDataHandler; | |
373 | } | |
626bfcc1 | 374 | return fRawDataHandler; |
375 | } | |
73449074 | 376 | |
51e9ec2a | 377 | // dump for {'CLUSTERS':'TPC '}, stored in a file HLT.TPC.Clusters.root in HOMER format |
378 | if (dt==AliHLTTPCDefinitions::fgkClustersDataType) { | |
379 | if (fClustersDataHandler==NULL) | |
380 | fClustersDataHandler=new AliHLTOUTHandlerChain("chains=TPC-hltout-cluster-dump libHLTsim.so libAliHLTUtil.so"); | |
381 | return fClustersDataHandler; | |
382 | } | |
383 | ||
73449074 | 384 | // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format |
385 | // in a kChain HLTOUT handler | |
386 | if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) { | |
387 | if (fTracksegsDataHandler==NULL) | |
388 | fTracksegsDataHandler=new AliHLTOUTHandlerChain("chains=TPC-hltout-tracksegs-esd-converter"); | |
389 | return fTracksegsDataHandler; | |
390 | } | |
391 | ||
392 | // afterburner for {'TRACKS ':'TPC '} block to be converted to ESD format | |
393 | // there is only one data block | |
394 | if (dt==AliHLTTPCDefinitions::fgkTracksDataType) { | |
395 | return new AliHLTOUTHandlerChain("chains=TPC-hltout-tracks-esd-converter"); | |
396 | } | |
397 | ||
626bfcc1 | 398 | return NULL; |
399 | } | |
400 | ||
401 | int AliHLTTPCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) | |
402 | { | |
403 | // see header file for class documentation | |
404 | if (pInstance==NULL) return -EINVAL; | |
405 | ||
406 | if (pInstance==fRawDataHandler) { | |
73449074 | 407 | delete fRawDataHandler; |
408 | fRawDataHandler=NULL; | |
409 | } | |
410 | ||
411 | if (pInstance==fTracksegsDataHandler) { | |
412 | delete fTracksegsDataHandler; | |
413 | fTracksegsDataHandler=NULL; | |
626bfcc1 | 414 | } |
51e9ec2a | 415 | |
416 | if (pInstance==fClustersDataHandler) { | |
417 | delete fClustersDataHandler; | |
418 | fClustersDataHandler=NULL; | |
419 | } | |
420 | ||
626bfcc1 | 421 | return 0; |
422 | } | |
423 | ||
424 | AliHLTTPCAgent::AliHLTTPCRawDataHandler::AliHLTTPCRawDataHandler() | |
425 | { | |
426 | // see header file for class documentation | |
427 | } | |
428 | ||
429 | AliHLTTPCAgent::AliHLTTPCRawDataHandler::~AliHLTTPCRawDataHandler() | |
430 | { | |
431 | // see header file for class documentation | |
432 | } | |
433 | ||
434 | int AliHLTTPCAgent::AliHLTTPCRawDataHandler::ProcessData(AliHLTOUT* pData) | |
435 | { | |
436 | // see header file for class documentation | |
437 | if (!pData) return -EINVAL; | |
438 | AliHLTComponentDataType dt=kAliHLTVoidDataType; | |
439 | AliHLTUInt32_t spec=kAliHLTVoidDataSpec; | |
440 | int iResult=pData->GetDataBlockDescription(dt, spec); | |
441 | if (iResult>=0) { | |
442 | int slice=AliHLTTPCDefinitions::GetMinSliceNr(spec); | |
443 | int part=AliHLTTPCDefinitions::GetMinPatchNr(spec); | |
444 | if (slice==AliHLTTPCDefinitions::GetMaxSliceNr(spec) && | |
445 | part==AliHLTTPCDefinitions::GetMaxPatchNr(spec)) { | |
446 | iResult=768; | |
447 | if (part>1) iResult+=72+4*slice+(part-2); | |
448 | else iResult+=2*slice+part; | |
449 | } else { | |
450 | HLTError("handler can not process merged data from multiple ddls:" | |
451 | " min slice %d, max slice %d, min part %d, max part %d", | |
452 | slice, AliHLTTPCDefinitions::GetMaxSliceNr(spec), | |
453 | part, AliHLTTPCDefinitions::GetMaxPatchNr(spec)); | |
454 | iResult=-EBADMSG; | |
455 | } | |
456 | } | |
457 | return iResult; | |
458 | } |