R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandParSet.cxx
Go to the documentation of this file.
1
#include "
R3BNeulandParSet.h
"
2
#include <FairDetParIo.h>
3
#include <FairParIo.h>
4
#include <
R3BException.h
>
5
#include <
R3BLogger.h
>
6
#include <gsl/span>
7
#include <range/v3/algorithm.hpp>
8
9
using
gsl::span;
10
11
namespace
R3B::Neuland
12
{
13
ParSet::ParSet
(std::string_view name, std::string_view title, std::string_view context,
bool
own)
14
: FairParSet(name.data(), title.data(), context.data(), own)
15
{
16
// TODO: versions should be initialized in FairParSet!
17
ranges::fill(span(versions), -1);
18
}
19
20
auto
ParSet::init
(FairParIo* inputFile) ->
bool
21
{
22
R3BLOG
(debug, fmt::format(
"Try to init parameter {}"
, GetName()));
23
if
(
auto
* detParIo = inputFile->getDetParIo(
"FairGenericParIo"
); detParIo !=
nullptr
)
24
{
25
R3BLOG
(debug, fmt::format(
"Found DetParIo {}. Try to init with this."
, detParIo->GetName()));
26
auto
res = detParIo->init(
this
);
27
if
(not res)
28
{
29
R3BLOG
(error, fmt::format(
"Parameter {} init failed."
, detParIo->GetName()));
30
}
31
return
res;
32
}
33
34
R3BLOG
(error, fmt::format(
"Failed to init parameter {} because no FairDetParIo object is found!"
, GetName()));
35
return
false
;
36
}
37
38
auto
ParSet::write
(FairParIo* outputFile) ->
int
39
{
40
// writes the container to an output
41
if
(
auto
* detParIo = outputFile->getDetParIo(
"FairGenericParIo"
); detParIo !=
nullptr
)
42
{
43
R3BLOG
(info, fmt::format(
"writing parameter {} to root file."
, GetName()));
44
return
detParIo->write(
this
);
45
}
46
throw
R3B::runtime_error
(
47
fmt::format(
"Failed to write parameter {} because no FairDetParIo object is found!"
, GetName()));
48
}
49
}
// namespace R3B::Neuland
50
51
ClassImp
(
R3B::Neuland::ParSet
);
R3BException.h
R3BLogger.h
R3BLOG
#define R3BLOG(severity, x)
Definition
R3BLogger.h:35
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BNeulandParSet.h
R3B::Neuland::ParSet
Definition
R3BNeulandParSet.h:23
R3B::Neuland::ParSet::write
auto write(FairParIo *outputFile) -> int override
Definition
R3BNeulandParSet.cxx:38
R3B::Neuland::ParSet::init
auto init(FairParIo *inputFile) -> bool override
Definition
R3BNeulandParSet.cxx:20
R3B::Neuland::ParSet::ParSet
ParSet(std::string_view name="parSet", std::string_view title="Neuland parameter", std::string_view context="TestDefaultContext", bool own=true)
Definition
R3BNeulandParSet.cxx:13
R3B::runtime_error
Definition
R3BException.h:13
R3B::Neuland
Simulation of NeuLAND Bar/Paddle.
Definition
R3BNeulandAnalysisApp.cxx:80
neuland
calibration
share
R3BNeulandParSet.cxx
Generated by
1.13.2