00001 #include "TPiFormFactor.h" 00002 #include "TRadGlobal.h" 00003 #include "TConstants.h" 00004 #include <iostream> 00005 #include <complex> 00006 #include <stdexcept> 00007 using namespace std; 00008 00009 //TRadGlobal *gGlobal; 00010 //TConstants *gConst; 00011 int main(unsigned int argc, char **argv){ 00012 gConst = new TConstants(); 00013 gGlobal = new TRadGlobal(); 00014 gGlobal->Set_Type(2); 00015 gGlobal->Set_E(800.); 00016 gGlobal->Set_ThetaMin(0.9); 00017 gGlobal->Set_dE_Abs(0.1); 00018 gGlobal->Set_Theta0_Rel(1); 00019 gGlobal->Set_ThetaInt(0.6); 00020 gGlobal->Set_TotalError(1.); 00021 gGlobal->Set_RelativeError(0.01); 00022 00023 try{ 00024 gGlobal->Init(); 00025 }catch(std::logic_error lge){ 00026 cout<<lge.what()<<endl; 00027 return 1; 00028 } 00029 00030 TPiFormFactor *fPi = new TPiFormFactor(); 00031 fPi->Init(); 00032 for (unsigned int i = 1; i < argc; i++){ 00033 double e = atof(argv[i]); 00034 complex<double> f = fPi->Eval(4*e*e); 00035 cout<<abs(f*conj(f))<<endl; 00036 } 00037 /* 00038 double En[] = {185, 195, 205, 215, 225, 235, 240, 250, 255, 260}; 00039 for (unsigned int i = 0; i < 10; i++){ 00040 double e = En[i]; 00041 double beta = sqrt(e*e - gConst->Mpi2())/e; 00042 complex<double> f = fPi->Eval(4*e*e); 00043 double cs0 = pow(beta,3)/pow(e,2)*abs(f*conj(f)); 00044 00045 e = 1.001*En[i]; 00046 beta = sqrt(e*e - gConst->Mpi2())/e; 00047 f = fPi->Eval(4*e*e); 00048 double cs1 = pow(beta,3)/pow(e,2)*abs(f*conj(f)); 00049 00050 cout<<En[i]<<" "<<(cs1-cs0)/cs0*100<<endl<<flush; 00051 } 00052 */ 00053 }