#include <EvtDecayMode.hh>
Public Member Functions | |
EvtDecayMode (const char *decay) | |
EvtDecayMode (const EvtDecayMode &other) | |
EvtDecayMode (std::string mother, std::vector< std::string > dau) | |
~EvtDecayMode () | |
const char * | mother () const |
int | nD () const |
const char * | dau (int i) const |
std::ostream & | print (std::ostream &) const |
const char * | m (EvtCyclic3::Pair i) const |
const char * | q (EvtCyclic3::Pair i) const |
const char * | dal (EvtCyclic3::Pair i, EvtCyclic3::Pair j) const |
const char * | mode () const |
Private Attributes | |
std::string | _mother |
std::vector< std::string > | _dau |
Definition at line 26 of file EvtDecayMode.hh.
EvtDecayMode::EvtDecayMode | ( | const char * | decay | ) |
Definition at line 60 of file EvtDecayMode.cc.
References _dau, _mother, Bes_Common::INFO, ganga-rec::j, RealDBUtil::npos, report(), s, and deljobs::string.
00061 { 00062 // Parse the decay string, it should be in a standard 00063 // format, e.g. "B+ -> pi+ pi+ pi-" with all spaces 00064 00065 string s(decay); 00066 size_t i,j; 00067 00068 // mother 00069 00070 i = s.find_first_not_of(" "); 00071 j = s.find_first_of(" ",i); 00072 00073 if(i == string::npos) { 00074 00075 report(INFO,"EvtGen") << "No non-space character found" << endl; 00076 assert(0); 00077 } 00078 00079 if(j == string::npos) { 00080 00081 report(INFO,"EvtGen") << "No space before -> found" << endl; 00082 assert(0); 00083 } 00084 00085 _mother = string(s,i,j-i); 00086 00087 i = s.find_first_not_of(" ",j); 00088 j = s.find_first_of("->",j); 00089 if(i != j) { 00090 00091 report(INFO,"EvtGen") << "Multiple mothers?" << i << "," << j << endl; 00092 assert(0); 00093 } 00094 j += 2; 00095 00096 while(1) { 00097 00098 i = s.find_first_not_of(" ",j); 00099 j = s.find_first_of(" ",i); 00100 00101 if(i == string::npos) break; 00102 if(j == string::npos) { 00103 _dau.push_back(string(s,i,s.size()-i+1)); 00104 break; 00105 } else { 00106 _dau.push_back(string(s,i,j-i)); 00107 } 00108 } 00109 }
EvtDecayMode::EvtDecayMode | ( | const EvtDecayMode & | other | ) |
EvtDecayMode::EvtDecayMode | ( | std::string | mother, | |
std::vector< std::string > | dau | |||
) |
EvtDecayMode::~EvtDecayMode | ( | ) |
const char * EvtDecayMode::dal | ( | EvtCyclic3::Pair | i, | |
EvtCyclic3::Pair | j | |||
) | const |
const char * EvtDecayMode::dau | ( | int | i | ) | const |
const char * EvtDecayMode::m | ( | EvtCyclic3::Pair | i | ) | const |
const char * EvtDecayMode::mode | ( | ) | const |
Definition at line 135 of file EvtDecayMode.cc.
References _dau, _mother, and deljobs::string.
Referenced by EvtMultiChannelParser::getDecayMode().
00136 { 00137 string ret = _mother + string(" -> "); 00138 int i; 00139 for(i=0;i<_dau.size()-1;i++) ret += string(_dau[i]) + string(" "); 00140 ret += _dau[_dau.size()-1]; 00141 return ret.c_str(); 00142 }
const char * EvtDecayMode::mother | ( | ) | const |
Definition at line 117 of file EvtDecayMode.cc.
References _mother.
Referenced by EvtDalitzPlot::EvtDalitzPlot().
00118 { 00119 return _mother.c_str(); 00120 }
int EvtDecayMode::nD | ( | ) | const |
Definition at line 123 of file EvtDecayMode.cc.
References _dau.
00124 { 00125 return _dau.size(); 00126 }
std::ostream& EvtDecayMode::print | ( | std::ostream & | ) | const |
Referenced by operator<<().
const char * EvtDecayMode::q | ( | EvtCyclic3::Pair | i | ) | const |
Definition at line 165 of file EvtDecayMode.cc.
References dau(), first, s, EvtCyclic3::second(), and deljobs::string.
Referenced by dal().
00166 { 00167 string s("q("); 00168 s.append(dau(first(i))); 00169 s.append(","); 00170 s.append(dau(second(i))); 00171 s.append(")"); 00172 return s.c_str(); 00173 }
std::vector<std::string> EvtDecayMode::_dau [private] |
Definition at line 52 of file EvtDecayMode.hh.
Referenced by dau(), EvtDecayMode(), mode(), and nD().
std::string EvtDecayMode::_mother [private] |