Merge branch 'multipleThreads'
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 30 Oct 2010 09:52:05 +0000 (09:52 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 30 Oct 2010 09:52:05 +0000 (09:52 +0000)
* multipleThreads:
  multithread with TThread
  Bugfixes
  Updates, enabling use of offline buffer
  Major updates, making using Offline event buffer possible
  Adding offline.C onlinedisplay macro
  Added offline event manager instance
  Possibly stupid commit. Perhaps use the previous?
  working with multithre
  Added hlt event manager, not compileable

21 files changed:
EVE/EveHLT/AliEveEventBuffer.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveEventBuffer.h [new file with mode: 0644]
EVE/EveHLT/AliEveEventBufferHomer.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveEventBufferHomer.h [new file with mode: 0644]
EVE/EveHLT/AliEveEventBufferOffline.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveEventBufferOffline.h [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManager.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManager.h [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManagerEditor.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManagerEditor.h [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManagerHomer.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManagerHomer.h [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManagerOffline.cxx [new file with mode: 0644]
EVE/EveHLT/AliEveHLTEventManagerOffline.h [new file with mode: 0644]
EVE/EveHLT/AliEveHOMERManager.cxx
EVE/EveHLT/AliEveHOMERManager.h
EVE/EveHLT/AliEveHOMERManagerEditor.cxx
EVE/EveHLT/AliEveHOMERManagerEditor.h
EVE/EveHLT/EveHLTLinkDef.h
EVE/hlt-macros/od.C
EVE/hlt-macros/off.C [new file with mode: 0644]

diff --git a/EVE/EveHLT/AliEveEventBuffer.cxx b/EVE/EveHLT/AliEveEventBuffer.cxx
new file mode 100644 (file)
index 0000000..911a915
--- /dev/null
@@ -0,0 +1,308 @@
+#include <iostream>
+
+#include "TObjArray.h"
+#include "TTimer.h"
+#include "TThread.h"
+#include "AliEveEventBuffer.h"
+
+
+//Not needed, only for debug
+#include "AliESDEvent.h"
+
+using namespace std;
+
+ClassImp(AliEveEventBuffer)
+
+///_______________________________________________________________________
+AliEveEventBuffer::AliEveEventBuffer() :
+  fBufferSize(10),
+  fPreBuffer(4),
+  fBusy(kFALSE),
+  fEventBuffer(NULL),
+  fCurrentEvent(NULL),
+  fBIndex(),
+  fTimer(NULL),
+  fThread(NULL),
+  fEventId()
+ {
+  // see header file for class documentation
+  fEventBuffer = new TObjArray(10, 0);
+  fEventBuffer->SetOwner(kTRUE);
+  
+  for(int id = 0; id < kSize; id++) {
+    fBIndex[id] = -1;
+  }
+  
+  fTimer = new TTimer();
+  fTimer->Connect("Timeout()", "AliEveEventBuffer", this, "MonitorBuffer()");
+
+  fEventId = new Int_t[fBufferSize];
+
+
+}
+
+
+
+///_______________________________________________________________________
+AliEveEventBuffer::~AliEveEventBuffer() {
+  // see header file for class documentation
+  
+  if ( fEventBuffer ) {
+    fEventBuffer->Clear();
+    delete fEventBuffer;
+  }
+  fEventBuffer = NULL;
+
+  if(fCurrentEvent)
+    delete fCurrentEvent;
+  fCurrentEvent = NULL;
+
+}
+
+///___________________________________________________________________________
+void * AliEveEventBuffer::BufferThread(void * buffer) {
+  if(buffer)
+    reinterpret_cast<AliEveEventBuffer*>(buffer)->StartBufferMonitor();
+  return (void*)0;
+}
+
+///_____________________________________________________________________________
+void AliEveEventBuffer::MonitorBuffer() {
+  cout << "Monitorbuffer: " << endl;
+  if(fBusy) {
+    cout << "Already called FetchEvent()" << endl;
+    return;
+  } else {
+    cout << "fbusy = false"<<endl;
+    
+    if ( (CalculateDifference(fBIndex[kTop],fBIndex[kLast]) < fPreBuffer) ) {
+      fBusy = kTRUE;
+      FetchEvent();
+      fBusy = kFALSE;
+    } else {
+      //StopBufferMonitor();
+      fBusy = kFALSE;
+    }
+  }
+}
+
+///_______________________________________________________________________________
+TObject * AliEveEventBuffer::NextEvent() {
+  //See header file for documentation
+  if(fBusy) {
+    cout << "Event Buffer busy"<<endl;
+    return NULL;
+  }
+  else SetBusy(kTRUE);
+  cout << "In enxtevent"<<endl;
+  TObject * nextEvent = GetNextUnSeen();
+  SetBusy(kFALSE);
+  return nextEvent;
+}
+
+///______________________________________________________________________________
+TObject * AliEveEventBuffer::Back() {
+  cout << "go back"<<endl;
+  PrintIndeces();
+  Int_t prevId = CalculatePrevious(fBIndex[kCurrent]);
+  if(prevId == fBIndex[kTop]) {
+    cout << "returning NULL" << endl;
+    return NULL;
+  } else {
+    fBIndex[kCurrent] = prevId;
+    PrintIndeces();
+    cout <<"returning: "<< fBIndex[kCurrent] << " " << fEventBuffer->At(fBIndex[kCurrent]);
+    return fEventBuffer->At(fBIndex[kCurrent]);
+  }
+}
+
+///______________________________________________________________________________
+TObject * AliEveEventBuffer::Fwd() {
+  PrintIndeces();
+  if (fBIndex[kCurrent] == fBIndex[kLast]) {
+    cout<<  "returning NULL"<<endl;
+    return NULL;
+  }
+  
+  fBIndex[kCurrent] = CalculateNext(fBIndex[kCurrent]);
+  TObject * event = fEventBuffer->At(fBIndex[kCurrent]);
+  return event;
+}
+
+
+
+///________________________________________________________________________________
+TObject * AliEveEventBuffer::GetNextUnSeen() {
+  //See header file for documentation
+  cout << "GetNextUnSeend"<<endl;
+  PrintIndeces();
+  if(CalculateDifference(fBIndex[kTop], fBIndex[kLast])) {
+    fBIndex[kLast] = CalculateNext(fBIndex[kLast]);
+    fBIndex[kCurrent] = fBIndex[kLast];
+    PrintIndeces();
+    return fEventBuffer->At(fBIndex[kCurrent]);      
+  } else {
+    cout << "No new event available, only events in buffer available!"<<endl;
+    return NULL;
+  } 
+}
+///_________________________________________________________________________________
+void AliEveEventBuffer::PrintIndeces() {
+  for(Int_t i = 0; i < kSize; i++) {
+    cout << i << ": " << fBIndex[i] << endl;
+  }
+}
+///_________________________________________________________________________________
+void AliEveEventBuffer::PrintBuffer() {
+  for(Int_t i = 0; i < 10; i++) {
+    AliESDEvent * event = dynamic_cast<AliESDEvent*>(fEventBuffer->At(i));
+    if(event) {
+      cout << i << ": " <<event << " " << event->GetEventNumberInFile() << endl;;
+    }
+  }
+}
+
+///____________________________________________________________________________________
+void AliEveEventBuffer::FetchEvent() {
+  cout << "FetchEvent " << endl;
+  TObject * event = GetEventFromSource();
+  if(event) AddToBuffer(event);
+  PrintIndeces();
+  cout << "FetchedEvent " << endl;
+  
+}
+
+///_________________________________________________________________________________
+void AliEveEventBuffer::AddToBuffer(TObject * event) {
+  cout << "Add to buffer"<<endl;
+  if(!event) return;
+
+  fBIndex[kTop] = CalculateNext(fBIndex[kTop]);
+  //Delete the event already there (ok to delete as object, not aliesdevent, TList?)
+  TObject * object = fEventBuffer->At(fBIndex[kTop]);
+  if (object) delete object;
+  fEventBuffer->AddAt(event, fBIndex[kTop]);
+}
+
+
+
+///_____________________________________________________________________________________
+Int_t AliEveEventBuffer::CalculateNext(Int_t current) {
+  //See header file for documentation
+  current++;
+  if(current == fBufferSize) current = 0;
+  return current;
+}
+
+
+///_____________________________________________________________________________________
+Int_t AliEveEventBuffer::CalculatePrevious(Int_t current) {
+  //See header file for documentation
+  cout << "CalculatePrev:  " << current; 
+  current--;
+  if(current == -1) current += fBufferSize;
+  cout << "... " << current << endl;
+  return current;
+}
+
+///__________________________________________________________________________________
+Int_t AliEveEventBuffer::CalculateDifference(Int_t top, Int_t low) {
+  //See header file for documentation
+  if (top > low) {
+    //    cout << "top > low"<<endl;
+    return (top - low);
+  } else if (top < low) {
+    // cout << "low < top"<<endl;
+    return (fBufferSize - low + top);
+  } else {
+    //cout << "calculated to 0"<<endl;
+    return 0;
+  }
+}
+
+///___________________________________________________________________________________
+void AliEveEventBuffer::StartBufferMonitor() {
+  //cout << "NOT !!! starting buffer mon"<<endl;
+  cout << "starting buffer mon"<<endl;
+  fTimer->Start(5000);
+}
+///___________________________________________________________________________________
+void AliEveEventBuffer::StopBufferMonitor() {
+  cout << "Stopping buffer mon"<<endl;
+  fTimer->Stop();
+}
+
+
+// //_________________________________________________________________________________
+// Int_t AliEveEventBuffer::NavigateEventBufferBack() { 
+//   // see header file for class documentation
+
+//   // -- reached the end of the buffer
+//   if ( fNavigateBufferIdx == fBufferLowIdx )
+//     return -1;
+
+//   Int_t newIdx = fNavigateBufferIdx - 1;
+//   if ( newIdx == -1 )
+//     newIdx = BUFFERSIZE-1;
+
+//   fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
+
+//   return newIdx;
+// }
+
+// //_______________________________________________________________
+// Int_t AliEveEventBuffer::NavigateEventBufferFwd() {
+//   // see header file for class documentation
+
+//   // -- reached the top of the buffer
+//   if ( fNavigateBufferIdx == fBufferTopIdx )
+//     return -1;
+
+//   Int_t newIdx = fNavigateBufferIdx + 1;
+//   if ( newIdx == BUFFERSIZE )
+//     newIdx = 0;
+  
+//   fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
+
+//   return newIdx;
+// }
+
+// void AliEveEventBuffer::MonitorBuffer() {
+//   //See header file for documentation
+//   if( GetNAvailableEvents() < 10) {
+//     StopBufferChecker();
+//     StartLoop();
+//   }
+// }
+
+// void AliEveEventBuffer::StartLoop() {
+//   //See header file for documentation
+//   fTimer->Start(2000);
+// }
+// void AliEveEventBuffer::StopLoop() {
+//   //See header file for documentation
+//   fTimer->Stop();
+// }
+
+// void AliEveEventBuffer::StartBufferChecker() {
+//   //See header file for documentation
+//   fBufferTimer->Start(2000);
+// }
+// void AliEveEventBuffer::StopBufferChecker() {
+//   //See header file for documentation
+//   fBufferTimer->Stop();
+// }
+
+// AliESDEvent * GetNextEvent() {
+  
+//   tree->GetEntry(fEvent++);
+
+//   AliESDEvent * event = new AliESDEvent();
+//   event->ReadFromTree(fTree);
+//   if (event) {
+//     return event;
+//   } else {
+//     cout << "error getting event" << endl;
+//     return NULL;
+//   }
+// }
diff --git a/EVE/EveHLT/AliEveEventBuffer.h b/EVE/EveHLT/AliEveEventBuffer.h
new file mode 100644 (file)
index 0000000..ac54618
--- /dev/null
@@ -0,0 +1,126 @@
+//-*- Mode: C++ -*-
+
+// $Id$
+
+#ifndef ALIEVEEVENTBUFFER_H
+#define ALIEVEEVENTBUFFER_H
+
+/* 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     
+ */
+
+/** @file   AliEveEventBuffer.h
+    @author Svein Lindal
+    @date
+    @brief  Manager for HOMER in aliroot
+*/
+
+
+class TObjArray;
+class TObject;
+class TTimer;
+class TThread;
+
+#include "TTimer.h"
+
+class AliEveEventBuffer : public TObject{
+
+public:
+  
+  /** default constructor */
+  AliEveEventBuffer();
+
+  /** destructor */
+  virtual ~AliEveEventBuffer();
+
+  void SetBufferSize(Int_t bs) { fBufferSize = bs;}
+  void SetBusy(Bool_t busy) { fBusy = busy;}
+
+  //Navigate the event buffer
+  // TObject *  NavigateFwd();
+  // TObject *  NavigateBack();
+  TObject * NextEvent();
+  TObject * Back();
+  TObject * Fwd();
+  
+  void StartBufferMonitor();
+  void StopBufferMonitor();
+  //Needed for Homer buffer
+  virtual void ConnectToSource() = 0;
+  //Check if more events are needed in buffer
+  void MonitorBuffer();
+
+  static void * BufferThread(void * buffer);
+  virtual void WriteToFile() {//Do nothing
+    ;
+  }
+
+  Int_t GetEventId() const { return fEventId[fBIndex[kCurrent]];}
+
+protected:
+  
+  enum fBufferIndex {
+    kCurrent,
+    kLast, 
+    kTop,
+    kSize
+  };
+
+  
+  Int_t fBufferSize;
+  Int_t fPreBuffer;
+  Bool_t fBusy;
+
+  //TClonesArray containing the stored events
+  TObjArray * fEventBuffer;
+
+  //Pointer to current event
+  TObject * fCurrentEvent;
+
+  //Event buffer indexes
+  Int_t fBIndex[kSize];
+  
+  
+  //Add event to buffer
+  virtual void AddToBuffer(TObject * event);
+  
+  virtual TObject * GetEventFromSource() = 0;
+
+  void FetchEvent();
+  
+
+  //Calculate buffer index stuff
+  Int_t CalculateDifference(Int_t top, Int_t low);
+  Int_t CalculatePrevious(Int_t current);
+  Int_t CalculateNext(Int_t current);
+
+  void SetEventId(Int_t eventId) { fEventId[fBIndex[kCurrent]] = eventId;}
+  
+
+private:
+
+  /** copy constructor prohibited */
+  AliEveEventBuffer(const AliEveEventBuffer&);
+
+  /** assignment operator prohibited */
+  AliEveEventBuffer& operator=(const AliEveEventBuffer&);
+
+
+  TObject *  GetNextUnSeen();
+
+  void PrintIndeces();
+  void PrintBuffer();
+
+  TTimer * fTimer;
+
+  TThread * fThread;
+
+  //Current event id
+  Int_t * fEventId;
+  
+
+  ClassDef(AliEveEventBuffer, 0); // Manage connections to HLT data-sources.
+};
+
+#endif
diff --git a/EVE/EveHLT/AliEveEventBufferHomer.cxx b/EVE/EveHLT/AliEveEventBufferHomer.cxx
new file mode 100644 (file)
index 0000000..eacea7c
--- /dev/null
@@ -0,0 +1,108 @@
+#if __GNUC__>= 3
+   using namespace std;
+#endif
+
+#include "AliEveEventBufferHomer.h"
+#include "AliEveHOMERManager.h"
+
+#include "TList.h"
+#include "TFile.h"
+
+#include <iostream>
+
+ClassImp(AliEveEventBufferHomer);
+
+///_______________________________________________________________________
+AliEveEventBufferHomer::AliEveEventBufferHomer() :
+  fHomer(NULL),
+  fEventNo(0),
+  fAsyncList(NULL)
+{
+  // see header file for class documentation
+  fHomer = new AliEveHOMERManager();
+  Initialize();
+
+}
+
+
+///____________________________________________________________________
+AliEveEventBufferHomer::~AliEveEventBufferHomer() {
+  
+  if(fHomer)
+    delete fHomer;
+  fHomer = NULL;
+
+}
+
+
+
+
+///______________________________________________________________________
+TObject * AliEveEventBufferHomer::GetEventFromSource() {
+  //see header file for documentation
+  if(fHomer) {
+    cout << "calling nexthomerevent"<<endl;
+    TList * blockList = fHomer->NextHOMEREvent();
+    if(blockList)  return dynamic_cast<TObject*>(blockList);
+    else return NULL;
+  } 
+
+  cout << "AliEveEventBufferHomer::GetEventFromSource() : fHomer is null pointer!!"<<endl;
+  return NULL;
+}
+///___________________________________________________________________________
+void AliEveEventBufferHomer::AddToBuffer(TObject * event) {
+  cout << "Add to buffer"<<endl;
+  if(!event) return;
+  fBIndex[kTop] = CalculateNext(fBIndex[kTop]);
+  TList * list = dynamic_cast<TList*>(fEventBuffer->At(fBIndex[kTop]));
+  if(list) {
+    list->Clear();
+    list->AddAll(dynamic_cast<TList*>(event));
+  }
+}
+
+
+///______________________________________________________________________
+void AliEveEventBufferHomer::Initialize() {
+  //Add TList pointers to the buffer array
+  for(Int_t i = 0; i < fBufferSize; i++) {
+    TList * list = new TList();
+    list->SetOwner(kTRUE);
+    fEventBuffer->AddAt(list, i);
+  }
+
+
+  Int_t iResult = fHomer->Initialize();
+  if(iResult) {
+    cout << "Error Initializing HOMER!!!"<<endl;
+    return;
+  }
+
+
+  fHomer->SetRetryCount(1,15);
+  fHomer->SetBlockOwner(kFALSE);
+  fHomer->StartEveSourceListLoop();
+}
+
+
+///______________________________________________________________________
+void AliEveEventBufferHomer::ConnectToSource () {
+
+  fHomer->SetRetryCount(200, 15);
+  fHomer->ReConnectHOMER();
+}
+
+///_____________________________________________________________________
+void AliEveEventBufferHomer::WriteToFile(){
+
+  TFile * file = TFile::Open(Form("Event_0x%016X_ITS.root", 100), "RECREATE"); 
+  fEventBuffer->At(fBIndex[kTop])->Write("blockList", TObject::kSingleKey);
+  file->Close();
+  
+  if(fAsyncList) {
+    TFile * afile = TFile::Open(Form("Event_0x%016X_Async.root", 100), "RECREATE"); 
+    fAsyncList->Write("blockList", TObject::kSingleKey);
+    afile->Close();
+  }
+}           
diff --git a/EVE/EveHLT/AliEveEventBufferHomer.h b/EVE/EveHLT/AliEveEventBufferHomer.h
new file mode 100644 (file)
index 0000000..caacd26
--- /dev/null
@@ -0,0 +1,75 @@
+//-*- Mode: C++ -*-
+
+// $Id$
+
+
+/* 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     
+ */
+
+/** @file   AliEveEventBufferHomer.h
+    @author Svein Lindal
+    @date
+    @brief  Manager for HOMER in aliroot
+*/
+
+#define BUFFERSIZE 15
+
+
+#ifndef ALIEVEEVENTBUFFERHOMER_H
+#define ALIEVEEVENTBUFFERHOMER_H
+
+class AliEveHOMERManager;
+#include "Rtypes.h"
+#include "AliEveEventBuffer.h"
+
+class TFile;
+class TTree;
+class AliESDEvent;
+class TString;
+
+class AliEveEventBufferHomer : public AliEveEventBuffer {
+
+public:
+  
+  /** default constructor */
+  AliEveEventBufferHomer();
+  /** destructor */
+  virtual ~AliEveEventBufferHomer();
+
+  void ConnectToSource();
+  
+  void Initialize();
+
+  AliEveHOMERManager * GetHomerManager() const { return fHomer;}
+
+
+  void WriteToFile();
+
+
+private:
+
+
+  /** copy constructor prohibited */
+  AliEveEventBufferHomer(const AliEveEventBufferHomer&);
+
+  /** assignment operator prohibited */
+  AliEveEventBufferHomer& operator=(const AliEveEventBufferHomer&);
+
+  ///Inherited from AliEveEventBuffer
+  TObject * GetEventFromSource();
+
+  ///Inherited form AliEveEventBuffer
+  void AddToBuffer(TObject * event);
+
+  AliEveHOMERManager * fHomer;
+  Int_t fEventNo;
+  TList * fAsyncList;
+
+
+
+  ClassDef(AliEveEventBufferHomer, 0); 
+};
+
+#endif
diff --git a/EVE/EveHLT/AliEveEventBufferOffline.cxx b/EVE/EveHLT/AliEveEventBufferOffline.cxx
new file mode 100644 (file)
index 0000000..9f64034
--- /dev/null
@@ -0,0 +1,113 @@
+#if __GNUC__>= 3
+   using namespace std;
+#endif
+
+#include "AliEveEventBufferOffline.h"
+
+#include "AliESDEvent.h"
+
+#include "TTimer.h"
+#include "TFile.h"
+#include "TTree.h"
+#include <iostream>
+
+ClassImp(AliEveEventBufferOffline);
+
+///_______________________________________________________________________
+AliEveEventBufferOffline::AliEveEventBufferOffline() :
+  fFile(NULL),
+  fNEntries(0),
+  fEventNo(0),
+  fEvent(NULL),
+  fTree(NULL)
+{
+  // see header file for class documentation
+  //Not Allowed
+}
+
+///_______________________________________________________________________
+AliEveEventBufferOffline::AliEveEventBufferOffline(TString filename)  : 
+  fFile(NULL),
+  fNEntries(0),
+  fEventNo(0),
+  fEvent(NULL),
+  fTree(NULL)
+{
+  
+  fEvent = new AliESDEvent();
+
+  cout <<"opening file " << filename << " what?" <<endl;
+  fFile = TFile::Open(filename, "READ");
+  if(!fFile) {
+    cout << "Couldn't open file, crashing hard! Soon?"<<endl;
+    return;
+  }
+
+  fTree = dynamic_cast<TTree *>(fFile->Get("esdTree"));
+  cout << "File has " << fNEntries << "events" << endl;
+  fNEntries = fTree->GetEntries();
+  fEvent->ReadFromTree(fTree);
+  
+}
+
+
+
+
+///____________________________________________________________________
+AliEveEventBufferOffline::~AliEveEventBufferOffline() {
+  
+  if(fFile)
+    delete fFile;
+  fFile = NULL;
+
+  if(fTree)
+    delete fTree;
+  fTree = NULL;
+  
+  if(fEvent)
+    delete fEvent;
+  fEvent = NULL;
+
+}
+
+
+///______________________________________________________________________
+TObject * AliEveEventBufferOffline::GetEventFromSource() {
+  //see header file for documentation
+  if(fTree) {
+    fTree->GetEntry(fEventNo++);
+    if(fEventNo == fNEntries)
+      fEventNo = 0;
+  }  else {
+    cout << "Tree not found, probably bad file!!"<<endl;
+    return NULL;
+  }
+
+  //Copy event into new event (must be deleted when no longer needed in list!!
+  AliESDEvent * event = new AliESDEvent();
+  fEvent->Copy(*event);
+  cout << event->GetNumberOfCaloClusters() << endl;
+
+  if (event) {
+    return dynamic_cast<TObject*>(event);
+  } else {
+    cout << "error getting event" << endl;
+    return NULL;
+  }
+}
+
+///___________________________________________________________________
+void AliEveEventBufferOffline::ConnectToSource() {
+  //Needed for homer version
+  // see header file for class documentation
+  return;
+}
+
+
+///_____________________________________________________________________
+void AliEveEventBufferOffline::WriteToFile(){
+  //Inherited from AliEveEventBuffer
+  TFile * file = TFile::Open(Form("Event_%d_ITS.root", 100), "RECREATE"); 
+  fEventBuffer->At(fBIndex[kTop])->Write("blockList", TObject::kSingleKey);
+  file->Close();
+}           
diff --git a/EVE/EveHLT/AliEveEventBufferOffline.h b/EVE/EveHLT/AliEveEventBufferOffline.h
new file mode 100644 (file)
index 0000000..64223e7
--- /dev/null
@@ -0,0 +1,67 @@
+//-*- Mode: C++ -*-
+
+// $Id$
+
+
+/* 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     
+ */
+
+/** @file   AliEveEventBufferOffline.h
+    @author Svein Lindal
+    @date
+    @brief  Manager for HOMER in aliroot
+*/
+
+#define BUFFERSIZE 15
+
+
+#ifndef ALIEVEEVENTBUFFEROFFLINE_H
+#define ALIEVEEVENTBUFFEROFFLINE_H
+
+#include "Rtypes.h"
+#include "AliEveEventBuffer.h"
+
+class TFile;
+class TTree;
+class AliESDEvent;
+class TString;
+
+class AliEveEventBufferOffline : public AliEveEventBuffer {
+
+
+public:
+  
+  /** default constructor */
+  AliEveEventBufferOffline(TString file);
+  /** destructor */
+  virtual ~AliEveEventBufferOffline();
+
+  void ConnectToSource();
+  void WriteToFile();
+
+private:
+
+  //not allowed
+  AliEveEventBufferOffline();
+
+  /** copy constructor prohibited */
+  AliEveEventBufferOffline(const AliEveEventBufferOffline&);
+
+  /** assignment operator prohibited */
+  AliEveEventBufferOffline& operator=(const AliEveEventBufferOffline&);
+
+  ///Inherited from AliEveEventBuffer
+  TObject * GetEventFromSource();
+
+  TFile * fFile;
+  Int_t fNEntries;
+  Int_t fEventNo;
+  AliESDEvent * fEvent;
+  TTree * fTree;
+
+  ClassDef(AliEveEventBufferOffline, 0); 
+};
+
+#endif
diff --git a/EVE/EveHLT/AliEveHLTEventManager.cxx b/EVE/EveHLT/AliEveHLTEventManager.cxx
new file mode 100644 (file)
index 0000000..773bca3
--- /dev/null
@@ -0,0 +1,496 @@
+#include "TEveManager.h"
+#include "TEveScene.h"
+#include "TEveProjectionManager.h"
+#include "TEveBrowser.h"
+#include "TGLViewer.h"
+#include "TEveViewer.h"
+#include "TEveEventManager.h"
+
+//#include "AliHLTTriggerDecision.h"
+#include "AliHLTEvePhos.h"
+#include "AliHLTEveEmcal.h"
+#include "AliHLTEveTPC.h"
+#include "AliHLTEveHLT.h"
+#include "AliHLTEveITS.h"
+#include "AliHLTEveISPD.h"
+#include "AliHLTEveISSD.h"
+#include "AliHLTEveISDD.h"
+#include "AliHLTEveTRD.h"
+#include "AliHLTEveMuon.h"
+#include "AliHLTEveAny.h"
+
+#include "AliEveHLTEventManager.h"
+#include "AliEveHOMERManager.h"
+#include "AliEveEventBuffer.h"
+
+#include "TList.h"
+#include "TTimer.h"
+
+#include "TThread.h"
+
+ClassImp(AliEveHLTEventManager);
+
+AliEveHLTEventManager::AliEveHLTEventManager() : 
+  TEveElementList("Event Manager"),
+  fGeoManager(NULL),
+  fEveManager(NULL),
+  fRPhiManager(NULL),
+  fRhoZManager(NULL),
+  fRPhiEventScene(NULL),
+  fRhoZEventScene(NULL),
+  fRhoZViewer(NULL),
+  fRPhiViewer(NULL),
+  fTimer(NULL),
+  fPhosElement(NULL), 
+  fEmcalElement(NULL), 
+  fTPCElement(NULL),
+  fHLTElement(NULL),
+  fITSElement(NULL),
+  fISPDElement(NULL),
+  fISSDElement(NULL),
+  fISDDElement(NULL),
+  fTRDElement(NULL),
+  fMuonElement(NULL),
+  fAnyElement(NULL),
+  fEventLoopStarted(kFALSE),
+  fCenterProjectionsAtPrimaryVertex(kFALSE),
+  fShowBarrel(kTRUE),
+  fShowMuon(kFALSE), 
+  fRunNumber(-1)  
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+   
+  fTimer = new TTimer();
+  fTimer->Connect("Timeout()", "AliEveHLTEventManager", this, "NextEvent()" );
+
+}
+AliEveHLTEventManager::~AliEveHLTEventManager() {
+  
+  //DestroyElements();
+  //DestroyDetectorElements();  
+  
+}
+
+
+void AliEveHLTEventManager::DestroyDetectorElements(){
+  //See header file for documentation
+
+  if (fPhosElement)
+    delete fPhosElement;
+  fPhosElement = NULL;
+
+  if(fEmcalElement)
+    delete fEmcalElement;
+  fEmcalElement = NULL;
+
+  if(fTPCElement)
+    delete fTPCElement;
+  fTPCElement = NULL;
+
+  if(fHLTElement)
+    delete fHLTElement;
+  fHLTElement = NULL;
+
+  if(fITSElement)
+    delete fITSElement;
+  fITSElement = NULL;
+
+  if(fISSDElement)
+    delete fISSDElement;
+  fISSDElement = NULL;
+
+  if(fISDDElement)
+    delete fISDDElement;
+  fISDDElement = NULL;
+
+  if(fISPDElement)
+    delete fISPDElement;
+  fISPDElement = NULL;
+
+  if(fTRDElement)
+    delete fTRDElement;
+  fTRDElement = NULL;
+
+  if(fMuonElement)
+    delete fMuonElement;
+  fMuonElement = NULL;
+  if(fAnyElement)
+    delete fAnyElement;
+  fAnyElement = NULL;
+  
+
+}
+///_______________________________________________________________________________________
+void AliEveHLTEventManager::ConnectEventBuffer() {
+  GetEventBuffer()->ConnectToSource();
+}
+
+
+///___________________________________________________________________________________________
+void AliEveHLTEventManager::StartBufferMonitor() { 
+  AliEveEventBuffer * buffer = GetEventBuffer();
+  if(buffer) {
+    TThread * fThread = new TThread(AliEveEventBuffer::BufferThread, (void*) buffer);
+    fThread->Run();
+  } else {
+    cout << "Buffer does not exist " << endl;
+  }
+}
+//______________________________________________________________________________________________
+Int_t AliEveHLTEventManager::ProcessEvent(AliESDEvent * event) {
+
+  //We have a new event, reset display items (need to check if there really is anything interesting in event before resetting. ie not just histos)
+  
+  cout << "reset()"<<endl;
+  
+  ResetDisplay();
+  
+  cout << "process()"<<endl;
+  if(!fHLTElement) {
+    fHLTElement = new AliHLTEveHLT();
+    fHLTElement->SetEventManager(this);
+    gEve->AddElement(fHLTElement);
+ }
+  fHLTElement->ProcessEsdEvent(event);
+
+  if(!fPhosElement) CreatePhosElement();
+  fPhosElement->ProcessEvent(event);
+  
+  if(!fEmcalElement) CreateEmcalElement();
+  fEmcalElement->ProcessEvent(event);
+  
+  cout << "update()"<<endl;
+  UpdateDisplay();
+
+  return 0;
+
+}
+
+
+
+//______________________________________________________________________________________________
+Int_t AliEveHLTEventManager::ProcessEvent(TList * blockList) {
+
+  //We have a new event, reset display items (need to check if there really is anything interesting in event before resetting. ie not just histos)
+  
+  if(!blockList) {
+    cout << "Block list is NULL pointer, return " << endl;
+    return -1;
+  }
+  cout << "reset ()"<<endl;
+  ResetDisplay();
+  cout << "done reset()"<<endl;
+  AliHLTHOMERBlockDesc * block = NULL;
+  TIter next(blockList);
+  while ((block = (AliHLTHOMERBlockDesc*)next())) {
+    cout <<"Process Block"<<endl;
+    ProcessBlock(block);
+  } 
+
+  cout << "update() "<<endl;
+  UpdateDisplay();
+  
+  return 0;
+
+}
+
+void AliEveHLTEventManager::ProcessBlock(AliHLTHOMERBlockDesc * block) {
+  //See header file for documentation
+  
+#if 1//DEBUG
+  printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
+  printf( "Detector           : %s\n", block->GetDetector().Data() );
+  printf( "Datatype           : %s\n", block->GetDataType().Data() );
+  if (block->IsTObject() )
+    printf( "Is TObject of class: %s\n", block->GetClassName().Data() );
+  printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
+#endif
+
+
+  if(fShowBarrel) {
+
+    if ( ! block->GetDetector().CompareTo("PHOS") ) {
+      if(!fPhosElement) CreatePhosElement();
+      fPhosElement->ProcessBlock(block);
+    }
+    
+    else if ( ! block->GetDetector().CompareTo("EMCA") ) {
+      if(!fEmcalElement) CreateEmcalElement();
+      fEmcalElement->ProcessBlock(block);
+    }  
+    
+    else if ( ! block->GetDetector().CompareTo("TPC") ) {
+      if(!fTPCElement) CreateTPCElement();
+      fTPCElement->ProcessBlock(block);
+    }
+    
+    else if ( ! block->GetDetector().CompareTo("HLT") ) {
+      if(!fHLTElement) CreateHLTElement();
+      fHLTElement->ProcessBlock(block);
+    }
+
+    else if ( ! block->GetDetector().CompareTo("ITS") ) {
+      if(!fITSElement) CreateITSElement();
+      fITSElement->ProcessBlock(block);
+    }
+    
+    else if ( ! block->GetDetector().CompareTo("ISDD") ) {
+      if(!fISDDElement) CreateISDDElement();
+      fISDDElement->ProcessBlock(block);
+    }
+    
+    else if ( ! block->GetDetector().CompareTo("ISPD") ) {
+      if(!fISPDElement) CreateISPDElement();
+      fISPDElement->ProcessBlock(block);
+    }
+    
+    else if ( ! block->GetDetector().CompareTo("ISSD") ) {
+      if(!fISSDElement) CreateISSDElement();
+      fISSDElement->ProcessBlock(block);
+    }
+    
+    else if ( ! block->GetDetector().CompareTo("TRD") ) {
+      if(!fTRDElement) CreateTRDElement();
+      fTRDElement->ProcessBlock(block);
+    }
+    
+    else if ( ! block->GetDetector().CompareTo("MUON") ) {
+      //Do Nothing
+    } else {
+      if(!fAnyElement) {
+       fAnyElement = new AliHLTEveAny();
+       fAnyElement->SetEventManager(this);
+      } 
+      fAnyElement->ProcessBlock(block);
+    }
+     
+  }
+
+   
+  if(fShowMuon) {
+    if ( ! block->GetDetector().CompareTo("MUON") ) {
+      if(!fMuonElement) {
+       fMuonElement = new AliHLTEveMuon();
+       fMuonElement->SetEventManager(this);
+       gEve->AddElement(fMuonElement);
+      }
+      fMuonElement->ProcessBlock(block);
+    }
+  }
+
+}
+
+void AliEveHLTEventManager::ResetDisplay () {
+  //See header file for documentation
+
+ if(fPhosElement)
+   fPhosElement->ResetElements();
+ if(fEmcalElement)
+   fEmcalElement->ResetElements();
+ if(fTPCElement)
+   fTPCElement->ResetElements();
+ if(fHLTElement)
+   fHLTElement->ResetElements();
+ if(fITSElement)
+   fITSElement->ResetElements();
+ if(fISPDElement)
+   fISPDElement->ResetElements();
+ if(fISDDElement)
+   fISDDElement->ResetElements();
+ if(fISSDElement)
+   fISSDElement->ResetElements();
+
+ if (fTRDElement)
+   fTRDElement->ResetElements();
+
+ if(fAnyElement)
+   fAnyElement->ResetElements();
+
+ if(fMuonElement)
+   fMuonElement->ResetElements();
+
+}
+
+
+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)));
+  return;
+}
+
+
+void AliEveHLTEventManager::StartLoop() {
+  //See header file for documentation
+  //fTimer->SetCommand("NextEvent()", "AliEveHLTEventManager", this);
+  SetEventLoopStarted(kTRUE);
+  fTimer->Start(10000);
+}
+
+void AliEveHLTEventManager::StopLoop() {
+  //See header file for documentation
+  fTimer->Stop();
+  SetEventLoopStarted(kFALSE);
+}
+
+
+// void AliEveHLTEventManager::NavigateBack() {
+  
+//   if (fHomerManager->NavigateEventBufferBack()) {
+//     //return -1;
+//   } else {
+    
+//     TList * blockList = fHomerManager->GetBlockList();
+//     if(blockList) {      
+//       ProcessEvent(blockList);
+//     } else {
+//       cout << "BALLE Error blocklist NULL pointer even though it's navigateable"<<endl;
+//     }
+//   }   
+
+// }
+
+// void AliEveHLTEventManager::NavigateFwd() {
+
+//   if (fHomerManager->NavigateEventBufferFwd()) {
+//     cout << "No event available" << endl;
+//     return;
+//     //return -1;
+//   } else {
+//     cout << "Getting block list" << endl;
+//     TList * blockList = fHomerManager->GetBlockList();
+//     if (blockList){
+//       ProcessEvent(blockList);
+//     } else {
+//       cout << "blockList is NULL pointer"<<endl;
+//     }
+//   }
+
+// }
+
+void  AliEveHLTEventManager::UpdateDisplay() {
+  //See header file for documentation
+  if(fPhosElement) fPhosElement->UpdateElements();
+  if(fEmcalElement) fEmcalElement->UpdateElements();
+  if(fTPCElement) fTPCElement->UpdateElements();
+  if(fHLTElement) fHLTElement->UpdateElements();
+  if(fITSElement) fITSElement->UpdateElements();
+  if(fISSDElement) fISSDElement->UpdateElements();
+  if(fISDDElement) fISDDElement->UpdateElements();
+  if(fISPDElement) fISPDElement->UpdateElements();
+  if(fTRDElement) fTRDElement->UpdateElements();
+  if(fAnyElement) fAnyElement->UpdateElements();
+  if(fMuonElement) fMuonElement->UpdateElements();
+
+
+  // -- Set EventID in Window Title  
+  TString winTitle("Eve Main Window");
+  winTitle += Form("-- Run Number: %d", fRunNumber); 
+  //winTitle += Form("-- Event ID : 0x%lu ", GetEventID(fCurrentEventIdx) );
+  GetEveManager()->GetBrowser()->SetWindowName(winTitle);
+
+  //==============================================================================
+  // -- Import global scene into projection scenes
+  //==============================================================================
+
+  Double_t x[3] = { 0, 0, 0 };
+  
+  TEveElement* top = GetEveManager()->GetCurrentEvent();
+  
+  if (fRPhiManager && top) {
+    fRPhiEventScene->DestroyElements();
+    if (fCenterProjectionsAtPrimaryVertex)
+      fRPhiManager->SetCenter(x[0], x[1], x[2]);
+    fRPhiManager->ImportElements(top, fRPhiEventScene);
+  }
+  
+  if (fRhoZManager && top) {
+    fRhoZEventScene->DestroyElements();
+    if (fCenterProjectionsAtPrimaryVertex)
+      fRhoZManager->SetCenter(x[0], x[1], x[2]);
+    fRhoZManager->ImportElements(top, fRhoZEventScene);
+  }
+
+
+  //Redraw the display
+  GetEveManager()->Redraw3D(0,1); // (0, 1)
+  GetEveManager()->EnableRedraw(); 
+
+}
+
+void AliEveHLTEventManager::SaveEveryThing() {
+
+  GetEventBuffer()->WriteToFile();
+  //Save everything to file
+  //fEventBuffer->SaveBlockList();
+  //fEventBuffer->SaveAsyncBlockList();
+
+
+}
+
+
+
+void AliEveHLTEventManager::CreatePhosElement() {
+  fPhosElement = new AliHLTEvePhos();
+  fPhosElement->SetEventManager(this);
+  gEve->AddElement(fPhosElement);
+}
+
+void AliEveHLTEventManager::CreateEmcalElement() {
+  fEmcalElement = new AliHLTEveEmcal();
+  fEmcalElement->SetEventManager(this);
+  gEve->AddElement(fEmcalElement);
+}
+void AliEveHLTEventManager::CreateTPCElement() {
+  fTPCElement = new AliHLTEveTPC();
+  fTPCElement->SetEventManager(this);
+  gEve->AddElement(fTPCElement);
+}
+void AliEveHLTEventManager::CreateITSElement() {
+  fITSElement = new AliHLTEveITS();
+  fITSElement->SetEventManager(this);
+  gEve->AddElement(fITSElement);
+}
+void AliEveHLTEventManager::CreateISPDElement() {
+  fISPDElement = new AliHLTEveISPD();
+  fISPDElement->SetEventManager(this);
+  gEve->AddElement(fISPDElement);
+}
+void AliEveHLTEventManager::CreateISDDElement() {
+  fISDDElement = new AliHLTEveISDD();
+  fISDDElement->SetEventManager(this);
+  gEve->AddElement(fISSDElement);
+}
+void AliEveHLTEventManager::CreateISSDElement() {
+  fISSDElement = new AliHLTEveISSD();
+  fISSDElement->SetEventManager(this);
+  gEve->AddElement(fISSDElement);
+}
+void AliEveHLTEventManager::CreateTRDElement() {
+  fTRDElement = new AliHLTEveTRD();
+  fTRDElement->SetEventManager(this);
+  gEve->AddElement(fTRDElement);
+}
+void AliEveHLTEventManager::CreateHLTElement() {
+  fHLTElement = new AliHLTEveHLT();
+  fHLTElement->SetEventManager(this);
+  gEve->AddElement(fHLTElement);
+}
+
+
diff --git a/EVE/EveHLT/AliEveHLTEventManager.h b/EVE/EveHLT/AliEveHLTEventManager.h
new file mode 100644 (file)
index 0000000..10fb8a3
--- /dev/null
@@ -0,0 +1,156 @@
+#ifndef ALIEVEHLTEVENTMANAGER_H
+#define ALIEVEHLTEVENTMANAGER_H
+
+
+#include "TEveEventManager.h"
+#include "AliHLTLoggingVariadicFree.h"
+
+class AliHLTHOMERBlockDesc;
+class TList;
+
+class TEveManager;
+class TEveScene;
+class TEveProjectionManager;
+class TTimer;
+class TEveViewer;
+
+class AliHLTEvePhos;
+class AliHLTEveEmcal;
+class AliHLTEveTPC;
+class AliHLTEveHLT;
+class AliHLTEveITS;
+class AliHLTEveISSD;
+class AliHLTEveISDD;
+class AliHLTEveISPD;
+class AliHLTEveTRD;
+class AliHLTEveAny;
+class AliHLTEveMuon;
+class AliEveEventBuffer;
+class AliESDEvent;
+
+class AliEveHLTEventManager : public TEveElementList { 
+
+public:
+
+  ///Constructor
+  AliEveHLTEventManager();
+  
+  virtual ~AliEveHLTEventManager();
+
+
+  void SetRunNumber(Int_t rn) { fRunNumber = rn; }
+
+  /**Set and get the global instance of the Eve manager */
+  void SetEveManager(TEveManager * manager) {fEveManager = manager;}
+  TEveManager * GetEveManager() const {return fEveManager;}
+
+  /**Set and get the global instance of TGeoManager */
+  void SetGeoManager(TGeoManager * manager) {fGeoManager = manager;}
+  TGeoManager * GetGeoManager() const {return fGeoManager;}
+
+  /** Set the projection scenes and their managers */
+  void SetRPhiManager (TEveProjectionManager * mgr) {fRPhiManager = mgr;}
+  void SetRPhiEventScene (TEveScene * scene ) {fRPhiEventScene = scene;}
+  void SetRPhiViewer(TEveViewer * viewer ) {fRPhiViewer = viewer;}
+  void SetRhoZManager(TEveProjectionManager * mgr) {fRhoZManager = mgr;}
+  void SetRhoZEventScene(TEveScene * scene ) {fRhoZEventScene = scene;}
+  void SetRhoZViewer(TEveViewer * viewer ) {fRhoZViewer = viewer;}
+
+  /** Start and stop the automatic event loop */
+  void StartLoop();
+  void StopLoop();
+
+  /** Print the screens to a file **/
+  void PrintScreens();
+
+
+  virtual void NavigateBack() = 0;
+  virtual void NavigateFwd() = 0;
+
+
+
+  //Event buffer stuff
+  virtual void ConnectEventBuffer();  
+  virtual void StartBufferMonitor();
+  virtual void NextEvent() = 0;
+
+  virtual void SaveEveryThing();
+  
+ protected:
+
+  /** copy constructor prohibited */
+  AliEveHLTEventManager(const AliEveHLTEventManager&);
+
+  /** assignment operator prohibited */
+  AliEveHLTEventManager& operator=(const AliEveHLTEventManager&);
+
+  /** Process the event data */
+  Int_t ProcessEvent(TList * blockList);
+  Int_t ProcessEvent(AliESDEvent * event);
+
+  /** Set flag for event loop */
+  void SetEventLoopStarted (Bool_t started) {fEventLoopStarted = started;}
+
+  void DestroyDetectorElements();
+  
+  virtual AliEveEventBuffer * GetEventBuffer() {return NULL;}
+  
+  /** Process block */
+  void ProcessBlock(AliHLTHOMERBlockDesc * block);  //Process block
+  /** Reset the elements in the display */
+  void ResetDisplay();  
+  /** Update the display  */
+  void UpdateDisplay(); 
+
+
+  void CreatePhosElement();
+  void CreateEmcalElement();
+  void CreateTPCElement();
+  void CreateITSElement();
+  void CreateISPDElement();
+  void CreateISDDElement();
+  void CreateISSDElement();
+  void CreateTRDElement();
+  void CreateHLTElement();
+
+
+  TGeoManager * fGeoManager;              //The global TGeoManager instance
+  TEveManager * fEveManager;              //The global TEveManager instance
+  TEveProjectionManager * fRPhiManager;   //The R - Phi projection scene manager
+  TEveProjectionManager * fRhoZManager;   //The Rho- Z projection sene manager
+  TEveScene * fRPhiEventScene;            //The R - Phi projection scene
+  TEveScene * fRhoZEventScene;            //The Rho - Z projection sene
+  TEveViewer * fRhoZViewer;
+  TEveViewer * fRPhiViewer;
+  
+
+
+  TTimer * fTimer;                   //Timer for event loop
+  //TTimer * fSourceListTimer;       //Timer for source list loop
+  AliHLTEvePhos  * fPhosElement;     //Phos eve processor
+  AliHLTEveEmcal * fEmcalElement;    //Emcal eve processor
+  AliHLTEveTPC   * fTPCElement;      //TPC eve processor
+  AliHLTEveHLT   * fHLTElement;      //HLT
+  AliHLTEveITS   * fITSElement;      //ITS
+  AliHLTEveISPD  * fISPDElement;     //ISPD
+  AliHLTEveISSD  * fISSDElement;     //ISSD
+  AliHLTEveISDD  * fISDDElement;     //ISDD
+  AliHLTEveTRD   * fTRDElement;      //TRD
+  AliHLTEveMuon  * fMuonElement;     //MUON
+  AliHLTEveAny   * fAnyElement;      //Catch all
+
+
+
+  Bool_t fEventLoopStarted;                    // Flag indicating whether the loop is running
+  Bool_t fCenterProjectionsAtPrimaryVertex;    // Flag indicating whether to center the projection scenes at primary vertex (as opposed to 0, 0, 0)
+  Bool_t fShowBarrel;                               // Display barrel detectors ?
+  Bool_t fShowMuon;                                 // Display Muon arm ?
+
+  Int_t fRunNumber;
+
+  ClassDef(AliEveHLTEventManager, 0);
+
+};
+
+#endif
diff --git a/EVE/EveHLT/AliEveHLTEventManagerEditor.cxx b/EVE/EveHLT/AliEveHLTEventManagerEditor.cxx
new file mode 100644 (file)
index 0000000..1a32ace
--- /dev/null
@@ -0,0 +1,181 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#include "AliEveHLTEventManagerEditor.h"
+#include "AliEveHLTEventManager.h"
+
+#include <TVirtualPad.h>
+#include <TColor.h>
+#include <TROOT.h>
+
+#include <TGLabel.h>
+#include <TGButton.h>
+#include <TGNumberEntry.h>
+#include <TGColorSelect.h>
+#include <TGDoubleSlider.h>
+#include <TGComboBox.h>
+
+//______________________________________________________________________________
+// AliEveHLTEventManagerEditor
+//
+
+ClassImp(AliEveHLTEventManagerEditor)
+
+AliEveHLTEventManagerEditor::AliEveHLTEventManagerEditor(const TGWindow *p, Int_t width, Int_t height,
+            UInt_t options, Pixel_t back) :
+  
+TGedFrame(p, width, height, options | kVerticalFrame, back),
+  fM(0),
+  fButtonConnect(NULL),
+  fButtonWriteToFile(0),
+  fButtonNextEvent(0),
+  fButtonNavigateBack(0),
+  fButtonNavigateFwd(0),
+  fButtonPrintScreens(NULL),
+  fBoxTriggerSelector(0),
+//  fBoxEventLoopSpeed(0),
+  fButtonEventLoopText(0),
+  fButtonUpdateEvents(NULL),
+  fButtonEventLoop(0),
+ fEventLoopStarted(kFALSE) 
+{
+
+  fButtonUpdateEvents = new TGTextButton(this, " Fill buffer.. ");
+  AddFrame(fButtonUpdateEvents); //, new TGLayoutHints(...));
+  fButtonUpdateEvents->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "PollEvents()");
+
+
+  MakeTitle("AliEveHLTEventManager");
+
+  // Create widgets
+  // fXYZZ = new TGSomeWidget(this, ...);
+  // AddFrame(fXYZZ, new TGLayoutHints(...));
+  // fXYZZ->Connect("SignalName()", "AliEveHLTEventManagerEditor", this, "DoXYZZ()");
+
+  fButtonConnect = new TGTextButton(this, " Reconnect ");
+  AddFrame(fButtonConnect); //, new TGLayoutHints(...));
+  fButtonConnect->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "ConnectToHLT()");
+
+  fButtonWriteToFile = new TGTextButton(this, " Write to file  ");
+  AddFrame(fButtonWriteToFile); //, new TGLayoutHints(...));
+  fButtonWriteToFile->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "WriteBlockListToFile()");
+
+
+  fButtonNextEvent = new TGTextButton(this, "  NextEvent  ");
+  AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
+  fButtonNextEvent->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "NextEvent()");
+
+  fButtonNavigateBack = new TGTextButton(this, "  Navigate Back  ");
+  AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...));
+  fButtonNavigateBack->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "NavigateBack()");
+
+  fButtonNavigateFwd = new TGTextButton(this, "  Navigate Fwd  ");
+  AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...));
+  fButtonNavigateFwd->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "NavigateFwd()");
+
+
+  fButtonPrintScreens = new TGTextButton(this, "  Save Viewers  ");
+  AddFrame(fButtonPrintScreens); //, new TGLayoutHints(...));
+  fButtonPrintScreens->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "PrintScreens()");
+
+
+  fBoxTriggerSelector = new TGComboBox(this, "Select Trigger");
+  fBoxTriggerSelector->AddEntry("HLT Global Trigger", 0);
+  fBoxTriggerSelector->AddEntry("Barrel multiplicity trigger", 1);
+  fBoxTriggerSelector->AddEntry("PHOS Geometry trigger", 2);
+  fBoxTriggerSelector->AddEntry("No trigger selection", 3);
+  fBoxTriggerSelector->Connect("Selected(Int_t)","AliEveHLTEventManagerEditor", this, "SetTriggerString(int)");
+  fBoxTriggerSelector->SetWidth(150);
+  fBoxTriggerSelector->SetHeight(25);
+  AddFrame(fBoxTriggerSelector);
+
+  fButtonEventLoopText = new TGTextButton(this, "  Loop Events  ");
+  AddFrame(fButtonEventLoopText); //, new TGLayoutHints(...));
+  fButtonEventLoopText->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "EventLoop()");
+
+  fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png"));
+  AddFrame(fButtonEventLoop); //, new TGLayoutHints(...));
+  fButtonEventLoop->Connect("Clicked()", "AliEveHLTEventManagerEditor", this, "EventLoop()");
+}
+
+/******************************************************************************/
+
+void AliEveHLTEventManagerEditor::SetModel(TObject* obj) {
+  fM = dynamic_cast<AliEveHLTEventManager*>(obj);
+}
+
+/******************************************************************************/
+
+void AliEveHLTEventManagerEditor::ConnectToHLT() {
+   // Connects to HOMER sources -> to HLT.
+  fM->ConnectEventBuffer();
+}
+
+void AliEveHLTEventManagerEditor::NextEvent() {
+  // call next event from AliEveHOMERManger
+  fM->NextEvent();
+}
+
+void AliEveHLTEventManagerEditor::WriteBlockListToFile() {
+  fM->SaveEveryThing();
+}
+
+
+void AliEveHLTEventManagerEditor::PrintScreens() {
+  //Print screens
+  fM->PrintScreens();
+}
+
+void AliEveHLTEventManagerEditor::NavigateFwd() {
+  // navigate forward
+  if ( !fEventLoopStarted ) {
+    fM->NavigateFwd();
+  }
+}
+
+void AliEveHLTEventManagerEditor::NavigateBack() {
+  // navigate back
+  if ( !fEventLoopStarted ) {
+    fM->NavigateBack();
+  }
+}
+
+void AliEveHLTEventManagerEditor::PollEvents() {
+  fM->StartBufferMonitor();
+}
+
+void AliEveHLTEventManagerEditor::EventLoop() {
+  // Start/stop event loop
+  if ( !fEventLoopStarted ) {
+    fEventLoopStarted = kTRUE;
+    fButtonEventLoopText->SetText(" Stop Loop ");
+    fM->StartLoop();
+  } else {
+    fM->StopLoop();
+    fEventLoopStarted = kFALSE;
+    fButtonEventLoopText->SetText(" Loop Events ");
+  }
+}
+
+void AliEveHLTEventManagerEditor::SetTriggerString(int id) {
+
+  if (id < 0 || id > 4) {
+    return;
+  }
+  
+  // TString tsa[4] = {"HLTGlobalTrigger", 
+  //               "BarrelMultiplicityTrigger", 
+  //               "PHOSgeomTrigger",
+  //               "ALL"};
+   
+  // fM->SetTriggerString(tsa[id]);
+    
+}
+
diff --git a/EVE/EveHLT/AliEveHLTEventManagerEditor.h b/EVE/EveHLT/AliEveHLTEventManagerEditor.h
new file mode 100644 (file)
index 0000000..f67ed2c
--- /dev/null
@@ -0,0 +1,70 @@
+ // $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifndef AliEveHLTEventManagerEditor_H
+#define AliEveHLTEventManagerEditor_H
+
+#include <TGedFrame.h>
+
+class TGCheckButton;
+class TGTextButton;
+class TGNumberEntry;
+class TGColorSelect;
+class TGPictureButton;
+class TGComboBox;
+class AliEveHLTEventManager;
+
+class AliEveHLTEventManagerEditor : public TGedFrame
+{
+public:
+  AliEveHLTEventManagerEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, 
+                          UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+  virtual ~AliEveHLTEventManagerEditor() {}
+
+  virtual void SetModel(TObject* obj);
+
+  // Declare callback/slot methods
+  void ConnectToHLT();
+  void NextEvent();
+  void EventLoop();
+
+  void NavigateBack();
+  void NavigateFwd();
+  void SetTriggerString(int id);
+  void WriteBlockListToFile();
+  void PrintScreens();
+  void PollEvents();
+
+protected:
+
+  AliEveHLTEventManager  *fM; // Model object.
+  
+  TGTextButton     *fButtonConnect; // Button to connect to HOMER.
+  TGTextButton     *fButtonWriteToFile; // Button to write block list to file
+  TGTextButton     *fButtonNextEvent; // Button to call next Even
+  TGTextButton     *fButtonNavigateBack; // Button to navigate back
+  TGTextButton     *fButtonNavigateFwd;  // Button to navigate fwd
+  TGTextButton     *fButtonPrintScreens;  // Button to print viewers
+  TGComboBox       *fBoxTriggerSelector; // Drop down menu to select trigger criteria.
+  TGTextButton     *fButtonEventLoopText; //Text button to start / stop event loop.
+  TGTextButton    *fButtonUpdateEvents;
+  //TGComboBox       *fBoxEventLoopSpeed; // Drop down menu to set the speed of the loop.
+  TGPictureButton  *fButtonEventLoop; // Picture button to start/stop event loop, HLT LOGO.
+  
+
+private:
+  AliEveHLTEventManagerEditor(const AliEveHLTEventManagerEditor&);            // Not implemented
+  AliEveHLTEventManagerEditor& operator=(const AliEveHLTEventManagerEditor&); // Not implemented
+
+  Bool_t fEventLoopStarted;
+
+  ClassDef(AliEveHLTEventManagerEditor, 0); // Editor for AliEveHLTEventManager
+};
+
+#endif
diff --git a/EVE/EveHLT/AliEveHLTEventManagerHomer.cxx b/EVE/EveHLT/AliEveHLTEventManagerHomer.cxx
new file mode 100644 (file)
index 0000000..338026e
--- /dev/null
@@ -0,0 +1,83 @@
+// Author: 2010 Svein Lindal <slindal@fys.uio.no>                        *
+//         for The ALICE HLT Project.                                    *
+
+#include "AliHLTEveHLT.h"
+#include "AliHLTEvePhos.h"
+#include "AliHLTEveEmcal.h"
+
+
+#include "AliESDEvent.h"
+#include "AliEveHLTEventManager.h"
+#include "AliEveEventBufferOffline.h"
+#include "AliEveHLTEventManagerHomer.h"
+#include "TList.h"
+#include "AliEveHOMERManager.h"
+#include "TEveManager.h"
+
+ClassImp(AliEveHLTEventManagerHomer)
+
+AliEveHLTEventManagerHomer::AliEveHLTEventManagerHomer() : 
+  AliEveHLTEventManager(),
+  fEventBuffer(NULL)
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+  fEventBuffer = new AliEveEventBufferHomer();
+  //AliEveHOMERManager * hm = fEventBuffer->GetHomerManager();
+  //if(hm) GetEveManager()->AddToListTree(hm, kTRUE);
+  
+
+}
+
+AliEveHLTEventManagerHomer::~AliEveHLTEventManagerHomer() {
+
+  //DestroyElements();
+  //DestroyDetectorElements();  
+  if(fEventBuffer)
+    delete fEventBuffer;
+  fEventBuffer = NULL;
+
+}
+
+
+///________________________________________________________________________________
+void AliEveHLTEventManagerHomer::NextEvent() {
+  //See header file for documentation
+  TList * fEvent = static_cast<TList*>(fEventBuffer->NextEvent());
+  if(fEvent) {
+    cout << "Got the event " <<endl;
+    ProcessEvent(fEvent);
+    fEventBuffer->SetBusy(kFALSE);
+  } else {
+    cout << "couldn't get the event"<<endl;
+  }
+}
+
+
+///____________________________________________________________________________________
+void AliEveHLTEventManagerHomer::NavigateFwd() {
+  //See header file for documentation
+  TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Fwd());
+  if(fEvent) {
+    ProcessEvent(fEvent);
+  } else {
+    cout << "couldn't get the fwd event"<<endl;
+  }
+}
+
+
+///______________________________________________________________________________________
+void AliEveHLTEventManagerHomer::NavigateBack() {
+  //See header file for documentation
+  TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Back());
+  if(fEvent) {
+    ProcessEvent(fEvent);
+  } else {
+    cout << "couldn't get the back event"<<endl;
+  }
+}
+
diff --git a/EVE/EveHLT/AliEveHLTEventManagerHomer.h b/EVE/EveHLT/AliEveHLTEventManagerHomer.h
new file mode 100644 (file)
index 0000000..cdb70e5
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef ALIEVEHLTEVENTMANAGERHOMER_H
+#define ALIEVEHLTEVENTMANAGERHOMER_H
+
+class AliESDEvent;
+
+class AliEveHLTEventManager;
+#include "AliEveEventBufferHomer.h"
+#include "AliEveEventBuffer.h"
+class TList;
+
+class AliEveHLTEventManagerHomer : public AliEveHLTEventManager { 
+
+public:
+
+  ///Constructor
+  AliEveHLTEventManagerHomer();
+  
+  virtual ~AliEveHLTEventManagerHomer();
+
+  void NextEvent();
+  void NavigateFwd();
+  void NavigateBack();
+
+ private:
+
+
+  /** copy constructor prohibited */
+  AliEveHLTEventManagerHomer(const AliEveHLTEventManagerHomer&);
+
+  /** assignment operator prohibited */
+  AliEveHLTEventManagerHomer& operator=(const AliEveHLTEventManagerHomer&);
+  
+  AliEveEventBufferHomer * fEventBuffer;
+  AliEveEventBuffer * GetEventBuffer() { return dynamic_cast<AliEveEventBuffer*>(fEventBuffer); }
+
+  ClassDef(AliEveHLTEventManagerHomer, 0);
+
+};
+
+#endif
diff --git a/EVE/EveHLT/AliEveHLTEventManagerOffline.cxx b/EVE/EveHLT/AliEveHLTEventManagerOffline.cxx
new file mode 100644 (file)
index 0000000..ce3040f
--- /dev/null
@@ -0,0 +1,89 @@
+// Author: 2010 Svein Lindal <slindal@fys.uio.no>                        *
+//         for The ALICE HLT Project.                                    *
+
+#include "AliHLTEveHLT.h"
+#include "AliHLTEvePhos.h"
+#include "AliHLTEveEmcal.h"
+#include "TEveManager.h"
+
+#include "AliESDEvent.h"
+#include "AliEveHLTEventManager.h"
+#include "AliEveEventBufferOffline.h"
+#include "AliEveHLTEventManagerOffline.h"
+
+
+ClassImp(AliEveHLTEventManagerOffline)
+
+AliEveHLTEventManagerOffline::AliEveHLTEventManagerOffline() : 
+  AliEveHLTEventManager(),
+  fEvent(NULL),
+  fEventBuffer(NULL)
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+  
+}
+
+AliEveHLTEventManagerOffline::AliEveHLTEventManagerOffline(TString filename) : 
+  AliEveHLTEventManager(),
+  fEvent(NULL),
+  fEventBuffer(NULL)
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+  fEventBuffer = new AliEveEventBufferOffline(filename);
+}
+AliEveHLTEventManagerOffline::~AliEveHLTEventManagerOffline() {
+
+  //DestroyElements();
+  //DestroyDetectorElements();  
+
+  if(fEvent)
+    delete fEvent;
+  fEvent = NULL;
+
+  if(fEventBuffer)
+    delete fEventBuffer;
+  fEventBuffer = NULL;
+  
+}
+
+void AliEveHLTEventManagerOffline::NextEvent() {
+  //See header file for documentation
+  fEvent = dynamic_cast<AliESDEvent*>(fEventBuffer->NextEvent());
+  if(fEvent) {
+    //Int_t eventId = fBuffer->GetEventId();
+    ProcessEvent(fEvent);
+  } else {
+    cout << "couldn't get the event"<<endl;
+  }
+}
+
+void AliEveHLTEventManagerOffline::NavigateFwd() {
+  //See header file for documentation
+  fEvent = dynamic_cast<AliESDEvent*>(fEventBuffer->Fwd());
+  if(fEvent) {
+    ProcessEvent(fEvent);
+  } else {
+    cout << "couldn't get the fwd event"<<endl;
+  }
+}
+
+void AliEveHLTEventManagerOffline::NavigateBack() {
+  //See header file for documentation
+  fEvent = dynamic_cast<AliESDEvent*>(fEventBuffer->Back());
+  if(fEvent) {
+    ProcessEvent(fEvent);
+  } else {
+    cout << "couldn't get the back event"<<endl;
+  }
+}
+
diff --git a/EVE/EveHLT/AliEveHLTEventManagerOffline.h b/EVE/EveHLT/AliEveHLTEventManagerOffline.h
new file mode 100644 (file)
index 0000000..dba4aa1
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIEVEHLTEVENTMANAGEROFFLINE_H
+#define ALIEVEHLTEVENTMANAGEROFFLINE_H
+
+class AliESDEvent;
+class AliEveHLTEventManager;
+
+class AliEveHLTEventManagerOffline : public AliEveHLTEventManager { 
+
+public:
+
+  ///Constructor
+  AliEveHLTEventManagerOffline(TString filename);
+  
+  virtual ~AliEveHLTEventManagerOffline();
+
+  void NextEvent();
+  void NavigateFwd();
+  void NavigateBack();
+
+ private:
+
+  ///Default constructor, private
+  AliEveHLTEventManagerOffline();
+
+  /** copy constructor prohibited */
+  AliEveHLTEventManagerOffline(const AliEveHLTEventManagerOffline&);
+
+  /** assignment operator prohibited */
+  AliEveHLTEventManagerOffline& operator=(const AliEveHLTEventManagerOffline&);
+
+  /** Process the event data */
+  //Int_t ProcessEvent(AliESDEvent * event);
+  
+  AliESDEvent * fEvent;
+  AliEveEventBufferOffline * fEventBuffer;
+  AliEveEventBuffer * GetEventBuffer() {return fEventBuffer;}
+
+  ClassDef(AliEveHLTEventManagerOffline, 1);
+
+};
+
+#endif
index d8ffa10..2f30649 100644 (file)
@@ -9,9 +9,10 @@
 
 
 /** @file   AliEveHOMERManager.cxx
-    @author Jochen Thaeder,  Svein Lindal <slindal@fys.uio.no>
+    @author Jochen Thaeder,  
+    @author Svein Lindal <slindal@fys.uio.no>
     @date
-    @brief  Manager for HOMER online
+    @brief  Manager for HOMER events
 */
 
 #if __GNUC__>= 3
 #endif
 
 #include "unistd.h"
