G4EmQExtraPhysics.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:   G4EmQExtraPhysics
00031 //
00032 // Author: 16-Oct-2012 A. Ribon
00033 //         Copied from the original G4EmExtraPhysics and renamed
00034 //
00035 // Modified:
00036 //
00037 //----------------------------------------------------------------------------
00038 //
00039 
00040 #include "G4EmQExtraPhysics.hh"
00041 
00042 #include "G4SystemOfUnits.hh"
00043 #include "G4SynchrotronRadiation.hh"
00044 
00045 #include "G4ParticleDefinition.hh"
00046 #include "G4ParticleTable.hh"
00047 #include "G4Gamma.hh"
00048 #include "G4Electron.hh"
00049 #include "G4Positron.hh"
00050 #include "G4MuonPlus.hh"
00051 #include "G4MuonMinus.hh"
00052 #include "G4ProcessManager.hh"
00053 #include "G4BuilderType.hh"
00054 #include "G4HadronicDeprecate.hh"
00055 
00056 // factory
00057 #include "G4PhysicsConstructorFactory.hh"
00058 //
00059 G4_DECLARE_PHYSCONSTR_FACTORY(G4EmQExtraPhysics);
00060 
00061 G4EmQExtraPhysics::G4EmQExtraPhysics(G4int ver): 
00062   G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false), 
00063   munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false), 
00064   theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
00065   verbose(ver)
00066 {
00067   G4HadronicDeprecate("G4EmQExtraPhysics");
00068   theMessenger = new G4EmQMessenger(this);
00069   SetPhysicsType(bEmExtra);
00070 }
00071 
00072 G4EmQExtraPhysics::G4EmQExtraPhysics(const G4String&): 
00073   G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false), 
00074   munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false), 
00075   theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
00076   verbose(1)
00077 {
00078   G4HadronicDeprecate("G4EmQExtraPhysics");
00079   theMessenger = new G4EmQMessenger(this);
00080   SetPhysicsType(bEmExtra);
00081 }
00082 
00083 G4EmQExtraPhysics::~G4EmQExtraPhysics()
00084 {
00085   delete theMessenger;
00086   delete theElectronSynch;
00087   delete thePositronSynch;
00088   delete theGNPhysics;
00089   delete muNucProcess;
00090   delete muNucModel;
00091 }
00092 
00093 void G4EmQExtraPhysics::Synch(G4String & newState)
00094 {
00095   if(newState == "on" || newState == "ON") {
00096     synchOn = true;
00097     if(wasBuilt) BuildSynch();
00098   } else synchOn = false;
00099 }
00100 
00101 void G4EmQExtraPhysics::GammaNuclear(G4String & newState)
00102 {
00103   if(newState == "on" || newState == "ON") {
00104     gammNucOn = true;
00105     if(wasBuilt) BuildGammaNuclear();
00106   } else  gammNucOn = false;
00107 }
00108 
00109 void G4EmQExtraPhysics::MuonNuclear(G4String & newState)
00110 {
00111   if(newState == "on" || newState == "ON") {
00112     muNucOn = true;
00113     if(wasBuilt) BuildMuonNuclear();
00114   } else muNucOn = false;
00115 }
00116 
00117 void G4EmQExtraPhysics::ConstructParticle()
00118 {
00119   G4Gamma::Gamma();
00120   G4Electron::Electron();
00121   G4Positron::Positron();
00122   G4MuonPlus::MuonPlus();
00123   G4MuonMinus::MuonMinus();
00124 }
00125 
00126 void G4EmQExtraPhysics::ConstructProcess()
00127 {
00128   if(wasBuilt) return;
00129   wasBuilt = true;
00130 
00131   if (synchOn)   BuildSynch();
00132   if (gammNucOn) BuildGammaNuclear();
00133   if (muNucOn)   BuildMuonNuclear();
00134 }
00135 
00136 void G4EmQExtraPhysics::BuildMuonNuclear()
00137 {
00138   if(munActivated) return;
00139   munActivated = true;
00140   G4ProcessManager * pManager = 0;
00141 
00142   muNucProcess = new G4MuonNuclearProcess();
00143   muNucModel = new G4MuonVDNuclearModel();
00144   muNucProcess->RegisterMe(muNucModel);
00145 
00146   pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
00147   pManager->AddDiscreteProcess(muNucProcess);
00148 
00149   pManager = G4MuonMinus::MuonMinus()->GetProcessManager();
00150   pManager->AddDiscreteProcess(muNucProcess);
00151 }
00152 
00153 void G4EmQExtraPhysics::BuildGammaNuclear()
00154 {
00155   if(gnActivated) return;
00156   gnActivated = true;
00157 
00158   theGNPhysics = new G4ElectroNuclearBuilder();
00159   theGNPhysics->Build();
00160 }
00161 
00162 void G4EmQExtraPhysics::BuildSynch()
00163 {
00164   if(synActivated) return;
00165   synActivated = true;
00166   G4ProcessManager * pManager = 0;
00167 
00168   pManager = G4Electron::Electron()->GetProcessManager();
00169   theElectronSynch = new G4SynchrotronRadiation();
00170   pManager->AddDiscreteProcess(theElectronSynch);
00171 
00172   pManager = G4Positron::Positron()->GetProcessManager();
00173   thePositronSynch = new G4SynchrotronRadiation();
00174   pManager->AddDiscreteProcess(thePositronSynch);
00175 }

Generated on Mon May 27 17:48:09 2013 for Geant4 by  doxygen 1.4.7