Project
Loading...
Searching...
No Matches
RawReaderEventSync.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 O2_TPC_RAWREADEREVENTSYNC_H_
13#define O2_TPC_RAWREADEREVENTSYNC_H_
14
17
18#include <map>
19#include <utility>
20
21namespace o2
22{
23namespace tpc
24{
25
43{
44 public:
46 RawReaderEventSync() : mFrames(8), mMaxOffset(){};
47
50
53
57 void addEventOffset(int event, long time);
58
62 long getEventOffset(int event) { return mMaxOffset[event]; };
63
64 private:
65 int mFrames;
66 std::map<int, long> mMaxOffset;
67};
68
70{
71
72 // set time offset to next multiple of mFrames (+ mFrames)
73 const long iTimeOffset = time + (mFrames - (time % mFrames)) + mFrames;
74
75 mMaxOffset[event] = std::max(mMaxOffset[event], iTimeOffset);
76}
77
78} // namespace tpc
79} // namespace o2
80#endif
int16_t time
Definition RawEventData.h:4
RawReaderEventSync()
Default constructor.
RawReaderEventSync(const RawReaderEventSync &other)=default
Copy constructor.
~RawReaderEventSync()=default
Destructor.
void addEventOffset(int event, long time)
struct _cl_event * event
Definition glcorearb.h:2982
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other