00001 #include <MUIOO.h> 00002 #include <cmath> 00003 void MUIOO::TRACE(std::string message){ 00004 std::cout << "TRACE: " << message << std::endl; 00005 } 00006 00007 void MUIOO::TRACE(std::string message, float val){ 00008 std::cout << "TRACE: " << message << "\t" << val << std::endl; 00009 } 00010 void MUIOO::PRINT(std::ostream& os, std::string message){ 00011 const int max_col=80; 00012 if(!message.size()) { 00013 os << std::string(max_col,'-') << std::endl; 00014 return; 00015 } 00016 int fill = max_col - message.size() - 2; 00017 int pre = static_cast<int>(std::floor(fill/2.0)); 00018 int post = fill - pre; 00019 os << std::string(pre,'-') << " "; 00020 os << message << " "; 00021 os << std::string(post,'-') << std::endl; 00022 } 00023 00024 double MUIOO::SQUARE(double x) { return x*x; } 00025 00026 double MUIOO::rapidity(double px, double py, double pz, double mass) { 00027 double ptot = std::sqrt(px*px + py*py + pz*pz); 00028 double E = std::sqrt(ptot*ptot + mass*mass); 00029 return 0.5*std::log((E+pz)/(E-pz)); 00030 } 00031 00032 double MUIOO::pt(double px, double py) { 00033 return std::sqrt(px*px + py*py); 00034 }