Belle II Software  release-05-02-19
SoftwareTriggerResult.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <framework/datastore/RelationsObject.h>
13 
14 #include <map>
15 #include <string>
16 
17 namespace Belle2 {
22  enum class SoftwareTriggerCutResult {
24  c_reject = -1,
25  c_accept = 1,
26  c_noResult = 0
27  };
28 
38  class SoftwareTriggerResult : public RelationsObject {
39  public:
41  void addResult(const std::string& triggerIdentifier, const SoftwareTriggerCutResult& result,
43 
45  std::pair<SoftwareTriggerCutResult, SoftwareTriggerCutResult> getResultPair(const std::string& triggerIdentifier) const;
46 
48  SoftwareTriggerCutResult getResult(const std::string& triggerIdentifier) const;
49 
51  SoftwareTriggerCutResult getNonPrescaledResult(const std::string& triggerIdentifier) const;
52 
57  const std::map<std::string, std::pair<int, int>>& getResultPairs() const
58  {
59  return m_results;
60  }
61 
66  std::map<std::string, int> getResults() const;
67 
72  std::map<std::string, int> getNonPrescaledResults() const;
73 
75  void clear();
76 
78  std::string getInfoHTML() const override;
79 
80  private:
82  std::map<std::string, std::pair<int, int>> m_results;
83 
86  };
88 }
Belle2::SoftwareTriggerResult::getNonPrescaledResults
std::map< std::string, int > getNonPrescaledResults() const
Return all stored cut tags with their non-prescaled results as a map identifier -> cut result.
Definition: SoftwareTriggerResult.cc:43
Belle2::SoftwareTriggerResult::getInfoHTML
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
Definition: SoftwareTriggerResult.cc:58
Belle2::SoftwareTriggerResult::getResultPairs
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,...
Definition: SoftwareTriggerResult.h:65
Belle2::SoftwareTriggerCutResult::c_accept
@ c_accept
Accept this event.
Belle2::SoftwareTriggerResult::m_results
std::map< std::string, std::pair< int, int > > m_results
Internal storage of the cut decisions with names.
Definition: SoftwareTriggerResult.h:90
Belle2::SoftwareTriggerResult::addResult
void addResult(const std::string &triggerIdentifier, const SoftwareTriggerCutResult &result, const SoftwareTriggerCutResult &nonPrescaledResult=SoftwareTriggerCutResult::c_noResult)
Add a new cut result to the storage or override the result with the same name.
Definition: SoftwareTriggerResult.cc:10
Belle2::SoftwareTriggerResult::ClassDefOverride
ClassDefOverride(SoftwareTriggerResult, 5)
Making this class a ROOT class.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SoftwareTriggerCutResult::c_reject
@ c_reject
Reject this event.
Belle2::SoftwareTriggerResult
Dataobject to store the results of the cut calculations performed by the SoftwareTriggerModule.
Definition: SoftwareTriggerResult.h:46
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::SoftwareTriggerResult::clear
void clear()
Clear all results.
Definition: SoftwareTriggerResult.cc:53
Belle2::SoftwareTriggerResult::getResults
std::map< std::string, int > getResults() const
Return all stored cut tags with their results as a map identifier -> cut result.
Definition: SoftwareTriggerResult.cc:34
Belle2::SoftwareTriggerResult::getNonPrescaledResult
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.
Definition: SoftwareTriggerResult.cc:29
Belle2::SoftwareTriggerCutResult
SoftwareTriggerCutResult
Enumeration with all possible results of the SoftwareTriggerCut.
Definition: SoftwareTriggerResult.h:31
Belle2::SoftwareTriggerResult::getResult
SoftwareTriggerCutResult getResult(const std::string &triggerIdentifier) const
Return the cut result with the given name or throw an error if no result is there.
Definition: SoftwareTriggerResult.cc:23
Belle2::SoftwareTriggerCutResult::c_noResult
@ c_noResult
There were not enough information to decide on what to do with the event.
Belle2::SoftwareTriggerResult::getResultPair
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...
Definition: SoftwareTriggerResult.cc:16