Belle II Software development
HelixCovariance.test.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
9#include <tracking/trackFindingCDC/geometry/HelixParameters.h>
10
11#include <gtest/gtest.h>
12
13
14using namespace Belle2;
15using namespace TrackFindingCDC;
16
17TEST(TrackFindingCDCTest, geometry_HelixCovariance_constructFromPerigeeAndSZCovariance)
18{
19 PerigeeCovariance perigeeCovariance = PerigeeCovariance::Zero();
20 {
21 using namespace NPerigeeParameterIndices;
22 perigeeCovariance(c_Curv, c_Curv) = 1;
23 perigeeCovariance(c_Curv, c_I) = 1;
24 perigeeCovariance(c_I, c_Curv) = 1;
25 perigeeCovariance(c_I, c_I) = 1;
26 }
27
28 SZCovariance szCovariance = SZCovariance::Zero();
29 {
30 using namespace NSZParameterIndices;
31 szCovariance(c_TanL, c_TanL) = 1;
32 szCovariance(c_Z0, c_Z0) = 1;
33 }
34
35 HelixCovariance helixCovariance = HelixUtil::stackBlocks(perigeeCovariance, szCovariance);
36 {
37 using namespace NHelixParameterIndices;
38 EXPECT_EQ(1, helixCovariance(c_Curv, c_Curv));
39 EXPECT_EQ(1, helixCovariance(c_I, c_I));
40 EXPECT_EQ(1, helixCovariance(c_Curv, c_I));
41 EXPECT_EQ(1, helixCovariance(c_I, c_Curv));
42
43 EXPECT_EQ(1, helixCovariance(c_TanL, c_TanL));
44 EXPECT_EQ(1, helixCovariance(c_Z0, c_Z0));
45
46 EXPECT_EQ(0, helixCovariance(c_Phi0, c_Phi0));
47 EXPECT_EQ(0, helixCovariance(c_TanL, c_Curv));
48 }
49}
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:40
static PlainMatrix< T, M, N > Zero()
Construct a matrix initialized with zeros.
Definition: PlainMatrix.h:67
Abstract base class for different kinds of events.
static HelixUtil::CovarianceMatrix stackBlocks(const PerigeeUtil::CovarianceMatrix &perigeeCov, const SZUtil::CovarianceMatrix &szCov)
Combine covariance matrices from the xy space and the sz space in their respective blocks.