Belle II Software light-2406-ragdoll
EventMetaData Class Reference

Store event, run, and experiment numbers. More...

#include <EventMetaData.h>

Inheritance diagram for EventMetaData:
Collaboration diagram for EventMetaData:

Public Types

enum  EventErrorFlag {
  c_B2LinkPacketCRCError = 0x1 ,
  c_B2LinkEventCRCError = 0x2 ,
  c_HLTCrash = 0x4 ,
  c_ReconstructionAbort = 0x8 ,
  c_HLTDiscard = 0x10
}
 bit-flag format of m_error_flag
More...
 

Public Member Functions

 EventMetaData (unsigned int event=1, int run=0, int experiment=0)
 Constructor.
 
 ~EventMetaData ()
 Destructor.
 
void setEvent (unsigned int event)
 Event Setter.
 
void setRun (int run)
 Run Setter.
 
void setSubrun (int subrun)
 Sub run Setter.
 
void setExperiment (int experiment)
 Experiment Setter.
 
void setProduction (int production)
 Production Setter.
 
void setTime (unsigned long long int time)
 Time Setter.
 
void setEndOfData ()
 Marks the end of the data processing.
 
void setEndOfRun (unsigned int experimentNumber, unsigned int runNumber)
 Marks the end of the current run.
 
bool isEndOfData () const
 is end-of-data set? (see setEndOfData()).
 
bool isEndOfRun () const
 is end-of-run set? (see setEndOfRun()).
 
void setParentLfn (const std::string &parent)
 Parent LFN Setter.
 
void setGeneratedWeight (double weight)
 Generated Weight Setter.
 
void setErrorFlag (unsigned int errorFlag)
 Set Error Flag.
 
void addErrorFlag (EventErrorFlag errorFlag)
 Add Error Flag.
 
unsigned int getErrorFlag () const
 Get error flag.
 
unsigned int getEvent () const
 Event Getter.
 
int getRun () const
 Run Getter.
 
int getSubrun () const
 Sub run Getter.
 
int getExperiment () const
 Experiment Getter.
 
int getProduction () const
 Production Getter.
 
unsigned long long int getTime () const
 Time Getter.
 
const std::string & getParentLfn () const
 Return LFN of the current parent file, or an empty string if not set.
 
double getGeneratedWeight () const
 Generated Weight Getter.
 
bool operator== (const EventMetaData &eventMetaData) const
 Comparison Operator.
 
bool operator!= (const EventMetaData &eventMetaData) const
 Comparison Operator.
 

Private Member Functions

 ClassDef (EventMetaData, 4)
 Store event number, run number, and experiment number.
 

Private Attributes

unsigned int m_event
 Event number ('normal' data has values > 0).
 
int m_run
 Run number (usually > 0, run-independent MC has run == 0).
 
int m_subrun
 Sub-run number, increases indicate recovery from DAQ-internal trouble without change to detector constants.
 
int m_experiment
 Experiment number.
 
int m_production
 Unique identifier of the production of the event.
 
unsigned long long int m_time
 Time in ns since epoch (1970-01-01).
 
std::string m_parentLfn
 LFN of the parent file.
 
double m_generatedWeight
 Generated weight.
 
unsigned int m_errorFlag
 Indicator of error conditions during data taking, ORed combination of EventErrorFlag values.
 

Detailed Description

Store event, run, and experiment numbers.

(see member variable doc for detailed description)

An object of this type is registered by e.g. EventInfoSetter for newly generated data, and updated with proper values for each event. Alternatively it can also be read from file.

This object is used for controlling the event-flow, e.g. via changing run-numbers or setEndOfData() (see also EventProcessor).

See BELLE2-NOTE-TE-2015-028: Event, File, and Dataset Metadata for a detailed definition. Available at: https://docs.belle2.org/record/287?ln=en

See also
EventInfoSetterModule, EventInfoPrinterModule

Definition at line 33 of file EventMetaData.h.

Member Enumeration Documentation

◆ EventErrorFlag

bit-flag format of m_error_flag

Enumerator
c_B2LinkPacketCRCError 

Belle2link CRC error is detected in the event.

c_B2LinkEventCRCError 

HSLB_COPPER CRC error is detected in the event.

c_HLTCrash 

The HLT reconstruction crashed in this event or the event before.

c_ReconstructionAbort 

The event was not reconstructed, e.g.

because of too high occupancy.

c_HLTDiscard 

The HLT discarded the event and only metadata is kept.

Definition at line 43 of file EventMetaData.h.

43 {
46 c_HLTCrash = 0x4,
48 c_HLTDiscard = 0x10,
49 };
@ c_B2LinkPacketCRCError
Belle2link CRC error is detected in the event.
Definition: EventMetaData.h:44
@ c_HLTCrash
The HLT reconstruction crashed in this event or the event before.
Definition: EventMetaData.h:46
@ c_ReconstructionAbort
The event was not reconstructed, e.g.
Definition: EventMetaData.h:47
@ c_B2LinkEventCRCError
HSLB_COPPER CRC error is detected in the event.
Definition: EventMetaData.h:45
@ c_HLTDiscard
The HLT discarded the event and only metadata is kept.
Definition: EventMetaData.h:48

