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