Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EmQExtraPhysics.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: G4EmQExtraPhysics
31//
32// Author: 16-Oct-2012 A. Ribon
33// Copied from the original G4EmExtraPhysics and renamed
34//
35// Modified:
36//
37//----------------------------------------------------------------------------
38//
39
40#include "G4EmQExtraPhysics.hh"
41
42#include "G4SystemOfUnits.hh"
44
46#include "G4ParticleTable.hh"
47#include "G4Gamma.hh"
48#include "G4Electron.hh"
49#include "G4Positron.hh"
50#include "G4MuonPlus.hh"
51#include "G4MuonMinus.hh"
52#include "G4ProcessManager.hh"
53#include "G4BuilderType.hh"
55
56// factory
58//
60
62 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
63 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
64 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
65 verbose(ver)
66{
67 G4HadronicDeprecate("G4EmQExtraPhysics");
68 theMessenger = new G4EmQMessenger(this);
70}
71
73 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
74 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
75 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
76 verbose(1)
77{
78 G4HadronicDeprecate("G4EmQExtraPhysics");
79 theMessenger = new G4EmQMessenger(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 G4EmQExtraPhysics::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 G4EmQExtraPhysics::BuildGammaNuclear()
154{
155 if(gnActivated) return;
156 gnActivated = true;
157
158 theGNPhysics = new G4ElectroNuclearBuilder();
159 theGNPhysics->Build();
160}
161
162void G4EmQExtraPhysics::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 G4HadronicDeprecate(name)
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
int G4int
Definition: G4Types.hh:66
static G4Electron * Electron()
Definition: G4Electron.cc:94
virtual ~G4EmQExtraPhysics()
G4EmQExtraPhysics(G4int ver=1)
void Synch(G4String &aState)
void GammaNuclear(G4String &aState)
void MuonNuclear(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)