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
21
namespace
o2
22
{
23
namespace
tpc
24
{
25
42
class
RawReaderEventSync
43
{
44
public
:
46
RawReaderEventSync
() : mFrames(8), mMaxOffset(){};
47
49
RawReaderEventSync
(
const
RawReaderEventSync
&
other
) =
default
;
50
52
~RawReaderEventSync
() =
default
;
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
69
inline
void
RawReaderEventSync::addEventOffset
(
int
event
,
long
time
)
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
time
int16_t time
Definition
RawEventData.h:4
o2::tpc::RawReaderEventSync
Definition
RawReaderEventSync.h:43
o2::tpc::RawReaderEventSync::RawReaderEventSync
RawReaderEventSync()
Default constructor.
Definition
RawReaderEventSync.h:46
o2::tpc::RawReaderEventSync::RawReaderEventSync
RawReaderEventSync(const RawReaderEventSync &other)=default
Copy constructor.
o2::tpc::RawReaderEventSync::~RawReaderEventSync
~RawReaderEventSync()=default
Destructor.
o2::tpc::RawReaderEventSync::addEventOffset
void addEventOffset(int event, long time)
Definition
RawReaderEventSync.h:69
o2::tpc::RawReaderEventSync::getEventOffset
long getEventOffset(int event)
Definition
RawReaderEventSync.h:62
event
struct _cl_event * event
Definition
glcorearb.h:2982
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
other
VectorOfTObjectPtrs other
Definition
test_Algorithm.cxx:501
Detectors
TPC
reconstruction
include
TPCReconstruction
RawReaderEventSync.h
Generated on Tue Feb 25 2025 23:16:29 for Project by
1.9.8