G4QNeutrinoPhysics.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:   G4QNeutrinoPhysics
00031 //
00032 // Author: 2009 M. V. Kosov
00033 //
00034 // Modified:
00035 //
00036 //----------------------------------------------------------------------------
00037 //
00038 
00039 #include "G4QNeutrinoPhysics.hh"
00040 
00041 G4QNeutrinoPhysics::G4QNeutrinoPhysics(G4int): 
00042   G4VPhysicsConstructor("CHIPS neutrino-nuclear"), wasBuilt(false), nuEleActivated(false),
00043   nuMuoActivated(false), nuTauActivated(false), nuEleOn(false),
00044   nuMuoOn(false), nuTauOn(false), nuNucBias(1.), inelastic(0)
00045 {
00046   theMessenger = G4QMessenger::GetPointer();
00047   theMessenger->Add(this);
00048 }
00049 
00050 G4QNeutrinoPhysics::G4QNeutrinoPhysics(const G4String& name): 
00051   G4VPhysicsConstructor(name), wasBuilt(false), nuEleActivated(false),
00052   nuMuoActivated(false), nuTauActivated(false), nuEleOn(false),
00053   nuMuoOn(false), nuTauOn(false), nuNucBias(1.), inelastic(0)
00054 {
00055   theMessenger = G4QMessenger::GetPointer();
00056   theMessenger->Add(this);
00057 }
00058 
00059 G4QNeutrinoPhysics::~G4QNeutrinoPhysics()
00060 {
00061   if(wasBuilt && inelastic) delete inelastic;
00062 }
00063 
00064 void G4QNeutrinoPhysics::ConstructParticle()
00065 {
00066   G4NeutrinoE::NeutrinoE();
00067   G4AntiNeutrinoE::AntiNeutrinoE();
00068   G4NeutrinoMu::NeutrinoMu();
00069   G4AntiNeutrinoMu::AntiNeutrinoMu();
00070   G4NeutrinoTau::NeutrinoTau();
00071   G4AntiNeutrinoTau::AntiNeutrinoTau();
00072 }
00073 
00074 void G4QNeutrinoPhysics::SetNuElNuclearOnOff(G4String& newSwitch)
00075 {
00076   if(wasBuilt) G4cout<<"G4QNeutrinoPhysics:No, processes are already builded!"<<G4endl;
00077   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") nuEleOn = true;
00078   else nuEleOn = false;
00079 }
00080 
00081 void G4QNeutrinoPhysics::SetNuMuNuclearOnOff(G4String& newSwitch)
00082 {
00083   if(wasBuilt) G4cout<<"G4QNeutrinoPhysics:No, processes are already builded!"<<G4endl;
00084   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") nuMuoOn = true;
00085   else nuMuoOn = false;
00086 }
00087 
00088 void G4QNeutrinoPhysics::SetNuTauNuclearOnOff(G4String& newSwitch)
00089 {
00090   if(wasBuilt) G4cout<<"G4QNeutrinoPhysics:No, processes are already builded!"<<G4endl;
00091   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") nuTauOn = true;
00092   else nuTauOn = false;
00093 }
00094 
00095 void G4QNeutrinoPhysics::SetNuNuclearBias(G4double newValue)
00096 {
00097   if(wasBuilt) G4cout<<"G4QNeutrinoPhysics:No, processes are already builded!"<<G4endl;
00098   else nuNucBias = newValue;
00099 }
00100 
00101 void G4QNeutrinoPhysics::ConstructProcess()
00102 {
00103   if(wasBuilt) return;
00104   if(nuEleOn || nuMuoOn || nuTauOn)
00105   {
00106     wasBuilt = true;
00107     G4cout<<"Builded=>G4QNeutrinoPhysics: "<<nuEleOn<<", "<<nuMuoOn<<", "<<nuTauOn<<G4endl;
00108     inelastic = new G4QInelastic("neutrinoNuclear");
00109     inelastic->SetWeakNucBias(nuNucBias); // enough only once (static)
00110     if (nuEleOn)   BuildNuEleNuclear();
00111     if (nuMuoOn)   BuildNuMuoNuclear();
00112     if (nuTauOn)   BuildNuTauNuclear();
00113   }
00114 }
00115 
00116 void G4QNeutrinoPhysics::BuildNuEleNuclear()
00117 {
00118   if(nuEleActivated) return;
00119   nuEleActivated = true;
00120   G4ProcessManager * pManager = 0;
00121 
00122   pManager  = G4NeutrinoE::NeutrinoE()->GetProcessManager();
00123   pManager->AddDiscreteProcess(inelastic);
00124 
00125   pManager  = G4AntiNeutrinoE::AntiNeutrinoE()->GetProcessManager();
00126   pManager->AddDiscreteProcess(inelastic);
00127 }
00128 
00129 void G4QNeutrinoPhysics::BuildNuMuoNuclear()
00130 {
00131   if(nuMuoActivated) return;
00132   nuMuoActivated = true;
00133   G4ProcessManager * pManager = 0;
00134 
00135   pManager  = G4NeutrinoMu::NeutrinoMu()->GetProcessManager();
00136   pManager->AddDiscreteProcess(inelastic);
00137 
00138   pManager  = G4AntiNeutrinoMu::AntiNeutrinoMu()->GetProcessManager();
00139   pManager->AddDiscreteProcess(inelastic);
00140 }
00141 
00142 void G4QNeutrinoPhysics::BuildNuTauNuclear()
00143 {
00144   if(nuTauActivated) return;
00145   nuTauActivated = true;
00146   G4ProcessManager * pManager = 0;
00147 
00148   pManager  = G4NeutrinoTau::NeutrinoTau()->GetProcessManager();
00149   pManager->AddDiscreteProcess(inelastic);
00150 
00151   pManager  = G4AntiNeutrinoTau::AntiNeutrinoTau()->GetProcessManager();
00152   pManager->AddDiscreteProcess(inelastic);
00153 }

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