Belle II Software  release-05-01-25
ArcLengthBasedCDCfromEclPathPairFilter.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Simon Kurz *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/ckf/cdc/filters/pathPairs/BaseCDCPathPairFilter.h>
13 
14 #include <tracking/trackFindingCDC/numerics/Weight.h>
15 
16 namespace Belle2 {
21  class ArcLengthBasedCDCfromEclPathPairFilter : public BaseCDCPathPairFilter {
23  public:
25  TrackFindingCDC::Weight operator()(const BaseCDCPathPairFilter::Object& pair) final {
26  const auto& lhs = *pair.first;
27  const auto& rhs = *pair.second;
28  const auto& lhsLastState = lhs.back();
29  const auto& rhsLastState = rhs.back();
30 
31  const auto lhsArcLength = - lhsLastState.getArcLength();
32  const auto rhsArcLength = - rhsLastState.getArcLength();
33 
34  // priority is most hits
35  if (lhs.size() != rhs.size())
36  {
37  return lhs.size() > rhs.size();
38  }
39 
40  return lhsArcLength < rhsArcLength;
41  }
42  };
44 }
Belle2::ArcLengthBasedCDCfromEclPathPairFilter::operator()
TrackFindingCDC::Weight operator()(const BaseCDCPathPairFilter::Object &pair) final
Input: pair of paths, returns 1 if pair.first to be selected, 0 otherwise.
Definition: ArcLengthBasedCDCfromEclPathPairFilter.h:33
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BaseCDCPathPairFilter
TrackFindingCDC::Filter< std::pair< const CDCCKFPath *, const CDCCKFPath * > > BaseCDCPathPairFilter
Base filter for CKF CDC paths.
Definition: BaseCDCPathPairFilter.h:31
Belle2::TrackFindingCDC::Filter::Object
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:43