Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4QMessenger.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id$
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4QMessenger
31 //
32 // Author: 2009 M. V. Kossov
33 //
34 // Modified:
35 //
36 //----------------------------------------------------------------------------
37 //
38 
39 #include "G4QMessenger.hh"
40 #include "G4QNeutrinoPhysics.hh"
42 
43 G4QMessenger::G4QMessenger()
44 {
45  rootDir = new G4UIdirectory("/CHIPS_physics/");
46  rootDir->SetGuidance("messenger of the CHIPS processes");
47  weakDir=0;
48  theWeak=0;
49  theNuElN=0;
50  theNuMuN=0;
51  theNuTaN=0;
52  biasNuNuc=0;
53  photoDir=0;
54  thePhoto=0;
55  theSynchR=0;
56  minGamSR=0;
57  theGamN=0;
58  theEleN=0;
59  theMuoN=0;
60  theTauN=0;
61  biasPhotoN=0;
62 }
63 
65 {
66  delete rootDir;
67  if(photoDir)
68  {
69  delete photoDir;
70  delete theSynchR;
71  delete minGamSR;
72  delete theGamN;
73  delete theEleN;
74  delete theMuoN;
75  delete theTauN;
76  delete biasPhotoN;
77  }
78  else if(weakDir)
79  {
80  delete weakDir;
81  delete theNuElN;
82  delete theNuMuN;
83  delete theNuTaN;
84  delete biasNuNuc;
85  }
86 }
87 
88 // Returns Pointer to the G4QMessenger class
90 {
91  static G4QMessenger theMessenger; //**Static body of CHIPS Messenger**
92  return &theMessenger;
93 }
94 
96 {
97  theWeak = weak;
98 
99  weakDir = new G4UIdirectory("/CHIPS_physics/neutrino/");
100  weakDir->SetGuidance("weak (neutrino) processes");
101 
102  // commands for neutrino_el-nuclear physics.
103  theNuElN = new G4UIcmdWithAString("/CHIPS_physics/neutrino/NuElNuclear",this);
104  theNuElN->SetGuidance("Switching of nu_el-nuclear physics.");
105  theNuElN->SetParameterName("status",false);
106  theNuElN->SetCandidates("on off");
107  theNuElN->SetDefaultValue("off");
109 
110  // commands for neutrino_mu-nuclear physics.
111  theNuMuN = new G4UIcmdWithAString("/CHIPS_physics/neutrino/NuMuNuclear",this);
112  theNuMuN->SetGuidance("Switching of nu_mu-nuclear physics.");
113  theNuMuN->SetParameterName("status",false);
114  theNuMuN->SetCandidates("on off");
115  theNuMuN->SetDefaultValue("off");
117 
118  // commands for neutrino_tau-nuclear physics.
119  theNuTaN = new G4UIcmdWithAString("/CHIPS_physics/neutrino/NuTauNuclear",this);
120  theNuTaN->SetGuidance("Switching of nu_tau-nuclear physics.");
121  theNuTaN->SetParameterName("status",false);
122  theNuTaN->SetCandidates("on off");
123  theNuTaN->SetDefaultValue("off");
125 
126  // command for biasing of neutrino-nuclear reactions
127  biasNuNuc = new G4UIcmdWithADouble("/CHIPS_physics/neutrino/NuNuc_Biasing", this);
128  biasNuNuc->SetGuidance("Set a biasing coefficient for neutrino-nuclear ractions");
129  biasNuNuc->SetParameterName("NuNuc_Biasing", false);
130  biasNuNuc->SetRange("NuNuc_Biasing > 0.");
131  biasNuNuc->SetDefaultValue(1.);
133 }
134 
136 {
137  thePhoto = photo;
138 
139  weakDir = new G4UIdirectory("/CHIPS_physics/photoNuclear/");
140  weakDir->SetGuidance("weak (neutrino) processes");
141 
142  // use G4UIcmdWithADouble for weighting of processes
143 
144  // command for synchrotron radiation.
145  theSynchR = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/SynchRadiation",this);
146  theSynchR->SetGuidance("Switching on/off synchrotron radiation.");
147  theSynchR->SetParameterName("status",false);
148  theSynchR->SetCandidates("on off");
149  theSynchR->SetDefaultValue("off");
151 
152  minGamSR = new G4UIcmdWithADouble("/CHIPS_physics/photoNuclear/MinGamma_SynchRad", this);
153  minGamSR->SetGuidance("Set a minimum gamma for Synchratron Radiation");
154  minGamSR->SetParameterName("MinGamma_SynchRad", false);
155  minGamSR->SetRange("MinGamma_SynchRad >> 1.");
156  minGamSR->SetDefaultValue(227.);
158 
159  // command for gamma-nuclear physics.
160  theGamN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/GammaNuclear",this);
161  theGamN->SetGuidance("Switching of gamma-nuclear physics.");
162  theGamN->SetParameterName("status",false);
163  theGamN->SetCandidates("on off");
164  theGamN->SetDefaultValue("on");
166 
167  // command for electro-nuclear physics.
168  theEleN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/ElectroNuclear",this);
169  theEleN->SetGuidance("Switching of electron-nuclear physics.");
170  theEleN->SetParameterName("status",false);
171  theEleN->SetCandidates("on off");
172  theEleN->SetDefaultValue("off");
174 
175  // command for muon-nuclear physics.
176  theMuoN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/MuonNuclear",this);
177  theMuoN->SetGuidance("Switching of muon nuclear physics.");
178  theMuoN->SetParameterName("status",false);
179  theMuoN->SetCandidates("on off");
180  theMuoN->SetDefaultValue("off");
182 
183  // command for tau-nuclear physics.
184  theTauN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/TauNuclear",this);
185  theTauN->SetGuidance("Switching of tau nuclear physics.");
186  theTauN->SetParameterName("status",false);
187  theTauN->SetCandidates("on off");
188  theTauN->SetDefaultValue("off");
190 
191 
192  biasPhotoN = new G4UIcmdWithADouble("/CHIPS_physics/photoNuclear/PhotoN_Biasing", this);
193  biasPhotoN->SetGuidance("Set a biasing coefficient for photo-nuclear ractions");
194  biasPhotoN->SetParameterName("PhotoN_Biasing", false);
195  biasPhotoN->SetRange("PhotoN_Biasing > 0.");
196  biasPhotoN->SetDefaultValue(1.);
198 }
199 
201 {
202  if(photoDir)
203  {
204  if (aComm==theSynchR) thePhoto->SetSynchRadOnOff(aS);
205  else if(aComm==minGamSR) thePhoto->SetMinGammaSR(minGamSR->GetNewDoubleValue(aS));
206  else if(aComm==theGamN) thePhoto->SetGammaNuclearOnOff(aS);
207  else if(aComm==theMuoN) thePhoto->SetElPosNuclearOnOff(aS);
208  else if(aComm==theMuoN) thePhoto->SetMuonNuclearOnOff(aS);
209  else if(aComm==theMuoN) thePhoto->SetTauNuclearOnOff(aS);
210  else if(aComm==biasPhotoN)thePhoto->SetPhotoNucBias(biasPhotoN->GetNewDoubleValue(aS));
211  }
212  else if(weakDir)
213  {
214  if (aComm==theNuElN) theWeak->SetNuElNuclearOnOff(aS);
215  else if(aComm==theNuMuN) theWeak->SetNuMuNuclearOnOff(aS);
216  else if(aComm==theNuTaN) theWeak->SetNuTauNuclearOnOff(aS);
217  else if(aComm==biasNuNuc) theWeak->SetNuNuclearBias(biasNuNuc->GetNewDoubleValue(aS));
218  }
219 }
220 
222 {
223  if(photoDir)
224  {
225  if (aComm==theSynchR) return thePhoto->GetSynchRadOnOff();
226  else if(aComm==theGamN) return thePhoto->GetGammaNuclearOnOff();
227  else if(aComm==theEleN) return thePhoto->GetElPosNuclearOnOff();
228  else if(aComm==theMuoN) return thePhoto->GetMuonNuclearOnOff();
229  else if(aComm==theTauN) return thePhoto->GetTauNuclearOnOff();
230  }
231  else if(weakDir)
232  {
233  if (aComm==theNuElN) return theWeak->GetNuElNuclearOnOff();
234  else if(aComm==theNuMuN) return theWeak->GetNuMuNuclearOnOff();
235  else if(aComm==theNuTaN) return theWeak->GetNuTauNuclearOnOff();
236  }
237  return "not_defined";
238 }