]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
minor correction: making file path and subversion consistent
[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"
deba5d85 33#include "AliHLTTPCDigitReader32Bit.h"
a38a7850 34#include "AliHLTTPCClusterFinder.h"
a6c02c85 35#include "AliHLTTPCSpacePointData.h"
71d7c760 36#include "AliHLTTPCClusterDataFormat.h"
a6c02c85 37#include "AliHLTTPCTransform.h"
01f43166 38#include "AliHLTTPCClusters.h"
e67b0680 39#include "AliHLTTPCDefinitions.h"
c3cda394 40#include "AliCDBEntry.h"
41#include "AliCDBManager.h"
d9e5f6f3 42#include "AliTPCcalibDB.h"
43#include "AliTPCCalPad.h"
44#include "AliTPCParam.h"
c3cda394 45
e67b0680 46#include <cstdlib>
47#include <cerrno>
ecefc48a 48#include "TString.h"
c3cda394 49#include "TObjString.h"
3f0fd8f1 50#include "TObjArray.h"
51#include "AliCDBEntry.h"
52#include "AliCDBManager.h"
53#include "AliCDBStorage.h"
54
01f43166 55#include <sys/time.h>
71d7c760 56
c3cda394 57/** ROOT macro for the implementation of ROOT specific class methods */
71d7c760 58ClassImp(AliHLTTPCClusterFinderComponent)
59
8252a538 60AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
74c73e5a 61 :
74c73e5a 62 fClusterFinder(NULL),
63 fReader(NULL),
6b15c309 64 fDeconvTime(kFALSE),
65 fDeconvPad(kFALSE),
66 fClusterDeconv(false),
74c73e5a 67 fXYClusterError(-1),
2a083ac4 68 fZClusterError(-1),
8252a538 69 fModeSwitch(mode),
6b15c309 70 fUnsorted(1),
a1dbf058 71 fPatch(0),
6b15c309 72 fGetActivePads(0),
73 fFirstTimeBin(-1),
deba5d85 74 fLastTimeBin(-1),
75 fDoMC(kFALSE)
74c73e5a 76{
2a083ac4 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
aca7e630 82 if (fModeSwitch!=kClusterFinderPacked &&
83 fModeSwitch!=kClusterFinderUnpacked &&
deba5d85 84 fModeSwitch!=kClusterFinderDecoder &&
85 fModeSwitch!=kClusterFinder32Bit) {
aca7e630 86 HLTFatal("unknown digit reader type");
87 }
74c73e5a 88}
89
71d7c760 90AliHLTTPCClusterFinderComponent::~AliHLTTPCClusterFinderComponent()
7e99beb3 91{
2a083ac4 92 // see header file for class documentation
7e99beb3 93}
71d7c760 94
95// Public functions to implement AliHLTComponent's interface.
96// These functions are required for the registration process
97
98const char* AliHLTTPCClusterFinderComponent::GetComponentID()
7e99beb3 99{
2a083ac4 100 // see header file for class documentation
8252a538 101 switch(fModeSwitch){
2efb85be 102 case kClusterFinderPacked:
8252a538 103 return "TPCClusterFinderPacked";
104 break;
d1dbb3c1 105 case kClusterFinderUnpacked:
106 return "TPCClusterFinderUnpacked";
107 break;
2efb85be 108 case kClusterFinderDecoder:
8252a538 109 return "TPCClusterFinderDecoder";
110 break;
deba5d85 111 case kClusterFinder32Bit:
112 return "TPCClusterFinder32Bit";
113 break;
8252a538 114 }
b0914d2e 115 return "";
7e99beb3 116}
71d7c760 117
8ede8717 118void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
7e99beb3 119{
2a083ac4 120 // see header file for class documentation
7e99beb3 121 list.clear();
8252a538 122 switch(fModeSwitch){
2efb85be 123 case kClusterFinderPacked:
8252a538 124 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
125 break;
d1dbb3c1 126 case kClusterFinderUnpacked:
127 list.push_back( AliHLTTPCDefinitions::fgkUnpackedRawDataType );
128 break;
2efb85be 129 case kClusterFinderDecoder:
8252a538 130 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
131 break;
deba5d85 132 case kClusterFinder32Bit:
133 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
134 break;
8252a538 135 }
7e99beb3 136}
71d7c760 137
8ede8717 138AliHLTComponentDataType AliHLTTPCClusterFinderComponent::GetOutputDataType()
7e99beb3 139{
2a083ac4 140 // see header file for class documentation
64defa03 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);
2fdb1ae7 150 tgtList.push_back(kAliHLTDataTypeHwAddr16);
64defa03 151 return tgtList.size();
7e99beb3 152}
71d7c760 153
154void AliHLTTPCClusterFinderComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
7e99beb3 155{
2a083ac4 156 // see header file for class documentation
7e99beb3 157 // XXX TODO: Find more realistic values.
158 constBase = 0;
8252a538 159 switch(fModeSwitch){
deba5d85 160 case kClusterFinderPacked:
8252a538 161 inputMultiplier = (6 * 0.4);
162 break;
deba5d85 163 case kClusterFinderUnpacked:
8252a538 164 inputMultiplier = 0.4;
165 break;
deba5d85 166 case kClusterFinderDecoder:
167 inputMultiplier = (6 * 0.4);
168 break;
169 case kClusterFinder32Bit:
8252a538 170 inputMultiplier = (6 * 0.4);
171 break;
172 }
7e99beb3 173}
71d7c760 174
175AliHLTComponent* AliHLTTPCClusterFinderComponent::Spawn()
7e99beb3 176{
2a083ac4 177 // see header file for class documentation
8252a538 178 return new AliHLTTPCClusterFinderComponent(fModeSwitch);
7e99beb3 179}
71d7c760 180
181int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
7e99beb3 182{
2a083ac4 183 // see header file for class documentation
7e99beb3 184 if ( fClusterFinder )
185 return EINPROGRESS;
186
d9e5f6f3 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
7e99beb3 203 fClusterFinder = new AliHLTTPCClusterFinder();
204
3f0fd8f1 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);
7e99beb3 218 }
db16520a 219
6b15c309 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 }
3f0fd8f1 226 if(fClusterFinder->GetOccupancyLimit()!=1.0 && fUnsorted){
6b15c309 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
7e99beb3 234 // Choose reader
51b88d1e 235 if (fModeSwitch==kClusterFinderPacked) {
f44e97dc 236 HLTDebug("using AliHLTTPCDigitReaderPacked");
7e99beb3 237 fReader = new AliHLTTPCDigitReaderPacked();
a912b63b 238 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
7e99beb3 239 fClusterFinder->SetReader(fReader);
7e99beb3 240 }
8e3c15c4 241 else if(fModeSwitch==kClusterFinderUnpacked){
242 HLTDebug("using AliHLTTPCDigitReaderUnpacked");
243 fReader = new AliHLTTPCDigitReaderUnpacked();
deba5d85 244 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
8e3c15c4 245 fClusterFinder->SetReader(fReader);
deba5d85 246 }
2efb85be 247 else if(fModeSwitch==kClusterFinderDecoder){
51b88d1e 248 HLTDebug("using AliHLTTPCDigitReaderDecoder");
8252a538 249 fReader = new AliHLTTPCDigitReaderDecoder();
250 fClusterFinder->SetReader(fReader);
251 }
deba5d85 252 else if(fModeSwitch==kClusterFinder32Bit){
253 HLTDebug("using AliHLTTPCDigitReader32Bit");
254 fReader = new AliHLTTPCDigitReader32Bit();
255 fClusterFinder->SetReader(fReader);
256 fClusterFinder->Set32BitFormat(kTRUE);
257 }
8252a538 258 else{
259 HLTFatal("No mode set for clusterfindercomponent");
260 }
3f0fd8f1 261
262 if(fClusterDeconv){
7e99beb3 263 fClusterFinder->SetOccupancyLimit(1.0);
3f0fd8f1 264 }
6b15c309 265
266 fClusterFinder->SetDeconv(fClusterDeconv);
267 fClusterFinder->SetDeconvPad(fDeconvPad);
268 fClusterFinder->SetDeconvTime(fDeconvPad);
7e99beb3 269 fClusterFinder->SetXYError( fXYClusterError );
270 fClusterFinder->SetZError( fZClusterError );
6b15c309 271 if ( (fXYClusterError>0) && (fZClusterError>0) ){
7e99beb3 272 fClusterFinder->SetCalcErr( false );
6b15c309 273 }
6b15c309 274
275 if(fFirstTimeBin>0){
276 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
277 }
278 if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
279 fClusterFinder->SetLastTimeBin(fLastTimeBin);
280 }
01f43166 281
7e99beb3 282 return 0;
283}
71d7c760 284
285int AliHLTTPCClusterFinderComponent::DoDeinit()
7e99beb3 286{
2a083ac4 287 // see header file for class documentation
a38a7850 288
7e99beb3 289 if ( fClusterFinder )
290 delete fClusterFinder;
291 fClusterFinder = NULL;
a38a7850 292
7e99beb3 293 if ( fReader )
294 delete fReader;
295 fReader = NULL;
a38a7850 296
7e99beb3 297 return 0;
298}
71d7c760 299
8ede8717 300int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& evtData,
301 const AliHLTComponentBlockData* blocks,
5d2abf3b 302 AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr,
a38a7850 303 AliHLTUInt32_t& size,
8ede8717 304 vector<AliHLTComponentBlockData>& outputBlocks )
7e99beb3 305{
2a083ac4 306 // see header file for class documentation
9758b471 307 int iResult=0;
db16520a 308
a912b63b 309 if(fReader == NULL){
998bd503 310 HLTFatal("Digit reader not initialized, skipping HLT TPC cluster reconstruction.");
a912b63b 311 size=0;
312 return 0;
313 }
314
0e588049 315 if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )){
316 size=0;
317 return 0;
318 }
319
7e99beb3 320 // == init iter (pointer to datablock)
321 const AliHLTComponentBlockData* iter = NULL;
322 unsigned long ndx;
a38a7850 323
7e99beb3 324 // == OUTdatatype pointer
325 AliHLTTPCClusterData* outPtr;
a38a7850 326
7e99beb3 327 AliHLTUInt8_t* outBPtr;
328 UInt_t offset, mysize, nSize, tSize = 0;
a38a7850 329
7e99beb3 330 outBPtr = outputPtr;
331 outPtr = (AliHLTTPCClusterData*)outBPtr;
a38a7850 332
a912b63b 333 Int_t slice, patch;
7e99beb3 334 unsigned long maxPoints, realPoints = 0;
a38a7850 335
7e99beb3 336 for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
337 {
338 iter = blocks+ndx;
339 mysize = 0;
340 offset = tSize;
a38a7850 341
2d6b17ff 342 // Kenneth 16. July 2009
343 // 32 byte is the size of the common data header (CDH)
344 // this is introduced as a protection of empty files
345 // normally when running with file publisher where
346 // Timms script is used to create the missing files
347 if(iter->fSize <= 32){
348 continue;
349 }
350
a38a7850 351
deba5d85 352 if (fModeSwitch==0 || fModeSwitch==2 || fModeSwitch==3) {
f69743b7 353 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
354 evtData.fEventID, evtData.fEventID,
355 DataType2Text( iter->fDataType).c_str(),
356 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
a38a7850 357
f69743b7 358 if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType &&
359 GetEventCount()<2) {
360 HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!",
361 DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(),
362 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
363 }
364
365 if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC) &&
366 iter->fDataType != AliHLTTPCDefinitions::fgkDDLPackedRawDataType ) continue;
a38a7850 367
7e99beb3 368 }
8252a538 369 else if(fModeSwitch==1){
f69743b7 370 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
371 evtData.fEventID, evtData.fEventID,
372 DataType2Text( iter->fDataType).c_str(),
373 DataType2Text(AliHLTTPCDefinitions::fgkUnpackedRawDataType).c_str());
aca7e630 374
375 if ( iter->fDataType != AliHLTTPCDefinitions::fgkUnpackedRawDataType ) continue;
376
7e99beb3 377 }
5863c71a 378
7e99beb3 379 slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
380 patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
8252a538 381
aff6e981 382 if(fUnsorted){
8252a538 383 fClusterFinder->SetUnsorted(fUnsorted);
384 fClusterFinder->SetPatch(patch);
aff6e981 385 }
386
7e99beb3 387 outPtr = (AliHLTTPCClusterData*)outBPtr;
a38a7850 388
7e99beb3 389 maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
db16520a 390
a912b63b 391 fClusterFinder->InitSlice( slice, patch, maxPoints );
e83e889b 392 fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
01f43166 393
394 if(fUnsorted){
2fdb1ae7 395 if(fGetActivePads){
396 fClusterFinder->SetDoPadSelection(kTRUE);
a912b63b 397 }
6b15c309 398 if(fDeconvTime){
399 fClusterFinder->ReadDataUnsortedDeconvoluteTime(iter->fPtr, iter->fSize);
400 }
401 else{
402 fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
403 }
01f43166 404
01f43166 405 fClusterFinder->FindClusters();
406 }
407 else{
408 fClusterFinder->Read(iter->fPtr, iter->fSize );
409 fClusterFinder->ProcessDigits();
410 }
9758b471 411 fReader->Reset();
a912b63b 412
7e99beb3 413 realPoints = fClusterFinder->GetNumberOfClusters();
71d7c760 414
7e99beb3 415 outPtr->fSpacePointCnt = realPoints;
416 nSize = sizeof(AliHLTTPCSpacePointData)*realPoints;
417 mysize += nSize+sizeof(AliHLTTPCClusterData);
74511e22 418
419 Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Spacepoints",
7e99beb3 420 "Number of spacepoints: %lu Slice/Patch/RowMin/RowMax: %d/%d/%d/%d.",
a912b63b 421 realPoints, slice, patch,AliHLTTPCTransform::GetFirstRow( patch ) , AliHLTTPCTransform::GetLastRow( patch ) );
7e99beb3 422 AliHLTComponentBlockData bd;
423 FillBlockData( bd );
424 bd.fOffset = offset;
425 bd.fSize = mysize;
426 bd.fSpecification = iter->fSpecification;
64defa03 427 bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType;
7e99beb3 428 outputBlocks.push_back( bd );
71d7c760 429
7e99beb3 430 tSize += mysize;
431 outBPtr += mysize;
432 outPtr = (AliHLTTPCClusterData*)outBPtr;
71d7c760 433
b1c46961 434
7e99beb3 435 if ( tSize > size )
436 {
437 Logging( kHLTLogFatal, "HLT::TPCClusterFinder::DoEvent", "Too much data",
438 "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
439 tSize, size );
9758b471 440 iResult=-ENOSPC;
441 break;
71d7c760 442 }
2fdb1ae7 443
444 if(fUnsorted && fGetActivePads){
445 Int_t maxNumberOfHW=(Int_t)((size-tSize)/sizeof(AliHLTUInt16_t)-1);
446 AliHLTUInt16_t* outputHWPtr= (AliHLTUInt16_t*)(outputPtr+tSize);
447 Int_t nHWAdd = fClusterFinder->FillHWAddressList(outputHWPtr, maxNumberOfHW);
448
2fdb1ae7 449 AliHLTComponentBlockData bdHW;
450 FillBlockData( bdHW );
451 bdHW.fOffset = tSize ;
452 bdHW.fSize = nHWAdd*sizeof(AliHLTUInt16_t);
453 bdHW.fSpecification = iter->fSpecification;
454 bdHW.fDataType = kAliHLTDataTypeHwAddr16;
455 outputBlocks.push_back( bdHW );
456
457 tSize+=nHWAdd*sizeof(AliHLTUInt16_t);
458 }
deba5d85 459
460 if(fDoMC){
461 Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize)/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo)-1);
462 AliHLTTPCClusterFinder::ClusterMCInfo* outputMCInfo= (AliHLTTPCClusterFinder::ClusterMCInfo*)(outputPtr+tSize);
463 Int_t nMCInfo = fClusterFinder->FillOutputMCInfo(outputMCInfo, maxNumberOfClusterMCInfo);
464
465 AliHLTComponentBlockData bdMCInfo;
466 FillBlockData( bdMCInfo );
467 bdMCInfo.fOffset = tSize ;
468 bdMCInfo.fSize = nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
469 bdMCInfo.fSpecification = iter->fSpecification;
470 bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
471 outputBlocks.push_back( bdMCInfo );
472
473 tSize+=nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
474
475 }
71d7c760 476 }
477
9758b471 478 if (iResult>=0)
479 size = tSize;
480
481 return iResult;
7e99beb3 482}
c3cda394 483
3f0fd8f1 484int AliHLTTPCClusterFinderComponent::Configure(const char* arguments){
485 // see header file for class documentation
486 int iResult=0;
487 if (!arguments) return iResult;
488
489 TString allArgs=arguments;
490 TString argument;
491 int bMissingParam=0;
492
493 TObjArray* pTokens=allArgs.Tokenize(" ");
494 if (pTokens) {
495
496 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
497 argument=((TObjString*)pTokens->At(i))->GetString();
498
499 if (argument.IsNull()) continue;
500
3f0fd8f1 501 // -- deconvolute-time option
502 if (argument.CompareTo("-deconvolute-time")==0){
503 HLTDebug("Switching on deconvolution in time direction.");
504 fDeconvTime = kTRUE;
2087f3ed 505 fClusterFinder->SetDeconvTime(fDeconvTime);
3f0fd8f1 506 }
507 else if (argument.CompareTo("-deconvolute-pad")==0){
508 HLTDebug("Switching on deconvolution in pad direction.");
509 fDeconvPad = kTRUE;
2087f3ed 510 fClusterFinder->SetDeconvPad(fDeconvPad);
3f0fd8f1 511 }
512 else if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
513 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
514 AliHLTTPCTransform::SetNTimeBins(((TObjString*)pTokens->At(i))->GetString().Atoi());
515 fClusterFinder->UpdateLastTimeBin();
516 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
517 if(argument.CompareTo("timebins")==0){
518 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
519 }
520 }
521 else if (argument.CompareTo("-first-timebin")==0){
522 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
523 fFirstTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
2087f3ed 524 if(fFirstTimeBin>=0){
525 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
526 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
527 }
528 else{
529 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
530 }
3f0fd8f1 531 }
532 else if (argument.CompareTo("-last-timebin")==0){
533 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
534 fLastTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
2087f3ed 535 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
536 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
537 }
538 else{
539 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
540 }
3f0fd8f1 541 }
6899b7f5 542 else if (argument.CompareTo("-sorted")==0) {
3f0fd8f1 543 fUnsorted=0;
544 HLTDebug("Swithching unsorted off.");
2087f3ed 545 fClusterFinder->SetUnsorted(0);
3f0fd8f1 546 }
deba5d85 547 else if (argument.CompareTo("-do-mc")==0) {
548 fDoMC=kTRUE;
549 fClusterFinder->SetDoMC(fDoMC);
550 HLTInfo("Setting fDoMC to true.");
551 }
3f0fd8f1 552 else if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
553 if(argument.CompareTo("activepads" )==0){
554 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
555 }
556 HLTDebug("Switching on ActivePads");
557 fGetActivePads = 1;
2087f3ed 558 fClusterFinder->SetDoPadSelection(kTRUE);
3f0fd8f1 559 }
6899b7f5 560 else if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
3f0fd8f1 561 if(argument.CompareTo("occupancy-limit" )==0){
562 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
563 }
564 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
565 fClusterFinder->SetOccupancyLimit(((TObjString*)pTokens->At(i))->GetString().Atof());
566 HLTDebug("Occupancy limit set to occulimit %f", ((TObjString*)pTokens->At(i))->GetString().Atof());
567 }
568 else if (argument.CompareTo("rawreadermode")==0){
569 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
570 HLTWarning("Argument 'rawreadermode' is deprecated");
571 }
572 else if (argument.CompareTo("pp-run")==0){
573 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
574 fClusterDeconv = false;
575 }
576 else if (argument.CompareTo("adc-threshold" )==0){
577 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
578 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
579 }
580 else if (argument.CompareTo("oldrcuformat" )==0){
581 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
582 HLTWarning("Argument 'oldrcuformat' is deprecated.");
583 }
584 else if (argument.CompareTo("unsorted" )==0){
585 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
2087f3ed 586 HLTDebug("Using unsorted reading.");
587 fClusterFinder->SetUnsorted(1);
3f0fd8f1 588 }
589 else if (argument.CompareTo("nsigma-threshold")==0){
590 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
591 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
592 }
593 else {
594 HLTError("unknown argument %s", argument.Data());
595 iResult=-EINVAL;
596 break;
597 }
598 }
599 delete pTokens;
600 }
601 if (bMissingParam) {
602 HLTError("missing parameter for argument %s", argument.Data());
603 iResult=-EINVAL;
604 }
605 return iResult;
606}
607
c3cda394 608int AliHLTTPCClusterFinderComponent::Reconfigure(const char* cdbEntry, const char* chainId)
609{
2087f3ed 610
611 int iResult=0;
c3cda394 612 // see header file for class documentation
3f0fd8f1 613 const char* path="HLT/ConfigTPC/ClusterFinderComponent";
c3cda394 614 if (cdbEntry) path=cdbEntry;
615 if (path) {
616 HLTInfo("reconfigure from entry %s, chain id %s", path, (chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
617 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
618 if (pEntry) {
619 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
620 if (pString) {
621 HLTInfo("received configuration object: %s", pString->GetString().Data());
2087f3ed 622 iResult = Configure(pString->GetString().Data());
c3cda394 623 } else {
624 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
625 }
626 } else {
627 HLTError("can not fetch object \"%s\" from CDB", path);
628 }
629 }
2087f3ed 630 return iResult;
c3cda394 631}