R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandSignalMatcher.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
16namespace R3B::Neuland
17{
18
19 auto SignalMatcher::GetGoodnessOfMatch(const Input& firstSignal, const Input& secondSignal, const Par& par) -> float
20 {
21 auto firstE = static_cast<float>(firstSignal.energy);
22 auto secondE = static_cast<float>(secondSignal.energy);
23 auto firstT = firstSignal.time;
24 auto secondT = secondSignal.time;
25
26 // keep the exponent always negative to prevent the exploding of exponential function
27 auto res = 0.F;
28 if (firstT > secondT)
29 {
30 // res = std::abs(
31 // (firstE / secondE) * std::exp(static_cast<float>(par.attenuation * par.c_medium * (firstT -
32 // secondT))) - 1);
33 res = std::abs((firstE / secondE) *
34 std::exp(static_cast<float>(par.attenuation * par.c_medium * (firstT - secondT))));
35 }
36 else
37 {
38 // res = std::abs((secondE / firstE) * std::exp(static_cast<float>(par.attenuation * par.c_medium *
39 // static_cast<float>(secondT - firstT))) -
40 // 1);
41 res = std::abs((secondE / firstE) * std::exp(static_cast<float>(par.attenuation * par.c_medium *
42 static_cast<float>(secondT - firstT))));
43 }
44 return res;
45 }
46
47} // namespace R3B::Neuland
Simulation of NeuLAND Bar/Paddle.
static auto GetGoodnessOfMatch(const Input &firstSignal, const Input &secondSignal, const Par &par) -> float