Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
F04PhysicsListMessenger Class Reference

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

#include <F04PhysicsListMessenger.hh>

Inheritance diagram for F04PhysicsListMessenger:
G4UImessenger

Public Member Functions

 F04PhysicsListMessenger (F04PhysicsList *)
 
virtual ~F04PhysicsListMessenger ()
 
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
 

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
 

Detailed Description

Provide control of the physics list and cut parameters.

Definition at line 47 of file F04PhysicsListMessenger.hh.

Constructor & Destructor Documentation

F04PhysicsListMessenger::F04PhysicsListMessenger ( F04PhysicsList pPhys)

Definition at line 53 of file F04PhysicsListMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcommand::SetGuidance(), G4UIcmdWithADoubleAndUnit::SetParameterName(), G4UIcommand::SetRange(), and G4UIcmdWithADoubleAndUnit::SetUnitCategory().

54  : fPhysicsList(pPhys)
55 {
56  fDirectory = new G4UIdirectory("/exp/phys/");
57  fDirectory->SetGuidance("Control the physics lists");
58 
59  fGammaCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/gammaCut",this);
60  fGammaCutCMD->SetGuidance("Set gamma cut");
61  fGammaCutCMD->SetParameterName("Gcut",false);
62  fGammaCutCMD->SetUnitCategory("Length");
63  fGammaCutCMD->SetRange("Gcut>0.0");
64  fGammaCutCMD->SetDefaultUnit("mm");
66 
67  fElectCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/electronCut",
68  this);
69  fElectCutCMD->SetGuidance("Set electron cut");
70  fElectCutCMD->SetParameterName("Ecut",false);
71  fElectCutCMD->SetUnitCategory("Length");
72  fElectCutCMD->SetRange("Ecut>0.0");
73  fElectCutCMD->SetDefaultUnit("mm");
75 
76  fPosCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/positronCut",
77  this);
78  fPosCutCMD->SetGuidance("Set positron cut");
79  fPosCutCMD->SetParameterName("Pcut",false);
80  fPosCutCMD->SetUnitCategory("Length");
81  fPosCutCMD->SetRange("Pcut>0.0");
82  fPosCutCMD->SetDefaultUnit("mm");
84 
85  fAllCutCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/allCuts",this);
86  fAllCutCMD->SetGuidance("Set cut for all");
87  fAllCutCMD->SetParameterName("cut",false);
88  fAllCutCMD->SetUnitCategory("Length");
89  fAllCutCMD->SetRange("cut>0.0");
90  fAllCutCMD->SetDefaultUnit("mm");
92 
93  fStepMaxCMD = new G4UIcmdWithADoubleAndUnit("/exp/phys/stepMax",this);
94  fStepMaxCMD->SetGuidance("Set max. step length in the detector");
95  fStepMaxCMD->SetParameterName("mxStep",false);
96  fStepMaxCMD->SetUnitCategory("Length");
97  fStepMaxCMD->SetRange("mxStep>0.0");
98  fStepMaxCMD->SetDefaultUnit("mm");
100 /*
101  fClearPhysicsCMD = new G4UIcmdWithoutParameter("/exp/phys/clearPhysics",
102  this);
103  fClearPhysicsCMD->SetGuidance("Clear the physics list");
104  fClearPhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
105 
106  fRemovePhysicsCMD = new G4UIcmdWithAString("/exp/phys/removePhysics",this);
107  fRemovePhysicsCMD->
108  SetGuidance("Remove a physics process from Physics List");
109  fRemovePhysicsCMD->SetParameterName("PList",false);
110  fRemovePhysicsCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
111 */
112  fDecayDirectory = new G4UIdirectory("/decay/");
113  fDecayDirectory->SetGuidance("Decay chain control commands.");
114 
115  fPienuCMD = new G4UIcmdWithoutParameter("/decay/pienu", this);
116  fPienuCMD->SetGuidance("Sets the pi+ to decay into e+, nu");
117 
118  fPimunuCMD = new G4UIcmdWithoutParameter("/decay/pimunu", this);
119  fPimunuCMD->SetGuidance("Sets the pi+ to decay into mu+, nu");
120 
121 }
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:225
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
F04PhysicsListMessenger::~F04PhysicsListMessenger ( )
virtual

