Belle II Software  release-05-01-25
SignCurvatureXY.h
1 /**************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2014 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Jakob Lettenbichler (jakob.lettenbichler@oeaw.ac.at) *
7 * *
8 * This software is provided "as is" without any warranty. *
9 **************************************************************************/
10 
11 #pragma once
12 
13 #include <tracking/trackFindingVXD/filterMap/filterFramework/SelectionVariable.h>
14 #include <boost/math/special_functions/sign.hpp>
15 
16 #include <framework/geometry/B2Vector3.h>
17 
18 #define SIGNCURVATUREXY_NAME SignCurvatureXY
19 
20 namespace Belle2 {
29  template <typename PointType >
30  class SIGNCURVATUREXY_NAME : public SelectionVariable< PointType , 3, int > {
31  public:
32 
35 
40  static int value(const PointType& a, const PointType& b, const PointType& c)
41  {
42  using boost::math::sign;
43  B2Vector3<double> ba(a.X() - b.X(), a.Y() - b.Y(), 0.0);
44  B2Vector3<double> bc(b.X() - c.X(), b.Y() - c.Y(), 0.0);
45  return sign(bc.Orthogonal() * ba); //normal vector of m_vecBC times segment of ba
46  }
47  };
48 
50 }
Belle2::SIGNCURVATUREXY_NAME::value
static int value(const PointType &a, const PointType &b, const PointType &c)
calculates calculates the sign of the curvature of given 3-hit-tracklet.
Definition: SignCurvatureXY.h:40
Belle2::B2Vector3::Orthogonal
B2Vector3< DataType > Orthogonal() const
Vector orthogonal to this one.
Definition: B2Vector3.h:276
Belle2::B2Vector3< double >
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SIGNCURVATUREXY_NAME::PUT_NAME_FUNCTION
PUT_NAME_FUNCTION(SIGNCURVATUREXY_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
Belle2::SelectionVariable
Base class of the selection variable objects used for pair filtering.
Definition: SelectionVariable.h:54
Belle2::SIGNCURVATUREXY_NAME
calculates the sign of the curvature for three hits
Definition: SignCurvatureXY.h:30