Belle II Software development
CosDirectionXY.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 <cmath>
13
14#define COSDIRECTIONXY_NAME CosDirectionXY
15
16namespace Belle2 {
24 template <typename PointType >
25 class COSDIRECTIONXY_NAME : public SelectionVariable< PointType, 2, double > {
26 public:
29
31 static double value(const PointType& outerHit, const PointType& innerHit)
32 {
33 double result = (outerHit.X() * innerHit.X() + outerHit.Y() * innerHit.Y());
34 result /= sqrt(outerHit.X() * outerHit.X() + outerHit.Y() * outerHit.Y());
35 result /= sqrt(innerHit.X() * innerHit.X() + innerHit.Y() * innerHit.Y());
36 return result;
37 }
38 };
39
41}
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
This is a specialization returning floats, where value calculates the cos of the angle of the segment...
static double value(const PointType &outerHit, const PointType &innerHit)
calculates the distance between the hits in z (1D), returning unit: cm
PUT_NAME_FUNCTION(COSDIRECTIONXY_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
Base class of the selection variable objects used for pair filtering.
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.