Belle II Software  release-05-01-25
BestMatchedTruthVarSet.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Michael Eliachevitch, 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 #include <framework/dataobjects/EventMetaData.h>
16 #include <framework/datastore/StoreObjPtr.h>
17 
18 namespace Belle2 {
23  namespace TrackFindingCDC {
24  class CDCTrack;
25 
27  constexpr static char const* const bestMatchedTruthVarNames[] = {
28  // Truth: PR Track is not a fake and the best matched track (not a clone)
29  "truth",
30  // Other truth variables are mostly to be helpful during debugging.
31  "truth_track_is_fake",
32  "truth_track_is_matched",
33  "truth_matched_hits",
34  "truth_track_is_clone",
35  "truth_first_nloops",
36  "truth_event_id",
37  "truth_MCTrackID",
38  };
39 
41  struct BestMatchedTruthVarNames : public VarNames<CDCTrack> {
42 
44  static const size_t nVars = size(bestMatchedTruthVarNames);
45 
47  static constexpr char const* getName(int iName)
48  {
49  return bestMatchedTruthVarNames[iName];
50  }
51  };
52 
57  class BestMatchedTruthVarSet : public VarSet<BestMatchedTruthVarNames> {
58 
59  public:
61  void initialize() final;
62 
64  void beginEvent() final;
65 
67  bool extract(const CDCTrack* ptrCDCTrack) override;
68 
69  private:
72 
75  };
76  }
78 }
Belle2::TrackFindingCDC::BestMatchedTruthVarSet::m_eventMetaData
StoreObjPtr< EventMetaData > m_eventMetaData
Pointer to the store array object with the EventMetaData.
Definition: BestMatchedTruthVarSet.h:82
Belle2::TrackFindingCDC::BestMatchedTruthVarSet::beginEvent
void beginEvent() final
Prepare the Monte Carlo truth information at start of the event.
Definition: BestMatchedTruthVarSet.cc:29
Belle2::TrackFindingCDC::CDCTrack
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:51
Belle2::TrackFindingCDC::BestMatchedTruthVarSet::initialize
void initialize() final
Require the Monte Carlo truth information at initialisation.
Definition: BestMatchedTruthVarSet.cc:23
Belle2::TrackFindingCDC::BestMatchedTruthVarNames::getName
static constexpr char const * getName(int iName)
Getter for the name at the given index.
Definition: BestMatchedTruthVarSet.h:55
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::BestMatchedTruthVarSet
Class to compute floating point variables from a track which can be recorded as a flat TNtuple or ser...
Definition: BestMatchedTruthVarSet.h:65
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::TrackFindingCDC::BestMatchedTruthVarNames::nVars
static const size_t nVars
Number of variables to be generated.
Definition: BestMatchedTruthVarSet.h:52
Belle2::TrackFindingCDC::VarSet
Generic class that generates some named float values from a given object.
Definition: VarSet.h:46
Belle2::TrackFindingCDC::BestMatchedTruthVarSet::extract
bool extract(const CDCTrack *ptrCDCTrack) override
Generate and assign the contained variables.
Definition: BestMatchedTruthVarSet.cc:35