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"
45 //#include "AliHLTTPCCAInputDataCompressorComponent.h"
46 //#include "AliHLTTPCCADef.h"
51 #include "TObjString.h"
52 #include "TObjArray.h"
53 #include "AliCDBEntry.h"
54 #include "AliCDBManager.h"
55 #include "AliCDBStorage.h"
56 #include "TGeoGlobalMagField.h"
60 /** ROOT macro for the implementation of ROOT specific class methods */
61 ClassImp(AliHLTTPCClusterFinderComponent)
63 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryPacked="HLT/ConfigTPC/TPCClusterFinderPacked";
64 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryUnpacked="HLT/ConfigTPC/TPCClusterFinderUnpacked";
65 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryDecoder="HLT/ConfigTPC/TPCClusterFinderDecoder";
66 const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntry32Bit="HLT/ConfigTPC/TPCClusterFinder32Bit";
68 AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
74 fClusterDeconv(false),
84 fReleaseMemory( kFALSE ),
85 fBenchmark("TPCClusterFinder")
87 // see header file for class documentation
89 // refer to README to build package
91 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
92 if (fModeSwitch!=kClusterFinderPacked &&
93 fModeSwitch!=kClusterFinderUnpacked &&
94 fModeSwitch!=kClusterFinderDecoder &&
95 fModeSwitch!=kClusterFinder32Bit) {
96 HLTFatal("unknown digit reader type");
100 AliHLTTPCClusterFinderComponent::~AliHLTTPCClusterFinderComponent()
102 // see header file for class documentation
105 // Public functions to implement AliHLTComponent's interface.
106 // These functions are required for the registration process
108 const char* AliHLTTPCClusterFinderComponent::GetComponentID()
110 // see header file for class documentation
112 case kClusterFinderPacked:
113 return "TPCClusterFinderPacked";
115 case kClusterFinderUnpacked:
116 return "TPCClusterFinderUnpacked";
118 case kClusterFinderDecoder:
119 return "TPCClusterFinderDecoder";
121 case kClusterFinder32Bit:
122 return "TPCClusterFinder32Bit";
128 void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
130 // see header file for class documentation
133 case kClusterFinderPacked:
134 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
136 case kClusterFinderUnpacked:
137 list.push_back( AliHLTTPCDefinitions::fgkUnpackedRawDataType );
139 case kClusterFinderDecoder:
140 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
142 case kClusterFinder32Bit:
143 list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
148 AliHLTComponentDataType AliHLTTPCClusterFinderComponent::GetOutputDataType()
150 // see header file for class documentation
151 return kAliHLTMultipleDataType;
154 int AliHLTTPCClusterFinderComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList)
157 // see header file for class documentation
159 tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
160 tgtList.push_back(kAliHLTDataTypeHwAddr16);
161 //tgtList.push_back(AliHLTTPCCADefinitions::fgkCompressedInputDataType);
162 return tgtList.size();
165 void AliHLTTPCClusterFinderComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
167 // see header file for class documentation
168 // XXX TODO: Find more realistic values.
171 case kClusterFinderPacked:
172 inputMultiplier = (6 * 0.4);
174 case kClusterFinderUnpacked:
175 inputMultiplier = 0.4;
177 case kClusterFinderDecoder:
178 inputMultiplier = (6 * 0.4);
180 case kClusterFinder32Bit:
181 inputMultiplier = (6 * 0.4);
186 AliHLTComponent* AliHLTTPCClusterFinderComponent::Spawn()
188 // see header file for class documentation
189 return new AliHLTTPCClusterFinderComponent(fModeSwitch);
192 int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
194 // see header file for class documentation
195 if ( fClusterFinder )
198 //Test if the OCDB entries used by AliTPCTransform is availible
199 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
202 HLTError("AliTPCcalibDB does not exist");
205 AliTPCCalPad * time0TPC = calib->GetPadTime0();
207 HLTError("OCDB entry TPC/Calib/PadTime0 (AliTPCcalibDB::GetPadTime0()) is not available.");
211 AliTPCParam * param = calib->GetParameters();
213 HLTError("OCDB entry TPC/Calib/Parameters (AliTPCcalibDB::GetParameters()) is not available.");
218 if (!TGeoGlobalMagField::Instance()) {
219 HLTError("magnetic field not initialized, please set up TGeoGlobalMagField and AliMagF");
222 calib->SetExBField(GetBz());
224 fClusterFinder = new AliHLTTPCClusterFinder();
226 // first configure the default
229 case kClusterFinderPacked:
230 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryPacked);
232 case kClusterFinderUnpacked:
233 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryUnpacked);
235 case kClusterFinderDecoder:
236 iResult=ConfigureFromCDBTObjString(fgkOCDBEntryDecoder);
238 case kClusterFinder32Bit:
239 iResult=ConfigureFromCDBTObjString(fgkOCDBEntry32Bit);
243 // configure from the command line parameters if specified
244 if (iResult>=0 && argc>0)
245 iResult=ConfigureFromArgumentString(argc, argv);
250 TString configuration="";
252 for (int i=0; i<argc && iResult>=0; i++) {
254 if (!configuration.IsNull()) configuration+=" ";
255 configuration+=argument;
258 if (!configuration.IsNull()) {
259 iResult=Configure(configuration.Data());
261 iResult=Reconfigure(NULL, NULL);
265 //Checking for conflicting arguments
267 if(fDeconvPad==kTRUE || fDeconvTime==kTRUE){
268 HLTWarning("Conflicting arguments: argument 'pp-run' will be ignored.");
271 if(fClusterFinder->GetOccupancyLimit()!=1.0 && fUnsorted){
272 HLTWarning("Argument 'occupancy-limit' is deprecated when doing unsorted data reading.");
274 if(fGetActivePads==kTRUE && fUnsorted==kFALSE){
275 HLTWarning("Argument '-active-pads' only work with unsorted data reading. Active pads list will not be produced.");
280 if (fModeSwitch==kClusterFinderPacked) {
281 HLTDebug("using AliHLTTPCDigitReaderPacked");
282 fReader = new AliHLTTPCDigitReaderPacked();
283 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
284 fClusterFinder->SetReader(fReader);
286 else if(fModeSwitch==kClusterFinderUnpacked){
287 HLTDebug("using AliHLTTPCDigitReaderUnpacked");
288 fReader = new AliHLTTPCDigitReaderUnpacked();
289 if(fUnsorted==1){ fReader->SetUnsorted(kTRUE); }
290 fClusterFinder->SetReader(fReader);
292 else if(fModeSwitch==kClusterFinderDecoder){
293 HLTDebug("using AliHLTTPCDigitReaderDecoder");
294 fReader = new AliHLTTPCDigitReaderDecoder();
295 fClusterFinder->SetReader(fReader);
297 else if(fModeSwitch==kClusterFinder32Bit){
298 HLTDebug("using AliHLTTPCDigitReader32Bit");
299 fReader = new AliHLTTPCDigitReader32Bit();
300 fClusterFinder->SetReader(fReader);
301 fClusterFinder->Set32BitFormat(kTRUE);
304 HLTFatal("No mode set for clusterfindercomponent");
308 fClusterFinder->SetOccupancyLimit(1.0);
311 fClusterFinder->SetDeconv(fClusterDeconv);
312 fClusterFinder->SetDeconvPad(fDeconvPad);
313 fClusterFinder->SetDeconvTime(fDeconvPad);
314 fClusterFinder->SetXYError( fXYClusterError );
315 fClusterFinder->SetZError( fZClusterError );
316 if ( (fXYClusterError>0) && (fZClusterError>0) ){
317 fClusterFinder->SetCalcErr( false );
321 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
323 if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
324 fClusterFinder->SetLastTimeBin(fLastTimeBin);
327 fBenchmark.SetTimer(0,"total");
328 fBenchmark.SetTimer(1,"reco");
333 int AliHLTTPCClusterFinderComponent::DoDeinit()
335 // see header file for class documentation
337 if ( fClusterFinder )
338 delete fClusterFinder;
339 fClusterFinder = NULL;
348 int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& evtData,
349 const AliHLTComponentBlockData* blocks,
350 AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr,
351 AliHLTUInt32_t& size,
352 vector<AliHLTComponentBlockData>& outputBlocks )
354 // see header file for class documentation
358 HLTFatal("Digit reader not initialized, skipping HLT TPC cluster reconstruction.");
368 fBenchmark.StartNewEvent();
371 // == init iter (pointer to datablock)
372 const AliHLTComponentBlockData* iter = NULL;
375 // == OUTdatatype pointer
376 AliHLTTPCClusterData* outPtr;
378 AliHLTUInt8_t* outBPtr;
379 UInt_t offset, mysize, nSize, tSize = 0;
382 outPtr = (AliHLTTPCClusterData*)outBPtr;
385 unsigned long maxPoints, realPoints = 0;
387 for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
393 // Kenneth 16. July 2009
394 // 32 byte is the size of the common data header (CDH)
395 // this is introduced as a protection of empty files
396 // normally when running with file publisher where
397 // Timms script is used to create the missing files
398 if(iter->fSize <= 32){
403 if (fModeSwitch==0 || fModeSwitch==2 || fModeSwitch==3) {
404 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
405 evtData.fEventID, evtData.fEventID,
406 DataType2Text( iter->fDataType).c_str(),
407 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
409 if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType &&
411 HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!",
412 DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(),
413 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
416 if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC) &&
417 iter->fDataType != AliHLTTPCDefinitions::fgkDDLPackedRawDataType ) continue;
420 else if(fModeSwitch==1){
421 HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
422 evtData.fEventID, evtData.fEventID,
423 DataType2Text( iter->fDataType).c_str(),
424 DataType2Text(AliHLTTPCDefinitions::fgkUnpackedRawDataType).c_str());
426 if ( iter->fDataType != AliHLTTPCDefinitions::fgkUnpackedRawDataType ) continue;
430 fBenchmark.AddInput(iter->fSize);
432 slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
433 patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
436 fClusterFinder->SetUnsorted(fUnsorted);
437 fClusterFinder->SetPatch(patch);
440 outPtr = (AliHLTTPCClusterData*)outBPtr;
442 maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
444 fClusterFinder->InitSlice( slice, patch, maxPoints );
445 fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
451 fClusterFinder->SetDoPadSelection(kTRUE);
454 fClusterFinder->ReadDataUnsortedDeconvoluteTime(iter->fPtr, iter->fSize);
457 fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
460 fClusterFinder->FindClusters();
463 fClusterFinder->Read(iter->fPtr, iter->fSize );
464 fClusterFinder->ProcessDigits();
470 realPoints = fClusterFinder->GetNumberOfClusters();
472 outPtr->fSpacePointCnt = realPoints;
473 nSize = sizeof(AliHLTTPCSpacePointData)*realPoints;
474 mysize += nSize+sizeof(AliHLTTPCClusterData);
476 Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Spacepoints",
477 "Number of spacepoints: %lu Slice/Patch/RowMin/RowMax: %d/%d/%d/%d.",
478 realPoints, slice, patch,AliHLTTPCTransform::GetFirstRow( patch ) , AliHLTTPCTransform::GetLastRow( patch ) );
479 AliHLTComponentBlockData bd;
483 bd.fSpecification = iter->fSpecification;
484 bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType;
485 outputBlocks.push_back( bd );
487 fBenchmark.AddOutput(bd.fSize);
491 outPtr = (AliHLTTPCClusterData*)outBPtr;
496 Logging( kHLTLogFatal, "HLT::TPCClusterFinder::DoEvent", "Too much data",
497 "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
503 if(fUnsorted && fGetActivePads){
504 Int_t maxNumberOfHW=(Int_t)((size-tSize)/sizeof(AliHLTUInt16_t)-1);
505 AliHLTUInt16_t* outputHWPtr= (AliHLTUInt16_t*)(outputPtr+tSize);
506 Int_t nHWAdd = fClusterFinder->FillHWAddressList(outputHWPtr, maxNumberOfHW);
508 AliHLTComponentBlockData bdHW;
509 FillBlockData( bdHW );
510 bdHW.fOffset = tSize ;
511 bdHW.fSize = nHWAdd*sizeof(AliHLTUInt16_t);
512 bdHW.fSpecification = iter->fSpecification;
513 bdHW.fDataType = kAliHLTDataTypeHwAddr16;
514 outputBlocks.push_back( bdHW );
516 fBenchmark.AddOutput(bdHW.fSize);
517 tSize+=nHWAdd*sizeof(AliHLTUInt16_t);
521 { // compressed output for the CA tracker
523 AliHLTUInt32_t dSize = 0;
525 int ret = AliHLTTPCCAInputDataCompressorComponent::Compress( (AliHLTTPCClusterData*)( outputPtr + bd.fOffset ),
530 if ( ret!=0 || tSize + dSize > size )
532 Logging( kHLTLogFatal, "HLT::TPCClusterFinder::DoEvent", "Too much data",
533 "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
534 tSize + dSize, size );
539 AliHLTComponentBlockData bdCompressed;
540 FillBlockData( bdCompressed );
541 bdCompressed.fOffset = tSize ;
542 bdCompressed.fSize = dSize;
543 bdCompressed.fSpecification = iter->fSpecification;
544 bdCompressed.fDataType = AliHLTTPCCADefinitions::fgkCompressedInputDataType;
545 outputBlocks.push_back( bdCompressed );
549 outPtr = (AliHLTTPCClusterData*)outBPtr;
554 Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize)/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo)-1);
555 AliHLTTPCClusterFinder::ClusterMCInfo* outputMCInfo= (AliHLTTPCClusterFinder::ClusterMCInfo*)(outputPtr+tSize);
556 Int_t nMCInfo = fClusterFinder->FillOutputMCInfo(outputMCInfo, maxNumberOfClusterMCInfo);
558 AliHLTComponentBlockData bdMCInfo;
559 FillBlockData( bdMCInfo );
560 bdMCInfo.fOffset = tSize ;
561 bdMCInfo.fSize = nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
562 bdMCInfo.fSpecification = iter->fSpecification;
563 bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
564 outputBlocks.push_back( bdMCInfo );
565 fBenchmark.AddOutput(bdMCInfo.fSize);
567 tSize+=nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
576 HLTInfo(fBenchmark.GetStatistics());
580 int AliHLTTPCClusterFinderComponent::ScanConfigurationArgument(int argc, const char** argv){
582 // see header file for class documentation
584 if (argc<=0) return 0;
586 TString argument=argv[i];
588 if (argument.CompareTo("-solenoidBz")==0){
589 if (++i>=argc) return -EPROTO;
590 HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz());
594 if (argument.CompareTo("-update-calibdb")==0 || argument.CompareTo("-update-transform")==0 ){
595 if(fClusterFinder->UpdateCalibDB()){
596 HLTDebug("CalibDB and offline transform successfully updated.");
599 HLTError("CalibDB could not be updated.");
604 if (argument.CompareTo("-deconvolute-time")==0){
605 HLTDebug("Switching on deconvolution in time direction.");
607 fClusterFinder->SetDeconvTime(fDeconvTime);
611 if (argument.CompareTo("-deconvolute-pad")==0){
612 HLTDebug("Switching on deconvolution in pad direction.");
614 fClusterFinder->SetDeconvPad(fDeconvPad);
618 if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
619 HLTWarning("Argument %s is depreciated after moving to the offline AliTPCTransform class for xyz calculations.",argument.Data());
621 if (++i>=argc) return -EPROTO;
623 AliHLTTPCTransform::SetNTimeBins(argument.Atoi());
624 fClusterFinder->UpdateLastTimeBin();
625 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
628 if(argument.CompareTo("timebins")==0){
629 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
634 if (argument.CompareTo("-first-timebin")==0){
635 if (++i>=argc) return -EPROTO;
637 fFirstTimeBin = argument.Atoi();
638 if(fFirstTimeBin>=0){
639 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
640 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
643 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
648 if (argument.CompareTo("-last-timebin")==0){
649 if (++i>=argc) return -EPROTO;
651 fLastTimeBin = argument.Atoi();
652 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
653 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
656 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
661 if (argument.CompareTo("-sorted")==0) {
663 HLTDebug("Swithching unsorted off.");
664 fClusterFinder->SetUnsorted(0);
668 if (argument.CompareTo("-do-mc")==0) {
670 fClusterFinder->SetDoMC(fDoMC);
671 HLTDebug("Setting fDoMC to true.");
674 if (argument.CompareTo("-release-memory")==0) {
675 fReleaseMemory=kTRUE;
676 fClusterFinder->SetReleaseMemory( fReleaseMemory );
677 HLTDebug("Setting fReleaseMemory to true.");
681 if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
682 if(argument.CompareTo("activepads" )==0){
683 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
685 HLTDebug("Switching on ActivePads");
687 fClusterFinder->SetDoPadSelection(kTRUE);
691 if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
692 if(argument.CompareTo("occupancy-limit" )==0){
693 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
695 if (++i>=argc) return -EPROTO;
697 fClusterFinder->SetOccupancyLimit(argument.Atof());
698 HLTDebug("Occupancy limit set to occulimit %f", argument.Atof());
702 if (argument.CompareTo("rawreadermode")==0){
703 if (++i>=argc) return -EPROTO;
704 HLTWarning("Argument 'rawreadermode' is deprecated");
708 if (argument.CompareTo("pp-run")==0){
709 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
710 fClusterDeconv = false;
714 if (argument.CompareTo("adc-threshold" )==0){
715 if (++i>=argc) return -EPROTO;
716 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
720 if (argument.CompareTo("oldrcuformat" )==0){
721 if (++i>=argc) return -EPROTO;
722 HLTWarning("Argument 'oldrcuformat' is deprecated.");
726 if (argument.CompareTo("unsorted" )==0 || argument.CompareTo("-unsorted" )==0){
727 HLTWarning("Argument is obsolete, unsorted reading is default.");
728 // fClusterFinder->SetUnsorted(1);
731 if (argument.CompareTo("nsigma-threshold")==0){
732 if (++i>=argc) return -EPROTO;
733 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
741 int AliHLTTPCClusterFinderComponent::Reconfigure(const char* cdbEntry, const char* /*chainId*/)
743 // see header file for class documentation
745 const char* entry=cdbEntry;
746 if (!entry || entry[0]==0){
748 case kClusterFinderPacked:
749 entry=fgkOCDBEntryPacked;
751 case kClusterFinderUnpacked:
752 entry=fgkOCDBEntryUnpacked;
754 case kClusterFinderDecoder:
755 entry=fgkOCDBEntryDecoder;
757 case kClusterFinder32Bit:
758 entry=fgkOCDBEntry32Bit;
763 return ConfigureFromCDBTObjString(entry);
768 const char* path="HLT/ConfigTPC/ClusterFinderComponent";
769 if (cdbEntry) path=cdbEntry;
771 HLTInfo("reconfigure from entry %s, chain id %s", path, (chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
772 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path);//,GetRunNo());
774 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
776 HLTInfo("received configuration object: %s", pString->GetString().Data());
777 iResult = Configure(pString->GetString().Data());
779 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
782 HLTError("can not fetch object \"%s\" from CDB", path);
789 int AliHLTTPCClusterFinderComponent::Configure(const char* arguments){
790 // see header file for class documentation
792 if (!arguments) return iResult;
794 TString allArgs=arguments;
798 TObjArray* pTokens=allArgs.Tokenize(" ");
801 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
802 argument=((TObjString*)pTokens->At(i))->GetString();
804 if (argument.IsNull()) continue;
806 // -- deconvolute-time option
807 if (argument.CompareTo("-deconvolute-time")==0){
808 HLTDebug("Switching on deconvolution in time direction.");
810 fClusterFinder->SetDeconvTime(fDeconvTime);
812 else if (argument.CompareTo("-deconvolute-pad")==0){
813 HLTDebug("Switching on deconvolution in pad direction.");
815 fClusterFinder->SetDeconvPad(fDeconvPad);
817 else if (argument.CompareTo("-timebins")==0 || argument.CompareTo("timebins" )==0){
818 HLTWarning("Argument %s is depreciated after moving to the offline AliTPCTransform class for xyz calculations.",argument.Data());
820 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
821 AliHLTTPCTransform::SetNTimeBins(((TObjString*)pTokens->At(i))->GetString().Atoi());
822 fClusterFinder->UpdateLastTimeBin();
823 HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
825 if(argument.CompareTo("timebins")==0){
826 HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
830 else if (argument.CompareTo("-first-timebin")==0){
831 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
832 fFirstTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
833 if(fFirstTimeBin>=0){
834 HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
835 fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
838 HLTError("-first-timebin specifier is negative: %d",fFirstTimeBin);
841 else if (argument.CompareTo("-last-timebin")==0){
842 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
843 fLastTimeBin = ((TObjString*)pTokens->At(i))->GetString().Atoi();
844 if(fLastTimeBin<AliHLTTPCTransform::GetNTimeBins()){
845 HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
848 HLTError("fLastTimeBins is too big: %d. Maximum: %d",fLastTimeBin,AliHLTTPCTransform::GetNTimeBins());
851 else if (argument.CompareTo("-sorted")==0) {
853 HLTDebug("Swithching unsorted off.");
854 fClusterFinder->SetUnsorted(0);
856 else if (argument.CompareTo("-do-mc")==0) {
858 fClusterFinder->SetDoMC(fDoMC);
859 HLTInfo("Setting fDoMC to true.");
861 else if (argument.CompareTo("-release-memory")==0) {
862 fReleaseMemory = kTRUE;
863 fClusterFinder->SetReleaseMemory( kTRUE );
864 HLTInfo("Setting fReleaseMemory to true.");
866 else if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
867 if(argument.CompareTo("activepads" )==0){
868 HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'activepads'");
870 HLTDebug("Switching on ActivePads");
872 fClusterFinder->SetDoPadSelection(kTRUE);
874 else if (argument.CompareTo("-occupancy-limit")==0 || argument.CompareTo("occupancy-limit")==0){
875 if(argument.CompareTo("occupancy-limit" )==0){
876 HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
878 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
879 fClusterFinder->SetOccupancyLimit(((TObjString*)pTokens->At(i))->GetString().Atof());
880 HLTDebug("Occupancy limit set to occulimit %f", ((TObjString*)pTokens->At(i))->GetString().Atof());
882 else if (argument.CompareTo("rawreadermode")==0){
883 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
884 HLTWarning("Argument 'rawreadermode' is deprecated");
886 else if (argument.CompareTo("pp-run")==0){
887 HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
888 fClusterDeconv = false;
890 else if (argument.CompareTo("adc-threshold" )==0){
891 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
892 HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
894 else if (argument.CompareTo("oldrcuformat" )==0){
895 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
896 HLTWarning("Argument 'oldrcuformat' is deprecated.");
898 else if (argument.CompareTo("unsorted" )==0){
899 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
900 HLTDebug("Using unsorted reading.");
901 fClusterFinder->SetUnsorted(1);
903 else if (argument.CompareTo("nsigma-threshold")==0){
904 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
905 HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
907 else if (argument.CompareTo("-update-calibdb")==0){
908 fClusterFinder->UpdateCalibDB();
911 HLTError("unknown argument %s", argument.Data());
919 HLTError("missing parameter for argument %s", argument.Data());