Project
Loading...
Searching...
No Matches
IntegratingMerger.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_INTEGRATINGMERGER_H
13#define ALICEO2_INTEGRATINGMERGER_H
14
19
22#include "Mergers/ObjectStore.h"
23
24#include "Framework/Task.h"
25
26#include <memory>
27
28class TObject;
29
30namespace o2::monitoring
31{
32class Monitoring;
33}
34
35namespace o2::mergers
36{
37
42{
43 public:
47 ~IntegratingMerger() override = default;
48
50 void init(framework::InitContext& ctx) override;
52 void run(framework::ProcessingContext& ctx) override;
53
55 void endOfStream(framework::EndOfStreamContext& eosContext) override;
56
57 private:
58 void finishCycle(framework::DataAllocator& outputs);
59 void publishIntegral(framework::DataAllocator& allocator);
60 void publishMovingWindow(framework::DataAllocator& allocator);
61 static void merge(ObjectStore& mMergedDelta, ObjectStore&& other);
62 void clear();
63 bool shouldFinishCycle(const framework::InputRecord&) const;
64
65 private:
67 // data points since the last cycle end. it allows us to create moving windows
68 ObjectStore mMergedObjectLastCycle = std::monostate{};
69 // data points since the last state reset
70 ObjectStore mMergedObjectIntegral = std::monostate{};
71 MergerConfig mConfig;
72 std::unique_ptr<monitoring::Monitoring> mCollector;
73 int mCyclesSinceReset = 0;
74
75 // stats
76 int mTotalDeltasMerged = 0;
77 int mDeltasMerged = 0;
78};
79
80} // namespace o2::mergers
81
82#endif //ALICEO2_INTEGRATINGMERGER_H
Definition of O2 Mergers merging interface, v0.1.
Definition of O2 MergerConfig, v0.1.
Definition of ObjectStore for Mergers, v0.1.
o2::monitoring::Monitoring Monitoring
The input API of the Data Processing Layer This class holds the inputs which are valid for processing...
IntegratingMerger data processor class.
~IntegratingMerger() override=default
Default destructor.
void endOfStream(framework::EndOfStreamContext &eosContext) override
Callback for CallbackService::Id::EndOfStream.
void run(framework::ProcessingContext &ctx) override
IntegratingMerger process callback.
void init(framework::InitContext &ctx) override
IntegratingMerger init callback.
std::variant< std::monostate, TObjectPtr, VectorOfTObjectPtrs, MergeInterfacePtr > ObjectStore
Definition ObjectStore.h:45
uint32_t SubSpecificationType
Definition DataHeader.h:620
VectorOfTObjectPtrs other