Belle II Software development
ZIGGZAGGRZ_NAME< PointType, PointContainerType > Class Template Reference

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

#include <ZiggZaggRZ.h>

Inheritance diagram for ZIGGZAGGRZ_NAME< PointType, PointContainerType >:
SelectionVariable< PointContainerType, 0, int >

Public Types

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

Public Member Functions

 PUT_NAME_FUNCTION (ZIGGZAGGRZ_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 R-Z-plane, returns number of charge-signs found (if != 1, then the given hitContainer is ziggZagging)
 
static variableType value (const PointContainerType &arg1, const PointContainerType &arg2)
 Static method that return the variable associated to:
 

Static Public Attributes

static const size_t c_Nargs
 Number of arguments.
 

Detailed Description

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

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

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 33 of file ZiggZaggRZ.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,constargumentType&>::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 PointContainerType &  arg1,
const PointContainerType &  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 R-Z-plane, returns number of charge-signs found (if != 1, then the given hitContainer is ziggZagging)

Definition at line 40 of file ZiggZaggRZ.h.

41 {
42 const unsigned nHits = hitContainer.size();
43 if (nHits < 4) return 1;
44
45 typedef SelVarHelper<PointType, double> Helper;
46 using boost::math::sign;
47
48 std::vector<B2Vector3D> vecRZ;
49 vecRZ.reserve(nHits);
50 for (const auto* hit : hitContainer) { // collect RZ-Vrsions of the hits:
51 vecRZ.push_back(B2Vector3D(Helper::calcPerp(*hit), hit->Z(), 0.));
52 }
53
54 std::vector<int> chargeSigns;
55 chargeSigns.reserve(nHits - 2);
56 for (unsigned i = 0; i < nHits - 2; ++i) {
57 int signVal = sign((vecRZ.at(i + 1) - vecRZ.at(i + 2)).Orthogonal() * (vecRZ.at(i) - vecRZ.at(i + 1)));
58 chargeSigns.push_back(signVal);
59 }
60
61 std::sort(chargeSigns.begin(), chargeSigns.end());
62 auto newEnd = std::unique(chargeSigns.begin(), chargeSigns.end());
63
64 return std::distance(chargeSigns.begin(), newEnd);
65 } // return unit: none
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516

Member Data Documentation

◆ c_Nargs

const size_t c_Nargs
staticinherited

Number of arguments.

Definition at line 91 of file SelectionVariable.h.


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