-#include "TEveManager.h"
-#include "TTimer.h"
-#include "TEveScene.h"
-#include "TEveProjectionManager.h"
-#include "TEveBrowser.h"
-#include "TGLViewer.h"
-#include "TEveViewer.h"
 
+#include "AliHLTTriggerDecision.h"
 #include "AliEveHOMERManager.h"
 #include "AliHLTHOMERBlockDesc.h"
 #include "AliHLTHOMERManager.h"
-#include "AliHLTTriggerDecision.h"
-#include "AliHLTEvePhos.h"
-#include "AliHLTEveEmcal.h"
-#include "AliHLTEveTPC.h"
-#include "AliHLTEveHLT.h"
-#include "AliHLTEveITS.h"
-#include "AliHLTEveISPD.h"
-#include "AliHLTEveISSD.h"
-#include "AliHLTEveISDD.h"
-#include "AliHLTEveTRD.h"
-#include "AliHLTEveMuon.h"
-#include "AliHLTEveAny.h"
 #include "AliEveHOMERSourceList.h"
 
-//#include "TTimer.h"
+#include "TTimer.h"
 
 ClassImp(AliEveHOMERManager)
   
-/*
- * ---------------------------------------------------------------------------------
- *                            Constructor / Destructor
- * ---------------------------------------------------------------------------------
- */
-  
-//##################################################################################
+//____________________________________________________________________________________
 AliEveHOMERManager::AliEveHOMERManager() :
 TEveElementList("Homer Manager"),
   AliHLTHOMERManager(), 
   fSrcList(NULL),
   fRetryCount(1000),
   fRetrySleeptime(15),
