]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/global/AliHLTGlobalFlatEsdConverterComponent.cxx
remove unnecessary call to base ctor
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalFlatEsdConverterComponent.cxx
index c5d5a2b01dc59d9717f923a0889095ef2b1aa6d5..a44e0a46fbda6575da3c2ec04db11ddec782cf19 100644 (file)
@@ -50,8 +50,6 @@
 #include "TTree.h"
 #include "TList.h"
 #include "TClonesArray.h"
-#include "TTimeStamp.h"
-#include "THnSparse.h"
 //#include "AliHLTESDCaloClusterMaker.h"
 //#include "AliHLTCaloClusterDataStruct.h"
 //#include "AliHLTCaloClusterReader.h"
@@ -65,6 +63,8 @@
 #include "AliHLTTPCClusterMCData.h"
 #include "AliHLTTPCTransform.h"
 
+#include "AliSysInfo.h"
+
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTGlobalFlatEsdConverterComponent)
 
@@ -74,25 +74,13 @@ AliHLTGlobalFlatEsdConverterComponent::AliHLTGlobalFlatEsdConverterComponent()
   , fVerbosity(0)  
   , fSolenoidBz(-5.00668)
   , fBenchmark("FlatEsdConverter")
-  , fBenchmarkHistosFilename("$PWD/histosBenchmark.root")
-  , fInitialTime(0)
 {
   // see header file for class documentation
   // or
   // refer to README to build package
   // or
   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-  
-  
-  
-  
-  TFile *f = TFile::Open(fBenchmarkHistosFilename,"READ");
-  if(f!=0x0){
-       TNamed *t = (TNamed*)f->Get("time");
-       if(t!=0x0){
-         fInitialTime = atoi(t->GetTitle());
-       }
-  }
+
 }
 
 AliHLTGlobalFlatEsdConverterComponent::~AliHLTGlobalFlatEsdConverterComponent()
@@ -277,7 +265,13 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
                                                    AliHLTUInt32_t& size,
                                                    AliHLTComponentBlockDataList& outputBlocks)
 {
+
   // see header file for class documentation
+
+
+AliSysInfo::AddStamp("DoEvent.Start");
+
+
   int iResult=0;
   bool benchmark = true;
 
@@ -444,7 +438,7 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
 
     for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(AliHLTTPCDefinitions::fgkClustersDataType| kAliHLTDataOriginTPC);
         pBlock!=NULL; pBlock=GetNextInputBlock()) {
-      //fBenchmark.AddInput(pBlock->fSize);
+      fBenchmark.AddInput(pBlock->fSize);
       UInt_t slice     = AliHLTTPCDefinitions::GetMinSliceNr(*pBlock); 
       UInt_t patch  = AliHLTTPCDefinitions::GetMinPatchNr(*pBlock);
       if( slice >= kNSlices || patch>= kNPatches ){
@@ -456,7 +450,7 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
     
     for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo| kAliHLTDataOriginTPC);
         pBlock!=NULL; pBlock=GetNextInputBlock()) {
-      //fBenchmark.AddInput(pBlock->fSize);
+      fBenchmark.AddInput(pBlock->fSize);
       UInt_t slice     = AliHLTTPCDefinitions::GetMinSliceNr(*pBlock); 
       UInt_t patch  = AliHLTTPCDefinitions::GetMinPatchNr(*pBlock);
       if( slice >= kNSlices || patch>= kNPatches ){
@@ -568,11 +562,18 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
        }
        
        AliFlatESDTrack *flatTrack = flatEsd->GetNextTrackPointer();
+       new(flatTrack) AliFlatESDTrack;
+       //cout<<"flatTrack: "<<flatTrack<<endl;
+
+       //cout<<"GetNumberOfTPCClusters before: "<<flatTrack->GetNumberOfTPCClusters()<<endl;
 
        UInt_t nClustersTPC = tpcTrack->GetNumberOfPoints();
        UInt_t nClustersITS = itsRefit ?itsRefit->GetNumberOfPoints() :0;
 
        flatTrack->SetNumberOfITSClusters( nClustersITS );
+       //flatTrack->SetNumberOfTPCClusters(0);
+
+       //cout<<"GetNumberOfTPCClusters: "<<flatTrack->GetNumberOfTPCClusters()<<endl;
 
        if( flatEsd->GetSize() + flatTrack->EstimateSize( kTRUE, nClustersTPC ) >= maxOutputSize ){
                cout<<endl<<endl<<"NOT ENOUGH MEMORY!!!!"<<endl<<endl;
@@ -603,7 +604,8 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
                 continue;
              } 
              const AliHLTTPCSpacePointData &cIn = clusterBlock->fSpacePoints[iCluster];
-             AliFlatTPCCluster *c= flatTrack->GetNextTPCClusterPointer();
+
+             AliFlatTPCCluster *c= flatTrack->GetTPCCluster( flatTrack->GetNumberOfTPCClusters() );;
              c->fX = cIn.GetX();
              c->fY = cIn.GetY();
              c->fZ = cIn.GetZ();
@@ -616,6 +618,8 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
           }
        }
 
