--- /dev/null
+// **************************************************************************
+// This file is property of and copyright by the ALICE HLT Project *
+// ALICE Experiment at CERN, All rights reserved. *
+// *
+// Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de>
+// for The ALICE HLT Project. *
+// *
+// Permission to use, copy, modify and distribute this software and its *
+// documentation strictly for non-commercial purposes is hereby granted *
+// without fee, provided that the above copyright notice appears in all *
+// copies and that both the copyright notice and this permission notice *
+// appear in the supporting documentation. The authors make no claims *
+// about the suitability of this software for any purpose. It is *
+// provided "as is" without express or implied warranty. *
+// *
+//***************************************************************************
+
+
+#include "AliHLTComponentBenchmark.h"
+
+AliHLTComponentBenchmark::AliHLTComponentBenchmark( const char *Name )
+ :fComponentName(Name),fNTimers(0),fNEvents(0), fTotalInput(0),fTotalOutput(0), fStatistics()
+{
+ // !
+ Reset();
+}
+
+void AliHLTComponentBenchmark::Reset()
+{
+ // !
+ fNEvents = 0;
+ fTotalInput = 0;
+ fTotalOutput = 0;
+ for( int i=0; i<10; i++ ){
+ fTimers[i].Reset();
+ fTotalRealTime[i] = 0;
+ fTotalCPUTime[i] = 0;
+ }
+ fStatistics = "";
+}
+
+void AliHLTComponentBenchmark::SetName( const char *Name )
+{
+ // !
+ fComponentName = Name;
+}
+
+void AliHLTComponentBenchmark::SetTimer( Int_t i, const char *Name )
+{
+ // !
+ if( i>=10 ) return;
+ if( i>=fNTimers ){
+ for( ; fNTimers<=i; fNTimers++ ){
+ fTimers[fNTimers].Reset();
+ fTotalRealTime[fNTimers] = 0;
+ fTotalCPUTime[fNTimers] = 0;
+ fNames[fNTimers] = Form("timer %d",fNTimers);
+ }
+ fNames[i] = Name;
+ }
+}
+
+void AliHLTComponentBenchmark::StartNewEvent()
+{
+ // !
+ fNEvents++;
+ for( int i=0; i<10; i++ ){
+ fTimers[i].Reset();
+ }
+}
+
+void AliHLTComponentBenchmark::Start( Int_t i )
+{
+ // !
+ if( i>=10 ) return;
+ fTimers[i].Start();
+}
+
+void AliHLTComponentBenchmark::Stop( Int_t i )
+{
+ // !
+ if( i>=10 ) return;
+ fTimers[i].Stop();
+ fTotalRealTime[i]+= fTimers[i].RealTime();
+ fTotalCPUTime[i] += fTimers[i].CpuTime();
+}
+
+
+void AliHLTComponentBenchmark::AddInput( Double_t x )
+{
+ // !
+ fTotalInput+=x;
+}
+
+void AliHLTComponentBenchmark::AddOutput( Double_t x )
+{
+ // !
+ fTotalOutput+=x;
+}
+
+const char *AliHLTComponentBenchmark::GetStatistics()
+{
+ // !
+ if( fNEvents<=0 ) return fStatistics.Data();
+ float ratio = 1;
+ if( fTotalInput >0 ) ratio = fTotalOutput / fTotalInput;
+
+ fStatistics = Form("%s, %d events: in %.1f Kb, out %.1f Kb, ratio %.1f",
+ fComponentName.Data(), fNEvents, fTotalInput/fNEvents/1024, fTotalOutput/fNEvents/1024, ratio);
+
+ if( fNTimers<=0 ) return fStatistics.Data();
+ fStatistics+=Form("; Time %.1fms/%.1fHz (real/cpu = ",fTotalRealTime[0]/fNEvents*1.e3,fNEvents/fTotalRealTime[0]);
+
+ for( int i=0; i<fNTimers; i++ ){
+ if( i>0 ) fStatistics+=", ";
+ fStatistics+= Form("%s %.1f/%.1fms",fNames[i].Data(),fTotalRealTime[i]/fNEvents*1.e3, fTotalCPUTime[i]/fNEvents*1.e3 );
+ }
+ fStatistics+=")";
+ return fStatistics.Data();
+}
--- /dev/null
+//-*- Mode: C++ -*-
+// ************************************************************************
+// This file is property of and copyright by the ALICE HLT Project *
+// ALICE Experiment at CERN, All rights reserved. *
+// See cxx source for full Copyright notice *
+// *
+//*************************************************************************
+
+
+#ifndef ALIHLTCOMPONENTBENCHMARK_H
+#define ALIHLTCOMPONENTBENCHMARK_H
+
+#include "TStopwatch.h"
+#include "TString.h"
+
+/**
+ * @class AliHLTComponentBenchmark
+ *
+ * AliHLTComponentBenchmark can be used to benchmark HLT compnoents
+ */
+class AliHLTComponentBenchmark
+{
+ public:
+
+ AliHLTComponentBenchmark( const char *Name="" );
+ ~AliHLTComponentBenchmark(){}
+
+ void Reset();
+ void SetName( const char *Name );
+ void SetTimer( Int_t i, const char *Name );
+ void StartNewEvent();
+ void Start( Int_t i );
+ void Stop( Int_t i );
+ void AddInput( Double_t x );
+ void AddOutput( Double_t x );
+ const char *GetStatistics();
+
+ private:
+
+ TString fComponentName;// name of the component
+ Int_t fNTimers; // n of timers
+ TStopwatch fTimers[10]; // the timers
+ TString fNames[10]; // timer names
+ ULong_t fNEvents; // N events processed
+ Double_t fTotalRealTime[10]; // total real time
+ Double_t fTotalCPUTime[10]; // total CPU time
+ Double_t fTotalInput; // total input size
+ Double_t fTotalOutput; // total output size
+ TString fStatistics;// string with statistics
+};
+
+#endif
fSSD(NULL),
tD(NULL),
tR(NULL),
- fclusters()
+ fclusters(),
+ fBenchmark(GetComponentID())
{
// see header file for class documentation
// or
Int_t AliHLTITSClusterFinderComponent::DoInit( int argc, const char** argv ) {
// see header file for class documentation
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"reco");
+
/*
fStatTime = 0;
fStatTimeAll = 0;
return 0;
}
-// #include "TStopwatch.h"
-
int AliHLTITSClusterFinderComponent::DoEvent
(
const AliHLTComponentEventData& evtData,
HLTDebug("no blocks in event" );
return 0;
}
-
- // TStopwatch timer;
+
+ fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
+ for( const AliHLTComponentBlockData *i= GetFirstInputBlock(fInputDataType); i!=NULL; i=GetNextInputBlock() ){
+ fBenchmark.AddInput(i->fSize);
+ }
+
Int_t ret = 0;
- //std::vector<AliITSRecPoint> vclusters;
+
if(fModeSwitch==kClusterFinderDigits) {
+
for ( const TObject *iter = GetFirstInputObject(fInputDataType); iter != NULL; iter = GetNextInputObject() ) {
tD = dynamic_cast<TTree*>(const_cast<TObject*>( iter ) );
if(!tD){
fDettype->MakeBranch(tR,"R");
fDettype->SetTreeAddressR(tR);
Option_t *opt="All";
+ fBenchmark.Start(1);
fDettype->DigitsToRecPoints(tD,tR,0,opt,kTRUE);
-
+ fBenchmark.Stop(1);
TClonesArray * fRecPoints;
tR->SetBranchAddress("ITSRecPoints",&fRecPoints);
for(Int_t treeEntry=0;treeEntry<tR->GetEntries();treeEntry++){
break;
}
if( nClusters>0 ){
-
+ fBenchmark.Start(1);
RecPointToSpacePoint(outputPtr,size);
-
+ fBenchmark.Stop(1);
AliHLTComponentBlockData bd;
FillBlockData( bd );
bd.fOffset = size;
bd.fDataType = GetOutputDataType();
outputBlocks.push_back( bd );
size += bufferSize;
-
+ fBenchmark.AddOutput(bd.fSize);
fclusters.clear();
}
}
if(!fRawReader->AddBuffer((UChar_t*) iter->fPtr, iter->fSize, id)){
HLTWarning("Could not add buffer");
}
- // TStopwatch timer1;
-
+
+ fBenchmark.Start(1);
+
if(fModeSwitch==kClusterFinderSPD && !fUseOfflineFinder){ fSPD->RawdataToClusters( fRawReader, fclusters ); }
else if(fModeSwitch==kClusterFinderSSD && !fUseOfflineFinder){ fSSD->RawdataToClusters( fclusters ); }
else{
fClusters[i] = NULL;
}
}
-
- // timer1.Stop();
- // fStatTime+=timer1.RealTime();
- // fStatTimeC+=timer1.CpuTime();
+ fBenchmark.Stop(1);
fRawReader->ClearBuffers();
bd.fDataType = GetOutputDataType();
outputBlocks.push_back( bd );
size += bufferSize;
-
+ fBenchmark.AddOutput(bd.fSize);
fclusters.clear();
}
} // input blocks
}
- /*
- timer.Stop();
-
- fStatTimeAll+=timer.RealTime();
- fStatTimeAllC+=timer.CpuTime();
- fStatNEv++;
- if( fStatNEv%1000==0 && fStatTimeAll>0.0 && fStatTime>0.0 && fStatTimeAllC>0.0 && fStatTimeC>0.0)
- cout<<fStatTimeAll/fStatNEv*1.e3<<" "<<fStatTime/fStatNEv*1.e3<<" "
- <<fStatTimeAllC/fStatNEv*1.e3<<" "<<fStatTimeC/fStatNEv*1.e3<<" ms"<<endl;
- */
+ fBenchmark.Stop(0);
+ HLTInfo(fBenchmark.GetStatistics());
return ret;
}
#include "TClonesArray.h"
#include "AliHLTDataTypes.h"
#include "TTree.h"
+#include "AliHLTComponentBenchmark.h"
class AliHLTITSClusterFinderSPD;
class AliHLTITSClusterFinderSSD;
TTree *tR; //!transient
std::vector<AliITSRecPoint> fclusters; //!transient
- /*
- int fStatNEv;
- double fStatTime;
- double fStatTimeAll;
- double fStatTimeC;
- double fStatTimeAllC;
- */
+
+ AliHLTComponentBenchmark fBenchmark;// benchmark
ClassDef(AliHLTITSClusterFinderComponent, 0)
AliHLTITSTrackerComponent::AliHLTITSTrackerComponent()
:
fSolenoidBz( 0 ),
- fFullTime( 0 ),
- fRecoTime( 0 ),
- fNEvents( 0 ),
+ fBenchmark("ITSTracker"),
fTracker(0)
{
// see header file for class documentation
:
AliHLTProcessor(),
fSolenoidBz( 0 ),
- fFullTime( 0 ),
- fRecoTime( 0 ),
- fNEvents( 0 ),
+ fBenchmark("ITSTracker"),
fTracker(0)
{
// see header file for class documentation
// Some parameters can be later overwritten from the OCDB
fSolenoidBz = -5.00668;
- fFullTime = 0;
- fRecoTime = 0;
- fNEvents = 0;
+
}
int AliHLTITSTrackerComponent::ReadConfigurationString( const char* arguments )
fSolenoidBz=GetBz();
fTracker = new AliITStrackerHLT(0);
-
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"reco");
return ret;
}
return 0;
}
-
- TStopwatch timer;
+ fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
// Event reconstruction in ITS
// Read TPC tracks
if( iter->fDataType == ( kAliHLTDataTypeTrack|kAliHLTDataOriginTPC ) ){
+ fBenchmark.AddInput(iter->fSize);
AliHLTTracksData* dataPtr = ( AliHLTTracksData* ) iter->fPtr;
int nTracks = dataPtr->fCount;
AliHLTExternalTrackParam* currOutTrack = dataPtr->fTracklets;
(iter->fDataType == (kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD) ) ||
(iter->fDataType == (kAliHLTDataTypeClusters|kAliHLTDataOriginITSSDD) )
){
+
+ fBenchmark.AddInput(iter->fSize);
AliHLTITSClusterData *inPtr=reinterpret_cast<AliHLTITSClusterData*>( iter->fPtr );
int nClusters = inPtr->fSpacePointCnt;
// Reconstruct the event
- TStopwatch timerReco;
-
- fTracker->Reconstruct( &(tracksTPC[0]), tracksTPC.size() );
-
- timerReco.Stop();
+ fBenchmark.Start(1);
+ fTracker->Reconstruct( &(tracksTPC[0]), tracksTPC.size() );
+ fBenchmark.Stop(1);
+
// Fill output tracks
int nITSUpdated = 0;
} else {
resultData.fDataType = kAliHLTDataTypeTrack|kAliHLTDataOriginITSOut;
}
+ fBenchmark.AddOutput(resultData.fSize);
outputBlocks.push_back( resultData );
size += resultData.fSize;
}
}
- timer.Stop();
- fFullTime += timer.RealTime();
- fRecoTime += timerReco.RealTime();
- fNEvents++;
+ fBenchmark.Stop(0);
// Set log level to "Warning" for on-line system monitoring
- int hz = ( int ) ( fFullTime > 1.e-10 ? fNEvents / fFullTime : 100000 );
- int hz1 = ( int ) ( fRecoTime > 1.e-10 ? fNEvents / fRecoTime : 100000 );
- HLTInfo( "ITS Tracker: output %d tracks; input %d clusters, %d tracks; time: full %d / reco %d Hz",
- nITSUpdated, nClustersTotal, tracksTPC.size(), hz, hz1 );
+ HLTInfo( "ITS Tracker: output %d tracks; input %d clusters, %d tracks",
+ nITSUpdated, nClustersTotal, tracksTPC.size() );
+ HLTInfo(fBenchmark.GetStatistics());
return iResult;
}
#include "AliHLTProcessor.h"
#include "AliHLTDataTypes.h"
+#include "AliHLTComponentBenchmark.h"
class AliITStrackerHLT;
/** magnetic field */
double fSolenoidBz; // see above
- double fFullTime; //* total time for DoEvent() [s]
- double fRecoTime; //* total reconstruction time [s]
- Long_t fNEvents; //* number of reconstructed events
+ AliHLTComponentBenchmark fBenchmark;// benchmark
AliITStrackerHLT *fTracker; // the tracker itself
/** set configuration parameters **/
fFirstTimeBin(-1),
fLastTimeBin(-1),
fDoMC(kFALSE),
- fReleaseMemory( kFALSE )
+ fReleaseMemory( kFALSE ),
+ fBenchmark("TPCClusterFinder")
{
// see header file for class documentation
// or
if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
fClusterFinder->SetLastTimeBin(fLastTimeBin);
}
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"reco");
return iResult;
}
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);
}
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;
}
*/
#include "AliHLTProcessor.h"
+#include "AliHLTComponentBenchmark.h"
class AliHLTTPCClusterFinder;
class AliHLTTPCDigitReader;
Bool_t fDoMC; // flag to provide MC labels
Bool_t fReleaseMemory; // flag to release the memory after each event
+ AliHLTComponentBenchmark fBenchmark; // benchmark
+
/// the default configuration entry for this component
static const char* fgkOCDBEntryPacked; //!transient
static const char* fgkOCDBEntryUnpacked; //!transient
AliHLTTPCCAGlobalMergerComponent::AliHLTTPCCAGlobalMergerComponent()
- : fGlobalMerger( 0 ), fSolenoidBz( 0 ), fClusterErrorCorrectionY(0), fClusterErrorCorrectionZ(0)
+: fGlobalMerger( 0 ), fSolenoidBz( 0 ), fClusterErrorCorrectionY(0), fClusterErrorCorrectionZ(0), fBenchmark("GlobalMerger")
{
// see header file for class documentation
}
fSolenoidBz = -5.00668;
fClusterErrorCorrectionY = 0;
fClusterErrorCorrectionZ = 1.1;
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"reco");
}
int AliHLTTPCCAGlobalMergerComponent::ReadConfigurationString( const char* arguments )
if ( !IsDataEvent() ) {
return 0;
}
+ fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
fGlobalMerger->Clear();
continue;
}
+ fBenchmark.AddInput(block->fSize);
+
int slice = AliHLTTPCDefinitions::GetMinSliceNr( *block );
if ( slice < 0 || slice >= AliHLTTPCTransform::GetNSlice() ) {
HLTError( "invalid slice number %d extracted from specification 0x%08lx, skipping block of type %s",
fwrite(sliceOut, 1, sliceOut->EstimateSize(sliceOut->NTracks(), sliceOut->NTrackClusters()), fp);
fclose(fp);*/
}
+ fBenchmark.Start(1);
fGlobalMerger->Reconstruct();
+ fBenchmark.Stop(1);
const AliHLTTPCCAMergerOutput *mergerOutput = fGlobalMerger->Output();
resultData.fDataType = kAliHLTDataTypeTrack|kAliHLTDataOriginTPC;
resultData.fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification( 0, 35, 0, 5 );
outputBlocks.push_back( resultData );
+ fBenchmark.AddOutput(resultData.fSize);
+
size = resultData.fSize;
}
HLTInfo( "CAGlobalMerger:: output %d tracks", mergerOutput->NTracks() );
*/
+ fBenchmark.Stop(0);
+ HLTInfo( fBenchmark.GetStatistics() );
return iResult;
}
*/
#include "AliHLTProcessor.h"
+#include "AliHLTComponentBenchmark.h"
class AliHLTTPCCAMerger;
class AliHLTTPCVertex;
double fSolenoidBz; // magnetic field
double fClusterErrorCorrectionY; // correction for the cluster error during pre-fit
double fClusterErrorCorrectionZ; // correction for the cluster error during pre-fit
+ AliHLTComponentBenchmark fBenchmark;// benchmark
ClassDef( AliHLTTPCCAGlobalMergerComponent, 0 )
};
#include "AliHLTTPCSpacePointData.h"
#include "AliHLTTPCDefinitions.h"
#include "AliHLTTPCCADef.h"
-#include "TStopwatch.h"
const AliHLTComponentDataType AliHLTTPCCADefinitions::fgkCompressedInputDataType = AliHLTComponentDataTypeInitializer( "CAINPACK", kAliHLTDataOriginTPC );
AliHLTTPCCAInputDataCompressorComponent::AliHLTTPCCAInputDataCompressorComponent()
:
AliHLTProcessor(),
- fTotalTime( 0 ),
- fTotalInputSize( 0 ),
- fTotalOutputSize( 0 ),
- fNEvents( 0 )
+ fBenchmark("CAInputCompressor")
{
// see header file for class documentation
// or
AliHLTTPCCAInputDataCompressorComponent::AliHLTTPCCAInputDataCompressorComponent( const AliHLTTPCCAInputDataCompressorComponent& )
:
AliHLTProcessor(),
- fTotalTime( 0 ),
- fTotalInputSize( 0 ),
- fTotalOutputSize( 0 ),
- fNEvents( 0 )
+ fBenchmark("CAInputCompressor")
{
// see header file for class documentation
HLTFatal( "copy constructor untested" );
int AliHLTTPCCAInputDataCompressorComponent::DoInit( int /*argc*/, const char** /*argv*/ )
{
// Configure the CA tracker component
- fTotalTime = 0;
- fTotalInputSize = 0;
- fTotalOutputSize = 0;
- fNEvents = 0;
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"reco");
return 0;
}
return 0;
}
- TStopwatch timer;
+ fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
// Preprocess the data for CA Slice Tracker
Int_t ret = 0;
- Int_t inTotalSize = 0;
Int_t outTotalSize = 0;
Int_t minSlice = 100;
Int_t maxSlice = -1;
const AliHLTComponentBlockData* iter = blocks + ndx;
if ( iter->fDataType != AliHLTTPCDefinitions::fgkClustersDataType ) continue;
+ fBenchmark.AddInput(iter->fSize);
+
if( minSlice>AliHLTTPCDefinitions::GetMinSliceNr( *iter ) ) minSlice = AliHLTTPCDefinitions::GetMinSliceNr( *iter ) ;
if( maxSlice<AliHLTTPCDefinitions::GetMaxSliceNr( *iter ) ) maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr( *iter ) ;
- inTotalSize += iter->fSize;
AliHLTUInt32_t dSize = 0;
-
+
+ fBenchmark.Start(1);
+
ret = Compress( ( AliHLTTPCClusterData* )( iter->fPtr ), maxBufferSize - outTotalSize,
outputPtr+outTotalSize,
dSize );
-
+ fBenchmark.Stop(1);
+
if ( ret!=0 ){
HLTWarning( "Output buffer size exceed (buffer size %d, current size %d)", maxBufferSize );
break;
bd.fDataType = GetOutputDataType();
outputBlocks.push_back( bd );
outTotalSize+=dSize;
+ fBenchmark.AddOutput(bd.fSize);
}
size = outTotalSize;
- timer.Stop();
+ fBenchmark.Stop(0);
- fTotalTime += timer.RealTime();
- fTotalInputSize+= inTotalSize;
- fTotalOutputSize+= outTotalSize;
- fNEvents++;
-
if( maxSlice<0 ) minSlice = -1;
- Int_t hz = ( int ) ( fTotalTime > 1.e-10 ? fNEvents / fTotalTime : 100000 );
- Float_t ratio = 0;
- if( fTotalOutputSize>0 ) ratio = (Float_t ) (fTotalInputSize/fTotalOutputSize);
- // Set log level to "Warning" for on-line system monitoring
-
- HLTInfo( "CAInputDataCompressor, slices %d-%d: speed %d Hz, ratio %f, %d events", minSlice, maxSlice, hz, ratio, fNEvents );
+ // Set log level to "Warning" for on-line system monitorin
+ if( minSlice!=maxSlice ) fBenchmark.SetName(Form("CAInputDataCompressor, slices %d-%d", minSlice, maxSlice));
+ else fBenchmark.SetName(Form("CAInputDataCompressor, slice %d", minSlice));
+
+ HLTInfo( fBenchmark.GetStatistics());
return ret;
}
#define ALIHLTTPCCAINPUTDATACOMPRESSORCOMPONENT_H
#include "AliHLTProcessor.h"
+#include "AliHLTComponentBenchmark.h"
+
class AliHLTTPCClusterData;
/**
private:
- double fTotalTime; //* total time for DoEvent() [s]
- double fTotalInputSize; //* total input size in [bytes]
- double fTotalOutputSize; //* total output size in [bytes]
- Long_t fNEvents; //* number of reconstructed events
+ AliHLTComponentBenchmark fBenchmark; // benchmarks
ClassDef( AliHLTTPCCAInputDataCompressorComponent, 0 );
};
#include "AliHLTTPCTrackletDataFormat.h"
#include "AliHLTTPCDefinitions.h"
#include "AliExternalTrackParam.h"
-#include "TStopwatch.h"
#include "TMath.h"
#include "AliCDBEntry.h"
#include "AliCDBManager.h"
fNeighboursSearchArea( 0 ),
fClusterErrorCorrectionY(0),
fClusterErrorCorrectionZ(0),
- fFullTime( 0 ),
- fRecoTime( 0 ),
- fNEvents( 0 ),
+ fBenchmark("CATracker"),
fAllowGPU( 0)
{
// see header file for class documentation
fNeighboursSearchArea(0),
fClusterErrorCorrectionY(0),
fClusterErrorCorrectionZ(0),
- fFullTime( 0 ),
- fRecoTime( 0 ),
- fNEvents( 0 ),
+ fBenchmark("CATracker"),
fAllowGPU( 0)
{
// see header file for class documentation
fNeighboursSearchArea = 0;
fClusterErrorCorrectionY = 0;
fClusterErrorCorrectionZ = 0;
- fFullTime = 0;
- fRecoTime = 0;
- fNEvents = 0;
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"reco");
}
int AliHLTTPCCATrackerComponent::ReadConfigurationString( const char* arguments )
return 0;
}
- TStopwatch timer;
+ fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
// Event reconstruction in one TPC slice with CA Tracker
if ( iter->fDataType == AliHLTTPCDefinitions::fgkClustersDataType ){
AliHLTTPCClusterData* inPtrSP = ( AliHLTTPCClusterData* )( iter->fPtr );
nClustersTotal += inPtrSP->fSpacePointCnt;
+ fBenchmark.AddInput(iter->fSize);
} else
if ( iter->fDataType == AliHLTTPCCADefinitions::fgkCompressedInputDataType){
+ fBenchmark.AddInput(iter->fSize);
const AliHLTUInt8_t * inPtr = (const AliHLTUInt8_t *)iter->fPtr;
while( inPtr< ((const AliHLTUInt8_t *) iter->fPtr) + iter->fSize ){
AliHLTTPCCACompressedClusterRow *row = (AliHLTTPCCACompressedClusterRow*)inPtr;
memset(sliceOutput, 0, slicecount * sizeof(AliHLTTPCCASliceOutput*));
// reconstruct the event
- TStopwatch timerReco;
+
+ fBenchmark.Start(1);
fTracker->SetOutputControl(&outputControl);
fTracker->ProcessSlices(minslice, slicecount, clusterData, sliceOutput);
- timerReco.Stop();
+ fBenchmark.Stop(1);
int ret = 0;
unsigned int mySize = 0;
bd.fDataType = GetOutputDataType();
outputBlocks.push_back( bd );
size += mySize;
+ fBenchmark.AddOutput(bd.fSize);
}
}
}
+
//No longer needed
delete[] clusterData;
delete[] sliceOutput;
- timer.Stop();
-
- fFullTime += timer.RealTime();
- fRecoTime += timerReco.RealTime();
- fNEvents++;
+ fBenchmark.Stop(0);
// Set log level to "Warning" for on-line system monitoring
- int hz = ( int ) ( fFullTime > 1.e-10 ? fNEvents / fFullTime : 100000 );
- int hz1 = ( int ) ( fRecoTime > 1.e-10 ? fNEvents / fRecoTime : 100000 );
+
//Min and Max Patch are taken for first slice processed...
- HLTInfo( "CATracker slices %d-%d: output %d tracks; input %d clusters, patches %d..%d, rows %d..%d; time: full %d / reco %d Hz",
- minslice, maxslice, ntracks, nClustersTotalSum, sliceminPatch[0], slicemaxPatch[0], slicerow[0], slicerow[1], hz, hz1 );
+ if( minslice==maxslice ) fBenchmark.SetName(Form("CATracker slice %d",minslice));
+ else fBenchmark.SetName(Form("CATracker slices %d-%d",minslice,maxslice));
+
+ HLTInfo(fBenchmark.GetStatistics());
//No longer needed
delete[] slicerow;
#define ALIHLTTPCCATRACKERCOMPONENT_H
#include "AliHLTProcessor.h"
+#include "AliHLTComponentBenchmark.h"
class AliHLTTPCCATrackerFramework;
class AliHLTTPCCASliceOutput;
double fClusterErrorCorrectionY; // correction for the cluster errors
double fClusterErrorCorrectionZ; // correction for the cluster errors
- double fFullTime; //* total time for DoEvent() [s]
- double fRecoTime; //* total reconstruction time [s]
- Long_t fNEvents; //* number of reconstructed events
+ AliHLTComponentBenchmark fBenchmark; // benchmarks
bool fAllowGPU; //* Allow this tracker to run on GPU
static bool CompareClusters( AliHLTTPCSpacePointData *a, AliHLTTPCSpacePointData *b );
, fVerbosity(0)
, fESD(NULL)
, fSolenoidBz(-5.00668)
+ , fBenchmark("EsdConverter")
{
// see header file for class documentation
// or
SetupCTPData();
}
+ fBenchmark.SetTimer(0,"total");
+
return iResult;
}
int iResult=0;
if (!fESD) return -ENODEV;
+ if (IsDataEvent()) fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
+
AliESDEvent* pESD = fESD;
pESD->Reset();
} else {
iResult=PushBack(pESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginOut, 0);
}
+ fBenchmark.AddOutput(GetLastObjectSize());
}
if (pTree) {
// clear user info list to prevent objects from being deleted
pTree->GetUserInfo()->Clear();
delete pTree;
}
+
+ fBenchmark.Stop(0);
+ HLTInfo( fBenchmark.GetStatistics() );
+
return iResult;
}
// in the first attempt this component reads the TPC tracks and updates in the
// second step from the ITS tracks
-
// first read MC information (if present)
std::map<int,int> mcLabels;
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrackMC|kAliHLTDataOriginTPC);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
+
+ fBenchmark.AddInput(pBlock->fSize);
+
AliHLTTrackMCData* dataPtr = reinterpret_cast<AliHLTTrackMCData*>( pBlock->fPtr );
if (sizeof(AliHLTTrackMCData)+dataPtr->fCount*sizeof(AliHLTTrackMCLabel)==pBlock->fSize) {
for( unsigned int il=0; il<dataPtr->fCount; il++ ){
Int_t ndEdxTPC = 0;
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypedEdx|kAliHLTDataOriginTPC);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
+ fBenchmark.AddInput(pBlock->fSize);
dEdxTPC = reinterpret_cast<AliHLTFloat32_t*>( pBlock->fPtr );
ndEdxTPC = pBlock->fSize / sizeof(AliHLTFloat32_t);
break;
// convert the TPC tracks to ESD tracks
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginTPC);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
+ fBenchmark.AddInput(pBlock->fSize);
vector<AliHLTGlobalBarrelTrack> tracks;
if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>=0) {
for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
// Get ITS SPD vertex
+ for( const AliHLTComponentBlockData *i= GetFirstInputBlock(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS); i!=NULL; i=GetNextInputBlock() ){
+ fBenchmark.AddInput(i->fSize);
+ }
for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS); iter != NULL; iter = GetNextInputObject() ) {
AliESDVertex *vtx = dynamic_cast<AliESDVertex*>(const_cast<TObject*>( iter ) );
// now update ESD tracks with the ITSOut info
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginITSOut);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
+ fBenchmark.AddInput(pBlock->fSize);
vector<AliHLTGlobalBarrelTrack> tracks;
if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
// now update ESD tracks with the ITS info
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginITS);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
+ fBenchmark.AddInput(pBlock->fSize);
vector<AliHLTGlobalBarrelTrack> tracks;
if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeGlobalVertexer);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
-
+ fBenchmark.AddInput(pBlock->fSize);
AliHLTGlobalVertexerComponent::FillESD( pESD, reinterpret_cast<AliHLTGlobalVertexerComponent::AliHLTGlobalVertexerData* >(pBlock->fPtr) );
}
// convert the HLT TRD tracks to ESD tracks
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack | kAliHLTDataOriginTRD);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
+ fBenchmark.AddInput(pBlock->fSize);
vector<AliHLTGlobalBarrelTrack> tracks;
if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
}
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeCaloCluster | kAliHLTDataOriginAny); pBlock!=NULL; pBlock=GetNextInputBlock())
{
+ fBenchmark.AddInput(pBlock->fSize);
AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr = reinterpret_cast<AliHLTCaloClusterHeaderStruct*>(pBlock->fPtr);
HLTDebug("%d HLT clusters from spec: 0x%X", caloClusterHeaderPtr->fNClusters, pBlock->fSpecification);
}
// Add tracks from MUON.
+ for( const AliHLTComponentBlockData *i= GetFirstInputBlock(kAliHLTAnyDataType | kAliHLTDataOriginMUON); i!=NULL; i=GetNextInputBlock() ){
+ fBenchmark.AddInput(i->fSize);
+ }
+
for (const TObject* obj = GetFirstInputObject(kAliHLTAnyDataType | kAliHLTDataOriginMUON);
obj != NULL;
obj = GetNextInputObject()
*/
#include "AliHLTProcessor.h"
+#include "AliHLTComponentBenchmark.h"
#include <vector>
// forward declarations
/// solenoid b field
Double_t fSolenoidBz; //! transient
+ AliHLTComponentBenchmark fBenchmark; // benchmark
ClassDef(AliHLTGlobalEsdConverterComponent, 0)
};
:
fNTracks(0),
fTrackInfos(0),
- fPrimaryVtx(),
- fNEvents(0),
+ fPrimaryVtx(),
fFitTracksToVertex(1),
fConstrainedTrackDeviation(4.),
fV0DaughterPrimDeviation( 2.5 ),
fV0Chi(3.5),
fV0DecayLengthInSigmas(3.),
fV0TimeLimit(10.e-3),
- fStatTimeR( 0 ),
- fStatTimeC( 0 ),
- fStatTimeR1( 0 ),
- fStatTimeC1( 0 ),
- fStatTimeR2( 0 ),
- fStatTimeC2( 0 ),
- fStatTimeR3( 0 ),
- fStatTimeC3( 0 ),
- fStatNEvents(0)
+ fBenchmark("GlobalVertexer")
{
// see header file for class documentation
// or
{
// init
- fStatTimeR = 0;
- fStatTimeC = 0;
- fStatTimeR1 = 0;
- fStatTimeC1 = 0;
- fStatTimeR2 = 0;
- fStatTimeC2 = 0;
- fStatTimeR3 = 0;
- fStatTimeC3 = 0;
- fStatNEvents = 0;
+ fBenchmark.Reset();
+ fBenchmark.SetTimer(0,"total");
+ fBenchmark.SetTimer(1,"convert");
+ fBenchmark.SetTimer(2,"vprim");
+ fBenchmark.SetTimer(3,"v0");
fV0TimeLimit = 10.e-3;
- fNEvents =0;
-
int iResult=0;
TString configuration="";
TString argument="";
fV0PrimDeviation =3.5;
fV0Chi = 3.5;
fV0DecayLengthInSigmas = 3.;
- fNEvents = 0;
fV0TimeLimit = 10.e-3;
return 0;
return 0;
int iResult = 0;
-
- fNEvents++;
- TStopwatch timer;
+ //cout<<"SG: GlobalVertexer:: DoEvent called"<<endl;
+ fBenchmark.StartNewEvent();
+ fBenchmark.Start(0);
+
vector< AliExternalTrackParam > tracks;
vector< int > trackId;
vector< pair<int,int> > v0s;
AliESDEvent *event = 0;
+ for( const AliHLTComponentBlockData *i= GetFirstInputBlock(kAliHLTDataTypeESDObject); i!=NULL; i=GetNextInputBlock() ){
+ fBenchmark.AddInput(i->fSize);
+ }
+
+
for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDObject); iter != NULL; iter = GetNextInputObject() ) {
event = dynamic_cast<AliESDEvent*>(const_cast<TObject*>( iter ) );
if( !event ) continue;
+
event->GetStdContent();
Int_t nESDTracks=event->GetNumberOfTracks();
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginITS);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
-
+
+ fBenchmark.AddInput(pBlock->fSize);
+
AliHLTTracksData* dataPtr = reinterpret_cast<AliHLTTracksData*>( pBlock->fPtr );
int nTracks = dataPtr->fCount;
if( tracks.size()==0 ){
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginTPC);
pBlock!=NULL; pBlock=GetNextInputBlock()) {
-
+
+ fBenchmark.AddInput(pBlock->fSize);
+
AliHLTTracksData* dataPtr = reinterpret_cast<AliHLTTracksData*>( pBlock->fPtr );
int nTracks = dataPtr->fCount;
AliHLTExternalTrackParam* currOutTrack = dataPtr->fTracklets;
AliKFParticle::SetField( GetBz() );
+ fBenchmark.Start(1);
+
{ //* Fill fTrackInfo array
- TStopwatch timer1;
-
if( fTrackInfos ) delete[] fTrackInfos;
fTrackInfos = 0;
fNTracks=tracks.size();
info.fOK = 1;
info.fPrimUsedFlag = 0;
info.fParticle = AliKFParticle( tracks[iTr], 211 );
+ for( int i=0; i<8; i++ ) if( !finite(info.fParticle.GetParameter(i)) ) info.fOK = 0;
+ for( int i=0; i<36; i++ ) if( !finite(info.fParticle.GetCovariance(i)) ) info.fOK = 0;
}
- timer1.Stop();
- fStatTimeR1+=timer1.RealTime();
- fStatTimeC1+=timer1.CpuTime();
}
-
- TStopwatch timer2;
+
+ fBenchmark.Stop(1);
+ fBenchmark.Start(2);
FindPrimaryVertex();
- timer2.Stop();
- fStatTimeR2+=timer2.RealTime();
- fStatTimeC2+=timer2.CpuTime();
- TStopwatch timer3;
+ fBenchmark.Stop(2);
+ fBenchmark.Start(3);
FindV0s( v0s );
- timer3.Stop();
- fStatTimeR3+=timer3.RealTime();
- fStatTimeC3+=timer3.CpuTime();
+ fBenchmark.Stop(3);
int *buf = new int[sizeof(AliHLTGlobalVertexerData)/sizeof(int)+1 + fNTracks + 2*v0s.size()];
AliHLTGlobalVertexerData *data = reinterpret_cast<AliHLTGlobalVertexerData*>(buf);
unsigned int blockSize = sizeof(AliHLTGlobalVertexerData) + (data->fNPrimTracks + 2*data->fNV0s)*sizeof(int);
iResult = PushBack( reinterpret_cast<void*>(data), blockSize, kAliHLTDataTypeGlobalVertexer|kAliHLTDataOriginOut );
+ fBenchmark.AddOutput(blockSize);
}
if( iResult==0 && data && data->fPrimNContributors >=3 ){
AliESDVertex vESD( data->fPrimP, data->fPrimC, data->fPrimChi2, data->fPrimNContributors );
iResult = PushBack( (TObject*) &vESD, kAliHLTDataTypeESDVertex|kAliHLTDataOriginOut,0 );
+ fBenchmark.AddOutput(GetLastObjectSize());
}
}
if( iResult==0 && event && data ){
FillESD( event, data );
iResult = PushBack( event, kAliHLTDataTypeESDObject|kAliHLTDataOriginOut, 0);
+ fBenchmark.AddOutput(GetLastObjectSize());
}
delete[] buf;
- timer.Stop();
- fStatTimeR+=timer.RealTime();
- fStatTimeC+=timer.CpuTime();
- fStatNEvents++;
-
- /*
- //if( fStatNEv%100==0 )
- cout<<"SG: "<<GetComponentID()<<": "<<fStatNEvents<<" events, real time: total= "
- <<fStatTimeR/fStatNEvents*1.e3<<" / create= "<<fStatTimeR1/fStatNEvents*1.e3
- <<" / vprim= "<<fStatTimeR2/fStatNEvents*1.e3<<" / v0= "<<fStatTimeR3/fStatNEvents*1.e3
- <<", CPU: total= "<<fStatTimeC/fStatNEvents*1.e3<<" / create= "<<fStatTimeC1/fStatNEvents*1.e3
-<<" / vprim= "<<fStatTimeC2/fStatNEvents*1.e3<<" / v0= "<<fStatTimeC2/fStatNEvents*1.e3
- <<" ms"<<endl;
- */
+ fBenchmark.Stop(0);
+ HLTInfo(fBenchmark.GetStatistics());
return iResult;
}
vIndex[nSelected] = i;
nSelected++;
}
+
fPrimaryVtx.ConstructPrimaryVertex( vSelected, nSelected, vFlag, fConstrainedTrackDeviation );
for( Int_t i = 0; i<nSelected; i++){
info.fPrimDeviation = info.fParticle.GetDeviationFromVertex( fPrimaryVtx );
}
- //cout<<"SG: prim vtx event"<<fStatNEvents<<": n selected="<<nSelected<<", ncont="<<fPrimaryVtx.GetNContributors()<<endl;
if( fPrimaryVtx.GetNContributors()<3 ){
for( Int_t i = 0; i<fNTracks; i++)
if( (++statN)%100 ==0 ){
if( timer.RealTime()>= fV0TimeLimit ){ run = 0; break; }
- timer.Start();
+ timer.Continue();
}
//* check if the particles fit
#include "AliHLTProcessor.h"
#include "AliKFParticle.h"
#include "AliKFVertex.h"
+#include "AliHLTComponentBenchmark.h"
+
class TH1F;
class TH2F;
class AliESDtrack;
int fNTracks; // n of input tracks
AliESDTrackInfo *fTrackInfos; // information about esd tracks
AliKFVertex fPrimaryVtx; // reconstructed KF primary vertex
-
- Int_t fNEvents; // n of processed events
-
Bool_t fFitTracksToVertex; // flag to store vertex constrained track parameters
Double_t fConstrainedTrackDeviation; // deviation of a track from prim.vtx <=cut
Double_t fV0DaughterPrimDeviation; // v0: daughters deviation from prim vertex >= cut
Double_t fV0TimeLimit; // time limit in seconds for V0 finder (it has N^2 combinatorics, therefore it can [potentially] block the data flow on some very hot events ) default limit is 10 ms
- Double_t fStatTimeR; // benchmark
- Double_t fStatTimeC; // benchmark
- Double_t fStatTimeR1; // benchmark
- Double_t fStatTimeC1; // benchmark
- Double_t fStatTimeR2; // benchmark
- Double_t fStatTimeC2; // benchmark
- Double_t fStatTimeR3; // benchmark
- Double_t fStatTimeC3; // benchmark
- Double_t fStatNEvents;// benchmark
+ AliHLTComponentBenchmark fBenchmark;// benchmark
ClassDef(AliHLTGlobalVertexerComponent, 0);
AliHLTGlobalBarrelTrack.h \
AliHLTAgentUtil.h \
AliHLTESDCaloClusterMaker.h \
- AliHLTCaloClusterReader.h
+ AliHLTCaloClusterReader.h \
+ AliHLTComponentBenchmark.h
# AliHLTMCGeneratorComponent.h