// -*- mode: c++ -*- #ifndef BRAT_BrGeantInput #define BRAT_BrGeantInput // $Id: BrGeantInput.h,v 1.3 2001/08/12 09:45:55 cholm Exp $ // /////////////////////////////////////////////////////////////////////// // // // 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 #ifndef __CINT__ #include "io.h" #endif #endif #endif #include "stdio.h" #ifndef BRAT_BrIOModule #include "BrIOModule.h" #endif #ifndef ROOT_TObject #include "TObject.h" #endif const int MAXGIVOLU = 50; 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; //Make sure this stays last in this struct!!! }; struct GeantEventHeader{ int NevUsr; int NevPar; int RunNumber; float VertexPos; float ImpactParameter; }; class BrGeantInput : public BrIOModule { public: BrGeantInput(); BrGeantInput(const Char_t *name, const Char_t* title=0); virtual ~BrGeantInput(); virtual Bool_t Open(const Char_t *fname, const Option_t *option=""); virtual Bool_t Close(); virtual void Event(BrEvent* event); virtual Bool_t ReadStreamHeader(); virtual void SkipEvent(Int_t numevt); virtual void Print(Option_t* option="B") const; 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 void SetFillHitList(Bool_t b) { fFillHitList = b; } UInt_t GetDetectorBit(const Text_t *name) const; void ListDetectors(UInt_t bits) const; Bool_t TryRepair(){return fRepair;} private: void OutStatus(); private: Bool_t fRepair; //| Repair in progress flag Bool_t rHeader; //! Header read mark Bool_t fByteSwap; // Flag for ByteSwap Int_t fEventCounter; //! Event counter #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 Bool_t fFillHitList; // Flag for Event to fill hit list of tracks Int_t fVersion; //! Version number for cdat file. Int_t fEndOfStreamEvent; //! Actual end of stream(event) tag. public: ClassDef(BrGeantInput,0) // Interface to STREAM files }; #endif ///////////////////////////////////////////////////////////////////////// // // $Log: BrGeantInput.h,v $ // Revision 1.3 2001/08/12 09:45:55 cholm // Changed the prototype of the constructor to be compliant with // BrModule. // // Revision 1.2 2001/06/22 11:21:23 cholm // Pretty-indent change // // Revision 1.1.1.1 2001/06/21 14:55:08 hagel // Initial revision of brat2 // // Revision 1.25 2001/03/07 12:19:01 cholm // * Made the method BrModule::Info() const obsolete in favour of // BrModule::Print(Option_t* option="B") const. // // Revision 1.24 2000/09/21 20:46:33 cholm // On Windoze, io.h isn't know by rootcint, so conditional inclusion on // preprocessor symbol __CINT__ // // Revision 1.23 2000/08/29 16:25:07 videbaek // Add track pointer (dummy yet) // // Revision 1.22 2000/06/28 09:03:20 hagel // Added const to various char's in BrGeantInput // // Revision 1.21 2000/06/03 22:21:05 videbaek // please check revision diff // CVpelling mistake ---------------------------------------------------------------------- // // Revision 1.20 2000/04/06 20:19:58 cholm // Added the class BrGeantDigitize, which is a full-blown // GBRAHMS digitizer // // Revision 1.19 2000/01/18 19:37:29 videbaek // increase number of possible geant volumes to 50 // // Revision 1.18 2000/01/18 18:37:42 videbaek // Added derived Info() method. // // Revision 1.17 1999/02/11 22:27:26 hagel // Changes to make run on Solaris // // Revision 1.16 1999/01/21 23:23:23 hagel // 1. Changed convention for checking includes. Current convention is: // BRAT_Br...... eg BRAT_BrModule ala ROOT. // 2. Added CVS logs to .h files that didn't have them. // 3. Moved checking of include definition to first line for easier reading // 4. Put checks before all includes in the include files as per BRAT specifications // 5. Added BrGeantHeader to Geant Makefile // 6. All changes have been checked to compile on NT ala Cygnus // // Revision 1.15 1998/11/13 19:39:20 videbaek // Added data members for handling different versions of cdat files // // Revision 1.14 1998/09/27 17:07:16 alv // added member functions GetDetectorBit and ListDetectors. // // Revision 1.13 1998/09/22 19:59:33 videbaek // Added TryRepair() boolean function. // This is used to indicate that logically bad record has been found // as observed in several .cdat files. After a while the events become // proper again. // // Revision 1.12 1998/09/16 20:10:36 alv // Added flag fFillHitList. // Added parameter option (default value "") to Open(name,option) in order to // have the same number of parameters as BrEventIO::Open. // // 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 // //