Belle II Software  release-05-02-19
TruthSegmentVarSet.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
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 CDCSegment2D;
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 VarNames<CDCSegment2D> {
34 
36  static const size_t nVars = size(truthSegmentVarNames);
37 
39  static constexpr char const* getName(int iName)
40  {
41  return truthSegmentVarNames[iName];
42  }
43  };
44 
49  class TruthSegmentVarSet : public VarSet<TruthSegmentVarNames> {
50 
51  private:
54 
55  public:
57  void initialize() final;
58 
60  void beginEvent() final;
61 
63  bool extract(const CDCSegment2D* segment) override;
64  };
65  }
67 }
Belle2::TrackFindingCDC::TruthSegmentVarSet::extract
bool extract(const CDCSegment2D *segment) override
Generate and assign the contained variables.
Definition: TruthSegmentVarSet.cc:36
Belle2::TrackFindingCDC::TruthSegmentVarSet::initialize
void initialize() final
Require the Monte Carlo truth information at initialisation.
Definition: TruthSegmentVarSet.cc:24
Belle2::TrackFindingCDC::TruthSegmentVarNames::getName
static constexpr char const * getName(int iName)
Getter for the name at the given index.
Definition: TruthSegmentVarSet.h:47
Belle2::TrackFindingCDC::TruthSegmentVarSet::Super
VarSet< TruthSegmentVarNames > Super
Type of the base class.
Definition: TruthSegmentVarSet.h:61
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::TruthSegmentVarNames::nVars
static const size_t nVars
Number of variables to be generated.
Definition: TruthSegmentVarSet.h:44
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40
Belle2::TrackFindingCDC::VarSet
Generic class that generates some named float values from a given object.
Definition: VarSet.h:46
Belle2::TrackFindingCDC::TruthSegmentVarSet::beginEvent
void beginEvent() final
Prepare the Monte Carlo truth information at start of the event.
Definition: TruthSegmentVarSet.cc:30
Belle2::TrackFindingCDC::TruthSegmentVarSet
Class to compute floating point variables from a segment which can be recorded as a flat TNtuple or s...
Definition: TruthSegmentVarSet.h:57