Belle II Software  release-05-01-25
SeedChargeCDCPathFilter.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: simon Kurz, Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/ckf/cdc/filters/paths/BaseCDCPathFilter.h>
13 
14 #include <tracking/trackFindingCDC/numerics/Weight.h>
15 
16 namespace Belle2 {
21  class SeedChargeCDCPathFilter : public BaseCDCPathFilter {
23  public:
25  TrackFindingCDC::Weight operator()(const BaseCDCPathFilter::Object& path) final {
26  // Not able to find any hits
27  if (path.size() == 1)
28  {
29  return NAN;
30  }
31 
32  // Filter does not make sense if seeds initialited with 0 charge
33  if (path.front().getSeed()->getChargeSeed() == 0)
34  {
35  return 0.;
36  }
37 
38  // We don't want tracks that flipped charge
39  if (path.front().getSeed()->getChargeSeed() != path.back().getTrackState().getCharge())
40  {
41  B2DEBUG(100, "Flipped charge: " << path.front().getSeed()->getChargeSeed() << "->" << path.back().getTrackState().getCharge());
42  return NAN;
43  }
44 
45  return path.front().getSeed()->getChargeSeed();
46  }
47  };
49 }
Belle2::BaseCDCPathFilter
TrackFindingCDC::Filter< CDCCKFPath > BaseCDCPathFilter
Base filter for CKF CDC paths.
Definition: BaseCDCPathFilter.h:29
Belle2::SeedChargeCDCPathFilter::operator()
TrackFindingCDC::Weight operator()(const BaseCDCPathFilter::Object &path) final
Main function: return the charge of the path.
Definition: SeedChargeCDCPathFilter.h:33
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::Filter::Object
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:43