Belle II Software development
AllPXDStateFilter.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/pxd/filters/states/AllPXDStateFilter.h>
9#include <tracking/ckf/pxd/entities/CKFToPXDState.h>
10
11#include <vector>
12
13using namespace Belle2;
14using namespace TrackFindingCDC;
15
16
18{
19 const std::vector<TrackFindingCDC::WithWeight<const CKFToPXDState*>>& previousStates = pair.first;
20 CKFToPXDState* 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 CKFToPXDState* 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 BasePXDStateFilter::Object &pair) override
Function to evaluate the object.
Specialized CKF State for extrapolating into the PXD.
Definition: CKFToPXDState.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.