Belle II Software  release-05-01-25
AllPXDStateFilter.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/pxd/filters/states/AllPXDStateFilter.h>
11 #include <tracking/ckf/pxd/entities/CKFToPXDState.h>
12 
13 #include <vector>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
18 
20 {
21  const std::vector<TrackFindingCDC::WithWeight<const CKFToPXDState*>>& previousStates = pair.first;
22  CKFToPXDState* 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 CKFToPXDState* 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::CKFToPXDState
Specialized CKF State for extrapolating into the PXD.
Definition: CKFToPXDState.h:29
Belle2::CKFToPXDState::getGeometricalLayer
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
Definition: CKFToPXDState.cc:33
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::AllPXDStateFilter::operator()
TrackFindingCDC::Weight operator()(const BasePXDStateFilter::Object &pair) override
Function to evaluate the object.
Definition: AllPXDStateFilter.cc:19
Belle2::TrackFindingCDC::Filter::Object
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:43