R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
testNeulandMultiplicityCalorimetricPar.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 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 "TCutG.h"
16#include "gtest/gtest.h"
17#include <map>
18
19namespace
20{
21 TEST(testNMultiplicityCalorimetricPar, HandlesConversionBetweenMaps)
22 {
23 std::map<UInt_t, TCutG*> m;
24 m[1] = new TCutG("cut1", 4);
25 m[2] = new TCutG("cut2", 4);
26
28 par.SetNeutronCuts(m);
29
30 EXPECT_STREQ(par.GetNeutronCuts().at(2)->GetName(), "cut2");
31 }
32
33 TEST(testMultiplicityCalorimetricPar, GetNeutronMultiplicity)
34 {
35 std::map<UInt_t, TCutG*> m;
36 m[0] = new TCutG("cut0", 4);
37 m[0]->SetPoint(0, 0, 0);
38 m[0]->SetPoint(1, 0, 10);
39 m[0]->SetPoint(2, 10, 0);
40 m[0]->SetPoint(3, 0, 0);
41 m[1] = new TCutG("cut1", 4);
42 m[1]->SetPoint(0, 0, 10);
43 m[1]->SetPoint(1, 0, 20);
44 m[1]->SetPoint(2, 20, 0);
45 m[1]->SetPoint(3, 10, 0);
46 m[2] = new TCutG("cut2", 4);
47 m[2]->SetPoint(0, 0, 20);
48 m[2]->SetPoint(1, 0, 30);
49 m[2]->SetPoint(2, 30, 0);
50 m[2]->SetPoint(3, 20, 0);
51
53 par.SetNeutronCuts(m);
54
55 EXPECT_EQ(par.GetNeutronMultiplicity(4, 4), 0u);
56 EXPECT_EQ(par.GetNeutronMultiplicity(9, 9), 1u);
57 EXPECT_EQ(par.GetNeutronMultiplicity(14, 14), 2u);
58 EXPECT_EQ(par.GetNeutronMultiplicity(19, 19), 3u);
59 }
60} // namespace
NeuLAND number of clusters / energy - neutron multiplicity parameter storage.
void SetNeutronCuts(const std::map< UInt_t, TCutG * > &cuts)
UInt_t GetNeutronMultiplicity(const Double_t energy, const Double_t nClusters) const