Belle II Software  release-08-01-10
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 
26 namespace Belle2 {
31  class Particle;
32 
46  public:
47 
52  virtual ~VariablesToExtraInfoModule() override;
53 
55  virtual void initialize() override;
57  virtual void event() override;
58 
59  private:
63  std::string m_inputListName;
67  std::map<std::string, std::string> m_variables;
69  std::vector<Variable::Manager::FunctionPtr> m_functions;
71  std::vector<std::string> m_extraInfoNames;
72 
74  std::string m_decayString;
78  bool m_writeToDaughter = false;
80  int m_overwrite = 0;
81 
86  void addExtraInfo(const Particle* source, Particle* destination);
87 
88  };
89 
91 } // 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.