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