-  fGeoManager(NULL),
-  fEveManager(NULL),
-  fRPhiManager(NULL),
-  fRhoZManager(NULL),
-  fRPhiEventScene(NULL),
-  fRhoZEventScene(NULL),
-  fRhoZViewer(NULL),
-  fRPhiViewer(NULL),
-  fTimer(NULL),
-//  fSourceListTimer(NULL),
-  fPhosElement(NULL), 
-  fEmcalElement(NULL), 
-  fTPCElement(NULL),
-  fHLTElement(NULL),
-  fITSElement(NULL),
-  fISPDElement(NULL),
-  fISSDElement(NULL),
-  fISDDElement(NULL),
-  fTRDElement(NULL),
-  fMuonElement(NULL),
-  fAnyElement(NULL),
-  fEventLoopStarted(kFALSE),
-  fCenterProjectionsAtPrimaryVertex(kFALSE),
-  fShowBarrel(kTRUE),
-  fShowMuon(kFALSE) 
+  fSourceListTimer(NULL)
 {
-  // see header file for class documentation
-  // or
-  // refer to README to build package
-  // or
-  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-   
-  fTimer = new TTimer();
-  fTimer->Connect("Timeout()", "AliEveHOMERManager", this, "NextHOMEREvent()" );
-
-  //fSourceListTimer = new TTimer();
-
-  fPhosElement = new AliHLTEvePhos();
-  fPhosElement->SetEventManager(this);
-   
-  fEmcalElement = new AliHLTEveEmcal();
-  fEmcalElement->SetEventManager(this);
-   
-  fTPCElement = new AliHLTEveTPC();
-  fTPCElement->SetEventManager(this);
-   
-  fHLTElement = new AliHLTEveHLT();
-  fHLTElement->SetEventManager(this);
-   
-  fITSElement = new AliHLTEveITS();
-  fITSElement->SetEventManager(this);
-  
-  fISPDElement = new AliHLTEveISPD();
-  fISPDElement->SetEventManager(this);
-
-  fISDDElement = new AliHLTEveISDD();
-  fISDDElement->SetEventManager(this);
-
-  fISSDElement = new AliHLTEveISSD();
-  fISSDElement->SetEventManager(this);
-
-  fTRDElement = new AliHLTEveTRD();
-  fTRDElement->SetEventManager(this);
-
+  fSourceListTimer = new TTimer();
+  fSourceListTimer->Connect("Timeout()", "AliEveHOMERManager", this, "CreateEveSourcesListLoop()");
 }
 
