#include "HADRONS++/Main/Tools.H" #include "ATOOLS/Org/Message.H" #include "ATOOLS/Org/MyStrStream.H" #include "ATOOLS/Org/Run_Parameter.H" #include "ATOOLS/Org/Data_Reader.H" #include "ATOOLS/Math/Algebra_Interpreter.H" #include //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // general tools %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% using namespace HADRONS; using namespace ATOOLS; using namespace std; PHASIC::Decay_Table * Tools::partonic_b = new PHASIC::Decay_Table(Flavour(kf_b),NULL); PHASIC::Decay_Table * Tools::partonic_c = new PHASIC::Decay_Table(Flavour(kf_c),NULL); const double Tools::Vud = 0.97377; const double Tools::Vus = 0.2257; const double Tools::Vub = 4.31e-3; const double Tools::Vcd = 0.225; const double Tools::Vcs = 0.973; const double Tools::Vcb = 41.6e-3; const double Tools::Vtd = 7.4e-3; const double Tools::Vts = Tools::Vtd/0.208; const double Tools::Vtb = 1.0; // 3 particle phase space function lambda double Tools::Lambda( double a, double b, double c ) { double L = sqr(a-b-c)-4.*b*c; if (L>0.) return L; return 0.; } // standard Breit Wigner with given Mass * Width Complex Tools::BreitWigner( double s, double Mass2, double MassWidth ) { return Mass2/Complex(Mass2-s,-1.*MassWidth ); } // standard Breit Wigner with given Mass * Width Complex Tools::BreitWignerFix( double s, double Mass2, double MassWidth ) { return Complex(Mass2,-1.*MassWidth)/Complex(Mass2-s,-1.*MassWidth ); } // off shell mass * width (2 particle final state with same mass) double Tools::OffShellMassWidth( double s, double Mass2, double Width, double ms ) { if (s>4.*ms && Mass2>4.*ms) return( sqrt(s)*Width*Mass2/s * pow( (s-4.*ms)/(Mass2-4.*ms), 1.5 ) ); return 0.; } // off shell mass * width (2 particle final state with different masses) double Tools::OffShellMassWidth( double s, double Mass2, double Width, double ms1, double ms2 ) { double threshold = ms1+ms2+2.*sqrt(ms1*ms2); if (Mass2>threshold && s>threshold) return( sqrt(s)*Width*Mass2/s * pow( Mass2/s*Lambda(s,ms1,ms2)/Lambda(Mass2,ms1,ms2), 1.5 ) ); return 0; } bool Tools::ExtractFlavours(std::vector & helpkfc,std::string help) { helpkfc.clear(); size_t pos = help.find("{"); bool hit; if (pos!=std::string::npos) help = help.substr(pos+1); else { msg_Error()<<"WARNING in "< & specs, std::vector & specweights) { specs.clear(); specweights.clear(); size_t pos = entry.find("{"); bool hit; if (pos!=std::string::npos) entry = entry.substr(pos+1); else { msg_Error()<<"WARNING in "<0); } void Tools::ExtractBRInfo( std::string entry, double & br, double & dbr, std::string & origin ) { size_t posa, posb; // start and end of things b/w brackets size_t posmin; // start of first bracket std::string sbr(""), sdbr(""); // extract Delta BR posa = entry.find("("); posb = entry.find(")"); posmin = posa; if(posa!=std::string::npos && posb!=std::string::npos && (posa+1)!=posb) sdbr = entry.substr(posa+1,posb-posa-1); if (sdbr=="") sdbr = "-1.0"; // extract Origin posa = entry.find("["); posb = entry.find("]"); if(posmin==std::string::npos || (posmin!=std::string::npos && posmin>posa)) posmin=posa; if(posa!=std::string::npos && posb!=std::string::npos) origin = entry.substr(posa+1,posb-posa-1); else origin = std::string(""); // extract BR if( posmin!=std::string::npos ) sbr = entry.substr(0,posmin); else sbr = entry.substr(0); Algebra_Interpreter ip; sdbr=ip.Interprete(sdbr); sbr=ip.Interprete(sbr); dbr=ToType(sdbr); br=ToType(sbr); if (dbr==-1.0) dbr = br; } void GeneralModel::AddParameters(const std::string& params) { Data_Reader reader(" ",";","!"); reader.AddComment("#"); reader.AddComment("//"); reader.SetMatrixType(mtc::transposed); reader.AddLineSeparator("\n"); if (params!="") reader.RescanFileContent(params,true); vector > helpsvv; reader.MatrixFromString(helpsvv,""); Algebra_Interpreter ip; for (size_t i=0;i = double abs = ToType ( ip.Interprete(helpsvv[i][3]) ); double phase = ToType ( ip.Interprete(helpsvv[i][4]) ); (*this)[helpsvv[i][0]+"_"+helpsvv[i][1]+"_abs"] = abs; (*this)[helpsvv[i][0]+"_"+helpsvv[i][1]+"_phase"] = phase; } } } }