3 //**************************************************************************
4 //* This file is property of and copyright by the *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
9 //* Permission to use, copy, modify and distribute this software and its *
10 //* documentation strictly for non-commercial purposes is hereby granted *
11 //* without fee, provided that the above copyright notice appears in all *
12 //* copies and that both the copyright notice and this permission notice *
13 //* appear in the supporting documentation. The authors make no claims *
14 //* about the suitability of this software for any purpose. It is *
15 //* provided "as is" without express or implied warranty. *
16 //**************************************************************************
18 // @file AliHLTTPCAgent.cxx
19 // @author Matthias Richter
21 // @brief Agent of the libAliHLTTPC library
24 #include "AliHLTTPCAgent.h"
25 #include "AliHLTTPCDefinitions.h"
26 #include "AliHLTOUT.h"
27 #include "AliHLTOUTHandlerChain.h"
28 #include "AliHLTMisc.h"
29 #include "AliRunLoader.h"
30 #include "AliCDBManager.h"
31 #include "AliCDBEntry.h"
32 #include "AliTPCParam.h"
33 #include "AliTPCRecoParam.h"
36 /** global instance for agent registration */
37 AliHLTTPCAgent gAliHLTTPCAgent;
40 #include "AliHLTTPCCAInputDataCompressorComponent.h"
41 #include "AliHLTTPCCATrackerComponent.h"
42 #include "AliHLTTPCCATrackerOutputConverter.h"
43 #include "AliHLTTPCTrackMCMarkerComponent.h"
44 #include "AliHLTTPCCAGlobalMergerComponent.h"
45 #include "AliHLTTPCdEdxComponent.h"
46 #include "AliHLTTPCdEdxMonitoringComponent.h"
47 #include "AliHLTTPCClusterFinderComponent.h"
48 #include "AliHLTTPCDigitPublisherComponent.h"
49 #include "AliHLTTPCDigitDumpComponent.h"
50 #include "AliHLTTPCClusterDumpComponent.h"
51 #include "AliHLTTPCClusterHistoComponent.h"
52 #include "AliHLTTPCHistogramHandlerComponent.h"
53 #include "AliHLTTPCTrackHistoComponent.h"
54 #include "AliHLTTPCTrackDumpComponent.h"
55 #include "AliHLTTPCHWCFDataReverterComponent.h"
56 #include "AliHLTTPCHWClusterTransformComponent.h"
57 #include "AliHLTTPCCFComparisonComponent.h"
58 #include "AliHLTTPCDataCheckerComponent.h"
59 #include "AliHLTTPCHWCFEmulatorComponent.h"
60 #include "AliHLTTPCHWCFConsistencyControlComponent.h"
61 #include "AliHLTTPCDataCompressionComponent.h"
62 #include "AliHLTTPCDataCompressionMonitorComponent.h"
63 #include "AliHLTTPCDataCompressionFilterComponent.h"
64 #include "AliHLTTPCDataPublisherComponent.h"
65 #include "AliHLTTPCHWClusterDecoderComponent.h"
66 #include "AliHLTTPCClusterTransformationComponent.h"
68 /** ROOT macro for the implementation of ROOT specific class methods */
69 ClassImp(AliHLTTPCAgent)
71 AliHLTTPCAgent::AliHLTTPCAgent()
72 : AliHLTModuleAgent("TPC")
73 , fRawDataHandler(NULL)
74 , fTracksegsDataHandler(NULL)
75 , fClustersDataHandler(NULL)
76 , fCompressionMonitorHandler(NULL)
78 // see header file for class documentation
80 // refer to README to build package
82 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
85 AliHLTTPCAgent::~AliHLTTPCAgent()
87 // see header file for class documentation
90 int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
91 AliRawReader* rawReader,
92 AliRunLoader* runloader) const
94 // see header file for class documentation
96 // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
97 // AliReconstruction: indicated by runloader==NULL, run always on raw data
98 bool bPublishRaw=rawReader!=NULL || runloader==NULL;
100 // This the tracking configuration for the full TPC
101 // - 216 clusterfinders (1 per partition)
102 // - 36 slice trackers
103 // - one global merger
104 // - the esd converter
105 // The ESD is shipped embedded into a TTree
113 TString sinkHWClusterInput;
115 TString hwclustOutput;
116 TString compressorInput;
117 TString trackerInput;
120 arg.Form("-publish-raw filtered");
121 handler->CreateConfiguration("TPC-DP", "TPCDataPublisher", NULL , arg.Data());
123 for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
124 for (int part=iMinPart; part<=iMaxPart; part++) {
127 // digit publisher components
128 publisher.Form("TPC-DP_%02d_%d", slice, part);
130 // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
131 // AliReconstruction: indicated by runloader==NULL, run always on raw data
133 if (part>1) ddlno+=72+4*slice+(part-2);
134 else ddlno+=2*slice+part;
135 arg.Form("-datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", slice, slice, part, part);
136 handler->CreateConfiguration(publisher.Data(), "BlockFilter", "TPC-DP" , arg.Data());
137 if (sinkRawData.Length()>0) sinkRawData+=" ";
138 sinkRawData+=publisher;
140 arg.Form("-slice %d -partition %d", slice, part);
141 handler->CreateConfiguration(publisher.Data(), "TPCDigitPublisher", NULL , arg.Data());
144 // Hardware CF emulator
146 hwcfemu.Form("TPC-HWCFEmu_%02d_%d", slice, part);
148 if (!bPublishRaw) arg+=" -do-mc 1";
149 handler->CreateConfiguration(hwcfemu.Data(), "TPCHWClusterFinderEmulator", publisher.Data(), arg.Data());
150 if (hwclustOutput.Length()>0) hwclustOutput+=" ";
151 hwclustOutput+=hwcfemu;
154 hwcf.Form("TPC-HWCF_%02d_%d", slice, part);
155 handler->CreateConfiguration(hwcf.Data(), "TPCHWClusterTransform",hwcfemu.Data(), "-publish-raw");
157 //if (trackerInput.Length()>0) trackerInput+=" ";
158 //trackerInput+=hwcf;
159 //if (dEdXInput.Length()>0) dEdXInput+=" ";
161 //if (sinkHWClusterInput.Length()>0) sinkHWClusterInput+=" ";
162 //sinkHWClusterInput+=hwcf;
166 TString hwcfDecoder = "TPC-HWCFDecoder";
167 handler->CreateConfiguration(hwcfDecoder.Data(), "TPCHWClusterDecoder",hwclustOutput.Data(), "");
169 TString clusterTransformation = "TPC-ClusterTransformation";
170 handler->CreateConfiguration(clusterTransformation.Data(), "TPCClusterTransformation",hwcfDecoder.Data(), "");
172 if (trackerInput.Length()>0) trackerInput+=" ";
173 trackerInput+=clusterTransformation;
174 if (dEdXInput.Length()>0) dEdXInput+=" ";
175 dEdXInput+=clusterTransformation;
176 if (sinkHWClusterInput.Length()>0) sinkHWClusterInput+=" ";
177 sinkHWClusterInput+=clusterTransformation;
179 // tracker finder component
180 // 2012-01-05 changing the configuration according to online setup
181 // the tracking strategy has been changed in the online system in Sep 2011
182 // the tracker now processes all clusters, and several of this 'global' trackers
183 // run in parallel. The GlobalMerger is still in the chain as it produces the final
186 tracker.Form("TPC-TR");
187 handler->CreateConfiguration(tracker.Data(), "TPCCATracker", trackerInput.Data(), "-GlobalTracking");
189 if (mergerInput.Length()>0) mergerInput+=" ";
190 mergerInput+=tracker;
192 // GlobalMerger component
193 handler->CreateConfiguration("TPC-globalmerger","TPCCAGlobalMerger",mergerInput.Data(),"");
196 if (dEdXInput.Length()>0) dEdXInput+=" ";
197 dEdXInput+="TPC-globalmerger";
199 handler->CreateConfiguration("TPC-dEdx","TPCdEdx",dEdXInput.Data(),"");
201 // compression component
202 if (compressorInput.Length()>0) compressorInput+=" ";
203 //compressorInput+=hwclustOutput;
204 compressorInput+=hwcfDecoder;
206 // special configuration to run the emulation automatically if the compressed clusters
207 // of a particular partition is missing. This configuration is announced for reconstruction
208 // of raw data if the HLT mode of the TPC reconstruction is enabled. Compression component
209 // always needs to run in mode 1. Even if the recorded data is mode 3 (optimized partition
210 // clusters), 2 (track model compression), or 4. The emulation can not be in mode 2 or 4,
211 // since the track model block can not be identified with a partition. Have to duplicate the
212 // configuration of the compression component
213 handler->CreateConfiguration("TPC-compression-emulation", "TPCDataCompressor", compressorInput.Data(), "-mode 1");
215 if (compressorInput.Length()>0) compressorInput+=" ";
216 compressorInput+="TPC-globalmerger";
217 handler->CreateConfiguration("TPC-compression", "TPCDataCompressor", compressorInput.Data(), "");
218 handler->CreateConfiguration("TPC-compression-huffman-trainer", "TPCDataCompressor", compressorInput.Data(),"-deflater-mode 3");
219 handler->CreateConfiguration("TPC-compression-monitoring-component", "TPCDataCompressorMonitor", "TPC-compression TPC-hwcfdata","-pushback-period=30");
220 handler->CreateConfiguration("TPC-compression-monitoring", "ROOTFileWriter", "TPC-compression-monitoring-component","-concatenate-events -overwrite -datafile HLT.TPCDataCompression-statistics.root");
222 // the esd converter configuration
223 TString converterInput="TPC-globalmerger";
225 // propagate cluster info to the esd converter in order to fill the MC information
226 handler->CreateConfiguration("TPC-clustermc-info", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLMCINFO' 'TPC '");
227 handler->CreateConfiguration("TPC-mcTrackMarker","TPCTrackMCMarker","TPC-globalmerger TPC-clustermc-info","" );
229 converterInput+="TPC-mcTrackMarker";
231 handler->CreateConfiguration("TPC-esd-converter", "TPCEsdConverter" , converterInput.Data(), "");
233 // cluster dump collection
234 handler->CreateConfiguration("TPC-clusters", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC ' -datatype 'CLMCINFO' 'TPC '");
235 handler->CreateConfiguration("TPC-raw-clusters", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLUSTRAW' 'TPC ' -datatype 'CLMCINFO' 'TPC '");
236 handler->CreateConfiguration("TPC-hwclusters", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC ' -datatype 'CLMCINFO' 'TPC '");
237 handler->CreateConfiguration("TPC-raw-hwclusters", "BlockFilter" , sinkHWClusterInput.Data(), "-datatype 'CLUSTRAW' 'TPC ' -datatype 'CLMCINFO' 'TPC '");
240 handler->CreateConfiguration("TPC-raw-data", "BlockFilter" , sinkRawData.Data(), "");
242 handler->CreateConfiguration("TPC-hwcfdata", "BlockFilter" , hwclustOutput.Data(), "-datatype 'HWCLUST1' 'TPC '");
244 /////////////////////////////////////////////////////////////////////////////////////
246 // dumps on the ALTRO digit level
248 // selected channel dump
249 arg.Form("-datafile selected-channel.dump -specfmt=_0x%%08x -subdir -blcknofmt= -idfmt=");
250 handler->CreateConfiguration("TPC-selected-altro-digits", "TPCDigitDump", "RCU-channelselect", arg.Data());
253 arg.Form("-datafile channel.dump -specfmt=_0x%%08x -subdir -blcknofmt= -idfmt=");
254 handler->CreateConfiguration("TPC-raw-altro-digits", "TPCDigitDump", "TPC-raw-data", arg.Data());
256 /////////////////////////////////////////////////////////////////////////////////////
258 // a kChain HLTOUT configuration for processing of {'TRAKSEGS':'TPC '} data blocks
259 // collects the data blocks, merges the tracks and produces an ESD object
261 // publisher component
262 handler->CreateConfiguration("TPC-hltout-tracksegs-publisher", "AliHLTOUTPublisher" , NULL, "");
264 // GlobalMerger component
265 handler->CreateConfiguration("TPC-hltout-tracksegs-merger", "TPCGlobalMerger", "TPC-hltout-tracksegs-publisher", "");
267 // the esd converter configuration
268 handler->CreateConfiguration("TPC-hltout-tracksegs-esd-converter", "TPCEsdConverter", "TPC-hltout-tracksegs-merger", "");
270 /////////////////////////////////////////////////////////////////////////////////////
272 // a kChain HLTOUT configuration for processing of {'TRACKS ':'TPC '} data blocks
273 // produces an ESD object from the track structure
275 // publisher component
276 handler->CreateConfiguration("TPC-hltout-tracks-publisher", "AliHLTOUTPublisher" , NULL, "");
278 // the esd converter configuration
279 handler->CreateConfiguration("TPC-hltout-tracks-esd-converter", "TPCEsdConverter", "TPC-hltout-tracks-publisher", "");
281 /////////////////////////////////////////////////////////////////////////////////////
283 // a kChain HLTOUT configuration for processing of {'CLUSTERS':'TPC '} data blocks
284 // stores the blocks in file HLT.TPC.Clusters.root in HOMER format
286 // publisher component
287 handler->CreateConfiguration("TPC-hltout-cluster-publisher", "AliHLTOUTPublisher" , NULL, "");
289 // the HLTOUT component collects the blocks and stores the file
290 handler->CreateConfiguration("TPC-hltout-cluster-dump", "HLTOUT", "TPC-hltout-cluster-publisher", "-digitfile HLT.TPC.Clusters.root -rawout=off -links 2");
292 /////////////////////////////////////////////////////////////////////////////////////
294 // monitoring of compressed TPC data {CLUSTRAW:TPC }, {REMCLSCM,TPC }, {CLSTRKCM,TPC }
297 // publisher component
298 handler->CreateConfiguration("TPC-hltout-compressionmonitor-publisher", "AliHLTOUTPublisher" , NULL,
299 "-datatype HWCLUST1 'TPC ' "
300 "-datatype CLUSTRAW 'TPC ' "
301 "-datatype REMCLSCM 'TPC ' "
302 "-datatype CLSTRKCM 'TPC ' "
303 "-datatype REMCLIDS 'TPC ' "
304 "-datatype CLIDSTRK 'TPC ' "
307 // the HLTOUT component collects the blocks and stores the file
308 handler->CreateConfiguration("TPC-hltout-compressionmonitor", "TPCDataCompressorMonitor", "TPC-hltout-compressionmonitor-publisher", "-histogram-file HLT.TPC-compression-statistics.root -publishing-mode off");
314 const char* AliHLTTPCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
315 AliRunLoader* runloader) const
317 // see header file for class documentation
319 // reconstruction chains for AliRoot simulation
320 return "TPC-compression";
322 return "TPC-compression-emulation";
327 const char* AliHLTTPCAgent::GetRequiredComponentLibraries() const
329 // see header file for class documentation
331 // actually, the TPC library has dependencies to Util and RCU
332 // so the two has to be loaded anyhow before we get here
333 //return "libAliHLTUtil.so libAliHLTRCU.so";
334 return "libAliHLTUtil.so";
337 int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
339 // see header file for class documentation
340 if (!pHandler) return -EINVAL;
342 pHandler->AddComponent(new AliHLTTPCCAInputDataCompressorComponent);
343 pHandler->AddComponent(new AliHLTTPCCATrackerComponent);
344 pHandler->AddComponent(new AliHLTTPCCATrackerOutputConverter);
345 pHandler->AddComponent(new AliHLTTPCCAGlobalMergerComponent);
346 pHandler->AddComponent(new AliHLTTPCTrackMCMarkerComponent);
347 pHandler->AddComponent(new AliHLTTPCdEdxComponent);
348 pHandler->AddComponent(new AliHLTTPCdEdxMonitoringComponent);
349 pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderPacked));
350 pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderUnpacked));
351 pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinderDecoder));
352 pHandler->AddComponent(new AliHLTTPCClusterFinderComponent(AliHLTTPCClusterFinderComponent::kClusterFinder32Bit));
353 pHandler->AddComponent(new AliHLTTPCDigitPublisherComponent);
354 pHandler->AddComponent(new AliHLTTPCDigitDumpComponent);
355 pHandler->AddComponent(new AliHLTTPCClusterDumpComponent);
356 pHandler->AddComponent(new AliHLTTPCClusterHistoComponent);
357 pHandler->AddComponent(new AliHLTTPCHistogramHandlerComponent);
358 pHandler->AddComponent(new AliHLTTPCTrackHistoComponent);
359 pHandler->AddComponent(new AliHLTTPCTrackDumpComponent);
360 pHandler->AddComponent(new AliHLTTPCHWCFDataReverterComponent);
361 pHandler->AddComponent(new AliHLTTPCHWClusterTransformComponent);
362 pHandler->AddComponent(new AliHLTTPCCFComparisonComponent);
363 pHandler->AddComponent(new AliHLTTPCDataCheckerComponent);
364 pHandler->AddComponent(new AliHLTTPCHWCFEmulatorComponent);
365 // pHandler->AddComponent(new AliHLTTPCHWCFConsistencyControlComponent); //FIXME: Causes crash: https://savannah.cern.ch/bugs/?83677
366 pHandler->AddComponent(new AliHLTTPCDataCompressionComponent);
367 pHandler->AddComponent(new AliHLTTPCDataCompressionMonitorComponent);
368 pHandler->AddComponent(new AliHLTTPCDataCompressionFilterComponent);
369 pHandler->AddComponent(new AliHLTTPCDataPublisherComponent);
370 pHandler->AddComponent(new AliHLTTPCHWClusterDecoderComponent);
371 pHandler->AddComponent(new AliHLTTPCClusterTransformationComponent);
375 int AliHLTTPCAgent::GetHandlerDescription(AliHLTComponentDataType dt,
377 AliHLTOUTHandlerDesc& desc) const
379 // see header file for class documentation
381 // raw data blocks to be fed into offline reconstruction
382 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC)) {
383 int slice=AliHLTTPCDefinitions::GetMinSliceNr(spec);
384 int part=AliHLTTPCDefinitions::GetMinPatchNr(spec);
385 if (slice==AliHLTTPCDefinitions::GetMaxSliceNr(spec) &&
386 part==AliHLTTPCDefinitions::GetMaxPatchNr(spec)) {
387 desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
390 HLTWarning("handler can not process merged data from multiple ddls:"
391 " min slice %d, max slice %d, min part %d, max part %d",
392 slice, AliHLTTPCDefinitions::GetMaxSliceNr(spec),
393 part, AliHLTTPCDefinitions::GetMaxPatchNr(spec));
398 // dump for {'CLUSTERS':'TPC '} blocks stored in a 'digit' file
399 if (dt==AliHLTTPCDefinitions::fgkClustersDataType) {
400 desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
404 // define handlers for all blocks related to compression, flag if the
405 // cluster id blocks are existing, this will be used to decide
406 // whether to create the handler or not
407 // {'CLUSTRAW':'TPC '}
408 // {'HWCLUST1':'TPC '}
409 // {'REMCLSCM':'TPC '}
410 // {'CLSTRKCM':'TPC '}
411 // {'REMCLIDS':'TPC '}
412 // {'CLIDSTRK':'TPC '}
413 if (dt==AliHLTTPCDefinitions::RawClustersDataType() ||
414 dt==AliHLTTPCDefinitions::HWClustersDataType() ||
415 dt==AliHLTTPCDefinitions::RemainingClustersCompressedDataType() ||
416 dt==AliHLTTPCDefinitions::ClusterTracksCompressedDataType()) {
417 desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
420 if (dt==AliHLTTPCDefinitions::RemainingClusterIdsDataType() ||
421 dt==AliHLTTPCDefinitions::ClusterIdTracksDataType()) {
422 desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
423 const_cast<AliHLTTPCAgent*>(this)->SetBit(kHaveCompressedClusterIdDataBlock);
427 // {'CLMCINFO':'TPC '}
428 if (dt==AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo) {
429 desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
433 // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format
434 if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) {
435 desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
439 // afterburner for {'TRACKS ':'TPC '} block to be converted to ESD format
440 // there is only one data block
441 if (dt==AliHLTTPCDefinitions::fgkTracksDataType) {
442 desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
448 AliHLTOUTHandler* AliHLTTPCAgent::GetOutputHandler(AliHLTComponentDataType dt,
449 AliHLTUInt32_t /*spec*/)
451 // see header file for class documentation
453 // raw data blocks to be fed into offline reconstruction
454 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC)) {
455 if (!fRawDataHandler) {
456 fRawDataHandler=new AliHLTTPCAgent::AliHLTTPCRawDataHandler;
458 return fRawDataHandler;
461 // dump for {'CLUSTERS':'TPC '}, stored in a file HLT.TPC.Clusters.root in HOMER format
462 if (dt==AliHLTTPCDefinitions::fgkClustersDataType) {
463 if (fClustersDataHandler==NULL)
464 fClustersDataHandler=new AliHLTOUTHandlerChain("chains=TPC-hltout-cluster-dump libHLTsim.so libAliHLTUtil.so");
465 return fClustersDataHandler;
468 // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format
469 // in a kChain HLTOUT handler
470 if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) {
471 if (fTracksegsDataHandler==NULL)
472 fTracksegsDataHandler=new AliHLTOUTHandlerChain("chains=TPC-hltout-tracksegs-esd-converter");
473 return fTracksegsDataHandler;
476 // afterburner for {'TRACKS ':'TPC '} block to be converted to ESD format
477 // there is only one data block
478 if (dt==AliHLTTPCDefinitions::fgkTracksDataType) {
479 return new AliHLTOUTHandlerChain("chains=TPC-hltout-tracks-esd-converter");
482 // monitoring of compressed data if cluster verification blocks exist
483 // {'REMCLIDS':'TPC '}
484 // {'CLIDSTRK':'TPC '}
485 // FIXME: needs to be commissioned
486 // if (dt==AliHLTTPCDefinitions::RawClustersDataType() ||
487 // dt==AliHLTTPCDefinitions::HWClustersDataType() ||
488 // dt==AliHLTTPCDefinitions::RemainingClustersCompressedDataType() ||
489 // dt==AliHLTTPCDefinitions::ClusterTracksCompressedDataType() ||
490 // dt==AliHLTTPCDefinitions::RemainingClusterIdsDataType() ||
491 // dt==AliHLTTPCDefinitions::ClusterIdTracksDataType()) {
492 // const char* arg="chains=TPC-hltout-compressionmonitor";
493 // if (!TestBit(kHaveCompressedClusterIdDataBlock))
494 // arg="chains=TPC-hltout-compressionmonitorpublisher";
495 // if (!fCompressionMonitorHandler)
496 // fCompressionMonitorHandler=new AliHLTOUTHandlerChain(arg);
497 // return fCompressionMonitorHandler;
503 int AliHLTTPCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
505 // see header file for class documentation
506 if (pInstance==NULL) return -EINVAL;
508 if (pInstance==fRawDataHandler) {
509 delete fRawDataHandler;
510 fRawDataHandler=NULL;
513 if (pInstance==fTracksegsDataHandler) {
514 delete fTracksegsDataHandler;
515 fTracksegsDataHandler=NULL;
518 if (pInstance==fClustersDataHandler) {
519 delete fClustersDataHandler;
520 fClustersDataHandler=NULL;
523 if (pInstance==fCompressionMonitorHandler) {
524 delete fCompressionMonitorHandler;
525 fCompressionMonitorHandler=NULL;
531 AliHLTTPCAgent::AliHLTTPCRawDataHandler::AliHLTTPCRawDataHandler()
533 // see header file for class documentation
536 AliHLTTPCAgent::AliHLTTPCRawDataHandler::~AliHLTTPCRawDataHandler()
538 // see header file for class documentation
541 int AliHLTTPCAgent::AliHLTTPCRawDataHandler::ProcessData(AliHLTOUT* pData)
543 // see header file for class documentation
544 if (!pData) return -EINVAL;
545 AliHLTComponentDataType dt=kAliHLTVoidDataType;
546 AliHLTUInt32_t spec=kAliHLTVoidDataSpec;
547 int iResult=pData->GetDataBlockDescription(dt, spec);
549 int slice=AliHLTTPCDefinitions::GetMinSliceNr(spec);
550 int part=AliHLTTPCDefinitions::GetMinPatchNr(spec);
551 if (slice==AliHLTTPCDefinitions::GetMaxSliceNr(spec) &&
552 part==AliHLTTPCDefinitions::GetMaxPatchNr(spec)) {
554 if (part>1) iResult+=72+4*slice+(part-2);
555 else iResult+=2*slice+part;
557 HLTError("handler can not process merged data from multiple ddls:"
558 " min slice %d, max slice %d, min part %d, max part %d",
559 slice, AliHLTTPCDefinitions::GetMaxSliceNr(spec),
560 part, AliHLTTPCDefinitions::GetMaxPatchNr(spec));