#include "AliHLTTPCTrackGeometry.h"
#include "AliHLTTPCHWCFSpacePointContainer.h"
#include "AliHLTErrorGuard.h"
+#include "AliHLTComponentBenchmark.h"
#include "AliRawDataHeader.h"
#include "AliTPCclusterMI.h"
#include "AliTPCROC.h"
AliHLTTPCDataCompressionMonitorComponent::AliHLTTPCDataCompressionMonitorComponent()
: AliHLTProcessor()
+ , fpBenchmark(NULL)
+ , fpDecoder(NULL)
, fpHWClusterDecoder(NULL)
, fHistoHWCFDataSize(NULL)
, fHistoHWCFReductionFactor(NULL)
return iResult;
}
+ if (GetBenchmarkInstance()) {
+ GetBenchmarkInstance()->StartNewEvent();
+ GetBenchmarkInstance()->Start(0);
+ }
+
const AliHLTComponentBlockData* pDesc=NULL;
unsigned rawDataSize=0;
unsigned rawEventSizeFromRCUtrailer=0;
}
if (fMonitoringContainer) {
+ if (GetBenchmarkInstance()) {
+ GetBenchmarkInstance()->Start(1);
+ }
+
for (pDesc=GetFirstInputBlock(AliHLTTPCDefinitions::RemainingClusterIdsDataType());
pDesc!=NULL; pDesc=GetNextInputBlock()) {
iResult=fMonitoringContainer->AddClusterIds(pDesc);
}
// read data
- AliHLTTPCDataCompressionDecoder decoder;
+ AliHLTTPCDataCompressionDecoder& decoder=*fpDecoder;
+ decoder.Clear();
bool bHaveRawClusters=false;
for (pDesc=GetFirstInputBlock(AliHLTTPCDefinitions::RawClustersDataType());
pDesc!=NULL; pDesc=GetNextInputBlock()) {
ALIHLTERRORGUARD(5, "conflicting data blocks, monitoring histograms already filled from raw cluster data, ignoring blocks of compressed partition and track clusters");
}
}
+ if (GetBenchmarkInstance()) {
+ GetBenchmarkInstance()->Stop(1);
+ }
fMonitoringContainer->Clear();
}
iResult=Publish(fPublishingMode);
}
+ if (GetBenchmarkInstance()) {
+ GetBenchmarkInstance()->Stop(0);
+ HLTBenchmark("%s", GetBenchmarkInstance()->GetStatistics());
+ }
+
return iResult;
}
if (yaxis) yaxis->SetTitle("reduction factor");
}
+ std::auto_ptr<AliHLTComponentBenchmark> benchmark(new AliHLTComponentBenchmark);
+ if (benchmark.get()) {
+ benchmark->SetTimer(0,"total");
+ benchmark->SetTimer(1,"clusterdecoding");
+ } else {
+ return -ENOMEM;
+ }
+
+ auto_ptr<AliHLTTPCDataCompressionDecoder> decoder(new AliHLTTPCDataCompressionDecoder);
+ if (!decoder.get()) {
+ return -ENOMEM;
+ }
+
+
fHistoHWCFDataSize=histoHWCFDataSize.release();
fHistoHWCFReductionFactor=histoHWCFReductionFactor.release();
fHistoTotalReductionFactor=histoTotalReductionFactor.release();
fpHWClusterDecoder=hwClusterDecoder.release();
fMonitoringContainer=dataContainer.release();
+ fpBenchmark=benchmark.release();
+ fpDecoder=decoder.release();
return iResult;
}
/// inherited from AliHLTComponent: component cleanup
int iResult=0;
+ if (fpBenchmark) delete fpBenchmark; fpBenchmark=NULL;
+ if (fpDecoder) delete fpDecoder;
+ fpDecoder=NULL;
if (fpHWClusterDecoder) delete fpHWClusterDecoder;
fpHWClusterDecoder=NULL;
if (fHistograms3D) delete fHistograms3D;
}
-AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::iterator& AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::BeginRemainingClusterBlock(int /*count*/, AliHLTUInt32_t specification)
+AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::iterator& AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::BeginPartitionClusterBlock(int /*count*/, AliHLTUInt32_t specification)
{
/// iterator of remaining clusters block of specification
AliHLTUInt8_t slice=AliHLTTPCDefinitions::GetMinSliceNr(specification);
fHistogram3DPointers[index]->Fill(fSector,pad,currentRow);
AliTPCROC *roc=AliTPCROC::Instance();
+ if (roc) {
Float_t pos[3]={0.,0.,0.};
roc->GetPositionGlobal(fSector, fSector>35?currentRow-63:currentRow, (int)pad, pos);
if (fSector<=17 || (fSector>=36&&fSector<=53))
if (index<fHistogram2DPointers.size() && fHistogram2DPointers[index]!=NULL)
fHistogram2DPointers[index]->Fill(pos[0],pos[1]);
}
+ }
}
class AliHLTDataInflater;
class AliHLTTPCTrackGeometry;
class AliHLTTPCHWCFSpacePointContainer;
+class AliHLTComponentBenchmark;
+class AliHLTTPCDataCompressionDecoder;
class TH1;
class TH2;
class TH3;
void SetSigmaZ2(float sigmaZ2) {if (fData) fData->FillSigmaZ2(sigmaZ2, fClusterId);}
void SetCharge(unsigned charge) {if (fData) fData->FillCharge(charge, fClusterId);}
void SetQMax(unsigned qmax) {if (fData) {fData->FillQMax(qmax, fClusterId);fData->Fill(fSlice, fPartition, fClusterId);}}
+ iterator& operator=(const AliHLTTPCRawCluster& cluster) {if (fData) {
+ fData->FillPadRow(cluster.GetPadRow(), fSlice, fClusterId);
+ fData->FillPad(cluster.GetPad(), fClusterId);
+ fData->FillTime(cluster.GetTime(), fClusterId);
+ fData->FillSigmaY2(cluster.GetSigmaY2(), fClusterId, fPartition);
+ fData->FillSigmaZ2(cluster.GetSigmaZ2(), fClusterId);
+ fData->FillCharge(cluster.GetCharge(), fClusterId);
+ fData->FillQMax(cluster.GetQMax(), fClusterId);
+ fData->Fill(fSlice, fPartition, fClusterId);
+ } return *this;}
void SetMC(const AliHLTTPCClusterMCLabel* /*pMC*/) {/* nop */}
// switch to next cluster
int fPartition; //! current partition
};
- /// iterator of remaining clusters block of specification
- iterator& BeginRemainingClusterBlock(int count, AliHLTUInt32_t specification);
+ /// legacy, to be removed later
+ iterator& BeginRemainingClusterBlock(int count, AliHLTUInt32_t specification) {
+ return BeginPartitionClusterBlock(count, specification);
+ }
+ /// iterator of partition clusters block of specification
+ iterator& BeginPartitionClusterBlock(int count, AliHLTUInt32_t specification);
/// iterator of track model clusters
iterator& BeginTrackModelClusterBlock(int count);
/// publish to output
int Publish(int mode);
+
+ AliHLTComponentBenchmark* GetBenchmarkInstance() const {return fpBenchmark;}
private:
AliHLTTPCDataCompressionMonitorComponent(const AliHLTTPCDataCompressionMonitorComponent&);
AliHLTTPCDataCompressionMonitorComponent& operator=(const AliHLTTPCDataCompressionMonitorComponent&);
+ /// benchmark
+ AliHLTComponentBenchmark* fpBenchmark; //! benchmark instance
+ AliHLTTPCDataCompressionDecoder* fpDecoder; //! cluster decoder instance
AliHLTTPCHWCFData* fpHWClusterDecoder; //! data decoder for HW clusters
TH2* fHistoHWCFDataSize; //! hwcf data size vs. event size