R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandBasePar.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2023 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#include "R3BNeulandBasePar.h"
15
16namespace R3B::Neuland
17{
19 std::string_view title,
20 std::string_view context,
21 bool own)
22 : Neuland::ParSet(name.data(), title.data(), context.data(), own)
23 {
24 }
25
26 void to_json(nlohmann::json& jsn, const CalibrationBasePar& par)
27 {
28 jsn = nlohmann::json{ { "expIDs", par.exp_ids_ },
29 { "num_of_planes", par.num_of_planes_ },
30 { "offspill", par.offspill_tpat_pos_ },
31 { "trig_mapping", par.trigIDMap_ } };
32 }
33 void from_json(const nlohmann::json& jsn, CalibrationBasePar& par)
34 {
35 jsn.at("expIDs").get_to(par.exp_ids_);
36 jsn.at("num_of_planes").get_to(par.num_of_planes_);
37 jsn.at("offspill").get_to(par.offspill_tpat_pos_);
38
39 par.trigIDMap_.clear();
40 for (const auto& jsonEntry : jsn.at("trig_mapping"))
41 {
42 const auto moduleID = jsonEntry.at("barID").template get<int>();
43 const auto trigID_left = jsonEntry.at("trigID_left").template get<int>();
44 const auto trigID_right = jsonEntry.at("trigID_right").template get<int>();
45 par.trigIDMap_.insert({ moduleID, std::make_pair(trigID_left, trigID_right) });
46 }
47 }
48} // namespace R3B::Neuland
49
ClassImp(R3B::Neuland::Cal2HitPar)
CalibrationBasePar(std::string_view name="NeulandCalibrationBasePar", std::string_view title="Neuland calibration base par", std::string_view context="TestDefaultContext", bool own=true)
ParSet(std::string_view name="parSet", std::string_view title="Neuland parameter", std::string_view context="TestDefaultContext", bool own=true)
Simulation of NeuLAND Bar/Paddle.
void from_json(const nlohmann::ordered_json &json_obj, MinimizerLimVar &option)
void to_json(nlohmann::ordered_json &json_obj, const MinimizerLimVar &option)