Geant4  10.00.p02
G4CascadeParameters.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4CascadeParameters.cc 72016 2013-07-03 16:24:15Z mkelsey $
27 // Encapsulate all user-configurable parameters with associated envvars
28 //
29 // 20120912 M. Kelsey -- Add interface to support UI commands
30 // 20130304 M. Kelsey -- Add flag to collect and display cascade structure
31 // 20130308 M. Kelsey -- Add flag to use separate 3-body momentum generators
32 // 20130421 M. Kelsey -- Add flag for CHECK_ECONS, replacing #ifdef's
33 // 20130702 M. Kelsey -- Add flag to use N-body phase-space generator
34 // 20140101 M. Kelsey -- Fix bug #1557: Static instance must be pointer
35 // *** Drop use of Messenger until thread safety is addressed
36 
37 #include "G4CascadeParameters.hh"
39 #include <stdlib.h>
40 #include <iostream>
41 using std::endl;
42 
43 
44 // Singleton accessor
45 
46 namespace {
47  static const G4CascadeParameters* theInstance = 0;
48 }
49 
51  if (0 == theInstance) theInstance = new G4CascadeParameters;
52  return theInstance;
53 }
54 
55 
56 // Constructor initializes everything once
57 
58 #define OLD_RADIUS_UNITS (3.3836/1.2) // Used with NucModel params
59 
61  : G4CASCADE_VERBOSE(getenv("G4CASCADE_VERBOSE")),
62  G4CASCADE_CHECK_ECONS(getenv("G4CASCADE_CHECK_ECONS")),
63  G4CASCADE_USE_PRECOMPOUND(getenv("G4CASCADE_USE_PRECOMPOUND")),
64  G4CASCADE_DO_COALESCENCE(getenv("G4CASCADE_DO_COALESCENCE")),
65  G4CASCADE_SHOW_HISTORY(getenv("G4CASCADE_SHOW_HISTORY")),
66  G4CASCADE_USE_3BODYMOM(getenv("G4CASCADE_USE_3BODYMOM")),
67  G4CASCADE_USE_PHASESPACE(getenv("G4CASCADE_USE_PHASESPACE")),
68  G4CASCADE_RANDOM_FILE(getenv("G4CASCADE_RANDOM_FILE")),
69  G4NUCMODEL_USE_BEST(getenv("G4NUCMODEL_USE_BEST")),
70  G4NUCMODEL_RAD_2PAR(getenv("G4NUCMODEL_RAD_2PAR")),
71  G4NUCMODEL_RAD_SCALE(getenv("G4NUCMODEL_RAD_SCALE")),
72  G4NUCMODEL_RAD_SMALL(getenv("G4NUCMODEL_RAD_SMALL")),
73  G4NUCMODEL_RAD_ALPHA(getenv("G4NUCMODEL_RAD_ALPHA")),
74  G4NUCMODEL_RAD_TRAILING(getenv("G4NUCMODEL_RAD_TRAILING")),
75  G4NUCMODEL_FERMI_SCALE(getenv("G4NUCMODEL_FERMI_SCALE")),
76  G4NUCMODEL_XSEC_SCALE(getenv("G4NUCMODEL_XSEC_SCALE")),
77  G4NUCMODEL_GAMMAQD(getenv("G4NUCMODEL_GAMMAQD")),
78  DPMAX_2CLUSTER(getenv("DPMAX_2CLUSTER")),
79  DPMAX_3CLUSTER(getenv("DPMAX_3CLUSTER")),
80  DPMAX_4CLUSTER(getenv("DPMAX_4CLUSTER")),
81  messenger(0) {
82  /*** FIXME: Messenger should not be accessing non-const shared pointer
83  messenger = new G4CascadeParamMessenger(this);
84  ***/
85 
86  Initialize();
87 }
88 
101  : (BEST_PAR?1.0:OLD_RADIUS_UNITS));
103  : (BEST_PAR?1.992:(8.0/OLD_RADIUS_UNITS))) * RADIUS_SCALE);
105  : (BEST_PAR?0.84:0.70));
107  : (BEST_PAR?0.70:0.0)) * RADIUS_SCALE);
109  : (BEST_PAR?0.685:(1.932/OLD_RADIUS_UNITS))) * RADIUS_SCALE);
111  : (BEST_PAR?0.1:1.0) );
113  DPMAX_DOUBLET = (DPMAX_2CLUSTER ? strtod(DPMAX_2CLUSTER,0) : 0.090);
114  DPMAX_TRIPLET = (DPMAX_3CLUSTER ? strtod(DPMAX_3CLUSTER,0) : 0.108);
115  DPMAX_ALPHA = (DPMAX_4CLUSTER ? strtod(DPMAX_4CLUSTER,0) : 0.115);
116 }
117 
119  delete messenger;
120 }
121 
122 
123 // Report any non-default parameters (used by G4CascadeInterface)
124 
125 void G4CascadeParameters::DumpConfig(std::ostream& os) const {
126  if (G4CASCADE_VERBOSE)
127  os << "G4CASCADE_VERBOSE = " << G4CASCADE_VERBOSE << endl;
129  os << "G4CASCADE_CHECK_ECONS = " << G4CASCADE_CHECK_ECONS << endl;
131  os << "G4CASCADE_USE_PRECOMPOUND = " << G4CASCADE_USE_PRECOMPOUND << endl;
133  os << "G4CASCADE_DO_COALESCENCE = " << G4CASCADE_DO_COALESCENCE << endl;
135  os << "G4CASCADE_SHOW_HISTORY = " << G4CASCADE_SHOW_HISTORY << endl;
137  os << "G4CASCADE_USE_3BODYMOM = " << G4CASCADE_USE_3BODYMOM << endl;
139  os << "G4CASCADE_USE_PHASESPACE = " << G4CASCADE_USE_PHASESPACE << endl;
141  os << "G4CASCADE_RANDOM_FILE = " << G4CASCADE_RANDOM_FILE << endl;
143  os << "G4NUCMODEL_USE_BEST = " << G4NUCMODEL_USE_BEST << endl;
145  os << "G4NUCMODEL_RAD_2PAR = " << G4NUCMODEL_RAD_2PAR << endl;
147  os << "G4NUCMODEL_RAD_SCALE = " << G4NUCMODEL_RAD_SCALE << endl;
149  os << "G4NUCMODEL_RAD_SMALL = " << G4NUCMODEL_RAD_SMALL << endl;
151  os << "G4NUCMODEL_RAD_ALPHA = " << G4NUCMODEL_RAD_ALPHA << endl;
153  os << "G4NUCMODEL_RAD_TRAILING = " << G4NUCMODEL_RAD_TRAILING << endl;
155  os << "G4NUCMODEL_FERMI_SCALE = " << G4NUCMODEL_FERMI_SCALE << endl;
157  os << "G4NUCMODEL_XSEC_SCALE = " << G4NUCMODEL_XSEC_SCALE << endl;
158  if (G4NUCMODEL_GAMMAQD)
159  os << "G4NUCMODEL_GAMMAQD = " << G4NUCMODEL_GAMMAQD << endl;
160  if (DPMAX_2CLUSTER)
161  os << "DPMAX_2CLUSTER = " << DPMAX_2CLUSTER << endl;
162  if (DPMAX_3CLUSTER)
163  os << "DPMAX_3CLUSTER = " << DPMAX_3CLUSTER << endl;
164  if (DPMAX_4CLUSTER)
165  os << "DPMAX_4CLUSTER = " << DPMAX_4CLUSTER << endl;
166 }
const char * G4NUCMODEL_USE_BEST
void DumpConfig(std::ostream &os) const
const char * G4NUCMODEL_RAD_SMALL
const char * G4CASCADE_VERBOSE
#define OLD_RADIUS_UNITS
const char * G4CASCADE_SHOW_HISTORY
const char * G4NUCMODEL_XSEC_SCALE
const char * G4CASCADE_DO_COALESCENCE
const char * G4NUCMODEL_RAD_TRAILING
const char * G4NUCMODEL_RAD_2PAR
const char * G4NUCMODEL_RAD_SCALE
const char * G4NUCMODEL_FERMI_SCALE
const char * G4CASCADE_CHECK_ECONS
static const G4CascadeParameters * Instance()
const char * G4CASCADE_USE_3BODYMOM
const char * G4CASCADE_USE_PRECOMPOUND
const char * G4CASCADE_USE_PHASESPACE
const char * G4CASCADE_RANDOM_FILE
G4CascadeParamMessenger * messenger
const char * G4NUCMODEL_GAMMAQD
const char * G4NUCMODEL_RAD_ALPHA