saveViews extended to print trigger classes, displaying of logo fixed. Cleanup of...
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / alifakedisplay.cxx
index fac3f9f..53a7cb3 100644 (file)
@@ -3,9 +3,12 @@
 #include "AliESDEvent.h"
 #include "AliESDRun.h"
 
+#include "AliRawEventHeaderBase.h"
+
 #include <iostream>
 
 #include <TThread.h>
+#include <TFile.h>
 
 using namespace std;
 
@@ -43,16 +46,17 @@ int main(int argc, char **argv)
     storageSockets socket;
     AliStorageEventManager *manager = AliStorageEventManager::GetEventManagerInstance();
     AliESDEvent *event;
+    struct recPointsStruct *files;
     
     if(atoi(argv[1])==0)
     {
-        socket = EVENTS_SERVER_SUB;
-        manager->CreateSocket(socket);
+        manager->CreateSocket(EVENTS_SERVER_SUB);
+       manager->CreateSocket(ITS_POINTS_SUB);
         cout<<"Socket created"<<endl;
         while(1)
         {
             cout<<"waiting for event..."<<flush;
-            event = manager->GetEvent(socket);
+            event = manager->GetEvent(EVENTS_SERVER_SUB);
             
             if(event)
             {
@@ -61,17 +65,42 @@ int main(int argc, char **argv)
                 cout<<event->GetPeriodNumber()<<endl;
                 cout<<event->GetOrbitNumber()<<endl;
                 cout<<event->GetBunchCrossNumber()<<endl;
+                cout<<AliRawEventHeaderBase::GetTypeName(event->GetEventType())<<endl;
                 for(int i=0;i<100;i++)
                 {
                     if(strcmp(event->GetESDRun()->GetTriggerClass(i),"")){
                         cout<<event->GetESDRun()->GetTriggerClass(i)<<endl;}
                 }
-                delete event;
+                delete event;event=0;
             }
             else
             {
                 cout<<"NO EVENT"<<endl;
             }
+           
+           // Receiving RecPoints:
+           /*
+
+           files = manager->GetFiles(ITS_POINTS_SUB);
+
+       
+           cout<<"Received file."<<endl;
+
+           //file->Write("ITS.RecPoints.root",kOverwrite);
+           if(files->files[0]){files->files[0]->SaveAs("ITS.RecPoints.root","recreate");}
+           if(files->files[1]){files->files[1]->SaveAs("TOF.RecPoints.root","recreate");}
+           if(files->files[2]){files->files[2]->SaveAs("galice.root","recreate");}
+
+           for(int i=0;i<10;i++)
+           {
+           if(files->files[i])
+           {
+           files->files[i]->Close();
+           delete files->files[i];files->files[i]=0;
+           }
+           }   
+           sleep(2);
+           */
         }
     }
     else if(atoi(argv[1])==1)