![]() |
Belle II Software release-09-00-04
|
This is a helper class for the MCDecayFinderModule. More...
#include <DecayTree.h>

Public Member Functions | |
| DecayTree () | |
| Default constructor. | |
| ~DecayTree () | |
| Destructor. | |
| std::vector< DecayTree< T > * > | getDaughters () const |
| Return list of decay daughters. | |
| T * | getObj () const |
| Return the decaying object itself, e.g. | |
| void | setObj (T *obj) |
| Set the decaying object, e.g. | |
| void | append (DecayTree< T > *t) |
| Add a daughter, which is a DecayTree itself. | |
| DecayTree (const std::string &decaystring, bool removeRadiativeGammaFlag=false) | |
| Create a new Decay tree from a decaystring. | |
| DecayTree (const DecayTree &tree) | |
| Copy constructor Required because we need to rebuild the node cache. | |
| DecayTree & | operator= (const DecayTree &tree) |
| Assign operator Required because we need to rebuild the node cache. | |
| std::vector< DecayNode > | build_tree (const std::string &decaystring, bool removeRadiativeGammaFlag) |
| Recursively build a new tree. | |
| bool | find_decay (const DecayTree &tree) const |
| Check if the decay tree contains the given decay tree. | |
| std::string | to_string () const |
| Output string representation of DecayTree. | |
| int | getMatchSymbolPosition () const |
| Returns position of match symbol. | |
| bool | isValid () const |
| Returns if the decay tree is valid (constructed from a decay string which has a match) | |
| const DecayNode & | getDecayNode (unsigned int n) const |
| Returns n-th node as const. | |
| DecayNode & | getDecayNode (unsigned int n) |
| Returns n-th node. | |
| size_t | getNumberOfDecayNodes () const |
| Return number of nodes in this tree. | |
Private Member Functions | |
| void | build_cache (DecayNode &node) |
| Build nodes_cache in order of appearance in the decay string for fast access. | |
Private Attributes | |
| T * | m_myObject |
| The decaying object, e.g. | |
| std::vector< DecayTree< T > * > | m_daughters |
| Decay daughters of m_myObject. | |
| bool | m_valid |
| True if the tree is valid (invalid can happen if is constructed from a node with "No match") | |
| size_t | m_i |
| Current position in the building of the DecayTree. | |
| unsigned int | m_token_count |
| Count current tokens. | |
| int | m_match_symbol_position |
| Position of the token with the match symbol ^. | |
| DecayNode | m_root_node |
| root DecayNode | |
| std::vector< DecayNode * > | m_nodes_cache |
| Vector of decay nodes of the particles in the order of their appearance in the decay string for fast access. | |
This is a helper class for the MCDecayFinderModule.
Consists of a tree of DecayNodes Can be constructed from the output of the ParticleMCDecayString module.
It is designed to hold MCParticle objects when trying to match a given DecayString.
Definition at line 20 of file DecayTree.h.
|
explicit |
Create a new Decay tree from a decaystring.
Definition at line 16 of file DecayTree.cc.
Copy constructor Required because we need to rebuild the node cache.
Definition at line 32 of file DecayTree.cc.
|
private |
Build nodes_cache in order of appearance in the decay string for fast access.
| node | current node |
Definition at line 60 of file DecayTree.cc.
| std::vector< DecayNode > build_tree | ( | const std::string & | decaystring, |
| bool | removeRadiativeGammaFlag | ||
| ) |
Recursively build a new tree.
| decaystring | as outputted by the ParticleMCDecayString module (after splitting by | ) |
| removeRadiativeGammaFlag | remove radiative photons from decay string. Handle with care: In the decay B+ --> e+ nu_e gamma, the gamma would be removed although this might be your signal. |
Definition at line 69 of file DecayTree.cc.
| bool find_decay | ( | const DecayTree< T > & | tree | ) | const |
Check if the decay tree contains the given decay tree.
| tree | DecayTree describing the decay |
Definition at line 129 of file DecayTree.cc.
| DecayNode & getDecayNode | ( | unsigned int | n | ) |
| const DecayNode & getDecayNode | ( | unsigned int | n | ) | const |
|
inline |
|
inline |
|
inline |
Returns if the decay tree is valid (constructed from a decay string which has a match)
Definition at line 73 of file DecayTree.h.
Assign operator Required because we need to rebuild the node cache.
Definition at line 45 of file DecayTree.cc.
| std::string to_string | ( | ) | const |
Output string representation of DecayTree.
Definition at line 145 of file DecayTree.cc.
|
private |
Decay daughters of m_myObject.
Definition at line 25 of file DecayTree.h.
|
private |
Current position in the building of the DecayTree.
Definition at line 101 of file DecayTree.h.
|
private |
Position of the token with the match symbol ^.
Definition at line 103 of file DecayTree.h.
|
private |
|
private |
Vector of decay nodes of the particles in the order of their appearance in the decay string for fast access.
Definition at line 106 of file DecayTree.h.
|
private |
root DecayNode
Definition at line 104 of file DecayTree.h.
|
private |
Count current tokens.
Definition at line 102 of file DecayTree.h.
|
private |
True if the tree is valid (invalid can happen if is constructed from a node with "No match")
Definition at line 100 of file DecayTree.h.