Belle II Software  release-05-02-19
TruthTrackVarSet.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/varsets/VarSet.h>
13 #include <tracking/trackFindingCDC/varsets/VarNames.h>
14 
15 namespace Belle2 {
20  namespace TrackFindingCDC {
21  class CDCTrack;
22 
24  constexpr
25  static char const* const truthTrackTruthVarNames[] = {
26  "track_is_fake_truth",
27  "truth",
28  };
29 
31  struct TruthTrackVarNames : public VarNames<CDCTrack> {
32 
34  static const size_t nVars = size(truthTrackTruthVarNames);
35 
37  static constexpr char const* getName(int iName)
38  {
39  return truthTrackTruthVarNames[iName];
40  }
41  };
42 
47  class TruthTrackVarSet : public VarSet<TruthTrackVarNames> {
48 
49  private:
52 
53  public:
55  void initialize() final;
56 
58  void beginEvent() final;
59 
61  bool extract(const CDCTrack* track) override;
62  };
63  }
65 }
Belle2::TrackFindingCDC::CDCTrack
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:51
Belle2::TrackFindingCDC::TruthTrackVarNames::getName
static constexpr char const * getName(int iName)
Getter for the name at the given index.
Definition: TruthTrackVarSet.h:45
Belle2::TrackFindingCDC::TruthTrackVarSet::Super
VarSet< TruthTrackVarNames > Super
Type of the base class.
Definition: TruthTrackVarSet.h:59
Belle2::TrackFindingCDC::TruthTrackVarSet::initialize
void initialize() final
Require the Monte Carlo truth information at initialisation.
Definition: TruthTrackVarSet.cc:22
Belle2::TrackFindingCDC::TruthTrackVarSet
Class to compute floating point variables from a track which can be recorded as a flat TNtuple or ser...
Definition: TruthTrackVarSet.h:55
Belle2::TrackFindingCDC::TruthTrackVarNames::nVars
static const size_t nVars
Number of variables to be generated.
Definition: TruthTrackVarSet.h:42
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::TruthTrackVarSet::extract
bool extract(const CDCTrack *track) override
Generate and assign the contained variables.
Definition: TruthTrackVarSet.cc:34
Belle2::TrackFindingCDC::TruthTrackVarSet::beginEvent
void beginEvent() final
Prepare the Monte Carlo truth information at start of the event.
Definition: TruthTrackVarSet.cc:28
Belle2::TrackFindingCDC::VarSet
Generic class that generates some named float values from a given object.
Definition: VarSet.h:46