Belle II Software  release-05-01-25
HelixCovariance.test.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost <oliver.frost@desy.de> *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/trackFindingCDC/geometry/HelixParameters.h>
12 
13 #include <gtest/gtest.h>
14 
15 
16 using namespace Belle2;
17 using namespace TrackFindingCDC;
18 
19 TEST(TrackFindingCDCTest, geometry_HelixCovariance_constructFromPerigeeAndSZCovariance)
20 {
21  PerigeeCovariance perigeeCovariance = PerigeeCovariance::Zero();
22  {
23  using namespace NPerigeeParameterIndices;
24  perigeeCovariance(c_Curv, c_Curv) = 1;
25  perigeeCovariance(c_Curv, c_I) = 1;
26  perigeeCovariance(c_I, c_Curv) = 1;
27  perigeeCovariance(c_I, c_I) = 1;
28  }
29 
30  SZCovariance szCovariance = SZCovariance::Zero();
31  {
32  using namespace NSZParameterIndices;
33  szCovariance(c_TanL, c_TanL) = 1;
34  szCovariance(c_Z0, c_Z0) = 1;
35  }
36 
37  HelixCovariance helixCovariance = HelixUtil::stackBlocks(perigeeCovariance, szCovariance);
38  {
39  using namespace NHelixParameterIndices;
40  EXPECT_EQ(1, helixCovariance(c_Curv, c_Curv));
41  EXPECT_EQ(1, helixCovariance(c_I, c_I));
42  EXPECT_EQ(1, helixCovariance(c_Curv, c_I));
43  EXPECT_EQ(1, helixCovariance(c_I, c_Curv));
44 
45  EXPECT_EQ(1, helixCovariance(c_TanL, c_TanL));
46  EXPECT_EQ(1, helixCovariance(c_Z0, c_Z0));
47 
48  EXPECT_EQ(0, helixCovariance(c_Phi0, c_Phi0));
49  EXPECT_EQ(0, helixCovariance(c_TanL, c_Curv));
50  }
51 }
Belle2::TrackFindingCDC::NHelixParameterIndices::c_Curv
@ c_Curv
Constant to address the curvature in the xy plane.
Definition: HelixParameters.h:39
Belle2::TrackFindingCDC::PlainMatrix::Zero
static PlainMatrix< T, M, N > Zero()
Construct a matrix initialized with zeros.
Definition: PlainMatrix.h:77
Belle2::TrackFindingCDC::NHelixParameterIndices::c_TanL
@ c_TanL
Constant to address the tan lambda dip out of the xy plane.
Definition: HelixParameters.h:48
Belle2::TrackFindingCDC::NSZParameterIndices::c_TanL
@ c_TanL
Constant to address the tan lambda dip out of the xy plane.
Definition: SZParameters.h:36
Belle2::TrackFindingCDC::NPerigeeParameterIndices::c_I
@ c_I
Constant to address the impact parameter.
Definition: PerigeeParameters.h:42
Belle2::TrackFindingCDC::NSZParameterIndices::c_Z0
@ c_Z0
Constant to address the z start position.
Definition: SZParameters.h:39
Belle2::TrackFindingCDC::NHelixParameterIndices::c_Z0
@ c_Z0
Constant to address the z start position.
Definition: HelixParameters.h:51
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TEST
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Definition: utilityFunctions.cc:18
Belle2::TrackFindingCDC::NHelixParameterIndices::c_I
@ c_I
Constant to address the impact parameter.
Definition: HelixParameters.h:45
Belle2::TrackFindingCDC::NHelixParameterIndices::c_Phi0
@ c_Phi0
Constant to address the azimuth angle of the direction of flight.
Definition: HelixParameters.h:42
Belle2::TrackFindingCDC::HelixUtil::stackBlocks
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.
Definition: HelixParameters.cc:60
Belle2::TrackFindingCDC::NPerigeeParameterIndices::c_Curv
@ c_Curv
Constant to address the curvature.
Definition: PerigeeParameters.h:36