Definition at line 125 of file F04PhysicsListMessenger.cc.

126 {
127  delete fGammaCutCMD;
128  delete fElectCutCMD;
129  delete fPosCutCMD;
130  delete fAllCutCMD;
131 /*
132  delete fClearPhysicsCMD;
133  delete fRemovePhysicsCMD;
134 */
135  delete fPienuCMD;
136  delete fPimunuCMD;
137 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 141 of file F04PhysicsListMessenger.cc.

References G4ParticleTable::FindParticle(), G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4ParticleTable::GetParticleTable(), G4DecayTable::Insert(), F04PhysicsList::SetCutForElectron(), F04PhysicsList::SetCutForGamma(), F04PhysicsList::SetCutForPositron(), G4ParticleDefinition::SetDecayTable(), and F04PhysicsList::SetStepMax().

143 {
145 
146  if (command == fPienuCMD) {
147  G4ParticleDefinition* fParticleDef = fParticleTable->FindParticle("pi+");
148  G4VDecayChannel* fMode =
149  new G4PhaseSpaceDecayChannel("pi+",0.999983,2,"e+","nu_e");
150  G4DecayTable* fTable = new G4DecayTable();
151  fTable->Insert(fMode);
152  fMode = new G4PionRadiativeDecayChannel("pi+",0.000017);
153  fTable->Insert(fMode);
154  fParticleDef->SetDecayTable(fTable);
155  }
156 
157  if (command == fPimunuCMD) {
158  G4ParticleDefinition* fParticleDef = fParticleTable->FindParticle("pi+");
159  G4VDecayChannel* fMode =
160  new G4PhaseSpaceDecayChannel("pi+",1.000,2,"mu+","nu_mu");
161  G4DecayTable* fTable = new G4DecayTable();
162  fTable->Insert(fMode);
163  fParticleDef->SetDecayTable(fTable);
164  }
165 
166  if (command == fGammaCutCMD) {
167  fPhysicsList->SetCutForGamma(fGammaCutCMD
168  ->GetNewDoubleValue(newValue));
169  }
170  else if (command == fElectCutCMD) {
171  fPhysicsList->SetCutForElectron(fElectCutCMD
172  ->GetNewDoubleValue(newValue));
173  }
174  else if (command == fPosCutCMD) {
175  fPhysicsList->SetCutForPositron(fPosCutCMD
176  ->GetNewDoubleValue(newValue));
177  }
178  else if (command == fAllCutCMD) {
179  G4double cut = fAllCutCMD->GetNewDoubleValue(newValue);
180  fPhysicsList->SetCutForGamma(cut);
181  fPhysicsList->SetCutForElectron(cut);
182  fPhysicsList->SetCutForPositron(cut);
183  }
184  else if (command == fStepMaxCMD) {
185  fPhysicsList->SetStepMax(fStepMaxCMD
186  ->GetNewDoubleValue(newValue));
187  }
188 /* else if (command == fClearPhysicsCMD) {
189  fPhysicsList->ClearPhysics();
190  }
191  else if (command == fRemovePhysicsCMD) {
192  G4String name = newValue;
193  fPhysicsList->RemoveFromPhysicsList(name);
194  }
195 */
196 }
void SetDecayTable(G4DecayTable *aDecayTable)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4double GetNewDoubleValue(const char *paramString)
void SetCutForGamma(G4double)
void SetCutForElectron(G4double)
void SetCutForPositron(G4double)
void SetStepMax(G4double)
void Insert(G4VDecayChannel *aChannel)
Definition: G4DecayTable.cc:60
static G4ParticleTable * GetParticleTable()
double G4double
Definition: G4Types.hh:76

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