#include "AliCDBEntry.h"
#include "AliCDBManager.h"
-#include "AliHLTDataTypes.h"
+#include "AliCDBStorage.h"
#include "AliITSgeomTGeo.h"
#include "AliITSRecPoint.h"
#include "AliHLTITSSpacePointData.h"
fSSD(NULL),
tD(NULL),
tR(NULL),
- fclusters()
+ fclusters(),
+ fBenchmark(GetComponentID())
{
// see header file for class documentation
// or
fOutputDataType = kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD;
break;
case kClusterFinderDigits:
- fInputDataType = kAliHLTDataTypeTTree|kAliHLTDataOriginITS;
+ fInputDataType = kAliHLTDataTypeAliTreeD|kAliHLTDataOriginITS;
fOutputDataType = kAliHLTDataTypeClusters|kAliHLTDataOriginITS;
break;
default:
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;
fStatTimeAllC = 0;
fStatNEv = 0;
*/
+
+ Int_t runNo = GetRunNo();
+ AliCDBStorage* store = AliCDBManager::Instance()->GetDefaultStorage();
+ if (!store) {
+ return NULL;
+ }
+
+ bool cdbOK = true;
+ //OCDB for SPD
+ if(store->GetLatestVersion("ITS/Calib/SPDNoisy", runNo)<0){
+ HLTError("SPDNoisy is not found in SPD/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("ITS/Calib/SPDDead", runNo)<0){
+ HLTError("SPDDead is not found in SPD/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("TRIGGER/SPD/PITConditions", runNo)<0){
+ HLTError("PITConditions is not found in TRIGGER/SPD");
+ cdbOK = false;
+ }
+
+ //OCDB for SDD
+ if(store->GetLatestVersion("ITS/Calib/CalibSDD", runNo)<0){
+ HLTError("CalibSDD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("ITS/Calib/RespSDD", runNo)<0){
+ HLTError("RespSDD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("ITS/Calib/DriftSpeedSDD", runNo)<0){
+ HLTError("DriftSpeedSDD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("ITS/Calib/DDLMapSDD", runNo)<0){
+ HLTError("DDLMapSDD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("ITS/Calib/MapsTimeSDD", runNo)<0){
+ HLTError("MapsTimeSDD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+
+ //OCDB for SSD
+ if(store->GetLatestVersion("ITS/Calib/NoiseSSD", runNo)<0){
+ HLTError("NoiseSSD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("ITS/Calib/GainSSD", runNo)<0){
+ HLTError("GainSSD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+ if(store->GetLatestVersion("ITS/Calib/BadChannelsSSD", runNo)<0){
+ HLTError("BadChannelsSSD is not found in ITS/Calib");
+ cdbOK = false;
+ }
+
+ //General reconstruction
+ if(store->GetLatestVersion("GRP/CTP/Scalers", runNo)<0){
+ HLTError("Scalers is not found in GRP/CTP/");
+ cdbOK = false;
+ }
+ if(!cdbOK){return NULL;}
+
if(fModeSwitch==kClusterFinderSPD) {
HLTDebug("using ClusterFinder for SPD");
//fNModules=AliITSgeomTGeo::GetNDetectors(1)*AliITSgeomTGeo::GetNLadders(1) + AliITSgeomTGeo::GetNDetectors(2)*AliITSgeomTGeo::GetNLadders(2);
fId=AliHLTDAQ::DdlIDOffset("ITSSSD");
fNddl=AliHLTDAQ::NumberOfDdls("ITSSSD");
}
- if(fModeSwitch==kClusterFinderDigits) {
+ else if(fModeSwitch==kClusterFinderDigits) {
//tR = new TTree();
}
else{
return 0;
}
-// #include "TStopwatch.h"
-
int AliHLTITSClusterFinderComponent::DoEvent
(
const AliHLTComponentEventData& evtData,
- const AliHLTComponentBlockData* blocks,
+ const AliHLTComponentBlockData* /*blocks*/,
AliHLTComponentTriggerData& /*trigData*/,
AliHLTUInt8_t* outputPtr,
AliHLTUInt32_t& size,
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();
}
}
// -- Set equipment ID to the raw reader
+ if(!fRawReader){
+ HLTWarning("The fRawReader pointer is NULL");
+ continue;
+ }
+
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;
}
AliHLTITSClusterData *outputClusters = reinterpret_cast<AliHLTITSClusterData*>(outputPtr + size);
outputClusters->fSpacePointCnt=fclusters.size();
int clustIdx=0;
- for(int i=0;i<fclusters.size();i++){
+ for(UInt_t i=0;i<fclusters.size();i++){
AliITSRecPoint *recpoint = (AliITSRecPoint*) &(fclusters[i]);
outputClusters->fSpacePoints[clustIdx].fY=recpoint->GetY();
outputClusters->fSpacePoints[clustIdx].fZ=recpoint->GetZ();