// 
// Adapted from similar file in  Gismo 2

// define the HEPEVT commom
#ifndef LCDREADROOTFILE_H
#define LCDREADROOTFILE_H

//#include <assert.h>
#include "TFile.h"
#include "TTree.h"
#include "LCDEventSource.h"

class LCDreadRootFile : public LCDEventSource {

public:
  LCDreadRootFile(Char_t* rootFileName, LCDEvent* event=0);  // constructor 
  ~LCDreadRootFile();

  Int_t GetEvent(LCDEvent* event);  // creates structure with next event

  Int_t GetEvent(Int_t ievt, LCDEvent* event=0);  
  // creates structure with given event #

  Int_t GetEventNumber()        { return m_nEvent; }
  void  SetEventNumber(Int_t a) { m_nEvent = a;    }

private:
  Char_t*    m_rootFileName;  // input Root filename
  TFile*     m_rootFile;      // Root TFile
  TTree*     T;               // Root TTree
  Bool_t     m_ownevent;
  
  Int_t      m_nEvent;  // current event number in file

public:
  ClassDef(LCDreadRootFile,0)

};

#endif

