Belle II Software development
VariableExtractor.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
9#pragma once
10#include <vector>
11#include <string>
12#include <tracking/trackFindingVXD/utilities/Named.h>
13#include <unordered_map>
14
15
16namespace Belle2 {
23 public:
24
25 protected:
27 void addVariable(const std::string& identifier, std::vector<Named<float*>>& variables)
28 {
29 //todo: verify if it is faster to check explicitly or not
30 auto value = m_variables.emplace(identifier, NAN).first;
31 variables.emplace_back(identifier, &(value->second));
32 }
33
35 std::unordered_map<std::string, float> m_variables;
36 };
38}
A mixin class to attach a name to an object. Based on class with same name in CDC package.
Definition: Named.h:21
class to extract individual variables
void addVariable(const std::string &identifier, std::vector< Named< float * > > &variables)
add a variable to the variable set
std::unordered_map< std::string, float > m_variables
unordered_map to associate float value with a string name
Abstract base class for different kinds of events.