]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MONITOR/alistoragemanager/alifakedisplay.cxx
temporary fix of broken compilation when DATE is insalled
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / alifakedisplay.cxx
index 7d556df2a303579c6e2ffe1420bd6d168aa612e3..5d89339151c4b20a139db9fde54b3e3a07806052 100644 (file)
@@ -20,7 +20,7 @@ using namespace std;
 // global variables:
 AliESDEvent *currentEvent[2];
 TTree *currentTree[2];
-TMutex mutex;
+TMutex myMutex;
 int eventInUse=1;
 int writingToEventIndex=0;
 bool isNewEventAvaliable=false;
@@ -47,9 +47,12 @@ int main(int argc, char **argv)
        {
                socket = EVENTS_SERVER_SUB;
                manager->CreateSocket(socket);
+               cout<<"Socket created"<<endl;
                while(1)
                {
+                 cout<<"waiting for event..."<<flush;
                        event = manager->GetEvent(socket);
+                       
                        if(event)
                        {
                                cout<<"Received event. Run:"<<event->GetRunNumber()<<"\t event:"<<event->GetEventNumberInFile()<<endl;
@@ -107,7 +110,7 @@ int main(int argc, char **argv)
             if(isNewEventAvaliable)
             {
               cout<<"new event"<<endl;
-              mutex.Lock();
+              myMutex.Lock();
               if(writingToEventIndex == 0) eventInUse = 0;
               else if(writingToEventIndex == 1) eventInUse = 1;
               cout<<"Using:"<<eventInUse<<endl;
@@ -120,7 +123,7 @@ int main(int argc, char **argv)
                 }
               }
               isNewEventAvaliable = false;
-              mutex.UnLock();
+              myMutex.UnLock();
             }
             else{cout<<"No new event is avaliable."<<endl;}
 
@@ -141,32 +144,28 @@ void* GetNextEvent(void*)
   currentTree[0]=0;
   currentTree[1]=0;
   AliESDEvent *tmpEvent;
-  TTree *tmpTree = NULL;
   
   while(1)
   {
     //if(tmpEvent){delete tmpEvent;tmpEvent=0;}
-    tmpEvent = eventManager->GetEvent(EVENTS_SERVER_SUB,-1,&tmpTree);
+    tmpEvent = eventManager->GetEvent(EVENTS_SERVER_SUB);
 
     if(tmpEvent)
     {
       if(tmpEvent->GetRunNumber()>=0)
       {
-        mutex.Lock();
+        myMutex.Lock();
         if(eventInUse == 0){writingToEventIndex = 1;}
         else if(eventInUse == 1){writingToEventIndex = 0;}
-        cout<<"Writing to:"<<writingToEventIndex<<endl;
+
         if(currentEvent[writingToEventIndex])
         {
-          cout<<"DELETING:"<<currentEvent[writingToEventIndex]<<endl;
           delete currentEvent[writingToEventIndex];
           currentEvent[writingToEventIndex]=0;
-          delete currentTree[writingToEventIndex];
         }
         currentEvent[writingToEventIndex] = tmpEvent;
-        currentTree[writingToEventIndex] = tmpTree;
         isNewEventAvaliable = true;
-        mutex.UnLock();
+        myMutex.UnLock();
       }
     }  
   }