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/trackFindingCDC/varsets/VarSet.h>
11#include <tracking/trackFindingCDC/varsets/VarNames.h>
12
13namespace Belle2 {
18 namespace TrackFindingCDC {
19 class CDCTrack;
20
22 constexpr
23 static char const* const truthTrackTruthVarNames[] = {
24 "track_is_fake_truth",
25 "truth",
26 };
27
29 struct TruthTrackVarNames : public VarNames<CDCTrack> {
30
32 // we shouldn't use public member variables but we do want to rewrite all related code using setters/getters
33 // at least tell cppcheck that everything is fine
34 // cppcheck-suppress duplInheritedMember
35 static const size_t nVars = size(truthTrackTruthVarNames);
36
38 static constexpr char const* getName(int iName)
39 {
40 return truthTrackTruthVarNames[iName];
41 }
42 };
43
48 class TruthTrackVarSet : public VarSet<TruthTrackVarNames> {
49
50 private:
53
54 public:
56 void initialize() final;
57
59 void beginEvent() final;
60
62 bool extract(const CDCTrack* track) override;
63 };
64 }
66}
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:41
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.
VarSet< TruthTrackVarNames > Super
Type of the base class.
bool extract(const CDCTrack *track) override
Generate and assign the contained variables.
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.