Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VCollision Class Referenceabstract

#include <G4VCollision.hh>

+ Inheritance diagram for G4VCollision:

Public Member Functions

 G4VCollision ()
 
void establish_G4MT_TLS_G4VCollision ()
 
 G4VCollision (void *s1, void *s2, void *s3, void *s4, void *s5, void *s6, void *s7)
 
virtual ~G4VCollision ()
 
G4bool operator== (const G4VCollision &right) const
 
G4bool operator!= (const G4VCollision &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4KineticTrackVectorFinalState (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
virtual G4bool IsInCharge (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
virtual G4String GetName () const =0
 
virtual void Print () const
 
virtual void Print (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 

Protected Member Functions

G4int GetNumberOfPartons (const G4ParticleDefinition *aP) const
 
virtual const G4CollisionVectorGetComponents () const
 
virtual const G4VCrossSectionSourceGetCrossSectionSource () const =0
 
virtual const G4VAngularDistributionGetAngularDistribution () const =0
 
virtual const std::vector< G4String > & GetListOfColliders (G4int whichOne) const =0
 

Detailed Description

Definition at line 39 of file G4VCollision.hh.

Constructor & Destructor Documentation

◆ G4VCollision() [1/2]

G4VCollision::G4VCollision ( )

Definition at line 34 of file G4VCollision.cc.

35{ }

◆ G4VCollision() [2/2]

G4VCollision::G4VCollision ( void *  s1,
void *  s2,
void *  s3,
void *  s4,
void *  s5,
void *  s6,
void *  s7 
)

Definition at line 142 of file G4VCollision.cc.

142{}

◆ ~G4VCollision()

G4VCollision::~G4VCollision ( )
virtual

Definition at line 37 of file G4VCollision.cc.

38{
39}

Member Function Documentation

◆ CrossSection()

G4double G4VCollision::CrossSection ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtual

Reimplemented in G4CollisionComposite, and G4CollisionNN.

Definition at line 54 of file G4VCollision.cc.

56{
57 G4double sigma = 0.;
58
60
61 if (xSource != 0)
62 {
63 // There is a cross section for this Collision
64 sigma = xSource->CrossSection(aTrk1,aTrk2);
65 }
66 return sigma;
67}
double G4double
Definition: G4Types.hh:83
virtual const G4VCrossSectionSource * GetCrossSectionSource() const =0
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0

Referenced by G4Scatterer::GetCrossSection(), G4Scatterer::GetTimeToInteraction(), Print(), and G4Scatterer::Scatter().

◆ establish_G4MT_TLS_G4VCollision()

void G4VCollision::establish_G4MT_TLS_G4VCollision ( )

◆ FinalState()

virtual G4KineticTrackVector * G4VCollision::FinalState ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
pure virtual

◆ GetAngularDistribution()

◆ GetComponents()

◆ GetCrossSectionSource()

◆ GetListOfColliders()

◆ GetName()

◆ GetNumberOfPartons()

G4int G4VCollision::GetNumberOfPartons ( const G4ParticleDefinition aP) const
inlineprotected

Definition at line 68 of file G4VCollision.hh.

69 {
70 G4int result = 0;
71 for(G4int i=0; i<6; i++)
72 {
73 result += aP->GetQuarkContent(i+1);
74 result += aP->GetAntiQuarkContent(i+1);
75 }
76 return result;
77 }
int G4int
Definition: G4Types.hh:85
G4int GetQuarkContent(G4int flavor) const
G4int GetAntiQuarkContent(G4int flavor) const

Referenced by G4CollisionMesonBaryonElastic::IsInCharge().

◆ IsInCharge()

virtual G4bool G4VCollision::IsInCharge ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
pure virtual

◆ operator!=()

G4bool G4VCollision::operator!= ( const G4VCollision right) const

Definition at line 48 of file G4VCollision.cc.

49{
50 return (this != (G4VCollision *) &right);
51}

◆ operator==()

G4bool G4VCollision::operator== ( const G4VCollision right) const

Definition at line 42 of file G4VCollision.cc.

43{
44 return (this == (G4VCollision *) &right);
45}

◆ Print() [1/2]

void G4VCollision::Print ( ) const
virtual

Definition at line 70 of file G4VCollision.cc.

71{
73
74 G4cout << "---- " << name << "---- Cross section" << G4endl;
75
77 if (xSource) xSource->Print();
78
79 G4int nComponents = 0;
80 const G4CollisionVector* components = GetComponents();
81 if (components)
82 {
83 nComponents = components->size();
84 }
85 G4cout << "---- " << name << "---- has " << nComponents << " components" <<G4endl;
86 G4int i = 0;
87 G4CollisionVector::const_iterator iter;
88 if (components)
89 {
90 for (iter = components->begin(); iter != components->end(); ++iter)
91 {
92 G4cout << "---- " << name << " ---- Component " << i << G4endl;
93 ((*iter))->Print();
94 i++;
95 }
96 }
97
98}
std::vector< G4VCollision * > G4CollisionVector
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual const G4CollisionVector * GetComponents() const
Definition: G4VCollision.hh:79
virtual void Print() const
Definition: G4VCollision.cc:70
virtual G4String GetName() const =0
virtual void Print() const
const char * name(G4int ptype)

Referenced by Print().

◆ Print() [2/2]

void G4VCollision::Print ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtual

Definition at line 101 of file G4VCollision.cc.

103{
105
106 if (IsInCharge(trk1,trk2))
107 {
108 G4cout << "---- " << name << "is in charge ---- " << G4endl;
109 }
110 else
111 {
112 G4cout << "---- " << name << "is not in charge ---- " << G4endl;
113 }
114
115 G4cout << "---- " << name << "---- Cross section" << G4endl;
116
118 if (xSource) xSource->Print();
119 G4cout << "Cross section = " << CrossSection(trk1,trk2) << G4endl;
120
121 G4int nComponents = 0;
122 const G4CollisionVector* components = GetComponents();
123 if (components)
124 {
125 nComponents = components->size();
126 }
127 G4cout << "---- " << name << "has " << nComponents << " components" <<G4endl;
128
129 G4int i = 0;
130 G4CollisionVector::const_iterator iter;
131 if (components)
132 {
133 for (iter = components->begin(); iter != components->end(); ++iter)
134 {
135 G4cout << "Component " << i << G4endl;
136 ((*iter))->Print();
137 i++;
138 }
139 }
140}
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
Definition: G4VCollision.cc:54
virtual G4bool IsInCharge(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0

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