Belle II Software  release-05-01-25
TriggerSkimModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: David Dossett *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <framework/datastore/StoreObjPtr.h>
13 #include <mdst/dataobjects/SoftwareTriggerResult.h>
14 #include <framework/core/Module.h>
15 
16 #include <string>
17 #include <map>
18 #include <boost/variant.hpp>
19 #include <boost/optional.hpp>
20 
21 namespace Belle2 {
26 
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;
45  StoreObjPtr<SoftwareTriggerResult> m_trigResults;
47  std::vector<boost::variant<std::string, std::tuple<std::string, unsigned int>>> m_triggerLines;
49  int m_expectedResult{1};
51  std::string m_logicMode{"or"};
55  boost::optional<int> m_resultOnMissing;
57  std::vector<uint32_t> m_prescaleCounters;
58  };
60 }
Belle2::TriggerSkimModule::m_logicMode
std::string m_logicMode
do we want each or any trigger line?
Definition: TriggerSkimModule.h:59
Belle2::TriggerSkimModule::event
virtual void event() override
Event function.
Definition: TriggerSkimModule.cc:121
Belle2::TriggerSkimModule::m_prescaleCounters
std::vector< uint32_t > m_prescaleCounters
if we don't use random prescale we need counters
Definition: TriggerSkimModule.h:65
Belle2::TriggerSkimModule::initialize
virtual void initialize() override
Initialize.
Definition: TriggerSkimModule.cc:62
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TriggerSkimModule::TriggerSkimModule
TriggerSkimModule()
Constructor: Sets the description, the properties and the parameters of the module.
Definition: TriggerSkimModule.cc:24
Belle2::TriggerSkimModule::m_expectedResult
int m_expectedResult
Result we want for each or any trigger line.
Definition: TriggerSkimModule.h:57
Belle2::TriggerSkimModule::checkTrigger
bool checkTrigger(const std::string &name, unsigned int prescale=1, uint32_t *counter=nullptr) const
Check a single trigger line for the expected result.
Definition: TriggerSkimModule.cc:103
Belle2::TriggerSkimModule::m_resultOnMissing
boost::optional< int > m_resultOnMissing
value to return if there's no SoftwareTriggerResult
Definition: TriggerSkimModule.h:63
Belle2::TriggerSkimModule::m_trigResults
StoreObjPtr< SoftwareTriggerResult > m_trigResults
Required input for trigger results.
Definition: TriggerSkimModule.h:53
Belle2::TriggerSkimModule::m_triggerLines
std::vector< boost::variant< std::string, std::tuple< std::string, unsigned int > > > m_triggerLines
List of triggerlines we're interested in.
Definition: TriggerSkimModule.h:55
Belle2::TriggerSkimModule::m_useRandomNumbersForPreScale
bool m_useRandomNumbersForPreScale
and do we want random prescale or counters ?
Definition: TriggerSkimModule.h:61