Geant4_10
G4INCLXXInterfaceMessenger.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 // 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 
45 #include "G4SystemOfUnits.hh"
46 #include <sstream>
47 
48 const G4String G4INCLXXInterfaceMessenger::theUIDirectory = "/process/had/inclxx/";
49 
51  theINCLXXInterfaceStore(anInterfaceStore)
52 {
53  // Create a directory for the INCL++ commands
54  theINCLXXDirectory = new G4UIdirectory(theUIDirectory);
55  theINCLXXDirectory->SetGuidance("Parameters for the INCL++ model");
56 
57  // This command controls whether nucleus-nucleus reactions should accurately
58  // describe the projectile or the target nucleus (default: projectile)
59  accurateNucleusCmd = new G4UIcmdWithAString((theUIDirectory + "accurateNucleus").data(),this);
60  accurateNucleusCmd->SetGuidance("Set which nucleus will be accurately described in nucleus-nucleus reactions.");
61  accurateNucleusCmd->SetGuidance(" projectile: accurate description of projectile-related quantities");
62  accurateNucleusCmd->SetGuidance(" target: accurate description of target-related quantities");
63  accurateNucleusCmd->SetGuidance(" Default: projectile");
64  accurateNucleusCmd->SetParameterName("AccurateNucleus",true);
65  accurateNucleusCmd->SetDefaultValue("projectile");
66 
67  // This command selects the maximum mass number of clusters to be produced in
68  // the INCL++ cascade
69  maxClusterMassCmd = new G4UIcmdWithAnInteger((theUIDirectory + "maxClusterMass").data(),this);
70  maxClusterMassCmd->SetGuidance("Set the maximum cluster mass.");
71  maxClusterMassCmd->SetGuidance(" The INCL++ cascade stage will produce clusters with mass up to the value of this parameter (included)");
72  maxClusterMassCmd->SetGuidance(" Allowed range: [2,12]");
73  maxClusterMassCmd->SetParameterName("MaxClusterMass",true);
74  maxClusterMassCmd->SetDefaultValue(8);
75  maxClusterMassCmd->SetRange("MaxClusterMass>=2 && MaxClusterMass<=12");
76 
77  // This command sets the energy below which PreCoumpound will be used
78  cascadeMinEnergyPerNucleonCmd = new G4UIcmdWithADoubleAndUnit((theUIDirectory + "cascadeMinEnergyPerNucleon").data(),this);
79  cascadeMinEnergyPerNucleonCmd->SetGuidance("Set the minimum energy per nucleon at which cascade will be used.");
80  cascadeMinEnergyPerNucleonCmd->SetGuidance(" INCL++ will rely on PreCompound for reactions induced by projectiles slower than the given energy (per nucleon, where applicable)");
81  cascadeMinEnergyPerNucleonCmd->SetParameterName("cascadeMinEnergyPerNucleon",true);
82  cascadeMinEnergyPerNucleonCmd->SetDefaultValue(1.*MeV);
83  cascadeMinEnergyPerNucleonCmd->SetRange("cascadeMinEnergyPerNucleon>=0");
84  cascadeMinEnergyPerNucleonCmd->SetUnitCategory("Energy");
85 
86 }
87 
89  delete theINCLXXDirectory;
90  delete accurateNucleusCmd;
91  delete maxClusterMassCmd;
92  delete cascadeMinEnergyPerNucleonCmd;
93 }
94 
96  if(command==accurateNucleusCmd) {
97  newValues.toLower();
98  if(newValues=="projectile") {
99  theINCLXXInterfaceStore->SetAccurateProjectile(true);
100  } else if(newValues=="target") {
101  theINCLXXInterfaceStore->SetAccurateProjectile(false);
102  }
103  } else if(command==maxClusterMassCmd) {
104  const G4int parameter = maxClusterMassCmd->GetNewIntValue(newValues);
105  theINCLXXInterfaceStore->SetMaxClusterMass(parameter);
106  } else if(command==cascadeMinEnergyPerNucleonCmd) {
107  const G4double parameter = cascadeMinEnergyPerNucleonCmd->GetNewDoubleValue(newValues);
108  theINCLXXInterfaceStore->SetCascadeMinEnergyPerNucleon(parameter);
109  }
110 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
int G4int
Definition: G4Types.hh:78
void SetAccurateProjectile(const G4bool b)
Setter for accurateProjectile.
Singleton class for configuring the INCL++ Geant4 interface.
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetCascadeMinEnergyPerNucleon(const G4double anEnergy)
Setter for cascadeMinEnergyPerNucleon.
G4INCLXXInterfaceMessenger(G4INCLXXInterfaceStore *anInterfaceStore)
void toLower()
void SetDefaultValue(const char *defVal)
Messenger class for the Geant4 INCL++ interface.
void SetDefaultValue(G4int defVal)
double G4double
Definition: G4Types.hh:76
void SetMaxClusterMass(const G4int aMass)
Setter for theMaxClusterMass.
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
const XML_Char const XML_Char * data
Definition: expat.h:268
void SetNewValue(G4UIcommand *command, G4String newValues)