Belle II Software development
TriggerSkimModule.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/StoreObjPtr.h>
11#include <mdst/dataobjects/SoftwareTriggerResult.h>
12#include <framework/core/Module.h>
13#include <framework/dataobjects/EventMetaData.h>
14
15#include <optional>
16#include <string>
17
18#include <boost/variant.hpp>
19
20namespace Belle2 {
26 class TriggerSkimModule : public Module {
27
28 public:
29
33 virtual void initialize() override;
35 virtual void event() override;
36
37 private:
39 bool checkTrigger(const std::string& name, unsigned int prescale = 1, uint32_t* counter = nullptr) const;
43 std::vector<boost::variant<std::string, std::tuple<std::string, unsigned int>>> m_triggerLines;
47 std::string m_logicMode{"or"};
51 std::optional<int> m_resultOnMissing;
53 std::vector<uint32_t> m_prescaleCounters;
57 bool m_firstEvent{false};
58 };
60}
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Returns the calibration result from SoftwareTriigerResult for skimming out calibration flagged events...
bool m_firstEvent
Check event is the first event for hbasf2 usage, especiaaly for HLT storage.
std::string m_logicMode
do we want each or any trigger line?
virtual void initialize() override
Initialize.
std::optional< int > m_resultOnMissing
value to return if there's no SoftwareTriggerResult
virtual void event() override
Event function.
int m_expectedResult
Result we want for each or any trigger line.
std::vector< boost::variant< std::string, std::tuple< std::string, unsigned int > > > m_triggerLines
List of triggerlines we're interested in.
std::vector< uint32_t > m_prescaleCounters
if we don't use random prescale we need counters
bool m_useRandomNumbersForPreScale
and do we want random prescale or counters ?
StoreObjPtr< SoftwareTriggerResult > m_trigResults
Required input for trigger results.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
EventMetaData is used to report warning/error messages.
bool checkTrigger(const std::string &name, unsigned int prescale=1, uint32_t *counter=nullptr) const
Check a single trigger line for the expected result.
TriggerSkimModule()
Constructor: Sets the description, the properties and the parameters of the module.
Abstract base class for different kinds of events.