Belle II Software  release-05-02-19
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 #include <framework/dataobjects/EventMetaData.h>
16 
17 #include <string>
18 #include <map>
19 #include <boost/variant.hpp>
20 #include <boost/optional.hpp>
21 
22 namespace Belle2 {
27 
31  class TriggerSkimModule : public Module {
32 
33  public:
34 
38  virtual void initialize() override;
40  virtual void event() override;
41 
42  private:
44  bool checkTrigger(const std::string& name, unsigned int prescale = 1, uint32_t* counter = nullptr) const;
46  StoreObjPtr<SoftwareTriggerResult> m_trigResults;
48  std::vector<boost::variant<std::string, std::tuple<std::string, unsigned int>>> m_triggerLines;
50  int m_expectedResult{1};
52  std::string m_logicMode{"or"};
56  boost::optional<int> m_resultOnMissing;
58  std::vector<uint32_t> m_prescaleCounters;
61  };
63 }
Belle2::TriggerSkimModule::m_logicMode
std::string m_logicMode
do we want each or any trigger line?
Definition: TriggerSkimModule.h:60
Belle2::TriggerSkimModule::event
virtual void event() override
Event function.
Definition: TriggerSkimModule.cc:138
Belle2::TriggerSkimModule::m_prescaleCounters
std::vector< uint32_t > m_prescaleCounters
if we don't use random prescale we need counters
Definition: TriggerSkimModule.h:66
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::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
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:58
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:64
Belle2::TriggerSkimModule::m_trigResults
StoreObjPtr< SoftwareTriggerResult > m_trigResults
Required input for trigger results.
Definition: TriggerSkimModule.h:54
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:56
Belle2::TriggerSkimModule::m_eventMetaDataPtr
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
EventMetaData is used to report warning/error messages.
Definition: TriggerSkimModule.h:68
Belle2::TriggerSkimModule::m_useRandomNumbersForPreScale
bool m_useRandomNumbersForPreScale
and do we want random prescale or counters ?
Definition: TriggerSkimModule.h:62