Belle II Software development
TruthSegmentVarSet.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 CDCSegment2D;
20 }
21 namespace TrackFindingCDC {
22
24 constexpr
25 static char const* const truthSegmentVarNames[] = {
26 "segment_is_fake_truth",
27 "track_is_already_found_truth",
28 "segment_is_new_track_truth",
29 "truth",
30 };
31
33 struct TruthSegmentVarNames : public TrackingUtilities::VarNames<TrackingUtilities::CDCSegment2D> {
34
36 // we shouldn't use public member variables but we do want to rewrite all related code using setters/getters
37 // at least tell cppcheck that everything is fine
38 // cppcheck-suppress duplInheritedMember
39 static const size_t nVars = TrackingUtilities::size(truthSegmentVarNames);
40
42 static constexpr char const* getName(int iName)
43 {
44 return truthSegmentVarNames[iName];
45 }
46 };
47
52 class TruthSegmentVarSet : public TrackingUtilities::VarSet<TruthSegmentVarNames> {
53
54 private:
57
58 public:
60 void initialize() final;
61
63 void beginEvent() final;
64
66 bool extract(const TrackingUtilities::CDCSegment2D* segment) override;
67 };
68 }
70}
Class to compute floating point variables from a segment which can be recorded as a flat TNtuple or s...
TrackingUtilities::VarSet< TruthSegmentVarNames > Super
Type of the base class.
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::CDCSegment2D *segment) override
Generate and assign the contained variables.
A reconstructed sequence of two dimensional hits in one super layer.
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.