3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Timm Steinbeck, Matthias Richter *
8 //* Developers: Kenneth Aamodt <kenneth.aamodt@student.uib.no> *
9 //* for The ALICE HLT Project. *
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 //**************************************************************************
20 /** @file AliHLTTPCClusterFinderComponent.cxx
21 @author Kenneth Aamodt <kenneth.aamodt@student.uib.no>
23 @brief The TPC cluster finder processing component
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"
49 #include "TObjString.h"
50 #include "TObjArray.h"
51 #include "AliCDBEntry.h"
52 #include "AliCDBManager.h"
53 #include "AliCDBStorage.h"
57 /** ROOT macro for the implementation of ROOT specific class methods */
58 ClassImp(AliHLTTPCClusterFinderComponent)
60 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryPacked="HLT/ConfigTPC/TPCClusterFinderPacked";
61 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryUnpacked="HLT/ConfigTPC/TPCClusterFinderUnpacked";
62 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryDecoder="HLT/ConfigTPC/TPCClusterFinderDecoder";
63 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntry32Bit="HLT/ConfigTPC/TPCClusterFinder32Bit";
65 AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
71 fClusterDeconv(false),
81 fReleaseMemory( kFALSE )
83 // see header file for class documentation
85 // refer to README to build package
87 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
88 if (fModeSwitch!=kClusterFinderPacked &&
89 fModeSwitch!=kClusterFinderUnpacked &&
90 fModeSwitch!=kClusterFinderDecoder &&
91 fModeSwitch!=kClusterFinder32Bit) {
92 HLTFatal("unknown digit reader type");
96 AliHLTTPCClusterFinderComponent::~AliHLTTPCClusterFinderComponent()
98 // see header file for class documentation
101 // Public functions to implement AliHLTComponent's interface.
102 // These functions are required for the registration process
104 const char* AliHLTTPCClusterFinderComponent::GetComponentID()
106 // see header file for class documentation
108 case kClusterFinderPacked:
109 return "TPCClusterFinderPacked";
111 case kClusterFinderUnpacked:
112 return "TPCClusterFinderUnpacked";
114 case kClusterFinderDecoder:
115 return "TPCClusterFinderDecoder";
117 case kClusterFinder32Bit:
118 return "TPCClusterFinder32Bit";
124 void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
126 // see header file for class documentation
129 case kClusterFinderPacked:
130 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
132 case kClusterFinderUnpacked:
133 list.push_back( AliHLTTPCDefinitions::fgkUnpackedRawDataType );
135 case kClusterFinderDecoder:
136 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
138 case kClusterFinder32Bit:
139 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
144 AliHLTComponentDataType AliHLTTPCClusterFinderComponent::GetOutputDataType()
146 // see header file for class documentation
147 return kAliHLTMultipleDataType;
150 int AliHLTTPCClusterFinderComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList)
153 // see header file for class documentation
155 tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
156 tgtList.push_back(kAliHLTDataTypeHwAddr16);
157 return tgtList.size();
160 void AliHLTTPCClusterFinderComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
162 // see header file for class documentation
163 // XXX TODO: Find more realistic values.
166 case kClusterFinderPacked:
167 inputMultiplier = (6 * 0.4);
169 case kClusterFinderUnpacked:
170 inputMultiplier = 0.4;
172 case kClusterFinderDecoder:
173 inputMultiplier = (6 * 0.4);
175 case kClusterFinder32Bit:
176 inputMultiplier = (6 * 0.4);
181 AliHLTComponent* AliHLTTPCClusterFinderComponent::Spawn()
183 // see header file for class documentation
184 return new AliHLTTPCClusterFinderComponent(fModeSwitch);
187 int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
189 // see header file for class documentation
190 if ( fClusterFinder )
193 //Test if the OCDB entries used by AliTPCTransform is availible
194 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
197 HLTError("AliTPCcalibCD does not exist");
200 AliTPCCalPad * time0TPC = calib->GetPadTime0();
202 HLTError("OCDB entry TPC/Calib/PadTime0 (AliTPCcalibDB::GetPadTime0()) is not available.");
206 AliTPCParam * param = calib->GetParameters();
208 HLTError("OCDB entry TPC/Calib/Parameters (AliTPCcalibDB::GetParameters()) is not available.");
212 fClusterFinder = new AliHLTTPCClusterFinder();
214 // first configure the default
217 case kClusterFinderPacked:
218 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryPacked);
220 case kClusterFinderUnpacked:
221 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryUnpacked);
223 case kClusterFinderDecoder:
224 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryDecoder);
226 case kClusterFinder32Bit:
227 iResult=ConfigureFromCDBTObjString(fgkOCDBEntry32Bit);
231 // configure from the command line parameters if specified
232 if (iResult>=0 && argc>0)
233 iResult=ConfigureFromArgumentString(argc, argv);
237 //initialize the magnetic field from CDB
238 iResult = ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
243 TString configuration="";
245 for (int i=0; i<argc && iResult>=0; i++) {
247 if (!configuration.IsNull()) configuration+=" ";
248 configuration+=argument;
251 if (!configuration.IsNull()) {
252 iResult=Configure(configuration.Data());
254 iResult=Reconfigure(NULL, NULL);
258 //Checking for conflicting arguments
260 if(fDeconvPad==kTRUE || fDeconvTime==kTRUE){
261 HLTWarning("Conflicting arguments: argument 'pp-run' will be ignored.");
264 if(fClusterFinder->GetOccupancyLimit()!=1.0 && fUnsorted){
265 HLTWarning("Argument 'occupancy-limit' is deprecated when doing unsorted data reading.");
267 if(fGetActivePads==kTRUE && fUnsorted==kFALSE){
268 HLTWarning("Argument '-active-pads' only work with unsorted data reading. Active pads list will not be produced.");
273 if (fModeSwitch==kClusterFinderPacked) {
274 HLTDebug("using AliHLTTPCDigitReaderPacked");
275 fReader = new AliHLTTPCDigitReaderPacked();
276 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
277 fClusterFinder->SetReader(fReader);
279 else if(fModeSwitch==kClusterFinderUnpacked){
280 HLTDebug("using AliHLTTPCDigitReaderUnpacked");
281 fReader = new AliHLTTPCDigitReaderUnpacked();
282 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
283 fClusterFinder->SetReader(fReader);
285 else if(fModeSwitch==kClusterFinderDecoder){
286 HLTDebug("using AliHLTTPCDigitReaderDecoder");
287 fReader = new AliHLTTPCDigitReaderDecoder();
288 fClusterFinder->SetReader(fReader);
290 else if(fModeSwitch==kClusterFinder32Bit){
291 HLTDebug("using AliHLTTPCDigitReader32Bit");
292 fReader = new AliHLTTPCDigitReader32Bit();
293 fClusterFinder->SetReader(fReader);
294 fClusterFinder->Set32BitFormat(kTRUE);
297 HLTFatal("No mode set for clusterfindercomponent");
301 fClusterFinder->SetOccupancyLimit(1.0);
304 fClusterFinder->SetDeconv(fClusterDeconv);
305 fClusterFinder->SetDeconvPad(fDeconvPad);
306 fClusterFinder->SetDeconvTime(fDeconvPad);
307 fClusterFinder->SetXYError( fXYClusterError );
308 fClusterFinder->SetZError( fZClusterError );
309 if ( (fXYClusterError>0) && (fZClusterError>0) ){
310 fClusterFinder->SetCalcErr( false );
314 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
316 if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
317 fClusterFinder->SetLastTimeBin(fLastTimeBin);
323 int AliHLTTPCClusterFinderComponent::DoDeinit()
325 // see header file for class documentation
327 if ( fClusterFinder )
328 delete fClusterFinder;
329 fClusterFinder = NULL;
338 int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& evtData,
339 const AliHLTComponentBlockData* blocks,
340 AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr,
341 AliHLTUInt32_t& size,
342 vector<AliHLTComponentBlockData>& outputBlocks )
344 // see header file for class documentation
348 HLTFatal("Digit reader not initialized, skipping HLT TPC cluster reconstruction.");
358 // == init iter (pointer to datablock)
359 const AliHLTComponentBlockData* iter = NULL;
362 // == OUTdatatype pointer
363 AliHLTTPCClusterData* outPtr;
365 AliHLTUInt8_t* outBPtr;
366 UInt_t offset, mysize, nSize, tSize = 0;
369 outPtr = (AliHLTTPCClusterData*)outBPtr;
372 unsigned long maxPoints, realPoints = 0;
374 for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
380 // Kenneth 16. July 2009
381 // 32 byte is the size of the common data header (CDH)
382 // this is introduced as a protection of empty files
383 // normally when running with file publisher where
384 // Timms script is used to create the missing files
385 if(iter->fSize <= 32){
390 if (fModeSwitch==0 || fModeSwitch==2 || fModeSwitch==3) {
391 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
392 evtData.fEventID, evtData.fEventID,
393 DataType2Text( iter->fDataType).c_str(),
394 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
396 if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType &&
398 HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!",
399 DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(),
400 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
403 if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC) &&
404 iter->fDataType != AliHLTTPCDefinitions::fgkDDLPackedRawDataType ) continue;
407 else if(fModeSwitch==1){
408 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
409 evtData.fEventID, evtData.fEventID,
410 DataType2Text( iter->fDataType).c_str(),
411 DataType2Text(AliHLTTPCDefinitions::fgkUnpackedRawDataType).c_str());
413 if ( iter->fDataType != AliHLTTPCDefinitions::fgkUnpackedRawDataType ) continue;
417 slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
418 patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
421 fClusterFinder->SetUnsorted(fUnsorted);
422 fClusterFinder->SetPatch(patch);
425 outPtr = (AliHLTTPCClusterData*)outBPtr;
427 maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
429 fClusterFinder->InitSlice( slice, patch, maxPoints );
430 fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
434 fClusterFinder->SetDoPadSelection(kTRUE);
437 fClusterFinder->ReadDataUnsortedDeconvoluteTime(iter->fPtr, iter->fSize);
440 fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
443 fClusterFinder->FindClusters();
446 fClusterFinder->Read(iter->fPtr, iter->fSize );
447 fClusterFinder->ProcessDigits();
451 realPoints = fClusterFinder->GetNumberOfClusters();
453 outPtr->fSpacePointCnt = realPoints;
454 nSize = sizeof(AliHLTTPCSpacePointData)*realPoints;
455 mysize += nSize+sizeof(AliHLTTPCClusterData);
457 Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Spacepoints",
458 "Number of spacepoints: %lu Slice/Patch/RowMin/RowMax: %d/%d/%d/%d.",
459 realPoints, slice, patch,AliHLTTPCTransform::GetFirstRow( patch ) , AliHLTTPCTransform::GetLastRow( patch ) );
460 AliHLTComponentBlockData bd;
464 bd.fSpecification = iter->fSpecification;
465 bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType;
466 outputBlocks.push_back( bd );
470 outPtr = (AliHLTTPCClusterData*)outBPtr;
475 Logging( kHLTLogFatal, "HLT::TPCClusterFinder::DoEvent", "Too much data",
476 "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
482 if(fUnsorted && fGetActivePads){
483 Int_t maxNumberOfHW=(Int_t)((size-tSize)/sizeof(AliHLTUInt16_t)-1);
484 AliHLTUInt16_t* outputHWPtr= (AliHLTUInt16_t*)(outputPtr+tSize);
485 Int_t nHWAdd = fClusterFinder->FillHWAddressList(outputHWPtr, maxNumberOfHW);
487 AliHLTComponentBlockData bdHW;
488 FillBlockData( bdHW );
489 bdHW.fOffset = tSize ;
490 bdHW.fSize = nHWAdd*sizeof(AliHLTUInt16_t);
491 bdHW.fSpecification = iter->fSpecification;
492 bdHW.fDataType = kAliHLTDataTypeHwAddr16;
493 outputBlocks.push_back( bdHW );
495 tSize+=nHWAdd*sizeof(AliHLTUInt16_t);
499 Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize)/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo)-1);
500 AliHLTTPCClusterFinder::ClusterMCInfo* outputMCInfo= (AliHLTTPCClusterFinder::ClusterMCInfo*)(outputPtr+tSize);
501 Int_t nMCInfo = fClusterFinder->FillOutputMCInfo(outputMCInfo, maxNumberOfClusterMCInfo);
503 AliHLTComponentBlockData bdMCInfo;
504 FillBlockData( bdMCInfo );
505 bdMCInfo.fOffset = tSize ;
506 bdMCInfo.fSize = nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
507 bdMCInfo.fSpecification = iter->fSpecification;
508 bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
509 outputBlocks.push_back( bdMCInfo );
511 tSize+=nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
522 int AliHLTTPCClusterFinderComponent::ScanConfigurationArgument(int argc, const char** argv){
524 // see header file for class documentation
526 if (argc<=0) return 0;
528 TString argument=argv[i];
530 if (argument.CompareTo("-solenoidBz")==0){
531 if (++i>=argc) return -EPROTO;
533 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
535 HLTError("CalibDB not availible");
537 Float_t magneticField = argument.Atof();
538 calib->SetExBField(magneticField);
539 HLTInfo("SolenoidBz is set to %f in the calibDB",magneticField);
543 if (argument.CompareTo("-update-calibdb")==0 || argument.CompareTo("-update-transform")==0 ){
544 if(fClusterFinder->UpdateCalibDB()){
545 HLTDebug("CalibDB and offline transform successfully updated.");
548 HLTError("CalibDB could not be updated.");
553 if (argument.CompareTo("-deconvolute-time")==0){
554 HLTDebug("Switching on deconvolution in time direction.");
556 fClusterFinder->SetDeconvTime(fDeconvTime);
560 if (argument.CompareTo("-deconvolute-pad")==0){
561 HLTDebug("Switching on deconvolution in pad direction.");
563 fClusterFinder->SetDeconvPad(fDeconvPad);
567 if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
568 HLTWarning("Argument %s is depreciated after moving to the offline AliTPCTransform class for xyz calculations.",argument.Data());
570 if (++i>=argc) return -EPROTO;
572 AliHLTTPCTransform::SetNTimeBins(argument.Atoi());
573 fClusterFinder->UpdateLastTimeBin();
574 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
577 if(argument.CompareTo("timebins")==0){
578 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
583 if (argument.CompareTo("-first-timebin")==0){
584 if (++i>=argc) return -EPROTO;
586 fFirstTimeBin = argument.Atoi();
587 if(fFirstTimeBin>=0){
588 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
589 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
592 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
597 if (argument.CompareTo("-last-timebin")==0){
598 if (++i>=argc) return -EPROTO;
600 fLastTimeBin = argument.Atoi();
601 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
602 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
605 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
610 if (argument.CompareTo("-sorted")==0) {
612 HLTDebug("Swithching unsorted off.");
613 fClusterFinder->SetUnsorted(0);
617 if (argument.CompareTo("-do-mc")==0) {
619 fClusterFinder->SetDoMC(fDoMC);
620 HLTDebug("Setting fDoMC to true.");
623 if (argument.CompareTo("-release-memory")==0) {
624 fReleaseMemory=kTRUE;
625 fClusterFinder->SetReleaseMemory( fReleaseMemory );
626 HLTDebug("Setting fReleaseMemory to true.");
630 if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
631 if(argument.CompareTo("activepads" )==0){
632 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
634 HLTDebug("Switching on ActivePads");
636 fClusterFinder->SetDoPadSelection(kTRUE);
640 if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
641 if(argument.CompareTo("occupancy-limit" )==0){
642 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
644 if (++i>=argc) return -EPROTO;
646 fClusterFinder->SetOccupancyLimit(argument.Atof());
647 HLTDebug("Occupancy limit set to occulimit %f", argument.Atof());
651 if (argument.CompareTo("rawreadermode")==0){
652 if (++i>=argc) return -EPROTO;
653 HLTWarning("Argument 'rawreadermode' is deprecated");
657 if (argument.CompareTo("pp-run")==0){
658 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
659 fClusterDeconv = false;
663 if (argument.CompareTo("adc-threshold" )==0){
664 if (++i>=argc) return -EPROTO;
665 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
669 if (argument.CompareTo("oldrcuformat" )==0){
670 if (++i>=argc) return -EPROTO;
671 HLTWarning("Argument 'oldrcuformat' is deprecated.");
675 if (argument.CompareTo("unsorted" )==0 || argument.CompareTo("-unsorted" )==0){
676 HLTWarning("Argument is obsolete, unsorted reading is default.");
677 // fClusterFinder->SetUnsorted(1);
680 if (argument.CompareTo("nsigma-threshold")==0){
681 if (++i>=argc) return -EPROTO;
682 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
690 int AliHLTTPCClusterFinderComponent::Reconfigure(const char* cdbEntry, const char* /*chainId*/)
692 // see header file for class documentation
694 const char* entry=cdbEntry;
695 if (!entry || entry[0]==0){
697 case kClusterFinderPacked:
698 entry=fgkOCDBEntryPacked;
700 case kClusterFinderUnpacked:
701 entry=fgkOCDBEntryUnpacked;
703 case kClusterFinderDecoder:
704 entry=fgkOCDBEntryDecoder;
706 case kClusterFinder32Bit:
707 entry=fgkOCDBEntry32Bit;
712 return ConfigureFromCDBTObjString(entry);
717 const char* path="HLT/ConfigTPC/ClusterFinderComponent";
718 if (cdbEntry) path=cdbEntry;
720 HLTInfo("reconfigure from entry %s, chain id %s", path, (chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
721 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path);//,GetRunNo());
723 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
725 HLTInfo("received configuration object: %s", pString->GetString().Data());
726 iResult = Configure(pString->GetString().Data());
728 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
731 HLTError("can not fetch object \"%s\" from CDB", path);
738 int AliHLTTPCClusterFinderComponent::Configure(const char* arguments){
739 // see header file for class documentation
741 if (!arguments) return iResult;
743 TString allArgs=arguments;
747 TObjArray* pTokens=allArgs.Tokenize(" ");
750 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
751 argument=((TObjString*)pTokens->At(i))->GetString();
753 if (argument.IsNull()) continue;
755 // -- deconvolute-time option
756 if (argument.CompareTo("-deconvolute-time")==0){
757 HLTDebug("Switching on deconvolution in time direction.");
759 fClusterFinder->SetDeconvTime(fDeconvTime);
761 else if (argument.CompareTo("-deconvolute-pad")==0){
762 HLTDebug("Switching on deconvolution in pad direction.");
764 fClusterFinder->SetDeconvPad(fDeconvPad);
766 else if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
767 HLTWarning("Argument %s is depreciated after moving to the offline AliTPCTransform class for xyz calculations.",argument.Data());
769 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
770 AliHLTTPCTransform::SetNTimeBins(((TObjString*)pTokens->At(i))->GetString().Atoi());
771 fClusterFinder->UpdateLastTimeBin();
772 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
774 if(argument.CompareTo("timebins")==0){
775 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
779 else if (argument.CompareTo("-first-timebin")==0){
780 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
781 fFirstTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
782 if(fFirstTimeBin>=0){
783 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
784 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
787 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
790 else if (argument.CompareTo("-last-timebin")==0){
791 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
792 fLastTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
793 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
794 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
797 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
800 else if (argument.CompareTo("-sorted")==0) {
802 HLTDebug("Swithching unsorted off.");
803 fClusterFinder->SetUnsorted(0);
805 else if (argument.CompareTo("-do-mc")==0) {
807 fClusterFinder->SetDoMC(fDoMC);
808 HLTInfo("Setting fDoMC to true.");
810 else if (argument.CompareTo("-release-memory")==0) {
811 fReleaseMemory = kTRUE;
812 fClusterFinder->SetReleaseMemory( kTRUE );
813 HLTInfo("Setting fReleaseMemory to true.");
815 else if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
816 if(argument.CompareTo("activepads" )==0){
817 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
819 HLTDebug("Switching on ActivePads");
821 fClusterFinder->SetDoPadSelection(kTRUE);
823 else if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
824 if(argument.CompareTo("occupancy-limit" )==0){
825 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
827 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
828 fClusterFinder->SetOccupancyLimit(((TObjString*)pTokens->At(i))->GetString().Atof());
829 HLTDebug("Occupancy limit set to occulimit %f", ((TObjString*)pTokens->At(i))->GetString().Atof());
831 else if (argument.CompareTo("rawreadermode")==0){
832 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
833 HLTWarning("Argument 'rawreadermode' is deprecated");
835 else if (argument.CompareTo("pp-run")==0){
836 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
837 fClusterDeconv = false;
839 else if (argument.CompareTo("adc-threshold" )==0){
840 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
841 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
843 else if (argument.CompareTo("oldrcuformat" )==0){
844 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
845 HLTWarning("Argument 'oldrcuformat' is deprecated.");
847 else if (argument.CompareTo("unsorted" )==0){
848 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
849 HLTDebug("Using unsorted reading.");
850 fClusterFinder->SetUnsorted(1);
852 else if (argument.CompareTo("nsigma-threshold")==0){
853 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
854 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
856 else if (argument.CompareTo("-update-calibdb")==0){
857 fClusterFinder->UpdateCalibDB();
860 HLTError("unknown argument %s", argument.Data());
868 HLTError("missing parameter for argument %s", argument.Data());