Belle II Software  release-05-01-25
HelixParameterFit.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 <tracking/trackFindingVXD/filterMap/twoHitVariables/CosDirectionXY.h>
16 #include <framework/geometry/B2Vector3.h>
17 #include <cmath>
18 
19 #define HELIXPARAMETERFIT_NAME HelixParameterFit
20 
21 namespace Belle2 {
31  template <typename PointType >
32  class HELIXPARAMETERFIT_NAME : public SelectionVariable< PointType , 3, double > {
33  public:
36 
37 
39  static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
40  {
41 
42  B2Vector3D cCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
43 
44  B2Vector3D vecOuter2cC(outerHit.X() - cCenter.X(), outerHit.Y() - cCenter.Y(), outerHit.Z() - cCenter.Z());
45  B2Vector3D vecCenter2cC(centerHit.X() - cCenter.X(), centerHit.Y() - cCenter.Y(), centerHit.Z() - cCenter.Z());
46  B2Vector3D vecInner2cC(innerHit.X() - cCenter.X(), innerHit.Y() - cCenter.Y(), innerHit.Z() - cCenter.Z());
47 
48  double alfaAB = CosDirectionXY<B2Vector3D>::value(vecOuter2cC, vecCenter2cC);
49  double alfaBC = CosDirectionXY<B2Vector3D>::value(vecCenter2cC, vecInner2cC);
50 
51  // real calculation: ratio is (m_vecij[2] = deltaZ): alfaAB/deltaZab : alfaBC/deltaZbc, the following equation saves two times '/'
52  double result = (alfaAB * double(centerHit.Z() - innerHit.Z())) / (alfaBC * double(outerHit.Z() - centerHit.Z()));
53 
54  return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
55  } // return unit: none
56  };
57 
59 }
Belle2::HELIXPARAMETERFIT_NAME::PUT_NAME_FUNCTION
PUT_NAME_FUNCTION(HELIXPARAMETERFIT_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
Belle2::HELIXPARAMETERFIT_NAME
calculates the helixparameter describing the deviation in z per unit angle, returning unit: none.
Definition: HelixParameterFit.h:32
Belle2::B2Vector3::Z
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:434
Belle2::B2Vector3< double >
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::HELIXPARAMETERFIT_NAME::value
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
Definition: HelixParameterFit.h:39
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