Geant4 11.2.2
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 139 of file G4VCollision.cc.

140{
141}

◆ ~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 != nullptr)
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 ( )

Definition at line 143 of file G4VCollision.cc.

144{
145}

Referenced by G4VScatteringCollision::establish_G4MT_TLS_G4VScatteringCollision().

◆ 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()

◆ 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 = (G4int)components->size();
84 }
85 G4cout << "---- " << name << "---- has " << nComponents << " components" <<G4endl;
86 G4int i = 0;
87 if (components)
88 {
89 for (auto iter = components->cbegin(); iter != components->cend(); ++iter)
90 {
91 G4cout << "---- " << name << " ---- Component " << i << G4endl;
92 ((*iter))->Print();
93 ++i;
94 }
95 }
96}
std::vector< G4VCollision * > G4CollisionVector
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
virtual const G4CollisionVector * GetComponents() const
virtual void Print() const
virtual G4String GetName() const =0
virtual void Print() const
const char * name(G4int ptype)

Referenced by Print(), and Print().

◆ Print() [2/2]

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

Definition at line 99 of file G4VCollision.cc.

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

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