New class structure
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 May 2007 02:04:10 +0000 (02:04 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 May 2007 02:04:10 +0000 (02:04 +0000)
12 files changed:
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplay.cxx
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplay.h
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayCalibTab.cxx [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayCalibTab.h [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayEventTab.cxx [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayEventTab.h [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayRawTab.cxx [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayRawTab.h [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayTab.cxx [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayTab.h [new file with mode: 0644]
HLT/PHOS/OnlineDisplay/Makefile
HLT/PHOS/OnlineDisplay/main.cxx

index e4d79ea..b746278 100644 (file)
@@ -1,18 +1,3 @@
-#include  "AliHLTPHOSOnlineDisplay.h"
-#include  "AliHLTDataTypes.h"
-#include  "AliHLTPHOSRcuCellEnergyDataStruct.h"
-#include  <vector>
-#include  "stdio.h"
-#include <string>
-#include <sys/ipc.h>
-#include <errno.h>
-#include "TH2.h"
-#include "TCanvas.h"
-#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
-#include "AliHLTPHOSCommonDefs.h"
-
-//#include "TGMatrixLayout.h"
-
 /**************************************************************************
  * This file is property of and copyright by the Experimental Nuclear     *
  * Physics Group, Dep. of Physics                                         *
 # include <TApplication.h>
 # include "TStyle.h" 
 #endif
-#include <iostream>
 
+#include  "AliHLTPHOSOnlineDisplay.h"
+#include  "AliHLTDataTypes.h"
+#include  "AliHLTPHOSRcuCellEnergyDataStruct.h"
+#include  <vector>
+#include  "stdio.h"
+#include <string>
+#include <sys/ipc.h>
+#include <errno.h>
+#include "TH2.h"
+#include "TCanvas.h"
+#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
+#include "AliHLTPHOSCommonDefs.h"
+#include <iostream>
+#include "AliHLTPHOSOnlineDisplayEventTab.h"
+#include "AliHLTPHOSOnlineDisplayCalibTab.h"
+
+AliHLTPHOSOnlineDisplayEventTab*  AliHLTPHOSOnlineDisplay::fgEventTabPtr       = 0;
+AliHLTPHOSOnlineDisplayCalibTab*  AliHLTPHOSOnlineDisplay::fgCalibTabPtr       = 0;
+AliHLTPHOSOnlineDisplayRawTab*    AliHLTPHOSOnlineDisplay::fgRawTabPtr         = 0;
+AliHLTPHOSOnlineDisplay*          AliHLTPHOSOnlineDisplay::fgInstancePtr       = 0;          /**<The one an only instance of PhosOnlineDisplay*/
+HOMERReader*                      AliHLTPHOSOnlineDisplay::fgHomerReaderPtr    = 0;          /**<Homer reader that fetches events from the HLT online stream*/
+HOMERReader*                      AliHLTPHOSOnlineDisplay::fgHomerReadersPtr[MAX_HOSTS];     /**<Homer reader that fetches events from the HLT online stream*/
+Bool_t                            AliHLTPHOSOnlineDisplay::fgAccumulate        = kFALSE ;    /**<If set to kFALSE reset fgLegoplot between event, kTRUE adds current energies to previous plot*/
+Bool_t                            AliHLTPHOSOnlineDisplay::fgSyncronize        = kFALSE ;
+unsigned int                      AliHLTPHOSOnlineDisplay::fgNHosts            = 0;
+unsigned int                      AliHLTPHOSOnlineDisplay::fgNPorts            = 0;
+char*                             AliHLTPHOSOnlineDisplay::fgHosts[MAX_HOSTS];
+short unsigned int*               AliHLTPHOSOnlineDisplay::fgPorts             = 0; 
+TGTab*                            AliHLTPHOSOnlineDisplay::fTab                = 0;
 
-#define MAX_BIN_VALUE 1023
-
-
-AliHLTPHOSGetEventButton*  AliHLTPHOSOnlineDisplay::fgEventButtPtr     = 0;           /**<Button to get a new event from the HLT online stream*/
-AliHLTPHOSOnlineDisplay*   AliHLTPHOSOnlineDisplay::fgInstancePtr      = 0;           /**<The one an only instance of PhosOnlineDisplay*/
-HOMERReader*               AliHLTPHOSOnlineDisplay::fgHomerReaderPtr   = 0;           /**<Homer reader that fetches events from the HLT online stream*/
-HOMERReader*               AliHLTPHOSOnlineDisplay::fgHomerReadersPtr[MAX_HOSTS];     /**<Homer reader that fetches events from the HLT online stream*/
-HOMERReader*               AliHLTPHOSOnlineDisplay::fgCalibReadersPtr[MAX_HOSTS];     /**<Homer reader that fetches histograms from the HLT online stream*/
-HOMERReader*               AliHLTPHOSOnlineDisplay::fgChannelRawReadersPtr[MAX_HOSTS];
-TH2D*                      AliHLTPHOSOnlineDisplay::fgLegoPlotLGPtr      = 0;         /**<2D histogram for low gain channels*/
-TH2D*                      AliHLTPHOSOnlineDisplay::fgLegoPlotHGPtr      = 0;         /**<2D histogram for high gain channels*/
-TH2D*                      AliHLTPHOSOnlineDisplay::fgCalibHistPtr[N_GAINS];          /**<2D histogram for low gain channels*/
-TH2I*                      AliHLTPHOSOnlineDisplay::fgHitsHistPtr[N_GAINS];           /**<2D histogram for low gain channels*/
-TH2D*                      AliHLTPHOSOnlineDisplay::fgAveragePtr[N_GAINS];            /**<Accumuated energy/hits*/
-char*                      AliHLTPHOSOnlineDisplay::fgDefaultDet       = "SOHP";      /**<PHOS written backwards*/
-char*                      AliHLTPHOSOnlineDisplay::fgDefaultDataType  = "RENELLEC";  /**<CELLENER (Celle energy) written backwards*/  
-int                        AliHLTPHOSOnlineDisplay::fgEvntCnt          = 0;           /**<Event Counter*/
-TCanvas*                   AliHLTPHOSOnlineDisplay::fgCanvasHGPtr      = 0;           /**<Canvas to plot fgLegoplot for High gain channels*/ 
-TCanvas*                   AliHLTPHOSOnlineDisplay::fgCanvasLGPtr      = 0;           /**<Canvas to plot fgLegoplot for Low gain channels*/ 
-TCanvas*                   AliHLTPHOSOnlineDisplay::fgTestCanvasPtr    = 0;
-Bool_t                     AliHLTPHOSOnlineDisplay::fgAccumulate       = kFALSE ;     /**<If set to kFALSE reset fgLegoplot between event, kTRUE adds current energies to previous plot*/
-Bool_t                     AliHLTPHOSOnlineDisplay::fgSyncronize       = kFALSE ;
-unsigned int               AliHLTPHOSOnlineDisplay::fgNHosts           = 0;
-unsigned int               AliHLTPHOSOnlineDisplay::fgNPorts           = 0;
-char*                      AliHLTPHOSOnlineDisplay::fgHosts[MAX_HOSTS];
-short unsigned int*        AliHLTPHOSOnlineDisplay::fgPorts            =0; 
-
-
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fFrame1            = 0; 
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fF1                = 0;         
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fF2                = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fF3                = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fF4                = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fF5                = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF1             = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF2             = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF3             = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF4             = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF5             = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF6             = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF7             = 0;
-TGCompositeFrame*          AliHLTPHOSOnlineDisplay::fSubF8             = 0;
-
-TGTab*                     AliHLTPHOSOnlineDisplay::fTab               = 0;
-TGTab*                     AliHLTPHOSOnlineDisplay::fSubTab1           = 0;
-TGTab*                     AliHLTPHOSOnlineDisplay::fSubTab2           = 0;
-TGTab*                     AliHLTPHOSOnlineDisplay::fSubTab3           = 0;
-
-TGTab*                     AliHLTPHOSOnlineDisplay::fSubTabModule[N_MODULES];
-TGTab*                     AliHLTPHOSOnlineDisplay::fSubSubTabRcu[N_MODULES][N_RCUS_PER_MODULE]; 
-
-TH1D*                      AliHLTPHOSOnlineDisplay::fgChannelDataPlotPtr[N_ZROWS_RCU][N_XCOLUMNS_RCU];
-
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fTest              = 0;
 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc1               = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc2               = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc3               = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc4               = 0;
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc5               = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc6               = 0;
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc7               = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc8               = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc9               = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc10              = 0;
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc11              = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc12              = 0;
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc13              = 0; 
-TRootEmbeddedCanvas*       AliHLTPHOSOnlineDisplay::fEc14              = 0;
 using namespace std;
 
 
 AliHLTPHOSOnlineDisplay*
-AliHLTPHOSOnlineDisplay::Instance() 
+AliHLTPHOSOnlineDisplay::Instance(int argc, char** argv) 
 {
-  if (!fgInstancePtr) fgInstancePtr = new AliHLTPHOSOnlineDisplay();
+  if (!fgInstancePtr) fgInstancePtr = new AliHLTPHOSOnlineDisplay(argc, argv);
   return fgInstancePtr;
 }
 
+
 AliHLTPHOSOnlineDisplay::AliHLTPHOSOnlineDisplay()
 {
+  cout << "ERROR ! level: FATAL, you cannot invoke the onlinedisplay without arguments" << endl;
+}
+
+
+AliHLTPHOSOnlineDisplay::AliHLTPHOSOnlineDisplay(int argc, char** argv)
+{
+  ScanArguments(argc, argv);
   char **tmp;
   cout << "creating new PHOS Onlinedisplay" << endl;
-  fgLegoPlotLGPtr  = 0;
-  fgLegoPlotHGPtr  = 0;
-
   fgHomerReaderPtr = new  HOMERReader(fgNHosts, (const char**)fgHosts,  fgPorts);
+  cout << "AliHLTPHOSOnlineDisplay::AliHLTPHOSOnlineDisplay: fgHomerReaderPtr =  " <<  fgHomerReaderPtr << endl;
 
   for(int i = 0; i <fgNHosts; i++)
     {
       fgHomerReadersPtr[i] =      new  HOMERReader(fgHosts[i], fgPorts[i]); 
-      fgCalibReadersPtr[i] =      new  HOMERReader(fgHosts[i], fgPorts[i]);
-      fgChannelRawReadersPtr[i] = new  HOMERReader(fgHosts[i], fgPorts[i]);
     }
  InitDisplay();
-
 }
 
 
@@ -145,155 +92,22 @@ AliHLTPHOSOnlineDisplay::~AliHLTPHOSOnlineDisplay()
 
 }
 
+
 void
 AliHLTPHOSOnlineDisplay::InitDisplay()
 {
   char tmpHistoName[256];
-
-  fgLegoPlotHGPtr = new TH2D("Homer","HLT: #pi^{0} 5 - 30Gev HG, High gain",  
-                            N_XCOLUMNS_MOD*N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES,  
-                             N_ZROWS_MOD,               0, N_ZROWS_MOD);
-  fgLegoPlotHGPtr->SetMaximum( MAX_BIN_VALUE);
-  fgLegoPlotHGPtr->Reset();
-
-  fgLegoPlotLGPtr = new TH2D("Homer","HLT: #pi^{0} 5 - 30Gev LG, Low gain",  
-                            N_XCOLUMNS_MOD* N_MODULES , 0, N_XCOLUMNS_MOD* N_MODULES,  
-                            N_ZROWS_MOD,          0, N_ZROWS_MOD);
-  fgLegoPlotLGPtr->SetMaximum( MAX_BIN_VALUE); 
-  fgLegoPlotLGPtr->Reset();
-
-  for(int gain = 0; gain< N_GAINS; gain ++)
-    {
-      sprintf(tmpHistoName, "HLT gain %d", gain);
-      fgCalibHistPtr[gain] = new TH2D(tmpHistoName, tmpHistoName,  
-                                     N_XCOLUMNS_MOD*N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES , 
-                                     N_ZROWS_MOD,         0, N_ZROWS_MOD);
-      fgCalibHistPtr[gain]->Reset(); 
-     
-      sprintf(tmpHistoName, "Calibration Data HLT: #pi^{0} 5 - 30GeV gain %d", gain);
-      fgHitsHistPtr[gain] = new TH2I(tmpHistoName, tmpHistoName,  
-                                   N_XCOLUMNS_MOD* N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES,  
-                                   N_ZROWS_MOD,          0, N_ZROWS_MOD);
-      fgHitsHistPtr[gain]->SetMaximum( MAX_BIN_VALUE); 
-      fgHitsHistPtr[gain]->Reset();
-
-      sprintf(tmpHistoName, "Average Data HLT: #pi^{0} 5 - 30GeV gain %d", gain);
-      fgAveragePtr[gain] = new TH2D(tmpHistoName,tmpHistoName,  
-                                   N_XCOLUMNS_MOD* N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES,  
-                                   N_ZROWS_MOD,          0, N_ZROWS_MOD);
-      fgAveragePtr[gain]->SetMaximum( MAX_BIN_VALUE); 
-      fgAveragePtr[gain]->Reset();
-    }
-
   char tmpChDtaName[256];
 
-  for(int z = 0; z < N_ZROWS_RCU; z ++)
-    {
-      for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
-       {
-         sprintf(tmpHistoName, "blablaz%d x%d",z, x);
-         fgChannelDataPlotPtr[z][x] = new TH1D(tmpHistoName, tmpHistoName, 300, 0, 299);
-         fgChannelDataPlotPtr[z][x]->SetMaximum(MAX_BIN_VALUE); 
-         fgChannelDataPlotPtr[z][x]->Reset();
-       }
-    }
-
   gStyle->SetPalette(1);
   fTab = new TGTab(this, 100, 100);
   TGLayoutHints *fL1 = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
                                         kLHintsExpandY, 2, 2, 15, 1);
-
-  TGCompositeFrame *tf = fTab->AddTab("Event display");
-           fSubTab1 = new TGTab(tf, 100, 100);
-           TGCompositeFrame *tf2 = fSubTab1->AddTab("LEGO");  
-          fSubF1 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
-          fEc1 = new TRootEmbeddedCanvas("ec1", fSubF1, 100, 100);
-          fSubF1->AddFrame(fEc1, fL1);
-          fEc2 = new TRootEmbeddedCanvas("ec2", fSubF1, 100, 100);
-          fSubF1->AddFrame(fEc2, fL1);
-          tf2->AddFrame(fSubF1, fL1);
-
-          tf2 = fSubTab1->AddTab("SCAT"); 
-          fSubF2 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
-          tf2->AddFrame(fSubF2, fL1);
-          fEc3 = new TRootEmbeddedCanvas("ec3", fSubF2, 100, 100);
-          fSubF2->AddFrame(fEc3, fL1);
-          fEc4 = new TRootEmbeddedCanvas("ec4", fSubF2, 100, 100);
-          fSubF2->AddFrame(fEc4, fL1);
-
-          tf2 = fSubTab1->AddTab("SURF"); 
-          fSubF3 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
-          tf2->AddFrame(fSubF3, fL1);
-          fEc5 = new TRootEmbeddedCanvas("ec5", fSubF3, 100, 100);
-          fSubF3->AddFrame(fEc5, fL1);
-          fEc6 = new TRootEmbeddedCanvas("ec6", fSubF3, 100, 100);
-          fSubF3->AddFrame(fEc6, fL1);
-          fSubTab1->Resize();
-          tf->AddFrame(fSubTab1, fL1);
-
-  tf = fTab->AddTab("Calibration data");
-     
-           fSubTab2 = new TGTab(tf, 100, 100);
-
-          tf2 = fSubTab2->AddTab("Accumulated energy");   
-          fSubF4 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
-
-          fEc7 = new TRootEmbeddedCanvas("ec7", fSubF4, 100, 100);
-          fSubF4->AddFrame(fEc7, fL1);
-
-          fEc8 = new TRootEmbeddedCanvas("ec8", fSubF4, 100, 100);
-          fSubF4->AddFrame(fEc8, fL1);
-
-          tf2->AddFrame(fSubF4, fL1);
-          
-          tf2 = fSubTab2->AddTab("SCAT (hits)"); 
-          fSubF5 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
-          tf2->AddFrame(fSubF5, fL1);
-          fEc9 = new TRootEmbeddedCanvas("ec9", fSubF5, 100, 100);
-          fSubF5->AddFrame(fEc9, fL1);
-          fEc10 = new TRootEmbeddedCanvas("ec10", fSubF5, 100, 100);
-          fSubF5->AddFrame(fEc10, fL1);
-
-          tf2 = fSubTab2->AddTab("SURF"); 
-          fSubF6 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
-          tf2->AddFrame(fSubF6, fL1);
-          fEc11 = new TRootEmbeddedCanvas("ec11", fSubF6, 100, 100);
-          fSubF6->AddFrame(fEc11, fL1);
-          fEc12 = new TRootEmbeddedCanvas("ec12", fSubF6, 100, 100);
-          fSubF6->AddFrame(fEc12, fL1);
-
-          tf2 = fSubTab2->AddTab("acummulated energy / hits"); 
-          fSubF7 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
-          tf2->AddFrame(fSubF7, fL1);
-          fEc13 = new TRootEmbeddedCanvas("ec13", fSubF7, 100, 100);
-          fSubF7->AddFrame(fEc13, fL1);
-          fEc14 = new TRootEmbeddedCanvas("ec14", fSubF7, 100, 100);
-          fSubF7->AddFrame(fEc14, fL1);
-
-          fSubTab2->Resize();
-          tf->AddFrame(fSubTab2, fL1);
-
-
-  tf = fTab->AddTab("Raw Data Display");
-
-           fSubTab3 = new TGTab(tf, 100, 100);
-          TGLayoutHints *hints = new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0); 
-
-          char tmpTabName[256];
-          char tmpCanvasName[256];
-                  sprintf(tmpTabName, "Raw data");
-                  tf2 = fSubTab3->AddTab(tmpTabName);
-                  fgEventButtPtr = new  AliHLTPHOSGetEventButton(tf, "Get Rawdata2xxxxx", 'r');
-                  AliHLTPHOSGetEventButton*       EventButtPtr2 = new  AliHLTPHOSGetEventButton(tf, "Get Rawdata", 'r'); 
-                  EventButtPtr2->Move(200, 200); 
-
-  tf = fTab->AddTab("Tab 4");
+  fgEventTabPtr = new  AliHLTPHOSOnlineDisplayEventTab(fTab, fgHomerReaderPtr, fgHomerReadersPtr, fgNHosts);
+  fgCalibTabPtr = new  AliHLTPHOSOnlineDisplayCalibTab(fTab, fgHomerReaderPtr, fgHomerReadersPtr, fgNHosts);
+  fgRawTabPtr   = new  AliHLTPHOSOnlineDisplayRawTab(fTab, fgHomerReaderPtr, fgHomerReadersPtr, fgNHosts);
 
   AddFrame(fTab, fL1);
-
-  fgEventButtPtr = new  AliHLTPHOSGetEventButton(fSubF1, "get event", 'e');
-  fgEventButtPtr = new  AliHLTPHOSGetEventButton(fSubF4, "update histograms", 'h');
-
   MapSubwindows();
   Resize();
   SetWindowName("online display");
@@ -303,6 +117,27 @@ AliHLTPHOSOnlineDisplay::InitDisplay()
 
 
 int
+AliHLTPHOSOnlineDisplay::GetNextEvent()
+{
+  fgEventTabPtr->GetNextEvent();
+}
+
+
+int 
+AliHLTPHOSOnlineDisplay::GetNextEventRaw()
+{
+  fgRawTabPtr->GetNextEvent();
+}
+
+
+int
+AliHLTPHOSOnlineDisplay::GetHistogram()
+{
+  fgCalibTabPtr->GetNextEvent(); 
+}
+
+
+int
 AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
 {
   for(int i=0; i< MAX_HOSTS; i++)
@@ -311,7 +146,6 @@ AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
     }
 
   fgPorts = new short unsigned[100];
-
   Bool_t hostIsSet = kFALSE;
   Bool_t portIsSet = kFALSE;
   int iResult=0;
@@ -331,7 +165,6 @@ AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
          cout << "setting Synchronize to true" << endl;
          fgSyncronize = kTRUE;
        }  
-
       
       if (argument.CompareTo("-acc")==0)
        {
@@ -339,7 +172,6 @@ AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
          fgAccumulate = kTRUE;
        }  
       
       if (argument.CompareTo("-host")==0) 
        {
          if(i+1 <= argc)
@@ -347,6 +179,7 @@ AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
              i++;
              sprintf(fgHosts[fgNHosts],"%s", argv[i]);
              fgNHosts ++; 
+             cout <<"fgNHosts set to"<< fgNHosts <<endl;
              hostIsSet = kTRUE; 
              if(i+1 <= argc)
                {
@@ -363,7 +196,6 @@ AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
                        portIsSet = kTRUE;
                      }
                  }
-                 
                  else
                    {
                      fgPorts[fgNPorts] =  DEFAULT_EVENT_PORT;  
@@ -372,9 +204,7 @@ AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
                      portIsSet = kTRUE;
                    }
                }
-
            }
-
        }
     }
 
@@ -404,385 +234,3 @@ AliHLTPHOSOnlineDisplay::ScanArguments(int argc, char** argv)
 
   return iResult;
 }//end ScanArguments
