11#include <tracking/trackFindingVXD/filterMap/filterFramework/SelectionVariable.h>
12#include <tracking/trackFindingVXD/filterTools/SelectionVariableHelper.h>
13#include <framework/geometry/B2Vector3.h>
14#include <boost/math/special_functions/sign.hpp>
20#define ZIGGZAGGRZ_NAME ZiggZaggRZ
32 template <
typename Po
intType,
typename Po
intContainerType >
40 static int value(
const PointContainerType& hitContainer)
42 const unsigned nHits = hitContainer.size();
43 if (nHits < 4)
return 1;
46 using boost::math::sign;
48 std::vector<B2Vector3D> vecRZ;
50 for (
const auto* hit : hitContainer) {
51 vecRZ.push_back(
B2Vector3D(Helper::calcPerp(*hit), hit->Z(), 0.));
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);
61 std::sort(chargeSigns.begin(), chargeSigns.end());
62 auto newEnd = std::unique(chargeSigns.begin(), chargeSigns.end());
64 return std::distance(chargeSigns.begin(), newEnd);
Base class of the selection variable objects used for pair filtering.
checks whether chain of segments are zigg-zagging (changing sign of curvature of neighbouring segment...
static int value(const PointContainerType &hitContainer)
checks whether chain of segments are zigg-zagging (changing sign of curvature of neighbouring segment...
PUT_NAME_FUNCTION(ZIGGZAGGRZ_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.
contains a collection of functions and related stuff needed for SelectionVariables implementing 2-,...