Belle II Software  release-05-01-25
SignCurvatureXYError.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 <framework/geometry/B2Vector3.h>
15 
16 #include <math.h>
17 
18 #define SIGNCURVATUREXYERROR_NAME SignCurvatureXYError
19 
20 namespace Belle2 {
29  template <typename PointType >
30  class SIGNCURVATUREXYERROR_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  B2Vector3<double> sigma_a = a.getPositionError();
43  B2Vector3<double> sigma_b = b.getPositionError();
44  B2Vector3<double> sigma_c = c.getPositionError();
45 
46  B2Vector3<double> c2b(b.X() - c.X(), b.Y() - c.Y(), 0.0);
47  B2Vector3<double> b2a(a.X() - b.X(), a.Y() - b.Y(), 0.0);
48  //TODO: check if acos of the dot product is better (faster)
49  double angle = atan2(b2a[0], b2a[1]) - atan2(c2b[0], c2b[1]);
50  //TODO 1/3...mean of the sigmas. Possible improvement: Use a parameter instead, and determine with simulated events.
51  double sigmaan = (sigma_a.Mag() + sigma_b.Mag() + sigma_c.Mag()) / (3.*(c2b.Mag() + b2a.Mag()));
52  if (angle < (-sigmaan)) { return -1; }
53  else if (angle > sigmaan) {return 1; }
54  else { return 0; }
55  }
56 
57  };
58 
60 }
Belle2::SIGNCURVATUREXYERROR_NAME::PUT_NAME_FUNCTION
PUT_NAME_FUNCTION(SIGNCURVATUREXYERROR_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
Belle2::B2Vector3< double >
Belle2::SIGNCURVATUREXYERROR_NAME
calculates the sign of the curvature for three hits
Definition: SignCurvatureXYError.h:30
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SelectionVariable
Base class of the selection variable objects used for pair filtering.
Definition: SelectionVariable.h:54
Belle2::B2Vector3::Mag
DataType Mag() const
The magnitude (rho in spherical coordinate system).
Definition: B2Vector3.h:158
Belle2::SIGNCURVATUREXYERROR_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: SignCurvatureXYError.h:40