EvtDecayMode Class Reference

#include <EvtDecayMode.hh>

List of all members.

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::ostreamprint (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


Detailed Description

Definition at line 26 of file EvtDecayMode.hh.


Constructor & Destructor Documentation

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  ) 

Definition at line 47 of file EvtDecayMode.cc.

References _dau, EvtCyclic3::other(), s, and deljobs::string.

00048   : _mother(other._mother)
00049 {
00050   unsigned i;
00051   for(i=0;i<other._dau.size();i++) {
00052     
00053     string s;
00054     s.append(other._dau[i]);
00055     _dau.push_back(s);
00056   }
00057 }

EvtDecayMode::EvtDecayMode ( std::string  mother,
std::vector< std::string dau 
)

EvtDecayMode::~EvtDecayMode (  ) 

Definition at line 113 of file EvtDecayMode.cc.

00114 {}


Member Function Documentation

const char * EvtDecayMode::dal ( EvtCyclic3::Pair  i,
EvtCyclic3::Pair  j 
) const

Definition at line 176 of file EvtDecayMode.cc.

References q(), s, and deljobs::string.

00177 {
00178   string s(q(i));
00179   s.append(":");
00180   s.append(q(j));
00181   return s.c_str();
00182 }

const char * EvtDecayMode::dau ( int  i  )  const

Definition at line 129 of file EvtDecayMode.cc.

References _dau.

Referenced by EvtDalitzPlot::EvtDalitzPlot(), m(), and q().

00130 {
00131   assert(0<=i && i< (int) _dau.size());
00132   return _dau[i].c_str();
00133 }

const char * EvtDecayMode::m ( EvtCyclic3::Pair  i  )  const

Definition at line 154 of file EvtDecayMode.cc.

References dau(), first, s, EvtCyclic3::second(), and deljobs::string.

00155 {
00156   string s("m(");
00157   s.append(dau(first(i)));
00158   s.append(",");
00159   s.append(dau(second(i)));
00160   s.append(")");
00161   return s.c_str();
00162 }

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 }


Member Data Documentation

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]

Definition at line 51 of file EvtDecayMode.hh.

Referenced by EvtDecayMode(), mode(), and mother().


Generated on Tue Nov 29 23:18:58 2016 for BOSS_7.0.2 by  doxygen 1.4.7