R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandCalToHitPar.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
15#include <R3BNeulandCommon.h>
16#include <R3BShared.h>
17#include <algorithm>
18#include <cmath>
19#include <range/v3/all.hpp>
20
21namespace
22{
23 auto calculate_threshold(const R3B::Neuland::HitModulePar& modulePar, R3B::Side side)
24 {
25 const auto value = modulePar.pmt_threshold.get(side).value *
27 const auto err = 0.;
28 return R3B::ValueError<double>{ value, err };
29 }
30
31} // namespace
32
33namespace R3B::Neuland
34{
35 Cal2HitPar::Cal2HitPar(std::string_view name, std::string_view title, std::string_view context, Bool_t own)
36 : ParSet(name, title, context, own)
37 {
38 }
39
41 {
42 auto threshold_views =
43 ranges::views::transform(module_pars_ | ranges::views::values,
44 [](const auto& ele)
45 {
46 return std::max(calculate_threshold(ele, R3B::Side::left).value,
47 calculate_threshold(ele, R3B::Side::right).value);
48 });
49
50 auto max_value = ranges::max_element(threshold_views);
51 if (max_value != threshold_views.end())
52 {
53 energy_cut_ = *max_value;
54 }
55 }
56
57} // namespace R3B::Neuland
58
ClassImp(R3B::Neuland::Cal2HitPar)
Cal2HitPar(std::string_view name="NeulandHitPar", std::string_view title="Neuland Cal2Hit calibration", std::string_view context="TestDefaultContext", Bool_t own=kTRUE)
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.
constexpr auto TotalBarLength
ValueError< double > light_attenuation_length
LRPair< ValueError< double > > pmt_threshold