Contains several DecayTree objects, which belong all to the same candidate.
More...
#include <DecayForest.h>
|
static int | decayHashFloatToInt (float decayHash, float decayHashExtended) |
| Convert DecayHashes outputted by ParticleMCDecayString module to an integer.
|
|
Contains several DecayTree objects, which belong all to the same candidate.
Definition at line 24 of file DecayForest.h.
◆ 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_decaystring | full decay string |
save_memory | by storing only the reconstructed and first valid original DecayTree |
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 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) {
37 break;
38 }
39 }
40
41}
std::vector< DecayTree > forest
vector of DecayTrees
size_t m_first_valid_original
The first valid DecayTree.
◆ decayHashFloatToInt()
int decayHashFloatToInt |
( |
float |
decayHash, |
|
|
float |
decayHashExtended |
|
) |
| |
|
static |
Convert DecayHashes outputted by ParticleMCDecayString module to an integer.
Definition at line 44 of file DecayForest.cc.
45{
46
47
48 assert(sizeof(float) == sizeof(uint32_t));
49
50 union convert {
51 uint32_t i;
52 float f;
53 };
54 convert bitconverter;
55
56 uint64_t integer = 0;
57
58 bitconverter.f = decayHash;
59 integer = static_cast<uint64_t>(bitconverter.i) << 32;
60
61
62
63 bitconverter.f = decayHashExtended;
64 integer += bitconverter.i;
65
66 return integer;
67
68}
◆ getNumberOfTrees()
unsigned int getNumberOfTrees |
( |
| ) |
const |
|
inline |
◆ getOriginalTree()
Get first valid original tree.
Definition at line 48 of file DecayForest.h.
◆ getOriginalTreeNumber()
unsigned int getOriginalTreeNumber |
( |
| ) |
const |
|
inline |
Return first valid original tree number.
Definition at line 63 of file DecayForest.h.
◆ getReconstructedTree()
const DecayTree & getReconstructedTree |
( |
| ) |
const |
|
inline |
◆ getTree()
const DecayTree & getTree |
( |
unsigned int |
n | ) |
const |
|
inline |
Return nth tree (0 is the reconstructed tree)
Definition at line 38 of file DecayForest.h.
◆ forest
◆ m_first_valid_original
size_t m_first_valid_original |
|
private |
The documentation for this class was generated from the following files: