#include <MyCfSource.hh>
Public Methods | |
| MyCfSource (int newIsotope=k.Isotope, int newRmaxgen=k.Rmaxgen) | |
| MyCfSource constructor. More... | |
| ~MyCfSource () | |
| MyCfSource destructor. | |
| MyCfSource (const MyCfSource &CfSource) | |
| MyCfSource copy constructor. | |
| MyCfSource & | operator= (const MyCfSource &rhs) |
| MyCfSource overloaded = operator. | |
| int | GetNumCfSources () const |
| Returns the number of Cf sources. | |
| double | GetCfNeutronEnergy (int &n) const |
| Returns the energy of the neutron produced by each Cf decay. More... | |
| double | GetCfVertexR (int &n) const |
| Returns the radius of the neutron produced by each Cf decay. More... | |
| double | GetCfVertexCosTheta (int &n) const |
| Returns cos(theta) of the neutron produced by each Cf decay. More... | |
| double | GetCfVertexPhi (int &n) const |
| Returns the phi of the neutron produced by each Cf decay. More... | |
Static Public Methods | |
| float | Cf252NeutronSpectrum (const float &x) |
| The probability density of the delayed neutrons from the Cf decay as a function of neutron energy. | |
The supported isotope is 252, which is also the default isotope given ReactorConstants. The neutrons are generated by the Cf252NeutronSpectrum function, which the probability density of the produced neutrons as a function of neutron energy. One neutron is produced per Cf source. The photons are generated by a gaussian peak centered around XX MeV.
The number and locations of the Cf sources are read in from cf252_position.txt and parsed by MyCfSource to yield the source vertex R, cos(theta), and phi.
Definition at line 25 of file MyCfSource.hh.
|
||||||||||||
|
MyCfSource constructor. Called with the desired Cf isotope: 252, which is the default isotope given in ReactorConstants and the maximum allowed radius for generating particles in the simulation, Rmaxgen (default = 200 cm). If the source in cf252_position.txt is located with R > Rmaxgen the source is ignored and an error message is printed. Definition at line 17 of file MyCfSource.cpp. References Cf252NeutronSpectrum, ReactorConstants::Ndim, and ReactorConstants::pi.
00018 {
00019
00020 Isotope = newIsotope;
00021 Rmaxgen = newRmaxgen;
00022
00023 // cout << "MyCfSource::MyCfSource(" << Isotope << "," << Rmaxgen
00024 // << ")" << endl;
00025
00026 // Cf252
00027 if(Isotope == 252){
00028
00029 // setup the probability density as a function of energy
00030 bool static first=1;
00031 float static fspace[200];
00032
00033 if(first){
00034 float xlo = 0.;
00035 float xhi = 50.;
00036 funlxp_(Cf252NeutronSpectrum,fspace,xlo,xhi);
00037 first = 0;
00038 }
00039
00040 // input the source number and position
00041 fstream cf252_position("data/cf252_position.txt", ios::in);
00042 //cout << "Cf input file: data/cf252_position.txt" << endl;
00043
00044 Nsources = 0;
00045 char paramLine[256];
00046 string dummy;
00047 bool done = false;
00048 bool numSet = false;
00049 int positionNum = 0;
00050
00051 while(!done){
00052
00053 // '#' specifies a comment line -- ignore it
00054 if(cf252_position.peek() == '#'){
00055
00056 cf252_position.getline(paramLine, 256);
00057 continue;
00058 }
00059
00060 // 'E'ND or 'e'nd specifies end of file -- set done flag to true
00061 if(cf252_position.peek() == 'e' || cf252_position.peek() == 'E'){
00062
00063 if(Nsources == 0) cout << " Cf252 ERROR: "
00064 << "number of cf252 sources = 0" << endl;
00065 done = true;
00066 continue;
00067 }
00068
00069 // 'N'SOURCES = or 'n'sources = specifies number of sources
00070 if(cf252_position.peek() == 'n' || cf252_position.peek() == 'N'){
00071
00072 if(numSet){
00073
00074 cf252_position.getline( paramLine, 256 );
00075 continue;
00076 }
00077 cf252_position >> dummy;
00078 while(cf252_position.peek() == ' ' || cf252_position.peek() == '=')
00079 cf252_position.ignore(1);
00080
00081 cf252_position >> Nsources;
00082 if(Nsources == 0){
00083 cout << " Cf252 ERROR: number of cf252 sources = 0" << endl;
00084 done = true;
00085 continue;
00086 }
00087
00088 numSet = true;
00089 continue;
00090 }
00091
00092 // 'P'OSITION = or 'p'osition = specifies position of the sourse(s)
00093 if(cf252_position.peek() == 'p' || cf252_position.peek() == 'P'){
00094
00095 if(Nsources == 0 || positionNum >= Nsources){
00096
00097 cout << " Cf252 ERROR: too many positions " << positionNum+1
00098 << " given for the number of sources " << Nsources << endl;
00099 cf252_position.getline( paramLine, 256 );
00100 positionNum++;
00101 continue;
00102 }
00103 cf252_position >> dummy;
00104 while(cf252_position.peek() == ' ' || cf252_position.peek() == '=')
00105 cf252_position.ignore(1);
00106
00107 cf252_position >> R[positionNum] >> zR[positionNum]
00108 >> phiR[positionNum];
00109
00110 // check for unphysical source positions
00111 if(R[positionNum] > Rmaxgen){
00112 cout << " Cf252 ERROR: R[" << positionNum << "] of "
00113 << R[positionNum] << " > Rmaxgen" << endl;
00114 done = true;
00115 continue;
00116 }
00117 if(zR[positionNum] < -1. || zR[positionNum] > 1.){
00118 cout << " Cf252 ERROR: CosTheta["
00119 << positionNum << "] of " << zR[positionNum] << endl;
00120 done = true;
00121 continue;
00122 }
00123 if(phiR[positionNum] > 2*k.pi){
00124 cout << " Cf252 ERROR: Phi[" << positionNum << "] of "
00125 << phiR[positionNum] << " > 2*pi" << endl;
00126 done = true;
00127 continue;
00128 }
00129
00130 positionNum++;
00131 continue;
00132 }
00133
00134 // ignore extra whitespace
00135 if(cf252_position.peek() == ' ' || cf252_position.peek() == '\n'){
00136
00137 cf252_position.ignore(1);
00138 continue;
00139 }
00140 }
00141
00142 if(positionNum < Nsources){
00143 cout << " Cf252 ERROR: not enough positions " << positionNum
00144 << " given for the number of sources " << Nsources << endl;
00145 }
00146
00147 for(int n=0;n<Nsources;n++){
00148 //cout << "Source " << n+1 << endl << " Cf Source Position = "
00149 // << R[n] << ", " << zR[n] << ", " << phiR[n] << endl;
00150
00151 // pick a neutron energy
00152 int len = 1;
00153 funlux_(fspace,neutronE[n],len);
00154 //cout << " Cf Neutron Energy = " << neutronE[n] << endl;
00155
00156 } // done looping over sources
00157
00158 // zero out remaining energy and position arrays
00159 for(int n=Nsources;n<k.Ndim;n++){
00160 neutronE[n] = 0.;
00161 R[n] = 0.;
00162 zR[n] = 0.;
00163 phiR[n] = 0.;
00164 }
00165
00166 } // done with Cf 252
00167
00168 if(Isotope == 255){
00169
00170 Nsources = 0;
00171 for(int n=Nsources;n<k.Ndim;n++){
00172
00173 neutronE[n] = 0.;
00174 R[n] = 0.;
00175 zR[n] = 0.;
00176 phiR[n] = 0.;
00177 }
00178 } // done with Cf 255
00179
00180 }
|
|
|
Returns the energy of the neutron produced by each Cf decay. Called with the integer index for each neutron in the neutronE array, from 0 to the total number of sources. Definition at line 54 of file MyCfSource.hh. Referenced by ReactorEvent::ReactorEvent.
00054 {return neutronE[n];}
|
|
|
Returns cos(theta) of the neutron produced by each Cf decay. Called with the integer index for each neutron in the zR array, from 0 to the total number of sources. Definition at line 63 of file MyCfSource.hh. Referenced by ReactorEvent::ReactorEvent.
00063 {return zR[n];}
|
|
|
Returns the phi of the neutron produced by each Cf decay. Called with the integer index for each neutron in the phiR array, from 0 to the total number of sources. Definition at line 67 of file MyCfSource.hh. Referenced by ReactorEvent::ReactorEvent.
00067 {return phiR[n];}
|
|
|
Returns the radius of the neutron produced by each Cf decay. Called with the integer index for each neutron in the R array, from 0 to the total number of sources. Definition at line 59 of file MyCfSource.hh. Referenced by ReactorEvent::ReactorEvent.
00059 {return R[n];}
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002