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"
54 #include "TGeoGlobalMagField.h"
58 /** ROOT macro for the implementation of ROOT specific class methods */
59 ClassImp(AliHLTTPCClusterFinderComponent)
61 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryPacked="HLT/ConfigTPC/TPCClusterFinderPacked";
62 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryUnpacked="HLT/ConfigTPC/TPCClusterFinderUnpacked";
63 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryDecoder="HLT/ConfigTPC/TPCClusterFinderDecoder";
64 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntry32Bit="HLT/ConfigTPC/TPCClusterFinder32Bit";
66 AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
72 fClusterDeconv(false),
82 fReleaseMemory( kFALSE )
84 // see header file for class documentation
86 // refer to README to build package
88 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
89 if (fModeSwitch!=kClusterFinderPacked &&
90 fModeSwitch!=kClusterFinderUnpacked &&
91 fModeSwitch!=kClusterFinderDecoder &&
92 fModeSwitch!=kClusterFinder32Bit) {
93 HLTFatal("unknown digit reader type");
97 AliHLTTPCClusterFinderComponent::~AliHLTTPCClusterFinderComponent()
99 // see header file for class documentation
102 // Public functions to implement AliHLTComponent's interface.
103 // These functions are required for the registration process
105 const char* AliHLTTPCClusterFinderComponent::GetComponentID()
107 // see header file for class documentation
109 case kClusterFinderPacked:
110 return "TPCClusterFinderPacked";
112 case kClusterFinderUnpacked:
113 return "TPCClusterFinderUnpacked";
115 case kClusterFinderDecoder:
116 return "TPCClusterFinderDecoder";
118 case kClusterFinder32Bit:
119 return "TPCClusterFinder32Bit";
125 void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
127 // see header file for class documentation
130 case kClusterFinderPacked:
131 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
133 case kClusterFinderUnpacked:
134 list.push_back( AliHLTTPCDefinitions::fgkUnpackedRawDataType );
136 case kClusterFinderDecoder:
137 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
139 case kClusterFinder32Bit:
140 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
145 AliHLTComponentDataType AliHLTTPCClusterFinderComponent::GetOutputDataType()
147 // see header file for class documentation
148 return kAliHLTMultipleDataType;
151 int AliHLTTPCClusterFinderComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList)
154 // see header file for class documentation
156 tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
157 tgtList.push_back(kAliHLTDataTypeHwAddr16);
158 return tgtList.size();
161 void AliHLTTPCClusterFinderComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
163 // see header file for class documentation
164 // XXX TODO: Find more realistic values.
167 case kClusterFinderPacked:
168 inputMultiplier = (6 * 0.4);
170 case kClusterFinderUnpacked:
171 inputMultiplier = 0.4;
173 case kClusterFinderDecoder:
174 inputMultiplier = (6 * 0.4);
176 case kClusterFinder32Bit:
177 inputMultiplier = (6 * 0.4);
182 AliHLTComponent* AliHLTTPCClusterFinderComponent::Spawn()
184 // see header file for class documentation
185 return new AliHLTTPCClusterFinderComponent(fModeSwitch);
188 int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
190 // see header file for class documentation
191 if ( fClusterFinder )
194 //Test if the OCDB entries used by AliTPCTransform is availible
195 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
198 HLTError("AliTPCcalibCD does not exist");
201 AliTPCCalPad * time0TPC = calib->GetPadTime0();
203 HLTError("OCDB entry TPC/Calib/PadTime0 (AliTPCcalibDB::GetPadTime0()) is not available.");
207 AliTPCParam * param = calib->GetParameters();
209 HLTError("OCDB entry TPC/Calib/Parameters (AliTPCcalibDB::GetParameters()) is not available.");
214 if (!TGeoGlobalMagField::Instance()) {
215 HLTError("magnetic field not initialized, please set up TGeoGlobalMagField and AliMagF");
218 calib->SetExBField(GetBz());
220 fClusterFinder = new AliHLTTPCClusterFinder();
222 // first configure the default
225 case kClusterFinderPacked:
226 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryPacked);
228 case kClusterFinderUnpacked:
229 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryUnpacked);
231 case kClusterFinderDecoder:
232 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryDecoder);
234 case kClusterFinder32Bit:
235 iResult=ConfigureFromCDBTObjString(fgkOCDBEntry32Bit);
239 // configure from the command line parameters if specified
240 if (iResult>=0 && argc>0)
241 iResult=ConfigureFromArgumentString(argc, argv);
246 TString configuration="";
248 for (int i=0; i<argc && iResult>=0; i++) {
250 if (!configuration.IsNull()) configuration+=" ";
251 configuration+=argument;
254 if (!configuration.IsNull()) {
255 iResult=Configure(configuration.Data());
257 iResult=Reconfigure(NULL, NULL);
261 //Checking for conflicting arguments
263 if(fDeconvPad==kTRUE || fDeconvTime==kTRUE){
264 HLTWarning("Conflicting arguments: argument 'pp-run' will be ignored.");
267 if(fClusterFinder->GetOccupancyLimit()!=1.0 && fUnsorted){
268 HLTWarning("Argument 'occupancy-limit' is deprecated when doing unsorted data reading.");
270 if(fGetActivePads==kTRUE && fUnsorted==kFALSE){
271 HLTWarning("Argument '-active-pads' only work with unsorted data reading. Active pads list will not be produced.");
276 if (fModeSwitch==kClusterFinderPacked) {
277 HLTDebug("using AliHLTTPCDigitReaderPacked");
278 fReader = new AliHLTTPCDigitReaderPacked();
279 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
280 fClusterFinder->SetReader(fReader);
282 else if(fModeSwitch==kClusterFinderUnpacked){
283 HLTDebug("using AliHLTTPCDigitReaderUnpacked");
284 fReader = new AliHLTTPCDigitReaderUnpacked();
285 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
286 fClusterFinder->SetReader(fReader);
288 else if(fModeSwitch==kClusterFinderDecoder){
289 HLTDebug("using AliHLTTPCDigitReaderDecoder");
290 fReader = new AliHLTTPCDigitReaderDecoder();
291 fClusterFinder->SetReader(fReader);
293 else if(fModeSwitch==kClusterFinder32Bit){
294 HLTDebug("using AliHLTTPCDigitReader32Bit");
295 fReader = new AliHLTTPCDigitReader32Bit();
296 fClusterFinder->SetReader(fReader);
297 fClusterFinder->Set32BitFormat(kTRUE);
300 HLTFatal("No mode set for clusterfindercomponent");
304 fClusterFinder->SetOccupancyLimit(1.0);
307 fClusterFinder->SetDeconv(fClusterDeconv);
308 fClusterFinder->SetDeconvPad(fDeconvPad);
309 fClusterFinder->SetDeconvTime(fDeconvPad);
310 fClusterFinder->SetXYError( fXYClusterError );
311 fClusterFinder->SetZError( fZClusterError );
312 if ( (fXYClusterError>0) && (fZClusterError>0) ){
313 fClusterFinder->SetCalcErr( false );
317 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
319 if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
320 fClusterFinder->SetLastTimeBin(fLastTimeBin);
326 int AliHLTTPCClusterFinderComponent::DoDeinit()
328 // see header file for class documentation
330 if ( fClusterFinder )
331 delete fClusterFinder;
332 fClusterFinder = NULL;
341 int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& evtData,
342 const AliHLTComponentBlockData* blocks,
343 AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr,
344 AliHLTUInt32_t& size,
345 vector<AliHLTComponentBlockData>& outputBlocks )
347 // see header file for class documentation
351 HLTFatal("Digit reader not initialized, skipping HLT TPC cluster reconstruction.");
361 // == init iter (pointer to datablock)
362 const AliHLTComponentBlockData* iter = NULL;
365 // == OUTdatatype pointer
366 AliHLTTPCClusterData* outPtr;
368 AliHLTUInt8_t* outBPtr;
369 UInt_t offset, mysize, nSize, tSize = 0;
372 outPtr = (AliHLTTPCClusterData*)outBPtr;
375 unsigned long maxPoints, realPoints = 0;
377 for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
383 // Kenneth 16. July 2009
384 // 32 byte is the size of the common data header (CDH)
385 // this is introduced as a protection of empty files
386 // normally when running with file publisher where
387 // Timms script is used to create the missing files
388 if(iter->fSize <= 32){
393 if (fModeSwitch==0 || fModeSwitch==2 || fModeSwitch==3) {
394 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
395 evtData.fEventID, evtData.fEventID,
396 DataType2Text( iter->fDataType).c_str(),
397 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
399 if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType &&
401 HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!",
402 DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(),
403 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
406 if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC) &&
407 iter->fDataType != AliHLTTPCDefinitions::fgkDDLPackedRawDataType ) continue;
410 else if(fModeSwitch==1){
411 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
412 evtData.fEventID, evtData.fEventID,
413 DataType2Text( iter->fDataType).c_str(),
414 DataType2Text(AliHLTTPCDefinitions::fgkUnpackedRawDataType).c_str());
416 if ( iter->fDataType != AliHLTTPCDefinitions::fgkUnpackedRawDataType ) continue;
420 slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
421 patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
424 fClusterFinder->SetUnsorted(fUnsorted);
425 fClusterFinder->SetPatch(patch);
428 outPtr = (AliHLTTPCClusterData*)outBPtr;
430 maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
432 fClusterFinder->InitSlice( slice, patch, maxPoints );
433 fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
437 fClusterFinder->SetDoPadSelection(kTRUE);
440 fClusterFinder->ReadDataUnsortedDeconvoluteTime(iter->fPtr, iter->fSize);
443 fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
446 fClusterFinder->FindClusters();
449 fClusterFinder->Read(iter->fPtr, iter->fSize );
450 fClusterFinder->ProcessDigits();
454 realPoints = fClusterFinder->GetNumberOfClusters();
456 outPtr->fSpacePointCnt = realPoints;
457 nSize = sizeof(AliHLTTPCSpacePointData)*realPoints;
458 mysize += nSize+sizeof(AliHLTTPCClusterData);
460 Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Spacepoints",
461 "Number of spacepoints: %lu Slice/Patch/RowMin/RowMax: %d/%d/%d/%d.",
462 realPoints, slice, patch,AliHLTTPCTransform::GetFirstRow( patch ) , AliHLTTPCTransform::GetLastRow( patch ) );
463 AliHLTComponentBlockData bd;
467 bd.fSpecification = iter->fSpecification;
468 bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType;
469 outputBlocks.push_back( bd );
473 outPtr = (AliHLTTPCClusterData*)outBPtr;
478 Logging( kHLTLogFatal, "HLT::TPCClusterFinder::DoEvent", "Too much data",
479 "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
485 if(fUnsorted && fGetActivePads){
486 Int_t maxNumberOfHW=(Int_t)((size-tSize)/sizeof(AliHLTUInt16_t)-1);
487 AliHLTUInt16_t* outputHWPtr= (AliHLTUInt16_t*)(outputPtr+tSize);
488 Int_t nHWAdd = fClusterFinder->FillHWAddressList(outputHWPtr, maxNumberOfHW);
490 AliHLTComponentBlockData bdHW;
491 FillBlockData( bdHW );
492 bdHW.fOffset = tSize ;
493 bdHW.fSize = nHWAdd*sizeof(AliHLTUInt16_t);
494 bdHW.fSpecification = iter->fSpecification;
495 bdHW.fDataType = kAliHLTDataTypeHwAddr16;
496 outputBlocks.push_back( bdHW );
498 tSize+=nHWAdd*sizeof(AliHLTUInt16_t);
502 Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize)/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo)-1);
503 AliHLTTPCClusterFinder::ClusterMCInfo* outputMCInfo= (AliHLTTPCClusterFinder::ClusterMCInfo*)(outputPtr+tSize);
504 Int_t nMCInfo = fClusterFinder->FillOutputMCInfo(outputMCInfo, maxNumberOfClusterMCInfo);
506 AliHLTComponentBlockData bdMCInfo;
507 FillBlockData( bdMCInfo );
508 bdMCInfo.fOffset = tSize ;
509 bdMCInfo.fSize = nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
510 bdMCInfo.fSpecification = iter->fSpecification;
511 bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
512 outputBlocks.push_back( bdMCInfo );
514 tSize+=nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
525 int AliHLTTPCClusterFinderComponent::ScanConfigurationArgument(int argc, const char** argv){
527 // see header file for class documentation
529 if (argc<=0) return 0;
531 TString argument=argv[i];
533 if (argument.CompareTo("-solenoidBz")==0){
534 if (++i>=argc) return -EPROTO;
535 HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz());
539 if (argument.CompareTo("-update-calibdb")==0 || argument.CompareTo("-update-transform")==0 ){
540 if(fClusterFinder->UpdateCalibDB()){
541 HLTDebug("CalibDB and offline transform successfully updated.");
544 HLTError("CalibDB could not be updated.");
549 if (argument.CompareTo("-deconvolute-time")==0){
550 HLTDebug("Switching on deconvolution in time direction.");
552 fClusterFinder->SetDeconvTime(fDeconvTime);
556 if (argument.CompareTo("-deconvolute-pad")==0){
557 HLTDebug("Switching on deconvolution in pad direction.");
559 fClusterFinder->SetDeconvPad(fDeconvPad);
563 if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
564 HLTWarning("Argument %s is depreciated after moving to the offline AliTPCTransform class for xyz calculations.",argument.Data());
566 if (++i>=argc) return -EPROTO;
568 AliHLTTPCTransform::SetNTimeBins(argument.Atoi());
569 fClusterFinder->UpdateLastTimeBin();
570 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
573 if(argument.CompareTo("timebins")==0){
574 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
579 if (argument.CompareTo("-first-timebin")==0){
580 if (++i>=argc) return -EPROTO;
582 fFirstTimeBin = argument.Atoi();
583 if(fFirstTimeBin>=0){
584 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
585 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
588 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
593 if (argument.CompareTo("-last-timebin")==0){
594 if (++i>=argc) return -EPROTO;
596 fLastTimeBin = argument.Atoi();
597 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
598 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
601 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
606 if (argument.CompareTo("-sorted")==0) {
608 HLTDebug("Swithching unsorted off.");
609 fClusterFinder->SetUnsorted(0);
613 if (argument.CompareTo("-do-mc")==0) {
615 fClusterFinder->SetDoMC(fDoMC);
616 HLTDebug("Setting fDoMC to true.");
619 if (argument.CompareTo("-release-memory")==0) {
620 fReleaseMemory=kTRUE;
621 fClusterFinder->SetReleaseMemory( fReleaseMemory );
622 HLTDebug("Setting fReleaseMemory to true.");
626 if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
627 if(argument.CompareTo("activepads" )==0){
628 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
630 HLTDebug("Switching on ActivePads");
632 fClusterFinder->SetDoPadSelection(kTRUE);
636 if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
637 if(argument.CompareTo("occupancy-limit" )==0){
638 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
640 if (++i>=argc) return -EPROTO;
642 fClusterFinder->SetOccupancyLimit(argument.Atof());
643 HLTDebug("Occupancy limit set to occulimit %f", argument.Atof());
647 if (argument.CompareTo("rawreadermode")==0){
648 if (++i>=argc) return -EPROTO;
649 HLTWarning("Argument 'rawreadermode' is deprecated");
653 if (argument.CompareTo("pp-run")==0){
654 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
655 fClusterDeconv = false;
659 if (argument.CompareTo("adc-threshold" )==0){
660 if (++i>=argc) return -EPROTO;
661 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
665 if (argument.CompareTo("oldrcuformat" )==0){
666 if (++i>=argc) return -EPROTO;
667 HLTWarning("Argument 'oldrcuformat' is deprecated.");
671 if (argument.CompareTo("unsorted" )==0 || argument.CompareTo("-unsorted" )==0){
672 HLTWarning("Argument is obsolete, unsorted reading is default.");
673 // fClusterFinder->SetUnsorted(1);
676 if (argument.CompareTo("nsigma-threshold")==0){
677 if (++i>=argc) return -EPROTO;
678 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
686 int AliHLTTPCClusterFinderComponent::Reconfigure(const char* cdbEntry, const char* /*chainId*/)
688 // see header file for class documentation
690 const char* entry=cdbEntry;
691 if (!entry || entry[0]==0){
693 case kClusterFinderPacked:
694 entry=fgkOCDBEntryPacked;
696 case kClusterFinderUnpacked:
697 entry=fgkOCDBEntryUnpacked;
699 case kClusterFinderDecoder:
700 entry=fgkOCDBEntryDecoder;
702 case kClusterFinder32Bit:
703 entry=fgkOCDBEntry32Bit;
708 return ConfigureFromCDBTObjString(entry);
713 const char* path="HLT/ConfigTPC/ClusterFinderComponent";
714 if (cdbEntry) path=cdbEntry;
716 HLTInfo("reconfigure from entry %s, chain id %s", path, (chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
717 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path);//,GetRunNo());
719 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
721 HLTInfo("received configuration object: %s", pString->GetString().Data());
722 iResult = Configure(pString->GetString().Data());
724 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
727 HLTError("can not fetch object \"%s\" from CDB", path);
734 int AliHLTTPCClusterFinderComponent::Configure(const char* arguments){
735 // see header file for class documentation
737 if (!arguments) return iResult;
739 TString allArgs=arguments;
743 TObjArray* pTokens=allArgs.Tokenize(" ");
746 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
747 argument=((TObjString*)pTokens->At(i))->GetString();
749 if (argument.IsNull()) continue;
751 // -- deconvolute-time option
752 if (argument.CompareTo("-deconvolute-time")==0){
753 HLTDebug("Switching on deconvolution in time direction.");
755 fClusterFinder->SetDeconvTime(fDeconvTime);
757 else if (argument.CompareTo("-deconvolute-pad")==0){
758 HLTDebug("Switching on deconvolution in pad direction.");
760 fClusterFinder->SetDeconvPad(fDeconvPad);
762 else if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
763 HLTWarning("Argument %s is depreciated after moving to the offline AliTPCTransform class for xyz calculations.",argument.Data());
765 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
766 AliHLTTPCTransform::SetNTimeBins(((TObjString*)pTokens->At(i))->GetString().Atoi());
767 fClusterFinder->UpdateLastTimeBin();
768 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
770 if(argument.CompareTo("timebins")==0){
771 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
775 else if (argument.CompareTo("-first-timebin")==0){
776 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
777 fFirstTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
778 if(fFirstTimeBin>=0){
779 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
780 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
783 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
786 else if (argument.CompareTo("-last-timebin")==0){
787 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
788 fLastTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
789 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
790 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
793 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
796 else if (argument.CompareTo("-sorted")==0) {
798 HLTDebug("Swithching unsorted off.");
799 fClusterFinder->SetUnsorted(0);
801 else if (argument.CompareTo("-do-mc")==0) {
803 fClusterFinder->SetDoMC(fDoMC);
804 HLTInfo("Setting fDoMC to true.");
806 else if (argument.CompareTo("-release-memory")==0) {
807 fReleaseMemory = kTRUE;
808 fClusterFinder->SetReleaseMemory( kTRUE );
809 HLTInfo("Setting fReleaseMemory to true.");
811 else if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
812 if(argument.CompareTo("activepads" )==0){
813 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
815 HLTDebug("Switching on ActivePads");
817 fClusterFinder->SetDoPadSelection(kTRUE);
819 else if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
820 if(argument.CompareTo("occupancy-limit" )==0){
821 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
823 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
824 fClusterFinder->SetOccupancyLimit(((TObjString*)pTokens->At(i))->GetString().Atof());
825 HLTDebug("Occupancy limit set to occulimit %f", ((TObjString*)pTokens->At(i))->GetString().Atof());
827 else if (argument.CompareTo("rawreadermode")==0){
828 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
829 HLTWarning("Argument 'rawreadermode' is deprecated");
831 else if (argument.CompareTo("pp-run")==0){
832 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
833 fClusterDeconv = false;
835 else if (argument.CompareTo("adc-threshold" )==0){
836 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
837 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
839 else if (argument.CompareTo("oldrcuformat" )==0){
840 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
841 HLTWarning("Argument 'oldrcuformat' is deprecated.");
843 else if (argument.CompareTo("unsorted" )==0){
844 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
845 HLTDebug("Using unsorted reading.");
846 fClusterFinder->SetUnsorted(1);
848 else if (argument.CompareTo("nsigma-threshold")==0){
849 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
850 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
852 else if (argument.CompareTo("-update-calibdb")==0){
853 fClusterFinder->UpdateCalibDB();
856 HLTError("unknown argument %s", argument.Data());
864 HLTError("missing parameter for argument %s", argument.Data());