#include "AliHLTTPCTransform.h"
#include "AliHLTTPCClusters.h"
#include "AliHLTTPCDefinitions.h"
+#include "AliGRPObject.h"
#include "AliCDBEntry.h"
#include "AliCDBManager.h"
#include "AliTPCcalibDB.h"
#include "AliTPCCalPad.h"
#include "AliTPCParam.h"
+#include "AliTPCTransform.h"
+
+//#include "AliHLTTPCCAInputDataCompressorComponent.h"
+//#include "AliHLTTPCCADef.h"
#include <cstdlib>
#include <cerrno>
#include "AliCDBManager.h"
#include "AliCDBStorage.h"
#include "TGeoGlobalMagField.h"
+#include "AliGeomManager.h"
#include <sys/time.h>
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTTPCClusterFinderComponent)
-const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryPacked="HLT/ConfigTPC/TPCClusterFinderPacked";
-const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryUnpacked="HLT/ConfigTPC/TPCClusterFinderUnpacked";
-const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntryDecoder="HLT/ConfigTPC/TPCClusterFinderDecoder";
-const char* AliHLTTPCClusterFinderComponent::fgkOCDBEntry32Bit="HLT/ConfigTPC/TPCClusterFinder32Bit";
-
AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
:
fClusterFinder(NULL),
fReader(NULL),
fDeconvTime(kFALSE),
+ fTS(0),
fDeconvPad(kFALSE),
fClusterDeconv(false),
fXYClusterError(-1),
fFirstTimeBin(-1),
fLastTimeBin(-1),
fDoMC(kFALSE),
- fReleaseMemory( kFALSE )
+ fReleaseMemory( kFALSE ),
+ fBenchmark("TPCClusterFinder")
{
// see header file for class documentation
// or
tgtList.clear();
tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
tgtList.push_back(kAliHLTDataTypeHwAddr16);
+ //tgtList.push_back(AliHLTTPCCADefinitions::fgkCompressedInputDataType);
return tgtList.size();
}
AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
//
if(!calib){
- HLTError("AliTPCcalibCD does not exist");
+ HLTError("AliTPCcalibDB does not exist");
return -ENOENT;
}
+
+ fTS = calib->GetTransform();
+
+ calib->SetRun(GetRunNo());
+ calib->UpdateRunInformations(GetRunNo());
AliTPCCalPad * time0TPC = calib->GetPadTime0();
if(!time0TPC){
HLTError("OCDB entry TPC/Calib/PadTime0 (AliTPCcalibDB::GetPadTime0()) is not available.");
}
calib->SetExBField(GetBz());
+ if(!AliGeomManager::GetGeometry()){
+ AliGeomManager::LoadGeometry();
+ }
+
fClusterFinder = new AliHLTTPCClusterFinder();
+ TObject* pOCDBEntry=LoadAndExtractOCDBObject("GRP/GRP/Data");
+ AliGRPObject* pGRP=pOCDBEntry?dynamic_cast<AliGRPObject*>(pOCDBEntry):NULL;
+ TString beamType;
+ if (pGRP) {
+ beamType=pGRP->GetBeamType();
+ }
+
// first configure the default
int iResult = 0;
- switch(fModeSwitch){
- case kClusterFinderPacked:
- iResult=ConfigureFromCDBTObjString(fgkOCDBEntryPacked);
- break;
- case kClusterFinderUnpacked:
- iResult=ConfigureFromCDBTObjString(fgkOCDBEntryUnpacked);
- break;
- case kClusterFinderDecoder:
- iResult=ConfigureFromCDBTObjString(fgkOCDBEntryDecoder);
- break;
- case kClusterFinder32Bit:
- iResult=ConfigureFromCDBTObjString(fgkOCDBEntry32Bit);
- break;
- }
+ TString cdbPath="HLT/ConfigTPC/";
+ cdbPath+=GetComponentID();
+ iResult=ConfigureFromCDBTObjString(cdbPath, beamType.Data());
// configure from the command line parameters if specified
if (iResult>=0 && argc>0)
if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
fClusterFinder->SetLastTimeBin(fLastTimeBin);
}
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"reco");
return iResult;
}
{
// see header file for class documentation
int iResult=0;
+ //SG!!!
+ //fDeconvTime = kTRUE;
+ //fClusterFinder->SetDeconvTime(fDeconvTime);
+ // fDeconvPad = kTRUE;
+ //fClusterFinder->SetDeconvPad(fDeconvPad);
+
+
+ fTS->SetCurrentTimeStamp(GetTimeStamp());
+ //fTS->SetCurrentTimeStamp(0);
if(fReader == NULL){
HLTFatal("Digit reader not initialized, skipping HLT TPC cluster reconstruction.");
return 0;
}
+ fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
+
// == init iter (pointer to datablock)
const AliHLTComponentBlockData* iter = NULL;
unsigned long ndx;
}
+ fBenchmark.AddInput(iter->fSize);
+
slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
fClusterFinder->InitSlice( slice, patch, maxPoints );
fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
+ fBenchmark.Start(1);
+
if(fUnsorted){
if(fGetActivePads){
fClusterFinder->SetDoPadSelection(kTRUE);
fClusterFinder->Read(iter->fPtr, iter->fSize );
fClusterFinder->ProcessDigits();
}
+ fBenchmark.Stop(1);
+
fReader->Reset();
realPoints = fClusterFinder->GetNumberOfClusters();
bd.fSpecification = iter->fSpecification;
bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType;
outputBlocks.push_back( bd );
-
+
+ fBenchmark.AddOutput(bd.fSize);
+
tSize += mysize;
outBPtr += mysize;
outPtr = (AliHLTTPCClusterData*)outBPtr;
bdHW.fDataType = kAliHLTDataTypeHwAddr16;
outputBlocks.push_back( bdHW );
+ fBenchmark.AddOutput(bdHW.fSize);
tSize+=nHWAdd*sizeof(AliHLTUInt16_t);
}
+ /*
+ { // compressed output for the CA tracker
+
+ AliHLTUInt32_t dSize = 0;
+
+ int ret = AliHLTTPCCAInputDataCompressorComponent::Compress( (AliHLTTPCClusterData*)( outputPtr + bd.fOffset ),
+ size - tSize,
+ outputPtr+tSize,
+ dSize );
+
+ if ( ret!=0 || tSize + dSize > size )
+ {
+ Logging( kHLTLogFatal, "HLT::TPCClusterFinder::DoEvent", "Too much data",
+ "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
+ tSize + dSize, size );
+ iResult=-ENOSPC;
+ break;
+ }
+
+ AliHLTComponentBlockData bdCompressed;
+ FillBlockData( bdCompressed );
+ bdCompressed.fOffset = tSize ;
+ bdCompressed.fSize = dSize;
+ bdCompressed.fSpecification = iter->fSpecification;
+ bdCompressed.fDataType = AliHLTTPCCADefinitions::fgkCompressedInputDataType;
+ outputBlocks.push_back( bdCompressed );
+
+ tSize += dSize;
+ outBPtr += dSize;
+ outPtr = (AliHLTTPCClusterData*)outBPtr;
+ }
+ */
+
if(fDoMC){
Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize)/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo)-1);
AliHLTTPCClusterFinder::ClusterMCInfo* outputMCInfo= (AliHLTTPCClusterFinder::ClusterMCInfo*)(outputPtr+tSize);
bdMCInfo.fSpecification = iter->fSpecification;
bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
outputBlocks.push_back( bdMCInfo );
-
+ fBenchmark.AddOutput(bdMCInfo.fSize);
+
tSize+=nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
}
if (iResult>=0)
size = tSize;
+ fBenchmark.Stop(0);
+ HLTInfo(fBenchmark.GetStatistics());
return iResult;
}
{
// see header file for class documentation
- const char* entry=cdbEntry;
- if (!entry || entry[0]==0){
- switch(fModeSwitch){
- case kClusterFinderPacked:
- entry=fgkOCDBEntryPacked;
- break;
- case kClusterFinderUnpacked:
- entry=fgkOCDBEntryUnpacked;
- break;
- case kClusterFinderDecoder:
- entry=fgkOCDBEntryDecoder;
- break;
- case kClusterFinder32Bit:
- entry=fgkOCDBEntry32Bit;
- break;
- }
+ TString cdbPath;
+ if (cdbEntry) {
+ cdbPath=cdbEntry;
+ } else {
+ cdbPath="HLT/ConfigTPC/";
+ cdbPath+=GetComponentID();
}
- return ConfigureFromCDBTObjString(entry);
+ return ConfigureFromCDBTObjString(cdbPath.Data());
/*
int iResult=0;
return iResult;
}
+void AliHLTTPCClusterFinderComponent::GetOCDBObjectDescription( TMap* const targetMap){
+// Get a list of OCDB object description needed for the particular component
+
+ if (!targetMap) return;
+
+ // OCDB entries for component arguments
+ targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinder32Bit"), new TObjString("component arguments, empty at the moment"));
+ targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderPacked"), new TObjString("component arguments, empty at the moment"));
+ targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderUnpacked"), new TObjString("component arguments, empty at the moment"));
+ targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderDecoder"), new TObjString("component arguments, empty at the moment"));
+
+ // OCDB entries to be fetched by the TAXI (access via the AliTPCcalibDB class)
+ targetMap->Add(new TObjString("TPC/Calib/Parameters"), new TObjString("unknown content"));
+ targetMap->Add(new TObjString("TPC/Calib/TimeDrift"), new TObjString("drift velocity calibration"));
+ targetMap->Add(new TObjString("TPC/Calib/Temperature"), new TObjString("temperature map"));
+ targetMap->Add(new TObjString("TPC/Calib/PadGainFactor"), new TObjString("gain factor pad by pad"));
+ targetMap->Add(new TObjString("TPC/Calib/ClusterParam"), new TObjString("cluster parameters"));
+
+ // OCDB entries needed to be fetched by the Pendolino
+ targetMap->Add(new TObjString("TPC/Calib/AltroConfig"), new TObjString("contains the altro config, e.g. info about the L0 trigger timing"));
+ targetMap->Add(new TObjString("GRP/CTP/CTPtiming"), new TObjString("content used in the cluster coordinate transformation in relation to the L0 trigger timing"));
+
+ // OCDB entries necessary for replaying data on the HLT cluster
+ targetMap->Add(new TObjString("GRP/GRP/Data"), new TObjString("contains magnetic field info"));
+
+ // OCDB entries needed to suppress fatals/errors/warnings during reconstruction
+ targetMap->Add(new TObjString("TPC/Calib/PadTime0"), new TObjString("time0 offset pad by pad"));
+ targetMap->Add(new TObjString("TPC/Calib/PadNoise"), new TObjString("pad noise values"));
+ targetMap->Add(new TObjString("TPC/Calib/Pedestals"), new TObjString("pedestal info"));
+ targetMap->Add(new TObjString("TPC/Calib/Pulser"), new TObjString("pulser info"));
+ targetMap->Add(new TObjString("TPC/Calib/CE"), new TObjString("CE laser calibration result"));
+ targetMap->Add(new TObjString("TPC/Calib/Raw"), new TObjString("unknown content"));
+ targetMap->Add(new TObjString("TPC/Calib/QA"), new TObjString("not important"));
+ targetMap->Add(new TObjString("TPC/Calib/Mapping"), new TObjString("unknown content"));
+ targetMap->Add(new TObjString("TPC/Calib/Goofie"), new TObjString("Goofie values, not used at the moment (05.03.2010)"));
+ targetMap->Add(new TObjString("TPC/Calib/HighVoltage"), new TObjString("high voltage values, not used"));
+ targetMap->Add(new TObjString("TPC/Calib/Ref"), new TObjString("unknown content"));
+}