MINT2
DecayTreeItem.cpp
Go to the documentation of this file.
1 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2 // status: Mon 9 Feb 2009 19:18:03 GMT
3 
4 #include "Mint/DecayTreeItem.h"
6 #include <cmath>
7 
9  : _pdg_id(i)
10  , _L_angMom(-9999)
11 {
12 }
14  : _pdg_id(other._pdg_id)
15  , _L_angMom(other._L_angMom)
16 {}
18  _pdg_id = other._pdg_id;
19  _L_angMom = other._L_angMom;
20  return *this;
21 }
22 
25  if(0 == ppl){
26  std::cout << "Error in DecayTreeItem::props(): "
27  << "can't find ParticlePropertiesList."
28  << std::endl;
29  return 0;
30  }
31  return ppl->get(_pdg_id);
32 }
33 std::string DecayTreeItem::name() const{
34  const ParticleProperties* pp = props();
35  if(0 == pp){
36  return "";
37  }
38  return pp->name();
39 }
40 std::string DecayTreeItem::SVPAT() const{
41  const ParticleProperties* pp = props();
42  if(0 == pp){
43  return "?";
44  }
45  return pp->SVPAT();
46 }
47 double DecayTreeItem::mass() const{
48  const ParticleProperties* pp = props();
49  if(0 == pp){
50  return -1;
51  }
52  return pp->mass();
53 }
55  const ParticleProperties* pp = props();
56  if(0 == pp){
57  return false;
58  }
59  return pp->isNonResonant();
60 }
61 double DecayTreeItem::width() const{
62  const ParticleProperties* pp = props();
63  if(0 == pp){
64  return -1;
65  }
66  return pp->width();
67 }
68 std::string DecayTreeItem::charge() const{
69  const ParticleProperties* pp = props();
70  if(0 == pp){
71  return "-9999";
72  }
73  return pp->charge();
74 }
76  const ParticleProperties* pp = props();
77  if(0 == pp){
78  return -1;
79  }
80  return pp->hasDistinctAnti();
81 }
82 int DecayTreeItem::pdg() const{
83  return _pdg_id;
84 }
85 
86 std::string DecayTreeItem::J() const{
87  const ParticleProperties* pp = props();
88  if(0 == pp){
89  return "";
90  }
91  return pp->J();
92 }
93 
94 
96  if(! hasDistinctAnti()) return false;
97  _pdg_id *= -1;
98  return true;
99 }
100 
102  _pdg_id = id;
103 }
105  if(L() < 0) return ' ';
106 
107  if(L()==0) return 'S';
108  else if(L()==1) return 'P';
109  else if(L()==2) return 'D';
110  else if(L()==3) return 'F';
111  else if(L()==4) return 'G';
112  else if(L()==5) return 'H';
113  else if(L()==6) return 'I';
114  else{
115  // J's missing, next (L=7) is K, then alphabetical
116  char Kplus='K';
117  int advanceK = L()-7;
118  for(int i=0; i < advanceK; i++) Kplus++;
119  return Kplus;
120  }
121 }
122 
123 void DecayTreeItem::print(std::ostream& out) const{
124  const ParticleProperties* pp = props();
125  if(0 == pp){
126  out << _pdg_id;
127  }else{
128  out << pp->name()
129  << "(" << pp->SVPAT() <<")";
130  }
131  if(L() > -9998){
132  out << L_as_SPD() << "-wave";
133  }
134 }
135 void DecayTreeItem::printShort(std::ostream& out) const{
136  const ParticleProperties* pp = props();
137  if(0 == pp){
138  out << _pdg_id;
139  }else{
140  out << pp->name();
141  }
142  if(L() > -9998){
143  out << "[" << L_as_SPD() << "]";
144  }
145 }
147  DecayTreeItem dt(*this);
148  dt.antiThis();
149  return dt;
150 }
152  return *this;
153 }
154 
155 std::ostream& operator<<(std::ostream& os
156  , const DecayTreeItem& dti){
157  dti.print(os);
158  return os;
159 }
160 
161 std::stringstream& operator<<(std::stringstream& seam
162  , const DecayTreeItem& dti){
163  dti.printShort(seam);
164  return seam;
165 }
166 
167 std::stringstream& operator<<(std::stringstream& seam
168  , int i){
169  ((std::ostream&) seam) << i;
170  return seam;
171 }
172 
173 
174 //
std::string SVPAT() const
std::string SVPAT() const
bool hasDistinctAnti() const
char L_as_SPD() const
std::string J() const
DecayTreeItem & operator=(const DecayTreeItem &other)
std::ostream & operator<<(std::ostream &os, const DecayTreeItem &dti)
std::string charge() const
double mass() const
std::string charge() const
virtual void print(std::ostream &out=std::cout) const
virtual void printShort(std::ostream &out=std::cout) const
const ParticleProperties * get(const std::string &name) const
bool ChargeConThis()
void setPDG(int id)
std::string J() const
int L() const
Definition: DecayTreeItem.h:59
std::string name() const
std::string name() const
static const ParticlePropertiesList * getMe()
int pdg() const
double width() const
bool isNonResonant() const
const ParticleProperties * props() const
DecayTreeItem(int i=0)
double width() const
DecayTreeItem operator+() const
DecayTreeItem operator-() const