G4CascadeParameters.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // G4CascadeParameters.cc
00027 // Encapsulate all user-configurable parameters with associated envvars
00028 //
00029 // 20120912  M. Kelsey -- Add interface to support UI commands
00030 
00031 #include "G4CascadeParameters.hh"
00032 #include "G4CascadeParamMessenger.hh"
00033 #include <stdlib.h>
00034 #include <iostream>
00035 using std::endl;
00036 
00037 
00038 // Singleton accessor
00039 
00040 const G4CascadeParameters* G4CascadeParameters::Instance() {
00041   static const G4CascadeParameters theInstance;
00042   return &theInstance;
00043 }
00044 
00045 
00046 // Constructor initializes everything once
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 // Report any non-default parameters (used by G4CascadeInterface)
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 }

Generated on Mon May 27 17:47:50 2013 for Geant4 by  doxygen 1.4.7