LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PhysicsListMessenger Class Reference

#include "PhysicsListMessenger.hh"

Inheritance diagram for PhysicsListMessenger:

Public Member Functions

 PhysicsListMessenger (PhysicsList *)
 
 ~PhysicsListMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 

Private Attributes

PhysicsListpPhysicsList
 
G4UIdirectory * physDir
 
G4UIcmdWithADoubleAndUnit * gammaCutCmd
 
G4UIcmdWithADoubleAndUnit * electCutCmd
 
G4UIcmdWithADoubleAndUnit * protoCutCmd
 
G4UIcmdWithADoubleAndUnit * allCutCmd
 
G4UIcmdWithAString * pListCmd
 

Detailed Description

Definition at line 43 of file PhysicsListMessenger.hh.

Constructor & Destructor Documentation

PhysicsListMessenger::PhysicsListMessenger ( PhysicsList pPhys)

Definition at line 39 of file PhysicsListMessenger.cc.

References allCutCmd, electCutCmd, gammaCutCmd, physDir, pListCmd, and protoCutCmd.

40 :pPhysicsList(pPhys)
41 {
42  physDir = new G4UIdirectory("/testem/phys/");
43  physDir->SetGuidance("physics list commands");
44 
45  gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this);
46  gammaCutCmd->SetGuidance("Set gamma cut.");
47  gammaCutCmd->SetParameterName("Gcut",false);
48  gammaCutCmd->SetUnitCategory("Length");
49  gammaCutCmd->SetRange("Gcut>0.0");
50  gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
51 
52  electCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this);
53  electCutCmd->SetGuidance("Set electron cut.");
54  electCutCmd->SetParameterName("Ecut",false);
55  electCutCmd->SetUnitCategory("Length");
56  electCutCmd->SetRange("Ecut>0.0");
57  electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
58 
59  protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this);
60  protoCutCmd->SetGuidance("Set positron cut.");
61  protoCutCmd->SetParameterName("Pcut",false);
62  protoCutCmd->SetUnitCategory("Length");
63  protoCutCmd->SetRange("Pcut>0.0");
64  protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
65 
66  allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this);
67  allCutCmd->SetGuidance("Set cut for all.");
68  allCutCmd->SetParameterName("cut",false);
69  allCutCmd->SetUnitCategory("Length");
70  allCutCmd->SetRange("cut>0.0");
71  allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
72 
73  pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
74  pListCmd->SetGuidance("Add modula physics list.");
75  pListCmd->SetParameterName("PList",false);
76  pListCmd->AvailableForStates(G4State_PreInit);
77 }
G4UIcmdWithADoubleAndUnit * electCutCmd
G4UIcmdWithAString * pListCmd
G4UIcmdWithADoubleAndUnit * protoCutCmd
G4UIcmdWithADoubleAndUnit * gammaCutCmd
G4UIcmdWithADoubleAndUnit * allCutCmd
PhysicsListMessenger::~PhysicsListMessenger ( )

Definition at line 81 of file PhysicsListMessenger.cc.

References allCutCmd, electCutCmd, gammaCutCmd, physDir, pListCmd, and protoCutCmd.

82 {
83  delete gammaCutCmd;
84  delete electCutCmd;
85  delete protoCutCmd;
86  delete allCutCmd;
87  delete pListCmd;
88  delete physDir;
89 }
G4UIcmdWithADoubleAndUnit * electCutCmd
G4UIcmdWithAString * pListCmd
G4UIcmdWithADoubleAndUnit * protoCutCmd
G4UIcmdWithADoubleAndUnit * gammaCutCmd
G4UIcmdWithADoubleAndUnit * allCutCmd

Member Function Documentation

void PhysicsListMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

Definition at line 93 of file PhysicsListMessenger.cc.

References PhysicsList::AddPhysicsList(), allCutCmd, electCutCmd, gammaCutCmd, pListCmd, pPhysicsList, protoCutCmd, PhysicsList::SetCutForElectron(), PhysicsList::SetCutForGamma(), and PhysicsList::SetCutForPositron().

95 {
96  if( command == gammaCutCmd )
97  { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
98 
99  if( command == electCutCmd )
100  { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
101 
102  if( command == protoCutCmd )
103  { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
104 
105  if( command == allCutCmd )
106  {
107  G4double cut = allCutCmd->GetNewDoubleValue(newValue);
111  }
112 
113  if( command == pListCmd )
114  { pPhysicsList->AddPhysicsList(newValue);}
115 }
G4UIcmdWithADoubleAndUnit * electCutCmd
G4UIcmdWithAString * pListCmd
G4UIcmdWithADoubleAndUnit * protoCutCmd
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:190
void SetCutForGamma(G4double)
Definition: PhysicsList.cc:230
void SetCutForElectron(G4double)
Definition: PhysicsList.cc:238
void SetCutForPositron(G4double)
Definition: PhysicsList.cc:246
G4UIcmdWithADoubleAndUnit * gammaCutCmd
G4UIcmdWithADoubleAndUnit * allCutCmd

Member Data Documentation

G4UIcmdWithADoubleAndUnit* PhysicsListMessenger::allCutCmd
private
G4UIcmdWithADoubleAndUnit* PhysicsListMessenger::electCutCmd
private
G4UIcmdWithADoubleAndUnit* PhysicsListMessenger::gammaCutCmd
private
G4UIdirectory* PhysicsListMessenger::physDir
private

Definition at line 56 of file PhysicsListMessenger.hh.

Referenced by PhysicsListMessenger(), and ~PhysicsListMessenger().

G4UIcmdWithAString* PhysicsListMessenger::pListCmd
private
PhysicsList* PhysicsListMessenger::pPhysicsList
private

Definition at line 54 of file PhysicsListMessenger.hh.

Referenced by SetNewValue().

G4UIcmdWithADoubleAndUnit* PhysicsListMessenger::protoCutCmd
private

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