-
-
-int
-AliHLTPHOSOnlineDisplay::GetNextEvent()
-{
-  HOMERReader* CurrentReaderPtr;
-
-  if(fgAccumulate == kFALSE)
-    {
-      cout <<"resetting fgLegoplot" << endl;
-      if(fgLegoPlotHGPtr !=0)
-       {
-         fgLegoPlotHGPtr->Reset(); 
-       }
-
-      if(fgLegoPlotLGPtr !=0)
-       {
-         fgLegoPlotLGPtr->Reset();
-       }  
-    }
-
-  int ret = 0;
-  unsigned long ndx;
-  const AliHLTComponentBlockData* iter = NULL;   
-  Bool_t nextSwitch=kTRUE; 
-  cout << "homerreader connectionstatus  =" <<fgHomerReaderPtr->GetConnectionStatus() << endl;;
-
-  int nLoops=0;
-  if(fgSyncronize == kTRUE)
-    {
-      nLoops = 1;
-    }
-  else
-    {
-      nLoops =  fgNHosts; 
-    }
-  
-  for(int reader = 0; reader <  nLoops; reader ++)
-    {
-      if(fgSyncronize == kTRUE)
-       {
-         CurrentReaderPtr =fgHomerReaderPtr;
-       }
-      else
-       {
-         CurrentReaderPtr =fgHomerReadersPtr[reader];
-       }
-      ret =CurrentReaderPtr->ReadNextEvent();  
-      cout << "Event ID =\t " << reader <<" = "<< CurrentReaderPtr->GetEventID() << endl;;
-  
-      if( ret ) 
-       {
-         int ndx = fgHomerReaderPtr->GetErrorConnectionNdx();
-         printf( "------------ TRY AGAIN --------------->Error reading event from source %d: %s (%d)\n", ndx, strerror(ret), ret );
-         cout << "HOMER getconncetioNdx  status = " << ndx << endl;
-         return ret; 
-       }
-  
-      unsigned long blockCnt = CurrentReaderPtr->GetBlockCnt();
-      
-      for ( unsigned long i = 0; i < blockCnt; i++ ) 
-       {
-         char tmp1[9], tmp2[5];
-         memset( tmp1, 0, 9 );
-         memset( tmp2, 0, 5);
-         void *tmp11 = tmp1;
-         ULong64_t* tmp12 = (ULong64_t*)tmp11;
-         *tmp12 =fgHomerReadersPtr[reader]->GetBlockDataType( i );
-         void *tmp21 = tmp2;
-         ULong_t* tmp22 = (ULong_t*)tmp21;
-         *tmp22 = CurrentReaderPtr->GetBlockDataOrigin( i );
-         cout << "Dataype for block:  "<< i<<"  is:  "<< tmp1<<tmp2 <<endl;
-       }
-
-      unsigned long blk = CurrentReaderPtr->FindBlockNdx("RENELLEC","SOHP", 0xFFFFFFFF );
-
-      while ( blk != ~(unsigned long)0 ) 
-       {
-         Int_t moduleID;
-         const AliHLTPHOSRcuCellEnergyDataStruct* cellEnergiesPtr = (const AliHLTPHOSRcuCellEnergyDataStruct*) CurrentReaderPtr->GetBlockData( blk );  
-         moduleID = cellEnergiesPtr->fModuleID ;
-         Int_t tmpCount = cellEnergiesPtr->fCnt;
-         Int_t tmpZ;
-         Int_t tmpX;
-         Int_t tmpGain;
-         
-         //      for(int i= 0; i<tmpCount; i++)
-         for(int i= 0; i <= tmpCount; i++)
-           {
-             tmpZ = cellEnergiesPtr->fValidData[i].fZ;
-             tmpX = cellEnergiesPtr->fValidData[i].fX;
-             tmpGain =  cellEnergiesPtr->fValidData[i].fGain;
-             
-             if(tmpGain == HIGH_GAIN)
-               {
-                 fgLegoPlotHGPtr->Fill(moduleID*N_XCOLUMNS_MOD + tmpX +  N_XCOLUMNS_RCU*cellEnergiesPtr->fRcuX,  
-                                     tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ, cellEnergiesPtr->fValidData[i].fEnergy);
-               }
-                 
-             else if(tmpGain == LOW_GAIN)
-               {
-                 fgLegoPlotLGPtr->Fill(moduleID*N_XCOLUMNS_MOD + tmpX +  N_XCOLUMNS_RCU*cellEnergiesPtr->fRcuX,
-                                     tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ,    cellEnergiesPtr->fValidData[i].fEnergy);
-               }
-           }
-               
-         blk = CurrentReaderPtr->FindBlockNdx("RENELLEC","SOHP", 0xFFFFFFFF, blk+1);
-       }
-    }
-  UpdateDisplay();
-  fgEvntCnt ++;
-}
-
-int 
-AliHLTPHOSOnlineDisplay::GetNextEventRaw()
-{
-  cout << "AliHLTPHOSOnlineDisplay::GetNextEventRaw():updating RawdataDisplay" << endl;
-  int ret = 0;
-  unsigned long ndx;
-  const AliHLTComponentBlockData* iter = NULL;
-  for(int reader = 0; reader <  fgNHosts; reader ++)
-    {
-      ret = fgChannelRawReadersPtr[reader]->ReadNextEvent();  
-      if( ret ) 
-       {
-         int ndx = fgChannelRawReadersPtr[reader]->GetErrorConnectionNdx();
-         printf( "------------ TRY AGAIN --------------->Error reading event from source %d: %s (%d)\n", ndx, strerror(ret), ret );
-         cout << "HOMER getconncetioNdx  status = " << ndx << endl;
-         return ret; 
-       }
-      
-      unsigned long blockCnt = fgChannelRawReadersPtr[reader]->GetBlockCnt();
-      cout << "AliHLTPHOSOnlineDisplay::NextEventRaw():  blockCnt  = " << blockCnt << endl;
-
-      for ( unsigned long i = 0; i < blockCnt; i++ ) 
-       {
-         char tmp1[9], tmp2[5];
-         memset( tmp1, 0, 9 );
-         memset( tmp2, 0, 5);
-         void *tmp11 = tmp1;
-         ULong64_t* tmp12 = (ULong64_t*)tmp11;
-         *tmp12 =fgChannelRawReadersPtr[reader]->GetBlockDataType( i );
-         void *tmp21 = tmp2;
-         ULong_t* tmp22 = (ULong_t*)tmp21;
-         *tmp22 = fgChannelRawReadersPtr[reader]->GetBlockDataOrigin( i );
-         cout << "Dataype is: "<< tmp1<<"   "<<tmp2 <<endl;
-       }
-      
-      unsigned long blk = fgChannelRawReadersPtr[reader]->FindBlockNdx("ATADNAHC","SOHP", 0xeFFFFFFF );
-
-      while ( blk != ~(unsigned long)0 ) 
-       {
-         cout << ":GetNextEventRaw(): updating block " << endl;
-         AliHLTUInt16_t moduleID;
-         const AliHLTPHOSRcuChannelDataStruct* rcuChannelDataPtr = (const AliHLTPHOSRcuChannelDataStruct*)fgChannelRawReadersPtr[reader]->GetBlockData( blk ); 
-         moduleID = rcuChannelDataPtr->fModuleID ;
-         int tmpx;
-         int tmpz;
-         AliHLTUInt32_t tmpChCnt =0;
-         AliHLTUInt16_t tmpSampleCnt =0;
-
-         tmpChCnt = rcuChannelDataPtr->fNValidChannels;
-         cout << "tmpChCnt = " << tmpChCnt << endl; 
-
-         for( AliHLTUInt32_t ch =0; ch < tmpChCnt; ch ++)
-           {
-             {
-               tmpz =  rcuChannelDataPtr->fValidData[ch].fZ;
-               tmpx =  rcuChannelDataPtr->fValidData[ch].fX;   
-               tmpSampleCnt =  rcuChannelDataPtr->fValidData[ch].fNSamples;
-
-               for(AliHLTUInt16_t sample =0; sample <tmpSampleCnt; sample ++)
-                 {
-                   if(  rcuChannelDataPtr->fValidData[ch].fGain  == 0)
-                     {
-                       fgChannelDataPlotPtr[tmpz][tmpx]->SetBinContent(sample,  rcuChannelDataPtr->fValidData[ch].fChannelData[sample]);
-                     }
-                 }
-             }
-           }
-
-         blk = fgChannelRawReadersPtr[reader]->FindBlockNdx("ATADNAHC","SOHP", 0xeFFFFFFF, blk+1);
-
-       } 
-    }
-  
-  UpdateChanneRawDataDisplay();
-  fgEvntCnt ++;
-}
-
-
-
-int
-AliHLTPHOSOnlineDisplay::GetHistogram()
-{
-  fgCalibHistPtr[LOW_GAIN]->Reset(); 
-  fgCalibHistPtr[HIGH_GAIN]->Reset();
-  int ret = 0;
-  unsigned long ndx;
-  const AliHLTComponentBlockData* iter = NULL;   
-  Bool_t nextSwitch=kTRUE; 
-
-  for(int reader = 0; reader <  fgNHosts; reader ++)
-    {
-      ret =fgCalibReadersPtr[reader]->ReadNextEvent(); ;  
-      if( ret ) 
-       {
-         int ndx = fgCalibReadersPtr[reader]->GetErrorConnectionNdx();
-         printf( "------------ TRY AGAIN --------------->Error reading event from source %d: %s (%d)\n", ndx, strerror(ret), ret );
-         cout << "HOMER getconncetioNdx  status = " << ndx << endl;
-         return ret; 
-       }
-      
-      unsigned long blockCnt = fgCalibReadersPtr[reader]->GetBlockCnt();
-      cout << "AliHLTPHOSOnlineDisplay::GetHistogram():  blockCnt  = " << blockCnt << endl;
-
-      for ( unsigned long i = 0; i < blockCnt; i++ ) 
-       {
-         char tmp1[9], tmp2[5];
-         memset( tmp1, 0, 9 );
-         memset( tmp2, 0, 5);
-         void *tmp11 = tmp1;
-         ULong64_t* tmp12 = (ULong64_t*)tmp11;
-         *tmp12 =fgCalibReadersPtr[reader]->GetBlockDataType( i );
-         void *tmp21 = tmp2;
-         ULong_t* tmp22 = (ULong_t*)tmp21;
-         *tmp22 = fgCalibReadersPtr[reader]->GetBlockDataOrigin( i );
-         cout << "Dataype is: "<< tmp1<<"   "<<tmp2 <<endl;
-       }
-      
-      unsigned long blk = fgCalibReadersPtr[reader]->FindBlockNdx("UCCARENE","SOHP", 0xFFFFFFFF );
-      //      int tmpWhileCnt = 0;
-  
-
-
-      while ( blk != ~(unsigned long)0 ) 
-       {
-         cout << "GetHistogram: updating block " << endl;
-         AliHLTUInt16_t moduleID;
-         const AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* accCellEnergiesPtr = (const AliHLTPHOSRcuCellAccumulatedEnergyDataStruct*)fgCalibReadersPtr[reader]->GetBlockData( blk ); 
-         moduleID = accCellEnergiesPtr->fModuleID ;
-         //      int RcuXOffset = (accCellEnergiesPtr->fRcuX)*N_XCOLUMNS_RCU;
-         //      int RcuZOffset = (accCellEnergiesPtr->fRcuZ)*N_ZROWS_RCU;
-         cout << "(X,Z) =" << "("<< (int)accCellEnergiesPtr->fRcuX <<" , " <<  (int)accCellEnergiesPtr->fRcuZ << ") " << endl;
-         
-         int tmpx;
-         int tmpz;
-
-         for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
-           for(int z = 0; z <N_ZROWS_RCU; z ++)
-             {
-               {
-                 for(int gain = 0; gain < N_GAINS; gain ++)
-                   {
-                     tmpx = moduleID*N_XCOLUMNS_MOD + (accCellEnergiesPtr->fRcuX)*N_XCOLUMNS_RCU + x;
-                     tmpz = (accCellEnergiesPtr->fRcuZ)*N_ZROWS_RCU +z;
-
-                     fgCalibHistPtr[gain]->Fill(tmpx, tmpz, accCellEnergiesPtr->fAccumulatedEnergies[x][z][gain] );
-                     fgHitsHistPtr[gain]->Fill(tmpx, tmpz, accCellEnergiesPtr->fHits[x][z][gain] );
-                     
-                     if(fgHitsHistPtr[gain]->GetBinContent(tmpx, tmpz) > 0)
-                       {
-                         fgAveragePtr[gain]->SetBinContent(tmpx, tmpz, fgCalibHistPtr[gain]->GetBinContent(tmpx, tmpz)/fgHitsHistPtr[gain]->GetBinContent(tmpx, tmpz));
-                       }
-                   }
-               }
-             }
-
-         blk = fgCalibReadersPtr[reader]->FindBlockNdx("UCCARENE","SOHP", 0xFFFFFFFF, blk+1);
-         //      tmpWhileCnt ++;
-       } 
-    }
-  
-  UpdateHistograms();
-  fgEvntCnt ++;
-}
-
-
-void
-AliHLTPHOSOnlineDisplay::UpdateDisplay()
-{
-  fgCanvasHGPtr =  fEc1->GetCanvas();
-  fgCanvasHGPtr->cd();
-  fgLegoPlotHGPtr->Draw("LEGO2Z");
-  fgCanvasHGPtr->Update();
-  fgCanvasLGPtr = fEc2->GetCanvas();
-  fgCanvasLGPtr->cd();
-  fgLegoPlotLGPtr->Draw("LEGO2Z");
-  fgCanvasLGPtr->Update();
-
-  fgCanvasHGPtr =  fEc3->GetCanvas();
-  fgCanvasHGPtr->cd();
-  fgLegoPlotHGPtr->Draw("SCAT");
-  fgCanvasHGPtr->Update();
-  fgCanvasLGPtr = fEc4->GetCanvas();
-  fgCanvasLGPtr->cd();
-  fgLegoPlotLGPtr->Draw("SCAT");
-  fgCanvasLGPtr->Update();
-
-  fgCanvasHGPtr =  fEc5->GetCanvas();
-  fgCanvasHGPtr->cd();
-  fgLegoPlotHGPtr->Draw("CONTZ");
-  fgCanvasHGPtr->Update();
-  fgCanvasLGPtr = fEc6->GetCanvas();
-  fgCanvasLGPtr->cd();
-  fgLegoPlotLGPtr->Draw("CONTZ");
-  fgCanvasLGPtr->Update();
-}
-
-void
-AliHLTPHOSOnlineDisplay::UpdateHistograms()
-{
-  fgCanvasHGPtr =  fEc7->GetCanvas();
-  fgCanvasHGPtr->cd();
-  fgCalibHistPtr[HIGH_GAIN]->Draw("LEGO2Z");
-  fgCanvasHGPtr->Update();
-
-  fgCanvasLGPtr = fEc8->GetCanvas();
-  fgCanvasLGPtr->cd();
-  fgCalibHistPtr[LOW_GAIN]->Draw("LEGO2Z");
-  fgCanvasLGPtr->Update();
-
-  fgCanvasHGPtr =  fEc9->GetCanvas();
-  fgCanvasHGPtr->cd();
-  fgHitsHistPtr[HIGH_GAIN]->Draw("SCAT");
-  fgCanvasHGPtr->Update();
-
-  fgCanvasLGPtr = fEc10->GetCanvas();
-  fgCanvasLGPtr->cd();
-  fgHitsHistPtr[LOW_GAIN]->Draw("SCAT");
-  fgCanvasLGPtr->Update();
-
-  fgCanvasHGPtr =  fEc11->GetCanvas();
-  fgCanvasHGPtr->cd();
-  fgCalibHistPtr[HIGH_GAIN]->Draw("COLZ");
-  fgCanvasHGPtr->Update();
-
-  fgCanvasLGPtr = fEc12->GetCanvas();
-  fgCanvasLGPtr->cd();
-  fgCalibHistPtr[LOW_GAIN]->Draw("COLZ");
-  fgCanvasLGPtr->Update();
-
-
-  fgCanvasLGPtr = fEc13->GetCanvas();
-  fgCanvasLGPtr->cd();
-  fgAveragePtr[HIGH_GAIN]->Draw("COLZ");
-  fgCanvasLGPtr->Update();
-
-  fgCanvasHGPtr = fEc14->GetCanvas();
-  fgCanvasHGPtr->cd();
-  fgAveragePtr[LOW_GAIN]->Draw("COLZ");
-  fgCanvasHGPtr->Update();
-
-}
-
-
-void 
-AliHLTPHOSOnlineDisplay::UpdateChanneRawDataDisplay()
-{
-  fgTestCanvasPtr = new TCanvas("TEST", "testcanvas", 1200, 1000);  
-  //  fgTestCanvasPtr->Divide(N_ZROWS_RCU, N_XCOLUMNS_RCU, 0, 0);
-  fgTestCanvasPtr->Divide(N_XCOLUMNS_RCU, N_ZROWS_RCU, 0, 0);
-
-  for(int z = 0; z < N_ZROWS_RCU; z ++)
-    {
-      for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
-       {
-         //      fgTestCanvasPtr->cd(x*N_ZROWS_RCU +z + 1);
-         fgTestCanvasPtr->cd(z*N_XCOLUMNS_RCU +x + 1);
-
-         fgChannelDataPlotPtr[z][x]->Draw();
-       } 
-    }
-
-  fgTestCanvasPtr->Update();
-
-}
-
-
-
-
index 636edbe..8c143b7 100644 (file)
 #include "TGFrame.h"
 #include "AliHLTPHOSCommonDefs.h"
 #include "AliHLTPHOSRcuChannelDataStruct.h"
