8#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
10#include <tracking/trackFindingCDC/topology/WireLine.h>
12#include <framework/logging/Logger.h>
14#include <gtest/gtest.h>
17using namespace TrackFindingCDC;
20TEST(TrackFindingCDCTest, eventdata_trajectories_CDCTrajectory2D_constructorPosMomCharge)
25 ESign newChargeSign = ESign::c_Plus;
28 CDCTrajectory2D trajectory(newPos2D, newTime, newMom2D, newChargeSign, bZ);
30 Vector2D mom2D = trajectory.getMom2DAtSupport(bZ);
31 Vector2D pos2D = trajectory.getSupport();
32 ESign chargeSign = trajectory.getChargeSign();
34 EXPECT_NEAR(newMom2D.x(), mom2D.
x(), 10e-7);
35 EXPECT_NEAR(newMom2D.y(), mom2D.
y(), 10e-7);
37 EXPECT_NEAR(newPos2D.x(), pos2D.
x(), 10e-7);
38 EXPECT_NEAR(newPos2D.y(), pos2D.
y(), 10e-7);
40 EXPECT_NEAR(newChargeSign, chargeSign, 10e-7);
44TEST(TrackFindingCDCTest, eventdata_trajectories_CDCTrajectory2D_reconstruct)
48 WireLine wireLine(forward, backward, 0);
50 double localPhi0 = M_PI / 3;
51 double localCurv = -2.0;
52 double localImpact = 0.0;
56 Vector3D positionOnWire = wireLine.nominalPos3DAtZ(localOrigin.z());
57 EXPECT_NEAR(localOrigin.x(), positionOnWire.
x(), 10e-7);
58 EXPECT_NEAR(localOrigin.y(), positionOnWire.
y(), 10e-7);
59 EXPECT_NEAR(localOrigin.z(), positionOnWire.
z(), 10e-7);
62 double arcLength2D = trajectory2D.setLocalOrigin(
Vector2D(0.0, 0.0));
65 double distance = trajectory2D.getDist2D(localOrigin.xy());
66 EXPECT_NEAR(0, distance, 10e-7);
69 Vector2D extrapolation2D = trajectory2D.getPos2DAtArcLength2D(-arcLength2D);
70 EXPECT_NEAR(localOrigin.x(), extrapolation2D.
x(), 10e-7);
71 EXPECT_NEAR(localOrigin.y(), extrapolation2D.
y(), 10e-7);
73 Vector3D recoPos3D = trajectory2D.reconstruct3D(wireLine);
77 EXPECT_NEAR(localOrigin.x(), recoPos3D.
x(), 10e-7);
78 EXPECT_NEAR(localOrigin.y(), recoPos3D.
y(), 10e-7);
79 EXPECT_NEAR(localOrigin.z(), recoPos3D.
z(), 10e-7);
Particle trajectory as it is seen in xy projection represented as a circle.
Adds an uncertainty matrix to the circle in perigee parameterisation.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double x() const
Getter for the x coordinate.
double y() const
Getter for the y coordinate.
A three dimensional vector.
double x() const
Getter for the x coordinate.
double y() const
Getter for the y coordinate.
double z() const
Getter for the z coordinate.
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
ESign
Enumeration for the distinct sign values of floating point variables.
Abstract base class for different kinds of events.