Belle II Software  release-05-01-25
CircleRadius.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 <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleCenterXY.h>
15 #include <framework/geometry/B2Vector3.h>
16 
17 #define CIRCLERADIUS_NAME CircleRadius
18 namespace Belle2 {
28  template <typename PointType >
29  class CIRCLERADIUS_NAME : public SelectionVariable< PointType , 3, double > {
30  public:
31 
34 
35 
37  static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
38  {
39  B2Vector3D circleCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
40 
41  return CIRCLERADIUS_NAME<PointType>::calcAvgDistanceXY(outerHit, centerHit, innerHit, circleCenter);
42  } // return unit: cm
43 
49  static double calcAvgDistanceXY(const PointType& a, const PointType& b, const PointType& c, const B2Vector3<double>& center)
50  {
51  return (sqrt(std::pow(center.X() - a.X(), 2) + std::pow(center.Y() - a.Y(), 2)) +
52  sqrt(std::pow(center.X() - b.X(), 2) + std::pow(center.Y() - b.Y(), 2)) +
53  sqrt(std::pow(center.X() - c.X(), 2) + std::pow(center.Y() - c.Y(), 2))) / 3.;
54  } // = radius in [cm], sign here not needed. normally: signKappaAB/normAB1
55 
56 
57  };
58 
60 }
Belle2::CIRCLERADIUS_NAME
calculates the estimation of the circle radius of the 3-hit-tracklet, returning unit: cm.
Definition: CircleRadius.h:29
Belle2::B2Vector3< double >
Belle2::CIRCLERADIUS_NAME::calcAvgDistanceXY
static double calcAvgDistanceXY(const PointType &a, const PointType &b, const PointType &c, const B2Vector3< double > &center)
helper function with calculates the average distance in XY from the given center
Definition: CircleRadius.h:49
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CIRCLERADIUS_NAME::PUT_NAME_FUNCTION
PUT_NAME_FUNCTION(CIRCLERADIUS_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::CIRCLERADIUS_NAME::value
static double value(const PointType &outerHit, const PointType &centerHit, const PointType &innerHit)
calculates the estimation of the circle radius of the 3-hit-tracklet, returning unit: cm.
Definition: CircleRadius.h:37
Belle2::B2Vector3::X
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:430
Belle2::B2Vector3::Y
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:432