+#include "AliHLTPHOSOnlineDisplayEventTab.h"
+#include "AliHLTPHOSOnlineDisplayCalibTab.h"
+#include "AliHLTPHOSOnlineDisplayRawTab.h"
+
+#include "AliHLTPHOSCommonDefs.h"
 
-#define MAX_HOSTS 10
-#define MAX_HOSTNAME_LENGTH 64
-#define DEFAULT_EVENT_PORT 42001 
-#define DEFAULT_HISTO_PORT 42002 
 
 class TCanvas;
 class AliHLTPHOSRcuCellEnergyDataStruct;
@@ -34,53 +35,21 @@ class AliHLTPHOSOnlineDisplay : public  TGMainFrame
   int GetNextEventRaw();
   int GetHistogram();
   void InitDisplay();
-  void UpdateDisplay();
-  void UpdateHistograms();
-  void UpdateChanneRawDataDisplay();
   void EvaluateAverage();
-  static int ScanArguments(int argc, char** argv);
-  static AliHLTPHOSOnlineDisplay* Instance();  
-  
+  int ScanArguments(int argc, char** argv);
+  static AliHLTPHOSOnlineDisplay* Instance(int argc, char** argv);  
  private:
   AliHLTPHOSOnlineDisplay();
-  static TGCompositeFrame    *fFrame1, *fF1, *fF2, *fF3, *fF4, *fF5, *fSubF1, *fSubF2, *fSubF3, *fSubF4, *fSubF5, *fSubF6, *fSubF7,*fSubF8;
+  AliHLTPHOSOnlineDisplay(int argc, char** argv);
+  static AliHLTPHOSOnlineDisplayEventTab  *fgEventTabPtr;
+  static AliHLTPHOSOnlineDisplayCalibTab  *fgCalibTabPtr;
+  static AliHLTPHOSOnlineDisplayRawTab    *fgRawTabPtr;
   static TGTab               *fTab;
-  static TGTab               *fSubTab1, *fSubTab2, *fSubTab3;
-  static TGTab               *fSubTabModule[N_MODULES];
-  static TGTab               *fSubSubTabRcu[N_MODULES][N_RCUS_PER_MODULE]; 
-  //  static TH1D                *fgChannelDataPlotPtr[N_MODULES][N_RCUS_PER_MODULE][N_ZROWS_RCU][N_XCOLUMNS_RCU];
-  static TH1D                *fgChannelDataPlotPtr[N_ZROWS_RCU][N_XCOLUMNS_RCU];
-  //  static TRootEmbeddedCanvas *fgChannelDataCanvasPtr[N_MODULES][N_RCUS_PER_MODULE];
-  //  static TRootEmbeddedCanvas *fgChannelDataCanvasPtr[N_MODULES][N_RCUS_PER_MODULE][N_ZROWS_RCU][N_XCOLUMNS_RCU];
-  //  static TRootEmbeddedCanvas *fgChannelDataCanvasPtr[N_ZROWS_RCU][N_XCOLUMNS_RCU];
-  static TRootEmbeddedCanvas *fTest;
-
-  //  static TGCompositeFrame    *fgChannelDataCompositeFramePtr[N_MODULES][N_RCUS_PER_MODULE];
-  
- //  static TGTab               *fSubTab2;
-  static TRootEmbeddedCanvas *fEc1, *fEc2, *fEc3, *fEc4, *fEc5, *fEc6, *fEc7, *fEc8, *fEc9, *fEc10, *fEc11, *fEc12, *fEc13, *fEc14;
-  static AliHLTPHOSGetEventButton* fgEventButtPtr; 
   static AliHLTPHOSOnlineDisplay* fgInstancePtr;
-  static TH2D *fgLegoPlotLGPtr;
-  static TH2D *fgLegoPlotHGPtr;
-  static TH2D *fgCalibHistPtr[N_GAINS];
-  static TH2I *fgHitsHistPtr[N_GAINS]; 
-  static TH2D *fgAveragePtr[N_GAINS]; 
-  static char *fgDefaultDet;        
-  static char *fgDefaultDataType;   
-  static int fgEvntCnt;
-  static TCanvas *fgCanvasHGPtr;
-  static TCanvas *fgCanvasLGPtr;
-
-  static TCanvas *fgTestCanvasPtr;
-
   static unsigned int fgNHosts;
   static unsigned int fgNPorts;
   static HOMERReader* fgHomerReaderPtr;
   static HOMERReader* fgHomerReadersPtr[MAX_HOSTS];
