Belle II Software development
SoftwareTriggerCalculation.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <hlt/softwaretrigger/core/SoftwareTriggerObject.h>
11#include <hlt/softwaretrigger/dataobjects/SoftwareTriggerVariables.h>
12#include <framework/datastore/StoreObjPtr.h>
13#include <TTree.h>
14
15namespace Belle2 {
20 namespace SoftwareTrigger {
30 public:
36 virtual void requireStoreArrays() = 0;
37
43 void writeDebugOutput(const std::unique_ptr<TTree>& debugOutputTTree);
44
51 void addDebugOutput(const StoreObjPtr<SoftwareTriggerVariables>& storeObject, const std::string& prefix);
52
64 const SoftwareTriggerObject& fillInCalculations();
65
67 virtual void doCalculation(SoftwareTriggerObject& m_calculationResult) = 0;
68
70 virtual ~SoftwareTriggerCalculation() = default;
71
72 private:
74 SoftwareTriggerObject m_calculationResult;
76 bool m_debugPrepared = false;
77 };
78 }
80}
Base class for all calculation algorithms to be used when calculating the variables needed in the Sof...
SoftwareTriggerObject m_calculationResult
Internal storage of the result of the calculation.
virtual void doCalculation(SoftwareTriggerObject &m_calculationResult)=0
Override this function to implement your calculation.
void addDebugOutput(const StoreObjPtr< SoftwareTriggerVariables > &storeObject, const std::string &prefix)
Function to write out debug output into the given StoreObject.
bool m_debugPrepared
Flag to not add the branches twice to the TTree.
virtual void requireStoreArrays()=0
Function to be called in the initialize phase of the module, in which all later needed StoreArrays ca...
virtual ~SoftwareTriggerCalculation()=default
Default but virtual desctructor.
void writeDebugOutput(const std::unique_ptr< TTree > &debugOutputTTree)
Function to write out debug output into the given TTree.
const SoftwareTriggerObject & fillInCalculations()
Main function of this class: calculate the needed variables using the overwritten doCalculation funct...
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.