]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliMDC.cxx
New class AliFigure (Jochen)
[u/mrichter/AliRoot.git] / RAW / AliMDC.cxx
index f5a2eeb93a97be059528585eab48bedbde5b2597..869948a78e2b3b99950f64151dbf338de0d3c789 100644 (file)
@@ -51,7 +51,6 @@
 #include <TStopwatch.h>
 #include <TPluginManager.h>
 #include <TBufferFile.h>
-#include <TProcessID.h>
 
 #include <sys/uio.h>
 #ifdef USE_EB
@@ -246,12 +245,10 @@ Int_t AliMDC::ProcessEvent(void* event, Bool_t isIovecArray)
 // The return value is the number of written bytes or an error code
   const Long64_t kFileSizeErrorLevel   = 19000000000LL;
 
-  Int_t objectNumber = TProcessID::GetObjectCount();
-
   Long64_t currentFileSize = GetTotalSize();
   //  AliDebug(1,Form("current file size is %lld bytes",currentFileSize));
   if(currentFileSize > kFileSizeErrorLevel) {
-    Error("ProcessEvent", "file size (%lu) exceeds the limit "
+    Error("ProcessEvent", "file size (%lld) exceeds the limit "
          , currentFileSize);
     return kErrFileSize;
   }
@@ -401,8 +398,6 @@ Int_t AliMDC::ProcessEvent(void* event, Bool_t isIovecArray)
   // Store raw event in tree
   Int_t nBytes = fRawDB->Fill();
 
-  TProcessID::SetObjectCount(objectNumber);
-
   // Fill the event tag object
   fEventTag->SetHeader(header);
   fEventTag->SetGUID(fRawDB->GetDB()->GetUUID().AsString());
@@ -514,8 +509,10 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
   // Create new raw DB.
   if (fRawDB) Close();
 
-  if (Open(mode,NULL,maxFileSize,fs1,fs2) < 0) return 1;
-
+  if (Open(mode,NULL,maxFileSize,fs1,fs2) < 0) {
+    if (fd>-1) close(fd);
+    return 1;
+  }
   // Process input stream
 #ifdef USE_EB
   Int_t eorFlag = 0;
@@ -570,6 +567,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
            Error("Run", "error reading base header");
            Close();
            delete[] event;
+           if (fd>-1) close(fd);
            return 1;
          }
        }
@@ -598,6 +596,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
          Close();
          delete[] event;
          delete hdr;
+         if (fd>-1) close(fd);
          return 1;
        }
       }
@@ -617,6 +616,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
        Close();
        delete[] event;
        delete hdr;
+       if (fd>-1) close(fd);
        return 1;
       }
     }
@@ -647,6 +647,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
          Close();
          if (inputFile) delete[] event;
          delete hdr;
+         if (fd>-1) close(fd);
          return 1;
        }
 
@@ -699,7 +700,7 @@ Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
 #endif
   } else {
     // Close input source
-    close(fd);
+    if (fd>-1) close(fd);
     delete [] event;
   }