Geant4 Cross Reference |
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 // 27 //--------------------------------------------------------------------------- 28 // 29 // ClassName: G4HadronPhysicsFTF_BIC 30 // 31 // Author: 2007 Gunter Folger 32 // 33 // Modified: 34 // 35 //---------------------------------------------------------------------------- 36 // 37 #include <iomanip> 38 #include "G4HadronPhysicsFTF_BIC.hh" 39 #include "globals.hh" 40 #include "G4ios.hh" 41 #include "G4SystemOfUnits.hh" 42 #include "G4ParticleDefinition.hh" 43 #include "G4ParticleTable.hh" 44 #include "G4PionBuilder.hh" 45 #include "G4KaonBuilder.hh" 46 #include "G4BinaryPionBuilder.hh" 47 #include "G4BertiniPionBuilder.hh" 48 #include "G4BertiniKaonBuilder.hh" 49 #include "G4FTFBinaryPionBuilder.hh" 50 #include "G4FTFBinaryKaonBuilder.hh" 51 #include "G4ProtonBuilder.hh" 52 #include "G4FTFBinaryProtonBuilder.hh" 53 #include "G4BinaryProtonBuilder.hh" 54 #include "G4NeutronBuilder.hh" 55 #include "G4FTFBinaryNeutronBuilder.hh" 56 #include "G4BinaryNeutronBuilder.hh" 57 #include "G4ProcessManager.hh" 58 #include "G4ProcessVector.hh" 59 #include "G4NeutronRadCapture.hh" 60 #include "G4NeutronInelasticXS.hh" 61 #include "G4NeutronCaptureXS.hh" 62 #include "G4PhysListUtil.hh" 63 #include "G4HadParticles.hh" 64 #include "G4HadronicParameters.hh" 65 #include "G4PhysicsConstructorFactory.hh" 66 67 G4_DECLARE_PHYSCONSTR_FACTORY(G4HadronPhysicsFTF_BIC); 68 69 G4HadronPhysicsFTF_BIC::G4HadronPhysicsFTF_BIC(G4int verb) 70 : G4HadronPhysicsFTF_BIC("hInelastic FTF_BIC",false) 71 { 72 G4HadronicParameters::Instance()->SetVerboseLevel(verb); 73 } 74 75 G4HadronPhysicsFTF_BIC::G4HadronPhysicsFTF_BIC(const G4String& name, G4bool qe) 76 : G4HadronPhysicsFTFP_BERT(name, qe) 77 { 78 maxBIC_pion = 1.5*CLHEP::GeV; 79 minBERT_pion = 1.0*CLHEP::GeV; 80 } 81 82 G4HadronPhysicsFTF_BIC::~G4HadronPhysicsFTF_BIC() 83 {} 84 85 void G4HadronPhysicsFTF_BIC::Neutron() 86 { 87 G4HadronicParameters* param = G4HadronicParameters::Instance(); 88 G4bool useFactorXS = param->ApplyFactorXS(); 89 //General schema: 90 // 1) Create a builder 91 // 2) Call AddBuilder 92 // 3) Configure the builder, possibly with sub-builders 93 // 4) Call builder->Build() 94 auto neu = new G4NeutronBuilder; 95 AddBuilder(neu); 96 auto ftfn = new G4FTFBinaryNeutronBuilder(QuasiElastic); 97 AddBuilder( ftfn ); 98 neu->RegisterMe(ftfn); 99 auto bicn = new G4BinaryNeutronBuilder; 100 AddBuilder(bicn); 101 neu->RegisterMe(bicn); 102 bicn->SetMinEnergy(0.0); 103 bicn->SetMaxEnergy(maxBERT_neutron); 104 neu->Build(); 105 106 // add cross section factor 107 const G4ParticleDefinition* neutron = G4Neutron::Neutron(); 108 G4HadronicProcess* inel = G4PhysListUtil::FindInelasticProcess(neutron); 109 if(nullptr != inel) { 110 inel->AddDataSet(new G4NeutronInelasticXS()); 111 if( useFactorXS ) inel->MultiplyCrossSectionBy( param->XSFactorNucleonInelastic() ); 112 } 113 G4HadronicProcess* capture = G4PhysListUtil::FindCaptureProcess(neutron); 114 if (nullptr != capture) { 115 capture->RegisterMe(new G4NeutronRadCapture()); 116 } 117 } 118 119 void G4HadronPhysicsFTF_BIC::Proton() 120 { 121 G4HadronicParameters* param = G4HadronicParameters::Instance(); 122 G4bool useFactorXS = param->ApplyFactorXS(); 123 124 auto pro = new G4ProtonBuilder; 125 AddBuilder(pro); 126 auto ftfp = new G4FTFBinaryProtonBuilder(QuasiElastic); 127 AddBuilder(ftfp); 128 pro->RegisterMe(ftfp); 129 auto bicp = new G4BinaryProtonBuilder; 130 AddBuilder(bicp); 131 pro->RegisterMe(bicp); 132 bicp->SetMaxEnergy(maxBERT_proton); 133 pro->Build(); 134 135 // add cross section factor 136 const G4ParticleDefinition* proton = G4Proton::Proton(); 137 G4HadronicProcess* inel = G4PhysListUtil::FindInelasticProcess(proton); 138 if(nullptr != inel) { 139 if( useFactorXS ) inel->MultiplyCrossSectionBy( param->XSFactorNucleonInelastic() ); 140 } 141 } 142 143 void G4HadronPhysicsFTF_BIC::Pion() 144 { 145 G4HadronicParameters* param = G4HadronicParameters::Instance(); 146 G4bool useFactorXS = param->ApplyFactorXS(); 147 148 auto pi = new G4PionBuilder; 149 AddBuilder(pi); 150 auto ftfpi = new G4FTFBinaryPionBuilder(QuasiElastic); 151 AddBuilder(ftfpi); 152 pi->RegisterMe(ftfpi); 153 auto bertpi = new G4BertiniPionBuilder; 154 AddBuilder(bertpi); 155 bertpi->SetMinEnergy(minBERT_pion); 156 bertpi->SetMaxEnergy(maxBERT_pion); 157 pi->RegisterMe(bertpi); 158 auto bicpi = new G4BinaryPionBuilder; 159 AddBuilder(bicpi); 160 pi->RegisterMe(bicpi); 161 bicpi->SetMaxEnergy(maxBIC_pion); 162 pi->Build(); 163 164 // add cross section factor 165 if( useFactorXS ) { 166 const G4ParticleDefinition* pion = G4PionPlus::PionPlus(); 167 G4HadronicProcess* inel = G4PhysListUtil::FindInelasticProcess(pion); 168 if(nullptr != inel) { 169 inel->MultiplyCrossSectionBy( param->XSFactorPionInelastic() ); 170 } 171 pion = G4PionMinus::PionMinus(); 172 inel = G4PhysListUtil::FindInelasticProcess(pion); 173 if(nullptr != inel) { 174 inel->MultiplyCrossSectionBy( param->XSFactorPionInelastic() ); 175 } 176 } 177 } 178 179 void G4HadronPhysicsFTF_BIC::Kaon() 180 { 181 G4HadronicParameters* param = G4HadronicParameters::Instance(); 182 G4bool useFactorXS = param->ApplyFactorXS(); 183 184 auto k = new G4KaonBuilder; 185 AddBuilder(k); 186 auto ftfk = new G4FTFBinaryKaonBuilder(QuasiElastic); 187 AddBuilder(ftfk); 188 k->RegisterMe(ftfk); 189 auto bertk = new G4BertiniKaonBuilder; 190 AddBuilder(bertk); 191 k->RegisterMe(bertk); 192 bertk->SetMaxEnergy(maxBERT_kaon); 193 k->Build(); 194 // add cross section factor 195 if( useFactorXS ) { 196 G4ParticleTable* table = G4ParticleTable::GetParticleTable(); 197 for( auto & pdg : G4HadParticles::GetKaons() ) { 198 auto part = table->FindParticle( pdg ); 199 if ( part == nullptr ) { continue; } 200 G4HadronicProcess* inel = G4PhysListUtil::FindInelasticProcess(part); 201 if(nullptr != inel) { 202 inel->MultiplyCrossSectionBy( param->XSFactorHadronInelastic() ); 203 } 204 } 205 } 206 } 207 208