]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/EveHLT/AliEveHLTEventManager.cxx
Coverity
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHLTEventManager.cxx
index e3287d514baad1eb1a46522e5a14f15b80e90745..8037174606fcfb863bd3c273701120b0202c1382 100644 (file)
@@ -6,7 +6,6 @@
 #include "TEveViewer.h"
 #include "TEveEventManager.h"
 
-//#include "AliHLTTriggerDecision.h"
 #include "AliHLTEvePhos.h"
 #include "AliHLTEveEmcal.h"
 #include "AliHLTEveTPC.h"
@@ -17,6 +16,7 @@
 #include "AliHLTEveISDD.h"
 #include "AliHLTEveTRD.h"
 #include "AliHLTEveMuon.h"
+#include "AliHLTEveMultCorr.h"
 #include "AliHLTEveAny.h"
 
 #include "AliEveHLTEventManager.h"
@@ -25,7 +25,6 @@
 
 #include "TList.h"
 #include "TTimer.h"
-
 #include "TThread.h"
 
 ClassImp(AliEveHLTEventManager);
@@ -51,12 +50,14 @@ AliEveHLTEventManager::AliEveHLTEventManager() :
   fISDDElement(NULL),
   fTRDElement(NULL),
   fMuonElement(NULL),
+  fMultCorrElement(NULL),
   fAnyElement(NULL),
   fEventLoopStarted(kFALSE),
   fCenterProjectionsAtPrimaryVertex(kFALSE),
   fShowBarrel(kTRUE),
   fShowMuon(kFALSE), 
