Belle II Software development
HelixParameterFit.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 <tracking/trackFindingVXD/filterMap/twoHitVariables/CosDirectionXY.h>
14#include <framework/geometry/B2Vector3.h>
15#include <cmath>
16
17#define HELIXPARAMETERFIT_NAME HelixParameterFit
18
19namespace Belle2 {
29 template <typename PointType >
30 class HELIXPARAMETERFIT_NAME : public SelectionVariable< PointType, 3, double > {
31 public:
34
35
37 static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
38 {
39
40 B2Vector3D cCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
41
42 B2Vector3D vecOuter2cC(outerHit.X() - cCenter.X(), outerHit.Y() - cCenter.Y(), outerHit.Z() - cCenter.Z());
43 B2Vector3D vecCenter2cC(centerHit.X() - cCenter.X(), centerHit.Y() - cCenter.Y(), centerHit.Z() - cCenter.Z());
44 B2Vector3D vecInner2cC(innerHit.X() - cCenter.X(), innerHit.Y() - cCenter.Y(), innerHit.Z() - cCenter.Z());
45
46 double alfaAB = CosDirectionXY<B2Vector3D>::value(vecOuter2cC, vecCenter2cC);
47 double alfaBC = CosDirectionXY<B2Vector3D>::value(vecCenter2cC, vecInner2cC);
48
49 // real calculation: ratio is (m_vecij[2] = deltaZ): alfaAB/deltaZab : alfaBC/deltaZbc, the following equation saves two times '/'
50 double result = (alfaAB * double(centerHit.Z() - innerHit.Z())) / (alfaBC * double(outerHit.Z() - centerHit.Z()));
51
52 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
53 } // return unit: none
54 };
55
57}
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435
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 helixparameter describing the deviation in z per unit angle, returning unit: none.
PUT_NAME_FUNCTION(HELIXPARAMETERFIT_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
static double value(const PointType &outerHit, const PointType &centerHit, const PointType &innerHit)
calculates the helixparameter describing the deviation in z per unit angle, returning unit: none
Base class of the selection variable objects used for pair filtering.
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.