// ---------------------------------------------------------------------------- // $Id: LCDreadStdFile.h,v 1.2 2001/06/19 03:53:16 toshi Exp $ // ---------------------------------------------------------------------------- // // $Log: LCDreadStdFile.h,v $ // Revision 1.2 2001/06/19 03:53:16 toshi // Changes to allow to open multiple files and to read them separetly. // These purpose is mainly to allow background overlay events. // // Revision 1.1 2001/05/10 22:06:06 toshi // File IO (stdHEP, SIO,...) utilities. // // // // Adapted from similar file in Gismo 2 // 31 Mar 1999 J. Bogart moved to Util (in libRootAppsUtil.so) // define the HEPEVT commom #ifndef LCDREADSTDFILE_H #define LCDREADSTDFILE_H //#include #include "LCDEventSource.h" extern "C"{ #include "stdhep.h" Double_t partchg( Int_t ); int StdHepXdrReadInit(char*, int, int); int StdHepXdrReadOpen(char*, int, int); int StdHepXdrRead(int*, int); int StdHepXdrReadMulti(int*, int); int StdHepXdrWriteInit(char*, char*, int, int); int StdHepXdrWriteOpen(char*, char*, int, int); int StdHepXdrWrite(int, int); int StdHepXdrWriteCM(int, int); int StdHepXdrWriteEvent(int, int); void StdHepXdrEnd(int); void StdHepZero(void); #include "stdlun.h" #include "stdcnt.h" } class LCDreadStdFile : public LCDEventSource { public: LCDreadStdFile(); // constructor. LCDreadStdFile(Char_t* stdfilename, LCDEvent* event=0); // constructor that reads from an open stream. ~LCDreadStdFile(); // deconstructor. void CleanHEPEVT() { StdHepZero(); } // Set the contents of the hepevt_ to 0. Int_t GetEvent(LCDEvent* event=0); // creates structure with next event. Int_t GetStdFileEntries() { return m_ninputfile; } // N of input files. Char_t* GetFileName(Int_t i); // input file name. Int_t MakeMcPart(LCDEvent* event=0,Int_t f_overlay=0); // creates structure with current event. if f_overlay is non zero, overlay read events. Int_t ReadEvent(Int_t ifile=0); // fill the common from input file. Int_t ReadEventMulti(Int_t ifile=0); // Read multiple input streams Int_t AddStdFile(Char_t* stdfilename); // Set StdHEP file name. private: Int_t m_ninputfile ; // N of input files (max 10). Char_t* m_inputfile[10]; // stdHEP file from which we read Int_t m_istr[10]; // index to array idxdrstr holding stream pointer Bool_t m_ownevent; // flag; is m_event created in this class? public: ClassDef(LCDreadStdFile,0) // Make McPart objects from info in stdHEP file }; #endif