Belle II Software  release-05-02-19
FitSegmentRelationVarSet.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 #include <tracking/trackFindingCDC/utilities/Relation.h>
16 
17 namespace Belle2 {
22  namespace TrackFindingCDC {
23  class CDCSegment2D;
24 
26  constexpr
27  static char const* const fitSegmentRelationVarNames[] = {
28  "is_fitted",
29  "curv",
30  "curv_var",
31  "chi2",
32  "chi2_no_rl",
33  "chi2_per_ndf",
34  "chi2_no_rl_per_ndf",
35  "ndf",
36  "p_value",
37  };
38 
40  struct FitSegmentRelationVarNames : public VarNames<Relation<const CDCSegment2D>> {
41 
43  static const size_t nVars = size(fitSegmentRelationVarNames);
44 
46  static constexpr char const* getName(int iName)
47  {
48  return fitSegmentRelationVarNames[iName];
49  }
50  };
51 
56  class FitSegmentRelationVarSet : public VarSet<FitSegmentRelationVarNames> {
57 
58  public:
60  bool extract(const Relation<const CDCSegment2D>* ptrSegmentRelation) final;
61  };
62  }
64 }
Belle2::TrackFindingCDC::Relation
Type for two related objects.
Definition: CDCSegment2D.h:37
Belle2::TrackFindingCDC::FitSegmentRelationVarNames::getName
static constexpr char const * getName(int iName)
Getter for the name at the given index.
Definition: FitSegmentRelationVarSet.h:54
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::FitSegmentRelationVarSet::extract
bool extract(const Relation< const CDCSegment2D > *ptrSegmentRelation) final
Generate and assign the contained variables.
Definition: FitSegmentRelationVarSet.cc:19
Belle2::TrackFindingCDC::FitSegmentRelationVarSet
Class to compute floating point variables from a segment relation which can be recorded as a flat TNt...
Definition: FitSegmentRelationVarSet.h:64
Belle2::TrackFindingCDC::VarSet
Generic class that generates some named float values from a given object.
Definition: VarSet.h:46
Belle2::TrackFindingCDC::FitSegmentRelationVarNames::nVars
static const size_t nVars
Number of variables to be generated.
Definition: FitSegmentRelationVarSet.h:51