Belle II Software  release-08-01-10
ZIGGZAGGXYWITHSIGMA_NAME< PointType, PointContainerType > Class Template Reference

checks whether chain of segments are zigg-zagging (changing sign of curvature of neighbouring segments) in the X-Y-plane, returns number of charge-signs found (if != 1, then the given hitContainer is ziggZagging). More...

#include <ZiggZaggXYWithSigma.h>

Inheritance diagram for ZIGGZAGGXYWITHSIGMA_NAME< PointType, PointContainerType >:
Collaboration diagram for ZIGGZAGGXYWITHSIGMA_NAME< PointType, PointContainerType >:

Public Types

typedef int variableType
 Type of the returned object. More...
 
typedef PointContainerType argumentType
 Type of the argument object. More...
 
typedef FunctionOf< Nargs, variableType, const argumentType & >::functionType functionType
 Type of the function returning the value. More...
 

Public Member Functions

 PUT_NAME_FUNCTION (ZIGGZAGGXYWITHSIGMA_NAME)
 is replaced by "static const std:string name(void)" frunction which returns name of the Class
 

Static Public Member Functions

static int value (const PointContainerType &hitContainer)
 checks whether chain of segments are zigg-zagging (changing sign of curvature of neighbouring segments) in the X-Y-plane, returns number of charge-signs found (if != 1, then the given hitContainer is ziggZagging). More...
 
static variableType value (const PointContainerType &arg1, const PointContainerType &arg2)
 Static method that return the variable associated to: More...
 

Static Public Attributes

static const size_t c_Nargs
 Number of arguments.
 

Detailed Description

template<typename PointType, typename PointContainerType>
class Belle2::ZIGGZAGGXYWITHSIGMA_NAME< PointType, PointContainerType >

checks whether chain of segments are zigg-zagging (changing sign of curvature of neighbouring segments) in the X-Y-plane, returns number of charge-signs found (if != 1, then the given hitContainer is ziggZagging).

This functions uses the sigma to consider also approximately straight tracks as not zigg-zagging.

ATTENTION: in contrast to the Two- Three- and FourHit-filters, the TrackletFilters do NOT expect Hits, but a Container with pointers to Hits (e.g. Vector of hits or a SpacePointTrackCandidate, These filters therefore apply to arbitrary numbers of hits in that container.

Definition at line 30 of file ZiggZaggXYWithSigma.h.

Member Typedef Documentation

◆ argumentType

typedef PointContainerType argumentType
inherited

Type of the argument object.

Needed for SFINAE in Filter.hh

Definition at line 84 of file SelectionVariable.h.

◆ functionType

typedef FunctionOf<Nargs, variableType, const argumentType&>::functionType functionType
inherited

Type of the function returning the value.

Needed for the automated training

Definition at line 88 of file SelectionVariable.h.

◆ variableType

typedef int variableType
inherited

Type of the returned object.

Needed for SFINAE in Filter.hh

Definition at line 81 of file SelectionVariable.h.

Member Function Documentation

◆ value() [1/2]

static variableType value ( const templateArgumentType &  arg1,
const templateArgumentType &  arg2 
)
inlinestaticinherited

Static method that return the variable associated to:

Parameters
arg1first object of the pair
arg2second object of the pair

N.B. this method must be static.

◆ value() [2/2]

static int value ( const PointContainerType &  hitContainer)
inlinestatic

checks whether chain of segments are zigg-zagging (changing sign of curvature of neighbouring segments) in the X-Y-plane, returns number of charge-signs found (if != 1, then the given hitContainer is ziggZagging).

This functions uses the sigma to consider also approximately straight tracks as not zigg-zagging

Definition at line 37 of file ZiggZaggXYWithSigma.h.

38  {
39  if (hitContainer.size() < 4) return 1;
40 
41 
42  std::vector<int> chargeSigns;
43  chargeSigns.reserve(hitContainer.size() - 2);
44 
45  auto iterPos = hitContainer.begin();
46  auto stopPos = hitContainer.end() - 2;
47 
48  for (; iterPos < stopPos; ++iterPos) {
49  int signVal = SignCurvatureXYError<PointType>::value(**iterPos, **(iterPos + 1), **(iterPos + 2));
50  chargeSigns.push_back(signVal);
51  }
52 
53  std::sort(chargeSigns.begin(), chargeSigns.end());
54  auto endAfterRemove = std::remove(chargeSigns.begin(), chargeSigns.end(), 0);
55  auto finalEnd = std::unique(chargeSigns.begin(), endAfterRemove);
56 
57  return std::distance(chargeSigns.begin(), finalEnd);
58  } // return unit: none

The documentation for this class was generated from the following file: