Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 {
120  G4Gamma::Gamma();
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 
152 void G4QPhotoNuclearPhysics::BuildGammaNuclear()
153 {
154  if(GamNucActivated) return;
155  GamNucActivated = true;
157  pManager->AddDiscreteProcess(inelastic);
158 }
159 
160 void G4QPhotoNuclearPhysics::BuildElectroNuclear()
161 {
162  if(EleNucActivated) return;
163  EleNucActivated = true;
164  G4ProcessManager * pManager = 0;
165 
166  pManager = G4Electron::Electron()->GetProcessManager();
167  pManager->AddDiscreteProcess(inelastic);
168 
169  pManager = G4Positron::Positron()->GetProcessManager();
170  pManager->AddDiscreteProcess(inelastic);
171 }
172 
173 void G4QPhotoNuclearPhysics::BuildMuonNuclear()
174 {
175  if(MuoNucActivated) return;
176  MuoNucActivated = true;
177  G4ProcessManager * pManager = 0;
178 
179  pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
180  pManager->AddDiscreteProcess(inelastic);
181 
183  pManager->AddDiscreteProcess(inelastic);
184 }
185 
186 void G4QPhotoNuclearPhysics::BuildTauNuclear()
187 {
188  if(TauNucActivated) return;
189  TauNucActivated = true;
190  G4ProcessManager * pManager = 0;
191 
192  pManager = G4TauPlus::TauPlus()->GetProcessManager();
193  pManager->AddDiscreteProcess(inelastic);
194 
195  pManager = G4TauMinus::TauMinus()->GetProcessManager();
196  pManager->AddDiscreteProcess(inelastic);
197 }
198 
199 // The CHIPS Synchrotron radiation process is working for all charged particles
200 void 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 }