-  static HOMERReader* fgCalibReadersPtr[MAX_HOSTS];
-  static HOMERReader* fgChannelRawReadersPtr[MAX_HOSTS];
   static char  *fgHosts[MAX_HOSTS];
   static short unsigned    *fgPorts;
   static Bool_t fgAccumulate;
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayCalibTab.cxx b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayCalibTab.cxx
new file mode 100644 (file)
index 0000000..e1e84e1
--- /dev/null
@@ -0,0 +1,231 @@
+#include  "AliHLTPHOSOnlineDisplayCalibTab.h"
+#include <iostream>
+#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
+#include "AliHLTPHOSGetEventButton.h"
+
+using namespace std;
+
+AliHLTPHOSOnlineDisplayCalibTab::AliHLTPHOSOnlineDisplayCalibTab()
+{
+  cout << "AliHLTPHOSOnlineDisplayCalibTab:ERROR: You cannot create a onlinedisplay Tab without arguments" << endl;
+}
+
+AliHLTPHOSOnlineDisplayCalibTab::AliHLTPHOSOnlineDisplayCalibTab(TGTab  *tabPtr, HOMERReader *homerSyncPtr, HOMERReader *homerPtrs[MAX_HOSTS], int nHosts)
+{
+  for(int i=0; i<MAX_HOSTS; i++)
+    {
+       fgHomerReadersPtr[i] = 0;
+    }
+
+  fgHomerReaderPtr = homerSyncPtr;
+  
+  for(int i=0; i<nHosts; i++)
+    {
+      fgHomerReadersPtr[i] = homerPtrs[i] ;
+    }
+
+  fgNHosts = nHosts;
+  InitDisplay(tabPtr);
+}
+
+
+AliHLTPHOSOnlineDisplayCalibTab::~AliHLTPHOSOnlineDisplayCalibTab()
+{
+
+
+}
+
+
+void
+AliHLTPHOSOnlineDisplayCalibTab::ReadBlockData(HOMERReader *homerReaderPtr)
+{
+  unsigned long blk = homerReaderPtr->FindBlockNdx("UCCARENE","SOHP", 0xFFFFFFFF );
+
+  while ( blk != ~(unsigned long)0 ) 
+    {
+      cout << "AliHLTPHOSOnlineDisplayCalibTab::ReadBlockDat:GetHistogram: updating block " << endl;
+      AliHLTUInt16_t moduleID;
+      const AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* accCellEnergiesPtr = (const AliHLTPHOSRcuCellAccumulatedEnergyDataStruct*)homerReaderPtr->GetBlockData( blk ); 
+      moduleID = accCellEnergiesPtr->fModuleID ;
+      cout << "(X,Z) =" << "("<< (int)accCellEnergiesPtr->fRcuX <<" , " <<  (int)accCellEnergiesPtr->fRcuZ << ") " << endl;
+      
+      int tmpx;
+      int tmpz;
+      
+      for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
+       for(int z = 0; z <N_ZROWS_RCU; z ++)
+         {
+           {
+             for(int gain = 0; gain < N_GAINS; gain ++)
+               {
+                 tmpx = moduleID*N_XCOLUMNS_MOD + (accCellEnergiesPtr->fRcuX)*N_XCOLUMNS_RCU + x;
+                 tmpz = (accCellEnergiesPtr->fRcuZ)*N_ZROWS_RCU +z;
+                 
+                 fgCalibHistPtr[gain]->Fill(tmpx, tmpz, accCellEnergiesPtr->fAccumulatedEnergies[x][z][gain] );
+                 fgHitsHistPtr[gain]->Fill(tmpx, tmpz, accCellEnergiesPtr->fHits[x][z][gain] );
+                 
+                 if(fgHitsHistPtr[gain]->GetBinContent(tmpx, tmpz) > 0)
+                   {
+                     fgAveragePtr[gain]->SetBinContent(tmpx, tmpz, fgCalibHistPtr[gain]->GetBinContent(tmpx, tmpz)/fgHitsHistPtr[gain]->GetBinContent(tmpx, tmpz));
+                   }
+               }
+           }
+         }
+     
+      blk = homerReaderPtr->FindBlockNdx("UCCARENE","SOHP", 0xFFFFFFFF, blk+1);
+    }
+}
+
+
+int 
+AliHLTPHOSOnlineDisplayCalibTab::GetNextEvent()
+{
+  ResetDisplay();
+  DoGetNextEvent();
+  UpdateDisplay();
+  fgEvntCnt ++;
+}
+
+void
+AliHLTPHOSOnlineDisplayCalibTab::ResetDisplay()
+{
+
+}
+
+void 
+AliHLTPHOSOnlineDisplayCalibTab::InitDisplay(TGTab *tabPtr)
+{
+  char tmpHistoName[256]; 
+
+  fgLegoPlotHGPtr = new TH2D("Homer","HLT: #pi^{0} 5 - 30Gev HG, High gain",  
+                            N_XCOLUMNS_MOD*N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES,  
+                             N_ZROWS_MOD,               0, N_ZROWS_MOD);
+  fgLegoPlotHGPtr->SetMaximum( MAX_BIN_VALUE);
+  fgLegoPlotHGPtr->Reset();
+
+  fgLegoPlotLGPtr = new TH2D("Homer","HLT: #pi^{0} 5 - 30Gev LG, Low gain",  
+                            N_XCOLUMNS_MOD* N_MODULES , 0, N_XCOLUMNS_MOD* N_MODULES,  
+                            N_ZROWS_MOD,          0, N_ZROWS_MOD);
+  fgLegoPlotLGPtr->SetMaximum( MAX_BIN_VALUE); 
+  fgLegoPlotLGPtr->Reset();
+
+
+ TGLayoutHints *fL1 = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
+                                        kLHintsExpandY, 2, 2, 15, 1);
+
+
+  for(int gain = 0; gain< N_GAINS; gain ++)
+    {
+      sprintf(tmpHistoName, "TAB a HLT gain %d", gain);
+      fgCalibHistPtr[gain] = new TH2D(tmpHistoName, tmpHistoName,  
+                                     N_XCOLUMNS_MOD*N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES , 
+                                     N_ZROWS_MOD,         0, N_ZROWS_MOD);
+      fgCalibHistPtr[gain]->Reset(); 
+      
+      sprintf(tmpHistoName, "TAB b Calibration Data HLT: #pi^{0} 5 - 30GeV gain %d", gain);
+      fgHitsHistPtr[gain] = new TH2I(tmpHistoName, tmpHistoName,  
+                                   N_XCOLUMNS_MOD* N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES,  
+                                   N_ZROWS_MOD,          0, N_ZROWS_MOD);
+      fgHitsHistPtr[gain]->SetMaximum( MAX_BIN_VALUE); 
+      fgHitsHistPtr[gain]->Reset();
+      
+      sprintf(tmpHistoName, "TAB c Average Data HLT: #pi^{0} 5 - 30GeV gain %d", gain);
+      fgAveragePtr[gain] = new TH2D(tmpHistoName,tmpHistoName,  
+                                   N_XCOLUMNS_MOD* N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES,  
+                                   N_ZROWS_MOD,          0, N_ZROWS_MOD);
+      fgAveragePtr[gain]->SetMaximum( MAX_BIN_VALUE); 
+      fgAveragePtr[gain]->Reset();
+    }
+
+
+   TGCompositeFrame  *tf = tabPtr->AddTab("Calibration data zzz");
+     
+
+          fSubTab2 = new TGTab(tf, 100, 100);
+
+          TGCompositeFrame        *tf2 = fSubTab2->AddTab("Accumulated energy");   
+          fSubF4 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
+
+          fEc7 = new TRootEmbeddedCanvas("ec7", fSubF4, 100, 100);
+          fSubF4->AddFrame(fEc7, fL1);
+
+          fEc8 = new TRootEmbeddedCanvas("ec8", fSubF4, 100, 100);
+          fSubF4->AddFrame(fEc8, fL1);
+
+          tf2->AddFrame(fSubF4, fL1);
+
+          tf2 = fSubTab2->AddTab("SCAT (hits)"); 
+          fSubF5 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
+          tf2->AddFrame(fSubF5, fL1);
+          fEc9 = new TRootEmbeddedCanvas("ec9", fSubF5, 100, 100);
+          fSubF5->AddFrame(fEc9, fL1);
+          fEc10 = new TRootEmbeddedCanvas("ec10", fSubF5, 100, 100);
+          fSubF5->AddFrame(fEc10, fL1);
+
+          tf2 = fSubTab2->AddTab("SURF"); 
+          fSubF6 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
+          tf2->AddFrame(fSubF6, fL1);
+          fEc11 = new TRootEmbeddedCanvas("ec11", fSubF6, 100, 100);
+          fSubF6->AddFrame(fEc11, fL1);
+          fEc12 = new TRootEmbeddedCanvas("ec12", fSubF6, 100, 100);
+          fSubF6->AddFrame(fEc12, fL1);
+
+          tf2 = fSubTab2->AddTab("acummulated energy / hits"); 
+          fSubF7 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
+          tf2->AddFrame(fSubF7, fL1);
+          fEc13 = new TRootEmbeddedCanvas("ec13", fSubF7, 100, 100);
+          fSubF7->AddFrame(fEc13, fL1);
+          fEc14 = new TRootEmbeddedCanvas("ec14", fSubF7, 100, 100);
+          fSubF7->AddFrame(fEc14, fL1);
+
+          fSubTab2->Resize();
+          tf->AddFrame(fSubTab2, fL1);
+
+  fgEventButtPtr = new  AliHLTPHOSGetEventButton(fSubF4, "update histograms z", 'h');
+}
+
+
+void 
+AliHLTPHOSOnlineDisplayCalibTab::UpdateDisplay()
+{
+
+  fgCanvasHGPtr =  fEc7->GetCanvas();
+  fgCanvasHGPtr->cd();
+
+  fgCalibHistPtr[HIGH_GAIN]->Draw("LEGO2Z");
+  fgCanvasHGPtr->Update();
+  fgCanvasLGPtr = fEc8->GetCanvas();
+  fgCanvasLGPtr->cd();
+  fgCalibHistPtr[LOW_GAIN]->Draw("LEGO2Z");
+  fgCanvasLGPtr->Update();
+  fgCanvasHGPtr =  fEc9->GetCanvas();
+
+  fgCanvasHGPtr->cd();
+  fgHitsHistPtr[HIGH_GAIN]->Draw("SCAT");
+  fgCanvasHGPtr->Update();
+  fgCanvasLGPtr = fEc10->GetCanvas();
+  fgCanvasLGPtr->cd();
+  fgHitsHistPtr[LOW_GAIN]->Draw("SCAT");
+  fgCanvasLGPtr->Update();
+  fgCanvasHGPtr =  fEc11->GetCanvas();
+  fgCanvasHGPtr->cd();
+
+  fgCalibHistPtr[HIGH_GAIN]->Draw("COLZ");
+  fgCanvasHGPtr->Update();
+  fgCanvasLGPtr = fEc12->GetCanvas();
+  fgCanvasLGPtr->cd();
+  fgCalibHistPtr[LOW_GAIN]->Draw("COLZ");
+  fgCanvasLGPtr->Update();
+
+
+  fgCanvasLGPtr = fEc13->GetCanvas();
+  fgCanvasLGPtr->cd();
+  fgAveragePtr[HIGH_GAIN]->Draw("COLZ");
+  fgCanvasLGPtr->Update();
+
+  fgCanvasHGPtr = fEc14->GetCanvas();
+  fgCanvasHGPtr->cd();
+  fgAveragePtr[LOW_GAIN]->Draw("COLZ");
+  fgCanvasHGPtr->Update();
+
+}
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayCalibTab.h b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayCalibTab.h
new file mode 100644 (file)
index 0000000..2a0d76f
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIHLTPHOSONLINEDISPLAYCALIBTAB_H
+#define ALIHLTPHOSONLINEDISPLAYCALIBTAB_H
+
+#include "TGTab.h"
+#include "AliHLTPHOSOnlineDisplayTab.h"
+#include "TH2.h"
+#include "AliHLTPHOSCommonDefs.h"
+#include <TRootEmbeddedCanvas.h>
+#include <TCanvas.h>
+#include "AliHLTDataTypes.h"
+
+class AliHLTPHOSGetEventButton;
+class AliHLTPHOSOnlineDisplayCalibTab : public AliHLTPHOSOnlineDisplayTab
+{
+ public:
+  AliHLTPHOSOnlineDisplayCalibTab();
+  AliHLTPHOSOnlineDisplayCalibTab(TGTab  *tabPtr, HOMERReader *homerSyncPtr, HOMERReader *homerPtrs[MAX_HOSTS], int nHosts);
+  virtual ~AliHLTPHOSOnlineDisplayCalibTab();
+
+  void InitDisplay(TGTab *tabPtr);
+  void UpdateDisplay();
+  int GetNextEvent();
+  virtual void ReadBlockData(HOMERReader *homeReaderPtr);
+  void ResetDisplay();
+
+  TH2D *fgCalibHistPtr[N_GAINS];
+  TH2I *fgHitsHistPtr[N_GAINS]; 
+  TH2D *fgAveragePtr[N_GAINS];
+  TGTab               *fTab;
+  TRootEmbeddedCanvas *fEc7, *fEc8, *fEc9, *fEc10, *fEc11, *fEc12, *fEc13, *fEc14;
+  TGTab               *fSubTab2;
+  TGCompositeFrame    *fSubF4, *fSubF5, *fSubF6, *fSubF7,*fSubF8;
+  TCanvas *fgCanvasHGPtr;
+  TCanvas *fgCanvasLGPtr;
+  TH2D *fgLegoPlotLGPtr;
+  TH2D *fgLegoPlotHGPtr;
+  AliHLTPHOSGetEventButton* fgEventButtPtr; 
+};
+
+
+#endif
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayEventTab.cxx b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayEventTab.cxx
new file mode 100644 (file)
index 0000000..6b01956
--- /dev/null
@@ -0,0 +1,204 @@
+#include "AliHLTPHOSOnlineDisplayEventTab.h"
+#include <iostream>
+#include "TGFrame.h"
+#include "AliHLTPHOSGetEventButton.h"
+#include "AliHLTPHOSCommonDefs.h"
+#include "AliHLTDataTypes.h"
+#include "HOMERData.h"
+#include "HOMERReader.h"
+#include "HOMERWriter.h"
+#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
+
+
+using namespace std;
+
+
+AliHLTPHOSOnlineDisplayEventTab::AliHLTPHOSOnlineDisplayEventTab()
+{
+  cout << "ERROR: You cannot create a onlinedisplay Tab without arguments" << endl;
+}
+
+
+AliHLTPHOSOnlineDisplayEventTab::AliHLTPHOSOnlineDisplayEventTab(TGTab  *tabPtr, HOMERReader *homerSyncPtr, HOMERReader *homerPtrs[MAX_HOSTS], int nHosts)
+{
+  for(int i=0; i<MAX_HOSTS; i++)
+    {
+       fgHomerReadersPtr[i] = 0;
+    }
+
+  fgHomerReaderPtr = homerSyncPtr;
+  
+  for(int i=0; i<nHosts; i++)
+    {
+      fgHomerReadersPtr[i] = homerPtrs[i] ;
+    }
+
+  fgCanvasHGPtr = 0;
+  fgCanvasLGPtr = 0;
+  fgLegoPlotLGPtr = 0;
+  fgLegoPlotHGPtr = 0;
+
+  fgNHosts = nHosts;
+  InitDisplay(tabPtr);
+}
+
+
+AliHLTPHOSOnlineDisplayEventTab::~AliHLTPHOSOnlineDisplayEventTab()
+{
+
+}
+
+
+int
+AliHLTPHOSOnlineDisplayEventTab::GetNextEvent()
+{
+  ResetDisplay();
+  DoGetNextEvent();
+  UpdateDisplay();
+  fgEvntCnt ++;
+}
+
+
+
+void 
+AliHLTPHOSOnlineDisplayEventTab::ReadBlockData(HOMERReader *homeReaderPtr)
+{
+  cout << "Reading block data" << endl;
+
+  unsigned long blk = homeReaderPtr->FindBlockNdx("RENELLEC","SOHP", 0xFFFFFFFF );
+
+  while ( blk != ~(unsigned long)0 ) 
+    {
+      Int_t moduleID;
+      const AliHLTPHOSRcuCellEnergyDataStruct* cellEnergiesPtr = (const AliHLTPHOSRcuCellEnergyDataStruct*)homeReaderPtr->GetBlockData( blk );  
+      moduleID = cellEnergiesPtr->fModuleID ;
+      Int_t tmpCount = cellEnergiesPtr->fCnt;
+      Int_t tmpZ;
+      Int_t tmpX;
+      Int_t tmpGain;
+         
+      for(int i= 0; i <= tmpCount; i++)
+       {
+         tmpZ = cellEnergiesPtr->fValidData[i].fZ;
+         tmpX = cellEnergiesPtr->fValidData[i].fX;
+         tmpGain =  cellEnergiesPtr->fValidData[i].fGain;
+         
+         if(tmpGain == HIGH_GAIN)
+           {
+             fgLegoPlotHGPtr->Fill(moduleID*N_XCOLUMNS_MOD + tmpX +  N_XCOLUMNS_RCU*cellEnergiesPtr->fRcuX,  
+                                   tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ, cellEnergiesPtr->fValidData[i].fEnergy);
+           }
+         
+         else if(tmpGain == LOW_GAIN)
+           {
+             fgLegoPlotLGPtr->Fill(moduleID*N_XCOLUMNS_MOD + tmpX +  N_XCOLUMNS_RCU*cellEnergiesPtr->fRcuX,
+                                   tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ,    cellEnergiesPtr->fValidData[i].fEnergy);
+           }
+       }
+      
+      blk = homeReaderPtr->FindBlockNdx("RENELLEC","SOHP", 0xFFFFFFFF, blk+1);
+    }
+}
+
+
+void
+AliHLTPHOSOnlineDisplayEventTab::ResetDisplay()
+{
+  if(fgAccumulate == kFALSE)
+    {
+      if(fgLegoPlotHGPtr !=0)
+       {
+         fgLegoPlotHGPtr->Reset(); 
+       }
+
+      if(fgLegoPlotLGPtr !=0)
+       {
+         fgLegoPlotLGPtr->Reset();
+       }  
+    }
+ }
+
+
+void
+AliHLTPHOSOnlineDisplayEventTab::InitDisplay(TGTab  *tabPtr)
+{
+
+
+  fgLegoPlotHGPtr = new TH2D("Homer a eventTAB","xx HLT: #pi^{0} 5 - 30Gev HG, High gain",  
+                            N_XCOLUMNS_MOD*N_MODULES , 0, N_XCOLUMNS_MOD*N_MODULES,  
+                             N_ZROWS_MOD,               0, N_ZROWS_MOD);
+  fgLegoPlotHGPtr->SetMaximum( MAX_BIN_VALUE);
+  fgLegoPlotHGPtr->Reset();
+
+  fgLegoPlotLGPtr = new TH2D("Homer b eventTab","x HLT: #pi^{0} 5 - 30Gev LG, Low gain",  
+                            N_XCOLUMNS_MOD* N_MODULES , 0, N_XCOLUMNS_MOD* N_MODULES,  
+                            N_ZROWS_MOD,          0, N_ZROWS_MOD);
+  fgLegoPlotLGPtr->SetMaximum( MAX_BIN_VALUE); 
+  fgLegoPlotLGPtr->Reset();
+
+  TGLayoutHints *fL1 = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
+                                        kLHintsExpandY, 2, 2, 15, 1);
+
+  TGCompositeFrame *tf = tabPtr->AddTab("Event display TAB");
+  fSubTab1 = new TGTab(tf, 100, 100);
+  TGCompositeFrame *tf2 = fSubTab1->AddTab("LEGO");  
+  fSubF1 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
+  fEc1 = new TRootEmbeddedCanvas("ec1", fSubF1, 100, 100);
+  fSubF1->AddFrame(fEc1, fL1);
+  fEc2 = new TRootEmbeddedCanvas("ec2", fSubF1, 100, 100);
+  fSubF1->AddFrame(fEc2, fL1);
+  tf2->AddFrame(fSubF1, fL1);
+  
+  tf2 = fSubTab1->AddTab("SCAT"); 
+  fSubF2 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
+  tf2->AddFrame(fSubF2, fL1);
+  fEc3 = new TRootEmbeddedCanvas("ec3", fSubF2, 100, 100);
+  fSubF2->AddFrame(fEc3, fL1);
+  fEc4 = new TRootEmbeddedCanvas("ec4", fSubF2, 100, 100);
+  fSubF2->AddFrame(fEc4, fL1);
+  
+  tf2 = fSubTab1->AddTab("SURF"); 
+  fSubF3 = new TGCompositeFrame(tf2, 60, 20, kVerticalFrame);
+  tf2->AddFrame(fSubF3, fL1);
+  fEc5 = new TRootEmbeddedCanvas("ec5", fSubF3, 100, 100);
+  fSubF3->AddFrame(fEc5, fL1);
+  fEc6 = new TRootEmbeddedCanvas("ec6", fSubF3, 100, 100);
+  fSubF3->AddFrame(fEc6, fL1);
+  fSubTab1->Resize();
+  tf->AddFrame(fSubTab1, fL1);
+
+  fgEventButtPtr = new  AliHLTPHOSGetEventButton(fSubF1, "get event", 'e');
+}
+
+
+void
+AliHLTPHOSOnlineDisplayEventTab::UpdateDisplay()
+{
+  fgCanvasHGPtr =  fEc1->GetCanvas();
+  fgCanvasHGPtr->cd();
+  fgLegoPlotHGPtr->Draw("LEGO2Z");
+  fgCanvasHGPtr->Update();
+  fgCanvasLGPtr = fEc2->GetCanvas();
+  fgCanvasLGPtr->cd();
+  fgLegoPlotLGPtr->Draw("LEGO2Z");
+  fgCanvasLGPtr->Update();
+
+  fgCanvasHGPtr =  fEc3->GetCanvas();
+  fgCanvasHGPtr->cd();
+  fgLegoPlotHGPtr->Draw("SCAT");
+  fgCanvasHGPtr->Update();
+  fgCanvasLGPtr = fEc4->GetCanvas();
+  fgCanvasLGPtr->cd();
+  fgLegoPlotLGPtr->Draw("SCAT");
+  fgCanvasLGPtr->Update();
+
+  fgCanvasHGPtr =  fEc5->GetCanvas();
+  fgCanvasHGPtr->cd();
+  fgLegoPlotHGPtr->Draw("CONTZ");
+  fgCanvasHGPtr->Update();
+  fgCanvasLGPtr = fEc6->GetCanvas();
+  fgCanvasLGPtr->cd();
+  fgLegoPlotLGPtr->Draw("CONTZ");
+  fgCanvasLGPtr->Update();
+
+}
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayEventTab.h b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayEventTab.h
new file mode 100644 (file)
index 0000000..40678f7
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIHLTPHOSONLINEDISPLAYEVENTTAB_H
+#define ALIHLTPHOSONLINEDISPLAYEVENTTAB_H
+
+#include <TGTab.h>
+#include <TRootEmbeddedCanvas.h>
+#include "AliHLTPHOSOnlineDisplayTab.h"
+#include <TCanvas.h>
+#include <TH2D.h>
+
+class AliHLTPHOSGetEventButton;
+class HOMERReader;
+class AliHLTPHOSRcuCellEnergyDataStruct;
+
+class AliHLTPHOSOnlineDisplayEventTab : public AliHLTPHOSOnlineDisplayTab
+{
+ public:
+  virtual ~AliHLTPHOSOnlineDisplayEventTab();
+  AliHLTPHOSOnlineDisplayEventTab(TGTab *tabPtr, HOMERReader *fgHomerReaderPtr, HOMERReader *fgHomerReadersPtr[MAX_HOSTS], int nHosts);
+  AliHLTPHOSOnlineDisplayEventTab();
+  void UpdateDisplay();
+  int GetNextEvent();
+  virtual void ReadBlockData(HOMERReader *homeReaderPtr);
+  void ResetDisplay();
+  TGTab               *fTab;
+  TGTab               *fSubTab1;
+  TRootEmbeddedCanvas *fEc1, *fEc2, *fEc3, *fEc4, *fEc5, *fEc6;
+  TGCompositeFrame    *fSubF1, *fSubF2, *fSubF3;
+  TCanvas *fgCanvasHGPtr;
+  TCanvas *fgCanvasLGPtr;
+  TH2D *fgLegoPlotLGPtr;
+  TH2D *fgLegoPlotHGPtr;
+
+ protected:
+  Bool_t fgAccumulate;
+
+ private:
+  AliHLTPHOSGetEventButton* fgEventButtPtr; 
+  void InitDisplay(TGTab *tabPtr);
+};
+
+
+#endif
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayRawTab.cxx b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayRawTab.cxx
new file mode 100644 (file)
index 0000000..de5dd53
--- /dev/null
@@ -0,0 +1,154 @@
+#include  "AliHLTPHOSOnlineDisplayRawTab.h"
+#include <iostream>
+#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
+#include "AliHLTPHOSGetEventButton.h"
+#include "AliHLTPHOSRcuChannelDataStruct.h"
+
+using namespace std;
+
+AliHLTPHOSOnlineDisplayRawTab::AliHLTPHOSOnlineDisplayRawTab()
+{
+  cout << "AliHLTPHOSOnlineDisplayRawTab:ERROR: You cannot create a onlinedisplay Tab without arguments" << endl;
+}
+
+AliHLTPHOSOnlineDisplayRawTab::AliHLTPHOSOnlineDisplayRawTab(TGTab  *tabPtr, HOMERReader *homerSyncPtr, HOMERReader *homerPtrs[MAX_HOSTS], int nHosts)
+{
+  for(int i=0; i<MAX_HOSTS; i++)
+    {
+       fgHomerReadersPtr[i] = 0;
+    }
+
+  fgHomerReaderPtr = homerSyncPtr;
+  
+  for(int i=0; i<nHosts; i++)
+    {
+      fgHomerReadersPtr[i] = homerPtrs[i] ;
+    }
+
+  fgNHosts = nHosts;
+  InitDisplay(tabPtr);
+}
+
+
+AliHLTPHOSOnlineDisplayRawTab::~AliHLTPHOSOnlineDisplayRawTab()
+{
+
+
+}
+
+
+void
+AliHLTPHOSOnlineDisplayRawTab::ReadBlockData(HOMERReader *homerReaderPtr)
+{
+  unsigned long blk = homerReaderPtr->FindBlockNdx("ATADNAHC","SOHP", 0xeFFFFFFF );
+  
+  while ( blk != ~(unsigned long)0 ) 
+    {
+      cout << "GetNextEventRaw(): updating block " << endl;
+      AliHLTUInt16_t moduleID;
+      const AliHLTPHOSRcuChannelDataStruct* rcuChannelDataPtr = (const AliHLTPHOSRcuChannelDataStruct*)homerReaderPtr->GetBlockData( blk ); 
+      moduleID = rcuChannelDataPtr->fModuleID ;
+      int tmpx;
+      int tmpz;
+      AliHLTUInt32_t tmpChCnt =0;
+      AliHLTUInt16_t tmpSampleCnt =0;
+      
+      tmpChCnt = rcuChannelDataPtr->fNValidChannels;
+      cout << "tmpChCnt = " << tmpChCnt << endl; 
+      
+      for( AliHLTUInt32_t ch =0; ch < tmpChCnt; ch ++)
+       {
+         {
+           tmpz =  rcuChannelDataPtr->fValidData[ch].fZ;
+           tmpx =  rcuChannelDataPtr->fValidData[ch].fX;       
+           tmpSampleCnt =  rcuChannelDataPtr->fValidData[ch].fNSamples;
+
+           for(AliHLTUInt16_t sample =0; sample <tmpSampleCnt; sample ++)
+             {
+               if(  rcuChannelDataPtr->fValidData[ch].fGain  == 0)
+                 {
+                   fgChannelDataPlotPtr[tmpz][tmpx]->SetBinContent(sample,  rcuChannelDataPtr->fValidData[ch].fChannelData[sample]);
+                 }
+             }
+         }
+       }
+      blk =  homerReaderPtr->FindBlockNdx("ATADNAHC","SOHP", 0xeFFFFFFF, blk+1);
+    }
+}
+
+
+int 
+AliHLTPHOSOnlineDisplayRawTab::GetNextEvent()
+{
+  cout << "AliHLTPHOSOnlineDisplayRawTab::GetNextEvent()" << endl;
+  ResetDisplay();
+  DoGetNextEvent();
+  UpdateDisplay();
+  fgEvntCnt ++;
+}
+
+
+void
+AliHLTPHOSOnlineDisplayRawTab::ResetDisplay()
+{
+
+}
+
+
+void 
+AliHLTPHOSOnlineDisplayRawTab::InitDisplay(TGTab *tabPtr)
+{
+  char tmpHistoName[256]; 
+  //  char tmpHistoName[256];
+  char tmpChDtaName[256];
+
+  for(int z = 0; z < N_ZROWS_RCU; z ++)
+    {
+      for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
+       {
+         sprintf(tmpHistoName, "blablaz%d x%d",z, x);
+         fgChannelDataPlotPtr[z][x] = new TH1D(tmpHistoName, tmpHistoName, 300, 0, 299);
+         fgChannelDataPlotPtr[z][x]->SetMaximum(MAX_BIN_VALUE); 
+         fgChannelDataPlotPtr[z][x]->Reset();
+       }
+    }
+
+
+
+  TGCompositeFrame  *tf = tabPtr->AddTab("Raw Data Dislay");
+  fSubTab3 = new TGTab(tf, 100, 100);
+  TGLayoutHints *hints = new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0); 
+  char tmpTabName[256];
+  char tmpCanvasName[256];
+  sprintf(tmpTabName, "Raw data zzz");
+  TGCompositeFrame        *tf2 = fSubTab3->AddTab(tmpTabName);   
+  fgEventButtPtr = new  AliHLTPHOSGetEventButton(tf, "Get Rawdata2xxxxx", 'r');
+  AliHLTPHOSGetEventButton*       EventButtPtr2 = new  AliHLTPHOSGetEventButton(tf, "Get Rawdata", 'r'); 
+  EventButtPtr2->Move(200, 200); 
+
+}
+
+
+void 
+AliHLTPHOSOnlineDisplayRawTab::UpdateDisplay()
+{
+  
+  fgTestCanvasPtr = new TCanvas("TEST", "testcanvas", 1200, 1000);  
+  //  fgTestCanvasPtr->Divide(N_ZROWS_RCU, N_XCOLUMNS_RCU, 0, 0);
+  fgTestCanvasPtr->Divide(N_XCOLUMNS_RCU, N_ZROWS_RCU, 0, 0);
+
+  for(int z = 0; z < N_ZROWS_RCU; z ++)
+    {
+      for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
+       {
+         //      fgTestCanvasPtr->cd(x*N_ZROWS_RCU +z + 1);
+         fgTestCanvasPtr->cd(z*N_XCOLUMNS_RCU +x + 1);
+
+         fgChannelDataPlotPtr[z][x]->Draw();
+       } 
+    }
+
+  fgTestCanvasPtr->Update();
+  
+}
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayRawTab.h b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayRawTab.h
new file mode 100644 (file)
index 0000000..d1ad97a
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIHLTPHOSONLINEDISPLAYRAWTAB_H
+#define ALIHLTPHOSONLINEDISPLAYRAWTAB_H
+
+#include "TGTab.h"
+#include "AliHLTPHOSOnlineDisplayTab.h"
+#include "TH2.h"
+#include "AliHLTPHOSCommonDefs.h"
+#include <TRootEmbeddedCanvas.h>
+#include <TCanvas.h>
+#include "AliHLTDataTypes.h"
+
+class AliHLTPHOSGetEventButton;
+class AliHLTPHOSOnlineDisplayRawTab : public AliHLTPHOSOnlineDisplayTab
+{
+ public:
+  AliHLTPHOSOnlineDisplayRawTab();
+  AliHLTPHOSOnlineDisplayRawTab(TGTab  *tabPtr, HOMERReader *homerSyncPtr, HOMERReader *homerPtrs[MAX_HOSTS], int nHosts);
+  virtual ~AliHLTPHOSOnlineDisplayRawTab();
+
+  void InitDisplay(TGTab *tabPtr);
+  void UpdateDisplay();
+  int GetNextEvent();
+  virtual void ReadBlockData(HOMERReader *homeReaderPtr);
+  void ResetDisplay();
+
+  TH2D *fgRawHistPtr[N_GAINS];
+  TH2I *fgHitsHistPtr[N_GAINS]; 
+  TH2D *fgAveragePtr[N_GAINS];
+  TGTab               *fTab;
+  TGTab               *fSubTab3;
+  TGCompositeFrame *fFrame1;
+  TCanvas *fgTestCanvasPtr;
+  TCanvas *fgCanvasHGPtr;
+  TCanvas *fgCanvasLGPtr;
+  TH2D *fgLegoPlotLGPtr;
+  TH2D *fgLegoPlotHGPtr;
+  AliHLTPHOSGetEventButton* fgEventButtPtr; 
+  TH1D                *fgChannelDataPlotPtr[N_ZROWS_RCU][N_XCOLUMNS_RCU];
+};
+
+
+#endif
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayTab.cxx b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayTab.cxx
new file mode 100644 (file)
index 0000000..a393da9
--- /dev/null
@@ -0,0 +1,104 @@
+#include "AliHLTPHOSOnlineDisplayTab.h"
+#include "HOMERReader.h"
+#include <iostream>
+#include "AliHLTDataTypes.h"
+
+
+using namespace std;
+
+
+AliHLTPHOSOnlineDisplayTab::AliHLTPHOSOnlineDisplayTab():fgSyncronize(kFALSE)
+{
+
+}
+
+AliHLTPHOSOnlineDisplayTab::~AliHLTPHOSOnlineDisplayTab()
+{
+
+}
+
+
+void 
+AliHLTPHOSOnlineDisplayTab::PrintBlockInfo(HOMERReader *homeReaderPtr, int i)
+{
+  char tmp1[9], tmp2[5];
+  memset( tmp1, 0, 9 );
+  memset( tmp2, 0, 5);
+  void *tmp11 = tmp1;
+  ULong64_t* tmp12 = (ULong64_t*)tmp11;
+  *tmp12 =homeReaderPtr->GetBlockDataType( i );
+  void *tmp21 = tmp2;
+  ULong_t* tmp22 = (ULong_t*)tmp21;
+  *tmp22 = homeReaderPtr->GetBlockDataOrigin( i );
+  cout << "Dataype for block:  "<< i<<"  is:  "<< tmp1<<tmp2 <<endl;
+}
+
+
+int 
+AliHLTPHOSOnlineDisplayTab::GetEventInfo(HOMERReader *homeReaderPtr, int i)
+{
+  int ret = 0;
+  ret =homeReaderPtr->ReadNextEvent();  
+  if( ret ) 
+    {
+      int ndx = homeReaderPtr->GetErrorConnectionNdx();
+      printf( "------------ TRY AGAIN --------------->Error reading event from source %d: %s (%d)\n", ndx, strerror(ret), ret );
+      cout << "HOMER getconncetioNdx  status = " << ndx << endl;
+      return -1; 
+    }
+  else
+    {
+      unsigned long blockCnt = homeReaderPtr->GetBlockCnt();
+      cout << "AliHLTPHOSOnlineDisplayEventTab::GetNextEvent:  blockCnt ="  << blockCnt <<endl;
+      return blockCnt;
+    }
+}
+
+
+int 
+AliHLTPHOSOnlineDisplayTab::DoGetNextEvent()
+{
+  HOMERReader* CurrentReaderPtr;
+  int ret = 0;
+  unsigned long ndx;
+  const AliHLTComponentBlockData* iter = NULL;   
+  Bool_t nextSwitch=kTRUE; 
+  int nLoops=0;
+
+  if(fgSyncronize == kTRUE)
+    {
+      nLoops = 1;
+    }
+  else
+    {
+      nLoops =  fgNHosts; 
+    }
+
+  for(int reader = 0; reader <  nLoops; reader ++)
+    {
+      if(fgSyncronize == kTRUE)
+       {
+         CurrentReaderPtr =fgHomerReaderPtr;
+       }
+      else
+       {
+         CurrentReaderPtr =fgHomerReadersPtr[reader];
+       }
+
+      ret = GetEventInfo(CurrentReaderPtr, reader);
+
+      if( ret < 0) 
+       {
+         return ret; 
+       }
+      else
+       {
+         unsigned long blockCnt = ret;
+         for ( unsigned long i = 0; i < blockCnt; i++ ) 
+           {
+             PrintBlockInfo(CurrentReaderPtr, i);
+           }
+         ReadBlockData(CurrentReaderPtr);
+       }
+    }
+}
diff --git a/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayTab.h b/HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayTab.h
new file mode 100644 (file)
index 0000000..0af695b
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef ALIHLTPHOSONLINEDISPLAYTAB_H
+#define ALIHLTPHOSONLINEDISPLAYTAB_H
+
+#include "TGTab.h"
+#include "HOMERReader.h"
+#include "AliHLTPHOSCommonDefs.h"
+
+class HOMERReader;
+
+
+class AliHLTPHOSOnlineDisplayTab : public TGTab
+{
+ public:
+  virtual ~AliHLTPHOSOnlineDisplayTab();
+  AliHLTPHOSOnlineDisplayTab();
+  virtual void InitDisplay(TGTab *tabPtr) = 0;
+  void PrintBlockInfo(HOMERReader *homeReaderPtr, int i);
+  int GetEventInfo(HOMERReader *homeReaderPtr, int i);
+  virtual void ReadBlockData(HOMERReader *homeReaderPtr) = 0;
+
+ protected:
+  Bool_t fgAccumulate;
+  Bool_t fgSyncronize;
+  HOMERReader* fgHomerReaderPtr;
+  HOMERReader* fgHomerReadersPtr[MAX_HOSTS];
+  int DoGetNextEvent();
+  int fgEvntCnt;
+  int fgNHosts;
+};
+
+
+#endif
index 4fe870c..eb5fd41 100755 (executable)
@@ -24,20 +24,35 @@ ALIHLTPHOSINCLUDE   =$(ALICE_ROOT)/HLT/PHOS
 
 ALIHLTINCLUDE  =$(ALICE_ROOT)/HLT/BASE
 
