Geant4-11
Public Member Functions | Private Attributes
G4InteractionCase Class Reference

#include <G4InteractionCase.hh>

Public Member Functions

void clear ()
 
G4int code () const
 
 G4InteractionCase ()
 
 G4InteractionCase (G4InuclParticle *part1, G4InuclParticle *part2)
 
G4InuclParticlegetBullet () const
 
G4InuclParticlegetTarget () const
 
G4bool hadNucleus () const
 
G4int hadrons () const
 
void set (G4InuclParticle *part1, G4InuclParticle *part2)
 
G4bool twoNuclei () const
 
G4bool valid () const
 

Private Attributes

G4InuclParticlebullet
 
G4int inter_case
 
G4InuclParticletarget
 

Detailed Description

Definition at line 39 of file G4InteractionCase.hh.

Constructor & Destructor Documentation

◆ G4InteractionCase() [1/2]

G4InteractionCase::G4InteractionCase ( )
inline

Definition at line 41 of file G4InteractionCase.hh.

41: bullet(0), target(0), inter_case(0) {}
G4InuclParticle * target
G4InuclParticle * bullet

◆ G4InteractionCase() [2/2]

G4InteractionCase::G4InteractionCase ( G4InuclParticle part1,
G4InuclParticle part2 
)
inline

Definition at line 43 of file G4InteractionCase.hh.

43 {
44 set(part1, part2);
45 }
void set(G4InuclParticle *part1, G4InuclParticle *part2)

References set().

Member Function Documentation

◆ clear()

void G4InteractionCase::clear ( )
inline

Definition at line 49 of file G4InteractionCase.hh.

49 {
50 bullet = target = 0;
51 inter_case = 0;
52 }

References bullet, inter_case, and target.

Referenced by set().

◆ code()

G4int G4InteractionCase::code ( ) const
inline

Definition at line 64 of file G4InteractionCase.hh.

64{ return ((inter_case<0) ? -inter_case : 0); }

References inter_case.

Referenced by G4InuclCollider::collide(), and G4IntraNucleiCascader::newCascade().

◆ getBullet()

G4InuclParticle * G4InteractionCase::getBullet ( ) const
inline

◆ getTarget()

G4InuclParticle * G4InteractionCase::getTarget ( ) const
inline

◆ hadNucleus()

G4bool G4InteractionCase::hadNucleus ( ) const
inline

Definition at line 60 of file G4InteractionCase.hh.

60{ return inter_case == -1; }

References inter_case.

Referenced by G4InuclCollider::collide(), and G4IntraNucleiCascader::setupCascade().

◆ hadrons()

G4int G4InteractionCase::hadrons ( ) const
inline

Definition at line 61 of file G4InteractionCase.hh.

61{ return inter_case; } // "rtype" or "is" code

References inter_case.

Referenced by G4ElementaryParticleCollider::collide(), and G4ElementaryParticleCollider::pionNucleonAbsorption().

◆ set()

void G4InteractionCase::set ( G4InuclParticle part1,
G4InuclParticle part2 
)

Definition at line 38 of file G4InteractionCase.cc.

39 {
40 clear(); // Reset everything in case of failure
41
42 // See which one of the two (or both) is a nucleus
43 G4InuclNuclei* nucl1 = dynamic_cast<G4InuclNuclei*>(part1);
44 G4InuclNuclei* nucl2 = dynamic_cast<G4InuclNuclei*>(part2);
45
46 G4InuclElementaryParticle* had1 = dynamic_cast<G4InuclElementaryParticle*>(part1);
47 G4InuclElementaryParticle* had2 = dynamic_cast<G4InuclElementaryParticle*>(part2);
48
49 if (nucl1 && nucl2) { // Nuclear collision, lighter is projectile
50 inter_case = -2;
51 if (nucl2->getA() >= nucl1->getA()) {
52 bullet = part1;
53 target = part2;
54 } else {
55 bullet = part2;
56 target = part1;
57 }
58 } else if (nucl1 || nucl2) { // Hadron on nucleus, hadron projectile
59 inter_case = -1;
60 if (nucl1 && had2) {
61 bullet = part2;
62 target = part1;
63 } else {
64 bullet = part1;
65 target = part2;
66 }
67 } else if (had1 && had2) { // Hadron-hadron interaction, order irrelevant
68 inter_case = had1->type() * had2->type();
69 bullet = part1;
70 target = part2;
71 }
72}
G4int getA() const

References bullet, clear(), G4InuclNuclei::getA(), inter_case, target, and G4InuclElementaryParticle::type().

Referenced by G4InuclCollider::collide(), G4ElementaryParticleCollider::collide(), G4InteractionCase(), and G4IntraNucleiCascader::initialize().

◆ twoNuclei()

G4bool G4InteractionCase::twoNuclei ( ) const
inline

Definition at line 59 of file G4InteractionCase.hh.

59{ return inter_case == -2; }

References inter_case.

Referenced by G4InuclCollider::photonuclearOkay().

◆ valid()

G4bool G4InteractionCase::valid ( ) const
inline

Definition at line 57 of file G4InteractionCase.hh.

57{ return inter_case != 0; }

References inter_case.

Referenced by G4InuclCollider::collide().

Field Documentation

◆ bullet

G4InuclParticle* G4InteractionCase::bullet
private

Definition at line 67 of file G4InteractionCase.hh.

Referenced by clear(), getBullet(), and set().

◆ inter_case

G4int G4InteractionCase::inter_case
private

Definition at line 70 of file G4InteractionCase.hh.

Referenced by clear(), code(), hadNucleus(), hadrons(), set(), twoNuclei(), and valid().

◆ target

G4InuclParticle* G4InteractionCase::target
private

Definition at line 68 of file G4InteractionCase.hh.

Referenced by clear(), getTarget(), and set().


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