Belle II Software
prerelease-10-00-00a
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
16
namespace
Belle2
{
22
class
VariableExtractor
{
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
};
37
38
}
Belle2::Named
A mixin class to attach a name to an object. Based on class with same name in CDC package.
Definition
Named.h:21
Belle2::VariableExtractor
class to extract individual variables
Definition
VariableExtractor.h:22
Belle2::VariableExtractor::addVariable
void addVariable(const std::string &identifier, std::vector< Named< float * > > &variables)
add a variable to the variable set
Definition
VariableExtractor.h:27
Belle2::VariableExtractor::m_variables
std::unordered_map< std::string, float > m_variables
unordered_map to associate float value with a string name
Definition
VariableExtractor.h:35
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
tracking
trackFindingVXD
variableExtractors
include
VariableExtractor.h
Generated on Wed Jul 2 2025 03:34:22 for Belle II Software by
1.13.2