Belle II Software development
PhiTrackRelationFilter.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/filters/trackRelation/PhiTrackRelationFilter.h>
9
10#include <tracking/trackingUtilities/eventdata/tracks/CDCTrack.h>
11
12#include <tracking/trackingUtilities/numerics/Angle.h>
13
14#include <tracking/trackingUtilities/utilities/StringManipulation.h>
15
16#include <framework/core/ModuleParamList.templateDetails.h>
17
18using namespace Belle2;
19using namespace TrackFindingCDC;
20using namespace TrackingUtilities;
21
23 const std::string& prefix)
24{
25 moduleParamList->addParameter(prefixed(prefix, "maximalPhiDistance"),
27 "Maximal Phi distance below to tracks should be merged.",
29}
30
31Weight PhiTrackRelationFilter::operator()(const CDCTrack& fromTrack, const CDCTrack& toTrack)
32{
33 // Make sure we only have one relation out of A -> B and B -> A
34 if (fromTrack.getStartRecoPos3D().y() < toTrack.getStartRecoPos3D().y()) {
35 return NAN;
36 }
37
38 const double lhsPhi = fromTrack.getStartTrajectory3D().getFlightDirection3DAtSupport().phi();
39 const double rhsPhi = toTrack.getStartTrajectory3D().getFlightDirection3DAtSupport().phi();
40
41 const double phiDistance = std::fabs(AngleUtil::normalised(lhsPhi - rhsPhi));
42
43 if (phiDistance > m_param_maximalPhiDistance) {
44 return NAN;
45 } else {
46 return phiDistance;
47 }
48}
The Module parameter list class.
double m_param_maximalPhiDistance
Parameter : The maximal deviation in phi between the trajectories of the track.
TrackingUtilities::Weight operator()(const TrackingUtilities::CDCTrack &fromTrack, const TrackingUtilities::CDCTrack &toTrack) final
Implementation of the phi calculation.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Export all parameters.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:39
const Vector3D & getStartRecoPos3D() const
Getter for the position of the first reconstructed hit.
Definition CDCTrack.h:83
const CDCTrajectory3D & getStartTrajectory3D() const
Getter for the two dimensional trajectory.
Definition CDCTrack.h:110
Vector3D getFlightDirection3DAtSupport() const
Get the unit momentum at the start point of the trajectory.
double phi() const
Getter for the azimuth angle.
Definition Vector3D.h:545
double y() const
Getter for the y coordinate.
Definition Vector3D.h:489
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.
static double normalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].
Definition Angle.h:33