Belle II Software  release-08-01-10
SoftwareTriggerCalculation Class Referenceabstract

Base class for all calculation algorithms to be used when calculating the variables needed in the SoftwareTrigger modules for the cuts. More...

#include <SoftwareTriggerCalculation.h>

Inheritance diagram for SoftwareTriggerCalculation:
Collaboration diagram for SoftwareTriggerCalculation:

Public Member Functions

virtual void requireStoreArrays ()=0
 Function to be called in the initialize phase of the module, in which all later needed StoreArrays can be made a requirement. More...
 
void writeDebugOutput (const std::unique_ptr< TTree > &debugOutputTTree)
 Function to write out debug output into the given TTree. More...
 
void addDebugOutput (const StoreObjPtr< SoftwareTriggerVariables > &storeObject, const std::string &prefix)
 Function to write out debug output into the given StoreObject. More...
 
const SoftwareTriggerObject & fillInCalculations ()
 Main function of this class: calculate the needed variables using the overwritten doCalculation function and write out the values into the results object (with their names). More...
 
virtual void doCalculation (SoftwareTriggerObject &m_calculationResult)=0
 Override this function to implement your calculation.
 
virtual ~SoftwareTriggerCalculation ()=default
 Default but virtual desctructor.
 

Private Attributes

SoftwareTriggerObject m_calculationResult
 Internal storage of the result of the calculation.
 
bool m_debugPrepared = false
 Flag to not add the branches twice to the TTree.
 

Detailed Description

Base class for all calculation algorithms to be used when calculating the variables needed in the SoftwareTrigger modules for the cuts.

Override in your own calculation. Your override class must have a function requireStoreArray (which can be empty) and a function doCalculation getting the SoftwareTriggerObject as a reference.

Definition at line 29 of file SoftwareTriggerCalculation.h.

Member Function Documentation

◆ addDebugOutput()

void addDebugOutput ( const StoreObjPtr< SoftwareTriggerVariables > &  storeObject,
const std::string &  prefix 
)

Function to write out debug output into the given StoreObject.

Needs an already prefilled calculationResult for this (probably using the fillInCalculations function). All added variables are prefixed with the given prefix string.

Definition at line 34 of file SoftwareTriggerCalculation.cc.

◆ fillInCalculations()

const SoftwareTriggerObject & fillInCalculations ( )

Main function of this class: calculate the needed variables using the overwritten doCalculation function and write out the values into the results object (with their names).

Please make sure to override (or clear) the variables! Otherwise it can happen that their old values are still in the object.

What variables exactly are added to the result depends on the implementation details of the class.

Definition at line 44 of file SoftwareTriggerCalculation.cc.

◆ requireStoreArrays()

virtual void requireStoreArrays ( )
pure virtual

Function to be called in the initialize phase of the module, in which all later needed StoreArrays can be made a requirement.

Override it in your class if you need special store arrays.

Implemented in SkimSampleCalculator, and FilterCalculator.

◆ writeDebugOutput()

void writeDebugOutput ( const std::unique_ptr< TTree > &  debugOutputTTree)

Function to write out debug output into the given TTree.

Needs an already prefilled calculationResult for this (probably using the fillInCalculations function).

Definition at line 19 of file SoftwareTriggerCalculation.cc.


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