EventMixer 1.0
An event mixer for mixing events generated by PIBIDS.
Public Member Functions | Private Attributes
FileEventStream Class Reference

Creates a pointer to a file, and reads events from that file. More...

#include <FileEventStream.hh>

List of all members.

Public Member Functions

 FileEventStream (char *filename, int nTubes)
 Constructor, constructs the FileEventStream.
 ~FileEventStream ()
 Destructor.
EventgetNextEvent ()
 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

Detailed Description

Creates a pointer to a file, and reads events from that file.

Definition at line 37 of file FileEventStream.hh.


Constructor & Destructor Documentation

FileEventStream::FileEventStream ( char *  filename,
int  nTubes 
)

Constructor, constructs the FileEventStream.

Parameters:
filenameThe file to read events from.
nTubesNumber 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.
}

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines

Back to the main page of the Precalibrated Ion Beam Identification Detector project

Created by Rikard Lundmark