Belle II Software development
FourHitVariables.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#pragma once
9
10#include <tracking/vxdHoughTracking/filters/pathFilters/ThreeHitVariables.h>
11#include <tracking/spacePointCreation/SpacePoint.h>
12#include <framework/geometry/B2Vector3.h>
13
14#include <cmath>
15
16namespace Belle2 {
21 namespace vxdHoughTracking {
22
25 public:
27 FourHitVariables() : m_oHit(0., 0., 0.), m_ocHit(0., 0., 0.), m_icHit(0., 0., 0.), m_iHit(0., 0., 0.)
28 {};
29
35 FourHitVariables(const B2Vector3D& oHit, const B2Vector3D& ocHit, const B2Vector3D& icHit, const B2Vector3D& iHit) :
36 m_outerThreeHitVariables(oHit, ocHit, icHit), m_innerThreeHitVariables(ocHit, icHit, iHit),
37 m_oHit(oHit), m_ocHit(ocHit), m_icHit(icHit), m_iHit(iHit)
38 {
39 };
40
46 void setHits(const B2Vector3D& oHit, const B2Vector3D& ocHit, const B2Vector3D& icHit, const B2Vector3D& iHit)
47 {
48 m_oHit = oHit;
49 m_ocHit = ocHit;
50 m_icHit = icHit;
51 m_iHit = iHit;
52 m_outerThreeHitVariables = ThreeHitVariables(oHit, ocHit, icHit);
53 m_innerThreeHitVariables = ThreeHitVariables(ocHit, icHit, iHit);
54 }
55
58 {
59 B2Vector3D outerCircleCenter = m_outerThreeHitVariables.getCircleCenterXY();
60 B2Vector3D innerCircleCenter = m_innerThreeHitVariables.getCircleCenterXY();
61 if (outerCircleCenter.Perp2() > 1e30 or innerCircleCenter.Perp2() > 1e30) {
62 return NAN;
63 }
64 double outerCircleRadius = m_outerThreeHitVariables.calcAvgDistanceXY(outerCircleCenter);
65 double innerCircleRadius = m_innerThreeHitVariables.calcAvgDistanceXY(innerCircleCenter);
66
67 return outerCircleRadius - innerCircleRadius;
68 }
69
70
73 {
74 B2Vector3D outerCircleCenter = m_outerThreeHitVariables.getCircleCenterXY();
75 B2Vector3D innerCircleCenter = m_innerThreeHitVariables.getCircleCenterXY();
76 if (outerCircleCenter.Perp2() > 1e30 or innerCircleCenter.Perp2() > 1e30) {
77 return NAN;
78 }
79
80 return fabs(outerCircleCenter.Perp() - innerCircleCenter.Perp());
81 }
82
83
85 double getDeltaPT()
86 {
87 B2Vector3D outerCircleCenter = m_outerThreeHitVariables.getCircleCenterXY();
88 B2Vector3D innerCircleCenter = m_innerThreeHitVariables.getCircleCenterXY();
89 if (outerCircleCenter.Perp2() > 1e30 or innerCircleCenter.Perp2() > 1e30) {
90 return NAN;
91 }
92 double outerCircleRadius = m_outerThreeHitVariables.calcAvgDistanceXY(outerCircleCenter);
93 double innerCircleRadius = m_innerThreeHitVariables.calcAvgDistanceXY(innerCircleCenter);
94
95 return fabs(0.00299792458 * m_BFieldZ * (outerCircleRadius - innerCircleRadius));
96 }
97
100 void setBFieldZ(const double bfieldZ = 1.5) { m_BFieldZ = bfieldZ; }
101
102 private:
116 double m_BFieldZ = 1.5;
117
118 };
119
120 }
122}
DataType Perp2() const
The transverse component squared (R^2 in cylindrical coordinate system).
Definition B2Vector3.h:198
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
Definition B2Vector3.h:202
FourHitVariables(const B2Vector3D &oHit, const B2Vector3D &ocHit, const B2Vector3D &icHit, const B2Vector3D &iHit)
actual useful constructor
void setBFieldZ(const double bfieldZ=1.5)
Set the B-Field value used for pT calculations.
double getCircleCenterPositionDifference()
calculates the distance between the estimated circle centers (using 2 subsets of given hits) in the x...
void setHits(const B2Vector3D &oHit, const B2Vector3D &ocHit, const B2Vector3D &icHit, const B2Vector3D &iHit)
Set hits if not given in constructor of if they need to be changed.
B2Vector3D m_ocHit
second-to-outer hit position
ThreeHitVariables m_innerThreeHitVariables
ThreeHitVariables getter for the inner three hits.
double m_BFieldZ
BField along z to estimate pT.
B2Vector3D m_oHit
outermost hit position
ThreeHitVariables m_outerThreeHitVariables
ThreeHitVariables getter for the outer three hits.
double getDeltaPT()
calculates dpt-value (dpt= difference in transverse momentum of 2 subsets of the hits),...
B2Vector3D m_iHit
innermost hit position
double getCircleRadiusDifference()
calculates dpt-value (dpt= difference in transverse momentum of 2 subsets of the hits),...
B2Vector3D m_icHit
second-to-inner hit position
Class that allows the calculation of simple variables to estimate the quality of a triplet of hits.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition B2Vector3.h:522
Abstract base class for different kinds of events.