/* fIRST IMPLEMENTATION BY ANLSEM,H. IN FORTRAN C++ CONVERSION T.K.PARAISO 04-2005 !!! IMPORTANT !!! Notice: Tables definition changes between FORTRAN and C++: 1/ Fortran indices start at 1 and C++ indices start at 0 2/ Tables are defined as table[column][row] in Fortran table[row][column] in c++ usefull reference http://gershwin.ens.fr/vdaniel/Doc-Locale/Langages-Program-Scientific/Fortran/Tutorial/arrays.htm */ #include "meyer.h" #include #include #include #include #include using namespace std; meyer::meyer() {;} meyer::~meyer() {;} void meyer::GFunctions(double* g1,double* g2, double tau) { //Diese Routine gibt in Abhaengigkeit von der reduzierten Dicke 'tau' //Funktionswerte fuer g1 und g2 zurueck. g1 und g2 sind dabei die von //Meyer angegebenen tabellierten Funktionen fuer die Berechnung von Halbwerts- //breiten von Streuwinkelverteilungen. (L.Meyer, phys.stat.sol. (b) 44, 253 //(1971)) double help; int i; double tau_[] = {0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0 }; double g1_[] = {0.050,0.115,0.183,0.245,0.305,0.363,0.419,0.473,0.525,0.575, 0.689,0.799,0.905,1.010,1.100,1.190,1.370,1.540,1.700,1.850, 1.990,2.270,2.540,2.800,3.050,3.290 }; double g2_[] = {0.00,1.25,0.91,0.79,0.73,0.69,0.65,0.63,0.61,0.59, 0.56,0.53,0.50,0.47,0.45,0.43,0.40,0.37,0.34,0.32, 0.30,0.26,0.22,0.18,0.15,0.13 }; if (tau kann ich nicht ... => STOP"< Tabelle A thetaSchlangeMax = 4.0; } else if (tau<=8.) { //! => Tabelle B thetaSchlangeMax = 7.0; } else if (tau<=20.) { //! => Tabelle C thetaSchlangeMax = 20.0; } else { std::cout<< "Subroutine ''Get_F_Function_Meyer'':"< kann ich nicht ... => STOP"<50.) { thetaStep = .5; } else if (thetaMax>25) { thetaStep = .25; } else if (thetaMax>12.5) { thetaStep = .125; } else { thetaStep = .0625; } //Tabelle der F-Werte erstellen: nBin = 0; std::cout<<"thetamax = "<nBinMax) { std::cout<< "nBin > nBinMax => EXIT"; break; } value[nBin] = sin(theta)*F; fValues[nBin+1] = F; // ! fuer Testzwecke fValuesFolded[nBin+1] = sin(theta/180*M_PI)*F;// ! fuer Testzwecke }// end of do loop //Berechnen der Flaecheninhalte der einzelnen Kanaele sowie der Integrale: bigtheta:for( i = 1;i<= nBin; i++) { area[i] = (value[i]+value[i-1])/2.* thetaStep; integ[i] = integ[i-1] + area[i]; } //Normiere totale Flaeche auf 1: rHelp = integ[nBin]; for( i = 1; i<=nBin; i++) { value[i] = value[i] / rHelp; area[i] = area[i] / rHelp; integ[i] = integ[i] / rHelp; } //vorerst noch: gib Tabelle in Datei und Histogrammfile aus: //! Berechne die Werte fuer theta=0: F_Functions_Meyer(tau,0.,&f1,&f2); F = Meyer_faktor4*Meyer_faktor4 * Ekin*Ekin /2 /M_PI * (f1 - Meyer_faktor3*f2);// TAO, Anselm was: Meyer_faktor5 * Ekin*Ekin * (f1 - Meyer_faktor3*f2); fValues[1] = F; fValuesFolded[1] = 0.; //! Gib die Werte in das Tabellenfile aus: ofstream Mprint("tkm.out"); theta = thetaStep; if (!Mprint.is_open()) exit(8); for( i = 1; i<=nBin+1;i++) { Mprint << theta<< " "<< fValues[i]/fValues[1]<<" " << fValuesFolded[i]< Reihe mit hoeherem Index //iColumn = 2 => Reihe mit kleinerem Index iColumn = 1; // 5 continue; do{ if (column_<=8) { //! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //! Werte aus 1. Tabelle: 0.2 <= tau <= 1.8 column = column_; // std::cout<<"thetaSchlange = "<