Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4QInelasticCHIPS_HPBuilder.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 // GEANT4 tag $Name: not supported by cvs2svn $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4QInelasticCHIPS_HPBuilder
31 //
32 // Author: 2009 M. Kosov
33 //
34 //----------------------------------------------------------------------------
35 //
36 // Short comment: This is a physics list of only one model G4QInelastic for
37 // all hadron-nuclear interactions at all energies + G4QNGamma for LE neutrons.
38 // There are process-mixings (G4QProcessMixer) w/ HP processes at low (< 20 MeV)
39 // energies with the G4QInelastic & G4QNGammafor neutrons, as CHIPS in G4 does
40 // not include yet all precise LE nA inelastic processes. In this particular
41 // builder the G4QInelastic process is attached to all hadrons + G4NGamma +
42 // HP_fission (fission && NNGamma CHIPS processes to be added).
43 //
44 // -----------------------------------------------------------------------------
45 
46 //#define debug
47 
49 #include "G4SystemOfUnits.hh"
50 
52  verbose(ver)
53  , wasActivated(false)
54  , inelastic(0)
55  , theInProcessMixer(0)
56  , theNgProcessMixer(0)
57  , theFiProcessMixer(0)
58  , theNeutronInelastic(0)
59  , theNeutronFission(0)
60  , theNeutronCapture(0)
61  , theCHIPSInelastic(0)
62  , theCHIPSNGamma(0)
63  , theHPNeutron(0)
64 {
65  // pointer to the particle table
68 }
69 
71 {
72  if(wasActivated)
73  {
74  delete inelastic;
75  delete theCHIPSInelastic;
76  delete theCHIPSNGamma;
77  //delete theCHIPSFission;
78  delete theNeutronInelastic;
79  delete theNeutronCapture;
80  delete theNeutronFission;
81  delete theHPNeutron;
82  delete theInProcessMixer;
83  delete theNgProcessMixer;
84  delete theFiProcessMixer;
85  }
86 }
87 
89 {
90  if(wasActivated) return;
91  wasActivated = true;
93  inelastic = new G4QInelastic();
94  while( (*theParticleIterator)() )
95  {
97  G4String pname = particle->GetParticleName();
98  if(pname == "kaon-" || pname == "kaon+" || pname == "kaon0S" || pname == "kaon0L" ||
99  //pname == "pi-" || pname == "pi+" || pname == "neutron" || pname == "proton" ||
100  pname == "pi-" || pname == "pi+" || pname == "proton" ||
101  pname == "lambda" || pname == "sigma+" || pname == "sigma0" ||
102  pname == "sigma-" || pname == "xi0" || pname == "xi-" || pname == "omega-" ||
103  pname == "anti_proton" || pname == "anti_neutron" || pname == "anti_lambda" ||
104  pname == "anti_sigma+" || pname == "anti_sigma0" || pname == "anti_sigma-" ||
105  pname == "anti_xi0" || pname == "anti_xi-" || pname == "anti_omega-" )
106  {
107  if(verbose>1)
108  G4cout<< "__G4QInelCHIPS_HPBuilder: "<< pname <<" is defined here"<<G4endl;
109  G4ProcessManager* pmanager = particle->GetProcessManager();
110  pmanager->AddDiscreteProcess(inelastic);
111  if(verbose>1)G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<inelastic->GetProcessName()
112  <<" is added for "<<pname<<G4endl;
113  }
114  else if(pname == "neutron")
115  {
116  if(verbose>1)
117  G4cout<< "__G4QInelCHIPS_HPBuilder: "<< pname <<" is defined here"<<G4endl;
118  G4ProcessManager* pmanager = particle->GetProcessManager();
119  // The model definition for neutrons (needed for HP implementation)
120 #ifdef debug
121  G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before NeutronBuild"<<G4endl;
122 #endif
123  theCHIPSInelastic = new G4QInelastic();
124  theCHIPSNGamma = new G4QNGamma();
125  //theCHIPSFission = new G4QFission();
126  theNeutronInelastic = new G4NeutronInelasticProcess();
127  theNeutronCapture = new G4HadronCaptureProcess();
128  theNeutronFission = new G4HadronFissionProcess();
129  theInProcessMixer = new G4QDiscProcessMixer("Mixed NeutronInelastic", particle);
130  theNgProcessMixer = new G4QDiscProcessMixer("Mixed NGamma", particle);
131  theFiProcessMixer = new G4QDiscProcessMixer("Mixed NFission", particle);
132 #ifdef debug
133  G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before Build HP processes"<<G4endl;
134 #endif
135  theHPNeutron = new G4NeutronHPBuilder;
136  theHPNeutron->Build(theNeutronInelastic);
137  theHPNeutron->Build(theNeutronCapture);
138  theHPNeutron->Build(theNeutronFission);
139 #ifdef debug
140  G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before QIn="<<theCHIPSInelastic<<G4endl;
141 #endif
142  theInProcessMixer->AddDiscreteProcess(theCHIPSInelastic, 1.E8*megaelectronvolt);
143 #ifdef debug
144  G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: befr HPI="<<theNeutronInelastic<<G4endl;
145 #endif
146  theInProcessMixer->AddDiscreteProcess(theNeutronInelastic, 19.9*megaelectronvolt);
147 
148 #ifdef debug
149  G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before QNG="<<theCHIPSNGamma<<G4endl;
150 #endif
151  theNgProcessMixer->AddDiscreteProcess(theCHIPSNGamma, 1.E8*megaelectronvolt);
152 #ifdef debug
153  G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before HPC="<<theNeutronCapture<<G4endl;
154 #endif
155  theNgProcessMixer->AddDiscreteProcess(theNeutronCapture, 19.9*megaelectronvolt);
156 
157  //theFiProcessMixer->AddDiscreteProcess(theCHIPSFission, 1.E8*megaelectronvolt);
158  //theFiProcessMixer->AddDiscreteProcess(theNeutronFission, 19.9*megaelectronvolt);
159 
160 #ifdef debug
161  G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before ProcessAdd"<<G4endl;
162 #endif
163  pmanager->AddDiscreteProcess(theInProcessMixer); // Mix CHIPS+HP for neutronInelastic
164  if(verbose>1)
165  G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<theCHIPSInelastic->GetProcessName()
166  <<" is added for "<<pname<<G4endl;
167  pmanager->AddDiscreteProcess(theNgProcessMixer); // Mix CHIPS+HP for (n,gamma)
168  if(verbose>1)
169  G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<theCHIPSNGamma->GetProcessName()
170  <<" is added for "<<pname<<G4endl;
171  pmanager->AddDiscreteProcess(theNeutronFission); // Only HP for fission
172  //pmanager->AddDiscreteProcess(theFiProcessMixer); // Mix CHIPS+HP for fission
173  if(verbose>1)
174  G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<theNeutronFission->GetProcessName()
175  <<" is added for "<<pname<<G4endl;
176  }
177  }
178 }
179 
180 // 2012 by M. Kosov