Belle II Software development
TrackFlightTimeAdjuster.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#include <tracking/trackFindingCDC/findlets/minimal/TrackFlightTimeAdjuster.h>
9
10#include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
11
12#include <tracking/trackFindingCDC/eventdata/utils/FlightTimeEstimator.h>
13
14#include <vector>
15#include <string>
16
17using namespace Belle2;
18using namespace TrackFindingCDC;
19
21{
22 return "Adjusts the flight time of tracks relative to the flight time zero location";
23}
24
25void TrackFlightTimeAdjuster::apply(std::vector<CDCTrack>& tracks)
26{
27 for (CDCTrack& track : tracks) {
28 CDCTrajectory3D startTrajectory3D = track.getStartTrajectory3D();
29 const Vector2D pos2D = startTrajectory3D.getSupport().xy();
30 const Vector2D dir2D = startTrajectory3D.getFlightDirection3DAtSupport().xy();
31 const double alpha = pos2D.angleWith(dir2D);
32 const double beta = 1;
33 const double flightTime2D =
35 const double flightTime3D = flightTime2D * hypot2(1, startTrajectory3D.getTanLambda());
36 startTrajectory3D.setFlightTime(flightTime3D);
37 track.setStartTrajectory3D(startTrajectory3D);
38 }
39}
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
Particle full three dimensional trajectory.
Vector3D getFlightDirection3DAtSupport() const
Get the unit momentum at the start point of the trajectory.
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
void setFlightTime(double flightTime)
Setter for the time when the particle reached the support point position.
Vector3D getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
static const FlightTimeEstimator & instance(std::unique_ptr< FlightTimeEstimator > replacement=nullptr)
Getter for the instance.
virtual double getFlightTime2D(const Vector2D &, double, double=1) const
Default estimator for the flight time.
void apply(std::vector< CDCTrack > &tracks) final
Adjust the flight time of the given tracks.
std::string getDescription() final
Short description of the findlet.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition: Vector2D.h:32
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition: Vector2D.h:197
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:508
Abstract base class for different kinds of events.