]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliStream.h
Bug fix. Removed delete statement
[u/mrichter/AliRoot.git] / STEER / AliStream.h
index 215c7b54b4d32edc0b87f6f32c57aa969373dba5..f67d1c88962e2cdebee15198ca68be755269b73f 100644 (file)
@@ -8,48 +8,54 @@
 ////////////////////////////////////////////////////////////////////////
 //
 //  Class to handle files on IO
-//                  
+//  Handles files and returns serial event number                  
 //  Author: Jiri Chudoba (CERN), 2001
 //
 ////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
-#include "TNamed.h"
-#include "TObjArray.h"
-#include "TString.h"
+#include <TNamed.h>
 
+// --- AliRoot header files ---
+class TObjArray;
 class TFile;
 
-// --- AliRoot header files ---
+class TString;
 
 class AliStream: public TNamed {
 
 public:
   AliStream();
-  AliStream(Option_t *option);
-  AliStream(const AliStream& str);
-  AliStream & operator=(const AliStream& str
-    {str.Copy(*this); return (*this);}
+  AliStream(const char* foldername, Option_t *optioneventfoldername);
+  AliStream(const AliStream &as);
+  AliStream & operator = (const AliStream & as
+    {as.Copy(*this); return *this;}
   virtual ~AliStream();
-  void AddFile(const char *fileName);
-  Bool_t NextEventInStream(Int_t &eventNr);
-  Bool_t OpenNextFile();
-  Bool_t ImportgAlice();
-  TFile* CurrentFile() { return fCurrentFile;}
-  void ChangeMode(Option_t* option);     // reset READ or UPDATE mode
-  Int_t GetNInputFiles() const {return fFileNames->GetLast()+1;}          
-  TString GetFileName(const Int_t order) const; 
-  
+
+  void       AddFile(const char *fileName);
+  Bool_t     NextEventInStream();
+  Bool_t     OpenNextFile();//returns kFALSE in case of failure
+  Bool_t     ImportgAlice();
+  void       ChangeMode(Option_t* option);     // reset READ or UPDATE mode
+  const TString& GetFolderName() const{return fEventFolderName;}
+  Int_t GetNInputFiles() const {return fFileNames->GetLast()+1;}
+  TString GetFileName(Int_t order) const;
+  void SetFolderName(const TString name) { fEventFolderName = name ; }
+  Int_t GetCurrentEventNumber() const { return fLastEventSerialNr ; }
+    
 private:  
-  void Copy(AliStream& str) const;
-
-  Int_t fLastEventSerialNr;     // Serial number of the last event
-  Int_t fLastEventNr;           // Number of the last event
-  Int_t fCurrentFileIndex;      // Index of the current file
-  Int_t fEvents;                //! nr. of events in the current file
-  TString fMode;                // = 0 for READONLY, = 1 for READWRITE
-  TFile *fCurrentFile;          //! pointer to current open file
-  TObjArray * fFileNames;       // storage for TStrings with file names
+
+  void Copy(TObject & as) const;
+
+  Int_t      fLastEventSerialNr;     // Serial number of last event
+  Int_t      fLastEventNr;           // Number of last event
+  Int_t      fCurrentFileIndex;      // Index of current file
+  Int_t      fEvents;                //! nr. of events in the current file
+  TString    fMode;                  // = 0 for READONLY, = 1 for READWRITE
+  TObjArray* fFileNames;             // List of file names
+  
+  TString fEventFolderName; //Name of the folder where data for this stram will be mounted
   
   ClassDef(AliStream,1)
 };