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: G4ChargeExchangePhysics 30 // 31 // Author: 19 November 2008 V. Ivanchenko 32 // 33 // Modified: 34 // 35 //---------------------------------------------------------------------------- 36 // 37 38 #include "G4ChargeExchangePhysics.hh" 39 40 #include "G4ChargeExchangeXS.hh" 41 #include "G4ChargeExchange.hh" 42 43 #include "G4ParticleDefinition.hh" 44 #include "G4PhysicsListHelper.hh" 45 #include "G4ProcessManager.hh" 46 47 #include "G4MesonConstructor.hh" 48 #include "G4BaryonConstructor.hh" 49 #include "G4ShortLivedConstructor.hh" 50 #include "G4PionPlus.hh" 51 #include "G4PionMinus.hh" 52 #include "G4KaonPlus.hh" 53 #include "G4KaonMinus.hh" 54 #include "G4KaonZeroLong.hh" 55 #include "G4HadronicParameters.hh" 56 #include "G4HadronInelasticProcess.hh" 57 #include "G4SystemOfUnits.hh" 58 59 // factory 60 #include "G4PhysicsConstructorFactory.hh" 61 // 62 G4_DECLARE_PHYSCONSTR_FACTORY(G4ChargeExchangePhysics); 63 64 G4ChargeExchangePhysics::G4ChargeExchangePhysics(G4int ver) 65 : G4VPhysicsConstructor("chargeExchange"), 66 fLowEnergyLimit(12*CLHEP::GeV) 67 { 68 // because it is an addition, the type of this constructor is 0 69 G4HadronicParameters::Instance()->SetVerboseLevel(ver); 70 if (ver > 1) { 71 G4cout << "### ChargeExchangePhysics above " 72 << fLowEnergyLimit/CLHEP::GeV << " GeV." << G4endl; 73 } 74 } 75 76 void G4ChargeExchangePhysics::ConstructParticle() 77 { 78 G4MesonConstructor pMesonConstructor; 79 pMesonConstructor.ConstructParticle(); 80 81 G4BaryonConstructor pBaryonConstructor; 82 pBaryonConstructor.ConstructParticle(); 83 84 G4ShortLivedConstructor pShortLivedConstructor; 85 pShortLivedConstructor.ConstructParticle(); 86 } 87 88 void G4ChargeExchangePhysics::ConstructProcess() 89 { 90 auto xs = new G4ChargeExchangeXS(); 91 xs->SetEnergyLimit(fLowEnergyLimit); 92 xs->SetCrossSectionFactor(fXSFactor); 93 94 auto model = new G4ChargeExchange(xs); 95 96 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 1) { 97 G4cout << "### ChargeExchangePhysics Construct Processes with the model <" 98 << model->GetModelName() << "> and x-section <" 99 << xs->GetName() << "> XSFactor=" << fXSFactor 100 << G4endl; 101 } 102 103 // pi- 104 G4ParticleDefinition* part = G4PionMinus::PionMinus(); 105 auto proc = 106 new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part); 107 proc->AddDataSet( xs ); 108 proc->RegisterMe( model ); 109 G4ProcessManager* pman = part->GetProcessManager(); 110 pman->AddDiscreteProcess(proc); 111 112 // pi+ 113 part = G4PionPlus::PionPlus(); 114 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part); 115 proc->AddDataSet( xs ); 116 proc->RegisterMe( model ); 117 pman = part->GetProcessManager(); 118 pman->AddDiscreteProcess(proc); 119 120 // kaon- 121 part = G4KaonMinus::KaonMinus(); 122 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part); 123 proc->AddDataSet( xs ); 124 proc->RegisterMe( model ); 125 pman = part->GetProcessManager(); 126 pman->AddDiscreteProcess(proc); 127 128 129 // kaon+ 130 part = G4KaonPlus::KaonPlus(); 131 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part); 132 proc->AddDataSet( xs ); 133 proc->RegisterMe( model ); 134 pman = part->GetProcessManager(); 135 pman->AddDiscreteProcess(proc); 136 137 // KL 138 part = G4KaonZeroLong::KaonZeroLong(); 139 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part); 140 proc->AddDataSet( xs ); 141 proc->RegisterMe( model ); 142 pman = part->GetProcessManager(); 143 pman->AddDiscreteProcess(proc); 144 } 145