Project
Loading...
Searching...
No Matches
DigitSampler.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
12
#include "
DigitSampler.h
"
13
#include <istream>
14
#include "
DigitFileFormat.h
"
15
#include <iostream>
16
#include "
DataFormatsMCH/Digit.h
"
17
#include "
DataFormatsMCH/ROFRecord.h
"
18
#include <fmt/format.h>
19
#include "
DigitSamplerImpl.h
"
20
21
namespace
o2::mch::io
22
{
23
24
DigitSampler::DigitSampler(std::istream& in) : mInput{in}
25
{
26
mFileFormat =
readDigitFileFormat
(mInput);
27
mImpl =
impl::createDigitSamplerImpl
(mFileFormat.
fileVersion
);
28
}
29
30
DigitSampler::~DigitSampler() =
default
;
31
32
bool
DigitSampler::read(std::vector<Digit>&
digits
,
33
std::vector<ROFRecord>& rofs)
34
{
35
digits
.clear();
36
rofs.clear();
37
bool
ok = mImpl->read(mInput,
digits
, rofs);
38
return
ok;
39
}
40
41
void
DigitSampler::rewind()
42
{
43
mImpl->rewind(mInput);
44
}
45
46
void
DigitSampler::count()
const
47
{
48
if
(mCountDone) {
49
return
;
50
}
51
mImpl->count(mInput, mNofTimeFrames, mNofROFs, mNofDigits);
52
mCountDone =
true
;
53
}
54
55
size_t
DigitSampler::nofTimeFrames()
const
56
{
57
count
();
58
return
mNofTimeFrames;
59
}
60
61
size_t
DigitSampler::nofROFs()
const
62
{
63
count
();
64
return
mNofROFs;
65
}
66
67
size_t
DigitSampler::nofDigits()
const
68
{
69
count
();
70
return
mNofDigits;
71
}
72
73
}
// namespace o2::mch::io
Digit.h
DigitFileFormat.h
DigitSamplerImpl.h
DigitSampler.h
ROFRecord.h
Definition of the MCH ROFrame record.
count
GLint GLsizei count
Definition
glcorearb.h:399
o2::mch::io::impl::createDigitSamplerImpl
std::unique_ptr< DigitSamplerImpl > createDigitSamplerImpl(int version)
Definition
DigitSamplerImpl.cxx:26
o2::mch::io
Definition
DigitD0.h:19
o2::mch::io::readDigitFileFormat
DigitFileFormat readDigitFileFormat(std::istream &in)
Definition
DigitFileFormat.cxx:59
o2::mch::io::DigitFileFormat::fileVersion
uint64_t fileVersion
Definition
DigitFileFormat.h:29
digits
std::vector< Digit > digits
Definition
test_ctf_io_hmpid.cxx:40
Detectors
MUON
MCH
DevIO
Digits
DigitSampler.cxx
Generated on Tue Feb 25 2025 23:16:22 for Project by
1.9.8