Belle II Software development
SeedChargeCDCPathFilter.h
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#pragma once
9
10#include <tracking/ckf/cdc/filters/paths/BaseCDCPathFilter.h>
11
12#include <tracking/trackFindingCDC/numerics/Weight.h>
13
14namespace Belle2 {
21 public:
23 TrackFindingCDC::Weight operator()(const BaseCDCPathFilter::Object& path) final
24 {
25 // Not able to find any hits
26 if (path.size() == 1) {
27 return NAN;
28 }
29
30 // Filter does not make sense if seeds initialited with 0 charge
31 if (path.front().getSeed()->getChargeSeed() == 0) {
32 return 0.;
33 }
34
35 // We don't want tracks that flipped charge
36 if (path.front().getSeed()->getChargeSeed() != path.back().getTrackState().getCharge()) {
37 B2DEBUG(29, "Flipped charge: " << path.front().getSeed()->getChargeSeed() << "->" << path.back().getTrackState().getCharge());
38 return NAN;
39 }
40
41 return path.front().getSeed()->getChargeSeed();
42 }
43 };
45}
Check if charge of fitted path corresponds to charge of seed.
TrackFindingCDC::Weight operator()(const BaseCDCPathFilter::Object &path) final
Main function: return the charge of the path.
Base class for filters on a generic object type.
Definition: Filter.dcl.h:31
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:35
Abstract base class for different kinds of events.