00001
00002
00003
00004
00005 #ifndef __PEGSDATA_H
00006 #define __PEGSDATA_H
00007
00008 #include "gismo/Material.h"
00009 #include "gismo/MatData.h"
00010
00011 #include <iostream>
00012
00013 #include <cstdlib>
00014 #include <algorithm>
00015
00016 #include "egs/Photin.h"
00017 #include "egs/Brempr.h"
00018 #include "egs/Elecin.h"
00019
00020 class PEGSData : public MatData
00021 {
00022 friend class EGS;
00023 public:
00024 PEGSData():ae(1E12f),ap(1E12f){};
00025
00026
00027 ~PEGSData();
00028
00029
00030 void read(std::istream& in, Material& mat);
00031
00032
00033 MatData* copy()const {return new PEGSData();}
00034
00035
00036 void read(std::istream&);
00037
00038
00039
00040 float ecut() const {return ae;}
00041 float pcut() const {return ap;}
00042 float emax() const {return ue;}
00043 float pmax() const {return up;}
00044 float rl() const {return rldu;}
00045
00046 float hzbrang()const {return zbrang;}
00047
00048
00049 float tmxs(float ke)const;
00050
00051
00052 float meanFreePath(float e, int charge)const;
00053 float dedx(float e, int charge) const;
00054
00055
00056 enum channel {STOP, BREMS, MOLLER, ANNIH, BHABHA, PAIR, COMPT, PHOTO, RAYLEIGH};
00057
00058
00059 PEGSData::channel chooseChannel(float ran,float e,int charge)const;
00060
00061
00062
00063 static float estepe;
00064
00065
00066
00067
00068 static int irayl;
00069
00070
00071 static const float rm;
00072 static const float dunit;
00073
00074
00075 void printHead1(std::ostream&);
00076 void printHead2(std::ostream&);
00077 void printOn(std::ostream&);
00078
00079
00080 private:
00081
00082 float rldu;
00083 int iraylm;
00084
00085
00086 float ae, ap,
00087 up, ue,
00088 te,
00089 thmoll;
00090
00091 float zbrang;
00092
00093
00094 Brempr bp;
00095 Elecin el;
00096 Photin ph;
00097 Kedge edge;
00098
00099 public:
00100
00101
00102
00103 float esig(float e)const;
00104 float psig(float e)const;
00105 float ededx(float e)const;
00106 float pdedx(float e)const;
00107 float ebr1(float e)const;
00108 float pbr1(float e)const;
00109 float pbr2(float e)const;
00110
00111 float gmfp(float e)const;
00112 float gbr1(float e)const;
00113 float gbr2(float e)const;
00114 float cohe(float e)const;
00115
00116 float blcc()const{return el.blcc;}
00117 float xcc()const{return el.xcc;}
00118 float ebinda()const{return ph.ebinda;}
00119
00120 float screening(float del, int lvx, int lvl)const { return bp.screening(del,lvx,lvl);}
00121 float alphi(int lvx)const{return bp.alphi[lvx];}
00122 float bpar(int lvx)const{return bp.bpar[lvx];}
00123
00124 };
00125
00126
00127
00128
00129
00130
00131 inline float PEGSData::esig(float ke)const
00132 {
00133 el.updateIndex(ke); return el.esig();
00134 }
00135 inline float PEGSData::psig(float ke)const
00136 { el.updateIndex(ke); return el.psig();
00137 }
00138
00139 inline float PEGSData::ededx(float ke)const
00140 { el.updateIndex(ke); return el.ededx();
00141
00142 }
00143
00144 inline float PEGSData::pdedx(float ke)const
00145 { el.updateIndex(ke); return el.pdedx();
00146
00147 }
00148
00149 inline float PEGSData::ebr1(float ke) const
00150 { el.updateIndex(ke); return el.ebr1();
00151
00152 }
00153
00154 inline float
00155 PEGSData::pbr1(float ke)const
00156 { el.updateIndex(ke); return el.pbr1();
00157
00158 }
00159
00160 inline float
00161 PEGSData::pbr2(float ke)const
00162 { el.updateIndex(ke); return el.pbr2();
00163
00164 }
00165 inline float
00166 PEGSData::tmxs(float ke)const
00167 {
00168
00169
00170
00171
00172
00173 el.updateIndex(ke); return std::min(el.tmxs(),200*el.teff0);
00174 }
00175
00176
00177
00178 inline float
00179 PEGSData::gmfp(float eig)const
00180 { ph.updateIndex(eig); return ph.gmfp();
00181 }
00182
00183 inline float
00184 PEGSData::gbr1(float eig)const
00185 { ph.updateIndex(eig); return ph.gbr1();
00186 }
00187
00188 inline float
00189 PEGSData::gbr2(float eig)const
00190 { ph.updateIndex(eig); return ph.gbr2();
00191 }
00192
00193 inline float
00194 PEGSData::cohe(float eig)const
00195 { ph.updateIndex(eig); return ph.cohe();
00196 }
00197
00198 #endif
00199