G4QMessenger.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 //---------------------------------------------------------------------------
00029 //
00030 // ClassName:   G4QMessenger
00031 //
00032 // Author: 2009 M. V. Kossov
00033 //
00034 // Modified:
00035 //
00036 //----------------------------------------------------------------------------
00037 //
00038 
00039 #include "G4QMessenger.hh"
00040 #include "G4QNeutrinoPhysics.hh"
00041 #include "G4QPhotoNuclearPhysics.hh"
00042 
00043 G4QMessenger::G4QMessenger()
00044 {
00045   rootDir = new G4UIdirectory("/CHIPS_physics/");
00046   rootDir->SetGuidance("messenger of the CHIPS processes");
00047   weakDir=0;
00048   theWeak=0;
00049   theNuElN=0;
00050   theNuMuN=0;
00051   theNuTaN=0;
00052   biasNuNuc=0;
00053   photoDir=0;
00054   thePhoto=0;
00055   theSynchR=0;
00056   minGamSR=0;
00057   theGamN=0;
00058   theEleN=0;
00059   theMuoN=0;
00060   theTauN=0;
00061   biasPhotoN=0;
00062 }
00063 
00064 G4QMessenger::~G4QMessenger()
00065 {
00066   delete rootDir;
00067   if(photoDir)
00068   {
00069     delete photoDir;
00070     delete theSynchR;
00071     delete minGamSR;
00072     delete theGamN;
00073     delete theEleN;
00074     delete theMuoN;
00075     delete theTauN;
00076     delete biasPhotoN;
00077   }
00078   else if(weakDir)
00079   {
00080     delete weakDir;
00081     delete theNuElN;
00082     delete theNuMuN;
00083     delete theNuTaN;
00084     delete biasNuNuc;
00085   }
00086 }
00087 
00088 // Returns Pointer to the G4QMessenger class
00089 G4QMessenger* G4QMessenger::GetPointer()
00090 {
00091   static G4QMessenger theMessenger; //**Static body of CHIPS Messenger**
00092   return &theMessenger;
00093 }
00094 
00095 void G4QMessenger::Add(G4QNeutrinoPhysics* weak)
00096 {
00097   theWeak = weak;
00098 
00099   weakDir = new G4UIdirectory("/CHIPS_physics/neutrino/");
00100   weakDir->SetGuidance("weak (neutrino) processes");
00101 
00102   // commands for neutrino_el-nuclear physics.
00103   theNuElN = new G4UIcmdWithAString("/CHIPS_physics/neutrino/NuElNuclear",this);
00104   theNuElN->SetGuidance("Switching of nu_el-nuclear physics.");
00105   theNuElN->SetParameterName("status",false);
00106   theNuElN->SetCandidates("on off");
00107   theNuElN->SetDefaultValue("off");
00108   theNuElN->AvailableForStates(G4State_PreInit, G4State_Idle);
00109 
00110   // commands for neutrino_mu-nuclear physics.
00111   theNuMuN = new G4UIcmdWithAString("/CHIPS_physics/neutrino/NuMuNuclear",this);
00112   theNuMuN->SetGuidance("Switching of nu_mu-nuclear physics.");
00113   theNuMuN->SetParameterName("status",false);
00114   theNuMuN->SetCandidates("on off");
00115   theNuMuN->SetDefaultValue("off");
00116   theNuMuN->AvailableForStates(G4State_PreInit, G4State_Idle);
00117 
00118   // commands for neutrino_tau-nuclear physics.
00119   theNuTaN = new G4UIcmdWithAString("/CHIPS_physics/neutrino/NuTauNuclear",this);
00120   theNuTaN->SetGuidance("Switching of nu_tau-nuclear physics.");
00121   theNuTaN->SetParameterName("status",false);
00122   theNuTaN->SetCandidates("on off");
00123   theNuTaN->SetDefaultValue("off");
00124   theNuTaN->AvailableForStates(G4State_PreInit, G4State_Idle);
00125 
00126   // command for biasing of neutrino-nuclear reactions
00127   biasNuNuc = new G4UIcmdWithADouble("/CHIPS_physics/neutrino/NuNuc_Biasing", this);  
00128   biasNuNuc->SetGuidance("Set a biasing coefficient for neutrino-nuclear ractions");
00129   biasNuNuc->SetParameterName("NuNuc_Biasing", false);
00130   biasNuNuc->SetRange("NuNuc_Biasing > 0.");
00131   biasNuNuc->SetDefaultValue(1.);
00132   biasNuNuc->AvailableForStates(G4State_PreInit, G4State_Idle);
00133 }
00134 
00135 void G4QMessenger::Add(G4QPhotoNuclearPhysics* photo)
00136 {
00137   thePhoto = photo;
00138 
00139   weakDir = new G4UIdirectory("/CHIPS_physics/photoNuclear/");
00140   weakDir->SetGuidance("weak (neutrino) processes");
00141 
00142   // use G4UIcmdWithADouble for weighting of processes
00143 
00144   // command for synchrotron radiation.
00145   theSynchR = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/SynchRadiation",this);
00146   theSynchR->SetGuidance("Switching on/off synchrotron radiation.");
00147   theSynchR->SetParameterName("status",false);
00148   theSynchR->SetCandidates("on off");
00149   theSynchR->SetDefaultValue("off");
00150   theSynchR->AvailableForStates(G4State_PreInit, G4State_Idle);
00151 
00152   minGamSR = new G4UIcmdWithADouble("/CHIPS_physics/photoNuclear/MinGamma_SynchRad", this);
00153   minGamSR->SetGuidance("Set a minimum gamma for Synchratron Radiation");
00154   minGamSR->SetParameterName("MinGamma_SynchRad", false);
00155   minGamSR->SetRange("MinGamma_SynchRad >> 1.");
00156   minGamSR->SetDefaultValue(227.);
00157   minGamSR->AvailableForStates(G4State_PreInit, G4State_Idle);
00158 
00159   // command for gamma-nuclear physics.
00160   theGamN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/GammaNuclear",this);
00161   theGamN->SetGuidance("Switching of gamma-nuclear physics.");
00162   theGamN->SetParameterName("status",false);
00163   theGamN->SetCandidates("on off");
00164   theGamN->SetDefaultValue("on");
00165   theGamN->AvailableForStates(G4State_PreInit, G4State_Idle);
00166 
00167   // command for electro-nuclear physics.
00168   theEleN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/ElectroNuclear",this);
00169   theEleN->SetGuidance("Switching of electron-nuclear physics.");
00170   theEleN->SetParameterName("status",false);
00171   theEleN->SetCandidates("on off");
00172   theEleN->SetDefaultValue("off");
00173   theEleN->AvailableForStates(G4State_PreInit, G4State_Idle);
00174 
00175   // command for muon-nuclear physics.
00176   theMuoN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/MuonNuclear",this);
00177   theMuoN->SetGuidance("Switching of muon nuclear physics.");
00178   theMuoN->SetParameterName("status",false);
00179   theMuoN->SetCandidates("on off");
00180   theMuoN->SetDefaultValue("off");
00181   theMuoN->AvailableForStates(G4State_PreInit, G4State_Idle);
00182 
00183   // command for tau-nuclear physics.
00184   theTauN = new G4UIcmdWithAString("/CHIPS_physics/photoNuclear/TauNuclear",this);
00185   theTauN->SetGuidance("Switching of tau nuclear physics.");
00186   theTauN->SetParameterName("status",false);
00187   theTauN->SetCandidates("on off");
00188   theTauN->SetDefaultValue("off");
00189   theTauN->AvailableForStates(G4State_PreInit, G4State_Idle);
00190 
00191 
00192   biasPhotoN = new G4UIcmdWithADouble("/CHIPS_physics/photoNuclear/PhotoN_Biasing", this);
00193   biasPhotoN->SetGuidance("Set a biasing coefficient for photo-nuclear ractions");
00194   biasPhotoN->SetParameterName("PhotoN_Biasing", false);
00195   biasPhotoN->SetRange("PhotoN_Biasing > 0.");
00196   biasPhotoN->SetDefaultValue(1.);
00197   biasPhotoN->AvailableForStates(G4State_PreInit, G4State_Idle);
00198 }
00199 
00200 void G4QMessenger::SetNewValue(G4UIcommand* aComm, G4String aS)
00201 {
00202   if(photoDir)
00203   {
00204     if     (aComm==theSynchR) thePhoto->SetSynchRadOnOff(aS);
00205     else if(aComm==minGamSR)  thePhoto->SetMinGammaSR(minGamSR->GetNewDoubleValue(aS));
00206     else if(aComm==theGamN)   thePhoto->SetGammaNuclearOnOff(aS);
00207     else if(aComm==theMuoN)   thePhoto->SetElPosNuclearOnOff(aS);
00208     else if(aComm==theMuoN)   thePhoto->SetMuonNuclearOnOff(aS);
00209     else if(aComm==theMuoN)   thePhoto->SetTauNuclearOnOff(aS);
00210     else if(aComm==biasPhotoN)thePhoto->SetPhotoNucBias(biasPhotoN->GetNewDoubleValue(aS));
00211   }
00212   else if(weakDir)
00213   {
00214     if     (aComm==theNuElN)  theWeak->SetNuElNuclearOnOff(aS);
00215     else if(aComm==theNuMuN)  theWeak->SetNuMuNuclearOnOff(aS);
00216     else if(aComm==theNuTaN)  theWeak->SetNuTauNuclearOnOff(aS);
00217     else if(aComm==biasNuNuc) theWeak->SetNuNuclearBias(biasNuNuc->GetNewDoubleValue(aS));
00218   }
00219 }
00220 
00221 G4String G4QMessenger::GetCurrentValue(G4UIcommand* aComm)
00222 {
00223   if(photoDir)
00224   {
00225     if     (aComm==theSynchR) return thePhoto->GetSynchRadOnOff();
00226     else if(aComm==theGamN)   return thePhoto->GetGammaNuclearOnOff();
00227     else if(aComm==theEleN)   return thePhoto->GetElPosNuclearOnOff();
00228     else if(aComm==theMuoN)   return thePhoto->GetMuonNuclearOnOff();
00229     else if(aComm==theTauN)   return thePhoto->GetTauNuclearOnOff();
00230   }
00231   else if(weakDir)
00232   {
00233     if     (aComm==theNuElN)  return theWeak->GetNuElNuclearOnOff();
00234     else if(aComm==theNuMuN)  return theWeak->GetNuMuNuclearOnOff();
00235     else if(aComm==theNuTaN)  return theWeak->GetNuTauNuclearOnOff();
00236   }
00237   return "not_defined";
00238 }

Generated on Mon May 27 17:49:37 2013 for Geant4 by  doxygen 1.4.7