Belle II Software development
SoftwareTriggerCut.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 <mdst/dbobjects/SoftwareTriggerCutBase.h>
11#include <framework/utilities/GeneralCut.h>
12#include <hlt/softwaretrigger/core/SoftwareTriggerVariableManager.h>
13#include <mdst/dataobjects/SoftwareTriggerResult.h>
14#include <stdint.h>
15
16namespace Belle2 {
21
22 namespace SoftwareTrigger {
31 public:
80 static std::unique_ptr<SoftwareTriggerCut> compile(const std::string& cut_string,
81 const unsigned int prescaleFactor,
82 const bool rejectCut = false);
83
88 std::string decompile() const
89 {
90 return m_cut->decompile();
91 }
92
98
104 std::pair<SoftwareTriggerCutResult, SoftwareTriggerCutResult> check(const SoftwareTriggerVariableManager::Object& prefilledObject,
105 uint32_t* counter = nullptr)
106 const;
107
108 private:
110 std::unique_ptr<GeneralCut<SoftwareTriggerVariableManager>> m_cut = nullptr;
111
116 unsigned int prescaleFactor,
117 const bool rejectCut) : SoftwareTriggerCutBase(prescaleFactor, rejectCut),
118 m_cut(std::move(cut))
119 {
120 }
121 };
122 }
124}
This class implements a common way to implement cut/selection functionality for arbitrary objects.
Definition GeneralCut.h:71
SoftwareTriggerCutBase(unsigned int preScaleFactor=1, const bool &isRejectCut=false)
Create a new base instance. This should rarely be called by yourself.
SoftwareTriggerCutResult checkPreScaled(const SoftwareTriggerVariableManager::Object &prefilledObject) const
Main function of the SoftwareTriggerCut: check the cut condition.
std::unique_ptr< GeneralCut< SoftwareTriggerVariableManager > > m_cut
Internal representation of the cut condition as a general cut.
SoftwareTriggerCut(std::unique_ptr< GeneralCut< SoftwareTriggerVariableManager > > &&cut, unsigned int prescaleFactor, const bool rejectCut)
Make constructor private.
std::pair< SoftwareTriggerCutResult, SoftwareTriggerCutResult > check(const SoftwareTriggerVariableManager::Object &prefilledObject, uint32_t *counter=nullptr) const
Return both the prescaled and the non-prescaled result.
static std::unique_ptr< SoftwareTriggerCut > compile(const std::string &cut_string, const unsigned int prescaleFactor, const bool rejectCut=false)
Compile a new SoftwareTriggerCut from a cut string (by using the GeneralCut::compile function) and an...
std::string decompile() const
Decompile the internal General Cut back into a string.
SoftwareTriggerObject Object
As an object handed in for every cut to be checked, use a map of variable name -> precompiled value.
SoftwareTriggerCutResult
Enumeration with all possible results of the SoftwareTriggerCut.
Abstract base class for different kinds of events.
STL namespace.