![]() |
EventMixer 1.0
An event mixer for mixing events generated by PIBIDS.
|
Creates a pointer to a file, and reads events from that file. More...
#include <FileEventStream.hh>
Public Member Functions | |
FileEventStream (char *filename, int nTubes) | |
Constructor, constructs the FileEventStream. | |
~FileEventStream () | |
Destructor. | |
Event * | getNextEvent () |
Returns the next event from the file. | |
bool | hasMoreEvents () |
Returns the fileEmpty variable. | |
Private Attributes | |
FILE * | myFileStream |
The file stream that this object is connected to. Opened upon creation, closed upon destruction. | |
bool | fileEmpty |
True if file is now empty. If a getNextEvent() is called when this is true, a zero result will be returned. | |
int | upcomingEventID |
The ID of the event residing in the file. | |
int | NumberOfTubes |
Creates a pointer to a file, and reads events from that file.
Definition at line 37 of file FileEventStream.hh.
FileEventStream::FileEventStream | ( | char * | filename, |
int | nTubes | ||
) |
Constructor, constructs the FileEventStream.
filename | The file to read events from. |
nTubes | Number of scintillator tubes in detector. |
Definition at line 3 of file FileEventStream.cc.
References fileEmpty, myFileStream, and upcomingEventID.
:NumberOfTubes(nTubes) { myFileStream = fopen(filename,"r"); if(myFileStream==NULL) { fprintf (stderr,"Could not open input file %s, exiting.", filename); exit(1); } fileEmpty = false; fscanf(myFileStream,"%d",&upcomingEventID); //Read in the first event number, to make the event processing work. }