Geant4-11
source
processes
parameterisation
src
G4FastSimulationMessenger.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
//
27
//
28
29
#include "
G4FastSimulationMessenger.hh
"
30
#include "
G4UIdirectory.hh
"
31
#include "
G4UIcmdWithAString.hh
"
32
#include "
G4UIcmdWithoutParameter.hh
"
33
34
#include "
G4ios.hh
"
35
36
G4FastSimulationMessenger::
37
G4FastSimulationMessenger
(
G4GlobalFastSimulationManager
* theGFSM)
38
: fGlobalFastSimulationManager(theGFSM)
39
{
40
fFSDirectory
=
new
G4UIdirectory
(
"/param/"
);
41
fFSDirectory
->
SetGuidance
(
"Fast Simulation print/control commands."
);
42
43
fShowSetupCmd
=
44
new
G4UIcmdWithoutParameter
(
"/param/showSetup"
,
this
);
45
fShowSetupCmd
->
SetGuidance
(
"Show fast simulation setup:"
);
46
fShowSetupCmd
->
SetGuidance
(
" - for each world region:"
);
47
fShowSetupCmd
->
SetGuidance
(
" 1) fast simulation manager process attached;"
);
48
fShowSetupCmd
->
SetGuidance
(
" - and to which particles the process is attached to;"
);
49
fShowSetupCmd
->
SetGuidance
(
" 2) region hierarchy;"
);
50
fShowSetupCmd
->
SetGuidance
(
" - with for each the fast simulation models attached;"
);
51
fShowSetupCmd
->
AvailableForStates
(
G4State_Idle
,
G4State_GeomClosed
);
52
53
fListEnvelopesCmd
=
54
new
G4UIcmdWithAString
(
"/param/listEnvelopes"
,
this
);
55
fListEnvelopesCmd
->
SetParameterName
(
"ParticleName"
,
true
);
56
fListEnvelopesCmd
->
SetDefaultValue
(
"all"
);
57
fListEnvelopesCmd
->
SetGuidance
(
"List all the envelope names for a given Particle"
);
58
fListEnvelopesCmd
->
SetGuidance
(
"(or for all particles if without parameters)."
);
59
fListEnvelopesCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
60
61
fListModelsCmd
=
62
new
G4UIcmdWithAString
(
"/param/listModels"
,
this
);
63
fListModelsCmd
->
SetParameterName
(
"EnvelopeName"
,
true
);
64
fListModelsCmd
->
SetDefaultValue
(
"all"
);
65
fListModelsCmd
->
SetGuidance
(
"List all the Model names for a given Envelope"
);
66
fListModelsCmd
->
SetGuidance
(
"(or for all envelopes if without parameters)."
);
67
fListModelsCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
68
69
fListIsApplicableCmd
=
70
new
G4UIcmdWithAString
(
"/param/listIsApplicable"
,
this
);
71
fListIsApplicableCmd
->
SetParameterName
(
"ModelName"
,
true
);
72
fListIsApplicableCmd
->
SetDefaultValue
(
"all"
);
73
fListIsApplicableCmd
->
SetGuidance
(
"List all the Particle names a given Model is applicable"
);
74
fListIsApplicableCmd
->
SetGuidance
(
"(or for all Models if without parameters)."
);
75
76
fActivateModel
=
77
new
G4UIcmdWithAString
(
"/param/ActivateModel"
,
this
);
78
fActivateModel
->
SetParameterName
(
"ModelName"
,
false
);
79
fActivateModel
->
SetGuidance
(
"Activate a given Model."
);
80
81
fInActivateModel
=
82
new
G4UIcmdWithAString
(
"/param/InActivateModel"
,
this
);
83
fInActivateModel
->
SetParameterName
(
"ModelName"
,
false
);
84
fInActivateModel
->
SetGuidance
(
"InActivate a given Model."
);
85
}
86
87
G4FastSimulationMessenger::~G4FastSimulationMessenger
()
88
{
89
delete
fShowSetupCmd
;
90
fShowSetupCmd
= 0;
91
delete
fListIsApplicableCmd
;
92
fListIsApplicableCmd
= 0;
93
delete
fActivateModel
;
94
fActivateModel
= 0;
95
delete
fInActivateModel
;
96
fInActivateModel
= 0;
97
delete
fListModelsCmd
;
98
fListModelsCmd
= 0;
99
delete
fListEnvelopesCmd
;
100
fListEnvelopesCmd
= 0;
101
delete
fFSDirectory
;
102
fFSDirectory
= 0;
103
}
104
105
void
G4FastSimulationMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
106
{
107
if
(command ==
fShowSetupCmd
)
108
fGlobalFastSimulationManager
->
ShowSetup
();
109
if
( command ==
fListEnvelopesCmd
)
110
{
111
if
(newValue ==
"all"
)
112
fGlobalFastSimulationManager
->
ListEnvelopes
();
113
else
114
fGlobalFastSimulationManager
->
115
ListEnvelopes(
G4ParticleTable::GetParticleTable
()->
116
FindParticle(newValue));
117
}
118
if
( command ==
fListModelsCmd
)
119
fGlobalFastSimulationManager
->
ListEnvelopes
(newValue,
MODELS
);
120
if
( command ==
fListIsApplicableCmd
)
121
fGlobalFastSimulationManager
->
ListEnvelopes
(newValue,
ISAPPLICABLE
);
122
if
( command ==
fActivateModel
)
123
fGlobalFastSimulationManager
->
ActivateFastSimulationModel
(newValue);
124
if
( command ==
fInActivateModel
)
125
fGlobalFastSimulationManager
->
InActivateFastSimulationModel
(newValue);
126
}
G4State_Idle
@ G4State_Idle
Definition:
G4ApplicationState.hh:86
G4State_GeomClosed
@ G4State_GeomClosed
Definition:
G4ApplicationState.hh:87
G4State_PreInit
@ G4State_PreInit
Definition:
G4ApplicationState.hh:84
G4FastSimulationMessenger.hh
ISAPPLICABLE
@ ISAPPLICABLE
Definition:
G4GlobalFastSimulationManager.hh:62
MODELS
@ MODELS
Definition:
G4GlobalFastSimulationManager.hh:61
G4UIcmdWithAString.hh
G4UIcmdWithoutParameter.hh
G4UIdirectory.hh
G4ios.hh
G4FastSimulationMessenger::fInActivateModel
G4UIcmdWithAString * fInActivateModel
Definition:
G4FastSimulationMessenger.hh:71
G4FastSimulationMessenger::G4FastSimulationMessenger
G4FastSimulationMessenger(G4GlobalFastSimulationManager *theGFSM)
Definition:
G4FastSimulationMessenger.cc:37
G4FastSimulationMessenger::SetNewValue
void SetNewValue(G4UIcommand *command, G4String newValues)
Definition:
G4FastSimulationMessenger.cc:105
G4FastSimulationMessenger::fShowSetupCmd
G4UIcmdWithoutParameter * fShowSetupCmd
Definition:
G4FastSimulationMessenger.hh:66
G4FastSimulationMessenger::fListModelsCmd
G4UIcmdWithAString * fListModelsCmd
Definition:
G4FastSimulationMessenger.hh:68
G4FastSimulationMessenger::~G4FastSimulationMessenger
virtual ~G4FastSimulationMessenger()
Definition:
G4FastSimulationMessenger.cc:87
G4FastSimulationMessenger::fFSDirectory
G4UIdirectory * fFSDirectory
Definition:
G4FastSimulationMessenger.hh:65
G4FastSimulationMessenger::fGlobalFastSimulationManager
G4GlobalFastSimulationManager * fGlobalFastSimulationManager
Definition:
G4FastSimulationMessenger.hh:62
G4FastSimulationMessenger::fActivateModel
G4UIcmdWithAString * fActivateModel
Definition:
G4FastSimulationMessenger.hh:70
G4FastSimulationMessenger::fListEnvelopesCmd
G4UIcmdWithAString * fListEnvelopesCmd
Definition:
G4FastSimulationMessenger.hh:67
G4FastSimulationMessenger::fListIsApplicableCmd
G4UIcmdWithAString * fListIsApplicableCmd
Definition:
G4FastSimulationMessenger.hh:69
G4GlobalFastSimulationManager
Definition:
G4GlobalFastSimulationManager.hh:85
G4GlobalFastSimulationManager::ListEnvelopes
void ListEnvelopes(const G4String &aName="all", listType aListType=NAMES_ONLY)
Definition:
G4GlobalFastSimulationManager.cc:259
G4GlobalFastSimulationManager::ShowSetup
void ShowSetup()
Definition:
G4GlobalFastSimulationManager.cc:154
G4GlobalFastSimulationManager::InActivateFastSimulationModel
void InActivateFastSimulationModel(const G4String &)
Definition:
G4GlobalFastSimulationManager.cc:139
G4GlobalFastSimulationManager::ActivateFastSimulationModel
void ActivateFastSimulationModel(const G4String &)
Definition:
G4GlobalFastSimulationManager.cc:126
G4ParticleTable::GetParticleTable
static G4ParticleTable * GetParticleTable()
Definition:
G4ParticleTable.cc:87
G4String
Definition:
G4String.hh:62
G4UIcmdWithAString
Definition:
G4UIcmdWithAString.hh:43
G4UIcmdWithAString::SetParameterName
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Definition:
G4UIcmdWithAString.cc:44
G4UIcmdWithAString::SetDefaultValue
void SetDefaultValue(const char *defVal)
Definition:
G4UIcmdWithAString.cc:62
G4UIcmdWithoutParameter
Definition:
G4UIcmdWithoutParameter.hh:42
G4UIcommand
Definition:
G4UIcommand.hh:52
G4UIcommand::SetGuidance
void SetGuidance(const char *aGuidance)
Definition:
G4UIcommand.hh:156
G4UIcommand::AvailableForStates
void AvailableForStates(G4ApplicationState s1)
Definition:
G4UIcommand.cc:288
G4UIdirectory
Definition:
G4UIdirectory.hh:42
Generated by
1.9.3