Constructor & Destructor Documentation

◆ EventMetaData()

EventMetaData ( unsigned int  event = 1,
int  run = 0,
int  experiment = 0 
)
explicit

Constructor.

Definition at line 15 of file EventMetaData.cc.

15 :
16 m_event(event),
17 m_run(run),
18 m_subrun(0),
19 m_experiment(experiment),
20 m_production(0),
21 m_time(0),
22 m_parentLfn(""),
25{}
int m_subrun
Sub-run number, increases indicate recovery from DAQ-internal trouble without change to detector cons...
double m_generatedWeight
Generated weight.
std::string m_parentLfn
LFN of the parent file.
int m_production
Unique identifier of the production of the event.
unsigned long long int m_time
Time in ns since epoch (1970-01-01).
int m_experiment
Experiment number.
unsigned int m_event
Event number ('normal' data has values > 0).
unsigned int m_errorFlag
Indicator of error conditions during data taking, ORed combination of EventErrorFlag values.
int m_run
Run number (usually > 0, run-independent MC has run == 0).

◆ ~EventMetaData()

~EventMetaData ( )
inline

Destructor.

Definition at line 40 of file EventMetaData.h.

40{}

Member Function Documentation

◆ addErrorFlag()

void addErrorFlag ( EventErrorFlag  errorFlag)
inline

Add Error Flag.

Parameters
errorFlaga bit flag for an error event.

Definition at line 133 of file EventMetaData.h.

133{ m_errorFlag |= errorFlag; }

◆ getErrorFlag()

unsigned int getErrorFlag ( ) const
inline

Get error flag.

Returns
Error flag for this event.

Definition at line 139 of file EventMetaData.h.

139{ return m_errorFlag; }

◆ getEvent()

unsigned int getEvent ( ) const
inline

Event Getter.

Returns
The number of the current event.

Definition at line 145 of file EventMetaData.h.

145{ return m_event; }

◆ getExperiment()

int getExperiment ( ) const
inline

Experiment Getter.

Returns
The number of the current experiment.

Definition at line 164 of file EventMetaData.h.

164{ return m_experiment; }

◆ getGeneratedWeight()

double getGeneratedWeight ( ) const
inline

Generated Weight Getter.

Returns
The weight produced by the event generator

Definition at line 186 of file EventMetaData.h.

186{ return m_generatedWeight; }

◆ getParentLfn()

const std::string & getParentLfn ( ) const
inline

Return LFN of the current parent file, or an empty string if not set.

Definition at line 180 of file EventMetaData.h.

180{ return m_parentLfn; }

◆ getProduction()

int getProduction ( ) const
inline

Production Getter.

Returns
The number of the current production.

Definition at line 170 of file EventMetaData.h.

170{ return m_production; }

◆ getRun()

int getRun ( ) const
inline

Run Getter.

Returns
The number of the current run.

Definition at line 151 of file EventMetaData.h.

151{ return m_run; }

◆ getSubrun()

int getSubrun ( ) const
inline

Sub run Getter.

Returns
Sub-run number, increases indicate recovery from DAQ-internal trouble without change to detector constants. Not supposed to be used by offline analysis.

Definition at line 158 of file EventMetaData.h.

158{ return m_subrun; }

◆ getTime()

unsigned long long int getTime ( ) const
inline

Time Getter.

Returns
The time when the event was recorded.

Definition at line 176 of file EventMetaData.h.

176{ return m_time; }

◆ isEndOfData()

bool isEndOfData ( ) const

is end-of-data set? (see setEndOfData()).

Definition at line 34 of file EventMetaData.cc.

35{
36 return (m_event == UINT_MAX and m_run == INT_MAX and m_experiment == INT_MAX);
37}

◆ isEndOfRun()

bool isEndOfRun ( ) const

is end-of-run set? (see setEndOfRun()).

Definition at line 46 of file EventMetaData.cc.

47{
48 return not isEndOfData() and (m_event == UINT_MAX);
49}
bool isEndOfData() const
is end-of-data set? (see setEndOfData()).

◆ operator!=()

bool operator!= ( const EventMetaData eventMetaData) const
inline

Comparison Operator.

Parameters
eventMetaDataThe event meta data to compare with.
Returns
True if event, run, or experiment numbers are different

Definition at line 200 of file EventMetaData.h.

200{ return !(*this == eventMetaData); }

◆ operator==()

bool operator== ( const EventMetaData eventMetaData) const

Comparison Operator.

Parameters
eventMetaDataThe event meta data to compare with.
Returns
True if event, run, and experiment numbers are the same

