Belle II Software development
Distance2DXYSquared.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 <math.h>
13
14#define DISTANCE2DXYSQUARED_NAME Distance2DXYSquared
15
16namespace Belle2 {
23 template <typename PointType>
24 class DISTANCE2DXYSQUARED_NAME : public SelectionVariable< PointType, 2, double > {
25 public:
26
29
31 static double value(const PointType& outerHit, const PointType& innerHit)
32 {
33 return
34 std::pow(outerHit.X() - innerHit.X(), 2) +
35 std::pow(outerHit.Y() - innerHit.Y(), 2);
36 }
37 };
38
40}
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 the specialization for SpacePoints with returning floats, where value calculates the squared ...
PUT_NAME_FUNCTION(DISTANCE2DXYSQUARED_NAME)
is expanded as "static const std:string name(void)" frunction which returns name of the Class
static double value(const PointType &outerHit, const PointType &innerHit)
calculates the squared distance between the hits (2D on the X-Y-plane), returning unit: cm^2 for spee...
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.