Belle II Software  release-05-01-25
test_Fitparams.h
1 #pragma once
2 
3 #include <Eigen/Core>
4 #include <gtest/gtest.h>
5 
6 #include "analysis/VertexFitting/TreeFitter/FitParams.h"
7 
8 namespace {
9 
11  class TreeFitterFitparTest : public ::testing::Test {
12  protected:
13  };
14 
15  TEST_F(TreeFitterFitparTest, Constructor)
16  {
17  TreeFitter::FitParams fitParDim3(3);
18 
20  EXPECT_TRUE((fitParDim3.getStateVector().array() == 0.0).all()) << "statevector not initialised to 0,0,...";
21 
23  EXPECT_TRUE((fitParDim3.getCovariance().array() == 0.0).all()) << "covariance not initialised to 0";
24  }
25 
27  TEST_F(TreeFitterFitparTest, Functions)
28  {
29  TreeFitter::FitParams fitParDim3(3);
30 
31  // cppcheck-suppress constStatement
32  fitParDim3.getStateVector() << 1, 2, 3;
33  fitParDim3.resetStateVector();
34  EXPECT_TRUE((fitParDim3.getStateVector().array() == 0.0).all()) << "fitParDim3.resetStateVector() didn't work";
35 
36  // cppcheck-suppress constStatement
37  fitParDim3.getCovariance() << 1, 2, 3, 4, 5, 6, 7, 8, 9;
38  fitParDim3.resetCovariance();
39  EXPECT_TRUE((fitParDim3.getCovariance().array() == 0.0).all()) << "fitParDim3.resetCovariance() didn't work";
40 
41  EXPECT_FALSE(fitParDim3.testCovariance()) << "fitParDim3.testCovariance() failed";
42 
43 
44  }
45 
46 } // namespace
TreeFitter::FitParams
Class to store and manage fitparams (statevector)
Definition: FitParams.h:29
Belle2::TEST_F
TEST_F(GlobalLabelTest, LargeNumberOfTimeDependentParameters)
Test large number of time-dep params for registration and retrieval.
Definition: globalLabel.cc:65