8#include <tracking/ckf/cdc/filters/paths/CDCPathTruthVarSet.h>
10#include <tracking/ckf/cdc/entities/CDCCKFState.h>
12#include <ecl/dataobjects/ECLShower.h>
13#include <mdst/dataobjects/MCParticle.h>
15#include <tracking/dataobjects/RecoTrack.h>
22 const auto& seed = path->front();
23 auto* seedRecoTrack = seed.getSeed();
24 auto* seedMCTrack = seedRecoTrack->getRelated<
RecoTrack>(
"MCRecoTracks");
39 std::vector<MCParticle*> daughterMCParticles;
40 if (seedMCParticle->getNDaughters() > 0) {
43 while (daughterMCParticles.size() == 1) {
44 daughterMCParticles = daughterMCParticles.at(0)->getDaughters();
46 if (daughterMCParticles.size() > 1) {
47 daughters = daughterMCParticles.size();
51 while (seedMCParticle->getMother()) {
52 seedMCParticle = seedMCParticle->getMother();
58 mcTrackHits = seedMCTrack->getNumberOfCDCHits();
60 var<
named(
"mcTrackHits")>() = mcTrackHits;
62 var<
named(
"daughters")>() = daughters;
63 var<
named(
"PDG")>() = seedMCParticle->getPDG();
65 auto seedMom = seedMCParticle->getMomentum();
66 var<
named(
"seed_p_truth")>() = seedMom.R();
67 var<
named(
"seed_theta_truth")>() = seedMom.Theta() * 180. / M_PI;
68 var<
named(
"seed_pt_truth")>() = seedMom.Rho();
69 var<
named(
"seed_pz_truth")>() = seedMom.Z();
70 var<
named(
"seed_px_truth")>() = seedMom.X();
71 var<
named(
"seed_py_truth")>() = seedMom.Y();
virtual bool extract(const BaseCDCPathFilter::Object *path) override
Generate and assign the variables from the object.
Class to store ECL Showers.
A Class to store the Monte Carlo particle information.
std::vector< Belle2::MCParticle * > getDaughters() const
Get vector of all daughter particles, empty vector if none.
This is the Reconstruction Event-Data Model Track.
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.
static constexpr int named(const char *name)
Getter for the index from the name.
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Abstract base class for different kinds of events.