+               //      cout<<"number of tpc clusters: "<<flatTrack->GetNumberOfTPCClusters()<<endl;
+                       //cout<<"number of its clusters: "<<flatTrack->GetNumberOfITSClusters()<<endl;
        
        flatEsd->StoreLastTrack();
        
@@ -629,6 +633,7 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
   {    
     const AliHLTComponentBlockData* pP = GetFirstInputBlock(kAliHLTDataTypeGlobalVertexer|kAliHLTDataOriginOut);
     if (pP && pP->fSize && pP->fPtr) {
+               fBenchmark.AddInput(pP->fSize);
       const AliHLTGlobalVertexerComponent::AliHLTGlobalVertexerData *data = reinterpret_cast<AliHLTGlobalVertexerComponent::AliHLTGlobalVertexerData*>(pP->fPtr);
       const int* v0s = data->fTrackIndices + data->fNPrimTracks;
       nV0s = data->fNV0s;
@@ -647,6 +652,12 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
   for( const AliHLTComponentBlockData *i= GetFirstInputBlock(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS); i!=NULL; i=GetNextInputBlock() ){
     fBenchmark.AddInput(i->fSize);
   }
+  // Get Track vertex
+  for( const AliHLTComponentBlockData *i= GetFirstInputBlock(kAliHLTDataTypeESDVertex|kAliHLTDataOriginOut); i!=NULL; i=GetNextInputBlock() ){
+    fBenchmark.AddInput(i->fSize);
+  }
+
+
 
   /*
   for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS); iter != NULL; iter = GetNextInputObject() ) {
@@ -738,47 +749,23 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa
   
   if(benchmark){
        
-       TTimeStamp ts;
-       Double_t time = (Double_t) ts.GetSec() - fInitialTime;
-  
-       
-       
        Double_t statistics[10]; 
        TString names[10];
        fBenchmark.GetStatisticsData(statistics, names);
-         statistics[5] = tracksTPC.size();
-         statistics[6] = time;
-         statistics[7] = nV0s;
+       //  statistics[5] = tracksTPC.size();
+       //  statistics[7] = nV0s;
          
-         FillBenchmarkHistos( statistics, names);
-  printf("\nTIME:  %.1f \n\n",time);
- // printf("\nreal time:  %.9f \n\n",statistics[4]);
- // printf("\ncpu time:  %.9f \n\n",statistics[3]);
+       //  FillBenchmarkHistos( statistics, names);
          fBenchmark.Reset();
+
+       AliSysInfo::AddStamp("DoEvent.Stop", (int)(statistics[1]), (int)(statistics[2]) );
   
   }
   return iResult;
-}
 
 
-void AliHLTGlobalFlatEsdConverterComponent::FillBenchmarkHistos(Double_t *statistics, TString */*names*/){
 
 
-//  cout<<"Now writing benchmarks to " <<  fBenchmarkHistosFilename <<endl<<endl;
-    
-  TFile *f = TFile::Open(fBenchmarkHistosFilename,"UPDATE");
-  THnSparseD *s = (THnSparseD*)f->Get("benchmarkInformation");
-  TNamed *t = (TNamed*)f->Get("time");
-       
-  if(!s){
-       HLTWarning( "Benchmark Histograms not available!" );
-       return;
-  }
-  s->Fill(statistics);
+}
+
 
-  TList histosList;
-  histosList.Add(s);
-  histosList.Add(t);
-  histosList.SaveAs(fBenchmarkHistosFilename);
-  
-}
\ No newline at end of file