ComPWA
Common Partial-Wave-Analysis Framework
SubSystem.cpp
Go to the documentation of this file.
1 // Copyright (c) 2017 The ComPWA Team.
2 // This file is part of the ComPWA framework, check
3 // https://github.com/ComPWA/ComPWA/license.txt for details.
4 
5 #include "SubSystem.hpp"
6 
7 namespace ComPWA {
8 namespace Physics {
9 
10 SubSystem::SubSystem(const std::vector<std::vector<unsigned int>> &FinalStates,
11  const std::vector<unsigned int> &Recoil,
12  const std::vector<unsigned int> &ParentRecoil)
13  : DecayProductFinalStates(FinalStates), RecoilFinalState(Recoil),
14  ParentRecoilFinalState(ParentRecoil) {
15 
16  for (auto &fs : DecayProductFinalStates) {
17  std::sort(fs.begin(), fs.end());
18  }
19  std::sort(RecoilFinalState.begin(), RecoilFinalState.end());
20  std::sort(ParentRecoilFinalState.begin(), ParentRecoilFinalState.end());
21 }
22 
23 std::ostream &operator<<(std::ostream &stream, const SubSystem &s) {
24  for (auto const &j : s.DecayProductFinalStates) {
25  stream << "_";
26  for (auto const &i : j)
27  stream << std::to_string(i);
28  }
29  if (s.RecoilFinalState.size() > 0) {
30  stream << "_vs_";
31  for (auto i : s.RecoilFinalState)
32  stream << std::to_string(i);
33  }
34 
35  return stream;
36 }
37 
38 bool SubSystem::operator==(const SubSystem &b) const {
39  // we assume all vectors are sorted!!!
43  return true;
44  return false;
45 }
46 
47 const std::vector<std::vector<unsigned int>> &
50 }
51 
52 const std::vector<unsigned int> &SubSystem::getRecoilState() const {
53  return RecoilFinalState;
54 }
55 
56 const std::vector<unsigned int> &SubSystem::getParentRecoilState() const {
58 }
59 
60 } // namespace Physics
61 } // namespace ComPWA
virtual const std::vector< unsigned int > & getParentRecoilState() const
Definition: SubSystem.cpp:56
virtual const std::vector< unsigned int > & getRecoilState() const
Definition: SubSystem.cpp:52
friend std::ostream & operator<<(std::ostream &stream, const SubSystem &s)
Definition: SubSystem.cpp:23
virtual const std::vector< std::vector< unsigned int > > & getFinalStates() const
Definition: SubSystem.cpp:48
SubSystem(const std::vector< std::vector< unsigned int >> &FinalStates, const std::vector< unsigned int > &Recoil, const std::vector< unsigned int > &ParentRecoil)
Definition: SubSystem.cpp:10
bool operator==(const SubSystem &b) const
Definition: SubSystem.cpp:38
std::vector< std::vector< unsigned int > > DecayProductFinalStates
Definition: SubSystem.hpp:47
std::vector< unsigned int > RecoilFinalState
Definition: SubSystem.hpp:48
std::vector< unsigned int > ParentRecoilFinalState
Definition: SubSystem.hpp:49
Definition of a two-body decay node within a sequential decay tree.
Definition: SubSystem.hpp:31
Contains SubSystem class.