Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
45 #include "G4ParticleDefinition.hh"
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"
54 #include "G4HadronicDeprecate.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 {
119  G4Gamma::Gamma();
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 
136 void 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 
146  pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
147  pManager->AddDiscreteProcess(muNucProcess);
148 
150  pManager->AddDiscreteProcess(muNucProcess);
151 }
152 
153 void G4EmQExtraPhysics::BuildGammaNuclear()
154 {
155  if(gnActivated) return;
156  gnActivated = true;
157 
158  theGNPhysics = new G4ElectroNuclearBuilder();
159  theGNPhysics->Build();
160 }
161 
162 void G4EmQExtraPhysics::BuildSynch()
163 {
164  if(synActivated) return;
165  synActivated = true;
166  G4ProcessManager * pManager = 0;
167 
168  pManager = G4Electron::Electron()->GetProcessManager();
169  theElectronSynch = new G4SynchrotronRadiation();
170  pManager->AddDiscreteProcess(theElectronSynch);
171 
172  pManager = G4Positron::Positron()->GetProcessManager();
173  thePositronSynch = new G4SynchrotronRadiation();
174  pManager->AddDiscreteProcess(thePositronSynch);
175 }