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/trackingUtilities/eventdata/tracks/CDCTrack.h>
11
12#include <tracking/trackFindingCDC/eventdata/utils/FlightTimeEstimator.h>
13
14#include <framework/geometry/VectorUtil.h>
15
16#include <Math/Vector2D.h>
17#include <Math/VectorUtil.h>
18
19#include <vector>
20#include <string>
21
22using namespace Belle2;
23using namespace TrackFindingCDC;
24using namespace TrackingUtilities;
25
27{
28 return "Adjusts the flight time of tracks relative to the flight time zero location";
29}
30
31void TrackFlightTimeAdjuster::apply(std::vector<CDCTrack>& tracks)
32{
33 for (CDCTrack& track : tracks) {
34 CDCTrajectory3D startTrajectory3D = track.getStartTrajectory3D();
35 const ROOT::Math::XYVector pos2D = VectorUtil::getXYVector(startTrajectory3D.getSupport());
36 const ROOT::Math::XYVector dir2D = VectorUtil::getXYVector(startTrajectory3D.getFlightDirection3DAtSupport());
37 const double alpha = ROOT::Math::VectorUtil::DeltaPhi(pos2D, dir2D);
38 const double beta = 1;
39 const double flightTime2D =
41 const double flightTime3D = flightTime2D * hypot2(1, startTrajectory3D.getTanLambda());
42 startTrajectory3D.setFlightTime(flightTime3D);
43 track.setStartTrajectory3D(startTrajectory3D);
44 }
45}
static const FlightTimeEstimator & instance(std::unique_ptr< FlightTimeEstimator > replacement=nullptr)
Getter for the instance.
virtual double getFlightTime2D(const ROOT::Math::XYVector &, double, double=1) const
Default estimator for the flight time.
void apply(std::vector< TrackingUtilities::CDCTrack > &tracks) final
Adjust the flight time of the given tracks.
std::string getDescription() final
Short description of the findlet.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:37
Particle full three dimensional 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.
ROOT::Math::XYZVector getFlightDirection3DAtSupport() const
Get the unit momentum at the start point of the trajectory.
ROOT::Math::XYZVector getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
Abstract base class for different kinds of events.