Project
Loading...
Searching...
No Matches
testSimCutParam.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#define BOOST_TEST_MODULE Test SimConfig SimCutParam
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
16#include "SimConfig/SimParams.h"
18#include <boost/property_tree/ptree.hpp>
19
20using namespace o2::conf;
21
23{
24 BOOST_CHECK_EQUAL(ConfigurableParam::getValueAs<bool>("SimCutParams.trackSeed"), false);
25 BOOST_CHECK_EQUAL(ConfigurableParam::getValueAs<double>("SimCutParams.ZmaxA"), 1E20);
26
27 auto& par = SimCutParams::Instance();
28 ConfigurableParam::setValue("SimCutParams", "ZmaxA", 100.);
29 BOOST_CHECK_CLOSE(par.ZmaxA, 100., 0.001);
30 BOOST_CHECK_CLOSE(ConfigurableParam::getValueAs<double>("SimCutParams.ZmaxA"), 100., 0.001);
31
32 ConfigurableParam::updateFromString("SimCutParams.ZmaxA=20");
33 BOOST_CHECK_CLOSE(par.ZmaxA, 20., 0.001);
34 BOOST_CHECK_CLOSE(ConfigurableParam::getValueAs<double>("SimCutParams.ZmaxA"), 20., 0.001);
35}
static void setValue(std::string const &mainkey, std::string const &subkey, T x)
static void updateFromString(std::string const &)
BOOST_AUTO_TEST_CASE(test1)
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())