Belle II Software  release-08-01-10
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 
21 namespace Belle2 {
27 
30  class TriggerSkimModule : public Module {
31 
32  public:
33 
37  virtual void initialize() override;
39  virtual void event() override;
40 
41  private:
43  bool checkTrigger(const std::string& name, unsigned int prescale = 1, uint32_t* counter = nullptr) const;
47  std::vector<boost::variant<std::string, std::tuple<std::string, unsigned int>>> m_triggerLines;
51  std::string m_logicMode{"or"};
55  std::optional<int> m_resultOnMissing;
57  std::vector<uint32_t> m_prescaleCounters;
61  bool m_firstEvent{false};
62  };
64 }
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.