Belle II Software  release-05-01-25
DeltaSoverZ.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 <math.h>
18 
19 #define DELTASOVERZ_NAME DeltaSoverZ
20 
21 namespace Belle2 {
29  template <typename PointType >
30  class DELTASOVERZ_NAME : public SelectionVariable< PointType , 3, double > {
31  public:
34 
35 
38  static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
39  {
40 
41  B2Vector3D circleCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
42  B2Vector3D points2outerHit((outerHit.X() - circleCenter.X()),
43  (outerHit.Y() - circleCenter.Y()),
44  (outerHit.Z() - circleCenter.Z()));
45  B2Vector3D points2centerHit((centerHit.X() - circleCenter.X()),
46  (centerHit.Y() - circleCenter.Y()),
47  (centerHit.Z() - circleCenter.Z()));
48  B2Vector3D points2innerHit((innerHit.X() - circleCenter.X()),
49  (innerHit.Y() - circleCenter.Y()),
50  (innerHit.Z() - circleCenter.Z()));
51 
52  double alfaOC = acos(CosDirectionXY<B2Vector3D>::value(points2outerHit, points2centerHit));
53  double alfaCI = acos(CosDirectionXY<B2Vector3D>::value(points2centerHit, points2innerHit));
54 
55  // equals to alfaAB/dZAB and alfaBC/dZBC, but this solution here can not produce a division by zero:
56  return (alfaOC * double(centerHit.Z() - innerHit.Z())) - (alfaCI * double(outerHit.Z() - centerHit.Z()));
57  } // return unit: radians*cm
58  };
59 
61 }
Belle2::B2Vector3::Z
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:434
Belle2::B2Vector3< double >
Belle2::DELTASOVERZ_NAME
calculates the helixparameter describing the deviation in arc length per unit in z.
Definition: DeltaSoverZ.h:30
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::DELTASOVERZ_NAME::PUT_NAME_FUNCTION
PUT_NAME_FUNCTION(DELTASOVERZ_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::DELTASOVERZ_NAME::value
static double value(const PointType &outerHit, const PointType &centerHit, const PointType &innerHit)
calculates the helixparameter describing the deviation in arc length per unit in z.
Definition: DeltaSoverZ.h:38
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