QwGeant4
QweakSimEPEventMessenger.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimEPEventMessenger.cc
10 
11  \author Peiqing Wang
12 
13 */
14 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
15 
17 
18 // user includes
19 #include "QweakSimEPEvent.hh"
21 
22 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
23 
25 :pQweakSimEPEvent(pEPEvent)
26 {
27  G4cout << "###### Calling QweakSimEPEventMessenger::QweakSimEPEventMessenger() " << G4endl;
28 
29  EventGenDir = new G4UIdirectory("/EventGen/");
30  EventGenDir->SetGuidance("Event generator control");
31 
32  verboseCmd = new G4UIcmdWithAnInteger("/EventGen/verbose",this);
33  verboseCmd->SetGuidance("set verbose for event generator");
34  verboseCmd->SetParameterName("verbose",true);
35  verboseCmd->SetDefaultValue(1);
36  verboseCmd->SetRange("verbose>=0");
37  verboseCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
38 
39  SelectOctant_Cmd = new G4UIcmdWithAnInteger("/EventGen/SelectOctant",this);
40  SelectOctant_Cmd->SetGuidance("Select octant for primaries (=0: all octants, >8: two opposite octants)");
41  SelectOctant_Cmd->SetParameterName("SelectOctant",true);
42  SelectOctant_Cmd->SetDefaultValue(0);
43  SelectOctant_Cmd->SetRange("SelectOctant>=0");
44  SelectOctant_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
45 
46 // Isotropy: 0 - uniform phi angle and uniform theta angle, independent to each other
47 // 1 - uniform in any solid angle (i.e. uniform phi, but phi-denendent theta)
48  SelectIsotropy_Cmd = new G4UIcmdWithAnInteger("/EventGen/SelectIsotropy",this);
49  SelectIsotropy_Cmd->SetGuidance("Select isotropy for generator");
50  SelectIsotropy_Cmd->SetParameterName("SelectIsotropy",true);
51  SelectIsotropy_Cmd->SetDefaultValue(1);
52  SelectIsotropy_Cmd->SetRange("SelectIsotropy>=0 && SelectIsotropy<=1");
53  SelectIsotropy_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
54 
55 // ReactionType: 1 - LH2 elastic
56 // 2 - Al window elastic
57 // 3 - Al window quasi-elastic proton
58 // 4 - Al window quasi-elastic neutron
59 //
60 // ReactionRegion: 1 - LH2 target
61 // 2 - entrance window
62 // 3 - exit window
63 
64  SelectReactionType_Cmd = new G4UIcmdWithAnInteger("/EventGen/SelectReactionType",this);
65  SelectReactionType_Cmd->SetGuidance("Select reaction type");
66  SelectReactionType_Cmd->SetGuidance("0 - Combination of all reactions");
67  SelectReactionType_Cmd->SetGuidance("1 - LH2 elastic (default)");
68  SelectReactionType_Cmd->SetGuidance("2 - Al elastic");
69  SelectReactionType_Cmd->SetGuidance("3 - Al quasi-elastic (proton)");
70  SelectReactionType_Cmd->SetGuidance("4 - Al quasi-elastic (neutron)");
71  SelectReactionType_Cmd->SetGuidance("5 - LH2 inelastic (delta resonance)");
72  SelectReactionType_Cmd->SetGuidance("6 - Moller scattering");
73  SelectReactionType_Cmd->SetGuidance("7 - LH2 radiative lookup table (3.35 GeV)");
74  SelectReactionType_Cmd->SetGuidance("8 - Al quasi-elastic (Bosted)");
75 
76  SelectReactionType_Cmd->SetGuidance("88 - LH2 pion photo-production (3.35 GeV)");
77  SelectReactionType_Cmd->SetGuidance("89 - Al pion photo-production (3.35 GeV)");
78  SelectReactionType_Cmd->SetGuidance("90 - C pion photo-production (3.35 GeV)");
79 
80  SelectReactionType_Cmd->SetGuidance("20 - C Elastic A (Harmonic Well)");
81  SelectReactionType_Cmd->SetGuidance("21 - C Elastic B (FB empirical fit)");
82  SelectReactionType_Cmd->SetGuidance("22 - C GDR");
83  SelectReactionType_Cmd->SetGuidance("23 - C 4.4 MeV Excitation");
84  SelectReactionType_Cmd->SetGuidance("24 - C 7.7 MeV Excitation");
85  SelectReactionType_Cmd->SetGuidance("25 - C 9.6 MeV Excitation");
86 
87  SelectReactionType_Cmd->SetParameterName("SelectReactionType",true);
88  SelectReactionType_Cmd->SetDefaultValue(1);
89  SelectReactionType_Cmd->SetRange("SelectReactionType>=0");
90  SelectReactionType_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
91 
92  SelectReactionRegion_Cmd = new G4UIcmdWithAnInteger("/EventGen/SelectReactionRegion",this);
93  SelectReactionRegion_Cmd->SetGuidance("Select reaction region");
94  SelectReactionRegion_Cmd->SetGuidance("1 - target (default)");
95  SelectReactionRegion_Cmd->SetGuidance("2 - entrance target window");
96  SelectReactionRegion_Cmd->SetGuidance("3 - exit target window");
97  SelectReactionRegion_Cmd->SetParameterName("SelectReactionRegion",true);
98  SelectReactionRegion_Cmd->SetDefaultValue(1);
99  SelectReactionRegion_Cmd->SetRange("SelectReactionRegion>=1");
100  SelectReactionRegion_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
101 
102  ThetaMinLimitCmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetThetaMin",this);
103  ThetaMinLimitCmd->SetGuidance("Set the minimum theta angle of event generator");
104  ThetaMinLimitCmd->SetParameterName("ThetaMin",true);
105  ThetaMinLimitCmd->SetUnitCategory("Angle");
106  ThetaMinLimitCmd->SetDefaultUnit("degree");
107  ThetaMinLimitCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
108 
109  ThetaMaxLimitCmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetThetaMax",this);
110  ThetaMaxLimitCmd->SetGuidance("Set the maximum theta angle of event generator");
111  ThetaMaxLimitCmd->SetParameterName("ThetaMax",true);
112  ThetaMaxLimitCmd->SetUnitCategory("Angle");
113  ThetaMaxLimitCmd->SetDefaultUnit("degree");
114  ThetaMaxLimitCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
115 
116  PhiMinLimitCmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetPhiMin",this);
117  PhiMinLimitCmd->SetGuidance("Set the minimum theta angle of event generator");
118  PhiMinLimitCmd->SetParameterName("PhiMin",true);
119  PhiMinLimitCmd->SetUnitCategory("Angle");
120  PhiMinLimitCmd->SetDefaultUnit("degree");
121  PhiMinLimitCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
122 
123  PhiMaxLimitCmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetPhiMax",this);
124  PhiMaxLimitCmd->SetGuidance("Set the maximum theta angle of event generator");
125  PhiMaxLimitCmd->SetParameterName("PhiMax",true);
126  PhiMaxLimitCmd->SetUnitCategory("Angle");
127  PhiMaxLimitCmd->SetDefaultUnit("degree");
128  PhiMaxLimitCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
129 
130  EPrimeMinLimitCmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetEPrimeMin",this);
131  EPrimeMinLimitCmd->SetGuidance("Set the minimum E\' of event generator");
132  EPrimeMinLimitCmd->SetParameterName("EPrimeMin",true);
133  EPrimeMinLimitCmd->SetUnitCategory("Energy");
134  EPrimeMinLimitCmd->SetDefaultUnit("GeV");
135  EPrimeMinLimitCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
136 
137  EPrimeMaxLimitCmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetEPrimeMax",this);
138  EPrimeMaxLimitCmd->SetGuidance("Set the maximum E\' of event generator");
139  EPrimeMaxLimitCmd->SetParameterName("EPrimeMax",true);
140  EPrimeMaxLimitCmd->SetUnitCategory("Energy");
141  EPrimeMaxLimitCmd->SetDefaultUnit("GeV");
142  EPrimeMaxLimitCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
143 
144  SetBeamEnergyCmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetBeamEnergy",this);
145  SetBeamEnergyCmd->SetGuidance("Set beam energy.");
146  SetBeamEnergyCmd->SetParameterName("E_beam",true);
147  SetBeamEnergyCmd->SetUnitCategory("Energy");
148  SetBeamEnergyCmd->SetDefaultValue(1.160*GeV);
149  //SetBeamEnergyCmd->SetRange("BeamEnergy>0");
150  SetBeamEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
151 
152  SetElasticPeakDeltaECmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetElasticPeakDeltaE",this);
153  SetElasticPeakDeltaECmd->SetGuidance("Set elastic peak delta E range (Used in ReactionType 7).");
154  SetElasticPeakDeltaECmd->SetParameterName("delta_E",true);
155  SetElasticPeakDeltaECmd->SetUnitCategory("Energy");
156  SetElasticPeakDeltaECmd->SetDefaultValue(15*MeV);
157  SetElasticPeakDeltaECmd->AvailableForStates(G4State_PreInit,G4State_Idle);
158 
159  SetSchwingerDeltaECmd = new G4UIcmdWithADoubleAndUnit("/EventGen/SetSchwingerDeltaE",this);
160  SetSchwingerDeltaECmd->SetGuidance("Set elastic peak delta E range (Used in carbon generators).");
161  SetSchwingerDeltaECmd->SetParameterName("Schwinger_delta_E",true);
162  SetSchwingerDeltaECmd->SetUnitCategory("Energy");
163  SetSchwingerDeltaECmd->SetDefaultValue(15*MeV);
164  SetSchwingerDeltaECmd->AvailableForStates(G4State_PreInit,G4State_Idle);
165 
166  G4cout << "###### Leaving QweakSimEPEventMessenger::QweakSimEPEventMessenger() " << G4endl;
167 }
168 
169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
170 
172 {
173  G4cout << "###### Calling QweakSimEPEventMessenger::~QweakSimEPEventMessenger() " << G4endl;
174 
175  delete SelectOctant_Cmd;
176  delete SelectIsotropy_Cmd;
177  delete SelectReactionType_Cmd;
179  delete verboseCmd;
180  delete ThetaMinLimitCmd;
181  delete ThetaMaxLimitCmd;
182  delete PhiMinLimitCmd;
183  delete PhiMaxLimitCmd;
184  delete EPrimeMinLimitCmd;
185  delete EPrimeMaxLimitCmd;
186  delete SetBeamEnergyCmd;
188  delete SetSchwingerDeltaECmd;
189  delete EventGenDir;
190 
191  G4cout << "###### Leaving QweakSimEPEventMessenger::~QweakSimEPEventMessenger() " << G4endl;
192 
193 }
194 
195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
196 
197 void QweakSimEPEventMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
198 {
199 
200  if( command == SelectOctant_Cmd )
201  {
202  G4cout << "% % ===> Changing active octant number to: "<<newValue<< G4endl;
203  pQweakSimEPEvent->SetActiveOctantNumber(SelectOctant_Cmd->GetNewIntValue(newValue));
204  }
205  if( command == SelectIsotropy_Cmd )
206  {
207  G4cout << "% % ===> Changing isotropy to: "<<newValue<< G4endl;
208  pQweakSimEPEvent->SetIsotropy(SelectIsotropy_Cmd->GetNewIntValue(newValue));
209  }
210  if( command == SelectReactionType_Cmd )
211  {
212  G4cout << "% % ===> Changing reaction type to: "<<newValue<< G4endl;
213  G4int type = SelectReactionType_Cmd->GetNewIntValue(newValue);
215  if (type == 7) pQweakSimEPEvent->CreateLookupTable();
216  }
217 
218  if( command == SelectReactionRegion_Cmd )
219  {
220  G4cout << "% % ===> Changing reaction region to: "<<newValue<< G4endl;
221  pQweakSimEPEvent->SetReactionRegion(SelectReactionRegion_Cmd->GetNewIntValue(newValue));
222  }
223 
224  if( command == ThetaMinLimitCmd )
225  {
226  G4cout << "% % ===> Changing theta minimum to: "<<newValue<< G4endl;
227  pQweakSimEPEvent->SetThetaAngle_Min(ThetaMinLimitCmd->GetNewDoubleValue(newValue));
228  }
229 
230  if( command == ThetaMaxLimitCmd )
231  {
232  G4cout << "% % ===> Changing theta maximum to: "<<newValue<< G4endl;
233  pQweakSimEPEvent->SetThetaAngle_Max(ThetaMaxLimitCmd->GetNewDoubleValue(newValue));
234  }
235 
236  if( command == PhiMinLimitCmd )
237  {
238  G4cout << "% % ===> Changing phi minimum to: "<<newValue<< G4endl;
239  pQweakSimEPEvent->SetPhiAngle_Min(PhiMinLimitCmd->GetNewDoubleValue(newValue));
240  }
241 
242  if( command == PhiMaxLimitCmd )
243  {
244  G4cout << "% % ===> Changing phi maximum to: "<<newValue<< G4endl;
245  pQweakSimEPEvent->SetPhiAngle_Max(PhiMaxLimitCmd->GetNewDoubleValue(newValue));
246  }
247 
248  if( command == EPrimeMinLimitCmd )
249  {
250  G4cout << "% % ===> Changing E\' minimum to: "<<newValue<< G4endl;
251  pQweakSimEPEvent->SetEPrime_Min(EPrimeMinLimitCmd->GetNewDoubleValue(newValue));
252  }
253 
254  if( command == EPrimeMaxLimitCmd )
255  {
256  G4cout << "% % ===> Changing E\' maximum to: "<<newValue<< G4endl;
257  pQweakSimEPEvent->SetEPrime_Max(EPrimeMaxLimitCmd->GetNewDoubleValue(newValue));
258  }
259 
260  if( command == SetBeamEnergyCmd )
261  {
262  G4cout << "% % ===> Changing Beam Energy to: "<<newValue<< G4endl;
263  pQweakSimEPEvent->SetBeamEnergy(SetBeamEnergyCmd->GetNewDoubleValue(newValue));
264  }
265 
266  if( command == SetElasticPeakDeltaECmd )
267  {
268  G4cout << "% % ===> Changing Elastic Peak Energy Range to: "<<newValue<< G4endl;
269  pQweakSimEPEvent->SetElasticPeakDeltaE(SetElasticPeakDeltaECmd->GetNewDoubleValue(newValue));
270  }
271 
272  if( command == SetSchwingerDeltaECmd )
273  {
274  G4cout << "% % ===> Changing Schwinger Elastic Peak Energy Range to: "<<newValue<< G4endl;
275  pQweakSimEPEvent->SetSchwingerDeltaE(SetSchwingerDeltaECmd->GetNewDoubleValue(newValue));
276  }
277 
278 }
G4UIcmdWithAnInteger * SelectIsotropy_Cmd
void SetEPrime_Max(G4double energy)
void SetEPrime_Min(G4double energy)
G4UIcmdWithADoubleAndUnit * PhiMaxLimitCmd
void SetReactionType(G4int rt)
QweakSimEPEventMessenger(QweakSimEPEvent *)
void SetReactionRegion(G4int rr)
G4UIcmdWithADoubleAndUnit * EPrimeMaxLimitCmd
G4UIcmdWithADoubleAndUnit * SetBeamEnergyCmd
void SetPhiAngle_Max(G4double ang)
G4UIcmdWithAnInteger * SelectOctant_Cmd
void SetIsotropy(G4int isot)
void SetThetaAngle_Min(G4double ang)
void SetNewValue(G4UIcommand *, G4String)
void SetSchwingerDeltaE(G4double energy=15 *MeV)
void SetActiveOctantNumber(G4int kaot)
void SetElasticPeakDeltaE(G4double energy=15 *MeV)
void SetBeamEnergy(G4double energy=1.160 *GeV)
G4UIcmdWithADoubleAndUnit * EPrimeMinLimitCmd
void SetThetaAngle_Max(G4double ang)
G4UIcmdWithAnInteger * SelectReactionRegion_Cmd
G4UIcmdWithADoubleAndUnit * SetSchwingerDeltaECmd
G4UIcmdWithADoubleAndUnit * ThetaMinLimitCmd
G4UIcmdWithADoubleAndUnit * PhiMinLimitCmd
G4UIcmdWithADoubleAndUnit * SetElasticPeakDeltaECmd
G4UIcmdWithAnInteger * SelectReactionType_Cmd
G4UIcmdWithAnInteger * verboseCmd
void SetPhiAngle_Min(G4double ang)
G4UIcmdWithADoubleAndUnit * ThetaMaxLimitCmd