Belle II Software development
MCTruthEclSeedFilter.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/MCTruthEclSeedFilter.h>
9
10#include <tracking/ckf/cdc/entities/CDCCKFState.h>
11
12#include <ecl/dataobjects/ECLShower.h>
13
14#include <mdst/dataobjects/MCParticle.h>
15
16using namespace Belle2;
17
19{
20 const auto& path = *(pair.first);
21 const auto& state = *(pair.second);
22
23 const auto& seed = path.front();
24 const auto* seedRecoTrack = seed.getSeed();
25 const auto* seedEclShower = seedRecoTrack->getRelated<ECLShower>("ECLShowers");
26 const auto* seedMCParticle = seedEclShower->getRelated<MCParticle>();
27
28 const auto* wireHit = state.getWireHit();
29 const auto* cdcHit = wireHit->getHit();
30 const auto* hitMCParticle = cdcHit->getRelated<MCParticle>();
31
32 if (seedMCParticle != hitMCParticle) {
33 return NAN;
34 }
35
36 return 1;
37}
Class to store ECL Showers.
Definition: ECLShower.h:30
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
TrackFindingCDC::Weight operator()(const BaseCDCStateFilter::Object &pair) final
return 1 if matched truth hit belongs to matched truth track, NAN otherwise
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:35
Abstract base class for different kinds of events.