LDMX Software
trigger::DiscreteInputs Class Reference

Public Member Functions

 DiscreteInputs (const char *fileName)
 
bool nextEvent ()
 
const EventDump & event ()
 

Private Attributes

FILE * file_
 
EventDump event_
 

Detailed Description

Definition at line 31 of file DiscreteInputs_IO.h.

Constructor & Destructor Documentation

◆ DiscreteInputs()

trigger::DiscreteInputs::DiscreteInputs ( const char * fileName)
inline

Definition at line 33 of file DiscreteInputs_IO.h.

33 : file_(fopen(fileName, "rb")) {
34 if (!file_) {
35 std::cout << "ERROR: cannot read '" << fileName << "'" << std::endl;
36 }
37 assert(file_);
38 }

◆ ~DiscreteInputs()

trigger::DiscreteInputs::~DiscreteInputs ( )
inline

Definition at line 39 of file DiscreteInputs_IO.h.

39{ fclose(file_); }

Member Function Documentation

◆ event()

const EventDump & trigger::DiscreteInputs::event ( )
inline

Definition at line 48 of file DiscreteInputs_IO.h.

48{ return event_; }

◆ nextEvent()

bool trigger::DiscreteInputs::nextEvent ( )
inline

Definition at line 41 of file DiscreteInputs_IO.h.

41 {
42 if (feof(file_)) return false;
43 if (!event_.readFromFile(file_)) return false;
44 printf("Beginning of event %lu (%lu TPs) \n", event_.event_,
45 event_.ecal_tps_.size());
46 return true;
47 }

Member Data Documentation

◆ event_

EventDump trigger::DiscreteInputs::event_
private

Definition at line 52 of file DiscreteInputs_IO.h.

◆ file_

FILE* trigger::DiscreteInputs::file_
private

Definition at line 51 of file DiscreteInputs_IO.h.


The documentation for this class was generated from the following file: