Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4EmExtraPhysics.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: G4EmExtraPhysics
31//
32// Author: 2002 J.P. Wellisch
33//
34// Modified:
35// 10.11.2005 V.Ivanchenko edit to provide a standard
36// 19.06.2006 V.Ivanchenko add mu-nuclear process
37// 16.10.2012 A.Ribon: renamed G4EmExtraBertiniPhysics as G4EmExtraPhysics
38//
39//----------------------------------------------------------------------------
40//
41
42#include "G4EmExtraPhysics.hh"
43
44#include "G4SystemOfUnits.hh"
46
48#include "G4ParticleTable.hh"
49#include "G4Gamma.hh"
50#include "G4Electron.hh"
51#include "G4Positron.hh"
52#include "G4MuonPlus.hh"
53#include "G4MuonMinus.hh"
54#include "G4ProcessManager.hh"
55#include "G4BuilderType.hh"
56
57// factory
59//
61
62
64 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
65 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
66 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
67 verbose(ver)
68{
69 theMessenger = new G4EmMessenger(this);
71}
72
74 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
75 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
76 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
77 verbose(1)
78{
79 theMessenger = new G4EmMessenger(this);
81}
82
84{
85 delete theMessenger;
86 delete theElectronSynch;
87 delete thePositronSynch;
88 delete theGNPhysics;
89 delete muNucProcess;
90 delete muNucModel;
91}
92
94{
95 if(newState == "on" || newState == "ON") {
96 synchOn = true;
97 if(wasBuilt) BuildSynch();
98 } else synchOn = false;
99}
100
102{
103 if(newState == "on" || newState == "ON") {
104 gammNucOn = true;
105 if(wasBuilt) BuildGammaNuclear();
106 } else gammNucOn = false;
107}
108
110{
111 if(newState == "on" || newState == "ON") {
112 muNucOn = true;
113 if(wasBuilt) BuildMuonNuclear();
114 } else muNucOn = false;
115}
116
118{
124}
125
127{
128 if(wasBuilt) return;
129 wasBuilt = true;
130
131 if (synchOn) BuildSynch();
132 if (gammNucOn) BuildGammaNuclear();
133 if (muNucOn) BuildMuonNuclear();
134}
135
136void G4EmExtraPhysics::BuildMuonNuclear()
137{
138 if(munActivated) return;
139 munActivated = true;
140 G4ProcessManager * pManager = 0;
141
142 muNucProcess = new G4MuonNuclearProcess();
143 muNucModel = new G4MuonVDNuclearModel();
144 muNucProcess->RegisterMe(muNucModel);
145
147 pManager->AddDiscreteProcess(muNucProcess);
148
150 pManager->AddDiscreteProcess(muNucProcess);
151}
152
153void G4EmExtraPhysics::BuildGammaNuclear()
154{
155 if(gnActivated) return;
156 gnActivated = true;
157
158 theGNPhysics = new G4BertiniElectroNuclearBuilder();
159 theGNPhysics->Build();
160}
161
162void G4EmExtraPhysics::BuildSynch()
163{
164 if(synActivated) return;
165 synActivated = true;
166 G4ProcessManager * pManager = 0;
167
169 theElectronSynch = new G4SynchrotronRadiation();
170 pManager->AddDiscreteProcess(theElectronSynch);
171
173 thePositronSynch = new G4SynchrotronRadiation();
174 pManager->AddDiscreteProcess(thePositronSynch);
175}
@ bEmExtra
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
int G4int
Definition: G4Types.hh:66
static G4Electron * Electron()
Definition: G4Electron.cc:94
void MuonNuclear(G4String &aState)
G4EmExtraPhysics(G4int ver=1)
void GammaNuclear(G4String &aState)
virtual ~G4EmExtraPhysics()
void Synch(G4String &aState)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void RegisterMe(G4HadronicInteraction *a)
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:100
static G4MuonPlus * MuonPlus()
Definition: G4MuonPlus.cc:99
G4ProcessManager * GetProcessManager() const
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)