hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
EventBus Class Reference

#include <PreselectAndCategorize.h>

Classes

struct  auto_clearable
struct  auto_clearable< std::vector< U > >

Public Member Functions

bool has (const std::string &name)
void clear_outputs ()
template<typename BaggageType>
void board_input (TTree *tree, const std::string &name)
template<typename BaggageType>
void board_output (TTree *tree, const std::string &name)
template<typename BaggageType>
const BaggageType & get (const std::string &name)
template<typename BaggageType>
void set (const std::string &name, const BaggageType &obj)

Private Attributes

framework::Bus bus_
std::vector< std::string > clearable_output_names_
 names of the output passengers that are safe to reset each event

Detailed Description

Definition at line 167 of file PreselectAndCategorize.h.

Member Function Documentation

◆ board_input()

template<typename BaggageType>
void board_input ( TTree * tree,
const std::string & name )
inline

Definition at line 213 of file PreselectAndCategorize.h.

◆ board_output()

template<typename BaggageType>
void board_output ( TTree * tree,
const std::string & name )
inline

Definition at line 225 of file PreselectAndCategorize.h.

◆ clear_outputs()

void clear_outputs ( )
inline

Reset the resettable output passengers to their default state.

Call this at the start of each event. Branches that are only set under some condition (e.g. the truth branches, which need a truth match to be computed) would otherwise still be holding the value from the last event that did set them, and that stale value gets written into the tree.

Only outputs are reset – input passengers are attached to the input TTree and are refilled by ROOT on each entry, so clearing them here would throw away the event we are about to process. Class-typed outputs are also left alone; see auto_clearable above. Consumers of a conditionally-set class-typed branch should gate on a companion scalar (which is reset) rather than trusting the object itself.

Definition at line 208 of file PreselectAndCategorize.h.

◆ get()

template<typename BaggageType>
const BaggageType & get ( const std::string & name)
inline

Definition at line 239 of file PreselectAndCategorize.h.

◆ has()

bool has ( const std::string & name)
inline

Definition at line 188 of file PreselectAndCategorize.h.

◆ set()

template<typename BaggageType>
void set ( const std::string & name,
const BaggageType & obj )
inline

Definition at line 244 of file PreselectAndCategorize.h.

Member Data Documentation

◆ bus_

framework::Bus bus_
private

Definition at line 168 of file PreselectAndCategorize.h.

◆ clearable_output_names_

std::vector<std::string> clearable_output_names_
private

names of the output passengers that are safe to reset each event

Definition at line 170 of file PreselectAndCategorize.h.


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