Belle II Software  release-08-01-10
EventExtraInfo Class Reference

Class to stores ExtraInfo of the whole event. More...

#include <EventExtraInfo.h>

Inheritance diagram for EventExtraInfo:
Collaboration diagram for EventExtraInfo:

Public Member Functions

float getExtraInfo (const std::string &name) const
 Return given value if set. More...
 
bool hasExtraInfo (const std::string &name) const
 Return whether the extra info with the given name is set.
 
void removeExtraInfo ()
 Removes extra info from event.
 
void addExtraInfo (const std::string &name, float value)
 Sets the user-defined data of given name to the given value. More...
 
void setExtraInfo (const std::string &name, float value)
 Sets the user-defined data of given name to the given value. More...
 
std::string getInfoHTML () const
 Return a short summary of this object's contents in HTML format.
 
std::vector< std::string > getNames () const
 Grab the names in this event extra info (for printing etc)
 
std::string getExtraStringInfo (const std::string &name) const
 Return given value if set. More...
 
bool hasExtraStringInfo (const std::string &name) const
 Return whether the extra string info with the given name is set.
 
void removeExtraStringInfo ()
 Removes extra string info from event.
 
void addExtraStringInfo (const std::string &name, const std::string &value)
 Sets the user-defined data of given name to the given value. More...
 
void setExtraStringInfo (const std::string &name, const std::string &value)
 Sets the user-defined data of given name to the given value. More...
 
std::vector< std::string > getStringInfoNames () const
 Grab the names in this event extra string info (for printing etc)
 
void addEventTypeIfNotSet (const std::string &eventType)
 Add the event type information if it is not already set. More...
 
std::string getEventType () const
 Get the event type information. More...
 

Private Member Functions

 ClassDef (EventExtraInfo, 3)
 Class to store event extra info.
 

Private Attributes

std::map< std::string, float > eventExtraInfo
 map variable names to values.
 
std::map< std::string, std::string > eventExtraStringInfo
 map variable names to values for string data type.
 

Detailed Description

Class to stores ExtraInfo of the whole event.

Used by TMVAExpert to save expert output for a event-level training

Definition at line 25 of file EventExtraInfo.h.

Member Function Documentation

◆ addEventTypeIfNotSet()

void addEventTypeIfNotSet ( const std::string &  eventType)
inline

Add the event type information if it is not already set.

Helper function for the GeneratorBaseModule.

Event type may already be set if there are multiple generator calls with subsequent selection of generated events by another module.

Definition at line 90 of file EventExtraInfo.h.

91  {
96  if (!hasExtraStringInfo("eventType"))
97  addExtraStringInfo(std::string("eventType"), eventType);
98  };
bool hasExtraStringInfo(const std::string &name) const
Return whether the extra string info with the given name is set.
void addExtraStringInfo(const std::string &name, const std::string &value)
Sets the user-defined data of given name to the given value.

◆ addExtraInfo()

void addExtraInfo ( const std::string &  name,
float  value 
)

Sets the user-defined data of given name to the given value.

throws std::out_of_range if variable is already set.

Definition at line 34 of file EventExtraInfo.cc.

35 {
36  if (hasExtraInfo(name)) {
37  throw std::out_of_range(std::string("Key with name ") + name + " already exists in EventExtraInfo.");
38  }
39  eventExtraInfo[name] = value;
40 }
std::map< std::string, float > eventExtraInfo
map variable names to values.
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.

◆ addExtraStringInfo()

void addExtraStringInfo ( const std::string &  name,
const std::string &  value 
)

Sets the user-defined data of given name to the given value.

throws std::out_of_range if variable is already set.

Definition at line 84 of file EventExtraInfo.cc.

◆ getEventType()

std::string getEventType ( ) const

Get the event type information.

Helper function for the VariablesToNtupleModule

Definition at line 105 of file EventExtraInfo.cc.

◆ getExtraInfo()

float getExtraInfo ( const std::string &  name) const

Return given value if set.

throws std::out_of_range if variable is not set.

Definition at line 16 of file EventExtraInfo.cc.

◆ getExtraStringInfo()

std::string getExtraStringInfo ( const std::string &  name) const

Return given value if set.

throws std::out_of_range if variable is not set.

Definition at line 66 of file EventExtraInfo.cc.

◆ setExtraInfo()

void setExtraInfo ( const std::string &  name,
float  value 
)

Sets the user-defined data of given name to the given value.

Does not throw anything if the value is already set. Overrides existing values

Definition at line 42 of file EventExtraInfo.cc.

◆ setExtraStringInfo()

void setExtraStringInfo ( const std::string &  name,
const std::string &  value 
)

Sets the user-defined data of given name to the given value.

Does not throw anything if the value is already set. Overrides existing values

Definition at line 92 of file EventExtraInfo.cc.


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