]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix AliHLTGlobalEsdConverterComponent
authortbreitne <timo.gunther.breitner@cern.ch>
Thu, 20 Nov 2014 21:50:42 +0000 (22:50 +0100)
committertbreitne <timo.gunther.breitner@cern.ch>
Thu, 20 Nov 2014 21:59:30 +0000 (22:59 +0100)
after flatdev branch merging:
-- removed lots of std::cout
-- disabled creation of ESDfriends (sloooow)
-- fix library linking
-- bit of code cleanup

HLT/CMakelibAliHLTGlobal.pkg
HLT/global/AliHLTGlobalEsdConverterComponent.cxx

index 9f914dc60008ad9fb3713771942e858694f7081d..18bf686bd83ad19618940a2f7664b327ea0c2c56 100644 (file)
@@ -78,7 +78,7 @@ set ( MODULE_DHDR )
 
 set ( EINCLUDE  HLT/global HLT/global/physics HLT/BASE HLT/BASE/util HLT/TPCLib TPC TPC/Rec RAW TRD PHOS STEER/ESD STEER/STEERBase ANALYSIS STEER/STEER)
 
-set ( ELIBS  "HLTbase AliHLTUtil CDB ESD STEER STEERBase TPCrec TPCcalib TPCbase RAWDatarec RAWDatabase TRDbase -lEG")
+set ( ELIBS  "HLTbase AliHLTTPC AliHLTUtil CDB ESD STEER STEERBase TPCrec TPCcalib TPCbase RAWDatarec RAWDatabase TRDbase -lEG")
 
 set ( ELIBSDIR  "${ROOTLIBDIR}" )
 
index 10a0c78bc5799d2ffa08b449f645f41ac5ac251a..1658cddc1bfb935a684820182c34a4ea004494e2 100644 (file)
@@ -77,7 +77,7 @@ AliHLTGlobalEsdConverterComponent::AliHLTGlobalEsdConverterComponent()
   , fESD(NULL)
   , fESDfriend(NULL)
   , fSolenoidBz(-5.00668)
