Belle II Software  release-08-01-10
SoftwareTriggerResult.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 <framework/datastore/RelationsObject.h>
11 
12 #include <map>
13 #include <string>
14 
15 namespace Belle2 {
22  c_reject = -1,
23  c_accept = 1,
24  c_noResult = 0
25  };
26 
37  public:
39  void addResult(const std::string& triggerIdentifier, SoftwareTriggerCutResult result,
41 
43  std::pair<SoftwareTriggerCutResult, SoftwareTriggerCutResult> getResultPair(const std::string& triggerIdentifier) const;
44 
46  SoftwareTriggerCutResult getResult(const std::string& triggerIdentifier) const;
47 
49  SoftwareTriggerCutResult getNonPrescaledResult(const std::string& triggerIdentifier) const;
50 
55  const std::map<std::string, std::pair<int, int>>& getResultPairs() const
56  {
57  return m_results;
58  }
59 
64  std::map<std::string, int> getResults() const;
65 
70  std::map<std::string, int> getNonPrescaledResults() const;
71 
73  void clear();
74 
76  std::string getInfoHTML() const override;
77 
78  private:
80  std::map<std::string, std::pair<int, int>> m_results;
81 
84  };
86 }
Defines interface for accessing relations of objects in StoreArray.
Dataobject to store the results of the cut calculations performed by the SoftwareTriggerModule.
ClassDefOverride(SoftwareTriggerResult, 5)
Making this class a ROOT class.
SoftwareTriggerCutResult getNonPrescaledResult(const std::string &triggerIdentifier) const
Return the non-prescaled cut result with the given name or throw an error if no result is there.
std::map< std::string, std::pair< int, int > > m_results
Internal storage of the cut decisions with names.
SoftwareTriggerCutResult getResult(const std::string &triggerIdentifier) const
Return the cut result with the given name or throw an error if no result is there.
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
std::map< std::string, int > getResults() const
Return all stored cut tags with their results as a map identifier -> cut result.
const std::map< std::string, std::pair< int, int > > & getResultPairs() const
Return all stored cut tags with their results as a map identifier -> [prescaled cut result,...
void addResult(const std::string &triggerIdentifier, SoftwareTriggerCutResult result, SoftwareTriggerCutResult nonPrescaledResult=SoftwareTriggerCutResult::c_noResult)
Add a new cut result to the storage or override the result with the same name.
std::map< std::string, int > getNonPrescaledResults() const
Return all stored cut tags with their non-prescaled results as a map identifier -> cut result.
void clear()
Clear all results.
std::pair< SoftwareTriggerCutResult, SoftwareTriggerCutResult > getResultPair(const std::string &triggerIdentifier) const
Return the cut result and the non-prescaled cut result with the given name or throw an error if no re...
SoftwareTriggerCutResult
Enumeration with all possible results of the SoftwareTriggerCut.
@ c_accept
Accept this event.
@ c_reject
Reject this event.
@ c_noResult
There were not enough information to decide on what to do with the event.
Abstract base class for different kinds of events.