Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:51:37

0001 #include <cstdio>
0002 
0003 #ifndef IAEA_RECORD
0004 #define IAEA_RECORD
0005 
0006 #include "utilities.h"
0007 #include "iaea_config.h"
0008 
0009 /* *********************************************************************** */
0010 // defines
0011 
0012 // To use additional float or integers
0013 
0014 #ifndef NUM_EXTRA_FLOAT
0015   #define NUM_EXTRA_FLOAT 10 // Maximum 10 extra float stored
0016 #endif
0017 
0018 #ifndef NUM_EXTRA_LONG
0019   #define NUM_EXTRA_LONG  10 // Maximum 10 extra long stored
0020 #endif
0021 
0022 #define MAX_NUM_PARTICLES 5 // 1 photons 
0023                             // 2 electrons
0024                             // 3 positrons
0025                             // 4 neutrons
0026                             // 5 protons
0027 #define MAX_NUM_SOURCES 30
0028 
0029 #define OK     0
0030 #define FAIL  -1
0031 
0032 /* *********************************************************************** */
0033 // structures
0034 
0035 struct iaea_record_type
0036 {
0037   FILE *p_file;   // phase space file pointer   
0038 
0039   short particle; // mandatory       (photon:1 electron:2 positron:3 neutron:4 proton:5 ...)
0040   
0041   float  energy;  // mandatory
0042   
0043   IAEA_I32 IsNewHistory; // coded as sign of energy 
0044                          //  Type changed from short to IAEA_I32 to store EGS n_stat
0045 
0046   float x;       int ix;       
0047   float y;       int iy;
0048   float z;       int iz;
0049   float u;       int iu;
0050   float v;       int iv;
0051   float w;       int iw;      // sign of w coded as sign of code
0052   float weight;  int iweight;
0053 
0054   short iextrafloat; 
0055   short iextralong;  
0056 
0057   float extrafloat[NUM_EXTRA_FLOAT];  // (default: no extra float stored)
0058   IAEA_I32 extralong[NUM_EXTRA_LONG];      // (default: one extra long stored)
0059 
0060 public:
0061       short read_particle();
0062       short write_particle();
0063       short initialize();
0064 };
0065 
0066 #endif