Belle II Software  release-05-01-25
Distance3DSquared.h
1 /**************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2014 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Jakob Lettenbichler (jakob.lettenbichler@oeaw.ac.at) *
7 * *
8 * This software is provided "as is" without any warranty. *
9 **************************************************************************/
10 
11 #pragma once
12 
13 #include <tracking/trackFindingVXD/filterMap/filterFramework/SelectionVariable.h>
14 #include <math.h>
15 
16 //use this class name only
17 #define DISTANCE3DSQUARED_NAME Distance3DSquared
18 
19 namespace Belle2 {
26  template <typename PointType>
27  class DISTANCE3DSQUARED_NAME : public SelectionVariable< PointType, 2, double > {
28  public:
31 
32 
33 
35  static double value(const PointType& outerHit, const PointType& innerHit)
36  {
37 
38  return
39  std::pow(outerHit.X() - innerHit.X() , 2) +
40  std::pow(outerHit.Y() - innerHit.Y() , 2) +
41  std::pow(outerHit.Z() - innerHit.Z() , 2) ;
42  }
43  };
44 
46 }
Belle2::DISTANCE3DSQUARED_NAME::value
static double value(const PointType &outerHit, const PointType &innerHit)
calculates the squared distance between the hits (3D), returning unit: cm^2 for speed optimization
Definition: Distance3DSquared.h:35
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SelectionVariable
Base class of the selection variable objects used for pair filtering.
Definition: SelectionVariable.h:54
Belle2::DISTANCE3DSQUARED_NAME::PUT_NAME_FUNCTION
PUT_NAME_FUNCTION(DISTANCE3DSQUARED_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
Belle2::DISTANCE3DSQUARED_NAME
This is the specialization for SpacePoints with returning floats, where value calculates the squared ...
Definition: Distance3DSquared.h:27