]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/MUONTRKOCCda.cxx
Adding GetGeometryFromOCDB method
[u/mrichter/AliRoot.git] / MUON / MUONTRKOCCda.cxx
index 6e9d0d9f3d1a27066f78a0c1f59dfa0f7eb2aa23..026d2ad522746752b4765e844af4fabf23349beb 100644 (file)
@@ -51,6 +51,7 @@
 #include "daqDA.h"
 #include "event.h"
 #include "monitor.h"
+#include "signal.h"
 
 #ifdef ALI_AMORE
 #include <AmoreDA.h>
@@ -60,7 +61,7 @@
 #endif
 
 const char* OUTPUT_FILE = "mch.occupancy";
-const char* DAVERSION = "MUONTRKOCCda v1.2 ($Id$)";
+const char* DAVERSION = "MUONTRKOCCda v1.4 ($Id$)";
 
 //______________________________________________________________________________
 void Add(AliMUONVStore& destStore, const AliMUONVStore& srcStore)
@@ -144,6 +145,8 @@ int main(int argc, char **argv)
   /// were seen per manu, and the number of events.
   ///
   
+  signal(SIGSEGV,SIG_DFL); // to be able to get core dumps...
+  
   TStopwatch timers;
   timers.Start(kTRUE); 
   
@@ -201,7 +204,7 @@ int main(int argc, char **argv)
     
     for(;;)
     {
-      struct eventHeaderStruct *event;
+      struct eventHeaderStruct *event(0x0);
       eventTypeType eventT;
       
       status=monitorGetEventDynamic((void **)&event);
@@ -308,20 +311,23 @@ int main(int argc, char **argv)
   
 #ifdef ALI_AMORE
   
-  // Send occupancy store (as a big string) to the AMORE DB
-  amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
-  
-  ostringstream str;
-  
-  GenerateOutputFile(accumulatedData,str,runNumber,numberOfUsedEvents);
-    
-  TObjString occupancyAsString(str.str().c_str());
-  
-  Int_t status = amoreDA.Send("Occupancy",&occupancyAsString);
-  if ( status )
+  if ( numberOfUsedEvents ) // do not update the AMORE pool with an empty object...
   {
-    cerr << "ERROR : Failed to write occupancies in the AMORE database : " << status << endl;
-  } 
+    // Send occupancy store (as a big string) to the AMORE DB
+    amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
+    
+    ostringstream str;
+    
+    GenerateOutputFile(accumulatedData,str,runNumber,numberOfUsedEvents);
+    
+    TObjString occupancyAsString(str.str().c_str());
+    
+    Int_t status = amoreDA.Send("Occupancy",&occupancyAsString);
+    if ( status )
+    {
+      cerr << "ERROR : Failed to write occupancies in the AMORE database : " << status << endl;
+    } 
+  }
 
 #endif