Belle II Software development
CircleRadius.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 <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleCenterXY.h>
13#include <framework/geometry/B2Vector3.h>
14
15#define CIRCLERADIUS_NAME CircleRadius
16namespace Belle2 {
26 template <typename PointType >
27 class CIRCLERADIUS_NAME : public SelectionVariable< PointType, 3, double > {
28 public:
29
32
33
35 static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
36 {
37 B2Vector3D circleCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
38
39 return CIRCLERADIUS_NAME<PointType>::calcAvgDistanceXY(outerHit, centerHit, innerHit, circleCenter);
40 } // return unit: cm
41
49 static double calcAvgDistanceXY(const PointType& a, const PointType& b, const PointType& c, const B2Vector3D& 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}
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
calculates the estimation of the circle radius of the 3-hit-tracklet, returning unit: cm.
Definition: CircleRadius.h:27
PUT_NAME_FUNCTION(CIRCLERADIUS_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
static double calcAvgDistanceXY(const PointType &a, const PointType &b, const PointType &c, const B2Vector3D &center)
helper function with calculates the average distance in XY from the given center
Definition: CircleRadius.h:49
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:35
Base class of the selection variable objects used for pair filtering.
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.