Belle II Software development
DeltaSoverZ.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 <math.h>
16
17#define DELTASOVERZ_NAME DeltaSoverZ
18
19namespace Belle2 {
27 template <typename PointType >
28 class DELTASOVERZ_NAME : public SelectionVariable< PointType, 3, double > {
29 public:
32
33
36 static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
37 {
38
39 B2Vector3D circleCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
40 B2Vector3D points2outerHit((outerHit.X() - circleCenter.X()),
41 (outerHit.Y() - circleCenter.Y()),
42 (outerHit.Z() - circleCenter.Z()));
43 B2Vector3D points2centerHit((centerHit.X() - circleCenter.X()),
44 (centerHit.Y() - circleCenter.Y()),
45 (centerHit.Z() - circleCenter.Z()));
46 B2Vector3D points2innerHit((innerHit.X() - circleCenter.X()),
47 (innerHit.Y() - circleCenter.Y()),
48 (innerHit.Z() - circleCenter.Z()));
49
50 double alfaOC = acos(CosDirectionXY<B2Vector3D>::value(points2outerHit, points2centerHit));
51 double alfaCI = acos(CosDirectionXY<B2Vector3D>::value(points2centerHit, points2innerHit));
52
53 // equals to alfaAB/dZAB and alfaBC/dZBC, but this solution here can not produce a division by zero:
54 return (alfaOC * double(centerHit.Z() - innerHit.Z())) - (alfaCI * double(outerHit.Z() - centerHit.Z()));
55 } // return unit: radians*cm
56 };
57
59}
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 arc length per unit in z.
Definition: DeltaSoverZ.h:28
PUT_NAME_FUNCTION(DELTASOVERZ_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 arc length per unit in z.
Definition: DeltaSoverZ.h:36
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.