Belle II Software development
StorageZMQ2Ds.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/StorageStreamHelper.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#include <daq/storage/modules/DataStorePackage.h>
24
25namespace Belle2 {
57 class StorageZMQ2DsModule : 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 DataStorePackage* m_package;
76
78 bool m_firstEvent = true;
82 bool m_inInitialize = true; // orignal value: true
83
85 std::string m_param_input;
87 unsigned int m_param_bufferSize = 2;
90
92 unsigned int m_lastExperiment = 42;
94 unsigned int m_lastRun = 8;
95
98 };
100}
Base class for Modules.
Definition: Module.h:72
Helper class for data store serialization.
Input module in the ZMQ reconstruction path receiving events via ZMQ and deserializing the to the dat...
Definition: StorageZMQ2Ds.h:57
bool m_firstEvent
Are we still in the first real event?
Definition: StorageZMQ2Ds.h:78
std::unique_ptr< ZMQLoadBalancedInput > m_input
Load balanced connection to the previous ZMQ application.
Definition: StorageZMQ2Ds.h:71
bool m_lastEventIsSpecialMessage
The last event has a special message type?
Definition: StorageZMQ2Ds.h:80
bool m_inInitialize
Are we still before the first real event = before the modules are initialized = before the forking?
Definition: StorageZMQ2Ds.h:82
void initialize() override
Register the needed store arrays. In case of the HLT, this are only the raw data objects,...
void event() override
Handle the cases (a) before first event, (b) first event and (c) normal event as described in the cla...
std::shared_ptr< ZMQParent > m_parent
ZMQ Parent needed for the connections.
Definition: StorageZMQ2Ds.h:69
unsigned int m_lastExperiment
Default experiment number to be set during initialization/run end to have something to load the geome...
Definition: StorageZMQ2Ds.h:92
StorageZMQ2DsModule()
Register the module parameters.
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: StorageZMQ2Ds.h:87
StoreObjPtr< EventMetaData > m_eventMetaData
Reference to the event meta data to set numbers and flags according to the state and received message...
Definition: StorageZMQ2Ds.h:97
unsigned int m_lastRun
Default run number to be set during initialization/run end to have something to load the geometry....
Definition: StorageZMQ2Ds.h:94
StorageStreamHelper m_streamHelper
Utility class for deserialization.
Definition: StorageZMQ2Ds.h:74
std::string m_param_input
Module parameter: ZMQ address of the input ZMQ application.
Definition: StorageZMQ2Ds.h:85
bool m_param_addExpressRecoObjects
Module parameter: additional to the raw data, also register the data store objects needed for express...
Definition: StorageZMQ2Ds.h:89
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.