Geant4 11.4.0
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"
58#include "G4SystemOfUnits.hh"
59
60// factory
62//
64
66 : G4VPhysicsConstructor("chargeExchange"),
67 fLowEnergyLimit(12*CLHEP::GeV)
68{
69 // because it is an addition, the type of this constructor is 0
71 theMessenger = new G4ChargeExchangeMessenger(this);
72 if (ver > 1) {
73 G4cout << "### ChargeExchangePhysics above "
74 << fLowEnergyLimit/CLHEP::GeV << " GeV." << G4endl;
75 }
76}
77
79{
80 delete theMessenger;
81}
82
84{
85 G4MesonConstructor pMesonConstructor;
86 pMesonConstructor.ConstructParticle();
87
88 G4BaryonConstructor pBaryonConstructor;
89 pBaryonConstructor.ConstructParticle();
90
91 G4ShortLivedConstructor pShortLivedConstructor;
92 pShortLivedConstructor.ConstructParticle();
93}
94
96{
97 auto xs = new G4ChargeExchangeXS();
98 xs->SetEnergyLimit(fLowEnergyLimit);
99 xs->SetCrossSectionFactor(fXSFactor);
100
101 auto model = new G4ChargeExchange(xs);
102
104 G4cout << "### ChargeExchangePhysics Construct Processes with the model <"
105 << model->GetModelName() << "> and x-section <"
106 << xs->GetName() << "> XSFactor=" << fXSFactor
107 << G4endl;
108 }
109
110 // pi-
112 auto proc =
113 new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
114 proc->AddDataSet( xs );
115 proc->RegisterMe( model );
116 G4ProcessManager* pman = part->GetProcessManager();
117 pman->AddDiscreteProcess(proc);
118
119 // pi+
120 part = G4PionPlus::PionPlus();
121 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
122 proc->AddDataSet( xs );
123 proc->RegisterMe( model );
124 pman = part->GetProcessManager();
125 pman->AddDiscreteProcess(proc);
126
127 // kaon-
128 part = G4KaonMinus::KaonMinus();
129 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
130 proc->AddDataSet( xs );
131 proc->RegisterMe( model );
132 pman = part->GetProcessManager();
133 pman->AddDiscreteProcess(proc);
134
135
136 // kaon+
137 part = G4KaonPlus::KaonPlus();
138 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
139 proc->AddDataSet( xs );
140 proc->RegisterMe( model );
141 pman = part->GetProcessManager();
142 pman->AddDiscreteProcess(proc);
143
144 // KL
146 proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
147 proc->AddDataSet( xs );
148 proc->RegisterMe( model );
149 pman = part->GetProcessManager();
150 pman->AddDiscreteProcess(proc);
151}
#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)
G4VPhysicsConstructor(const G4String &="")