Belle II Software  release-08-01-10
DecayNode.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 <vector>
12 #include <string>
13 
14 namespace Belle2 {
23  class DecayNode {
24 
25  public:
31  DecayNode(int _pdg = 0, const std::vector<DecayNode>& _daughters = {}) : pdg(_pdg), daughters(_daughters) { }
32 
37  bool find_decay(const DecayNode& to_find) const;
38 
44  std::string print_node(unsigned int indent = 0) const;
45 
46 
47  int pdg;
48  std::vector<DecayNode> daughters;
49  };
50 
62  bool operator==(const DecayNode& node1, const DecayNode& node2);
63 
67  bool operator!=(const DecayNode& node1, const DecayNode& node2);
69 }
DecayNode describes the decay of a particle identified by its pdg code, into list of daughters.
Definition: DecayNode.h:23
std::vector< DecayNode > daughters
daughter decay nodes
Definition: DecayNode.h:48
DecayNode(int _pdg=0, const std::vector< DecayNode > &_daughters={})
Create new Decay node.
Definition: DecayNode.h:31
int pdg
pdg code of the particle
Definition: DecayNode.h:47
std::string print_node(unsigned int indent=0) const
Output a single node.
Definition: DecayNode.cc:30
bool operator==(const DecayNode &node1, const DecayNode &node2)
Compare two Decay Nodes: They are equal if All daughter decay nodes are equal or one of the daughter ...
Definition: DecayNode.cc:48
bool operator!=(const DecayNode &node1, const DecayNode &node2)
Not equal: See operator==.
Definition: DecayNode.cc:65
bool find_decay(const DecayNode &to_find) const
Check if the decay node contains the given decay tree.
Definition: DecayNode.cc:19
Abstract base class for different kinds of events.