]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
A new task for measuring the size of the beam interaction spot (A.Jacholkowski)
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCClusterFinderComponent.cxx
... / ...
CommitLineData
1// $Id$
2
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: Timm Steinbeck, Matthias Richter *
8//* Developers: Kenneth Aamodt <kenneth.aamodt@student.uib.no> *
9//* for The ALICE HLT Project. *
10//* *
11//* Permission to use, copy, modify and distribute this software and its *
12//* documentation strictly for non-commercial purposes is hereby granted *
13//* without fee, provided that the above copyright notice appears in all *
14//* copies and that both the copyright notice and this permission notice *
15//* appear in the supporting documentation. The authors make no claims *
16//* about the suitability of this software for any purpose. It is *
17//* provided "as is" without express or implied warranty. *
18//**************************************************************************
19
20/** @file AliHLTTPCClusterFinderComponent.cxx
21 @author Kenneth Aamodt <kenneth.aamodt@student.uib.no>
22 @date
23 @brief The TPC cluster finder processing component
24*/
25
26#if __GNUC__>= 3
27using namespace std;
28#endif
29#include "AliHLTTPCClusterFinderComponent.h"
30#include "AliHLTTPCDigitReaderPacked.h"
31#include "AliHLTTPCDigitReaderUnpacked.h"
32#include "AliHLTTPCDigitReaderDecoder.h"
33#include "AliHLTTPCDigitReader32Bit.h"
34#include "AliHLTTPCClusterFinder.h"
35#include "AliHLTTPCSpacePointData.h"
36#include "AliHLTTPCClusterDataFormat.h"
37#include "AliHLTTPCTransform.h"
38#include "AliHLTTPCClusters.h"
39#include "AliHLTTPCDefinitions.h"
40#include "AliCDBEntry.h"
41#include "AliCDBManager.h"
42#include "AliTPCcalibDB.h"
43#include "AliTPCCalPad.h"
44#include "AliTPCParam.h"
45
46#include <cstdlib>
47#include <cerrno>
48#include "TString.h"
49#include "TObjString.h"
50#include "TObjArray.h"
51#include "AliCDBEntry.h"
52#include "AliCDBManager.h"
53#include "AliCDBStorage.h"
54
55#include <sys/time.h>
56
57/** ROOT macro for the implementation of ROOT specific class methods */
58ClassImp(AliHLTTPCClusterFinderComponent)
59
60AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
61 :
62 fClusterFinder(NULL),
63 fReader(NULL),
64 fDeconvTime(kFALSE),
65 fDeconvPad(kFALSE),
66 fClusterDeconv(false),
67 fXYClusterError(-1),
68 fZClusterError(-1),
69 fModeSwitch(mode),
70 fUnsorted(1),
71 fPatch(0),
72 fGetActivePads(0),
73 fFirstTimeBin(-1),
74 fLastTimeBin(-1),
75 fDoMC(kFALSE)
76{
77 // see header file for class documentation
78 // or
79 // refer to README to build package
80 // or
81 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
82 if (fModeSwitch!=kClusterFinderPacked &&
83 fModeSwitch!=kClusterFinderUnpacked &&
84 fModeSwitch!=kClusterFinderDecoder &&
85 fModeSwitch!=kClusterFinder32Bit) {
86 HLTFatal("unknown digit reader type");
87 }
88}
89
90AliHLTTPCClusterFinderComponent::~AliHLTTPCClusterFinderComponent()
91{
92 // see header file for class documentation
93}
94
95// Public functions to implement AliHLTComponent's interface.
96// These functions are required for the registration process
97
98const char* AliHLTTPCClusterFinderComponent::GetComponentID()
99{
100 // see header file for class documentation
101 switch(fModeSwitch){
102 case kClusterFinderPacked:
103 return "TPCClusterFinderPacked";
104 break;
105 case kClusterFinderUnpacked:
106 return "TPCClusterFinderUnpacked";
107 break;
108 case kClusterFinderDecoder:
109 return "TPCClusterFinderDecoder";
110 break;
111 case kClusterFinder32Bit:
112 return "TPCClusterFinder32Bit";
113 break;
114 }
115 return "";
116}
117
118void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
119{
120 // see header file for class documentation
121 list.clear();
122 switch(fModeSwitch){
123 case kClusterFinderPacked:
124 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
125 break;
126 case kClusterFinderUnpacked:
127 list.push_back( AliHLTTPCDefinitions::fgkUnpackedRawDataType );
128 break;
129 case kClusterFinderDecoder:
130 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
131 break;
132 case kClusterFinder32Bit:
133 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
134 break;
135 }
136}
137
138AliHLTComponentDataType AliHLTTPCClusterFinderComponent::GetOutputDataType()
139{
140 // see header file for class documentation
141 return kAliHLTMultipleDataType;
142}
143
144int AliHLTTPCClusterFinderComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList)
145
146{
147 // see header file for class documentation
148 tgtList.clear();
149 tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
150 tgtList.push_back(kAliHLTDataTypeHwAddr16);
151 return tgtList.size();
152}
153
154void AliHLTTPCClusterFinderComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
155{
156 // see header file for class documentation
157 // XXX TODO: Find more realistic values.
158 constBase = 0;
159 switch(fModeSwitch){
160 case kClusterFinderPacked:
161 inputMultiplier = (6 * 0.4);
162 break;
163 case kClusterFinderUnpacked:
164 inputMultiplier = 0.4;
165 break;
166 case kClusterFinderDecoder:
167 inputMultiplier = (6 * 0.4);
168 break;
169 case kClusterFinder32Bit:
170 inputMultiplier = (6 * 0.4);
171 break;
172 }
173}
174
175AliHLTComponent* AliHLTTPCClusterFinderComponent::Spawn()
176{
177 // see header file for class documentation
178 return new AliHLTTPCClusterFinderComponent(fModeSwitch);
179}
180
181int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
182{
183 // see header file for class documentation
184 if ( fClusterFinder )
185 return EINPROGRESS;
186
187 //Test if the OCDB entries used by AliTPCTransform is availible
188 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
189 //
190 AliTPCCalPad * time0TPC = calib->GetPadTime0();
191 if(!time0TPC){
192 HLTError("OCDB entry TPC/Calib/PadTime0 (AliTPCcalibDB::GetPadTime0()) is not available.");
193 return -ENOENT;
194 }
195
196 AliTPCParam * param = calib->GetParameters();
197 if(!param){
198 HLTError("OCDB entry TPC/Calib/Parameters (AliTPCcalibDB::GetParameters()) is not available.");
199 return -ENOENT;
200 }
201
202
203 fClusterFinder = new AliHLTTPCClusterFinder();
204
205 Int_t iResult=0;
206 TString configuration="";
207 TString argument="";
208 for (int i=0; i<argc && iResult>=0; i++) {
209 argument=argv[i];
210 if (!configuration.IsNull()) configuration+=" ";
211 configuration+=argument;
212 }
213
214 if (!configuration.IsNull()) {
215 iResult=Configure(configuration.Data());
216 } else {
217 iResult=Reconfigure(NULL, NULL);
218 }
219
220 //Checking for conflicting arguments
221 if(fClusterDeconv){
222 if(fDeconvPad==kTRUE || fDeconvTime==kTRUE){
223 HLTWarning("Conflicting arguments: argument 'pp-run' will be ignored.");
224 }
225 }
226 if(fClusterFinder->GetOccupancyLimit()!=1.0 && fUnsorted){
227 HLTWarning("Argument 'occupancy-limit' is deprecated when doing unsorted data reading.");
228 }
229 if(fGetActivePads==kTRUE && fUnsorted==kFALSE){
230 HLTWarning("Argument '-active-pads' only work with unsorted data reading. Active pads list will not be produced.");
231 }
232
233
234 // Choose reader
235 if (fModeSwitch==kClusterFinderPacked) {
236 HLTDebug("using AliHLTTPCDigitReaderPacked");
237 fReader = new AliHLTTPCDigitReaderPacked();
238 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
239 fClusterFinder->SetReader(fReader);
240 }
241 else if(fModeSwitch==kClusterFinderUnpacked){
242 HLTDebug("using AliHLTTPCDigitReaderUnpacked");
243 fReader = new AliHLTTPCDigitReaderUnpacked();
244 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
245 fClusterFinder->SetReader(fReader);
246 }
247 else if(fModeSwitch==kClusterFinderDecoder){
248 HLTDebug("using AliHLTTPCDigitReaderDecoder");
249 fReader = new AliHLTTPCDigitReaderDecoder();
250 fClusterFinder->SetReader(fReader);
251 }
252 else if(fModeSwitch==kClusterFinder32Bit){
253 HLTDebug("using AliHLTTPCDigitReader32Bit");
254 fReader = new AliHLTTPCDigitReader32Bit();
255 fClusterFinder->SetReader(fReader);
256 fClusterFinder->Set32BitFormat(kTRUE);
257 }
258 else{
259 HLTFatal("No mode set for clusterfindercomponent");
260 }
261
262 if(fClusterDeconv){
263 fClusterFinder->SetOccupancyLimit(1.0);
264 }
265
266 fClusterFinder->SetDeconv(fClusterDeconv);
267 fClusterFinder->SetDeconvPad(fDeconvPad);
268 fClusterFinder->SetDeconvTime(fDeconvPad);
269 fClusterFinder->SetXYError( fXYClusterError );
270 fClusterFinder->SetZError( fZClusterError );
271 if ( (fXYClusterError>0) && (fZClusterError>0) ){
272 fClusterFinder->SetCalcErr( false );
273 }
274
275 if(fFirstTimeBin>0){
276 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
277 }
278 if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
279 fClusterFinder->SetLastTimeBin(fLastTimeBin);
280 }
281
282 return 0;
283}
284
285int AliHLTTPCClusterFinderComponent::DoDeinit()
286{
287 // see header file for class documentation
288
289 if ( fClusterFinder )
290 delete fClusterFinder;
291 fClusterFinder = NULL;
292
293 if ( fReader )
294 delete fReader;
295 fReader = NULL;
296
297 return 0;
298}
299
300int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& evtData,
301 const AliHLTComponentBlockData* blocks,
302 AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr,
303 AliHLTUInt32_t& size,
304 vector<AliHLTComponentBlockData>& outputBlocks )
305{
306 // see header file for class documentation
307
308 if(fReader == NULL){
309 HLTFatal("Digit reader not initialized, skipping HLT TPC cluster reconstruction.");
310 size=0;
311 return 0;
312 }
313
314 if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )){
315 size=0;
316 return 0;
317 }
318
319 // == init iter (pointer to datablock)
320 const AliHLTComponentBlockData* iter = NULL;
321 unsigned long ndx;
322
323 // == OUTdatatype pointer
324 AliHLTTPCClusterData* outPtr;
325
326 AliHLTUInt8_t* outBPtr;
327 UInt_t offset, mysize, nSize, tSize = 0;
328
329 outBPtr = outputPtr;
330 outPtr = (AliHLTTPCClusterData*)outBPtr;
331
332 Int_t slice, patch;
333 unsigned long maxPoints, realPoints = 0;
334
335 for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
336 {
337 iter = blocks+ndx;
338 mysize = 0;
339 offset = tSize;
340
341
342 if (fModeSwitch==0 || fModeSwitch==2 || fModeSwitch==3) {
343 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
344 evtData.fEventID, evtData.fEventID,
345 DataType2Text( iter->fDataType).c_str(),
346 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
347
348 if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType &&
349 GetEventCount()<2) {
350 HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!",
351 DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(),
352 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
353 }
354
355 if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC) &&
356 iter->fDataType != AliHLTTPCDefinitions::fgkDDLPackedRawDataType ) continue;
357
358 }
359 else if(fModeSwitch==1){
360 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
361 evtData.fEventID, evtData.fEventID,
362 DataType2Text( iter->fDataType).c_str(),
363 DataType2Text(AliHLTTPCDefinitions::fgkUnpackedRawDataType).c_str());
364
365 if ( iter->fDataType != AliHLTTPCDefinitions::fgkUnpackedRawDataType ) continue;
366
367 }
368
369 slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
370 patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
371
372 if(fUnsorted){
373 fClusterFinder->SetUnsorted(fUnsorted);
374 fClusterFinder->SetPatch(patch);
375 }
376
377 outPtr = (AliHLTTPCClusterData*)outBPtr;
378
379 maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
380
381 fClusterFinder->InitSlice( slice, patch, maxPoints );
382 fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
383
384 if(fUnsorted){
385 if(fGetActivePads){
386 fClusterFinder->SetDoPadSelection(kTRUE);
387 }
388 if(fDeconvTime){
389 fClusterFinder->ReadDataUnsortedDeconvoluteTime(iter->fPtr, iter->fSize);
390 }
391 else{
392 fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
393 }
394
395 fClusterFinder->FindClusters();
396 }
397 else{
398 fClusterFinder->Read(iter->fPtr, iter->fSize );
399 fClusterFinder->ProcessDigits();
400 }
401
402 realPoints = fClusterFinder->GetNumberOfClusters();
403
404 outPtr->fSpacePointCnt = realPoints;
405 nSize = sizeof(AliHLTTPCSpacePointData)*realPoints;
406 mysize += nSize+sizeof(AliHLTTPCClusterData);
407
408 Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Spacepoints",
409 "Number of spacepoints: %lu Slice/Patch/RowMin/RowMax: %d/%d/%d/%d.",
410 realPoints, slice, patch,AliHLTTPCTransform::GetFirstRow( patch ) , AliHLTTPCTransform::GetLastRow( patch ) );
411 AliHLTComponentBlockData bd;
412 FillBlockData( bd );
413 bd.fOffset = offset;
414 bd.fSize = mysize;
415 bd.fSpecification = iter->fSpecification;
416 bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType;
417 outputBlocks.push_back( bd );
418
419 tSize += mysize;
420 outBPtr += mysize;
421 outPtr = (AliHLTTPCClusterData*)outBPtr;
422
423
424 if ( tSize > size )
425 {
426 Logging( kHLTLogFatal, "HLT::TPCClusterFinder::DoEvent", "Too much data",
427 "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
428 tSize, size );
429 return -ENOSPC;
430 }
431
432 if(fUnsorted && fGetActivePads){
433 Int_t maxNumberOfHW=(Int_t)((size-tSize)/sizeof(AliHLTUInt16_t)-1);
434 AliHLTUInt16_t* outputHWPtr= (AliHLTUInt16_t*)(outputPtr+tSize);
435 Int_t nHWAdd = fClusterFinder->FillHWAddressList(outputHWPtr, maxNumberOfHW);
436
437 AliHLTComponentBlockData bdHW;
438 FillBlockData( bdHW );
439 bdHW.fOffset = tSize ;
440 bdHW.fSize = nHWAdd*sizeof(AliHLTUInt16_t);
441 bdHW.fSpecification = iter->fSpecification;
442 bdHW.fDataType = kAliHLTDataTypeHwAddr16;
443 outputBlocks.push_back( bdHW );
444
445 tSize+=nHWAdd*sizeof(AliHLTUInt16_t);
446 }
447
448 if(fDoMC){
449 Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize)/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo)-1);
450 AliHLTTPCClusterFinder::ClusterMCInfo* outputMCInfo= (AliHLTTPCClusterFinder::ClusterMCInfo*)(outputPtr+tSize);
451 Int_t nMCInfo = fClusterFinder->FillOutputMCInfo(outputMCInfo, maxNumberOfClusterMCInfo);
452
453 AliHLTComponentBlockData bdMCInfo;
454 FillBlockData( bdMCInfo );
455 bdMCInfo.fOffset = tSize ;
456 bdMCInfo.fSize = nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
457 bdMCInfo.fSpecification = iter->fSpecification;
458 bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
459 outputBlocks.push_back( bdMCInfo );
460
461 tSize+=nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
462
463 }
464
465 fReader->Reset();
466 }
467
468 size = tSize;
469
470 return 0;
471}
472
473int AliHLTTPCClusterFinderComponent::Configure(const char* arguments){
474 // see header file for class documentation
475 int iResult=0;
476 if (!arguments) return iResult;
477
478 TString allArgs=arguments;
479 TString argument;
480 int bMissingParam=0;
481
482 TObjArray* pTokens=allArgs.Tokenize(" ");
483 if (pTokens) {
484
485 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
486 argument=((TObjString*)pTokens->At(i))->GetString();
487
488 if (argument.IsNull()) continue;
489
490 // -- deconvolute-time option
491 if (argument.CompareTo("-deconvolute-time")==0){
492 HLTDebug("Switching on deconvolution in time direction.");
493 fDeconvTime = kTRUE;
494 fClusterFinder->SetDeconvTime(fDeconvTime);
495 }
496 else if (argument.CompareTo("-deconvolute-pad")==0){
497 HLTDebug("Switching on deconvolution in pad direction.");
498 fDeconvPad = kTRUE;
499 fClusterFinder->SetDeconvPad(fDeconvPad);
500 }
501 else if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
502 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
503 AliHLTTPCTransform::SetNTimeBins(((TObjString*)pTokens->At(i))->GetString().Atoi());
504 fClusterFinder->UpdateLastTimeBin();
505 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
506 if(argument.CompareTo("timebins")==0){
507 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
508 }
509 }
510 else if (argument.CompareTo("-first-timebin")==0){
511 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
512 fFirstTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
513 if(fFirstTimeBin>=0){
514 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
515 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
516 }
517 else{
518 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
519 }
520 }
521 else if (argument.CompareTo("-last-timebin")==0){
522 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
523 fLastTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
524 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
525 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
526 }
527 else{
528 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
529 }
530 }
531 else if (argument.CompareTo("-sorted")==0) {
532 fUnsorted=0;
533 HLTDebug("Swithching unsorted off.");
534 fClusterFinder->SetUnsorted(0);
535 }
536 else if (argument.CompareTo("-do-mc")==0) {
537 fDoMC=kTRUE;
538 fClusterFinder->SetDoMC(fDoMC);
539 HLTInfo("Setting fDoMC to true.");
540 }
541 else if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
542 if(argument.CompareTo("activepads" )==0){
543 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
544 }
545 HLTDebug("Switching on ActivePads");
546 fGetActivePads = 1;
547 fClusterFinder->SetDoPadSelection(kTRUE);
548 }
549 else if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
550 if(argument.CompareTo("occupancy-limit" )==0){
551 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
552 }
553 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
554 fClusterFinder->SetOccupancyLimit(((TObjString*)pTokens->At(i))->GetString().Atof());
555 HLTDebug("Occupancy limit set to occulimit %f", ((TObjString*)pTokens->At(i))->GetString().Atof());
556 }
557 else if (argument.CompareTo("rawreadermode")==0){
558 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
559 HLTWarning("Argument 'rawreadermode' is deprecated");
560 }
561 else if (argument.CompareTo("pp-run")==0){
562 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
563 fClusterDeconv = false;
564 }
565 else if (argument.CompareTo("adc-threshold" )==0){
566 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
567 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
568 }
569 else if (argument.CompareTo("oldrcuformat" )==0){
570 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
571 HLTWarning("Argument 'oldrcuformat' is deprecated.");
572 }
573 else if (argument.CompareTo("unsorted" )==0){
574 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
575 HLTDebug("Using unsorted reading.");
576 fClusterFinder->SetUnsorted(1);
577 }
578 else if (argument.CompareTo("nsigma-threshold")==0){
579 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
580 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
581 }
582 else {
583 HLTError("unknown argument %s", argument.Data());
584 iResult=-EINVAL;
585 break;
586 }
587 }
588 delete pTokens;
589 }
590 if (bMissingParam) {
591 HLTError("missing parameter for argument %s", argument.Data());
592 iResult=-EINVAL;
593 }
594 return iResult;
595}
596
597int AliHLTTPCClusterFinderComponent::Reconfigure(const char* cdbEntry, const char* chainId)
598{
599
600 int iResult=0;
601 // see header file for class documentation
602 const char* path="HLT/ConfigTPC/ClusterFinderComponent";
603 if (cdbEntry) path=cdbEntry;
604 if (path) {
605 HLTInfo("reconfigure from entry %s, chain id %s", path, (chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
606 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
607 if (pEntry) {
608 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
609 if (pString) {
610 HLTInfo("received configuration object: %s", pString->GetString().Data());
611 iResult = Configure(pString->GetString().Data());
612 } else {
613 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
614 }
615 } else {
616 HLTError("can not fetch object \"%s\" from CDB", path);
617 }
618 }
619 return iResult;
620}