Geant4  10.02.p03
G4InteractionCase Class Reference

#include <G4InteractionCase.hh>

Collaboration diagram for G4InteractionCase:

Public Member Functions

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

Private Attributes

G4InuclParticle * bullet
 
G4InuclParticle * target
 
G4int inter_case
 

Detailed Description

Definition at line 40 of file G4InteractionCase.hh.

Constructor & Destructor Documentation

◆ G4InteractionCase() [1/2]

G4InteractionCase::G4InteractionCase ( )
inline

Definition at line 42 of file G4InteractionCase.hh.

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

◆ G4InteractionCase() [2/2]

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

Definition at line 44 of file G4InteractionCase.hh.

44  {
45  set(part1, part2);
46  }

Member Function Documentation

◆ clear()

void G4InteractionCase::clear ( void  )
inline

Definition at line 50 of file G4InteractionCase.hh.

50  {
51  bullet = target = 0;
52  inter_case = 0;
53  }
G4InuclParticle * bullet
G4InuclParticle * target
Here is the caller graph for this function:

◆ code()

G4int G4InteractionCase::code ( ) const
inline

Definition at line 65 of file G4InteractionCase.hh.

65 { return ((inter_case<0) ? -inter_case : 0); }
Here is the caller graph for this function:

◆ getBullet()

G4InuclParticle* G4InteractionCase::getBullet ( ) const
inline

Definition at line 55 of file G4InteractionCase.hh.

55 { return bullet; }
G4InuclParticle * bullet
Here is the caller graph for this function:

◆ getTarget()

G4InuclParticle* G4InteractionCase::getTarget ( ) const
inline

Definition at line 56 of file G4InteractionCase.hh.

56 { return target; }
G4InuclParticle * target
Here is the caller graph for this function:

◆ hadNucleus()

G4bool G4InteractionCase::hadNucleus ( ) const
inline

Definition at line 61 of file G4InteractionCase.hh.

61 { return inter_case == -1; }
Here is the caller graph for this function:

◆ hadrons()

G4int G4InteractionCase::hadrons ( ) const
inline

Definition at line 62 of file G4InteractionCase.hh.

62 { return inter_case; } // "rtype" or "is" code
Here is the caller graph for this function:

◆ set()

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

Definition at line 39 of file G4InteractionCase.cc.

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

◆ twoNuclei()

G4bool G4InteractionCase::twoNuclei ( ) const
inline

Definition at line 60 of file G4InteractionCase.hh.

60 { return inter_case == -2; }
Here is the caller graph for this function:

◆ valid()

G4bool G4InteractionCase::valid ( ) const
inline

Definition at line 58 of file G4InteractionCase.hh.

58 { return inter_case != 0; }
Here is the caller graph for this function:

Member Data Documentation

◆ bullet

G4InuclParticle* G4InteractionCase::bullet
private

Definition at line 68 of file G4InteractionCase.hh.

◆ inter_case

G4int G4InteractionCase::inter_case
private

Definition at line 71 of file G4InteractionCase.hh.

◆ target

G4InuclParticle* G4InteractionCase::target
private

Definition at line 69 of file G4InteractionCase.hh.


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