ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
Columnar
ColumnarTestFixtures
Root
Configuration.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
#include <
ColumnarTestFixtures/Configuration.h
>
8
9
#include <nlohmann/json.hpp>
10
11
#include <cstdlib>
12
#include <fstream>
13
#include <stdexcept>
14
15
namespace
columnar
16
{
17
namespace
TestUtils
18
{
19
void
UserConfiguration ::
20
loadFromFile (
const
std::string& filename)
21
{
22
std::ifstream
file
(filename);
23
if
(!
file
.is_open())
24
throw
std::runtime_error (
"failed to open configuration file: "
+ filename);
25
26
auto
json
= nlohmann::json::parse (
file
);
27
28
if
(
json
.contains (
"targetTime"
))
29
targetTime
= std::chrono::seconds (
json
[
"targetTime"
].
get<int>
());
30
if
(
json
.contains (
"batchSize"
))
31
batchSize
=
json
[
"batchSize"
].get<
unsigned
int
>();
32
if
(
json
.contains (
"runToolTwice"
))
33
runToolTwice
=
json
[
"runToolTwice"
].get<
bool
>();
34
if
(
json
.contains (
"skipShallowCopies"
))
35
skipShallowCopies
=
json
[
"skipShallowCopies"
].get<
bool
>();
36
if
(
json
.contains (
"measureNonAccessForEmpty"
))
37
measureNonAccessForEmpty
=
json
[
"measureNonAccessForEmpty"
].get<
bool
>();
38
}
39
40
UserConfiguration
UserConfiguration :: fromEnvironment ()
41
{
42
UserConfiguration
config
;
43
const
char
*envPath = std::getenv (
"COLUMNAR_TEST_CONFIG"
);
44
if
(envPath !=
nullptr
&& envPath[0] !=
'\0'
)
45
config
.loadFromFile (envPath);
46
return
config
;
47
}
48
}
49
}
json
nlohmann::json json
Definition
HistogramDef.cxx:9
Configuration.h
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition
hcg.cxx:130
columnar::TestUtils
Definition
Benchmark.h:20
columnar
Definition
ClusterDef.h:16
config
Definition
PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
columnar::TestUtils::UserConfiguration
a struct holding user configuration for the PHYSLITE tests
Definition
PhysicsAnalysis/Columnar/ColumnarTestFixtures/ColumnarTestFixtures/Configuration.h:33
columnar::TestUtils::UserConfiguration::targetTime
std::chrono::seconds targetTime
Definition
PhysicsAnalysis/Columnar/ColumnarTestFixtures/ColumnarTestFixtures/Configuration.h:35
columnar::TestUtils::UserConfiguration::batchSize
unsigned int batchSize
Definition
PhysicsAnalysis/Columnar/ColumnarTestFixtures/ColumnarTestFixtures/Configuration.h:38
columnar::TestUtils::UserConfiguration::skipShallowCopies
bool skipShallowCopies
Definition
PhysicsAnalysis/Columnar/ColumnarTestFixtures/ColumnarTestFixtures/Configuration.h:44
columnar::TestUtils::UserConfiguration::runToolTwice
bool runToolTwice
Definition
PhysicsAnalysis/Columnar/ColumnarTestFixtures/ColumnarTestFixtures/Configuration.h:41
columnar::TestUtils::UserConfiguration::measureNonAccessForEmpty
bool measureNonAccessForEmpty
whether to measure non-retrieval for empty containers
Definition
PhysicsAnalysis/Columnar/ColumnarTestFixtures/ColumnarTestFixtures/Configuration.h:47
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.14.0