Belle II Software  release-08-01-10
DecayForest Class Reference

Contains several DecayTree objects, which belong all to the same candidate. More...

#include <DecayForest.h>

Collaboration diagram for DecayForest:

Public Member Functions

 DecayForest (const std::string &full_decaystring, bool save_memory=true, bool removeRadiativeGammaFlag=false)
 Create a DecayForest from a full decaystring outputted by ParticleMCDecayString. More...
 
const DecayTreegetTree (unsigned int n) const
 Return nth tree (0 is the reconstructed tree)
 
const DecayTreegetReconstructedTree () const
 Get reconstructed tree.
 
const DecayTreegetOriginalTree () const
 Get first valid original tree.
 
unsigned int getNumberOfTrees () const
 Return number of trees.
 
unsigned int getOriginalTreeNumber () const
 Return first valid original tree number.
 

Static Public Member Functions

static int decayHashFloatToInt (float decayHash, float decayHashExtended)
 Convert DecayHashes outputted by ParticleMCDecayString module to an integer.
 

Private Attributes

std::vector< DecayTreeforest
 vector of DecayTrees
 
size_t m_first_valid_original
 The first valid DecayTree.
 

Detailed Description

Contains several DecayTree objects, which belong all to the same candidate.

Definition at line 24 of file DecayForest.h.

Constructor & Destructor Documentation

◆ DecayForest()

DecayForest ( const std::string &  full_decaystring,
bool  save_memory = true,
bool  removeRadiativeGammaFlag = false 
)
explicit

Create a DecayForest from a full decaystring outputted by ParticleMCDecayString.

Parameters
full_decaystringfull decay string
save_memoryby storing only the reconstructed and first valid original DecayTree
removeRadiativeGammaFlagremove 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 17 of file DecayForest.cc.

18 {
19 
21  unsigned int start = 0;
22  for (unsigned int i = 0; i < full_decaystring.size(); ++i) {
23  if (full_decaystring[i] == '|') {
24  forest.emplace_back(full_decaystring.substr(start, i - start), removeRadiativeGammaFlag);
25  start = i + 1;
26  if (save_memory and forest.back().isValid() and forest.size() > 1)
27  break;
28  }
29  }
30 
31  if (not(save_memory and forest.back().isValid() and forest.size() > 1))
32  forest.emplace_back(full_decaystring.substr(start, full_decaystring.size() - start), removeRadiativeGammaFlag);
33 
34  for (unsigned int j = 1; j < forest.size(); ++j) {
35  if (forest[j].isValid()) {
37  break;
38  }
39  }
40 
41 }
std::vector< DecayTree > forest
vector of DecayTrees
Definition: DecayForest.h:66
size_t m_first_valid_original
The first valid DecayTree.
Definition: DecayForest.h:67
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.

The documentation for this class was generated from the following files: