Belle II Software  release-05-01-25
TrackFlightTimeAdjuster.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/findlets/minimal/TrackFlightTimeAdjuster.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
13 
14 #include <tracking/trackFindingCDC/eventdata/utils/FlightTimeEstimator.h>
15 
16 #include <vector>
17 #include <string>
18 
19 using namespace Belle2;
20 using namespace TrackFindingCDC;
21 
23 {
24  return "Adjusts the flight time of tracks relative to the flight time zero location";
25 }
26 
27 void TrackFlightTimeAdjuster::apply(std::vector<CDCTrack>& tracks)
28 {
29  for (CDCTrack& track : tracks) {
30  CDCTrajectory3D startTrajectory3D = track.getStartTrajectory3D();
31  const Vector2D pos2D = startTrajectory3D.getSupport().xy();
32  const Vector2D dir2D = startTrajectory3D.getFlightDirection3DAtSupport().xy();
33  const double alpha = pos2D.angleWith(dir2D);
34  const double beta = 1;
35  const double flightTime2D =
36  FlightTimeEstimator::instance().getFlightTime2D(pos2D, alpha, beta);
37  const double flightTime3D = flightTime2D * hypot2(1, startTrajectory3D.getTanLambda());
38  startTrajectory3D.setFlightTime(flightTime3D);
39  track.setStartTrajectory3D(startTrajectory3D);
40  }
41 }
Belle2::TrackFindingCDC::CDCTrajectory3D::getTanLambda
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
Definition: CDCTrajectory3D.h:299
Belle2::TrackFindingCDC::CDCTrack
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:51
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::FlightTimeEstimator::getFlightTime2D
virtual double getFlightTime2D(const Vector2D &, double, double=1) const
Default estimator for the flight time.
Definition: FlightTimeEstimator.h:45
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::TrackFlightTimeAdjuster::apply
void apply(std::vector< CDCTrack > &tracks) final
Adjust the flight time of the given tracks.
Definition: TrackFlightTimeAdjuster.cc:27
Belle2::TrackFindingCDC::TrackFlightTimeAdjuster::getDescription
std::string getDescription() final
Short description of the findlet.
Definition: TrackFlightTimeAdjuster.cc:22
Belle2::TrackFindingCDC::CDCTrajectory3D::setFlightTime
void setFlightTime(double flightTime)
Setter for the time when the particle reached the support point position.
Definition: CDCTrajectory3D.h:372
Belle2::TrackFindingCDC::Vector3D::xy
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:500
Belle2::TrackFindingCDC::CDCTrajectory3D::getSupport
Vector3D getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
Definition: CDCTrajectory3D.h:229
Belle2::TrackFindingCDC::FlightTimeEstimator::instance
static const FlightTimeEstimator & instance(std::unique_ptr< FlightTimeEstimator > replacement=nullptr)
Getter for the instance.
Definition: FlightTimeEstimator.cc:23
Belle2::TrackFindingCDC::CDCTrajectory3D::getFlightDirection3DAtSupport
Vector3D getFlightDirection3DAtSupport() const
Get the unit momentum at the start point of the trajectory.
Definition: CDCTrajectory3D.h:222
Belle2::TrackFindingCDC::Vector2D::angleWith
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition: Vector2D.h:211
Belle2::TrackFindingCDC::CDCTrajectory3D
Particle full three dimensional trajectory.
Definition: CDCTrajectory3D.h:47