-MAINO          = main.$(ObjSuf)
-MAINS          = main.$(SrcSuf)
+MAINO                                  = main.$(ObjSuf)
+MAINS                                  = main.$(SrcSuf)
 
-ALIHLTPHOSONLINEDISPLAYO       =AliHLTPHOSGetEventButton.$(ObjSuf)
-ALIHLTPHOSONLINEDISPLAYS       =AliHLTPHOSGetEventButton.$(SrcSuf)
-ALIHLTPHOSONLINEDISPLAYH       =AliHLTPHOSGetEventButton.$(HeadSuf)
+GETEVENTBUTTONO                                =AliHLTPHOSGetEventButton.$(ObjSuf)
+GETEVENTBUTTONS                                =AliHLTPHOSGetEventButton.$(SrcSuf)
+GETEVENTBUTTONH                                =AliHLTPHOSGetEventButton.$(HeadSuf)
 
-GETEVENTBUTTONO        =AliHLTPHOSOnlineDisplay.$(ObjSuf)
-GETEVENTBUTTONS        =AliHLTPHOSOnlineDisplay.$(SrcSuf)
-GETEVENTBUTTONH        =AliHLTPHOSOnlineDisplay.$(HeadSuf)
+ALIHLTPHOSONLINEDISPLAYO               =AliHLTPHOSOnlineDisplay.$(ObjSuf)
+ALIHLTPHOSONLINEDISPLAYS               =AliHLTPHOSOnlineDisplay.$(SrcSuf)
+ALIHLTPHOSONLINEDISPLAYH               =AliHLTPHOSOnlineDisplay.$(HeadSuf)
 
