Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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
30#include "G4UIdirectory.hh"
31#include "G4UIcmdWithAString.hh"
33
34#include "G4ios.hh"
35
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;");
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).");
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).");
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
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
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_GeomClosed
@ G4State_PreInit
G4FastSimulationMessenger(G4GlobalFastSimulationManager *theGFSM)
void SetNewValue(G4UIcommand *command, G4String newValues)
void ListEnvelopes(const G4String &aName="all", listType aListType=NAMES_ONLY)
void InActivateFastSimulationModel(const G4String &)
static G4ParticleTable * GetParticleTable()
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:157
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:287