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 <map>
16#include <optional>
17#include <string>
18
19#include <boost/variant.hpp>
20
21namespace Belle2 {
27 class TriggerSkimModule : public Module {
28
29 public:
30
34 virtual void initialize() override;
36 virtual void event() override;
37
38 private:
40 bool checkTrigger(const std::string& name, unsigned int prescale = 1, uint32_t* counter = nullptr) const;
44 std::vector<boost::variant<std::string, std::tuple<std::string, unsigned int>>> m_triggerLines;
48 std::string m_logicMode{"or"};
52 std::optional<int> m_resultOnMissing;
54 std::vector<uint32_t> m_prescaleCounters;
58 bool m_firstEvent{false};
59 };
61}
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
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.