+ALIHLTPHOSONLINEDISPLAYTABO            =AliHLTPHOSOnlineDisplayTab.$(ObjSuf)
+ALIHLTPHOSONLINEDISPLAYTABS            =AliHLTPHOSOnlineDisplayTab.$(SrcSuf)
+ALIHLTPHOSONLINEDISPLAYTABH            =AliHLTPHOSOnlineDisplayTab.$(HeadSuf)
 
-OBJS   = $(MAINO)  $(ALIHLTPHOSONLINEDISPLAYO) $(GETEVENTBUTTONO)
+ALIHLTPHOSONLINEDISPLAYEVENTTABO       =AliHLTPHOSOnlineDisplayEventTab.$(ObjSuf)
+ALIHLTPHOSONLINEDISPLAYEVENTTABS       =AliHLTPHOSOnlineDisplayEventTab.$(SrcSuf)
+ALIHLTPHOSONLINEDISPLAYEVENTTABH       =AliHLTPHOSOnlineDisplayEventTab.$(HeadSuf)
 
+ALIHLTPHOSONLINEDISPLAYRAWTABO         =AliHLTPHOSOnlineDisplayRawTab.$(ObjSuf)
+ALIHLTPHOSONLINEDISPLAYRAWTABS         =AliHLTPHOSOnlineDisplayRawTab.$(SrcSuf)
+ALIHLTPHOSONLINEDISPLAYRAWTABH         =AliHLTPHOSOnlineDisplayRawTab.$(HeadSuf)
+
+ALIHLTPHOSONLINEDISPLAYCALIBTABO       =AliHLTPHOSOnlineDisplayCalibTab.$(ObjSuf)
+ALIHLTPHOSONLINEDISPLAYCALIBTABS       =AliHLTPHOSOnlineDisplayCalibTab.$(SrcSuf)
+ALIHLTPHOSONLINEDISPLAYCALIBTABH       =AliHLTPHOSOnlineDisplayCalibTab.$(HeadSuf)
+
+OBJS   = $(MAINO)  $(ALIHLTPHOSONLINEDISPLAYO)  $(ALIHLTPHOSONLINEDISPLAYTABO) \
+       $(ALIHLTPHOSONLINEDISPLAYEVENTTABO) $(ALIHLTPHOSONLINEDISPLAYRAWTABO) $(ALIHLTPHOSONLINEDISPLAYCALIBTABO) $(GETEVENTBUTTONO)
 
 
 pftest:$(OBJS)
