Belle II Software development
CDCBField.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/eventdata/trajectories/CDCBFieldUtil.h>
10#include <framework/geometry/BFieldManager.h>
11#include <gtest/gtest.h>
12
13
14using namespace Belle2;
15using namespace TrackFindingCDC;
16
17
18TEST(TrackFindingCDCTest, eventdata_trajectories_CDCBField_getBFieldZSign)
19{
20 ROOT::Math::XYZVector bFieldAtOrigin = BFieldManager::getField(0, 0, 0) / Unit::T;
21 Double_t bZAtOrigin = bFieldAtOrigin.Z();
22 ESign bZSignAtOrigin = sign(bZAtOrigin);
23 EXPECT_EQ(bZSignAtOrigin, CDCBFieldUtil::getBFieldZSign());
24}
static ESign getBFieldZSign()
Getter for the sign of the magnetic field in z direction.
static const double T
[tesla]
Definition: Unit.h:120
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Definition: BFieldManager.h:91
ESign
Enumeration for the distinct sign values of floating point variables.
Definition: ESign.h:27
Abstract base class for different kinds of events.