Project
Loading...
Searching...
No Matches
PixelLaneData.cxx
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
#include <
FOCALReconstruction/PixelLaneData.h
>
12
#include <algorithm>
13
#include <cstdint>
14
#include <iostream>
15
#include <iomanip>
16
17
using namespace
o2::focal
;
18
19
void
PixelLaneHandler::reset
()
20
{
21
for
(
auto
& lane : mLaneData) {
22
lane.reset();
23
}
24
}
25
26
void
PixelLaneHandler::resetLane
(std::size_t laneID)
27
{
28
handleLaneIndex(laneID);
29
mLaneData[laneID].reset();
30
}
31
32
PixelLanePayload
&
PixelLaneHandler::getLane
(std::size_t
index
)
33
{
34
handleLaneIndex(
index
);
35
return
mLaneData[
index
];
36
}
37
38
const
PixelLanePayload
&
PixelLaneHandler::getLane
(std::size_t
index
)
const
39
{
40
handleLaneIndex(
index
);
41
return
mLaneData[
index
];
42
}
43
44
void
PixelLaneHandler::handleLaneIndex(std::size_t laneIndex)
const
45
{
46
if
(laneIndex >=
PixelLaneHandler::NLANES
) {
47
throw
PixelLaneHandler::LaneIndexException
(laneIndex);
48
}
49
}
50
51
void
PixelLanePayload::reset
()
52
{
53
mPayload.clear();
54
}
55
56
void
PixelLanePayload::append
(gsl::span<const uint8_t> payloadwords)
57
{
58
std::copy(payloadwords.begin(), payloadwords.end(), std::back_inserter(mPayload));
59
}
60
61
void
PixelLanePayload::append
(uint8_t word)
62
{
63
mPayload.emplace_back(word);
64
}
65
66
gsl::span<const uint8_t>
PixelLanePayload::getPayload
()
const
67
{
68
return
mPayload;
69
}
70
71
void
PixelLanePayload::print
(std::ostream&
stream
)
const
72
{
73
stream
<<
"Next lane with "
<< mPayload.size() <<
" words:"
;
74
for
(
const
auto
& word : mPayload) {
75
stream
<<
" 0x"
<< std::hex << static_cast<int>(word) << std::dec;
76
}
77
}
78
79
void
PixelLaneHandler::LaneIndexException::print
(std::ostream&
stream
)
const
80
{
81
stream
<< mMessage;
82
}
83
84
std::ostream&
o2::focal::operator<<
(std::ostream&
stream
,
const
PixelLaneHandler::LaneIndexException
& except)
85
{
86
except.
print
(
stream
);
87
return
stream
;
88
}
89
90
std::ostream&
o2::focal::operator<<
(std::ostream&
stream
,
const
PixelLanePayload
& payload)
91
{
92
payload.
print
(
stream
);
93
return
stream
;
94
}
PixelLaneData.h
o2::focal::PixelLaneHandler::LaneIndexException
Definition
PixelLaneData.h:50
o2::focal::PixelLaneHandler::LaneIndexException::print
void print(std::ostream &stream) const
Definition
PixelLaneData.cxx:79
o2::focal::PixelLaneHandler::reset
void reset()
Definition
PixelLaneData.cxx:19
o2::focal::PixelLaneHandler::getLane
PixelLanePayload & getLane(std::size_t index)
Definition
PixelLaneData.cxx:32
o2::focal::PixelLaneHandler::NLANES
static constexpr std::size_t NLANES
Definition
PixelLaneData.h:47
o2::focal::PixelLaneHandler::resetLane
void resetLane(std::size_t laneID)
Definition
PixelLaneData.cxx:26
o2::focal::PixelLanePayload
Definition
PixelLaneData.h:27
o2::focal::PixelLanePayload::getPayload
gsl::span< const uint8_t > getPayload() const
Definition
PixelLaneData.cxx:66
o2::focal::PixelLanePayload::reset
void reset()
Definition
PixelLaneData.cxx:51
o2::focal::PixelLanePayload::print
void print(std::ostream &stream) const
Definition
PixelLaneData.cxx:71
o2::focal::PixelLanePayload::append
void append(gsl::span< const uint8_t > payloadwords)
Definition
PixelLaneData.cxx:56
index
GLuint index
Definition
glcorearb.h:781
stream
GLuint GLuint stream
Definition
glcorearb.h:1806
o2::focal
Definition
SimTraits.h:171
o2::focal::operator<<
std::ostream & operator<<(std::ostream &in, const IndexExceptionEvent &error)
Definition
ErrorHandling.cxx:46
Detectors
FOCAL
reconstruction
src
PixelLaneData.cxx
Generated on Tue Feb 25 2025 17:02:57 for Project by
1.9.8