Belle II Software  release-05-02-19
BkgTruthClusterVarSet.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 CDCWireHitCluster;
22 
24  constexpr
25  static char const* const bkgTruthClusterNames[] = {
26  "n_background_hits_truth",
27  "background_fraction_truth",
28  "weight",
29  "truth",
30  };
31 
33  struct BkgTruthClusterVarNames : public VarNames<CDCWireHitCluster> {
34 
36  static const size_t nVars = size(bkgTruthClusterNames);
37 
39  static constexpr char const* getName(int iName)
40  {
41  return bkgTruthClusterNames[iName];
42  }
43  };
44 
49  class BkgTruthClusterVarSet : public VarSet<BkgTruthClusterVarNames> {
50 
51  private:
54 
55  public:
57  void initialize() override;
58 
60  void beginEvent() override;
61 
63  bool extract(const CDCWireHitCluster* ptrCluster) final;
64  };
65  }
67 }
Belle2::TrackFindingCDC::BkgTruthClusterVarSet::Super
VarSet< BkgTruthClusterVarNames > Super
Type of the base class.
Definition: BkgTruthClusterVarSet.h:61
Belle2::TrackFindingCDC::BkgTruthClusterVarSet
Class to compute floating point variables from a wire hit cluster which can be recorded as a flat TNt...
Definition: BkgTruthClusterVarSet.h:57
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::BkgTruthClusterVarSet::initialize
void initialize() override
Signal the initialisation of the event processing - requires the Monte Carlo information.
Definition: BkgTruthClusterVarSet.cc:20
Belle2::TrackFindingCDC::BkgTruthClusterVarNames::getName
static constexpr char const * getName(int iName)
Getter for the name at the given index.
Definition: BkgTruthClusterVarSet.h:47
Belle2::TrackFindingCDC::BkgTruthClusterVarSet::beginEvent
void beginEvent() override
Signal the beginning of a new event - loads the Monte Carlo information.
Definition: BkgTruthClusterVarSet.cc:26
Belle2::TrackFindingCDC::CDCWireHitCluster
An aggregation of CDCWireHits.
Definition: CDCWireHitCluster.h:31
Belle2::TrackFindingCDC::VarSet
Generic class that generates some named float values from a given object.
Definition: VarSet.h:46
Belle2::TrackFindingCDC::BkgTruthClusterVarSet::extract
bool extract(const CDCWireHitCluster *ptrCluster) final
Generate and assign the contained variables.
Definition: BkgTruthClusterVarSet.cc:32
Belle2::TrackFindingCDC::BkgTruthClusterVarNames::nVars
static const size_t nVars
Number of variables to be generated.
Definition: BkgTruthClusterVarSet.h:44