-  , fMakeFriends(1)
+  , fMakeFriends(0)
   , fBenchmark("EsdConverter")
 {
   // see header file for class documentation
@@ -94,8 +94,8 @@ AliHLTGlobalEsdConverterComponent::AliHLTGlobalEsdConverterComponent()
 AliHLTGlobalEsdConverterComponent::~AliHLTGlobalEsdConverterComponent()
 {
   // see header file for class documentation
-  delete fESD;
-  delete fESDfriend;
+  if (fESD) delete fESD;
+  if (fESDfriend) delete fESDfriend;
   for( int i=0; i<fkNPartition; i++ ){
     delete[] fPartitionClusters[i];
   }
@@ -278,10 +278,10 @@ int AliHLTGlobalEsdConverterComponent::DoInit(int argc, const char** argv)
 
   fSolenoidBz=GetBz();
 
-  delete fESD;
+  if(fESD) delete fESD;
   fESD = NULL;
-  delete fESDfriend;
-  fESDfriend=0;
+  if(fESDfriend) delete fESDfriend;
+  fESDfriend=NULL;
 
   if (iResult>=0) {
     fESD = new AliESDEvent;
@@ -329,9 +329,9 @@ int AliHLTGlobalEsdConverterComponent::DoInit(int argc, const char** argv)
 int AliHLTGlobalEsdConverterComponent::DoDeinit()
 {
   // see header file for class documentation
-  delete fESD;
+  if(fESD) delete fESD;
   fESD=NULL;
-  delete fESDfriend;
+  if(fESDfriend) delete fESDfriend;
   fESDfriend = NULL;
   return 0;
 }
@@ -342,11 +342,6 @@ int AliHLTGlobalEsdConverterComponent::DoEvent(const AliHLTComponentEventData& e
   // see header file for class documentation
   int iResult=0;
 
-
-  AliSysInfo::AddStamp("AliHLTGlobalEsdConverterComponent::DoEvent.Start", evtData.fStructSize);
-
-  bool benchmark = true;
-
   if (!fESD) return -ENODEV;
 
   if (!IsDataEvent()) return iResult;
@@ -404,13 +399,10 @@ int AliHLTGlobalEsdConverterComponent::DoEvent(const AliHLTComponentEventData& e
       pESD->WriteToTree(pTree);
       iResult=PushBack(pTree, kAliHLTDataTypeESDTree|kAliHLTDataOriginOut, 0);
     } else {
-      cout<<"Write ESD block: n tracks "<<pESD->GetNumberOfTracks()<<endl;
-      cout<<"Write ESD block: n v0s "<<pESD->GetNumberOfV0s()<<endl;
       iResult=PushBack(pESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginOut, 0);
     }
     fBenchmark.AddOutput(GetLastObjectSize());
     if( iResult>=0 && fMakeFriends ){
-      cout<<"Write ESD friend block: n friend tracks "<<fESDfriend->GetNumberOfTracks()<<endl;
       iResult=PushBack(fESDfriend, kAliHLTDataTypeESDfriendObject|kAliHLTDataOriginOut, 0);
       fBenchmark.AddOutput(GetLastObjectSize());
      }
@@ -422,28 +414,12 @@ int AliHLTGlobalEsdConverterComponent::DoEvent(const AliHLTComponentEventData& e
   }
 
   fBenchmark.Stop(0);
-  HLTWarning( fBenchmark.GetStatistics() );
-  
-    
-  
-  
-  
-  
-    if(benchmark){
-       
-       
-       Double_t statistics[10]; 
-       TString names[10];
-       fBenchmark.GetStatisticsData(statistics, names);
-         fBenchmark.Reset();
-  
-       AliSysInfo::AddStamp("AliHLTGlobalEsdConverterComponent::DoEvent.Stop", (int)(statistics[1]), (int)(statistics[2]),pESD->GetNumberOfTracks(),pESD->GetNumberOfV0s() );
-  }
+  HLTBenchmark( fBenchmark.GetStatistics() );
   
   for(Int_t i=0; i<fkNPartition; i++){
-      delete[] fPartitionClusters[i];    
-      fPartitionClusters[i]  = 0;
-      fNPartitionClusters[i] = 0;    
+    delete[] fPartitionClusters[i];    
+    fPartitionClusters[i]  = 0;
+    fNPartitionClusters[i] = 0;    
   }
 
   if( fESDfriend ) fESDfriend->Reset();
@@ -650,7 +626,6 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent*
     fBenchmark.AddInput(pBlock->fSize);
     vector<AliHLTGlobalBarrelTrack> tracks;
     if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>=0) {
-      cout<<"\n\n ESD converter: input "<<tracks.size()<<" TPC tracks"<<endl;
       for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
           element!=tracks.end(); element++) {
        Float_t points[4] = {
@@ -777,7 +752,7 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent*
          
          // Cook dEdx
          
-         AliTPCseed *seed = &(tTPC);      
+         //AliTPCseed *seed = &(tTPC);      
          //fSeedArray->AddAt( seed, TMath::Abs(seed->GetLabel()) );
          //fdEdx->Fill( seed->P()*seed->Charge(), seed->CookdEdx(0.02, 0.6) );
 
@@ -813,7 +788,6 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent*
       fBenchmark.AddInput(pBlock->fSize);
       AliFlatESDVertex *vtxFlat =  reinterpret_cast<AliFlatESDVertex*>( pBlock->fPtr );
       if (vtxFlat->GetNContributors()>0) {
-       cout<<"\n\n ESD converter: input vertexTrackSAP with "<<vtxFlat->GetNContributors()<<" contributors"<<endl;
        AliESDVertex vtx;
        vtxFlat->GetESDVertex(vtx);
        vtx.SetTitle("vertexITSSAP");
@@ -830,7 +804,6 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent*
       const AliHLTITSSAPTrackerDataContainer *dataSAP = reinterpret_cast<const AliHLTITSSAPTrackerDataContainer*>(pBlock->fPtr);
       AliITStrackV2 trcV2;
       int ntrITSSAP = dataSAP->fCount;
-      cout<<"\n\n ESD converter: input "<<ntrITSSAP<<" ITS SAP tracks"<<endl;
       for (int itr=0;itr<ntrITSSAP;itr++) {
        const AliHLTITSSAPTrackerData& trcFlatSAP = dataSAP->fTracks[itr];
        AliESDtrack inpESDtrc;
@@ -1158,7 +1131,6 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent*
 
   if( fMakeFriends && pESDfriend ){ // create friend track
     pESD->SetESDfriend( pESDfriend );
-    // cout<<"\n\n ESD Friend: "<<pESDfriend->GetNumberOfTracks()<<endl;
  }
   
  
@@ -1168,4 +1140,4 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent*
   
   if (iResult>=0) iResult=iAddedDataBlocks;
   return iResult;
-}
\ No newline at end of file
+}