Belle II Software  release-08-01-10
HitGapTrackRelationVarSet.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <tracking/trackFindingCDC/varsets/VarSet.h>
11 #include <tracking/trackFindingCDC/varsets/VarNames.h>
12 
13 #include <tracking/trackFindingCDC/utilities/Relation.h>
14 
15 namespace Belle2 {
20  namespace TrackFindingCDC {
21  class CDCTrack;
22 
24  constexpr
25  static char const* const hitGapTrackRelationVarNames[] = {
26  "delta_hit_pos_phi",
27  "delta_hit_mom_phi",
28  "delta_hit_alpha",
29 
30  "delta_hit_z",
31  "hit_distance",
32  "hit_long_distance",
33  "delta_hit_distance",
34 
35  "from_hit_forward",
36  "to_hit_forward",
37  "hit_forward",
38  "hit_ptolemy",
39  };
40 
42  struct HitGapTrackRelationVarNames : public VarNames<Relation<const CDCTrack> > {
43 
45  // we shouldn't use public member variables but we do want to rewrite all related code using setters/getters
46  // at least tell cppcheck that everything is fine
47  // cppcheck-suppress duplInheritedMember
48  static const size_t nVars = size(hitGapTrackRelationVarNames);
49 
51  static constexpr char const* getName(int iName)
52  {
53  return hitGapTrackRelationVarNames[iName];
54  }
55  };
56 
61  class HitGapTrackRelationVarSet : public VarSet<HitGapTrackRelationVarNames> {
62 
63  public:
65  bool extract(const Relation<const CDCTrack>* ptrTrackRelation) final;
66  };
67  }
69 }
Class to compute floating point variables from a track relation which can be recorded as a flat TNtup...
bool extract(const Relation< const CDCTrack > *ptrTrackRelation) final
Generate and assign the contained variables.
Type for two related objects.
Definition: Relation.h:21
Class that specifies the names of the variables.
Definition: VarNames.h:21
Generic class that generates some named float values from a given object.
Definition: VarSet.h:36
Abstract base class for different kinds of events.
Class vehicle to transport the variable names.
static const size_t nVars
Number of variables to be generated.
static constexpr char const * getName(int iName)
Getter for the name at the given index.