Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ChargeExchangePhysics.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//
27//---------------------------------------------------------------------------
28//
29// ClassName: G4ChargeExchangePhysics
30//
31// Author: 19 November 2008 V. Ivanchenko
32//
33// Modified:
34//
35//----------------------------------------------------------------------------
36//
37
39
40#include "G4ChargeExchangeXS.hh"
41#include "G4ChargeExchange.hh"
42
45#include "G4ProcessManager.hh"
46
47#include "G4MesonConstructor.hh"
50#include "G4PionPlus.hh"
51#include "G4PionMinus.hh"
52#include "G4KaonPlus.hh"
53#include "G4KaonMinus.hh"
54#include "G4KaonZeroLong.hh"
57#include "G4SystemOfUnits.hh"
58
59// factory
61//
63
65 : G4VPhysicsConstructor("chargeExchange"),
66 fLowEnergyLimit(12*CLHEP::GeV)
67{
68 // because it is an addition, the type of this constructor is 0
70 if (ver > 1) {
71 G4cout << "### ChargeExchangePhysics above "
72 << fLowEnergyLimit/CLHEP::GeV << " GeV." << G4endl;
73 }
74}
75
77{
78 G4MesonConstructor pMesonConstructor;
79 pMesonConstructor.ConstructParticle();
80
81 G4BaryonConstructor pBaryonConstructor;
82 pBaryonConstructor.ConstructParticle();
83
84 G4ShortLivedConstructor pShortLivedConstructor;
85 pShortLivedConstructor.ConstructParticle();
86}
87
89{
90 auto xs = new G4ChargeExchangeXS();
91 xs->SetEnergyLimit(fLowEnergyLimit);
92 xs->SetCrossSectionFactor(fXSFactor);
93
94 auto model = new G4ChargeExchange(xs);
95
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-
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
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}
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
static G4HadronicParameters * Instance()
void SetVerboseLevel(const G4int val)
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4KaonZeroLong * KaonZeroLong()
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
Definition G4PionPlus.cc:93
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)