-  fRunNumber(-1)  
+  fRunNumber(666),
+  fEventId(-1)
 {
   // see header file for class documentation
   // or
@@ -119,6 +120,10 @@ void AliEveHLTEventManager::DestroyDetectorElements(){
   if(fMuonElement)
     delete fMuonElement;
   fMuonElement = NULL;
+
+  if(fMultCorrElement)
+    delete fMultCorrElement;
+  fMultCorrElement = NULL;
  
   if(fAnyElement)
     delete fAnyElement;
@@ -146,19 +151,15 @@ Int_t AliEveHLTEventManager::ProcessEvent(AliESDEvent * event) {
 
   gEve->DisableRedraw();
 
+  event->GetStdContent();
   // -- Set EventID in Window Title  
   TString winTitle("Eve Main Window");
-  winTitle += Form("-- Run Number: %d", event->GetRunNumber()); 
-  winTitle += Form("-- Event ID : 0x%016lX ", GetEventBuffer()->GetEventId() );
+  SetRunNumber(event->GetRunNumber());
+  SetEventId(GetEventBuffer()->GetEventId());
+  winTitle += Form("-- Run Number: %d", GetRunNumber()); 
+  winTitle += Form("-- Event ID : 0x%016lX ", GetEventId() );
   GetEveManager()->GetBrowser()->SetWindowName(winTitle);
 
-
-  
-  cout << "reset()"<<endl;
-  
-  ResetDisplay();
-  
-  cout << "process()"<<endl;
   if(!fHLTElement) {
     fHLTElement = new AliHLTEveHLT();
     fHLTElement->SetEventManager(this);
@@ -172,10 +173,7 @@ Int_t AliEveHLTEventManager::ProcessEvent(AliESDEvent * event) {
   if(!fEmcalElement) CreateEmcalElement();
   fEmcalElement->ProcessEvent(event);
   
-  cout << "update()"<<endl;
-  UpdateDisplay();
-
-  gEve->Redraw3D(0, 1);
+  gEve->FullRedraw3D(0, 1);
   gEve->EnableRedraw();
 
   return 0;
@@ -194,19 +192,16 @@ Int_t AliEveHLTEventManager::ProcessEvent(TList * blockList) {
     return -1;
   }
  
-  cout << "ProcessEvent()::reset ()"<<endl;
-  ResetDisplay();
-  cout << "ProcessEvent() :: done reset()"<<endl;
+  gEve->DisableRedraw();
+
   AliHLTHOMERBlockDesc * block = NULL;
   TIter next(blockList);
   while ((block = (AliHLTHOMERBlockDesc*)next())) {
     cout <<"Process Block"<<endl;
     ProcessBlock(block);
   } 
-
-  cout << "update() "<<endl;
-  UpdateDisplay();
   
+
   return 0;
 
 }
@@ -250,6 +245,12 @@ void AliEveHLTEventManager::ProcessBlock(AliHLTHOMERBlockDesc * block) {
        if(event) {
          ProcessEvent(event);
        }
+      
+      } else if(!(block->GetDataType().CompareTo("ROOTTOBJ"))) {
+
+       if(!fMultCorrElement) CreateMultCorrElement();
+       fMultCorrElement->ProcessBlock(block);
+      
       } else {
        fHLTElement->ProcessBlock(block);
       }
@@ -282,6 +283,15 @@ void AliEveHLTEventManager::ProcessBlock(AliHLTHOMERBlockDesc * block) {
     
     else if ( ! block->GetDetector().CompareTo("MUON") ) {
       //Do Nothing
+      if(!block->GetDataType().CompareTo("ROOTHIST")) {
+       if(!fMuonElement) {
+         fMuonElement = new AliHLTEveMuon();
+         fMuonElement->SetEventManager(this);
+         gEve->AddElement(fMuonElement);
+       }
+       fMuonElement->ProcessBlock(block);
+      }
+    
     } else {
       if(!fAnyElement) {
        fAnyElement = new AliHLTEveAny();
@@ -348,9 +358,13 @@ void AliEveHLTEventManager::ResetDisplay () {
 void AliEveHLTEventManager::PrintScreens() {
 //   //See header file for documentation
 
-//   fEveManager->GetDefaultGLViewer()->SavePicture(Form("%d_0x%lu_3D.gif", fRunNumber, GetEventID(fCurrentEventIdx)));
-//   fRhoZViewer->GetGLViewer()->SavePicture(Form("%d_0x%lu_RhoZ.gif", fRunNumber, GetEventID(fCurrentEventIdx)));
-//   fRPhiViewer->GetGLViewer()->SavePicture(Form("%d_0x%lu_RPhi.gif", fRunNumber, GetEventID(fCurrentEventIdx)));
+  Float_t scale = 4.f;
+  //Int_t width = 4000;
+  //Int_t height = 2000;
+
+  fEveManager->GetDefaultGLViewer()->SavePictureScale(Form("run_%d_0x%016lX_3D.gif", fRunNumber, GetEventId()), scale);
+  fRhoZViewer->GetGLViewer()->SavePictureScale(Form("run_%d_0x%016lX_RhoZ.gif", fRunNumber, GetEventId()), scale);
+  fRPhiViewer->GetGLViewer()->SavePictureScale(Form("run_%d_0x%016lX_RPhi.gif", fRunNumber, GetEventId()), scale);
   return;
 }
 
@@ -360,7 +374,7 @@ void AliEveHLTEventManager::StartLoop() {
   //fTimer->SetCommand("NextEvent()", "AliEveHLTEventManager", this);
   NextEvent();
   SetEventLoopStarted(kTRUE);
-  fTimer->Start(15000);
+  fTimer->Start(45000);
 }
 
 void AliEveHLTEventManager::StopLoop() {
@@ -406,6 +420,7 @@ void AliEveHLTEventManager::StopLoop() {
 
 void  AliEveHLTEventManager::UpdateDisplay() {
   //See header file for documentation
+  cout << "AliHLTEventManager::UpdateDisplay(); " <<endl;
   if(fPhosElement) fPhosElement->UpdateElements();
   if(fEmcalElement) fEmcalElement->UpdateElements();
   if(fTPCElement) fTPCElement->UpdateElements();
@@ -417,6 +432,7 @@ void  AliEveHLTEventManager::UpdateDisplay() {
   if(fTRDElement) fTRDElement->UpdateElements();
   if(fAnyElement) fAnyElement->UpdateElements();
   if(fMuonElement) fMuonElement->UpdateElements();
+  if(fMultCorrElement) fMultCorrElement->UpdateElements();
 
 
   //==============================================================================
@@ -450,12 +466,10 @@ void  AliEveHLTEventManager::UpdateDisplay() {
 
 void AliEveHLTEventManager::SaveEveryThing() {
 
-  GetEventBuffer()->WriteToFile();
-  //Save everything to file
-  //fEventBuffer->SaveBlockList();
-  //fEventBuffer->SaveAsyncBlockList();
-
-
+  //Print the screens
+  PrintScreens();
+  //Save block lists to file
+  GetEventBuffer()->WriteToFile(GetRunNumber());
 }
 
 
@@ -466,6 +480,12 @@ void AliEveHLTEventManager::CreatePhosElement() {
   gEve->AddElement(fPhosElement);
 }
 
+void AliEveHLTEventManager::CreateMultCorrElement() {
+  fMultCorrElement = new AliHLTEveMultCorr("MultCorr");
+  fMultCorrElement->SetEventManager(this);
+  gEve->AddElement(fMultCorrElement);
+}
+
 void AliEveHLTEventManager::CreateEmcalElement() {
   fEmcalElement = new AliHLTEveEmcal();
   fEmcalElement->SetEventManager(this);