00001 00008 #ifndef _GRID_H 00009 #define _GRID_H 00010 00011 #include <iostream> 00012 #include <vector> 00013 #include <cmath> 00014 00015 #include "constants.h" 00016 00017 using namespace std; 00018 00025 class TGrid { 00026 00027 public: 00028 TGrid() { } 00029 TGrid(double, int, int, double); 00037 inline vector<double>& GetR() { return r; } 00039 inline vector<double>& GetZ() { return z; } 00041 inline vector<double>& GetEk() { return Ek; } 00043 inline vector<double>& GetBeta() { return beta; } 00045 inline vector<double>& GetGamma() { return gamma; } 00047 inline vector<double>& GetMomentum() { return momentum; } 00050 inline vector<double>& GetBetaEl() { return betael; } 00052 inline vector<double>& GetGammaEl() { return gammael; } 00054 inline vector<double>& GetMomentumEl() { return momentumel; } 00057 inline const double GetDeltaR() const { return Deltar; } 00059 inline const double GetDeltaZ() const { return Deltaz; } 00061 inline const double GetDeltaE() const { return DeltalogE; } 00064 inline const int GetDimR() const { return dimr; } 00066 inline const int GetDimZ() const { return dimz; } 00068 inline const int GetDimE() const { return dimE; } 00071 inline int index(int ir, int iz) { return ir*dimz+iz; } 00079 inline int index(int ir, int iz, int ip) { return (ir*dimz+iz)*dimE+ip; } 00089 ~TGrid() { 00090 r.clear(); 00091 z.clear(); 00092 Ek.clear(); 00093 beta.clear(); 00094 gamma.clear(); 00095 momentum.clear(); 00096 00097 betael.clear(); 00098 gammael.clear(); 00099 momentumel.clear(); 00100 00101 } 00104 protected: 00105 int dimE; 00106 int dimr; 00107 int dimz; 00108 double zmax; 00109 double zmin; 00110 double Deltar; 00111 double Deltaz; 00112 double Ekin_factor; 00113 double DeltalogE; 00114 vector<double> r; 00115 vector<double> z; 00116 vector<double> Ek; 00117 vector<double> beta; 00118 vector<double> gamma; 00119 vector<double> momentum; 00121 vector<double> betael; 00122 vector<double> gammael; 00123 vector<double> momentumel; 00125 }; 00126 00127 #endif
1.6.3