00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "G4VHadronPhysics.hh"
00040 #include "G4SystemOfUnits.hh"
00041 #include "G4ParticleDefinition.hh"
00042 #include "G4VCrossSectionDataSet.hh"
00043 #include "G4HadronicProcessType.hh"
00044 #include "G4HadronicProcessStore.hh"
00045 #include "G4HadronInelasticProcess.hh"
00046 #include "G4HadronElasticProcess.hh"
00047 #include "G4HadronCaptureProcess.hh"
00048 #include "G4HadronFissionProcess.hh"
00049 #include "G4Neutron.hh"
00050 #include "G4MesonConstructor.hh"
00051 #include "G4BaryonConstructor.hh"
00052 #include "G4IonConstructor.hh"
00053 #include "G4ShortLivedConstructor.hh"
00054 #include "G4ProcessVector.hh"
00055 #include "G4ProcessManager.hh"
00056
00057 G4VHadronPhysics::G4VHadronPhysics(const G4String& aName, G4int verb)
00058 : G4VPhysicsConstructor(aName)
00059 {
00060 SetVerboseLevel(verb);
00061 if (verboseLevel>1) {
00062 G4cout << "### G4VHadronPhysics: <" << aName << "> is created "
00063 << G4endl;
00064 }
00065 }
00066
00067 G4VHadronPhysics::~G4VHadronPhysics()
00068 {
00069 G4int n = builders.size();
00070 if(n > 0) {
00071 for(G4int i=0; i<n; i++) {delete builders[i];}
00072 }
00073 }
00074
00075 void G4VHadronPhysics::ConstructParticle()
00076 {
00077 G4MesonConstructor pMesonConstructor;
00078 pMesonConstructor.ConstructParticle();
00079
00080 G4BaryonConstructor pBaryonConstructor;
00081 pBaryonConstructor.ConstructParticle();
00082
00083 G4IonConstructor pIonConstructor;
00084 pIonConstructor.ConstructParticle();
00085
00086 G4ShortLivedConstructor pShortLivedConstructor;
00087 pShortLivedConstructor.ConstructParticle();
00088 }
00089
00090 G4HadronicInteraction*
00091 G4VHadronPhysics::BuildModel(G4VHadronModelBuilder* mBuilder,
00092 G4double emin,
00093 G4double emax)
00094 {
00095 builders.push_back(mBuilder);
00096 G4HadronicInteraction* model = mBuilder->GetModel();
00097 model->SetMinEnergy(emin);
00098 model->SetMaxEnergy(emax);
00099 if (verboseLevel>1) {
00100 G4cout << "### G4VHadronPhysics <"
00101 << model->GetModelName() << " Emin(GeV)= "
00102 << emin/GeV << " Emax(GeV)= " << emax/GeV
00103 << G4endl;
00104 }
00105
00106 return model;
00107 }
00108
00109 G4HadronicInteraction*
00110 G4VHadronPhysics::NewModel(G4HadronicInteraction* model,
00111 G4double emin,
00112 G4double emax)
00113 {
00114 if(!model) return model;
00115 model->SetMinEnergy(emin);
00116 model->SetMaxEnergy(emax);
00117 if (verboseLevel>1) {
00118 G4cout << "### G4VHadronPhysics <"
00119 << model->GetModelName() << " Emin(GeV)= "
00120 << emin/GeV << " Emax(GeV)= " << emax/GeV
00121 << G4endl;
00122 }
00123 return model;
00124 }
00125
00126 void
00127 G4VHadronPhysics::AddInelasticCrossSection(const G4String& pname,
00128 G4VCrossSectionDataSet* xsec)
00129 {
00130 const G4ParticleDefinition* p =
00131 G4ParticleTable::GetParticleTable()->FindParticle(pname);
00132 if(!p) {
00133 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
00134 << pname << G4endl;
00135 } else {
00136 AddInelasticCrossSection(p, xsec);
00137 }
00138 }
00139
00140 void
00141 G4VHadronPhysics::AddInelasticCrossSection(const G4ParticleDefinition* p,
00142 G4VCrossSectionDataSet* xsec)
00143 {
00144 if(!p) return;
00145 G4HadronicProcess* had = FindInelasticProcess(p);
00146 if(!had) return;
00147 had->AddDataSet(xsec);
00148 if (verboseLevel>1) {
00149 G4cout << "### G4VHadronPhysics: the inelastic cross section "
00150 << " is added for " << p->GetParticleName()
00151 << G4endl;
00152 }
00153 }
00154
00155 void
00156 G4VHadronPhysics::AddElasticCrossSection(const G4String& pname,
00157 G4VCrossSectionDataSet* xsec)
00158 {
00159 const G4ParticleDefinition* p =
00160 G4ParticleTable::GetParticleTable()->FindParticle(pname);
00161 if(!p) {
00162 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
00163 << pname << G4endl;
00164 } else {
00165 AddElasticCrossSection(p, xsec);
00166 }
00167 }
00168
00169 void
00170 G4VHadronPhysics::AddElasticCrossSection(const G4ParticleDefinition* p,
00171 G4VCrossSectionDataSet* xsec)
00172 {
00173 if(!p) return;
00174 G4HadronicProcess* had = FindElasticProcess(p);
00175 if(!had) return;
00176 had->AddDataSet(xsec);
00177 if (verboseLevel>1) {
00178 G4cout << "### G4VHadronPhysics: the inelastic cross section "
00179 << " is added for " << p->GetParticleName()
00180 << G4endl;
00181 }
00182 }
00183
00184 void
00185 G4VHadronPhysics::AddCaptureCrossSection(G4VCrossSectionDataSet* xsec)
00186 {
00187 G4HadronicProcess* had = FindCaptureProcess();
00188 if(!had) return;
00189 had->AddDataSet(xsec);
00190 if (verboseLevel>1) {
00191 G4cout << "### G4VHadronPhysics: the capture cross section "
00192 << " is added for neutron"
00193 << G4endl;
00194 }
00195 }
00196
00197 void
00198 G4VHadronPhysics::AddFissionCrossSection(G4VCrossSectionDataSet* xsec)
00199 {
00200 G4HadronicProcess* had = FindFissionProcess();
00201 if(!had) return;
00202 had->AddDataSet(xsec);
00203 if (verboseLevel>1) {
00204 G4cout << "### G4VHadronPhysics: the fission cross section "
00205 << " is added for neutron"
00206 << G4endl;
00207 }
00208 }
00209
00210 G4HadronicProcess*
00211 G4VHadronPhysics::FindInelasticProcess(const G4String& pname)
00212 {
00213 G4HadronicProcess* had = 0;
00214 const G4ParticleDefinition* p =
00215 G4ParticleTable::GetParticleTable()->FindParticle(pname);
00216 if(!p) {
00217 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
00218 << pname << G4endl;
00219 return had;
00220 }
00221 return FindInelasticProcess(p);
00222 }
00223
00224 G4HadronicProcess*
00225 G4VHadronPhysics::FindInelasticProcess(const G4ParticleDefinition* p)
00226 {
00227 G4HadronicProcess* had = 0;
00228 if(!p) return had;
00229 G4ProcessManager* pmanager = p->GetProcessManager();
00230 G4ProcessVector* pv = pmanager->GetProcessList();
00231 size_t n = pv->size();
00232 if(0 < n) {
00233 for(size_t i=0; i<n; ++i) {
00234 if(fHadronInelastic == ((*pv)[i])->GetProcessSubType()) {
00235 had = static_cast<G4HadronicProcess*>((*pv)[i]);
00236 return had;
00237 }
00238 }
00239 }
00240 G4ParticleDefinition* part = const_cast<G4ParticleDefinition*>(p);
00241 had = new G4HadronInelasticProcess(part->GetParticleName()+"Inelastic",part);
00242 pmanager->AddDiscreteProcess(had);
00243 return had;
00244 }
00245
00246 G4HadronicProcess*
00247 G4VHadronPhysics::FindElasticProcess(const G4String& pname)
00248 {
00249 G4HadronicProcess* had = 0;
00250 const G4ParticleDefinition* p =
00251 G4ParticleTable::GetParticleTable()->FindParticle(pname);
00252 if(!p) {
00253 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
00254 << pname << G4endl;
00255 return had;
00256 }
00257 return FindElasticProcess(p);
00258 }
00259
00260 G4HadronicProcess*
00261 G4VHadronPhysics::FindElasticProcess(const G4ParticleDefinition* p)
00262 {
00263 G4HadronicProcess* had = 0;
00264 if(!p) return had;
00265 G4ProcessManager* pmanager = p->GetProcessManager();
00266 G4ProcessVector* pv = pmanager->GetProcessList();
00267 size_t n = pv->size();
00268 if(0 < n) {
00269 for(size_t i=0; i<n; ++i) {
00270 if(fHadronElastic == ((*pv)[i])->GetProcessSubType()) {
00271 had = static_cast<G4HadronicProcess*>((*pv)[i]);
00272 return had;
00273 }
00274 }
00275 }
00276 had = new G4HadronElasticProcess("hElastic");
00277 pmanager->AddDiscreteProcess(had);
00278 return had;
00279 }
00280
00281 G4HadronicProcess* G4VHadronPhysics::FindCaptureProcess()
00282 {
00283 G4HadronicProcess* had = 0;
00284 G4ProcessManager* pmanager =
00285 G4Neutron::Neutron()->GetProcessManager();
00286 G4ProcessVector* pv = pmanager->GetProcessList();
00287 size_t n = pv->size();
00288 if(0 < n) {
00289 for(size_t i=0; i<n; ++i) {
00290 if(fCapture == ((*pv)[i])->GetProcessSubType()) {
00291 had = static_cast<G4HadronicProcess*>((*pv)[i]);
00292 return had;
00293 }
00294 }
00295 }
00296 had = new G4HadronCaptureProcess("nCapture");
00297 pmanager->AddDiscreteProcess(had);
00298 return had;
00299 }
00300
00301 G4HadronicProcess* G4VHadronPhysics::FindFissionProcess()
00302 {
00303 G4HadronicProcess* had = 0;
00304 G4ProcessManager* pmanager =
00305 G4Neutron::Neutron()->GetProcessManager();
00306 G4ProcessVector* pv = pmanager->GetProcessList();
00307 size_t n = pv->size();
00308 if(0 < n) {
00309 for(size_t i=0; i<n; ++i) {
00310 if(fFission == ((*pv)[i])->GetProcessSubType()) {
00311 had = static_cast<G4HadronicProcess*>((*pv)[i]);
00312 return had;
00313 }
00314 }
00315 }
00316 had = new G4HadronFissionProcess("nFission");
00317 pmanager->AddDiscreteProcess(had);
00318 return had;
00319 }
00320