Belle II Software development
VariablesToExtraInfoModule.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
11#include <framework/core/Module.h>
12
13#include <framework/datastore/StoreArray.h>
14#include <framework/datastore/StoreObjPtr.h>
15
16#include <analysis/dataobjects/Particle.h>
17#include <analysis/dataobjects/ParticleList.h>
18#include <analysis/VariableManager/Manager.h>
19
20#include <analysis/DecayDescriptor/DecayDescriptor.h>
21
22#include <string>
23#include <map>
24#include <vector>
25
26namespace Belle2 {
31 class Particle;
32
43 public:
44
49 virtual ~VariablesToExtraInfoModule() override;
50
52 virtual void initialize() override;
54 virtual void event() override;
55
56 private:
60 std::string m_inputListName;
64 std::map<std::string, std::string> m_variables;
66 std::vector<Variable::Manager::FunctionPtr> m_functions;
68 std::vector<std::string> m_extraInfoNames;
69
71 std::string m_decayString;
75 bool m_writeToDaughter = false;
77 int m_overwrite = 0;
78
83 void addExtraInfo(const Particle* source, Particle* destination);
84
85 };
86
88} // Belle2 namespace
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
Base class for Modules.
Definition: Module.h:72
Class to store reconstructed particles.
Definition: Particle.h:75
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
For each particle in the input list the selected variables are saved in an extra-info field with the ...
bool m_writeToDaughter
if true the extraInfo is written to daughter specified by the decay string
virtual void initialize() override
initialise
virtual void event() override
process event: actually adds the extra info
std::string m_decayString
DecayString specifying the daughter Particle to which the extra-info field will be added.
StoreArray< Particle > m_particles
StoreArray of Particles.
DecayDescriptor m_pDDescriptor
Decay descriptor of the particle being selected.
StoreObjPtr< ParticleList > m_inputList
input particle list
int m_overwrite
-1/0/1/2: Overwrite if lower / don't overwrite / overwrite if higher / always overwrite,...
std::vector< Variable::Manager::FunctionPtr > m_functions
Vector of function pointers corresponding to given variables.
std::map< std::string, std::string > m_variables
Map of variables and extraInfo names to save in the extra-info field.
std::vector< std::string > m_extraInfoNames
Vector of extra info names.
std::string m_inputListName
name of input particle list.
void addExtraInfo(const Particle *source, Particle *destination)
Adds extra info to the particle.
Abstract base class for different kinds of events.