@@ -49,6 +64,18 @@ $(MAINO):$(MAINS)
 $(ALIHLTPHOSONLINEDISPLAYO):$(ALIHLTPHOSONLINEDISPLAYS) $(ALIHLTPHOSONLINEDISPLAYH)
        g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSONLINEDISPLAYS)
 
+$(ALIHLTPHOSONLINEDISPLAYTABO):$(ALIHLTPHOSONLINEDISPLAYTABS) $(ALIHLTPHOSONLINEDISPLAYTABH)
+       g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSONLINEDISPLAYTABS)
+
+$(ALIHLTPHOSONLINEDISPLAYEVENTTABO):$(ALIHLTPHOSONLINEDISPLAYEVENTTABS) $(ALIHLTPHOSONLINEDISPLAYEVENTTABH)
+       g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSONLINEDISPLAYEVENTTABS)
+
+$(ALIHLTPHOSONLINEDISPLAYRAWTABO):$(ALIHLTPHOSONLINEDISPLAYRAWTABS) $(ALIHLTPHOSONLINEDISPLAYRAWTABH)
+       g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSONLINEDISPLAYRAWTABS)
+
+$(ALIHLTPHOSONLINEDISPLAYCALIBTABO):$(ALIHLTPHOSONLINEDISPLAYCALIBTABS) $(ALIHLTPHOSONLINEDISPLAYCALIBTABH)
+       g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSONLINEDISPLAYCALIBTABS)
+
 $(GETEVENTBUTTONO):$(GETEVENTBUTTONS) $(GETEVENTBUTTONH)
        g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(GETEVENTBUTTONS)
 
index 890f6cf..f4f9b14 100644 (file)
 #include <TString.h>
 #endif
 
+#include <iostream>
+
+using namespace std;
 
 int
 main(int argc, char** argv) 
 {
-
-  //  AliHLTPHOSOnlineDisplay* onlineDisplay = new AliHLTPHOSOnlineDisplay("alice3", 42001); 
-  
-  if(!AliHLTPHOSOnlineDisplay::ScanArguments(argc, argv))
-  {
-    
-    try 
-      {
-       TApplication app("app", 0, 0);
-       //      AliHLTPHOSOnlineDisplay* phosDisplayPtr = new AliHLTPHOSOnlineDisplay();
-       //      AliHLTPHOSOnlineDisplay* phosDisplayPtr = AliHLTPHOSOnlineDisplay::Instance();
-       AliHLTPHOSOnlineDisplay::Instance();
-       app.Run();
-      }
-    
-    catch (std::exception& e)
-      {
-       //   std::cerr << e.what() << std::endl;
-       return 1;
-      }
-      return 0;
-  }
-    else
-      {
-       return -1;
-      }
+  try 
+    {
+      TApplication app("app", 0, 0);
+      AliHLTPHOSOnlineDisplay::Instance(argc, argv);
+      app.Run();
+    }
   
-}
+  catch (std::exception& e)
+    {
+      //   std::cerr << e.what() << std::endl;
+      return 1;
+    }
 
+  return 0;
+}