Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4INCLConfig.hh
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 // INCL++ intra-nuclear cascade model
27 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
28 // Davide Mancusi, CEA
29 // Alain Boudard, CEA
30 // Sylvie Leray, CEA
31 // Joseph Cugnon, University of Liege
32 //
33 #define INCLXX_IN_GEANT4_MODE 1
34 
35 #include "globals.hh"
36 
37 #ifndef G4INCLConfig_hh
38 #define G4INCLConfig_hh 1
39 
40 #include "G4INCLParticleSpecies.hh"
41 #include "G4INCLConfigEnums.hh"
43 #include <iostream>
44 #include <string>
45 #include <sstream>
46 // #include <cassert>
47 
48 #if defined(HAS_BOOST_PROGRAM_OPTIONS) && !defined(INCLXX_IN_GEANT4_MODE)
49 #include <boost/program_options/options_description.hpp>
50 #include <boost/program_options/parsers.hpp>
51 #include <boost/program_options/variables_map.hpp>
52 #include <fstream>
53 #include <cstdlib>
54 
55 namespace po = boost::program_options;
56 #endif
57 
58 namespace G4INCL {
59 
60  /**
61  * The INCL configuration object
62  *
63  * The Config object keeps track of various INCL physics options
64  * (e.g. which Pauli blocking scheme to use, whether to use local
65  * energy option or not, etc.
66  */
67  class Config {
68  public:
69  /// \brief Default constructor
70  Config();
71 
72  /**
73  * Constructor for INCL++ with specified target A, Z, projectile
74  * type and energy. All other options are the default ones.
75  */
77 
78  /** \brief Constructor based on command-line and config-file options.
79  *
80  * \param argc command-line parameters
81  * \param argv command-line parameters
82  * \param isFullRun is this a real calculation: true = yes; false = no, it's just a unit test
83  */
84  Config(G4int argc, char *argv[], G4bool isFullRun);
85 
86  /// \brief Default destructor
87  ~Config();
88 
89  /// \brief Initialise the members
90  void init();
91 
92  /// \brief Return a summary of the run configuration.
93  std::string summary();
94 
95  /// \brief Get the verbosity.
96  G4int getVerbosity() const { return verbosity; }
97 
98  /// \brief Get the run title.
99  std::string const &getCalculationTitle() const { return title; }
100 
101  /// \brief Get the output file root.
102  std::string const &getOutputFileRoot() const { return outputFileRoot; }
103 
104  /// \brief Get the number of shots.
105  G4int getNumberOfShots() const { return nShots; }
106 
107  /// \brief Natural targets.
108  G4bool isNaturalTarget() const { return naturalTarget; }
109 
110  /** \brief Get the target mass number.
111  *
112  * Note that A==0 means natural target. You should first check the
113  * isNaturalTarget() method.
114  */
115  G4int getTargetA() const { return targetSpecies.theA; }
116 
117  /// \brief Get the target charge number.
118  G4int getTargetZ() const { return targetSpecies.theZ; }
119 
120  /// \brief Set target mass number
121  void setTargetA(G4int A) { targetSpecies.theA = A; }
122 
123  /// \brief Set target charge number
124  void setTargetZ(G4int Z) { targetSpecies.theZ = Z; }
125 
126  /// \brief Get the projectile type
127  ParticleType getProjectileType() const { return projectileSpecies.theType; }
128 
129  /// \brief Get the projectile species
130  ParticleSpecies getProjectileSpecies() const { return projectileSpecies; }
131 
132  /// \brief Set the projectile species
133  void setProjectileSpecies(ParticleSpecies const &ps) { projectileSpecies=ps; }
134 
135  /// \brief Get the projectile kinetic energy.
136  G4double getProjectileKineticEnergy() const { return projectileKineticEnergy; }
137 
138  /// \brief Set the projectile kinetic energy.
139  void setProjectileKineticEnergy(G4double const kinE) { projectileKineticEnergy=kinE; }
140 
141  /// \brief Get the number of the verbose event.
142  G4int getVerboseEvent() const { return verboseEvent; }
143 
144  /// \brief Get the INCL version ID.
145  static std::string const getVersionID();
146 
147  /// \brief Get the INCL version hash.
148  static std::string const getVersionHash();
149 
150  /// \brief Get the INCL version string.
151  static std::string const getVersionString() {
152  std::stringstream ss;
153  ss << getVersionID() << "-" << getVersionHash();
154  return ss.str();
155  }
156 
157  /// \brief Get the seeds for the random-number generator.
160  s.push_back(randomSeed1);
161  s.push_back(randomSeed2);
162  return s;
163  }
164 
165  /// \brief Get the Pauli-blocking algorithm.
166  PauliType getPauliType() const { return pauliType; }
167 
168  /// \brief Do we want CDPP?
169  G4bool getCDPP() const { return CDPP; }
170 
171  /// \brief Do we want the pion potential?
172  G4bool getPionPotential() const { return pionPotential; }
173 
174  /// \brief Get the Coulomb-distortion algorithm.
175  CoulombType getCoulombType() const { return coulombType; }
176 
177  /// \brief Get the type of the potential for nucleons.
178  PotentialType getPotentialType() const { return potentialType; }
179 
180  /// \brief Set the type of the potential for nucleons.
181  void setPotentialType(PotentialType type) { potentialType = type; }
182 
183  /// \brief Set the type of the potential for nucleons.
184  void setPionPotential(const G4bool pionPot) { pionPotential = pionPot; }
185 
186  /// \brief Get the type of local energy for N-N avatars.
187  LocalEnergyType getLocalEnergyBBType() const { return localEnergyBBType; }
188 
189  /// \brief Get the type of local energy for pi-N and decay avatars.
190  LocalEnergyType getLocalEnergyPiType() const { return localEnergyPiType; }
191 
192  /// \brief Set the type of local energy for N-N avatars.
193  void setLocalEnergyBBType(const LocalEnergyType t) { localEnergyBBType=t; }
194 
195  /// \brief Set the type of local energy for N-N avatars.
196  void setLocalEnergyPiType(const LocalEnergyType t) { localEnergyPiType=t; }
197 
198  /// \brief Get the log file name.
199  std::string const &getLogFileName() const { return logFileName; }
200 
201  /// \brief Get the de-excitation model.
202  DeExcitationType getDeExcitationType() const { return deExcitationType; }
203 
204  /// \brief Get the de-excitation string.
205  std::string getDeExcitationString() const { return deExcitationString; }
206 
207  /// \brief Get the clustering algorithm.
208  ClusterAlgorithmType getClusterAlgorithm() const { return clusterAlgorithmType; }
209 
210  /// \brief Get the maximum mass for production of clusters.
211  G4int getClusterMaxMass() const { return clusterMaxMass; }
212 
213  /// \brief Set the maximum mass for production of clusters.
214  void setClusterMaxMass(const G4int m){ clusterMaxMass=m; }
215 
216  /// \brief Get back-to-spectator
217  G4bool getBackToSpectator() const { return backToSpectator; }
218 
219  /// \brief Whether to use real masses
220  G4bool getUseRealMasses() const { return useRealMasses; }
221 
222  /// \brief Set whether to use real masses
223  void setUseRealMasses(G4bool use) { useRealMasses = use; }
224 
225  std::string const &getINCLXXDataFilePath() const {
226  return INCLXXDataFilePath;
227  }
228 
229 #ifdef INCL_DEEXCITATION_ABLAXX
230  std::string const &getABLAv3pCxxDataFilePath() const {
231  return ablav3pCxxDataFilePath;
232  }
233 #endif
234 
235 #ifdef INCL_DEEXCITATION_ABLA07
236  std::string const &getABLA07DataFilePath() const {
237  return abla07DataFilePath;
238  }
239 #endif
240 #ifdef INCL_DEEXCITATION_GEMINIXX
241  std::string const &getGEMINIXXDataFilePath() const {
242  return geminixxDataFilePath;
243  }
244 #endif
245 
246  G4double getImpactParameter() const { return impactParameter; }
247 
248  /// \brief Get the separation-energy type
249  SeparationEnergyType getSeparationEnergyType() const { return separationEnergyType; }
250 
251  /// \brief Get the Fermi-momentum type
252  FermiMomentumType getFermiMomentumType() const { return fermiMomentumType; }
253 
254  /// \brief Set the Fermi-momentum type
255  void setFermiMomentumType(FermiMomentumType const f) { fermiMomentumType=f; }
256 
257  G4double getCutNN() const { return cutNN; }
258 
259 #ifdef INCL_ROOT_USE
260  std::string const &getROOTSelectionString() const {
261  return rootSelectionString;
262  }
263 #endif
264 
265 #ifdef INCL_DEEXCITATION_FERMI_BREAKUP
266  G4int getMaxMassFermiBreakUp() const {
267  return maxMassFermiBreakUp;
268  }
269 #endif
270 
271  /// \brief Get the r-p correlation coefficient
273 // assert(t==Proton || t==Neutron);
274  return ((t==Proton) ? rpCorrelationCoefficientProton : rpCorrelationCoefficientNeutron);
275  }
276 
277  /// \brief Set the r-p correlation coefficient
278  void setRPCorrelationCoefficient(const ParticleType t, const G4double corrCoeff) {
279 // assert(t==Proton || t==Neutron);
280  if(t==Proton)
281  rpCorrelationCoefficientProton=corrCoeff;
282  else
283  rpCorrelationCoefficientNeutron=corrCoeff;
284  }
285 
286  /// \brief Set the r-p correlation coefficient
287  void setRPCorrelationCoefficient(const G4double corrCoeff) {
290  }
291 
292  /// \brief Get the neutron-skin thickness
293  G4double getNeutronSkinThickness() const { return neutronSkinThickness; }
294 
295  /// \brief Set the neutron-skin thickness
296  void setNeutronSkinThickness(const G4double d) { neutronSkinThickness=d; }
297 
298  /// \brief Get the neutron-skin additional diffuseness
299  G4double getNeutronSkinAdditionalDiffuseness() const { return neutronSkinAdditionalDiffuseness; }
300 
301  /// \brief Set the neutron-skin additional diffuseness
302  void setNeutronSkinAdditionalDiffuseness(const G4double d) { neutronSkinAdditionalDiffuseness=d; }
303 
304  /// \brief True if we should use refraction
305  G4bool getRefraction() const { return refraction; }
306 
307  /// \brief Set the refraction variable
308  void setRefraction(const G4bool r) { refraction = r; }
309 
310 #if defined(HAS_BOOST_PROGRAM_OPTIONS) && !defined(INCLXX_IN_GEANT4_MODE)
311  /// \brief Echo the input options.
312  std::string const echo() const;
313 #endif
314 
315  private:
316 
317 #if defined(HAS_BOOST_PROGRAM_OPTIONS) && !defined(INCLXX_IN_GEANT4_MODE)
318  std::string echoOptionsDescription(const po::options_description &aDesc) const;
319 
320  po::options_description runOptDesc;
321  po::options_description hiddenOptDesc;
322  po::options_description genericOptDesc;
323  po::options_description physicsOptDesc;
324  po::variables_map variablesMap;
325 #endif
326 
327  G4int verbosity;
328  std::string inputFileName;
329  std::string title;
330  std::string outputFileRoot;
331  std::string fileSuffix;
332  std::string logFileName;
333 
334  G4int nShots;
335 
336  std::string targetString;
337  ParticleSpecies targetSpecies;
338  G4bool naturalTarget;
339 
340  std::string projectileString;
341  ParticleSpecies projectileSpecies;
342  G4double projectileKineticEnergy;
343 
344  G4int verboseEvent;
345 
346  G4int randomSeed1, randomSeed2;
347  static const G4int randomSeedMin, randomSeedMax;
348 
349  std::string pauliString;
350  PauliType pauliType;
351  G4bool CDPP;
352 
353  std::string coulombString;
354  CoulombType coulombType;
355 
356  std::string potentialString;
357  PotentialType potentialType;
358  G4bool pionPotential;
359 
360  std::string localEnergyBBString;
361  LocalEnergyType localEnergyBBType;
362 
363  std::string localEnergyPiString;
364  LocalEnergyType localEnergyPiType;
365 
366  std::string deExcitationModelList;
367  std::string deExcitationOptionDescription;
368  std::string deExcitationString;
369  DeExcitationType deExcitationType;
370 #ifdef INCL_DEEXCITATION_ABLAXX
371  std::string ablav3pCxxDataFilePath;
372 #endif
373 #ifdef INCL_DEEXCITATION_ABLA07
374  std::string abla07DataFilePath;
375 #endif
376 #ifdef INCL_DEEXCITATION_GEMINIXX
377  std::string geminixxDataFilePath;
378 #endif
379  std::string INCLXXDataFilePath;
380 
381  std::string clusterAlgorithmString;
382  ClusterAlgorithmType clusterAlgorithmType;
383 
384  G4int clusterMaxMass;
385 
386  G4bool backToSpectator;
387 
388  G4bool useRealMasses;
389 
390  G4double impactParameter;
391 
392  std::string separationEnergyString;
393  SeparationEnergyType separationEnergyType;
394 
395  std::string fermiMomentumString;
396  FermiMomentumType fermiMomentumType;
397 
398  G4double cutNN;
399 
400 #ifdef INCL_ROOT_USE
401  std::string rootSelectionString;
402 #endif
403 
404 #ifdef INCL_DEEXCITATION_FERMI_BREAKUP
405  G4int maxMassFermiBreakUp;
406 #endif
407 
408  G4double rpCorrelationCoefficient;
409  G4double rpCorrelationCoefficientProton;
410  G4double rpCorrelationCoefficientNeutron;
411 
412  G4double neutronSkinThickness;
413  G4double neutronSkinAdditionalDiffuseness;
414 
415  G4bool refraction;
416  };
417 
418 }
419 
420 #endif
DeExcitationType getDeExcitationType() const
Get the de-excitation model.
ParticleType getProjectileType() const
Get the projectile type.
void setFermiMomentumType(FermiMomentumType const f)
Set the Fermi-momentum type.
void setProjectileSpecies(ParticleSpecies const &ps)
Set the projectile species.
void setRPCorrelationCoefficient(const G4double corrCoeff)
Set the r-p correlation coefficient.
G4int getTargetZ() const
Get the target charge number.
G4int getNumberOfShots() const
Get the number of shots.
std::string const & getINCLXXDataFilePath() const
G4int getVerboseEvent() const
Get the number of the verbose event.
void setProjectileKineticEnergy(G4double const kinE)
Set the projectile kinetic energy.
const XML_Char * s
G4int getClusterMaxMass() const
Get the maximum mass for production of clusters.
~Config()
Default destructor.
void setRPCorrelationCoefficient(const ParticleType t, const G4double corrCoeff)
Set the r-p correlation coefficient.
G4double getNeutronSkinAdditionalDiffuseness() const
Get the neutron-skin additional diffuseness.
G4bool isNaturalTarget() const
Natural targets.
int G4int
Definition: G4Types.hh:78
SeparationEnergyType getSeparationEnergyType() const
Get the separation-energy type.
void setLocalEnergyBBType(const LocalEnergyType t)
Set the type of local energy for N-N avatars.
G4int getVerbosity() const
Get the verbosity.
Definition: G4INCLConfig.hh:96
G4double getImpactParameter() const
G4bool getCDPP() const
Do we want CDPP?
static std::string const getVersionString()
Get the INCL version string.
void setNeutronSkinAdditionalDiffuseness(const G4double d)
Set the neutron-skin additional diffuseness.
void setTargetA(G4int A)
Set target mass number.
G4bool getBackToSpectator() const
Get back-to-spectator.
PauliType getPauliType() const
Get the Pauli-blocking algorithm.
void setRefraction(const G4bool r)
Set the refraction variable.
bool G4bool
Definition: G4Types.hh:79
G4int getTargetA() const
Get the target mass number.
void setLocalEnergyPiType(const LocalEnergyType t)
Set the type of local energy for N-N avatars.
G4bool getPionPotential() const
Do we want the pion potential?
G4bool getUseRealMasses() const
Whether to use real masses.
Config()
Default constructor.
Definition: G4INCLConfig.cc:48
Random::SeedVector getRandomSeeds() const
Get the seeds for the random-number generator.
ClusterAlgorithmType getClusterAlgorithm() const
Get the clustering algorithm.
FermiMomentumType getFermiMomentumType() const
Get the Fermi-momentum type.
std::string const & getLogFileName() const
Get the log file name.
PotentialType getPotentialType() const
Get the type of the potential for nucleons.
std::string getDeExcitationString() const
Get the de-excitation string.
static std::string const getVersionID()
Get the INCL version ID.
ParticleSpecies getProjectileSpecies() const
Get the projectile species.
void init()
Initialise the members.
void setPotentialType(PotentialType type)
Set the type of the potential for nucleons.
LocalEnergyType getLocalEnergyPiType() const
Get the type of local energy for pi-N and decay avatars.
LocalEnergyType getLocalEnergyBBType() const
Get the type of local energy for N-N avatars.
void setNeutronSkinThickness(const G4double d)
Set the neutron-skin thickness.
CoulombType getCoulombType() const
Get the Coulomb-distortion algorithm.
G4double getNeutronSkinThickness() const
Get the neutron-skin thickness.
std::string const & getOutputFileRoot() const
Get the output file root.
std::string const & getCalculationTitle() const
Get the run title.
Definition: G4INCLConfig.hh:99
std::string summary()
Return a summary of the run configuration.
void setClusterMaxMass(const G4int m)
Set the maximum mass for production of clusters.
void setPionPotential(const G4bool pionPot)
Set the type of the potential for nucleons.
void setUseRealMasses(G4bool use)
Set whether to use real masses.
double G4double
Definition: G4Types.hh:76
G4double getProjectileKineticEnergy() const
Get the projectile kinetic energy.
G4double getRPCorrelationCoefficient(const ParticleType t) const
Get the r-p correlation coefficient.
G4double getCutNN() const
static std::string const getVersionHash()
Get the INCL version hash.
G4bool getRefraction() const
True if we should use refraction.
void setTargetZ(G4int Z)
Set target charge number.