Belle II Software  release-08-01-10
MCTruthCDCStateFilter.cc
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 #include <tracking/ckf/cdc/filters/states/MCTruthCDCStateFilter.h>
9 
10 #include <tracking/ckf/cdc/entities/CDCCKFState.h>
11 
12 using namespace Belle2;
13 
15 {
16  const auto& path = *(pair.first);
17  const auto& state = *(pair.second);
18 
19  const auto& seed = path.front();
20  const auto* seedMCRecoTrack = seed.getMCRecoTrack();
21 
22  if (not seedMCRecoTrack) {
23  return NAN;
24  }
25 
26  const auto* wireHit = state.getWireHit();
27  const auto* cdcHit = wireHit->getHit();
28 
29  const auto* hitMCRecoTrack = cdcHit->getRelated<RecoTrack>("MCRecoTracks");
30 
31  if (seedMCRecoTrack != hitMCRecoTrack) {
32  return NAN;
33  }
34 
35  return 1;
36 }
TrackFindingCDC::Weight operator()(const BaseCDCStateFilter::Object &pair) final
return 1 if matched truth hit belongs to matched truth track, NAN otherwise
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:33
Abstract base class for different kinds of events.