Belle II Software  release-08-01-10
evtBCLFF.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <generators/evtgen/models/EvtBCLFF.h>
9 #include <generators/evtgen/EvtGenInterface.h>
10 #include <framework/utilities/FileSystem.h>
11 
12 #include <EvtGenBase/EvtId.hh>
13 #include <EvtGenBase/EvtPDL.hh>
14 
15 #include <gtest/gtest.h>
16 
17 #include <string>
18 
19 namespace Belle2 {
26  class EvtBCLFFTest : public ::testing::Test {
27  protected:
29  static void SetUpTestCase()
30  {
31  std::string decayFileName = FileSystem::findFile("decfiles/dec/DECAY_BELLE2.DEC");
32  s_evtgen = EvtGenInterface::createEvtGen(decayFileName, true);
33  }
34 
36  static void TearDownTestCase()
37  {
38  delete s_evtgen;
39  s_evtgen = nullptr;
40  }
41 
43  static EvtGen* s_evtgen;
44  };
45 
46 
47  EvtGen* EvtBCLFFTest::s_evtgen = nullptr;
48 
51  {
52  EvtId B0 = EvtPDL::getId("B0");
53  EvtId M = EvtPDL::getId("pi+");
54  const auto mB = EvtPDL::getMeanMass(B0);
55  const auto mB2 = mB * mB;
56  const auto mM = EvtPDL::getMeanMass(M);
57  const auto mM2 = mM * mM;
58  const auto q2min = 0.0;
59  const auto q2max = mB2 + mM2 - 2 * mB * mM;
60 
61  int nArguments = 8;
62  double arguments[] = {0.419, -0.495, -0.43, 0.22, 0.510, -1.700, 1.53, 4.52};
63 
64  EvtBCLFF bclff(nArguments, arguments);
65 
66  double fplus = 0;
67  double fzero = 0;
68 
69  bclff.getscalarff(B0, M, q2min, 0, &fplus, &fzero);
70 
71  ASSERT_NEAR(0.253, fplus, 0.003);
72  ASSERT_NEAR(0.253, fzero, 0.003);
73 
74  bclff.getscalarff(B0, M, q2max, 0, &fplus, &fzero);
75 
76  ASSERT_NEAR(7.620, fplus, 0.003);
77  ASSERT_NEAR(1.006, fzero, 0.003);
78 
79 
80  } // Scalar Tests
81 
84  {
85  EvtId B0 = EvtPDL::getId("B0");
86  EvtId M = EvtPDL::getId("rho+");
87  const auto mB = EvtPDL::getMeanMass(B0);
88  const auto mB2 = mB * mB;
89  const auto mM = EvtPDL::getMeanMass(M);
90  const auto mM2 = mM * mM;
91  const auto q2min = 0.0;
92  const auto q2max = mB2 + mM2 - 2 * mB * mM;
93 
94  int nArguments = 11;
95  double arguments[] = { -0.833, 1.331, 0.262, 0.394, 0.163, 0.297, 0.759, 0.465, 0.327, -0.86 , 1.802};
96 
97  EvtBCLFF bclFF(nArguments, arguments);
98 
99  double A0 = 0;
100  double A1 = 0;
101  double A2 = 0;
102  double V = 0;
103 
104  bclFF.getvectorff(B0, M, q2min, 0, &A1, &A2, &V, &A0);
105 
106  ASSERT_NEAR(0.356, A0, 0.003);
107  ASSERT_NEAR(0.262, A1, 0.003);
108  ASSERT_NEAR(0.327, V, 0.003);
109 
110  bclFF.getvectorff(B0, M, q2max, 0, &A1, &A2, &V, &A0);
111 
112  ASSERT_NEAR(2.123, A0, 0.003);
113  ASSERT_NEAR(0.497, A1, 0.003);
114  ASSERT_NEAR(2.014, V, 0.003);
115 
116  } // Vector Tests
117 
119 }
The fixture for testing the EvtBCLFF.
Definition: evtBCLFF.cc:26
static void SetUpTestCase()
sets up the test
Definition: evtBCLFF.cc:29
static void TearDownTestCase()
cleans up after the test
Definition: evtBCLFF.cc:36
BCL Form Factors.
Definition: EvtBCLFF.h:21
static EvtGen * createEvtGen(const std::string &decayFileName, bool coherentMixing)
Create and initialize an EvtGen instance:
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:148
TEST_F(GlobalLabelTest, LargeNumberOfTimeDependentParameters)
Test large number of time-dep params for registration and retrieval.
Definition: globalLabel.cc:72
void getscalarff(EvtId parent, EvtId daughter, double t, double, double *fpf, double *f0f)
Scalar FF's.
Definition: EvtBCLFF.cc:30
static EvtGen * s_evtgen
pointer to the evtgen instance
Definition: evtBCLFF.cc:43
void getvectorff(EvtId parent, EvtId daughter, double t, double, double *a1f, double *a2f, double *vf, double *a0f)
Vector FF's.
Definition: EvtBCLFF.cc:71
Abstract base class for different kinds of events.