ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimPhysicsListMessenger.cc
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 03/2006
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 //////////////////////////////////////////////////////////////////
10 /// \class ActarSimPhysicsListMessenger
11 /// Physics List Messenger
12 /////////////////////////////////////////////////////////////////
13 
15 #include "ActarSimPhysicsList.hh"
16 #include "G4UIdirectory.hh"
17 #include "G4UIcmdWithADoubleAndUnit.hh"
18 #include "G4UIcmdWithAString.hh"
19 #include "G4UIcmdWithAnInteger.hh"
20 #include "G4LossTableManager.hh"
21 
22 //////////////////////////////////////////////////////////////////
23 /// Constructor with commands definition.
24 /// Commands included in this AnalysisMessenger:
25 /// - /ActarSim/phys/setGCut
26 /// - /ActarSim/phys/setECut
27 /// - /ActarSim/phys/setPCut
28 /// - /ActarSim/phys/setCuts
29 /// - /ActarSim/phys/addPhysics
30 /// - /ActarSim/phys/RemovePhysics
31 /// - /ActarSim/phys/verbose
33  :pPhysicsList(pPhys){
34 
35  physDir = new G4UIdirectory("/ActarSim/phys/");
36  physDir->SetGuidance("physics list commands");
37 
38  gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/ActarSim/phys/setGCut",this);
39  gammaCutCmd->SetGuidance("Set gamma cut.");
40  gammaCutCmd->SetParameterName("Gcut",false);
41  gammaCutCmd->SetUnitCategory("Length");
42  gammaCutCmd->SetRange("Gcut>0.0");
43  gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
44 
45  electCutCmd = new G4UIcmdWithADoubleAndUnit("/ActarSim/phys/setECut",this);
46  electCutCmd->SetGuidance("Set electron cut.");
47  electCutCmd->SetParameterName("Ecut",false);
48  electCutCmd->SetUnitCategory("Length");
49  electCutCmd->SetRange("Ecut>0.0");
50  electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
51 
52  protoCutCmd = new G4UIcmdWithADoubleAndUnit("/ActarSim/phys/setPCut",this);
53  protoCutCmd->SetGuidance("Set positron cut.");
54  protoCutCmd->SetParameterName("Pcut",false);
55  protoCutCmd->SetUnitCategory("Length");
56  protoCutCmd->SetRange("Pcut>0.0");
57  protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
58 
59  allCutCmd = new G4UIcmdWithADoubleAndUnit("/ActarSim/phys/setCuts",this);
60  allCutCmd->SetGuidance("Set cut for all.");
61  allCutCmd->SetParameterName("cut",false);
62  allCutCmd->SetUnitCategory("Length");
63  allCutCmd->SetRange("cut>0.0");
64  allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
65 
66  pListCmd = new G4UIcmdWithAString("/ActarSim/phys/addPhysics",this);
67  pListCmd->SetGuidance("Add modula physics list.");
68  pListCmd->SetParameterName("PList",false);
69  pListCmd->AvailableForStates(G4State_PreInit);
70 
71  RmPListCmd = new G4UIcmdWithAString("/ActarSim/phys/RemovePhysics",this);
72  RmPListCmd->SetGuidance("Remove all modula physics list.");
73  RmPListCmd->AvailableForStates(G4State_Idle);
74 
75  verbCmd = new G4UIcmdWithAnInteger("/ActarSim/phys/verbose",this);
76  verbCmd->SetGuidance("Set verbose level for processes");
77  verbCmd->SetParameterName("pVerb",false);
78  verbCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
79 }
80 
81 //////////////////////////////////////////////////////////////////
82 /// Destructor
84  delete gammaCutCmd;
85  delete electCutCmd;
86  delete protoCutCmd;
87  delete allCutCmd;
88  delete pListCmd;
89  delete RmPListCmd;
90  delete verbCmd;
91  delete physDir;
92 }
93 
94 //////////////////////////////////////////////////////////////////
95 /// Setting the values using the ActarSimPhysicsList interface
97  G4String newValue) {
98 
99  if( command == gammaCutCmd )
100  pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));
101 
102  if( command == electCutCmd )
103  pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));
104 
105 
106  if( command == protoCutCmd )
107  pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));
108 
109  if( command == allCutCmd ) {
110  G4double cut = allCutCmd->GetNewDoubleValue(newValue);
114  }
115 
116  if( command == verbCmd )
117  G4LossTableManager::Instance()->SetVerbose(verbCmd->GetNewIntValue(newValue));
118 
119  if( command == pListCmd )
120  pPhysicsList->AddPhysicsList(newValue);
121 
122  if( command == RmPListCmd )
124 }
G4UIcmdWithADoubleAndUnit * allCutCmd
Set cut for all.
G4UIcmdWithADoubleAndUnit * protoCutCmd
Set positron cut.
ActarSimPhysicsList * pPhysicsList
Pointer to the Physic List.
void SetCutForElectron(G4double)
Setting cut value for the electron.
G4UIcmdWithAnInteger * verbCmd
Set verbose level for processes.
ActarSimPhysicsListMessenger(ActarSimPhysicsList *)
G4UIcmdWithAString * RmPListCmd
Remove all modula physics list.
void AddPhysicsList(const G4String &)
Registering the physics processes.
G4UIcmdWithAString * pListCmd
Add modula physics list.
G4UIcmdWithADoubleAndUnit * electCutCmd
Set electron cut.
void SetCutForGamma(G4double)
Setting cut value for the gammas.
void SetCutForPositron(G4double)
Setting cut value for the positron.
G4UIcmdWithADoubleAndUnit * gammaCutCmd
Set gamma cut.
~ActarSimPhysicsList()
Destructor. Nothing to do.
void SetNewValue(G4UIcommand *, G4String)
Setting the values using the ActarSimPhysicsList interface.