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 #include "G4CascadeParameters.hh"
00032 #include "G4CascadeParamMessenger.hh"
00033 #include <stdlib.h>
00034 #include <iostream>
00035 using std::endl;
00036
00037
00038
00039
00040 const G4CascadeParameters* G4CascadeParameters::Instance() {
00041 static const G4CascadeParameters theInstance;
00042 return &theInstance;
00043 }
00044
00045
00046
00047
00048 #define OLD_RADIUS_UNITS (3.3836/1.2) // Used with NucModel params
00049
00050 G4CascadeParameters::G4CascadeParameters()
00051 : G4CASCADE_VERBOSE(getenv("G4CASCADE_VERBOSE")),
00052 G4CASCADE_USE_PRECOMPOUND(getenv("G4CASCADE_USE_PRECOMPOUND")),
00053 G4CASCADE_DO_COALESCENCE(getenv("G4CASCADE_DO_COALESCENCE")),
00054 G4CASCADE_RANDOM_FILE(getenv("G4CASCADE_RANDOM_FILE")),
00055 G4NUCMODEL_USE_BEST(getenv("G4NUCMODEL_USE_BEST")),
00056 G4NUCMODEL_RAD_2PAR(getenv("G4NUCMODEL_RAD_2PAR")),
00057 G4NUCMODEL_RAD_SCALE(getenv("G4NUCMODEL_RAD_SCALE")),
00058 G4NUCMODEL_RAD_SMALL(getenv("G4NUCMODEL_RAD_SMALL")),
00059 G4NUCMODEL_RAD_ALPHA(getenv("G4NUCMODEL_RAD_ALPHA")),
00060 G4NUCMODEL_RAD_TRAILING(getenv("G4NUCMODEL_RAD_TRAILING")),
00061 G4NUCMODEL_FERMI_SCALE(getenv("G4NUCMODEL_FERMI_SCALE")),
00062 G4NUCMODEL_XSEC_SCALE(getenv("G4NUCMODEL_XSEC_SCALE")),
00063 G4NUCMODEL_GAMMAQD(getenv("G4NUCMODEL_GAMMAQD")),
00064 DPMAX_2CLUSTER(getenv("DPMAX_2CLUSTER")),
00065 DPMAX_3CLUSTER(getenv("DPMAX_3CLUSTER")),
00066 DPMAX_4CLUSTER(getenv("DPMAX_4CLUSTER")),
00067 messenger(0) {
00068 messenger = new G4CascadeParamMessenger(this);
00069 Initialize();
00070 }
00071
00072 void G4CascadeParameters::Initialize() {
00073 VERBOSE_LEVEL = (G4CASCADE_VERBOSE ? atoi(G4CASCADE_VERBOSE) : 0);
00074 USE_PRECOMPOUND = (0!=G4CASCADE_USE_PRECOMPOUND);
00075 DO_COALESCENCE = (0!=G4CASCADE_DO_COALESCENCE);
00076 RANDOM_FILE = (G4CASCADE_RANDOM_FILE ? G4CASCADE_RANDOM_FILE : "");
00077 BEST_PAR = (0!=G4NUCMODEL_USE_BEST);
00078 TWOPARAM_RADIUS = (0!=G4NUCMODEL_RAD_2PAR);
00079 RADIUS_SCALE = (G4NUCMODEL_RAD_SCALE ? strtod(G4NUCMODEL_RAD_SCALE,0)
00080 : (BEST_PAR?1.0:OLD_RADIUS_UNITS));
00081 RADIUS_SMALL = ((G4NUCMODEL_RAD_SMALL ? strtod(G4NUCMODEL_RAD_SMALL,0)
00082 : (BEST_PAR?1.992:(8.0/OLD_RADIUS_UNITS))) * RADIUS_SCALE);
00083 RADIUS_ALPHA = (G4NUCMODEL_RAD_ALPHA ? strtod(G4NUCMODEL_RAD_ALPHA,0)
00084 : (BEST_PAR?0.84:0.70));
00085 RADIUS_TRAILING = ((G4NUCMODEL_RAD_TRAILING ? strtod(G4NUCMODEL_RAD_TRAILING,0)
00086 : (BEST_PAR?0.70:0.0)) * RADIUS_SCALE);
00087 FERMI_SCALE = ((G4NUCMODEL_FERMI_SCALE ? strtod(G4NUCMODEL_FERMI_SCALE,0)
00088 : (BEST_PAR?0.685:(1.932/OLD_RADIUS_UNITS))) * RADIUS_SCALE);
00089 XSEC_SCALE = (G4NUCMODEL_XSEC_SCALE ? strtod(G4NUCMODEL_XSEC_SCALE,0)
00090 : (BEST_PAR?0.1:1.0) );
00091 GAMMAQD_SCALE = (G4NUCMODEL_GAMMAQD?strtod(G4NUCMODEL_GAMMAQD,0):1.);
00092 DPMAX_DOUBLET = (DPMAX_2CLUSTER ? strtod(DPMAX_2CLUSTER,0) : 0.090);
00093 DPMAX_TRIPLET = (DPMAX_3CLUSTER ? strtod(DPMAX_3CLUSTER,0) : 0.108);
00094 DPMAX_ALPHA = (DPMAX_4CLUSTER ? strtod(DPMAX_4CLUSTER,0) : 0.115);
00095 }
00096
00097 G4CascadeParameters::~G4CascadeParameters() {
00098 delete messenger;
00099 }
00100
00101
00102
00103
00104 void G4CascadeParameters::DumpConfig(std::ostream& os) const {
00105 if (G4CASCADE_VERBOSE)
00106 os << "G4CASCADE_VERBOSE = " << G4CASCADE_VERBOSE << endl;
00107 if (G4CASCADE_USE_PRECOMPOUND)
00108 os << "G4CASCADE_USE_PRECOMPOUND = " << G4CASCADE_USE_PRECOMPOUND << endl;
00109 if (G4CASCADE_DO_COALESCENCE)
00110 os << "G4CASCADE_DO_COALESCENCE = " << G4CASCADE_DO_COALESCENCE << endl;
00111 if (G4CASCADE_RANDOM_FILE)
00112 os << "G4CASCADE_RANDOM_FILE = " << G4CASCADE_RANDOM_FILE << endl;
00113 if (G4NUCMODEL_USE_BEST)
00114 os << "G4NUCMODEL_USE_BEST = " << G4NUCMODEL_USE_BEST << endl;
00115 if (G4NUCMODEL_RAD_2PAR)
00116 os << "G4NUCMODEL_RAD_2PAR = " << G4NUCMODEL_RAD_2PAR << endl;
00117 if (G4NUCMODEL_RAD_SCALE)
00118 os << "G4NUCMODEL_RAD_SCALE = " << G4NUCMODEL_RAD_SCALE << endl;
00119 if (G4NUCMODEL_RAD_SMALL)
00120 os << "G4NUCMODEL_RAD_SMALL = " << G4NUCMODEL_RAD_SMALL << endl;
00121 if (G4NUCMODEL_RAD_ALPHA)
00122 os << "G4NUCMODEL_RAD_ALPHA = " << G4NUCMODEL_RAD_ALPHA << endl;
00123 if (G4NUCMODEL_RAD_TRAILING)
00124 os << "G4NUCMODEL_RAD_TRAILING = " << G4NUCMODEL_RAD_TRAILING << endl;
00125 if (G4NUCMODEL_FERMI_SCALE)
00126 os << "G4NUCMODEL_FERMI_SCALE = " << G4NUCMODEL_FERMI_SCALE << endl;
00127 if (G4NUCMODEL_XSEC_SCALE)
00128 os << "G4NUCMODEL_XSEC_SCALE = " << G4NUCMODEL_XSEC_SCALE << endl;
00129 if (G4NUCMODEL_GAMMAQD)
00130 os << "G4NUCMODEL_GAMMAQD = " << G4NUCMODEL_GAMMAQD << endl;
00131 if (DPMAX_2CLUSTER)
00132 os << "DPMAX_2CLUSTER = " << DPMAX_2CLUSTER << endl;
00133 if (DPMAX_3CLUSTER)
00134 os << "DPMAX_3CLUSTER = " << DPMAX_3CLUSTER << endl;
00135 if (DPMAX_4CLUSTER)
00136 os << "DPMAX_4CLUSTER = " << DPMAX_4CLUSTER << endl;
00137 }