Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WLSPhysicsListMessenger Class Reference

Provide control of the physics list and cut parameters. More...

#include <WLSPhysicsListMessenger.hh>

Inheritance diagram for WLSPhysicsListMessenger:
Collaboration diagram for WLSPhysicsListMessenger:

Public Member Functions

 WLSPhysicsListMessenger (WLSPhysicsList *)
 
virtual ~WLSPhysicsListMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Provide control of the physics list and cut parameters.

Definition at line 58 of file WLSPhysicsListMessenger.hh.

Constructor & Destructor Documentation

WLSPhysicsListMessenger::WLSPhysicsListMessenger ( WLSPhysicsList pPhys)

Definition at line 49 of file WLSPhysicsListMessenger.cc.

50  : fPhysicsList(pPhys)
51 {
52 
53  fDirectory = new G4UIdirectory("/WLS/phys/");
54  fDirectory->SetGuidance("WLSPhysicsList control");
55 
56  fSetAbsorptionCMD = new G4UIcmdWithABool("/WLS/setAbsorption", this);
57  fSetAbsorptionCMD->SetGuidance("Turn on or off absorption process");
58  fSetAbsorptionCMD->AvailableForStates(G4State_Idle);
59 
60  fVerboseCmd = new G4UIcmdWithAnInteger("/WLS/phys/verbose",this);
61  fVerboseCmd->SetGuidance("set verbose for physics processes");
62  fVerboseCmd->SetParameterName("verbose",true);
63  fVerboseCmd->SetDefaultValue(1);
64  fVerboseCmd->SetRange("verbose>=0");
65  fVerboseCmd->AvailableForStates(G4State_Idle);
66 
67  fCerenkovCmd =
68  new G4UIcmdWithAnInteger("/WLS/phys/cerenkovMaxPhotons",this);
69  fCerenkovCmd->SetGuidance("set max nb of photons per step");
70  fCerenkovCmd->SetParameterName("MaxNumber",false);
71  fCerenkovCmd->SetRange("MaxNumber>=0");
72  fCerenkovCmd->AvailableForStates(G4State_Idle);
73 
74  fGammaCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/gammaCut",this);
75  fGammaCutCMD->SetGuidance("Set gamma cut");
76  fGammaCutCMD->SetParameterName("Gcut",false);
77  fGammaCutCMD->SetUnitCategory("Length");
78  fGammaCutCMD->SetRange("Gcut>0.0");
79  fGammaCutCMD->SetDefaultUnit("mm");
81 
82  fElectCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/electronCut",this);
83  fElectCutCMD->SetGuidance("Set electron cut");
84  fElectCutCMD->SetParameterName("Ecut",false);
85  fElectCutCMD->SetUnitCategory("Length");
86  fElectCutCMD->SetRange("Ecut>0.0");
87  fElectCutCMD->SetDefaultUnit("mm");
89 
90  fPosCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/positronCut",this);
91  fPosCutCMD->SetGuidance("Set positron cut");
92  fPosCutCMD->SetParameterName("Pcut",false);
93  fPosCutCMD->SetUnitCategory("Length");
94  fPosCutCMD->SetRange("Pcut>0.0");
95  fPosCutCMD->SetDefaultUnit("mm");
97 
98  fAllCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/allCuts",this);
99  fAllCutCMD->SetGuidance("Set cut for all");
100  fAllCutCMD->SetParameterName("cut",false);
101  fAllCutCMD->SetUnitCategory("Length");
102  fAllCutCMD->SetRange("cut>0.0");
103  fAllCutCMD->SetDefaultUnit("mm");
105 
106  fStepMaxCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/stepMax",this);
107  fStepMaxCMD->SetGuidance("Set max. step length in the detector");
108  fStepMaxCMD->SetParameterName("mxStep",false);
109  fStepMaxCMD->SetUnitCategory("Length");
110  fStepMaxCMD->SetRange("mxStep>0.0");
111  fStepMaxCMD->SetDefaultUnit("mm");
113 
114  fClearPhysicsCMD =
115  new G4UIcmdWithoutParameter("/WLS/phys/clearPhysics",this);
116  fClearPhysicsCMD->SetGuidance("Clear the physics list");
118 
119  fRemovePhysicsCMD = new G4UIcmdWithAString("/WLS/phys/removePhysics",this);
120  fRemovePhysicsCMD->
121  SetGuidance("Remove a physics process from Physics List");
122  fRemovePhysicsCMD->SetParameterName("PList",false);
123  fRemovePhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
124 
125  fListCMD = new G4UIcmdWithoutParameter("/WLS/phys/list",this);
126  fListCMD->SetGuidance("Available Physics Lists");
127  fListCMD->AvailableForStates(G4State_Idle);
128 
129  fDecayDirectory = new G4UIdirectory("/decay/");
130  fDecayDirectory->SetGuidance("Decay chain control commands.");
131 
132  fPienuCMD = new G4UIcmdWithoutParameter("/decay/pienu", this);
133  fPienuCMD->SetGuidance("Sets the pi+ to decay into e+, nu");
134 
135  fPimunuCMD = new G4UIcmdWithoutParameter("/decay/pimunu", this);
136  fPimunuCMD->SetGuidance("Sets the pi+ to decay into mu+, nu");
137 
138 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

WLSPhysicsListMessenger::~WLSPhysicsListMessenger ( )
virtual

Definition at line 142 of file WLSPhysicsListMessenger.cc.

143 {
144  delete fVerboseCmd;
145  delete fCerenkovCmd;
146 
147  delete fSetAbsorptionCMD;
148 
149  delete fGammaCutCMD;
150  delete fElectCutCMD;
151  delete fPosCutCMD;
152  delete fAllCutCMD;
153 
154  delete fClearPhysicsCMD;
155  delete fRemovePhysicsCMD;
156 
157  delete fListCMD;
158 
159  delete fPienuCMD;
160  delete fPimunuCMD;
161 
162  delete fDirectory;
163 }

Member Function Documentation

void WLSPhysicsListMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 167 of file WLSPhysicsListMessenger.cc.

169 {
170  if( command == fSetAbsorptionCMD ) {
171  fPhysicsList->SetAbsorption(G4UIcmdWithABool::GetNewBoolValue(newValue));
172  }
173 
174  else if( command == fVerboseCmd ) {
175  fPhysicsList->SetVerbose(fVerboseCmd->GetNewIntValue(newValue));
176  }
177 
178  else if( command == fCerenkovCmd ) {
179  fPhysicsList->
180  SetNbOfPhotonsCerenkov(fCerenkovCmd->GetNewIntValue(newValue));
181  }
182 
183  else if (command == fPienuCMD) {
185  G4ParticleDefinition* particleDef = particleTable->FindParticle("pi+");
186  G4VDecayChannel* mode =
187  new G4PhaseSpaceDecayChannel("pi+",1.0,2,"e+","nu_e");
188  G4DecayTable* table = new G4DecayTable();
189  table->Insert(mode);
190  // mode = new G4PionRadiativeDecayChannel("pi+",0.000017);
191  // table->Insert(mode);
192  particleDef->SetDecayTable(table);
193  }
194 
195  else if (command == fPimunuCMD) {
197  G4ParticleDefinition* particleDef = particleTable->FindParticle("pi+");
198  G4VDecayChannel* mode =
199  new G4PhaseSpaceDecayChannel("pi+",1.000,2,"mu+","nu_mu");
200  G4DecayTable* table = new G4DecayTable();
201  table->Insert(mode);
202  particleDef->SetDecayTable(table);
203  }
204 
205  else if (command == fGammaCutCMD) {
206  fPhysicsList->SetCutForGamma(fGammaCutCMD
207  ->GetNewDoubleValue(newValue));
208  }
209  else if (command == fElectCutCMD) {
210  fPhysicsList->SetCutForElectron(fElectCutCMD
211  ->GetNewDoubleValue(newValue));
212  }
213  else if (command == fPosCutCMD) {
214  fPhysicsList->SetCutForPositron(fPosCutCMD
215  ->GetNewDoubleValue(newValue));
216  }
217  else if (command == fAllCutCMD) {
218  G4double cut = fAllCutCMD->GetNewDoubleValue(newValue);
219  fPhysicsList->SetCutForGamma(cut);
220  fPhysicsList->SetCutForElectron(cut);
221  fPhysicsList->SetCutForPositron(cut);
222  }
223  else if (command == fStepMaxCMD) {
224  fPhysicsList->SetStepMax(fStepMaxCMD
225  ->GetNewDoubleValue(newValue));
226  }
227  else if (command == fClearPhysicsCMD) {
228  fPhysicsList->ClearPhysics();
229  }
230  else if (command == fRemovePhysicsCMD) {
231  G4String name = newValue;
232  fPhysicsList->RemoveFromPhysicsList(name);
233  }
234 }
void SetDecayTable(G4DecayTable *aDecayTable)
const XML_Char * name
Definition: expat.h:151
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
void SetStepMax(G4double)
void ClearPhysics()
Make sure that the physics list is empty.
void SetCutForPositron(G4double)
void Insert(G4VDecayChannel *aChannel)
Definition: G4DecayTable.cc:60
void SetCutForGamma(G4double)
void RemoveFromPhysicsList(const G4String &)
Remove specific physics from physics list.
static G4ParticleTable * GetParticleTable()
void SetCutForElectron(G4double)
double G4double
Definition: G4Types.hh:76
void SetAbsorption(G4bool)
void SetVerbose(G4int)

Here is the call graph for this function:


The documentation for this class was generated from the following files: