Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4CrossSectionComposite Class Referenceabstract

#include <G4CrossSectionComposite.hh>

Inheritance diagram for G4CrossSectionComposite:
Collaboration 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
G4CrossSectionVector
GetComponents () 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::G4CrossSectionComposite ( )

Definition at line 48 of file G4CrossSectionComposite.cc.

49 { }
G4CrossSectionComposite::~G4CrossSectionComposite ( )
virtual

Definition at line 52 of file G4CrossSectionComposite.cc.

53 { }
G4CrossSectionComposite::G4CrossSectionComposite ( )
virtual G4CrossSectionComposite::~G4CrossSectionComposite ( )
virtual

Member Function Documentation

virtual void G4CrossSectionComposite::Add ( G4CrossSectionComposite component)
virtual
virtual G4double G4CrossSectionComposite::CrossSection ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
)
virtual
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  G4int nComponents = this->GetComponents()->size();
80 // G4int nValid = 0;
81 
82  G4int i;
83  for (i=0; i<nComponents; i++)
84  {
85  G4CrossSectionSourcePtr componentPtr = (*components)[i];
86  G4VCrossSectionSource* component = componentPtr();
87  if (component->IsValid(ecm))
88  {
89  crossSection += component->CrossSection(trk1,trk2);
90  }
91  }
92  }
93 
94  return crossSection;
95 }
virtual const G4CrossSectionVector * GetComponents() const =0
int G4int
Definition: G4Types.hh:78
virtual G4bool IsValid(G4double e) const
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0

Here is the call graph for this function:

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

Implements G4VCrossSectionSource.

Here is the caller graph for this function:

G4bool G4CrossSectionComposite::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 98 of file G4CrossSectionComposite.cc.

99 {
100  // The composite is valid if any of its components are valid
101  G4bool answer = false;
102  const G4CrossSectionVector* components = GetComponents();
103  if (components != 0)
104  {
105  G4int n = components->size();
106  G4int i;
107  for (i=0; i<n; i++)
108  {
109  G4CrossSectionSourcePtr componentPtr = (*components)[i];
110  G4VCrossSectionSource* component = componentPtr();
111  if (component->IsValid(e))
112  {
113  answer = true;
114  break;
115  }
116  }
117  }
118  return answer;
119 }
virtual const G4CrossSectionVector * GetComponents() const =0
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
const G4int n
virtual G4bool IsValid(G4double e) const
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector

Here is the call graph for this function:

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

Definition at line 62 of file G4CrossSectionComposite.cc.

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

Definition at line 56 of file G4CrossSectionComposite.cc.

57 {
58  return (this == (G4CrossSectionComposite*) &right);
59 }
virtual void G4CrossSectionComposite::Remove ( G4CrossSectionComposite component)
virtual

Member Data Documentation

G4CrossSectionVector* G4CrossSectionComposite::_components
protected

Definition at line 69 of file G4VCrossSectionComposite.hh.


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