Belle II Software development
AngleXYFull.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/twoHitVariables/CosDirectionXY.h>
13#include <framework/geometry/B2Vector3.h>
14#include <cmath>
15
16#define ANGLEXYFULL_NAME AngleXYFull
17
18namespace Belle2 {
28 template <typename PointType >
29 class ANGLEXYFULL_NAME : public SelectionVariable< PointType, 3, double > {
30 public:
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 double result = acos(CosDirectionXY<B2Vector3D>::value(outerVector, innerVector)); // 0-pi
42 result *= double(180. / M_PI); // do conversion into degree
43 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
44 } // return unit: ° (0 - 180°)
45 };
46
48}
calculates the angle between the hits/vectors (XY), returning unit: angle in degrees.
Definition: AngleXYFull.h:29
PUT_NAME_FUNCTION(ANGLEXYFULL_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 (XY), returning unit: angle in degrees
Definition: AngleXYFull.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
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.