Belle II Software development
SoftwareTriggerVariables.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 <map>
11#include <string>
12#include <TObject.h>
13
14namespace Belle2 {
19 namespace SoftwareTrigger {
28 class SoftwareTriggerVariables : public TObject {
29 public:
31 void append(const std::string& identifier, const double& value)
32 {
33 m_results[identifier] = value;
34 }
35
37 const std::map<std::string, double>& get() const
38 {
39 return m_results;
40 }
41
43 double getVariable(std::string identifier) const
44 {
45 return m_results.at(identifier);
46 }
47
49 bool has(std::string identifier) const
50 {
51 return m_results.count(identifier) > 0;
52 }
53
55 void clear()
56 {
57 m_results.clear();
58 }
59
60 private:
62 std::map<std::string, double> m_results;
63
66 };
67 }
69}
Storable object for the variables calculated in the SoftwareTriggerModule.
bool has(std::string identifier) const
Returns true if indentifier is in the map of trigger variables.
ClassDef(SoftwareTriggerVariables, 1)
Making this class a ROOT class.
const std::map< std::string, double > & get() const
Get the whole map of results for analysis.
void append(const std::string &identifier, const double &value)
Append a new variable to the collection. Make sure not to override existing ones.
std::map< std::string, double > m_results
Internal storage of the variables with names.
double getVariable(std::string identifier) const
Get just one value from the map.
Abstract base class for different kinds of events.