G4QPhotoNuclearPhysics.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:   G4QPhotoNuclearPhysics
00031 //
00032 // Author: 2009 M. V. Kosov
00033 //
00034 // Modified:
00035 //
00036 //----------------------------------------------------------------------------
00037 //
00038 
00039 #include "G4QPhotoNuclearPhysics.hh"
00040 
00041 
00042 G4QPhotoNuclearPhysics::G4QPhotoNuclearPhysics(G4int): 
00043   G4VPhysicsConstructor("CHIPS photo-nuclear"), wasBuilt(false), SynchRActivated(false),
00044   GamNucActivated(false), EleNucActivated(false), MuoNucActivated(false),
00045   TauNucActivated(false), synchrOn(true), synchrMinGam(227.), gamNucOn(true),
00046   eleNucOn(true), muoNucOn(true), tauNucOn(true), photoNucBias(1.)
00047 {
00048   theMessenger = G4QMessenger::GetPointer();
00049   theMessenger->Add(this);
00050 }
00051 
00052 G4QPhotoNuclearPhysics::G4QPhotoNuclearPhysics(const G4String& name): 
00053   G4VPhysicsConstructor(name), wasBuilt(false), SynchRActivated(false),
00054   GamNucActivated(false), EleNucActivated(false), MuoNucActivated(false),
00055   TauNucActivated(false), synchrOn(true), synchrMinGam(227.), gamNucOn(true),
00056   eleNucOn(true), muoNucOn(true), tauNucOn(true), photoNucBias(1.)
00057 {
00058   theMessenger = G4QMessenger::GetPointer();
00059   theMessenger->Add(this);
00060 }
00061 
00062 G4QPhotoNuclearPhysics::~G4QPhotoNuclearPhysics()
00063 {
00064   if(wasBuilt)
00065   {
00066     delete inelastic;
00067     if(synchrOn) delete synchrad;
00068   }
00069 }
00070 
00071 void G4QPhotoNuclearPhysics::SetSynchRadOnOff(G4String& newSwitch)
00072 {
00073   if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
00074   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") synchrOn = true;
00075   else synchrOn = false;
00076 }
00077 
00078 void G4QPhotoNuclearPhysics::SetGammaNuclearOnOff(G4String& newSwitch)
00079 {
00080   if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
00081   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") gamNucOn = true;
00082   else gamNucOn = false;
00083 }
00084 
00085 void G4QPhotoNuclearPhysics::SetElPosNuclearOnOff(G4String& newSwitch)
00086 {
00087   if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
00088   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") eleNucOn = true;
00089   else eleNucOn = false;
00090 }
00091 
00092 void G4QPhotoNuclearPhysics::SetMuonNuclearOnOff(G4String& newSwitch)
00093 {
00094   if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
00095   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") muoNucOn = true;
00096   else muoNucOn = false;
00097 }
00098 
00099 void G4QPhotoNuclearPhysics::SetTauNuclearOnOff(G4String& newSwitch)
00100 {
00101   if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
00102   else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") tauNucOn = true;
00103   else tauNucOn = false;
00104 }
00105 
00106 void G4QPhotoNuclearPhysics::SetMinGammaSR(G4double newValue)
00107 {
00108   if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
00109   else synchrMinGam = newValue;
00110 }
00111 
00112 void G4QPhotoNuclearPhysics::SetPhotoNucBias(G4double newValue)
00113 {
00114   if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
00115   else photoNucBias = newValue;
00116 }
00117 
00118 void G4QPhotoNuclearPhysics::ConstructParticle()
00119 {
00120   G4Gamma::Gamma();
00121   G4Electron::Electron();
00122   G4Positron::Positron();
00123   G4MuonPlus::MuonPlus();
00124   G4MuonMinus::MuonMinus();
00125   G4TauPlus::TauPlus();
00126   G4TauMinus::TauMinus();
00127   if (synchrOn)
00128   {
00129     G4MesonConstructor pMesonConstructor;
00130     pMesonConstructor.ConstructParticle();
00131 
00132     G4BaryonConstructor pBaryonConstructor;
00133     pBaryonConstructor.ConstructParticle();
00134   }
00135 }
00136 
00137 void G4QPhotoNuclearPhysics::ConstructProcess()
00138 {
00139   if(wasBuilt) return;
00140   wasBuilt = true;
00141 
00142   inelastic = new G4QInelastic("photoNuclear");
00143   inelastic->SetPhotNucBias(photoNucBias);
00144 
00145   if (synchrOn)   BuildSynchRad();
00146   if (gamNucOn)   BuildGammaNuclear();
00147   if (eleNucOn)   BuildElectroNuclear();
00148   if (muoNucOn)   BuildMuonNuclear();
00149   if (tauNucOn)   BuildTauNuclear();
00150 }
00151 
00152 void G4QPhotoNuclearPhysics::BuildGammaNuclear()
00153 {
00154   if(GamNucActivated) return;
00155   GamNucActivated = true;
00156   G4ProcessManager* pManager  = G4Gamma::Gamma()->GetProcessManager();
00157   pManager->AddDiscreteProcess(inelastic);
00158 }
00159 
00160 void G4QPhotoNuclearPhysics::BuildElectroNuclear()
00161 {
00162   if(EleNucActivated) return;
00163   EleNucActivated = true;
00164   G4ProcessManager * pManager = 0;
00165 
00166   pManager  = G4Electron::Electron()->GetProcessManager();
00167   pManager->AddDiscreteProcess(inelastic);
00168 
00169   pManager  = G4Positron::Positron()->GetProcessManager();
00170   pManager->AddDiscreteProcess(inelastic);
00171 }
00172 
00173 void G4QPhotoNuclearPhysics::BuildMuonNuclear()
00174 {
00175   if(MuoNucActivated) return;
00176   MuoNucActivated = true;
00177   G4ProcessManager * pManager = 0;
00178 
00179   pManager  = G4MuonPlus::MuonPlus()->GetProcessManager();
00180   pManager->AddDiscreteProcess(inelastic);
00181 
00182   pManager  = G4MuonMinus::MuonMinus()->GetProcessManager();
00183   pManager->AddDiscreteProcess(inelastic);
00184 }
00185 
00186 void G4QPhotoNuclearPhysics::BuildTauNuclear()
00187 {
00188   if(TauNucActivated) return;
00189   TauNucActivated = true;
00190   G4ProcessManager * pManager = 0;
00191 
00192   pManager  = G4TauPlus::TauPlus()->GetProcessManager();
00193   pManager->AddDiscreteProcess(inelastic);
00194 
00195   pManager  = G4TauMinus::TauMinus()->GetProcessManager();
00196   pManager->AddDiscreteProcess(inelastic);
00197 }
00198 
00199 // The CHIPS Synchrotron radiation process is working for all charged particles
00200 void G4QPhotoNuclearPhysics::BuildSynchRad()
00201 {
00202   if(SynchRActivated) return;
00203   SynchRActivated = true;
00204   synchrad = new G4QSynchRad();
00205   theParticleIterator->reset();
00206   while( (*theParticleIterator)() )
00207   {
00208     G4ParticleDefinition* particle = theParticleIterator->value();
00209     G4double charge = particle->GetPDGCharge();
00210     if(charge != 0.0)
00211     {
00212       G4ProcessManager* pmanager = particle->GetProcessManager();
00213       pmanager->AddDiscreteProcess(synchrad);
00214     }
00215   }
00216 }

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