-//##################################################################################
+//____________________________________________________________________________________
 AliEveHOMERManager::~AliEveHOMERManager() {
- // see header file for class documentation 
-
-  DestroyElements();
-  DestroyDetectorElements();
-
-}
-
-
-
-void AliEveHOMERManager::DestroyDetectorElements(){
-  //See header file for documentation
+  // see header file for class documentation 
+  
   if (fSrcList)
     delete fSrcList;
   fSrcList = NULL;
-
-  if (fPhosElement)
-    delete fPhosElement;
-  fPhosElement = NULL;
-
-  if(fEmcalElement)
-    delete fEmcalElement;
-  fEmcalElement = NULL;
-
-  if(fTPCElement)
-    delete fTPCElement;
-  fTPCElement = NULL;
-
-  if(fHLTElement)
-    delete fHLTElement;
-  fHLTElement = NULL;
-
-  if(fITSElement)
-    delete fITSElement;
-  fITSElement = NULL;
-
-  if(fISSDElement)
-    delete fISSDElement;
-  fISSDElement = NULL;
-
-  if(fISDDElement)
-    delete fISDDElement;
-  fISDDElement = NULL;
-
-  if(fISPDElement)
-    delete fISPDElement;
-  fISPDElement = NULL;
-
-  if(fTRDElement)
-    delete fTRDElement;
-  fTRDElement = NULL;
-
-  if(fMuonElement)
-    delete fMuonElement;
-  fMuonElement = NULL;
-  if(fAnyElement)
-    delete fAnyElement;
-  fAnyElement = NULL;
   
-
-}
-
+  
 
 
-/*
- * ---------------------------------------------------------------------------------
- *                                 Source Handling
- * ---------------------------------------------------------------------------------
- */
+}
 
