Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4HyperonCHIPSBuilder.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// GEANT4 tag $Name: $
27//
28//---------------------------------------------------------------------------
29//
30// ClassName: G4HyperonCHIPSBuilder
31//
32// Author: 2011, J. Apostolakis
33//
34// created by modifying G4QInelasticCHIPSBuilder to apply only to MISC particles
35// -----------------------------------------------------------------------------
37
39 verbose(ver), wasActivated(false), inelastic(0)
40{
41 // pointer to the particle table
44}
45
47{
48 if(wasActivated) delete inelastic;
49}
50
52{
53 if(wasActivated) return;
54
55 wasActivated = true;
57 inelastic = new G4QInelastic();
58
59 while( (*theParticleIterator)() )
60 {
62 G4String pname = particle->GetParticleName();
63 if(pname == "kaon-" || pname == "kaon+" || pname == "kaon0S" || pname == "kaon0L" ||
64 pname == "pi-" || pname == "pi+" || pname == "neutron" || pname == "proton" ||
65 pname == "anti_proton" || pname == "anti_neutron" )
66 {
67 if(verbose>1)G4cout<<"** G4HyperonCHIPSBuilder: "<<pname<<" already defined"<<G4endl;
68 }
69 else if( pname == "lambda" || pname == "sigma+" || pname == "sigma0" ||
70 pname == "sigma-" || pname == "xi0" || pname == "xi-" ||
71 pname == "omega-" ||
72 pname == "anti_lambda" || pname == "anti_sigma+" || pname == "anti_sigma0" ||
73 pname == "anti_sigma-" || pname == "anti_xi0" || pname == "anti_xi-" ||
74 pname == "anti_omega-" )
75 {
76 if(verbose>1)G4cout<< "__G4HyperonCHIPSBuilder: "<< pname <<" is defined here"<<G4endl;
77 G4ProcessManager* pmanager = particle->GetProcessManager();
78 pmanager->AddDiscreteProcess(inelastic);
79 if(verbose>1) G4cout<<"###> G4HyperonCHIPSBuilder: "<<inelastic->GetProcessName()
80 <<" is added for "<<pname<<G4endl;
81 }
82 }
83}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4ParticleTable::G4PTblDicIterator * theParticleIterator
G4ParticleTable * theParticleTable
G4HyperonCHIPSBuilder(G4int verbose=0)
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4PTblDicIterator * GetIterator()
static G4ParticleTable * GetParticleTable()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:379