Belle II Software development
TruthTrackVarSet.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/trackingUtilities/varsets/VarSet.h>
11#include <tracking/trackingUtilities/varsets/VarNames.h>
12
13namespace Belle2 {
18 namespace TrackingUtilities {
19 class CDCTrack;
20 }
21 namespace TrackFindingCDC {
22
24 constexpr
25 static char const* const truthTrackTruthVarNames[] = {
26 "track_is_fake_truth",
27 "truth",
28 };
29
31 struct TruthTrackVarNames : public TrackingUtilities::VarNames<TrackingUtilities::CDCTrack> {
32
34 // we shouldn't use public member variables but we do want to rewrite all related code using setters/getters
35 // at least tell cppcheck that everything is fine
36 // cppcheck-suppress duplInheritedMember
37 static const size_t nVars = TrackingUtilities::size(truthTrackTruthVarNames);
38
40 static constexpr char const* getName(int iName)
41 {
42 return truthTrackTruthVarNames[iName];
43 }
44 };
45
50 class TruthTrackVarSet : public TrackingUtilities::VarSet<TruthTrackVarNames> {
51
52 private:
55
56 public:
58 void initialize() final;
59
61 void beginEvent() final;
62
64 bool extract(const TrackingUtilities::CDCTrack* track) override;
65 };
66 }
68}
Class to compute floating point variables from a track which can be recorded as a flat TNtuple or ser...
void initialize() final
Require the Monte Carlo truth information at initialisation.
void beginEvent() final
Prepare the Monte Carlo truth information at start of the event.
bool extract(const TrackingUtilities::CDCTrack *track) override
Generate and assign the contained variables.
TrackingUtilities::VarSet< TruthTrackVarNames > Super
Type of the base class.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:39
Class that specifies the names of the variables.
Definition VarNames.h:21
Generic class that generates some named float values from a given object.
Definition VarSet.h:36
Abstract base class for different kinds of events.
Vehicle class to transport the variable names.
static const size_t nVars
Number of variables to be generated.
static constexpr char const * getName(int iName)
Getter for the name at the given index.