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

#include <G4CrossSectionComposite.hh>

+ Inheritance diagram for G4CrossSectionComposite:

Public Member Functions

 G4CrossSectionComposite ()
 
virtual ~G4CrossSectionComposite ()
 
G4bool operator== (const G4CrossSectionComposite &right) const
 
G4bool operator!= (const G4CrossSectionComposite &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual const G4CrossSectionVectorGetComponents () const =0
 
virtual G4bool IsValid (G4double e) const
 
 G4CrossSectionComposite ()
 
virtual ~G4CrossSectionComposite ()
 
G4bool operator== (const G4CrossSectionComposite &right) const
 
G4bool operator!= (const G4CrossSectionComposite &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2)
 
virtual void Add (G4CrossSectionComposite *component)
 
virtual void Remove (G4CrossSectionComposite *component)
 
- Public Member Functions inherited from G4VCrossSectionSource
 G4VCrossSectionSource ()
 
virtual ~G4VCrossSectionSource ()
 
G4bool operator== (const G4VCrossSectionSource &right) const
 
G4bool operator!= (const G4VCrossSectionSource &right) const
 
virtual G4String Name () const =0
 
virtual void Print () const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4double HighLimit () const
 
virtual G4double LowLimit () const
 

Protected Attributes

G4CrossSectionVector_components
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionSource
G4bool InLimits (G4double e, G4double eLow, G4double eHigh) const
 
const G4ParticleDefinitionFindLightParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4double FcrossX (G4double e, G4double e0, G4double sigma, G4double eParam, G4double power) const
 
const G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 

Detailed Description

Definition at line 50 of file G4CrossSectionComposite.hh.

Constructor & Destructor Documentation

◆ G4CrossSectionComposite() [1/2]

G4CrossSectionComposite::G4CrossSectionComposite ( )

Definition at line 48 of file G4CrossSectionComposite.cc.

49{ }

◆ ~G4CrossSectionComposite() [1/2]

G4CrossSectionComposite::~G4CrossSectionComposite ( )
virtual

Definition at line 52 of file G4CrossSectionComposite.cc.

53{ }

◆ G4CrossSectionComposite() [2/2]

G4CrossSectionComposite::G4CrossSectionComposite ( )

◆ ~G4CrossSectionComposite() [2/2]

virtual G4CrossSectionComposite::~G4CrossSectionComposite ( )
virtual

Member Function Documentation

◆ Add()

virtual void G4CrossSectionComposite::Add ( G4CrossSectionComposite * component)
virtual

◆ CrossSection() [1/2]

virtual G4double G4CrossSectionComposite::CrossSection ( const G4KineticTrack & trk1,
const G4KineticTrack & trk2 )
virtual

◆ CrossSection() [2/2]

G4double G4CrossSectionComposite::CrossSection ( const G4KineticTrack & trk1,
const G4KineticTrack & trk2 ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 68 of file G4CrossSectionComposite.cc.

70{
71 // Cross section of composite is the sum of components cross sections
72
73 G4double crossSection = 0.;
74 G4double ecm = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
75
76 const G4CrossSectionVector* components = GetComponents();
77 if (components != 0)
78 {
79 std::size_t nComponents = GetComponents()->size();
80 for (std::size_t i=0; i<nComponents; ++i)
81 {
82 G4CrossSectionSourcePtr componentPtr = (*components)[i];
83 G4VCrossSectionSource* component = componentPtr();
84 if (component->IsValid(ecm))
85 {
86 crossSection += component->CrossSection(trk1,trk2);
87 }
88 }
89 }
90 return crossSection;
91}
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector
double G4double
Definition G4Types.hh:83
virtual const G4CrossSectionVector * GetComponents() const =0
const G4LorentzVector & Get4Momentum() const
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
virtual G4bool IsValid(G4double e) const

◆ GetComponents()

virtual const G4CrossSectionVector * G4CrossSectionComposite::GetComponents ( ) const
pure virtual

Implements G4VCrossSectionSource.

Referenced by CrossSection(), and IsValid().

◆ IsValid()

G4bool G4CrossSectionComposite::IsValid ( G4double e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 94 of file G4CrossSectionComposite.cc.

95{
96 // The composite is valid if any of its components are valid
97 G4bool answer = false;
98 const G4CrossSectionVector* components = GetComponents();
99 if (components != 0)
100 {
101 std::size_t n = components->size();
102 for (std::size_t i=0; i<n; ++i)
103 {
104 G4CrossSectionSourcePtr componentPtr = (*components)[i];
105 G4VCrossSectionSource* component = componentPtr();
106 if (component->IsValid(e))
107 {
108 answer = true;
109 break;
110 }
111 }
112 }
113 return answer;
114}
bool G4bool
Definition G4Types.hh:86

◆ operator!=() [1/2]

G4bool G4CrossSectionComposite::operator!= ( const G4CrossSectionComposite & right) const

Definition at line 62 of file G4CrossSectionComposite.cc.

63{
64 return (this != (G4CrossSectionComposite*) &right);
65}

◆ operator!=() [2/2]

G4bool G4CrossSectionComposite::operator!= ( const G4CrossSectionComposite & right) const

◆ operator==() [1/2]

G4bool G4CrossSectionComposite::operator== ( const G4CrossSectionComposite & right) const

Definition at line 56 of file G4CrossSectionComposite.cc.

57{
58 return (this == (G4CrossSectionComposite*) &right);
59}

◆ operator==() [2/2]

G4bool G4CrossSectionComposite::operator== ( const G4CrossSectionComposite & right) const

◆ Remove()

virtual void G4CrossSectionComposite::Remove ( G4CrossSectionComposite * component)
virtual

Member Data Documentation

◆ _components

G4CrossSectionVector* G4CrossSectionComposite::_components
protected

Definition at line 69 of file G4VCrossSectionComposite.hh.


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