Belle II Software  release-05-01-25
HLTZMQ2Ds.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Anselm Baur *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <framework/core/Module.h>
13 
14 #include <daq/hbasf2/utils/HLTStreamHelper.h>
15 #include <framework/pcore/zmq/connections/ZMQLoadBalancedConnection.h>
16 
17 #include <framework/pcore/zmq/utils/ZMQParent.h>
18 #include <framework/datastore/StoreObjPtr.h>
19 #include <framework/dataobjects/EventMetaData.h>
20 #include <framework/core/RandomGenerator.h>
21 
22 #include <memory>
23 #include <zmq.hpp>
24 
25 namespace Belle2 {
57  class HLTZMQ2DsModule : public Module {
58  public:
61 
63  void initialize() override;
65  void event() override;
66 
67  private:
69  std::shared_ptr<ZMQParent> m_parent;
71  std::unique_ptr<ZMQLoadBalancedInput> m_input;
72 
75 
77  bool m_firstEvent = true;
79  bool m_inInitialize = true;
80 
82  std::string m_param_input;
84  unsigned int m_param_bufferSize = 2;
86  bool m_param_addExpressRecoObjects = false;
87 
89  unsigned int m_lastExperiment = 42;
91  unsigned int m_lastRun = 8;
92 
95  };
97 }
Belle2::HLTZMQ2DsModule::m_streamHelper
HLTStreamHelper m_streamHelper
Utility class for deserialization.
Definition: HLTZMQ2Ds.h:82
Belle2::HLTZMQ2DsModule::m_param_input
std::string m_param_input
Module parameter: ZMQ address of the input ZMQ application.
Definition: HLTZMQ2Ds.h:90
Belle2::HLTZMQ2DsModule::m_input
std::unique_ptr< ZMQLoadBalancedInput > m_input
Load balanced connection to the previous ZMQ application.
Definition: HLTZMQ2Ds.h:79
Belle2::HLTStreamHelper
Helper class for data store serialization.
Definition: HLTStreamHelper.h:52
Belle2::HLTZMQ2DsModule::m_firstEvent
bool m_firstEvent
Are we still in the first real event?
Definition: HLTZMQ2Ds.h:85
Belle2::HLTZMQ2DsModule::m_lastExperiment
unsigned int m_lastExperiment
Default experiment number to be set during initialization/run end to have something to load the geome...
Definition: HLTZMQ2Ds.h:97
Belle2::HLTZMQ2DsModule::m_parent
std::shared_ptr< ZMQParent > m_parent
ZMQ Parent needed for the connections.
Definition: HLTZMQ2Ds.h:77
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::HLTZMQ2DsModule::m_lastRun
unsigned int m_lastRun
Default run number to be set during initialization/run end to have something to load the geometry....
Definition: HLTZMQ2Ds.h:99
Belle2::HLTZMQ2DsModule::m_eventMetaData
StoreObjPtr< EventMetaData > m_eventMetaData
Reference to the event meta data to set numbers and flags according to the state and received message...
Definition: HLTZMQ2Ds.h:102
Belle2::HLTZMQ2DsModule::HLTZMQ2DsModule
HLTZMQ2DsModule()
Register the module parameters.
Definition: HLTZMQ2Ds.cc:11
Belle2::HLTZMQ2DsModule::m_param_bufferSize
unsigned int m_param_bufferSize
Module parameter: how many events should be kept in flight. Has an impact on the stopping time as wel...
Definition: HLTZMQ2Ds.h:92
Belle2::HLTZMQ2DsModule::initialize
void initialize() override
Register the needed store arrays. In case of the HLT, this are only the raw data objects,...
Definition: HLTZMQ2Ds.cc:49
Belle2::HLTZMQ2DsModule::event
void event() override
Handle the cases (a) before first event, (b) first event and (c) normal event as described in the cla...
Definition: HLTZMQ2Ds.cc:54
Belle2::HLTZMQ2DsModule::m_inInitialize
bool m_inInitialize
Are we still before the first real event = before the modules are initialized = before the forking?
Definition: HLTZMQ2Ds.h:87
Belle2::HLTZMQ2DsModule::m_param_addExpressRecoObjects
bool m_param_addExpressRecoObjects
Module parameter: additional to the raw data, also register the data store objects needed for express...
Definition: HLTZMQ2Ds.h:94