Belle II Software development
AngleRZFull.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 <framework/geometry/B2Vector3.h>
13#include <math.h>
14
15#define ANGLERZFULL_NAME AngleRZFull
16
17namespace Belle2 {
27 template <typename PointType >
28 class ANGLERZFULL_NAME : public SelectionVariable< PointType, 3, double > {
29 public:
32
33
35 static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
36 {
37
38 B2Vector3D outerVector(outerHit.X() - centerHit.X(), outerHit.Y() - centerHit.Y(), outerHit.Z() - centerHit.Z());
39 B2Vector3D innerVector(centerHit.X() - innerHit.X(), centerHit.Y() - innerHit.Y(), centerHit.Z() - innerHit.Z());
40
41 B2Vector3D rzVecAB(outerVector.Perp(), outerVector[2], 0.);
42 B2Vector3D rzVecBC(innerVector.Perp(), innerVector[2], 0.);
43
44 double result = acos(CosDirectionXY<B2Vector3D>::value(rzVecAB, rzVecBC)); // 0-pi
45 result *= double(180. / M_PI);
46 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
47 } // return unit: ° (0 - 180°)
48 };
49
51}
calculates the angle between the hits/vectors (RZ), returning unit: angle in degrees.
Definition: AngleRZFull.h:28
PUT_NAME_FUNCTION(ANGLERZFULL_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 angle between the hits/vectors (RZ), returning unit: angle in degrees
Definition: AngleRZFull.h:35
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
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
Definition: B2Vector3.h:200
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.