Belle II Software development
AllSVDStateFilter.cc
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#include <tracking/ckf/svd/filters/states/AllSVDStateFilter.h>
9#include <tracking/ckf/svd/entities/CKFToSVDState.h>
10
11#include <vector>
12
13using namespace Belle2;
14using namespace TrackFindingCDC;
15
16
18{
19 const std::vector<TrackFindingCDC::WithWeight<const CKFToSVDState*>>& previousStates = pair.first;
20 CKFToSVDState* currentState = pair.second;
21
22 if (previousStates.size() < 3) {
23 // the path is to short (seed + 2 hits) to have too much overlap
24 return 1.0;
25 }
26
27 const CKFToSVDState* previousToPreviousState = previousStates[previousStates.size() - 2];
28
29 if (previousToPreviousState->getGeometricalLayer() == currentState->getGeometricalLayer()) {
30 return NAN;
31 }
32
33 if (std::count(previousStates.begin(), previousStates.end(), currentState)) {
34 B2FATAL("Have found a cycle!");
35 }
36
37 return 1.0;
38}
TrackFindingCDC::Weight operator()(const BaseSVDStateFilter::Object &pair) override
Function to evaluate the object.
Specialized CKF State for extrapolating into the SVD.
Definition: CKFToSVDState.h:27
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:35
Abstract base class for different kinds of events.