Belle II Software development
SignCurvatureXY.h
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
9#pragma once
10
11#include <tracking/trackFindingVXD/filterMap/filterFramework/SelectionVariable.h>
12#include <boost/math/special_functions/sign.hpp>
13
14#include <framework/geometry/B2Vector3.h>
15
16#define SIGNCURVATUREXY_NAME SignCurvatureXY
17
18namespace Belle2 {
27 template <typename PointType >
28 class SIGNCURVATUREXY_NAME : public SelectionVariable< PointType, 3, int > {
29 public:
30
33
38 static int value(const PointType& a, const PointType& b, const PointType& c)
39 {
40 using boost::math::sign;
41 B2Vector3D ba(a.X() - b.X(), a.Y() - b.Y(), 0.0);
42 B2Vector3D bc(b.X() - c.X(), b.Y() - c.Y(), 0.0);
43 return sign(bc.Orthogonal() * ba); //normal vector of m_vecBC times segment of ba
44 }
45 };
46
48}
B2Vector3< DataType > Orthogonal() const
Vector orthogonal to this one.
Definition: B2Vector3.h:277
calculates the sign of the curvature for three hits
PUT_NAME_FUNCTION(SIGNCURVATUREXY_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
static int value(const PointType &a, const PointType &b, const PointType &c)
calculates calculates the sign of the curvature of given 3-hit-tracklet.
Base class of the selection variable objects used for pair filtering.
Abstract base class for different kinds of events.