Belle II Software  release-08-01-10
HLTZMQ2Ds.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/core/Module.h>
11 
12 #include <daq/hbasf2/utils/HLTStreamHelper.h>
13 #include <framework/pcore/zmq/connections/ZMQLoadBalancedConnection.h>
14 
15 #include <framework/pcore/zmq/utils/ZMQParent.h>
16 #include <framework/datastore/StoreObjPtr.h>
17 #include <framework/dataobjects/EventMetaData.h>
18 #include <framework/core/RandomGenerator.h>
19 
20 #include <memory>
21 #include <zmq.hpp>
22 
23 namespace Belle2 {
55  class HLTZMQ2DsModule : public Module {
56  public:
59 
61  void initialize() override;
63  void event() override;
64 
65  private:
67  std::shared_ptr<ZMQParent> m_parent;
69  std::unique_ptr<ZMQLoadBalancedInput> m_input;
70 
73 
75  bool m_firstEvent = true;
79  bool m_inInitialize = true;
80 
82  std::string m_param_input;
84  unsigned int m_param_bufferSize = 2;
87 
89  unsigned int m_lastExperiment = 42;
91  unsigned int m_lastRun = 8;
92 
95  };
97 }
Helper class for data store serialization.
Input module in the ZMQ reconstruction path receiving events via ZMQ and deserializing the to the dat...
Definition: HLTZMQ2Ds.h:55
bool m_firstEvent
Are we still in the first real event?
Definition: HLTZMQ2Ds.h:75
std::unique_ptr< ZMQLoadBalancedInput > m_input
Load balanced connection to the previous ZMQ application.
Definition: HLTZMQ2Ds.h:69
bool m_inInitialize
Are we still before the first real event = before the modules are initialized = before the forking?
Definition: HLTZMQ2Ds.h:79
void initialize() override
Register the needed store arrays. In case of the HLT, this are only the raw data objects,...
Definition: HLTZMQ2Ds.cc:56
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:61
bool m_firstEventIsSpecialMessage
The first event has a special message type?
Definition: HLTZMQ2Ds.h:77
std::shared_ptr< ZMQParent > m_parent
ZMQ Parent needed for the connections.
Definition: HLTZMQ2Ds.h:67
unsigned int m_lastExperiment
Default experiment number to be set during initialization/run end to have something to load the geome...
Definition: HLTZMQ2Ds.h:89
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:84
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:94
HLTZMQ2DsModule()
Register the module parameters.
Definition: HLTZMQ2Ds.cc:18
unsigned int m_lastRun
Default run number to be set during initialization/run end to have something to load the geometry....
Definition: HLTZMQ2Ds.h:91
HLTStreamHelper m_streamHelper
Utility class for deserialization.
Definition: HLTZMQ2Ds.h:72
std::string m_param_input
Module parameter: ZMQ address of the input ZMQ application.
Definition: HLTZMQ2Ds.h:82
bool m_param_addExpressRecoObjects
Module parameter: additional to the raw data, also register the data store objects needed for express...
Definition: HLTZMQ2Ds.h:86
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.