Geant4 9.6.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 ()
 
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 (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 40 of file G4VCollision.hh.

Constructor & Destructor Documentation

◆ G4VCollision()

G4VCollision::G4VCollision ( )

Definition at line 35 of file G4VCollision.cc.

36{ }

◆ ~G4VCollision()

G4VCollision::~G4VCollision ( )
virtual

Definition at line 38 of file G4VCollision.cc.

39{
40}

Member Function Documentation

◆ CrossSection()

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

Reimplemented in G4CollisionComposite, and G4CollisionNN.

Definition at line 55 of file G4VCollision.cc.

57{
58 G4double sigma = 0.;
59
61
62 if (xSource != 0)
63 {
64 // There is a cross section for this Collision
65 sigma = xSource->CrossSection(aTrk1,aTrk2);
66 }
67 return sigma;
68}
double G4double
Definition: G4Types.hh:64
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().

◆ FinalState()

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

◆ GetAngularDistribution()

◆ GetComponents()

◆ GetCrossSectionSource()

◆ GetListOfColliders()

◆ GetName()

◆ GetNumberOfPartons()

G4int G4VCollision::GetNumberOfPartons ( G4ParticleDefinition aP) const
inlineprotected

Definition at line 67 of file G4VCollision.hh.

68 {
69 G4int result = 0;
70 for(G4int i=0; i<6; i++)
71 {
72 result += aP->GetQuarkContent(i+1);
73 result += aP->GetAntiQuarkContent(i+1);
74 }
75 return result;
76 }
int G4int
Definition: G4Types.hh:66
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 49 of file G4VCollision.cc.

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

◆ operator==()

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

Definition at line 43 of file G4VCollision.cc.

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

◆ Print() [1/2]

void G4VCollision::Print ( ) const
virtual

Definition at line 71 of file G4VCollision.cc.

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

Referenced by Print().

◆ Print() [2/2]

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

Definition at line 102 of file G4VCollision.cc.

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

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