// $Id: BrGeantInput.h,v 1.11 1998/07/17 02:20:07 hagel Exp $ // // $Log: BrGeantInput.h,v $ // Revision 1.11 1998/07/17 02:20:07 hagel // Modifications for byte swapping in BrGeantInput // // Revision 1.10 1998/06/21 20:11:04 hagel // cleanup // // Revision 1.9 1998/05/14 21:18:50 videbaek // update makefile - do not reload .so libraries // // Revision 1.8 1998/05/08 00:58:50 videbaek // TPC code updates // // Revision 1.7 1998/04/30 22:24:34 hagel // Add io.h include for WIN32 again // // Revision 1.6 1998/04/30 17:12:33 videbaek // Added functionality to BrGeantInput // // Revision 1.3 1998/04/08 18:09:23 videbaek // changed GeantInput class to use open,read // // Revision 1.2 1998/04/06 21:12:09 videbaek // Clean up and additions for Win95 // // Revision 1.1 1998/04/03 21:15:17 videbaek // part of first base release // // Revision 1.1.1.1 1998/03/04 21:33:10 brahmlib // Brat geant // // #ifndef _BRGEANTINPUT_H #define _BRGEANTINPUT_H /////////////////////////////////////////////////////////////////////// // // // BrGeantData // // // // BRAHMS simulated raw data class // // // // BrGeantInput read geant raw data in stream i/o format // // // the class is derived from the BrIOModule class // // // // Author : F.Videbaek // Created : March 98 // // Version : 1.0 // // Changed : // /////////////////////////////////////////////////////////////////////// #define USE_FSTREAM 0 #if USE_FSTREAM #include "fstream.h" #else #ifdef WIN32 #include "io.h" #endif #endif #include "stdio.h" #include "BrIOModule.h" #include "TObject.h" const int MAXGIVOLU = 30; class BrGeantHit; class BrGeantTrack; class BrEvent; struct GeantVol { int shape; int Npar; char Name[4]; float pos[3]; float rotang[3][3]; float param[12]; int Active; }; class BrGeantInput : public BrIOModule { public: BrGeantInput(); BrGeantInput(Char_t *filename); virtual ~BrGeantInput(); virtual Bool_t Open(Char_t *fname); virtual Bool_t Close(); virtual void Event(BrEvent* event); virtual Bool_t ReadStreamHeader(); virtual void SkipEvent(Int_t numevt); Int_t GetNumberOfVolumes(){return fNumberOfVolumes;} Bool_t GetrHeader() { return rHeader; } void SetrHeader( Bool_t rHead ) { rHeader = rHead; } void SwapLong(int *buffer,int nb); //Swap bytes on other endian private: Bool_t rHeader; //! Header read mark Bool_t fByteSwap; // Flag for ByteSwap Int_t fEventCounter; //! Event counter Char_t fFileName[256]; //! File name for ASCII file containing raw hits #if USE_FSTREAM ifstream *fFilePointer; // File pointer to STREAM file #else Int_t fFileDescriptor; // file descriptor #endif Int_t fNumberOfVolumes; //! Number of GEANT volumes GeantVol fVolume[MAXGIVOLU]; //! Geant Volumes in STREAM file public: ClassDef(BrGeantInput,0) // Interface to STREAM files }; #endif