Belle II Software development
BasicTrackVarSet.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/trackingUtilities/varsets/VarSet.h>
11#include <tracking/trackingUtilities/varsets/VarNames.h>
12
13// BOOST accumulators
14#include <boost/accumulators/accumulators.hpp>
15#include <boost/accumulators/statistics/count.hpp>
16#include <boost/accumulators/statistics/min.hpp>
17#include <boost/accumulators/statistics/max.hpp>
18#include <boost/accumulators/statistics/sum.hpp>
19#include <boost/accumulators/statistics/mean.hpp>
20#include <boost/accumulators/statistics/variance.hpp>
21
22namespace bacc = boost::accumulators;
23
24namespace Belle2 {
29 namespace TrackingUtilities {
30 class CDCTrack;
31 }
32 namespace TrackFindingCDC {
33
35 constexpr
36 static char const* const basicTrackVarNames[] = {
37 "pt",
38 "size",
39 "hits_per_layer",
40
41 "sz_slope",
42 "z0",
43 "s_range",
44 "avg_hit_dist",
45 "has_matching_segment",
46
47 "cont_layer_mean",
48 "cont_layer_variance",
49 "cont_layer_max",
50 "cont_layer_min",
51 "cont_layer_first",
52 "cont_layer_last",
53 "cont_layer_max_vs_last",
54 "cont_layer_first_vs_min",
55 "cont_layer_count",
56 "cont_layer_occupancy",
57
58 "super_layer_mean",
59 "super_layer_variance",
60 "super_layer_max",
61 "super_layer_min",
62 "super_layer_first",
63 "super_layer_last",
64 "super_layer_max_vs_last",
65 "super_layer_first_vs_min",
66 "super_layer_count",
67 "super_layer_occupancy",
68
69 "drift_length_mean",
70 "drift_length_variance",
71 "drift_length_max",
72 "drift_length_min",
73 "drift_length_sum",
74
75 "adc_mean",
76 "adc_variance",
77 "adc_max",
78 "adc_min",
79 "adc_sum",
80
81 "tot_mean",
82 "tot_variance",
83 "tot_max",
84 "tot_min",
85 "tot_sum",
86
87 "empty_s_mean",
88 "empty_s_variance",
89 "empty_s_max",
90 "empty_s_min",
91 "empty_s_sum",
92 };
93
95 struct BasicTrackVarSetNames : public TrackingUtilities::VarNames<TrackingUtilities::CDCTrack> {
96
98 // we shouldn't use public member variables but we do want to rewrite all related code using setters/getters
99 // at least tell cppcheck that everything is fine
100 // cppcheck-suppress duplInheritedMember
101 static const size_t nVars = TrackingUtilities::size(basicTrackVarNames);
102
104 static constexpr char const* getName(int iName)
105 {
106 return basicTrackVarNames[iName];
107 }
108 };
109
114 class BasicTrackVarSet : public TrackingUtilities::VarSet<BasicTrackVarSetNames> {
115
116 public:
118 bool extract(const TrackingUtilities::CDCTrack* track) override;
119
125 using statistics_set = bacc::features<bacc::tag::count,
126 bacc::tag::sum,
127 bacc::tag::min,
128 bacc::tag::max,
129 bacc::tag::mean,
130 bacc::tag::lazy_variance>;
131
138 using statistics_accumulator = bacc::accumulator_set<double, statistics_set>;
139 };
140 }
142}
Class to compute floating point variables from a track which can be recorded as a flat TNtuple or ser...
bool extract(const TrackingUtilities::CDCTrack *track) override
Generate and assign the contained variables.
bacc::features< bacc::tag::count, bacc::tag::sum, bacc::tag::min, bacc::tag::max, bacc::tag::mean, bacc::tag::lazy_variance > statistics_set
Set of statistics/features to accumulate for each variable category (e.g.
bacc::accumulator_set< double, statistics_set > statistics_accumulator
A boost accumulators set that aggregates statistics for the values it is called with.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:39
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.
Vehicle class 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.