fire v0.19.0
Framework for sImulation and Reconstruction of Events
fire::EventHeader Class Reference

Header information of an event such as event number and timestamp. More...

#include <EventHeader.h>

Collaboration diagram for fire::EventHeader:
[legend]

Public Member Functions

int getEventNumber () const
 Return the event number. More...
 
int number () const
 Return the event number. More...
 
int getRun () const
 Return the run number. More...
 
int run () const
 Return the run number. More...
 
double getWeight () const
 Get the event weight (default of 1.0). More...
 
double weight () const
 Get the event weight (default of 1.0). More...
 
bool isRealData () const
 Is this a real data event? More...
 
void setEventNumber (int number)
 Set the event number. More...
 
void setRun (int run)
 Set the run number. More...
 
void setTimestamp ()
 Set the timestamp. More...
 
void setWeight (double weight)
 Set the event weight. More...
 
void clear ()
 clear the event header, required by serialization technique
 
template<typename ParameterType >
const ParameterType & get (const std::string &name) const
 get a parameter from storage More...
 
template<typename ParameterType >
void set (const std::string &name, const ParameterType &val)
 set a parameter in storage More...
 

Static Public Attributes

static const std::string NAME
 Name of EventHeader branch. More...
 

Private Member Functions

template<typename DataSet >
void attach (DataSet &d)
 attach to the serializing h5::Data wrapper More...
 

Private Attributes

int eventNumber_ {-1}
 The event number.
 
int run_ {-1}
 The run number.
 
long int time_
 The event timestamp.
 
double weight_ {1.0}
 The event weight.
 
bool isRealData_ {false}
 Is this event real data?
 
fire::io::ParameterStorage parameters_
 Event parameters three types of parameters are allowed: int, float, string.
 

Friends

class fire::io::access
 allow data set access for reading/writing
 
std::ostreamoperator<< (std::ostream &s, const EventHeader &eh)
 Stream an event header. More...
 

Detailed Description

Header information of an event such as event number and timestamp.

Member Function Documentation

◆ attach()

template<typename DataSet >
void fire::EventHeader::attach ( DataSet &  d)
inlineprivate

attach to the serializing h5::Data wrapper

We use h5::constants::NUMBER_NAME so that the serialization method can deduce the number of events in a file using the size of our eventNumber_ dataset.

Parameters
[in]dh5::Data to attach to

◆ get()

template<typename ParameterType >
const ParameterType & fire::EventHeader::get ( const std::string name) const
inline

get a parameter from storage

See also
h5::ParameterStorage::get
Template Parameters
ParameterTypetype of parameter
Parameters
[in]nameparameter name
Returns
parameter value

◆ getEventNumber()

int fire::EventHeader::getEventNumber ( ) const
inline

Return the event number.

Returns
The event number.

◆ getRun()

int fire::EventHeader::getRun ( ) const
inline

Return the run number.

Returns
The run number.

◆ getWeight()

double fire::EventHeader::getWeight ( ) const
inline

Get the event weight (default of 1.0).

Returns
The event weight.

◆ isRealData()

bool fire::EventHeader::isRealData ( ) const
inline

Is this a real data event?

Returns
True if this is a real data event.

◆ number()

int fire::EventHeader::number ( ) const
inline

Return the event number.

Returns
The event number.

◆ run()

int fire::EventHeader::run ( ) const
inline

Return the run number.

Returns
The run number.

◆ set()

template<typename ParameterType >
void fire::EventHeader::set ( const std::string name,
const ParameterType &  val 
)
inline

set a parameter in storage

See also
h5::ParameterStorage::set
Template Parameters
ParameterTypetype of parameter
Parameters
[in]nameparameter name
[in]valparameter value

◆ setEventNumber()

void fire::EventHeader::setEventNumber ( int  number)
inline

Set the event number.

Parameters
numberThe event number.

◆ setRun()

void fire::EventHeader::setRun ( int  run)
inline

Set the run number.

Parameters
runThe run number.

◆ setTimestamp()

void fire::EventHeader::setTimestamp ( )
inline

Set the timestamp.

Parameters
timestampThe timestamp.

◆ setWeight()

void fire::EventHeader::setWeight ( double  weight)
inline

Set the event weight.

Parameters
weightThe event weight.

◆ weight()

double fire::EventHeader::weight ( ) const
inline

Get the event weight (default of 1.0).

Returns
The event weight.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream s,
const EventHeader eh 
)
friend

Stream an event header.

Streaming the header only involves printing the information we know exists for all event headers (i.e. everything not in ParameterStorage).

Parameters
[in]sostream to write to
[in]ehheader to stream out
Returns
modified ostream

Member Data Documentation

◆ NAME

const std::string fire::EventHeader::NAME
static
Initial value:
static const std::string EVENT_GROUP
the name of the group in the file holding all event objects
Definition: Constants.h:22
static const std::string EVENT_HEADER_NAME
the name of the event header data set
Definition: Constants.h:18

Name of EventHeader branch.

Defined in fire::h5 so that the serialization method knows where to look for the number of events in a file.


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