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