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
G4QPhotoNuclearPhysics.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: G4QPhotoNuclearPhysics
31//
32// Author: 2009 M. V. Kosov
33//
34// Modified:
35//
36//----------------------------------------------------------------------------
37//
38
40
41
43 G4VPhysicsConstructor("CHIPS photo-nuclear"), wasBuilt(false), SynchRActivated(false),
44 GamNucActivated(false), EleNucActivated(false), MuoNucActivated(false),
45 TauNucActivated(false), synchrOn(true), synchrMinGam(227.), gamNucOn(true),
46 eleNucOn(true), muoNucOn(true), tauNucOn(true), photoNucBias(1.)
47{
48 theMessenger = G4QMessenger::GetPointer();
49 theMessenger->Add(this);
50}
51
53 G4VPhysicsConstructor(name), wasBuilt(false), SynchRActivated(false),
54 GamNucActivated(false), EleNucActivated(false), MuoNucActivated(false),
55 TauNucActivated(false), synchrOn(true), synchrMinGam(227.), gamNucOn(true),
56 eleNucOn(true), muoNucOn(true), tauNucOn(true), photoNucBias(1.)
57{
58 theMessenger = G4QMessenger::GetPointer();
59 theMessenger->Add(this);
60}
61
63{
64 if(wasBuilt)
65 {
66 delete inelastic;
67 if(synchrOn) delete synchrad;
68 }
69}
70
72{
73 if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
74 else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") synchrOn = true;
75 else synchrOn = false;
76}
77
79{
80 if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
81 else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") gamNucOn = true;
82 else gamNucOn = false;
83}
84
86{
87 if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
88 else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") eleNucOn = true;
89 else eleNucOn = false;
90}
91
93{
94 if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
95 else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") muoNucOn = true;
96 else muoNucOn = false;
97}
98
100{
101 if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
102 else if(newSwitch == "on" || newSwitch == "ON" || newSwitch == "On") tauNucOn = true;
103 else tauNucOn = false;
104}
105
107{
108 if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
109 else synchrMinGam = newValue;
110}
111
113{
114 if(wasBuilt) G4cout<<"G4QPhotoNuclearPhysics:No, processes are already builded!"<<G4endl;
115 else photoNucBias = newValue;
116}
117
119{
127 if (synchrOn)
128 {
129 G4MesonConstructor pMesonConstructor;
130 pMesonConstructor.ConstructParticle();
131
132 G4BaryonConstructor pBaryonConstructor;
133 pBaryonConstructor.ConstructParticle();
134 }
135}
136
138{
139 if(wasBuilt) return;
140 wasBuilt = true;
141
142 inelastic = new G4QInelastic("photoNuclear");
143 inelastic->SetPhotNucBias(photoNucBias);
144
145 if (synchrOn) BuildSynchRad();
146 if (gamNucOn) BuildGammaNuclear();
147 if (eleNucOn) BuildElectroNuclear();
148 if (muoNucOn) BuildMuonNuclear();
149 if (tauNucOn) BuildTauNuclear();
150}
151
152void G4QPhotoNuclearPhysics::BuildGammaNuclear()
153{
154 if(GamNucActivated) return;
155 GamNucActivated = true;
157 pManager->AddDiscreteProcess(inelastic);
158}
159
160void G4QPhotoNuclearPhysics::BuildElectroNuclear()
161{
162 if(EleNucActivated) return;
163 EleNucActivated = true;
164 G4ProcessManager * pManager = 0;
165
167 pManager->AddDiscreteProcess(inelastic);
168
170 pManager->AddDiscreteProcess(inelastic);
171}
172
173void G4QPhotoNuclearPhysics::BuildMuonNuclear()
174{
175 if(MuoNucActivated) return;
176 MuoNucActivated = true;
177 G4ProcessManager * pManager = 0;
178
180 pManager->AddDiscreteProcess(inelastic);
181
183 pManager->AddDiscreteProcess(inelastic);
184}
185
186void G4QPhotoNuclearPhysics::BuildTauNuclear()
187{
188 if(TauNucActivated) return;
189 TauNucActivated = true;
190 G4ProcessManager * pManager = 0;
191
193 pManager->AddDiscreteProcess(inelastic);
194
196 pManager->AddDiscreteProcess(inelastic);
197}
198
199// The CHIPS Synchrotron radiation process is working for all charged particles
200void G4QPhotoNuclearPhysics::BuildSynchRad()
201{
202 if(SynchRActivated) return;
203 SynchRActivated = true;
204 synchrad = new G4QSynchRad();
206 while( (*theParticleIterator)() )
207 {
209 G4double charge = particle->GetPDGCharge();
210 if(charge != 0.0)
211 {
212 G4ProcessManager* pmanager = particle->GetProcessManager();
213 pmanager->AddDiscreteProcess(synchrad);
214 }
215 }
216}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static void ConstructParticle()
static G4Electron * Electron()
Definition: G4Electron.cc:94
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static void ConstructParticle()
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:100
static G4MuonPlus * MuonPlus()
Definition: G4MuonPlus.cc:99
G4ProcessManager * GetProcessManager() const
G4double GetPDGCharge() const
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void SetPhotNucBias(G4double phnB=1.)
void Add(G4QNeutrinoPhysics *weak)
Definition: G4QMessenger.cc:95
static G4QMessenger * GetPointer()
Definition: G4QMessenger.cc:89
void SetGammaNuclearOnOff(G4String &aSwitch)
void SetMuonNuclearOnOff(G4String &aSwitch)
G4QPhotoNuclearPhysics(G4int verbose=1)
void SetMinGammaSR(G4double newValue)
void SetElPosNuclearOnOff(G4String &aSwitch)
void SetTauNuclearOnOff(G4String &aSwitch)
void SetPhotoNucBias(G4double newValue)
void SetSynchRadOnOff(G4String &aSwitch)
static G4TauMinus * TauMinus()
Definition: G4TauMinus.cc:135
static G4TauPlus * TauPlus()
Definition: G4TauPlus.cc:134
G4ParticleTable::G4PTblDicIterator * theParticleIterator