00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef ENDL_FORMATS
00039 #define ENDL_FORMATS
00040
00041 #include <iostream>
00042 #include <iomanip>
00043 #include <fstream>
00044 #include <sstream>
00045 #include <string>
00046 #include <cmath>
00047 #include <vector>
00048 #include <map>
00049 #include <sstream>
00050 #include "bdfls_tools.hpp"
00051 #include "file_names.hpp"
00052
00053 using namespace std;
00054
00055
00056 class MTCPair
00057
00058
00059 {
00060 public:
00061 int MT;
00062 int C;
00063 MTCPair( int mt, int c ): MT(mt), C(c) {}
00064 MTCPair( const MTCPair& other ): MT(other.MT), C(other.C) {}
00065 bool operator==( const MTCPair& other ) const { return MT == other.MT; }
00066 bool operator<( const MTCPair& other ) const { return MT < other.MT; }
00067 };
00068
00069
00070
00071 class YoList
00072
00073 {
00074 public:
00075 vector<int> yos;
00076 string reactionName;
00077 YoList( string rxnName="", bool fission=false,
00078 int nN=0, int nP=0, int nD=0, int nT=0, int nH=0, int nA=0, int nG=0):
00079 reactionName(rxnName), yos(8,0)
00080 {
00081 yos[0]=int(fission);
00082 yos[1]=nN;
00083 yos[2]=nP;
00084 yos[3]=nD;
00085 yos[4]=nT;
00086 yos[5]=nH;
00087 yos[6]=nA;
00088 yos[7]=nG;
00089 }
00090 YoList( const YoList& other ): reactionName(other.reactionName), yos(other.yos) {}
00091 bool operator==( const YoList& other ) const { return yos == other.yos; }
00092 bool operator<( const YoList& other ) const { return yos < other.yos; }
00093 int operator[]( int i ) const { return yos[i]; }
00094 int& operator[]( int i ) { return yos[i]; }
00095 YoList& operator+=(const YoList& other)
00096 {
00097 for(unsigned int i=0;i<yos.size();++i) {yos[i]=yos[i]+other.yos[i];}
00098 return *this;
00099 }
00100 bool fission() { return yos[0]!=0; }
00101 string str()
00102 {
00103 stringstream ss;
00104 for(unsigned int i=0;i<yos.size();++i) {ss<<yos[i];}
00105 return ss.str()+" "+reactionName;
00106 }
00107 };
00108
00109
00110
00111
00112 class ENDLClass
00113
00114 {
00115 private:
00116
00117
00118 void fill_yoMap();
00119
00120
00121 map< MTCPair, YoList > yoMap;
00122
00123 public:
00124
00125 int ZA, incident_particle,date,twelve;
00126 double atomic_weight, lifetime, temp, zero;
00127 double projectile_mass, target_mass;
00128 double Max_E_in;
00129
00130 int outgoing_particle;
00131 double Max_E_out;
00132 int res_za;
00133 int intermediate_C;
00134 int current_za;
00135 double excitation_level;
00136 double threshold;
00137 int C, S, I, T, F, LR, yi;
00138 double QM,QI,X[5];
00139
00140 bool angles_CM;
00141
00142 double K2MeV,N2AMU,eV2MeV;
00143
00144 string header_line_1, header_line_2, eof_line;
00145 string file_name;
00146 bool write_file;
00147 bool append;
00148
00149 ENDLClass();
00150 ~ENDLClass();
00151
00152
00153 void global( int eZA, double eAWR, double eTEMP, double eELIS, int yi, int Date );
00154
00155
00156 void reaction( int lr, double eQM, double eQI );
00157
00158
00159 int za_to_yo( int za );
00160
00161
00162 int yo_to_za( int yo );
00163
00164
00165 void set_yo( int yo );
00166
00167
00168
00169 int get_ZAP( int mt );
00170
00171
00172 void set_outgoing_ZA( int eZAP );
00173
00174
00175 int get_resid( );
00176
00177
00178 void set_s_number( );
00179
00180
00181 inline void set_s_number( int es )
00182 {
00183 S = es;
00184 }
00185
00186
00187 void set_QValue( );
00188
00189
00190 void set_c_number( );
00191
00192
00193 inline void set_c_number( int ec)
00194 {
00195 C = ec;
00196 }
00197
00198 inline void set_LR( int lr )
00199 {
00200 LR=lr;
00201 }
00202
00203
00204 void adjust_c_number_for_breakup();
00205
00206
00207 inline void set_x0( double x0)
00208 {
00209 X[0] = x0;
00210 }
00211
00212
00213 inline void set_x1( double x1)
00214 {
00215 X[1] = x1;
00216 }
00217
00218
00219 void set_I_number( int eI );
00220
00221
00222 bool new_file( );
00223
00224
00225 string data( double d );
00226
00227
00228 string data( double d1, double d2 );
00229
00230
00231 string data( double d1, double d2 , double d3 );
00232
00233
00234 string data( double d1, double d2 , double d3, double d4);
00235
00236
00237 int yo_mult( );
00238
00239
00240 int get_Z( int yi );
00241 };
00242
00243 #endif