Definition at line 51 of file EventMetaData.cc.

52{
53 return ((m_event == eventMetaData.getEvent()) &&
54 (m_run == eventMetaData.getRun()) &&
55 (m_experiment == eventMetaData.getExperiment()));
56}
int getRun() const
Run Getter.
unsigned int getEvent() const
Event Getter.
int getExperiment() const
Experiment Getter.

◆ setEndOfData()

void setEndOfData ( )

Marks the end of the data processing.

Can be used by any module to safely halt event processing. After this is set on StoreObjPtr<EventMetaData> and your event() function returns, no further modules in the path will be called and normal cleanup will be done (i.e. endRun(), terminate()).

Using this will produce a warning that your module stopped execution early, so you might want to add an explanatory message of your own.

Definition at line 27 of file EventMetaData.cc.

28{
29 m_event = UINT_MAX;
30 m_run = INT_MAX;
31 m_experiment = INT_MAX;
32}

◆ setEndOfRun()

void setEndOfRun ( unsigned int  experimentNumber,
unsigned int  runNumber 
)

Marks the end of the current run.

Is only used and understood in special HLT processing.

Can only be used by the first ZMQ input module.

Definition at line 39 of file EventMetaData.cc.

40{
41 m_event = UINT_MAX;
42 m_experiment = experimentNumber;
43 m_run = runNumber;
44}

◆ setErrorFlag()

void setErrorFlag ( unsigned int  errorFlag)
inline

Set Error Flag.

Parameters
errorFlaga bit flag for an error event.

Definition at line 127 of file EventMetaData.h.

127{ m_errorFlag = errorFlag; }

◆ setEvent()

void setEvent ( unsigned int  event)
inline

Event Setter.

Parameters
eventThe current event number.

Definition at line 55 of file EventMetaData.h.

55{ m_event = event; }

◆ setExperiment()

void setExperiment ( int  experiment)
inline

Experiment Setter.

Parameters
experimentThe number of the current experiment.

Definition at line 73 of file EventMetaData.h.

73{ m_experiment = experiment; }

◆ setGeneratedWeight()

void setGeneratedWeight ( double  weight)
inline

Generated Weight Setter.

Parameters
weightThe weight produced by the event generator

Definition at line 121 of file EventMetaData.h.

121{ m_generatedWeight = weight; }

◆ setParentLfn()

void setParentLfn ( const std::string &  parent)
inline

Parent LFN Setter.

Parameters
parentThe LFN of the current parent file.

Definition at line 115 of file EventMetaData.h.

115{ m_parentLfn = parent; }

◆ setProduction()

void setProduction ( int  production)
inline

Production Setter.

Parameters
productionThe integer identifier of the production.

Definition at line 79 of file EventMetaData.h.

79{ m_production = production; }

◆ setRun()

void setRun ( int  run)
inline

Run Setter.

Parameters
runThe number of the current run.

Definition at line 61 of file EventMetaData.h.

61{ m_run = run; }

◆ setSubrun()

void setSubrun ( int  subrun)
inline

Sub run Setter.

Parameters
subrunThe number of the current sub run.

Definition at line 67 of file EventMetaData.h.

67{ m_subrun = subrun; }

◆ setTime()

void setTime ( unsigned long long int  time)
inline

Time Setter.

Parameters
timeThe time when the event was recorded.

Definition at line 85 of file EventMetaData.h.

85{ m_time = time; }

Member Data Documentation

◆ m_errorFlag

unsigned int m_errorFlag
private

Indicator of error conditions during data taking, ORed combination of EventErrorFlag values.


Definition at line 213 of file EventMetaData.h.

◆ m_event

unsigned int m_event
private

Event number ('normal' data has values > 0).


Definition at line 204 of file EventMetaData.h.

◆ m_experiment

int m_experiment
private

Experiment number.

(valid values: [0, 1023], run-independent MC has exp == 0)

Definition at line 207 of file EventMetaData.h.

◆ m_generatedWeight

double m_generatedWeight
private

Generated weight.


Definition at line 212 of file EventMetaData.h.

◆ m_parentLfn

std::string m_parentLfn
private

LFN of the parent file.

Definition at line 211 of file EventMetaData.h.

◆ m_production

int m_production
private

Unique identifier of the production of the event.


Definition at line 209 of file EventMetaData.h.

◆ m_run

int m_run
private

Run number (usually > 0, run-independent MC has run == 0).


Definition at line 205 of file EventMetaData.h.

◆ m_subrun

int m_subrun
private

Sub-run number, increases indicate recovery from DAQ-internal trouble without change to detector constants.

Not supposed to be used by offline analysis.

Definition at line 206 of file EventMetaData.h.

◆ m_time

unsigned long long int m_time
private

Time in ns since epoch (1970-01-01).


Definition at line 210 of file EventMetaData.h.


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