Project
Loading...
Searching...
No Matches
LHCIFfileReader.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 "
GRPCalibration/LHCIFfileReader.h
"
13
#include <fstream>
14
15
namespace
o2
16
{
17
namespace
grp
18
{
19
20
void
LHCIFfileReader::loadLHCIFfile
(
const
std::string& fileName)
21
{
22
// load the LHC IF file into a string
23
if
(
o2::utils::Str::pathExists
(fileName)) {
24
std::string expandedFileName =
o2::utils::Str::getFullPath
(fileName);
25
std::ifstream ifs(expandedFileName.c_str());
26
if
(ifs) {
27
ifs.seekg(0, std::ios::end);
28
const
auto
size
= ifs.tellg();
29
mFileBuffStr.resize(
size
);
30
ifs.seekg(0);
31
ifs.read(&mFileBuffStr[0],
size
);
32
ifs.close();
33
}
34
}
else
{
35
LOG
(error) <<
"File "
<< fileName <<
" does not exist!"
;
36
}
37
}
38
39
//_________________________________________________________________
40
41
void
LHCIFfileReader::loadLHCIFfile
(gsl::span<const char> configBuf)
42
{
43
// load the LHC IF file into a string from a buffer
44
mFileBuffStr.assign(configBuf.data());
45
}
46
47
//_________________________________________________________________
48
49
}
// end namespace grp
50
}
// end namespace o2
LHCIFfileReader.h
o2::grp::LHCIFfileReader::loadLHCIFfile
void loadLHCIFfile(const std::string &fileName)
Definition
LHCIFfileReader.cxx:20
size
GLsizeiptr size
Definition
glcorearb.h:659
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::utils::Str::pathExists
static bool pathExists(const std::string_view p)
Definition
StringUtils.cxx:52
o2::utils::Str::getFullPath
static std::string getFullPath(const std::string_view p)
Definition
StringUtils.cxx:62
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
Detectors
GRP
calibration
src
LHCIFfileReader.cxx
Generated on Tue Feb 25 2025 23:16:18 for Project by
1.9.8