Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CascadeColliderBase Class Reference

#include <G4CascadeColliderBase.hh>

+ Inheritance diagram for G4CascadeColliderBase:

Public Member Functions

 G4CascadeColliderBase (const G4String &name, G4int verbose=0)
 
virtual ~G4CascadeColliderBase ()
 
virtual void rescatter (G4InuclParticle *, G4KineticTrackVector *, G4V3DNucleus *, G4CollisionOutput &)
 
virtual void setVerboseLevel (G4int verbose=0)
 
- Public Member Functions inherited from G4VCascadeCollider
 G4VCascadeCollider (const G4String &name, G4int verbose=0)
 
virtual ~G4VCascadeCollider ()
 
virtual void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)=0
 

Protected Member Functions

virtual G4bool useEPCollider (G4InuclParticle *bullet, G4InuclParticle *target) const
 
virtual G4bool inelasticInteractionPossible (G4InuclParticle *bullet, G4InuclParticle *target, G4double ekin) const
 
virtual G4bool validateOutput (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
 
virtual G4bool validateOutput (const G4Fragment &fragment, G4CollisionOutput &output)
 
virtual G4bool validateOutput (G4InuclParticle *bullet, G4InuclParticle *target, const std::vector< G4InuclElementaryParticle > &particles)
 
- Protected Member Functions inherited from G4VCascadeCollider
virtual void setName (const G4String &name)
 

Protected Attributes

G4InteractionCase interCase
 
G4CascadeCheckBalancebalance
 
- Protected Attributes inherited from G4VCascadeCollider
G4String theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 62 of file G4CascadeColliderBase.hh.

Constructor & Destructor Documentation

◆ G4CascadeColliderBase()

G4CascadeColliderBase::G4CascadeColliderBase ( const G4String & name,
G4int verbose = 0 )

Definition at line 57 of file G4CascadeColliderBase.cc.

58 : G4VCascadeCollider(name, verbose), balance(0) {
61}
G4CascadeCheckBalance * balance
static G4bool checkConservation()
G4VCascadeCollider(const G4String &name, G4int verbose=0)

◆ ~G4CascadeColliderBase()

G4CascadeColliderBase::~G4CascadeColliderBase ( )
virtual

Definition at line 63 of file G4CascadeColliderBase.cc.

63 {
64 delete balance;
65}

Member Function Documentation

◆ inelasticInteractionPossible()

G4bool G4CascadeColliderBase::inelasticInteractionPossible ( G4InuclParticle * bullet,
G4InuclParticle * target,
G4double ekin ) const
protectedvirtual

Definition at line 85 of file G4CascadeColliderBase.cc.

87 {
88 if (verboseLevel) {
89 G4cout << " >>> " << theName << "::inelasticInteractionPossible" << G4endl;
90 }
91
92 // If hadron-hadron collision, defer to ElementaryParticleCollider
93 if (useEPCollider(bullet, target)) return true;
94
95 // See which one of the two (or both) is a nucleus, get properties
96 // FIXME: Should set a = baryon() for both, but that's not in base
97 G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet);
98 G4double ab = nuclei_bullet ? nuclei_bullet->getA() : 1; // FIXME
99 G4double zb = nuclei_bullet ? nuclei_bullet->getZ() : bullet->getCharge();
100
101 G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target);
102 G4double at = nuclei_target ? nuclei_target->getA() : 1; // FIXME
103 G4double zt = nuclei_target ? nuclei_target->getZ() : target->getCharge();
104
105 // VCOL (Coulomb barrier) used for testing if elastic collision necessary
106 const G4double coeff = 0.001 * 1.2;
107
108 G4double VCOL = coeff * zt * zb / (G4cbrt(at) + G4cbrt(ab));
109
110 G4bool possible = true; // Force inelastic; should be (ekin >= VCOL)
111
112 if (verboseLevel > 3) {
113 G4cout << " VCOL: " << VCOL << " ekin: " << ekin << " inelastic possible: "
114 << possible << G4endl;
115 }
116
117 return possible;
118}
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
virtual G4bool useEPCollider(G4InuclParticle *bullet, G4InuclParticle *target) const
G4int getZ() const
G4int getA() const
G4double getCharge() const

Referenced by G4InuclCollider::collide().

◆ rescatter()

virtual void G4CascadeColliderBase::rescatter ( G4InuclParticle * ,
G4KineticTrackVector * ,
G4V3DNucleus * ,
G4CollisionOutput &  )
inlinevirtual

Reimplemented in G4IntraNucleiCascader, and G4InuclCollider.

Definition at line 68 of file G4CascadeColliderBase.hh.

71 { ; }

◆ setVerboseLevel()

void G4CascadeColliderBase::setVerboseLevel ( G4int verbose = 0)
virtual

◆ useEPCollider()

G4bool G4CascadeColliderBase::useEPCollider ( G4InuclParticle * bullet,
G4InuclParticle * target ) const
protectedvirtual

◆ validateOutput() [1/3]

G4bool G4CascadeColliderBase::validateOutput ( const G4Fragment & fragment,
G4CollisionOutput & output )
protectedvirtual

Definition at line 139 of file G4CascadeColliderBase.cc.

140 {
141 if (!balance) return true; // Skip checks unless requested
142
143 if (verboseLevel > 1)
144 G4cout << " >>> " << theName << "::validateOutput" << G4endl;
145
147 balance->collide(fragment, output);
148 return balance->okay(); // Returns false if violations
149}
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)

◆ validateOutput() [2/3]

G4bool G4CascadeColliderBase::validateOutput ( G4InuclParticle * bullet,
G4InuclParticle * target,
const std::vector< G4InuclElementaryParticle > & particles )
protectedvirtual

Definition at line 151 of file G4CascadeColliderBase.cc.

153 {
154 if (!balance) return true; // Skip checks unless requested
155
156 if (verboseLevel > 1)
157 G4cout << " >>> " << theName << "::validateOutput" << G4endl;
158
160 balance->collide(bullet, target, particles);
161 return balance->okay(); // Returns false if violations
162}

◆ validateOutput() [3/3]

G4bool G4CascadeColliderBase::validateOutput ( G4InuclParticle * bullet,
G4InuclParticle * target,
G4CollisionOutput & output )
protectedvirtual

Definition at line 123 of file G4CascadeColliderBase.cc.

125 {
126 if (!balance) return true; // Skip checks unless requested
127
128 if (verboseLevel > 1)
129 G4cout << " >>> " << theName << "::validateOutput" << G4endl;
130
131 // Show final state particles
132 if (verboseLevel > 2) output.printCollisionOutput();
133
135 balance->collide(bullet, target, output);
136 return balance->okay(); // Returns false if violations
137}
void printCollisionOutput(std::ostream &os=G4cout) const

Referenced by G4ElementaryParticleCollider::collide(), and G4InuclCollider::deexcite().

Member Data Documentation

◆ balance

◆ interCase


The documentation for this class was generated from the following files: