source: trunk/source/physics_lists/builders/src/G4EmExtraPhysics.cc@ 1328

Last change on this file since 1328 was 1315, checked in by garnier, 15 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 5.2 KB
Line 
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: G4EmExtraPhysics.cc,v 1.4 2010/06/02 17:21:29 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName: G4EmExtraPhysics
32//
33// Author: 2002 J.P. Wellisch
34//
35// Modified:
36// 10.11.2005 V.Ivanchenko edit to provide a standard
37// 19.06.2006 V.Ivanchenko add mu-nuclear process
38//
39//----------------------------------------------------------------------------
40//
41
42#include "G4EmExtraPhysics.hh"
43
44#include "G4SynchrotronRadiation.hh"
45
46#include "G4ParticleDefinition.hh"
47#include "G4ParticleTable.hh"
48#include "G4Gamma.hh"
49#include "G4Electron.hh"
50#include "G4Positron.hh"
51#include "G4MuonPlus.hh"
52#include "G4MuonMinus.hh"
53#include "G4ProcessManager.hh"
54
55G4EmExtraPhysics::G4EmExtraPhysics(G4int ver):
56 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
57 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
58 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), theMuNuc1(0), theMuNuc2(0),
59 verbose(ver)
60{
61 theMessenger = new G4EmMessenger(this);
62}
63
64G4EmExtraPhysics::G4EmExtraPhysics(const G4String&):
65 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
66 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
67 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), theMuNuc1(0), theMuNuc2(0),
68 verbose(1)
69{
70 theMessenger = new G4EmMessenger(this);
71}
72
73G4EmExtraPhysics::~G4EmExtraPhysics()
74{
75 delete theMessenger;
76 delete theElectronSynch;
77 delete thePositronSynch;
78 delete theGNPhysics;
79 delete theMuNuc1;
80 delete theMuNuc2;
81}
82
83void G4EmExtraPhysics::Synch(G4String & newState)
84{
85 if(newState == "on" || newState == "ON") {
86 synchOn = true;
87 if(wasBuilt) BuildSynch();
88 } else synchOn = false;
89}
90
91void G4EmExtraPhysics::GammaNuclear(G4String & newState)
92{
93 if(newState == "on" || newState == "ON") {
94 gammNucOn = true;
95 if(wasBuilt) BuildGammaNuclear();
96 } else gammNucOn = false;
97}
98
99void G4EmExtraPhysics::MuonNuclear(G4String & newState)
100{
101 if(newState == "on" || newState == "ON") {
102 muNucOn = true;
103 if(wasBuilt) BuildMuonNuclear();
104 } else muNucOn = false;
105}
106
107void G4EmExtraPhysics::ConstructParticle()
108{
109 G4Gamma::Gamma();
110 G4Electron::Electron();
111 G4Positron::Positron();
112 G4MuonPlus::MuonPlus();
113 G4MuonMinus::MuonMinus();
114}
115
116void G4EmExtraPhysics::ConstructProcess()
117{
118 if(wasBuilt) return;
119 wasBuilt = true;
120
121 if (synchOn) BuildSynch();
122 if (gammNucOn) BuildGammaNuclear();
123 if (muNucOn) BuildMuonNuclear();
124}
125
126void G4EmExtraPhysics::BuildMuonNuclear()
127{
128 if(munActivated) return;
129 munActivated = true;
130 G4ProcessManager * pManager = 0;
131
132 pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
133 theMuNuc1 = new G4MuNuclearInteraction("muNucl");
134 pManager->AddDiscreteProcess(theMuNuc1);
135
136 pManager = G4MuonMinus::MuonMinus()->GetProcessManager();
137 theMuNuc2 = new G4MuNuclearInteraction("muNucl");
138 pManager->AddDiscreteProcess(theMuNuc2);
139}
140
141void G4EmExtraPhysics::BuildGammaNuclear()
142{
143 if(gnActivated) return;
144 gnActivated = true;
145
146 theGNPhysics = new G4ElectroNuclearBuilder();
147 theGNPhysics->Build();
148}
149
150void G4EmExtraPhysics::BuildSynch()
151{
152 if(synActivated) return;
153 synActivated = true;
154 G4ProcessManager * pManager = 0;
155
156 pManager = G4Electron::Electron()->GetProcessManager();
157 theElectronSynch = new G4SynchrotronRadiation();
158 pManager->AddDiscreteProcess(theElectronSynch);
159
160 pManager = G4Positron::Positron()->GetProcessManager();
161 thePositronSynch = new G4SynchrotronRadiation();
162 pManager->AddDiscreteProcess(thePositronSynch);
163}
Note: See TracBrowser for help on using the repository browser.