Belle II Software  release-05-01-25
AllSVDStateFilter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/ckf/svd/filters/states/AllSVDStateFilter.h>
11 #include <tracking/ckf/svd/entities/CKFToSVDState.h>
12 
13 #include <vector>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
18 
20 {
21  const std::vector<TrackFindingCDC::WithWeight<const CKFToSVDState*>>& previousStates = pair.first;
22  CKFToSVDState* currentState = pair.second;
23 
24  if (previousStates.size() < 3) {
25  // the path is to short (seed + 2 hits) to have too much overlap
26  return 1.0;
27  }
28 
29  const CKFToSVDState* previousToPreviousState = previousStates[previousStates.size() - 2];
30 
31  if (previousToPreviousState->getGeometricalLayer() == currentState->getGeometricalLayer()) {
32  return NAN;
33  }
34 
35  if (std::count(previousStates.begin(), previousStates.end(), currentState)) {
36  B2FATAL("Have found a cycle!");
37  }
38 
39  return 1.0;
40 }
Belle2::AllSVDStateFilter::operator()
TrackFindingCDC::Weight operator()(const BaseSVDStateFilter::Object &pair) override
Function to evaluate the object.
Definition: AllSVDStateFilter.cc:19
Belle2::CKFToSVDState::getGeometricalLayer
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
Definition: CKFToSVDState.cc:33
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CKFToSVDState
Specialized CKF State for extrapolating into the SVD.
Definition: CKFToSVDState.h:29
Belle2::TrackFindingCDC::Filter::Object
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:43