Belle II Software development
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 <limits>
21#include <memory>
22#include <zmq.hpp>
23
24namespace Belle2 {
56 class HLTZMQ2DsModule : public Module {
57 public:
60
62 void initialize() override;
64 void event() override;
65
66 private:
68 std::shared_ptr<ZMQParent> m_parent;
70 std::unique_ptr<ZMQLoadBalancedInput> m_input;
71
74
76 bool m_firstEvent = true;
80 bool m_inInitialize = true;
81
83 std::string m_param_input;
85 unsigned int m_param_bufferSize = 2;
88
90 unsigned int m_lastExperiment = std::numeric_limits<int>::max();
92 unsigned int m_lastRun = std::numeric_limits<int>::max();
93
96 };
98}
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:56
bool m_firstEvent
Are we still in the first real event?
Definition: HLTZMQ2Ds.h:76
std::unique_ptr< ZMQLoadBalancedInput > m_input
Load balanced connection to the previous ZMQ application.
Definition: HLTZMQ2Ds.h:70
bool m_lastEventIsSpecialMessage
The last event has a special message type?
Definition: HLTZMQ2Ds.h:78
bool m_inInitialize
Are we still before the first real event = before the modules are initialized = before the forking?
Definition: HLTZMQ2Ds.h:80
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
std::shared_ptr< ZMQParent > m_parent
ZMQ Parent needed for the connections.
Definition: HLTZMQ2Ds.h:68
unsigned int m_lastExperiment
Default experiment number to be set during initialization/run end to have something to load the geome...
Definition: HLTZMQ2Ds.h:90
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:85
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:95
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:92
HLTStreamHelper m_streamHelper
Utility class for deserialization.
Definition: HLTZMQ2Ds.h:73
std::string m_param_input
Module parameter: ZMQ address of the input ZMQ application.
Definition: HLTZMQ2Ds.h:83
bool m_param_addExpressRecoObjects
Module parameter: additional to the raw data, also register the data store objects needed for express...
Definition: HLTZMQ2Ds.h:87
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Abstract base class for different kinds of events.