-//##################################################################################
+ //____________________________________________________________________________________
 Int_t AliEveHOMERManager::CreateEveSourcesList() {
   // see header file for class documentation
 
@@ -207,12 +65,13 @@ Int_t AliEveHOMERManager::CreateEveSourcesList() {
 
   Int_t iResult = CreateSourcesList();
 
-  //  fStateHasChanged = kTRUE;
+  fStateHasChanged = kTRUE;
   
   HLTDebug(Form("iResult XXX %d", iResult));
   if ( iResult )
     return iResult;
 
 
   HLTDebug(Form("iResult %d", iResult));
   if (fSrcList) {
@@ -230,62 +89,59 @@ Int_t AliEveHOMERManager::CreateEveSourcesList() {
     HLTInfo("no source list");
     fSrcList = new AliEveHOMERSourceList("HLT Sources");
     fSrcList->SetManager(this);
-    
     AddElement(fSrcList);
   }
   
   //HLTInfo(Form("createbytype", iResult));
   fSrcList->CreateByDet();
   
-  HLTDebug(Form("Done createing source list %d", iResult));    
-  
-  
-  
+  HLTDebug(Form("Done creating source list %d", iResult));    
+    
   return iResult;
 }
 
-//##################################################################################
-Int_t AliEveHOMERManager::CreateEveSourcesListLoop() {
-  // see header file for class documentation
-
-  Int_t iResult = 0;
-
-  for ( Int_t retry = 0; retry < fRetryCount ; retry++ ) {
+///_______________________________________________________________
+void AliEveHOMERManager::StartEveSourceListLoop() {
+  HLTInfo("Starting source list timer");
+  fSourceListTimer->Start(5000); 
+}
+///_______________________________________________________________
+void AliEveHOMERManager::StopEveSourceListLoop() {
+  fSourceListTimer->Stop(); 
+}
 
-    iResult = CreateEveSourcesList();
 
-    if (!iResult) {
-      HLTInfo("Source list successfully created.");
-      break;
-    }
-    else if (iResult == 1) {
-      HLTWarning( Form("Couldn't find active services, sleeping %d s before making attempt %d out of %d", fRetrySleeptime, retry, fRetryCount) ) ;
-    }   
-    else if (iResult == 2) {
-      HLTWarning( Form("Services List empty, sleeping %d s before making new attempt.", fRetrySleeptime) ) ;
-    }
-    else {
-      HLTError( Form("Other problem ... \n") ); 
-      return iResult;
-    } 
+//________________________________________________________________###
+Int_t AliEveHOMERManager::CreateEveSourcesListLoop() {
+  // see header file for class documentation
 
-    //fSourceListTimer->Start(fRetrySleeptime, kFALSE);
-    sleep(fRetrySleeptime);
+  HLTInfo("Attempting to create source list");
+  Int_t iResult = CreateEveSourcesList();
 
+  if (!iResult) {
+    HLTInfo("Source list successfully created.");
+    StopEveSourceListLoop();
+    HLTInfo("Conneting to sources");
+    return ConnectEVEtoHOMER();
   }
+  
 
-  if ( iResult ) {
-    HLTWarning( Form("Couldn't find active services.") );
-    return iResult;
+  else if (iResult == 1) {
+    HLTWarning( Form("Couldn't find active services,"));
+  
+  } else if (iResult == 2) {
+    HLTWarning( Form("Services List empty, sleeping %d s before making new attempt.", fRetrySleeptime) ) ;
+  
+  } else {
+    HLTError( Form("Other problem ... \n") ); 
   } 
   
   return iResult;
 }
 
-//##################################################################################
+//________________________________________________________________
 Int_t AliEveHOMERManager::ConnectEVEtoHOMER( TString detector ) {
   // see header file for class documentation
-
   HLTInfo("");
   fStateHasChanged = fSrcList->GetSelectedSources();
   HLTInfo(Form("has state changed % d", fStateHasChanged));
@@ -293,278 +149,37 @@ Int_t AliEveHOMERManager::ConnectEVEtoHOMER( TString detector ) {
 }
 
 
-//##################################################################################
+//________________________________________________________________
 Int_t AliEveHOMERManager::ReConnectHOMER( TString /*detector*/ ){
   // see header file for class documentation
-  
   Int_t iResult = 0;
-
-  DisconnectHOMER();
-  iResult = CreateEveSourcesListLoop();
-  HLTInfo("Created new source list, reconnect to HOMER");
-  iResult = ConnectEVEtoHOMER();
-  if ( iResult ) {
-    HLTError(Form("Error reconnecting."));
-  }
-
+  if (Connected()) DisconnectHOMER();
+  StartEveSourceListLoop();
   return iResult;
 }
 
-
 //_____________________________________________________________________________________
-Int_t AliEveHOMERManager::NextHOMEREvent() {
+TList * AliEveHOMERManager::NextHOMEREvent() {
   //See header file for documentation  
-  Int_t iResult = 0;
+  
+  if(!Connected()) {
+    cout << "AliEveHOMERManager::NextHOMEREvent(): HOMER is not connected to a source!"<<endl;
+    return NULL;
+  }
 
   
   if ( NextEvent() ) {
     
     HLTInfo("Failed getting next event, trying to reconnect");
-    iResult = ReConnectHOMER();
-    return NextHOMEREvent();
-  }
-  return ProcessEvent();
-}
-
-
-//______________________________________________________________________________________________
-Int_t AliEveHOMERManager::ProcessEvent() {
-
-  //We have a new event, reset display items (need to check if there really is anything interesting in event before resetting. ie not just histos)
-  ResetDisplay();
-
-  AliHLTHOMERBlockDesc * block = NULL;
-
-
-  //Process the SYNCED block list
-  if ( GetBlockList() == NULL) {
-    printf ("onlineDisplay:   No regular BlockList ... \n");
-    cout << endl;
-    //return -1;
-   
-  } else {
-    
-    if (GetBlockList()->IsEmpty() ) {
-      printf ("onlineDisplay:   No Sync Blocks in list ... \n");
-      cout<<endl;
-      //return;
-    }  
-   
     
-    TIter next(GetBlockList());
-    while ((block = (AliHLTHOMERBlockDesc*)next())) {
-      ProcessBlock(block);
-     
-    } 
-  }
-
-
-  //Read out histograms and elements from detectors outside physics 1 partition
-  TIter anext(GetAsyncBlockList());
-
-  while ( (block = (AliHLTHOMERBlockDesc*)anext()) ) {
-    ProcessBlock(block);
-  }
-  
-  UpdateDisplay();
-
-  return 0;
-
-}
-
-void  AliEveHOMERManager::UpdateDisplay() {
-  //See header file for documentation
-  fPhosElement->UpdateElements();
-  fEmcalElement->UpdateElements();
-  fTPCElement->UpdateElements();
-  fHLTElement->UpdateElements();
-  fITSElement->UpdateElements();
-  fISSDElement->UpdateElements();
-  fISDDElement->UpdateElements();
-  fISPDElement->UpdateElements();
-  fTRDElement->UpdateElements();
-  if(fAnyElement) fAnyElement->UpdateElements();
-  if(fMuonElement) fMuonElement->UpdateElements();
-
-
-  // -- Set EventID in Window Title  
-  TString winTitle("Eve Main Window -- Event ID : ");
-  winTitle += Form("0x%lu ", GetEventID() );
-  GetEveManager()->GetBrowser()->SetWindowName(winTitle);
-
-  //==============================================================================
-  // -- Import global scene into projection scenes
-  //==============================================================================
-
-  // XXX Primary vertex ... to be retrieved from the ESD
-  Double_t x[3] = { 0, 0, 0 };
-  
-  TEveElement* top = GetEveManager()->GetCurrentEvent();
-  
-  if (fRPhiManager && top) {
-    fRPhiEventScene->DestroyElements();
-    if (fCenterProjectionsAtPrimaryVertex)
-      fRPhiManager->SetCenter(x[0], x[1], x[2]);
-    fRPhiManager->ImportElements(top, fRPhiEventScene);
-  }
-  
-  if (fRhoZManager && top) {
-    fRhoZEventScene->DestroyElements();
-    if (fCenterProjectionsAtPrimaryVertex)
-      fRhoZManager->SetCenter(x[0], x[1], x[2]);
-    fRhoZManager->ImportElements(top, fRhoZEventScene);
-  }
-
-
-  //Redraw the display
-  GetEveManager()->Redraw3D(0,1); // (0, 1)
-  GetEveManager()->EnableRedraw(); 
-
-}
-
-void AliEveHOMERManager::ProcessBlock(AliHLTHOMERBlockDesc * block) {
-  //See header file for documentation
-  
-#if 0//DEBUG
-  printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
-  printf( "Detector           : %s\n", block->GetDetector().Data() );
-  printf( "Datatype           : %s\n", block->GetDataType().Data() );
-  if (block->IsTObject() )
-    printf( "Is TObject of class: %s\n", block->GetClassName().Data() );
-  printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
-#endif
-
-
-  if(fShowBarrel) {
-
-    if ( ! block->GetDetector().CompareTo("PHOS") ) 
-      fPhosElement->ProcessBlock(block);
-    
-    else if ( ! block->GetDetector().CompareTo("EMCA") ) 
-      fEmcalElement->ProcessBlock(block);
-  
-    else if ( ! block->GetDetector().CompareTo("TPC") ) 
-      fTPCElement->ProcessBlock(block);
-  
-    else if ( ! block->GetDetector().CompareTo("HLT") ) 
-      fHLTElement->ProcessBlock(block);
-  
-    else if ( ! block->GetDetector().CompareTo("ITS") ) 
-      fITSElement->ProcessBlock(block);
-  
-    else if ( ! block->GetDetector().CompareTo("ISDD") ) 
-      fISDDElement->ProcessBlock(block);
-  
-    else if ( ! block->GetDetector().CompareTo("ISPD") ) 
-      fISPDElement->ProcessBlock(block);
-  
-    else if ( ! block->GetDetector().CompareTo("ISSD") ) 
-      fISSDElement->ProcessBlock(block);
-
-    else if ( ! block->GetDetector().CompareTo("TRD") ) 
-      fTRDElement->ProcessBlock(block);
-   
-    else if ( ! block->GetDetector().CompareTo("MUON") ) {
-      //Do Nothing
-       
-
-    } else {
-      if(!fAnyElement) {
-       fAnyElement = new AliHLTEveAny();
-       fAnyElement->SetEventManager(this);
-      } 
-      fAnyElement->ProcessBlock(block);
-    }
-     
-  }
-
-   
-  if(fShowMuon) {
-    if ( ! block->GetDetector().CompareTo("MUON") ) {
-      if(!fMuonElement) {
-       fMuonElement = new AliHLTEveMuon();
-       fMuonElement->SetEventManager(this);
-      }
-      fMuonElement->ProcessBlock(block);
+    Int_t iResult = ReConnectHOMER();
+    if(iResult)  {
+      HLTError("Error establishing connection to sources");
     }
+    
+    return NULL;
   }
-
-}
-
-void AliEveHOMERManager::ResetDisplay () {
-  //See header file for documentation
-
- if(fPhosElement)
-   fPhosElement->ResetElements();
- if(fEmcalElement)
-   fEmcalElement->ResetElements();
- if(fTPCElement)
-   fTPCElement->ResetElements();
- if(fHLTElement)
-   fHLTElement->ResetElements();
  
- if(fITSElement)
-   fITSElement->ResetElements();
- if(fISPDElement)
-   fISPDElement->ResetElements();
- if(fISDDElement)
-   fISDDElement->ResetElements();
- if(fISSDElement)
-   fISSDElement->ResetElements();
-
- if (fTRDElement)
-   fTRDElement->ResetElements();
-
- if(fAnyElement)
-   fAnyElement->ResetElements();
-
- if(fMuonElement)
-   fMuonElement->ResetElements();
-
-}
-
-
-void AliEveHOMERManager::PrintScreens() {
-  //See header file for documentation
-
-  fEveManager->GetDefaultGLViewer()->SavePicture(Form("0x%lu_3D.gif", GetEventID()));
-  fRhoZViewer->GetGLViewer()->SavePicture(Form("0x%lu_RhoZ.gif", GetEventID()));
-  fRPhiViewer->GetGLViewer()->SavePicture(Form("0x%lu_RPhi.gif", GetEventID()));
-
-}
-
-void AliEveHOMERManager::StartLoop() {
-  //See header file for documentation
-  //fTimer->SetCommand("NextEvent()", "AliEveHOMERManager", this);
-  SetEventLoopStarted(kTRUE);
-  fTimer->Start(10000);
-}
-
-void AliEveHOMERManager::StopLoop() {
-  //See header file for documentation
-  fTimer->Stop();
-  SetEventLoopStarted(kFALSE);
-}
-
-// void AliEveHOMERManager::TimeOut(Int_t sec) {
+  return GetBlockList();
   
-//   TTimer t(sec*1000, kFALSE);
-
-//   cout << "Start timer for " << sec << " seconds" << endl;
-
-//   while (!t.CheckTimer(gSystem->Now()))
-//     gSystem->Sleep(100);  // 100 ms sleep
-
-//   cout << "Timed out." << endl;
-
-// }
+}
index f7dbcc5..65ad75a 100644 (file)
 
 class AliEveHOMERSourceList;
 class TString;
-class TEveManager;
-class TEveScene;
-class TEveProjectionManager;
 class TTimer;
-class TEveViewer;
-
-class AliHLTEvePhos;
-class AliHLTEveEmcal;
-class AliHLTEveTPC;
-class AliHLTEveHLT;
-class AliHLTEveITS;
-class AliHLTEveISSD;
-class AliHLTEveISDD;
-class AliHLTEveISPD;
-class AliHLTEveTRD;
-class AliHLTEveAny;
-class AliHLTEveMuon;
 
 class AliEveHOMERManager : public TEveElementList, public AliHLTHOMERManager {
 
@@ -77,41 +61,10 @@ public:
   void SetRetryCount(Int_t count, Int_t sleeptime) { fRetryCount = count; fRetrySleeptime = sleeptime; }
   
   /** Get next event from the readers */
-  Int_t NextHOMEREvent();
+  TList * NextHOMEREvent();
 
-  /** Process the event data */
-  Int_t ProcessEvent();
-
-  /** Set flag for event loop */
-  void SetEventLoopStarted (Bool_t started) {fEventLoopStarted = started;}
-
-  /** Set flag for showing barrel */
-  void SetBarrelFlag(Bool_t flag) { fShowBarrel = flag;}
-  /** Set flag for showing muon arm */
-  void SetMuonFlag(Bool_t flag) { fShowMuon = flag;}
-
-  /**Set and get the global instance of the Eve manager */
-  void SetEveManager(TEveManager * manager) {fEveManager = manager;}
-  TEveManager * GetEveManager() const {return fEveManager;}
-
-  /**Set and get the global instance of TGeoManager */
-  void SetGeoManager(TGeoManager * manager) {fGeoManager = manager;}
-  TGeoManager * GetGeoManager() const {return fGeoManager;}
-
-  /** Set the projection scenes and their managers */
-  void SetRPhiManager (TEveProjectionManager * mgr) {fRPhiManager = mgr;}
-  void SetRPhiEventScene (TEveScene * scene ) {fRPhiEventScene = scene;}
-  void SetRPhiViewer(TEveViewer * viewer ) {fRPhiViewer = viewer;}
-  void SetRhoZManager(TEveProjectionManager * mgr) {fRhoZManager = mgr;}
-  void SetRhoZEventScene(TEveScene * scene ) {fRhoZEventScene = scene;}
-  void SetRhoZViewer(TEveViewer * viewer ) {fRhoZViewer = viewer;}
-
-  /** Start and stop the automatic event loop */
-  void StartLoop();
-  void StopLoop();
-
-  /** Print the screens to a file **/
-  void PrintScreens();
+  void StartEveSourceListLoop();
+  void StopEveSourceListLoop();
 
  
 private:
@@ -122,53 +75,18 @@ private:
   /** assignment operator prohibited */
   AliEveHOMERManager& operator=(const AliEveHOMERManager&);
 
-  void DestroyDetectorElements();
-  
-  /** Process block */
-  void ProcessBlock(AliHLTHOMERBlockDesc * block);  //Process block
-  /** Reset the elements in the display */
-  void ResetDisplay();  
-  /** Update the display  */
-  void UpdateDisplay(); 
-
   // == sources ==
   AliEveHOMERSourceList* fSrcList;        // List of Connected HOMER Sources
 
+
   Int_t fRetryCount;                     //How many times to retry creating source list before giving up
   Int_t fRetrySleeptime;                 //Sleep time between attempt at craeting source list
 
-  TGeoManager * fGeoManager;              //The global TGeoManager instance
-  TEveManager * fEveManager;              //The global TEveManager instance
-  TEveProjectionManager * fRPhiManager;   //The R - Phi projection scene manager
-  TEveProjectionManager * fRhoZManager;   //The Rho- Z projection sene manager
-  TEveScene * fRPhiEventScene;            //The R - Phi projection scene
-  TEveScene * fRhoZEventScene;            //The Rho - Z projection sene
-  TEveViewer * fRhoZViewer;
-  TEveViewer * fRPhiViewer;
   
-
-
-  TTimer * fTimer;                   //Timer for event loop
-  //TTimer * fSourceListTimer;       //Timer for source list loop
-  AliHLTEvePhos  * fPhosElement;     //Phos eve processor
-  AliHLTEveEmcal * fEmcalElement;    //Emcal eve processor
-  AliHLTEveTPC   * fTPCElement;      //TPC eve processor
-  AliHLTEveHLT   * fHLTElement;      //HLT
-  AliHLTEveITS   * fITSElement;      //ITS
-  AliHLTEveISPD  * fISPDElement;     //ISPD
-  AliHLTEveISSD  * fISSDElement;     //ISSD
-  AliHLTEveISDD  * fISDDElement;     //ISDD
-  AliHLTEveTRD   * fTRDElement;      //TRD
-  AliHLTEveMuon  * fMuonElement;     //MUON
-  AliHLTEveAny   * fAnyElement;      //Catch all
-
-  Bool_t fEventLoopStarted;                    // Flag indicating whether the loop is running
-  Bool_t fCenterProjectionsAtPrimaryVertex;    // Flag indicating whether to center the projection scenes at primary vertex (as opposed to 0, 0, 0)
-  Bool_t fShowBarrel;                               // Display barrel detectors ?
-  Bool_t fShowMuon;                                 // Display Muon arm ?
-   
+  TTimer * fSourceListTimer;             //Timer to attempt source list creation!
+    
   ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
+  
 
 };
 #endif
index 5be4242..e160ffd 100644 (file)
@@ -35,14 +35,8 @@ TGedFrame(p, width, height, options | kVerticalFrame, back),
   fButtonConnect(NULL),
   fButtonWriteToFile(0),
   fButtonNextEvent(0),
-  fButtonNavigateBack(0),
-  fButtonNavigateFwd(0),
   fButtonPrintScreens(NULL),
-  fBoxTriggerSelector(0),
-//  fBoxEventLoopSpeed(0),
-  fButtonEventLoopText(0),
-  fButtonEventLoop(0),
- fEventLoopStarted(kFALSE) 
+  fBoxTriggerSelector(0)
 {
   
   MakeTitle("AliEveHOMERManager");
@@ -65,19 +59,6 @@ TGedFrame(p, width, height, options | kVerticalFrame, back),
   AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
   fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()");
 
-  fButtonNavigateBack = new TGTextButton(this, "  Navigate Back  ");
-  AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...));
-  fButtonNavigateBack->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateBack()");
-
-  fButtonNavigateFwd = new TGTextButton(this, "  Navigate Fwd  ");
-  AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...));
-  fButtonNavigateFwd->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateFwd()");
-
-
-  fButtonPrintScreens = new TGTextButton(this, "  Save Viewers  ");
-  AddFrame(fButtonPrintScreens); //, new TGLayoutHints(...));
-  fButtonPrintScreens->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "PrintScreens()");
-
 
   fBoxTriggerSelector = new TGComboBox(this, "Select Trigger");
   fBoxTriggerSelector->AddEntry("HLT Global Trigger", 0);
@@ -89,13 +70,7 @@ TGedFrame(p, width, height, options | kVerticalFrame, back),
   fBoxTriggerSelector->SetHeight(25);
   AddFrame(fBoxTriggerSelector);
 
-  fButtonEventLoopText = new TGTextButton(this, "  Loop Events  ");
-  AddFrame(fButtonEventLoopText); //, new TGLayoutHints(...));
-  fButtonEventLoopText->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
 
-  fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png"));
-  AddFrame(fButtonEventLoop); //, new TGLayoutHints(...));
-  fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
 }
 
 /******************************************************************************/
@@ -119,62 +94,7 @@ void AliEveHOMERManagerEditor::NextEvent() {
   fM->NextHOMEREvent();
 }
 
-void AliEveHOMERManagerEditor::WriteBlockListToFile() {
-  gROOT->ProcessLineFast("writeToFile();");
-
-}
-
-
-void AliEveHOMERManagerEditor::PrintScreens() {
-  //Print screens
-  fM->PrintScreens();
-}
-
-void AliEveHOMERManagerEditor::NavigateFwd() {
-  // navigate forward
-  
-  if ( !fEventLoopStarted ) {
-    if ( fM->NavigateEventBufferFwd() == -1 )
-      return;
-
-    fM->ProcessEvent();
-    //    gROOT->ProcessLineFast("processEvent();");
-  }
-  return;
-}
-
-void AliEveHOMERManagerEditor::NavigateBack() {
-  // navigate back
-
-  if ( !fEventLoopStarted ) {
-    if ( fM->NavigateEventBufferBack() == -1 )
-      return;
-    
-    fM->ProcessEvent();
-    //gROOT->ProcessLineFast("processEvent();");
-  }
-  return;
-}
 
-void AliEveHOMERManagerEditor::EventLoop() {
-  // Start/stop event loop
-  if ( !fEventLoopStarted ) {
-    fEventLoopStarted = kTRUE;
-    fButtonEventLoopText->SetText(" Stop Loop ");
-    //fM->SetEventLoopStarted(kTRUE);
-    fM->StartLoop();
-    
-    //    gROOT->ProcessLineFast("loopEvent();");
-  
-  } else {
-    
-    //gROOT->ProcessLineFast("stopLoopEvent();");
-    fM->StopLoop();
-    fEventLoopStarted = kFALSE;
-    //fM->SetEventLoopStarted(kFALSE);
-    fButtonEventLoopText->SetText(" Loop Events ");
-  }
-}
 
 void AliEveHOMERManagerEditor::SetTriggerString(int id) {
 
index bb0cb4c..e3fd88f 100644 (file)
@@ -32,13 +32,9 @@ public:
   // Declare callback/slot methods
   void ConnectToHLT();
   void NextEvent();
-  void EventLoop();
 
-  void NavigateBack();
-  void NavigateFwd();
   void SetTriggerString(int id);
-  void WriteBlockListToFile();
-  void PrintScreens();
+
 protected:
 
   AliEveHOMERManager  *fM; // Model object.
@@ -46,21 +42,14 @@ protected:
   TGTextButton     *fButtonConnect; // Button to connect to HOMER.
   TGTextButton     *fButtonWriteToFile; // Button to write block list to file
   TGTextButton     *fButtonNextEvent; // Button to call next Even
-  TGTextButton     *fButtonNavigateBack; // Button to navigate back
-  TGTextButton     *fButtonNavigateFwd;  // Button to navigate fwd
   TGTextButton     *fButtonPrintScreens;  // Button to print viewers
   TGComboBox       *fBoxTriggerSelector; // Drop down menu to select trigger criteria.
-  TGTextButton     *fButtonEventLoopText; //Text button to start / stop event loop.
-  //TGComboBox       *fBoxEventLoopSpeed; // Drop down menu to set the speed of the loop.
-  TGPictureButton  *fButtonEventLoop; // Picture button to start/stop event loop, HLT LOGO.
   
 
 private:
   AliEveHOMERManagerEditor(const AliEveHOMERManagerEditor&);            // Not implemented
   AliEveHOMERManagerEditor& operator=(const AliEveHOMERManagerEditor&); // Not implemented
 
-  Bool_t fEventLoopStarted;
-
   ClassDef(AliEveHOMERManagerEditor, 0); // Editor for AliEveHOMERManager
 };
 
index 684d94f..c5fb2db 100644 (file)
 #pragma link C++ class AliEveHOMERSource+;
 #pragma link C++ class AliEveHOMERSourceList+;
 #pragma link C++ class AliEveHOMERSourceMap+;
+#pragma link C++ class AliEveHLTEventManager+;
+#pragma link C++ class AliEveHLTEventManagerOffline+;
+#pragma link C++ class AliEveHLTEventManagerHomer+;
+#pragma link C++ class AliEveHLTEventManagerEditor+;
+#pragma link C++ class AliEveEventBuffer+;
+#pragma link C++ class AliEveEventBufferOffline+;
+#pragma link C++ class AliEveEventBufferHomer+;
index 138c214..a5d0639 100644 (file)
@@ -29,7 +29,7 @@
 #include "TEveManager.h"\r
 \r
 #include "AliEveHOMERManager.h"\r
-\r
+#include "AliEveHLTEventManager.h"\r
 #include "geom_gentle_hlt.C"\r
 \r
 //***************************************************************\r
@@ -74,89 +74,12 @@ Bool_t gShowMUONRhoZ = kTRUE;
 Bool_t gShowTRD      = kFALSE;\r
 \r
 \r
-// -----------------------------------------------------------------\r
-// --                         Members                            --\r
-// -----------------------------------------------------------------\r
-\r
-// -- Timer for automatic event loop\r
-TTimer                                    eventTimer;\r
-TTimer                                    eventTimerFast;\r
-\r
 // -- HOMERManager\r
 AliEveHOMERManager*                       gHomerManager      = 0;\r
+AliEveHLTEventManager*                       geventManager      = 0;\r
 \r
 // -- Geometry Manager \r
 TGeoManager*                              gGeoManager        = 0;\r
-AliPHOSGeometry*                          gPHOSGeom          = 0;\r
-\r
-// -- Cluster members\r
-TEvePointSet*                             gSPDClusters       = 0;\r
-TEvePointSet*                             gSSDClusters       = 0;\r
-TEvePointSet*                             gSDDClusters       = 0;\r
-TEvePointSet*                             gTRDClusters       = 0;\r
-TEvePointSetArray*                        gTRDColClusters    = 0;\r
-TEvePointSet*                             gTPCClusters       = 0;\r
-TEvePointSet*                             gTPCTestClusters       = 0;\r
-TEvePointSetArray*                        gTPCColClusters    = 0;\r
-TEveBoxSet*                               gPHOSBoxSet[5]     = {0, 0, 0, 0, 0}; \r
-TEveBoxSet*                               gEMCALBoxSet[13]   = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\r
-TEvePointSet*                             gMUONClusters      = 0;\r
-TEveStraightLineSet*                      gMUONTracks        = 0;\r
-\r
-// -- Text output members\r
-TEveText*                                 gHLTText           = 0;\r
-\r
-// -- Tracks members\r
-TEveTrackList*                            gTPCTrack          = 0;\r
-\r
-// -- Canvas for histograms\r
-TCanvas*                                  gTRDCanvas         = 0;\r
-TCanvas*                                  gTPCCanvas         = 0;\r
-TCanvas*                                  gTPCClustCanvas          = 0;\r
-TCanvas*                                  gTRDCalibCanvas    = 0;\r
-TCanvas*                                  gTRDEORCanvas      = 0;\r
-TCanvas*                                  gPrimVertexCanvas  = 0;\r
-TCanvas*                                  gSPDVertexCanvas   = 0;\r
-TCanvas*                                  gITSCanvas         = 0;\r
-TCanvas*                                  gSSDCanvas0        = 0;\r
-TCanvas*                                  gSSDCanvas1        = 0;\r
-TCanvas*                                  gV0Canvas          = 0;\r
-TCanvas*                                  gPHOSCanvas          = NULL;\r
-TCanvas*                                  gEMCALCanvas          = 0;\r
-\r
-// -- vertex --\r
-Int_t                                     gSPDVertexHistoCount  = 0;\r
-\r
-\r
-\r
-// -- TRD --\r
-Int_t                                     gTRDHistoCount     = 0;\r
-Int_t                                     gTRDEvents         = 0;\r
-Int_t                                     gTRDBins           = 12;\r
-\r
-// -- TPC --\r
-Int_t                                     gTPCBins           = 15;\r
-TH1F*                                     gTPCCharge         = 0;\r
-TH1F*                                     gTPCQMax           = 0;\r
-TH1F*                                     gTPCQMaxOverCharge = 0;\r
-\r
-TH1F*                                     gTPCPt        = 0; // KK\r
-TH1F*                                     gTPCEta       = 0; \r
-TH1F*                                     gTPCPsi       = 0; \r
-TH1F*                                     gTPCnClusters = 0; \r
-TH1F*                                     gTPCMult      = 0;\r
-\r
-// -- PHOS --\r
-TEveElementList*                          gPHOSElementList   = 0;\r
-Int_t                                     gPHOSHistoCount    =0;\r
-// -- EMCAL\r
-TEveElementList*                          gEMCALElementList  = 0;\r
-TGeoNode*                                 gEMCALNode         = 0;\r
-Int_t                                     gEMCALHistoCount    =0;\r
-\r
-// --- Flag if eventloop is running\r
-Bool_t                                    gEventLoopStarted = kFALSE;\r
-\r
 \r
 \r
 //Container for gGeoManager till it is broken\r
@@ -200,6 +123,7 @@ void od ( Bool_t showBarrel = kTRUE, Bool_t showMuon = kFALSE ) {
 \r
   // -- Initialize Eve\r
   // -------------------\r
+  cout << "Initializing the EVE viewer"<<endl;\r
   initializeEveViewer( showBarrel, showMuon );\r
 \r
   // -- Reset gGeoManager to the original pointer\r
@@ -212,47 +136,54 @@ void od ( Bool_t showBarrel = kTRUE, Bool_t showMuon = kFALSE ) {
 \r
   // -- Create new hM object\r
   // -------------------------\r
-  gHomerManager = new AliEveHOMERManager();\r
-  gHomerManager->SetRetryCount(1000,15);\r
-  gHomerManager->SetEveManager(gEve);\r
-  gHomerManager->SetGeoManager(gGeoManager);\r
-  gHomerManager->SetRPhiManager(gRPhiMgr);\r
-  gHomerManager->SetRPhiEventScene(gRPhiEventScene);\r
-  gHomerManager->SetRPhiViewer(gRPhiView);\r
-  gHomerManager->SetRhoZManager(gRhoZMgr);\r
-  gHomerManager->SetRhoZEventScene(gRhoZEventScene);\r
-  gHomerManager->SetRhoZViewer(gRhoZView);\r
-  gHomerManager->SetBarrelFlag(showBarrel);\r
-  gHomerManager->SetMuonFlag(showMuon);\r
-\r
-  Int_t iResult = gHomerManager->Initialize();\r
-  if (iResult) { \r
-    printf("Error Initializing AliHLTHOMERManager, quitting");\r
-    return; \r
-  }\r
+\r
+  cout << "Creating the Event Manager"<<endl;\r
+  gEventManager = new AliEveHLTEventManagerHomer();\r
+  gEventManager->SetEveManager(gEve);\r
+  gEventManager->SetGeoManager(gGeoManager);\r
+  gEventManager->SetRPhiManager(gRPhiMgr);\r
+  gEventManager->SetRPhiEventScene(gRPhiEventScene);\r
+  gEventManager->SetRPhiViewer(gRPhiView);\r
+  gEventManager->SetRhoZManager(gRhoZMgr);\r
+  gEventManager->SetRhoZEventScene(gRhoZEventScene);\r
+  gEventManager->SetRhoZViewer(gRhoZView);\r
\r
+  //gEventManager->SetBarrelFlag(showBarrel);\r
+  //gEventManager->SetMuonFlag(showMuon);\r
+\r
+  // Int_t iResult = gHomerManager->Initialize();\r
+  // if (iResult) { \r
+  //   printf("Error Initializing AliHLTHOMERManager, quitting");\r
+  //   return; \r
+  // }\r
+  \r
+  // gEventManager->SetHomerManager(gHomerManager);\r
 \r
   // -- Add hM to EveTree\r
   // ----------------------\r
-  gEve->AddToListTree(gHomerManager, kTRUE);\r
+  //gEve->AddToListTree(gHomerManager, kTRUE);\r
+  gEve->AddToListTree(gEventManager, kTRUE);\r
 \r
   // -- Create SourceList\r
   // ----------------------\r
-  iResult = gHomerManager->CreateEveSourcesListLoop();\r
-  if (iResult) {\r
-    printf ("Couldn't find active services. Giving up. \n");\r
-    return;\r
-  } \r
-\r
-\r
-  if ( showBarrel ) {\r
-    gHomerManager->ConnectEVEtoHOMER("TPC" );\r
-  } else if ( MUONMode ) {\r
-    gHomerManager->ConnectEVEtoHOMER("MUON");\r
-  } else if( TRDMode ) {\r
-    gHomerManager->ConnectEVEtoHOMER("TRD");  \r
-  } else {\r
-    cout<<" No detectors selected, nothing will be displayed"<<endl;\r
-  }    \r
+  // iResult = gHomerManager->CreateEveSourcesListLoop();\r
+  // if (iResult) {\r
+  //   printf ("Couldn't find active services. Giving up. \n");\r
+  //   return;\r
+  // } \r
+\r
+\r
+  // if ( showBarrel ) {\r
+  //   gHomerManager->ConnectEVEtoHOMER("TPC" );\r
+  // } else if ( MUONMode ) {\r
+  //   gHomerManager->ConnectEVEtoHOMER("MUON");\r
+  // } else if( TRDMode ) {\r
+  //   gHomerManager->ConnectEVEtoHOMER("TRD");  \r
+  // } else {\r
+  //   cout<<" No detectors selected, nothing will be displayed"<<endl;\r
+  // } \r
+  // THIS LINE DOES NOT WORK. PLEASE USE ANOTHER LINE!\r
+\r
 \r
   gGeoManager = fGeoManager;\r
   \r
@@ -428,7 +359,6 @@ Int_t initializeEveViewer( Bool_t showBarrel, Bool_t showMuon ) {
 \r
 \r
   gStyle->SetPalette(1, 0);\r
-\r
   gStyle->SetOptFit(1);\r
 \r
 \r
@@ -436,423 +366,6 @@ Int_t initializeEveViewer( Bool_t showBarrel, Bool_t showMuon ) {
   return 0;\r
 }\r
 \r
-// -----------------------------------------------------------------\r
-void nextEvent() {\r
-\r
-  if ( gHomerManager->NextEvent() ) {\r
-    if (gEventLoopStarted) {\r
-      cout << "HomerManager failed getting next event, trying to reconnect" << endl;\r
-\r
-      gHomerManager->DisconnectHOMER();\r
-      gHomerManager->ConnectEVEtoHOMER();\r
-      nextEvent();\r
-   \r
-    } else {\r
-      return;\r
-    }\r
-  }\r
-\r
-  //  processEvent();\r
-}\r
-\r
-\r
-\r
-// -----------------------------------------------------------------\r
-\r
-\r
-Int_t updateDisplay() {\r
-\r
-  Int_t iResult = 0;\r
-\r
-  \r
-    \r
-  //==============================================================================\r
-  // -- Set EventID in Window Title  \r
-  // -- Update Objects\r
-  //==============================================================================\r
-\r
-  TString winTitle("Eve Main Window -- Event ID : ");\r
-  winTitle += Form("0x%016X ", gHomerManager->GetEventID() );\r
-  gEve->GetBrowser()->SetWindowName(winTitle);\r
-\r
-  //==============================================================================\r
-  // -- Set Projections\r
-  //==============================================================================\r
-\r
-  // XXX Primary vertex ... to be retrieved from the ESD\r
-  Double_t x[3] = { 0, 0, 0 };\r
-  \r
-  TEveElement* top = gEve->GetCurrentEvent();\r
-  \r
-  if (gRPhiMgr && top) {\r
-    gRPhiEventScene->DestroyElements();\r
-    if (gCenterProjectionsAtPrimaryVertex)\r
-      gRPhiMgr->SetCenter(x[0], x[1], x[2]);\r
-    gRPhiMgr->ImportElements(top, gRPhiEventScene);\r
-  }\r
-  \r
-  if (gRhoZMgr && top) {\r
-    gRhoZEventScene->DestroyElements();\r
-    if (gCenterProjectionsAtPrimaryVertex)\r
-      gRhoZMgr->SetCenter(x[0], x[1], x[2]);\r
-    gRhoZMgr->ImportElements(top, gRhoZEventScene);\r
-  }\r
-\r
-  //==============================================================================\r
-\r
-  gEve->Redraw3D(0,1); // (0, 1)\r
-  gEve->EnableRedraw(); \r
-\r
-  return iResult;\r
-\r
-}\r
-\r
-\r
-\r
-\r
-\r
-// -----------------------------------------------------------------\r
-Int_t processROOTTOBJ(AliHLTHOMERBlockDesc* block, TEveText* /*et*/) {\r
-  \r
-  // -- AliHLTGlobalTriggerDecision\r
-  if ( ! block->GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {\r
-\r
-    AliHLTGlobalTriggerDecision *trig = dynamic_cast<AliHLTGlobalTriggerDecision*>( block->GetTObject());\r
-    trig->Print(); \r
-    \r
-    // et->SetText("balle");;\r
-\r
-    // TEveText* tt = new TEveText("Trigger: Class is known ;-) ");\r
-    // gEve->AddElement(tt);\r
-\r
-  }\r
-  else {\r
-    printf(" Unknown root object %s",block->GetClassName().Data() );\r
-  }\r
-\r
-  return 0;\r
-}\r
-\r
-\r
-// -----------------------------------------------------------------\r
-Int_t processMUONClusters(AliHLTHOMERBlockDesc* block) {\r
-  \r
-  Int_t iResult = 0;\r
-  \r
-  unsigned long size = block->GetSize();\r
-  Int_t * buffer ;\r
-\r
-  buffer = (Int_t *)block->GetData();\r
-//   cout<<"block size : "<<size<<", buffer : "<<buffer<<", DataType : "<<block->GetDataType()<<endl;\r
-\r
-// //   for(int idata=0;idata<int(size);idata++)\r
-// //     printf("\tbuffer[%d] : %d\n",idata,buffer[idata]);\r
-  \r
-  \r
-  \r
-  if(block->GetDataType().CompareTo("RECHITS") == 0){\r
-\r
-    AliHLTMUONRecHitsBlockReader trackblock((char*)buffer, size);\r
-    const AliHLTMUONRecHitStruct* hit = trackblock.GetArray();\r
-    \r
-    for(AliHLTUInt32_t ientry = 0; ientry < trackblock.Nentries(); ientry++){\r
-//       cout << setw(13) << left << hit->fX << setw(0);\r
-//       cout << setw(13) << left << hit->fY << setw(0);\r
-//       cout << hit->fZ << setw(0) << endl;\r
-      if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0)\r
-       gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);\r
-      hit++;\r
-      \r
-    }// track hit loop\r
-  }\r
-\r
-  else{// if rechits\r
-    //     if(!strcmp((BlockType(ULong64_t(reader->GetBlockDataType(i)))).Data(),"TRIGRECS")){\r
-  \r
-    AliHLTMUONTriggerRecordsBlockReader trigblock(buffer, size);\r
-    const AliHLTMUONTriggerRecordStruct* trigrec = trigblock.GetArray();\r
-    for(AliHLTUInt32_t ientry = 0; ientry < trigblock.Nentries(); ientry++){\r
-      \r
-      const AliHLTMUONRecHitStruct* hit = &trigrec->fHit[0];\r
-      for(AliHLTUInt32_t ch = 0; ch < 4; ch++)\r
-       {\r
-//       cout << setw(10) << left << ch + 11 << setw(0);\r
-//       cout << setw(13) << left << hit->fX << setw(0);\r
-//       cout << setw(13) << left << hit->fY << setw(0);\r
-//       cout << hit->fZ << setw(0) << endl;\r
-         if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0)\r
-           gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);\r
-         hit++;\r
-       }// trig chamber loop\r
-      trigrec++;\r
-    }//trig hit loop\r
-  }//else trigger\r
-\r
-  return iResult;\r
-}\r
-\r
-// -----------------------------------------------------------------\r
-Int_t processMUONTracks(AliHLTHOMERBlockDesc* block) {\r
-  \r
-  Int_t iResult = 0;\r
-  \r
-  unsigned long size = block->GetSize();\r
-  Int_t * buffer = (Int_t *)block->GetData();\r
-  AliHLTMUONRecHitStruct hit1,hit2;\r
-  hit1.fX = hit1.fY = hit1.fZ = hit2.fX = hit2.fY = hit2.fZ = 0;\r
-  Int_t ch1=0, ch2=0;\r
-  Float_t x0=0.0,y0=0.0,z0=0.0;\r
-  Float_t x3=0.0,y3=0.0,z3=0.0;\r
-  if(block->GetDataType().CompareTo("MANTRACK") == 0){  \r
-    AliHLTMUONMansoTracksBlockReader mantrackblock(buffer, size);\r
-    const AliHLTMUONMansoTrackStruct* mtrack = mantrackblock.GetArray();\r
-    for(AliHLTUInt32_t ientry = 0; ientry < mantrackblock.Nentries(); ientry++){\r
-      const AliHLTMUONRecHitStruct* hit = &mtrack->fHit[0];\r
-      for(AliHLTUInt32_t ch = 0; ch < 4; ch++){\r
-       // cout << setw(10) << left << ch + 7 << setw(0);\r
-       // cout << setw(13) << left << hit->fX << setw(0);\r
-       // cout << setw(13) << left << hit->fY << setw(0);\r
-       // cout << hit->fZ << setw(0) << endl;\r
-       if(hit->fZ != 0.0){\r
-         if(ch==0 || ch==1){\r
-           hit1 = *hit; ch1 = ch+6;\r
-         }else{\r
-           hit2 = *hit; ch2 = ch+6;\r
-         }\r
-       }\r
-       hit++;\r
-      }// trig chamber loop\r
-      // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch1,hit1.fX,hit1.fY,hit1.fZ);\r
-      // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch2,hit2.fX,hit2.fY,hit2.fZ);\r
-      // meminfo();\r
-      z3 = AliMUONConstants::DefaultChamberZ(ch2+4);\r
-      y3 =  hit1.fY - (hit1.fZ-z3)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ;\r
-      x3 =  hit1.fX - (hit1.fZ-z3)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ;\r
-\r
-      z0 = AliMUONConstants::DefaultChamberZ(ch1);\r
-      y0 =  hit1.fY - (hit1.fZ-z0)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ;\r
-      x0 =  hit1.fX - (hit1.fZ-z0)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ;\r
-      \r
-\r
-      gMUONTracks->AddLine(x0,y0,z0,x3,y3,z3);\r
-      mtrack++;\r
-    }\r
-    cout<<"NofManso Tracks : "<<mantrackblock.Nentries()<<endl;\r
-  }\r
-  \r
-  return iResult;\r
-\r
-}\r
-\r
\r
-// -----------------------------------------------------------------\r
-Int_t processTRDClusters(AliHLTHOMERBlockDesc* block, TEvePointSet *cont, TEvePointSetArray *contCol) {\r
-  \r
-  Int_t iResult = 0;\r
-\r
-  Int_t sm = block->GetSubDetector();\r
-  if ( sm == 6 ) sm = 7;\r
-  \r
-  Float_t phi   = ( sm + 0.5 ) * TMath::Pi() / 9.0;  \r
-  Float_t cos   = TMath::Cos( phi );\r
-  Float_t sin   = TMath::Sin( phi );\r
-  \r
-  Byte_t* ptrData = reinterpret_cast<Byte_t*>(block->GetData());\r
-  UInt_t ptrSize = block->GetSize();\r
-\r
-  for (UInt_t size = 0; size+sizeof(AliHLTTRDCluster) <= ptrSize; size+=sizeof(AliHLTTRDCluster) ) {\r
-    AliHLTTRDCluster *cluster = reinterpret_cast<AliHLTTRDCluster*>(&(ptrData[size]));\r
-   \r
-    AliTRDcluster *trdCluster = new AliTRDcluster;\r
-    cluster->ExportTRDCluster( trdCluster );\r
-   \r
-    contCol->Fill(cos*trdCluster->GetX() - sin*trdCluster->GetY(), \r
-                  sin*trdCluster->GetX() + cos*trdCluster->GetY(), \r
-                  trdCluster->GetZ(),\r
-                  trdCluster->GetQ() );    \r
-     \r
-    cont->SetNextPoint(cos*trdCluster->GetX() - sin*trdCluster->GetY(), \r
-                      sin*trdCluster->GetX() + cos*trdCluster->GetY(), trdCluster->GetZ());\r
-  }\r
-  \r
-  return iResult;\r
-}\r
-\r
-// -----------------------------------------------------------------\r
-Int_t processTRDHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {\r
-\r
-  Int_t iResult = 0;\r
-\r
-  if ( ! block->GetClassName().CompareTo("TH1F")) {\r
-    TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());\r
-    ++gTRDHistoCount;\r
-  \r
-    TVirtualPad* pad = canvas->cd(gTRDHistoCount);\r
-    histo->Draw();\r
-    pad->SetGridy();\r
-    pad->SetGridx();\r
-\r
-    if ( ! strcmp(histo->GetName(), "nscls") ) {\r
-      gTRDEvents = static_cast<Int_t>(histo->GetEntries());\r
-        histo->GetXaxis()->SetRangeUser(0.,15.);\r
-    }\r
-\r
-    if ( ! strcmp(histo->GetName(),"sclsdist") ||\r
-        ! strcmp(histo->GetName(),"evSize") )\r
-      pad->SetLogy();\r
-  }\r
-\r
-  gTRDCanvas->Update();\r
-\r
-  return iResult;\r
-}\r
-\r
-// -----------------------------------------------------------------\r
-Int_t processPrimVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {\r
-\r
-  Int_t iResult = 0;\r
-\r
-  if ( ! block->GetClassName().CompareTo("TH1F")) {\r
-    TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());\r
-    if( histo ){\r
-      TString name(histo->GetName());\r
-      if( !name.CompareTo("primVertexZ") ){\r
-       canvas->cd(2);\r
-       histo->Draw();\r
-      }else if( !name.CompareTo("primVertexX") ){\r
-       canvas->cd(3);\r
-       histo->Draw();\r
-      }else if( !name.CompareTo("primVertexY") ){\r
-       canvas->cd(4);\r
-       histo->Draw();\r
-      }\r
-    }\r
-  }  else if ( ! block->GetClassName().CompareTo("TH2F")) {\r
-    TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());\r
-    if (hista ){\r
-       TString name(hista->GetName());\r
-       if( !name.CompareTo("primVertexXY")) {      \r
-        canvas->cd(1);\r
-        hista->Draw();\r
-       }\r
-    }\r
-  }\r
-  canvas->cd();\r
-\r
-  return iResult;\r
-}\r
-\r
-// -----------------------------------------------------------------\r
-Int_t processSPDVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {\r
-\r
-  Int_t iResult = 0;\r
-\r
-  if ( ! block->GetClassName().CompareTo("TH1F")) {\r
-    TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());\r
-    ++gSPDVertexHistoCount;\r
-  \r
-    canvas->cd(gSPDVertexHistoCount);\r
-    histo->Draw();\r
-\r
-  }  \r
-  else if ( ! block->GetClassName().CompareTo("TH2F")) {\r
-    TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());\r
-    if (hista) {\r
-      ++gSPDVertexHistoCount;\r
-  \r
-      canvas->cd(gSPDVertexHistoCount);\r
-      hista->Draw();\r
-    }\r
-  }\r
-  canvas->cd();\r
-\r
-  return iResult;\r
-}\r
-\r
-// -----------------------------------------------------------------\r
-Int_t processV0Histograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {\r
-\r
-  cout << "Processing to see if it's V0 histogram, !!!!!!!!!"<<endl;\r
-\r
-  Int_t iResult = 0;\r
-  bool update = 0;\r
-  if ( ! block->GetClassName().CompareTo("TH1F")) {\r
-    TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());\r
-    if( histo ){\r
-      TString name(histo->GetName());\r
-      if( !name.CompareTo("hKShort") ){\r
-       canvas->cd(1);\r
-       histo->Draw();\r
-       update = 1;\r
-      }else if( !name.CompareTo("hLambda") ){\r
-       canvas->cd(3);\r
-       histo->Draw();\r
-       update = 1;\r
-      }\r
-    }\r
-  }  else if ( ! block->GetClassName().CompareTo("TH2F")) {\r
-    TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());\r
-    if (hista ){\r
-       TString name(hista->GetName());\r
-       if( !name.CompareTo("hAP")) {      \r
-        canvas->cd(2);\r
-        hista->Draw();\r
-        update = 1;\r
-       }\r
-       else if( !name.CompareTo("hGammaXY")) {      \r
-        canvas->cd(4);\r
-        hista->Draw();\r
-        update = 1;\r
-       }\r
-    }\r
-  }\r
-  if( update ){\r
-    canvas->cd();\r
-    canvas->Update();\r
-  }\r
-  return iResult;\r
-}\r
-\r
-\r
-\r
-//*****************************************************************************\r
-Int_t processTRDCalibHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {\r
-  Int_t iResult = 0;\r
-\r
-  TObjArray *HistArray=(TObjArray*)block->GetTObject();\r
-  Int_t nCalibHistos=HistArray->GetEntriesFast();\r
-  for(Int_t CalibHistoCount=0;CalibHistoCount<nCalibHistos;CalibHistoCount++){\r
-    canvas->cd(CalibHistoCount+1);\r
-    \r
-    if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2S")){\r
-        TH2S *histCalib=(TH2S*)(HistArray->At(CalibHistoCount));\r
-        histCalib->Draw("colz");\r
-       }\r
-     else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2")){\r
-      //TH2D *histCalib=dynamic_cast<TH2D*>(HistArray->At(CalibHistoCount));\r
-      TH2D *histCalib=(TH2D*)(HistArray->At(CalibHistoCount));\r
-      histCalib->Draw("lego2");\r
-    }\r
-    else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH1")){\r
-      //TH1D *histCalib=dynamic_cast<TH1D*>(HistArray->At(CalibHistoCount));\r
-      TH1D *histCalib=(TH1D*)(HistArray->At(CalibHistoCount));\r
-      histCalib->Draw();\r
-    }\r
-    else if(HistArray->At(CalibHistoCount)->InheritsFrom("AliTRDCalibraVdriftLinearFit")){\r
-      //TH2S *histCalib = ((dynamic_cast<AliTRDCalibraVdriftLinearFit*>(HistArray->At(CalibHistoCount)))->GetLinearFitterHisto(10,kTRUE));\r
-      TH2S *histCalib =(TH2S*)(((AliTRDCalibraVdriftLinearFit*)HistArray->At(CalibHistoCount))->GetLinearFitterHisto(10,kTRUE));\r
-\r
-      histCalib->Draw();\r
-    }\r
-    \r
-   \r
-  }\r
-  \r
-  gTRDCalibCanvas->Update();\r
-\r
- return iResult;\r
-}\r
-\r
 //****************************************************************************\r
 void writeToFile(){\r
 \r
@@ -872,85 +385,5 @@ void writeToFile(){
 }\r
 \r
 \r
-// -----------------------------------------------------------------\r
-void loopEvent() {\r
-  eventTimer.SetCommand("nextEvent()");\r
-  eventTimer.Start(3000);\r
-}\r
-\r
-// -----------------------------------------------------------------\r
-void stopLoopEvent() {\r
-  eventTimer.Stop();\r
-}\r
-\r
-\r
-\r
-\r
-Int_t processTRDBlock (AliHLTHOMERBlockDesc * block) {\r
-\r
-   Int_t iResult = 0;\r
-\r
-  if ( ! block->GetDataType().CompareTo("CLUSTERS") ) {\r
-     \r
-    if(!gTRDClusters){\r
-      gTRDClusters = new TEvePointSet("TRD Clusters");\r
-      gTRDClusters->SetMainColor(kBlue);\r
-      gTRDClusters->SetMarkerStyle((Style_t)kFullDotSmall);\r
-      //gEve->AddElement(gTRDClusters);\r
-    } \r
-\r
-    if(!gTRDColClusters){\r
-      gTRDColClusters = new TEvePointSetArray("TRD Clusters Colorized");\r
-      gTRDColClusters->SetMainColor(kRed);\r
-      gTRDColClusters->SetMarkerStyle(4); // antialiased circle\r
-      //         gTRDColClusters->SetMarkerStyle((Style_t)kFullDotSmall);\r
-      gTRDColClusters->SetMarkerSize(0.4);\r
-      gTRDColClusters->InitBins("Cluster Charge", gTRDBins, 0., gTRDBins*100.);\r
-\r
-      //TColor::SetPalette(1, 0); // Spectrum palette\r
-      const Int_t nCol = TColor::GetNumberOfColors();\r
-      for (Int_t ii = 0; ii < gTRDBins+1; ++ii)\r
-       gTRDColClusters->GetBin(ii)->SetMainColor(TColor::GetColorPalette(ii * nCol / (gTRDBins+2)));\r
-         \r
-      gEve->AddElement(gTRDColClusters);\r
-    } \r
-\r
-    iResult = processTRDClusters( block, gTRDClusters, gTRDColClusters );\r
-    //gTRDClusters->ElementChanged();\r
-    gTRDColClusters->ElementChanged();\r
-  }\r
-\r
-  // -- Process TRD Histograms\r
-  else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {\r
-    if(!gTRDCanvas) {\r
-      gTRDCanvas = createCanvas("TRD", "TRD");\r
-      gTRDCanvas->Divide(3,2);\r
-    }\r
-    iResult = processTRDHistograms( block, gTRDCanvas );     \r
-  }\r
-\r
-  else if(block->GetDataType().CompareTo("CALIBRAH")==0){\r
-     \r
-    if(!gTRDCalibCanvas){\r
-      gTRDCalibCanvas = createCanvas("TRD Calib", "TRD Calib");\r
-      gTRDCalibCanvas->Divide(2,2);\r
-    }\r
-     \r
-    iResult=processTRDCalibHistograms(block,gTRDCalibCanvas);\r
-  }\r
-\r
-  else if(block->GetDataType().CompareTo("CALIBEOR")==0){\r
-     \r
-    if(!gTRDEORCanvas){\r
-      gTRDEORCanvas = createCanvas("TRD QA", "TRD QA");\r
-      gTRDEORCanvas->Divide(3,2);       \r
-    }\r
-  \r
-    iResult=processTRDCalibHistograms(block,gTRDEORCanvas);\r
-  }\r
-  return iResult;\r
-}\r
-\r
-\r
 \r
         \r
diff --git a/EVE/hlt-macros/off.C b/EVE/hlt-macros/off.C
new file mode 100644 (file)
index 0000000..45673ae
--- /dev/null
@@ -0,0 +1,426 @@
+//-*- Mode: C++ -*-\r
+\r
+// ** USED macros :\r
+// ***************************************************\r
+// - hlt_alieve_init.C\r
+// - VizDB_scan.C\r
+// - geom_gentle_hlt.C\r
+// - geom_gentle_muon.C\r
+// ***************************************************\r
+\r
+#if !defined(__CINT__) || defined(__MAKECINT__)\r
+\r
+//****************** ROOT ******************************************\r
+#include "TRandom.h"\r
+#include "TVirtualPad.h"\r
+#include "TGLViewer.h"\r
+#include "TThread.h"\r
+#include "TGFileBrowser.h"\r
+#include "TStyle.h"\r
+#include "TList.h"\r
+#include "TDirectory.h"\r
+#include "TFile.h"\r
+#include "TH2.h"\r
+#include "TCanvas.h"\r
+#include "TColor.h"\r
+#include "TVector3.h"\r
+\r
+//****************** ROOT/EVE **************************************\r
+#include "TEveManager.h"\r
+\r
+#include "AliEveHOMERManager.h"\r
+#include "AliEveHLTEventManagerOffline.h"\r
+#include "geom_gentle_hlt.C"\r
+\r
+//***************************************************************\r
+#include "HLT/rec/AliHLTReconstructor.h"\r
+\r
+\r
+\r
+#endif\r
+\r
+\r
+\r
+// -----------------------------------------------------------------\r
+// --                       Geometry / Scenes                     --\r
+// -----------------------------------------------------------------\r
+\r
+TEveGeoShape *gGeomGentle     = 0;\r
+TEveGeoShape *gGeomGentleRPhi = 0;\r
+TEveGeoShape *gGeomGentleRhoZ = 0;\r
+TEveGeoShape *gGeomGentleTRD  = 0;\r
+TEveGeoShape *gGeomGentleMUON = 0;\r
+\r
+TEveScene *gRPhiGeomScene  = 0;\r
+TEveScene *gRhoZGeomScene  = 0;\r
+TEveScene *gRPhiEventScene = 0;\r
+TEveScene *gRhoZEventScene = 0;\r
+\r
+TEveProjectionManager *gRPhiMgr = 0;\r
+TEveProjectionManager *gRhoZMgr = 0;\r
+\r
+TEveViewer *g3DView   = 0;\r
+TEveViewer *gRPhiView = 0;\r
+TEveViewer *gRhoZView = 0;\r
+\r
+// -----------------------------------------------------------------\r
+// --                Geometry / Scenes Parameters                 --\r
+// -----------------------------------------------------------------\r
+\r
+// -- Parameters to show different geometries\r
+Bool_t gShowMUON     = kTRUE;\r
+Bool_t gShowMUONRPhi = kFALSE;\r
+Bool_t gShowMUONRhoZ = kTRUE;\r
+Bool_t gShowTRD      = kFALSE;\r
+\r
+\r
+// -----------------------------------------------------------------\r
+// --                         Members                            --\r
+// -----------------------------------------------------------------\r
+\r
+// -- Timer for automatic event loop\r
+TTimer                                    eventTimer;\r
+TTimer                                    eventTimerFast;\r
+\r
+// -- HOMERManager\r
+AliEveHLTEventManagerOffline*                       geventManager      = 0;\r
+\r
+// -- Geometry Manager \r
+TGeoManager*                              gGeoManager        = 0;\r
+AliPHOSGeometry*                          gPHOSGeom          = 0;\r
+\r
+// -- Cluster members\r
+TEvePointSet*                             gSPDClusters       = 0;\r
+TEvePointSet*                             gSSDClusters       = 0;\r
+TEvePointSet*                             gSDDClusters       = 0;\r
+TEvePointSet*                             gTRDClusters       = 0;\r
+TEvePointSetArray*                        gTRDColClusters    = 0;\r
+TEvePointSet*                             gTPCClusters       = 0;\r
+TEvePointSet*                             gTPCTestClusters       = 0;\r
+TEvePointSetArray*                        gTPCColClusters    = 0;\r
+TEveBoxSet*                               gPHOSBoxSet[5]     = {0, 0, 0, 0, 0}; \r
+TEveBoxSet*                               gEMCALBoxSet[13]   = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\r
+TEvePointSet*                             gMUONClusters      = 0;\r
+TEveStraightLineSet*                      gMUONTracks        = 0;\r
+\r
+// -- Text output members\r
+TEveText*                                 gHLTText           = 0;\r
+\r
+// -- Tracks members\r
+TEveTrackList*                            gTPCTrack          = 0;\r
+\r
+// -- Canvas for histograms\r
+TCanvas*                                  gTRDCanvas         = 0;\r
+TCanvas*                                  gTPCCanvas         = 0;\r
+TCanvas*                                  gTPCClustCanvas          = 0;\r
+TCanvas*                                  gTRDCalibCanvas    = 0;\r
+TCanvas*                                  gTRDEORCanvas      = 0;\r
+TCanvas*                                  gPrimVertexCanvas  = 0;\r
+TCanvas*                                  gSPDVertexCanvas   = 0;\r
+TCanvas*                                  gITSCanvas         = 0;\r
+TCanvas*                                  gSSDCanvas0        = 0;\r
+TCanvas*                                  gSSDCanvas1        = 0;\r
+TCanvas*                                  gV0Canvas          = 0;\r
+TCanvas*                                  gPHOSCanvas          = NULL;\r
+TCanvas*                                  gEMCALCanvas          = 0;\r
+\r
+// -- vertex --\r
+Int_t                                     gSPDVertexHistoCount  = 0;\r
+\r
+\r
+\r
+// -- TRD --\r
+Int_t                                     gTRDHistoCount     = 0;\r
+Int_t                                     gTRDEvents         = 0;\r
+Int_t                                     gTRDBins           = 12;\r
+\r
+// -- TPC --\r
+Int_t                                     gTPCBins           = 15;\r
+TH1F*                                     gTPCCharge         = 0;\r
+TH1F*                                     gTPCQMax           = 0;\r
+TH1F*                                     gTPCQMaxOverCharge = 0;\r
+\r
+TH1F*                                     gTPCPt        = 0; // KK\r
+TH1F*                                     gTPCEta       = 0; \r
+TH1F*                                     gTPCPsi       = 0; \r
+TH1F*                                     gTPCnClusters = 0; \r
+TH1F*                                     gTPCMult      = 0;\r
+\r
+// -- PHOS --\r
+TEveElementList*                          gPHOSElementList   = 0;\r
+Int_t                                     gPHOSHistoCount    =0;\r
+// -- EMCAL\r
+TEveElementList*                          gEMCALElementList  = 0;\r
+TGeoNode*                                 gEMCALNode         = 0;\r
+Int_t                                     gEMCALHistoCount    =0;\r
+\r
+// --- Flag if eventloop is running\r
+Bool_t                                    gEventLoopStarted = kFALSE;\r
+\r
+\r
+\r
+//Container for gGeoManager till it is broken\r
+TGeoManager *fGeoManager = 0;\r
+// -----------------------------------------------------------------\r
+// --                          Methods                            --\r
+// -----------------------------------------------------------------\r
+\r
+Int_t initializeEveViewer( Bool_t showBarrel, Bool_t showMuon );\r
+\r
+void writeToFile();\r
+\r
+\r
+// #################################################################\r
+// #################################################################\r
+// #################################################################\r
+\r
+// -----------------------------------------------------------------\r
+void off ( Bool_t showBarrel = kTRUE, Bool_t showMuon = kFALSE ) {\r
+\r
+  // -- Loading Geometry\r
+  // ---------------------\r
+  Int_t run = 67179;\r
+  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");\r
+  AliCDBManager::Instance()->SetRun(run);\r
+  AliGeomManager::LoadGeometry();\r
+  // The default in the simulation is the following line\r
+  // TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1, AliMagF::k5kG));\r
+  // However for the current setting of +ve L3 and +ve Dipole magnetic field\r
+  // the following setting creates the field close to real field with currect polarity\r
+  if(showMuon)\r
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1, AliMagF::k5kG));\r
+\r
+  // Get the pointer to gGeoManager before it's broken (bug in alieve)\r
+  fGeoManager = gGeoManager;\r
+\r
+    // -- Initialize pointsets and add macros\r
+  // ----------------------------------------\r
+  //TEveUtil::LoadMacro("hlt_alieve_init.C");\r
+  //hlt_alieve_init(".", -1);\r
+\r
+  // -- Initialize Eve\r
+  // -------------------\r
+  initializeEveViewer( showBarrel, showMuon );\r
+\r
+  // -- Reset gGeoManager to the original pointer\r
+  // ----------------------------------------------\r
+\r
+  // -- Finalize Eve\r
+  // -----------------\r
+  gSystem->ProcessEvents();\r
+  gEve->Redraw3D(kTRUE);\r
+\r
+  // -- Create new hM object\r
+  // -------------------------\r
\r
+  gEventManager = new AliEveHLTEventManagerOffline("/home/slindal/alice/data/PbPb/AliESDs.root");\r
+  //gEventManager = new AliEveHLTEventManagerOffline("/home/slindal/alice/QAtasks/AliESDs.root");\r
+  gEventManager->SetEveManager(gEve);\r
+  gEventManager->SetGeoManager(gGeoManager);\r
+  gEventManager->SetRPhiManager(gRPhiMgr);\r
+  gEventManager->SetRPhiEventScene(gRPhiEventScene);\r
+  gEventManager->SetRPhiViewer(gRPhiView);\r
+  gEventManager->SetRhoZManager(gRhoZMgr);\r
+  gEventManager->SetRhoZEventScene(gRhoZEventScene);\r
+  gEventManager->SetRhoZViewer(gRhoZView);\r
+  //gEventManager->SetBarrelFlag(showBarrel);\r
+  //gEventManager->SetMuonFlag(showMuon);\r
+\r
+\r
+  // -- Add hM to EveTree\r
+  // ----------------------\r
+  gEve->AddToListTree(gEventManager, kTRUE);\r
+\r
+  // -- Create SourceList\r
+  // ----------------------\r
+\r
+\r
+\r
+  gGeoManager = fGeoManager;\r
+  \r
+\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+Int_t initializeEveViewer( Bool_t showBarrel, Bool_t showMuon ) {\r
+  \r
+  //=============================================================================\r
+  // Visualization database\r
+  //============================================================================\r
+\r
+  TEveUtil::AssertMacro("VizDB_scan.C");\r
+  \r
+  //  alieve_vizdb();\r
+  \r
+\r
+\r
+  //==============================================================================\r
+  // -- Geometry, scenes, projections and viewers\r
+  //==============================================================================\r
+\r
+  TEveBrowser         *browser = gEve->GetBrowser();\r
+  browser->ShowCloseTab(kFALSE);\r
+  \r
+  // -- Disable extra geometry\r
+  // ---------------------------\r
+  if (!showMuon)\r
+    gShowMUON = gShowMUONRPhi = gShowMUONRhoZ = kFALSE;\r
+  \r
+  // -- Load Geometry\r
+  // ------------------\r
+  TEveUtil::LoadMacro("geom_gentle_hlt.C");\r
+  gGeomGentle = geom_gentle_hlt();\r
+  gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy();\r
+  gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy();\r
+  gGeomGentleTRD  = geom_gentle_trd();\r
+\r
+  gGeoManager = fGeoManager;\r
+\r
+  gEMCALNode = gGeoManager->GetTopVolume()->FindNode("XEN1_1");\r
+\r
+  TEveGeoTopNode* emcal_re = new TEveGeoTopNode(gGeoManager, gEMCALNode);\r
+  gEve->AddGlobalElement(emcal_re);\r
+  gEve->Redraw3D();\r
+\r
+  if (gShowMUON) \r
+    gGeomGentleMUON = geom_gentle_muon(kFALSE);\r
+  \r
+  // -- Scenes\r
+  // -----------\r
+  gRPhiGeomScene  = gEve->SpawnNewScene("RPhi Geometry",\r
+                    "Scene holding projected geometry for the RPhi view.");\r
+  gRhoZGeomScene  = gEve->SpawnNewScene("RhoZ Geometry",\r
+                   "Scene holding projected geometry for the RhoZ view.");\r
+  gRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",\r
+                   "Scene holding projected geometry for the RPhi view.");\r
+  gRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",\r
+                   "Scene holding projected geometry for the RhoZ view.");\r
+\r
+  // -- Projection managers\r
+  // ------------------------\r
+\r
+  gRPhiMgr = new TEveProjectionManager();\r
+  gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);\r
+  gEve->AddToListTree(gRPhiMgr, kFALSE);\r
+  {\r
+    TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);\r
+    a->SetMainColor(kWhite);\r
+    a->SetTitle("R-Phi");\r
+    a->SetTitleSize(0.05);\r
+    a->SetTitleFont(102);\r
+    a->SetLabelSize(0.025);\r
+    a->SetLabelFont(102);\r
+    gRPhiGeomScene->AddElement(a);\r
+  }\r
+  gRPhiMgr->SetCurrentDepth(-10);\r
+  gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene);\r
+  gRPhiMgr->SetCurrentDepth(0);\r
+  gRPhiMgr->ImportElements(gGeomGentleTRD, gRPhiGeomScene);\r
+  if (gShowMUONRPhi) gRPhiMgr->ImportElements(gGeomGentleMUON, gRPhiGeomScene);\r
+\r
+  gRhoZMgr = new TEveProjectionManager();\r
+  gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);\r
+  gEve->AddToListTree(gRhoZMgr, kFALSE);\r
+  {\r
+    TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);\r
+    a->SetMainColor(kWhite);\r
+    a->SetTitle("Rho-Z");\r
+    a->SetTitleSize(0.05);\r
+    a->SetTitleFont(102);\r
+    a->SetLabelSize(0.025);\r
+    a->SetLabelFont(102);\r
+    gRhoZGeomScene->AddElement(a);\r
+  }\r
+  gRhoZMgr->SetCurrentDepth(-10);\r
+  gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene);\r
+  gRhoZMgr->SetCurrentDepth(0);\r
+  gRhoZMgr->ImportElements(gGeomGentleTRD, gRhoZGeomScene);\r
+  \r
+  if (gShowMUONRhoZ) gRhoZMgr->ImportElements(gGeomGentleMUON, gRhoZGeomScene);\r
+\r
+  // -- Viewers\r
+  // ------------\r
+\r
+  TEveWindowSlot *slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());\r
+  TEveWindowPack *pack = slot->MakePack();\r
+  pack->SetElementName("Multi View");\r
+  pack->SetHorizontal();\r
+  pack->SetShowTitleBar(kFALSE);\r
+  pack->NewSlot()->MakeCurrent();\r
+  g3DView = gEve->SpawnNewViewer("3D View", "");\r
+  g3DView->AddScene(gEve->GetGlobalScene());\r
+  g3DView->AddScene(gEve->GetEventScene());\r
+\r
+\r
+  pack = pack->NewSlot()->MakePack();\r
+  pack->SetShowTitleBar(kFALSE);\r
+  pack->NewSlot()->MakeCurrent();\r
+  gRPhiView = gEve->SpawnNewViewer("RPhi View", "");\r
+  gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);\r
+  gRPhiView->AddScene(gRPhiGeomScene);\r
+  gRPhiView->AddScene(gRPhiEventScene);\r
+\r
+  pack->NewSlot()->MakeCurrent();\r
+  gRhoZView = gEve->SpawnNewViewer("RhoZ View", "");\r
+  gRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);\r
+  gRhoZView->AddScene(gRhoZGeomScene);\r
+  gRhoZView->AddScene(gRhoZEventScene);\r
+\r
+\r
+   \r
+  //Add HLT Text to windows\r
\r
+  TGLOverlayButton *ob1 = new TGLOverlayButton(g3DView->GetGLViewer(),  "HLT", 0, 20, 110, 60);\r
+  ob1->SetAlphaValues(0.8, 0.8);\r
+  //  cout << "color" << ob1->GetBackColor() << endl;\r
+  //ob1->SetBackColor(8421631);\r
+  //ob1->SetBackColor(10492431);\r
+  TGLOverlayButton *ob2 = new TGLOverlayButton(g3DView->GetGLViewer(),  "ALICE", 0, 0, 110, 20);\r
+  ob2->SetAlphaValues(0.8, 0.8);\r
+  //ob2->SetBackColor(0.2);\r
+  TGLOverlayButton *ob3 = new TGLOverlayButton(gEve->GetDefaultGLViewer(),  "HLT", 0, 20, 110, 60);\r
+  ob3->SetAlphaValues(0.8, 0.8);\r
+  TGLOverlayButton *ob4 = new TGLOverlayButton(gEve->GetDefaultGLViewer(),  "ALICE", 0, 0, 110, 20);\r
+  ob4->SetAlphaValues(0.8, 0.8);\r
+\r
+\r
+  TGLOverlayButton *ne = new TGLOverlayButton(gEve->GetDefaultGLViewer(),  "Next Event", 110, 0, 210, 20);\r
+  ne->SetAlphaValues(0.0, 0.8);\r
+\r
+  // -- List of Viewers\r
+  // --------------------\r
+\r
+  TEveViewerList *viewerlist = new TEveViewerList();\r
+  viewerlist->AddElement(gEve->GetDefaultViewer());\r
+  \r
+  viewerlist->AddElement(g3DView);\r
+  viewerlist->AddElement(gRhoZView);\r
+  viewerlist->AddElement(gRPhiView);\r
+  viewerlist->SwitchColorSet();\r
+\r
+  //==============================================================================\r
+  // -- Macros / QA histograms\r
+  //==============================================================================\r
+\r
+  // -- Registration of per-event macros\r
+  // -------------------------------------\r
+\r
+  AliEveMacroExecutor *exec    = new AliEveMacroExecutor();\r
+\r
+\r
+\r
+  gStyle->SetPalette(1, 0);\r
+\r
+  gStyle->SetOptFit(1);\r
+\r
+\r
+  \r
+  return 0;\r
+}\r
+\r
+\r
+\r
+\r
+\r
+\r
+        \r