LDMX Software
|
Provides header information an event such as event number and timestamp. More...
#include <EventHeader.h>
Public Member Functions | |
EventHeader ()=default | |
Class constructor. | |
virtual | ~EventHeader ()=default |
Class destructor. | |
void | Clear (Option_t *o="") |
Clear information from this object. | |
void | Print (Option_t *o="") const |
Print this object. | |
int | getEventNumber () const |
Return the event number. | |
int | getRun () const |
Return the run number. | |
const TTimeStamp & | getTimestamp () const |
Get the event's timestamp. | |
double | getWeight () const |
Get the event weight (default of 1.0). | |
bool | isRealData () const |
Is this a real data event? | |
void | setRealData (bool yes=true) |
set whether this event is real or MC data | |
void | setEventNumber (int eventNumber) |
Set the event number. | |
void | setRun (int run) |
Set the run number. | |
void | setTimestamp (const TTimeStamp ×tamp) |
Set the timestamp. | |
void | setWeight (double weight) |
Set the event weight. | |
int | getIntParameter (const std::string &name) const |
Get an int parameter value. | |
void | setIntParameter (const std::string &name, int value) |
Set an int parameter value. | |
float | getFloatParameter (const std::string &name) const |
Get a float parameter value. | |
void | setFloatParameter (const std::string &name, float value) |
Set a float parameter value. | |
std::string | getStringParameter (const std::string &name) const |
Get a string parameter value. | |
void | setStringParameter (const std::string &name, std::string value) |
Set a string parameter value. | |
Static Public Attributes | |
static const std::string | BRANCH = "EventHeader" |
Name of EventHeader branch. | |
Protected Member Functions | |
ClassDef (EventHeader, 2) | |
ROOT class definition. | |
Protected Attributes | |
int | eventNumber_ {-1} |
The event number. | |
int | run_ {-1} |
The run number. | |
TTimeStamp | timestamp_ {0, 0} |
The event timestamp. | |
double | weight_ {1.0} |
The event weight. | |
bool | isRealData_ {false} |
Is this event real data? | |
std::map< std::string, int > | intParameters_ |
The int parameters. | |
std::map< std::string, float > | floatParameters_ |
The float parameters. | |
std::map< std::string, std::string > | stringParameters_ |
The string parameters. | |
Provides header information an event such as event number and timestamp.
The evolution of the EventHeader object has been pretty slow since the `*Parameter* members can be used to hold most additional information. ROOT's serialization infrastructure does define a class version and so we document the versions here.
This was the initial version of the EventHeader and should be considered a "beta" version. It is not even internally consistent in that some changes were made to the EventHeader and how it was serialized without modifying this version number. It has largely been lost to the sands of time as Framework has been moved into its own repository out of ldmx-sw.
This is the main version currently and has all of the ldmx-sw necessary information except the number of tries it took to generate any given event. This is what motivated the update to v3.
Definition at line 44 of file EventHeader.h.
void ldmx::EventHeader::Clear | ( | Option_t * | o = "" | ) |
Clear information from this object.
[in] | o | ROOT-style Option (ignored) |
Definition at line 11 of file EventHeader.cxx.
References eventNumber_, floatParameters_, intParameters_, isRealData_, run_, stringParameters_, timestamp_, and weight_.
|
inline |
Return the event number.
Definition at line 78 of file EventHeader.h.
References eventNumber_.
Referenced by framework::Conditions::getConditionPtr(), framework::Event::getEventNumber(), recon::OverlayProducer::produce(), simcore::Simulator::produce(), and trigscint::QIEDecoder::produce().
float ldmx::EventHeader::getFloatParameter | ( | const std::string & | name | ) | const |
Get a float parameter value.
Exception | if parameter does not exist |
name | The name of the parameter. |
Definition at line 41 of file EventHeader.cxx.
References floatParameters_.
int ldmx::EventHeader::getIntParameter | ( | const std::string & | name | ) | const |
Get an int parameter value.
Exception | if parameter does not exist |
name | The name of the parameter. |
Definition at line 33 of file EventHeader.cxx.
References intParameters_.
|
inline |
Return the run number.
Definition at line 84 of file EventHeader.h.
References run_.
Referenced by ecal::EcalDetectorMapLoader::getCondition(), ecal::EcalGeometryProvider::getCondition(), ecal::EcalTriggerGeometryProvider::getCondition(), framework::RandomNumberSeedService::getCondition(), hcal::HcalDetectorMapLoader::getCondition(), hcal::HcalGeometryProvider::getCondition(), hcal::HcalTriggerGeometryProvider::getCondition(), framework::Conditions::getConditionPtr(), framework::Process::getRunNumber(), framework::Process::run(), simcore::ReSimulator::skip(), and framework::ConditionsIOV::validForEvent().
std::string ldmx::EventHeader::getStringParameter | ( | const std::string & | name | ) | const |
Get a string parameter value.
Exception | if parameter does not exist |
name | The name of the parameter. |
Definition at line 49 of file EventHeader.cxx.
References stringParameters_.
|
inline |
Get the event's timestamp.
This currently returns second's since the epoch for simulated events.
Definition at line 92 of file EventHeader.h.
References timestamp_.
|
inline |
Get the event weight (default of 1.0).
Definition at line 98 of file EventHeader.h.
References weight_.
Referenced by framework::Event::getEventWeight(), and dqm::DarkBremInteraction::produce().
|
inline |
Is this a real data event?
Definition at line 104 of file EventHeader.h.
References isRealData_.
Referenced by framework::Conditions::getConditionPtr(), and framework::ConditionsIOV::validForEvent().
void ldmx::EventHeader::Print | ( | Option_t * | o = "" | ) | const |
Print this object.
[in] | o | ROOT-style Option (ignored) |
Definition at line 22 of file EventHeader.cxx.
References eventNumber_, isRealData_, run_, timestamp_, and weight_.
|
inline |
Set the event number.
eventNumber | The event number. |
Definition at line 120 of file EventHeader.h.
References eventNumber_.
Referenced by packing::rawdatafile::File::nextEvent(), recon::OverlayProducer::onNewRun(), and framework::Process::run().
|
inline |
Set a float parameter value.
name | The name of the parameter. |
Definition at line 185 of file EventHeader.h.
References floatParameters_.
|
inline |
Set an int parameter value.
name | The name of the parameter. |
value | The value of the parameter. |
Definition at line 168 of file EventHeader.h.
References intParameters_.
|
inline |
set whether this event is real or MC data
[in] | yes | True if this event is real data |
Definition at line 110 of file EventHeader.h.
References isRealData_.
|
inline |
Set the run number.
run | The run number. |
Definition at line 129 of file EventHeader.h.
References run_.
Referenced by framework::Process::run().
|
inline |
Set a string parameter value.
name | The name of the parameter. |
Definition at line 202 of file EventHeader.h.
References stringParameters_.
|
inline |
Set the timestamp.
timestamp | The timestamp. |
Definition at line 138 of file EventHeader.h.
References timestamp_.
Referenced by framework::Process::run().
|
inline |
Set the event weight.
The event weight is by default 1 for all events. It is up to a downstream producer to update the event weight if their procedure demands it (for example, a simulation producer would copy its event weight here).
weight | The event weight. |
Definition at line 152 of file EventHeader.h.
References weight_.
|
static |
Name of EventHeader branch.
Definition at line 49 of file EventHeader.h.
Referenced by framework::Event::add(), framework::Event::beforeFill(), framework::Event::getObject(), framework::Event::nextEvent(), and framework::Event::setInputTree().
|
protected |
The event number.
Definition at line 210 of file EventHeader.h.
Referenced by Clear(), getEventNumber(), Print(), and setEventNumber().
|
protected |
The float parameters.
Definition at line 240 of file EventHeader.h.
Referenced by Clear(), getFloatParameter(), and setFloatParameter().
|
protected |
The int parameters.
Definition at line 235 of file EventHeader.h.
Referenced by Clear(), getIntParameter(), and setIntParameter().
|
protected |
Is this event real data?
Definition at line 230 of file EventHeader.h.
Referenced by Clear(), isRealData(), Print(), and setRealData().
|
protected |
|
protected |
The string parameters.
Definition at line 245 of file EventHeader.h.
Referenced by Clear(), getStringParameter(), and setStringParameter().
|
protected |
The event timestamp.
Definition at line 220 of file EventHeader.h.
Referenced by Clear(), getTimestamp(), Print(), and setTimestamp().
|
protected |
The event weight.
Definition at line 225 of file EventHeader.h.
Referenced by Clear(), getWeight(), Print(), and setWeight().