G4CascadeFunctions< DATA, SAMP > Class Template Reference

#include <G4CascadeFunctions.hh>

Inheritance diagram for G4CascadeFunctions< DATA, SAMP >:

G4CascadeChannel

Public Member Functions

 G4CascadeFunctions ()
virtual ~G4CascadeFunctions ()
virtual G4double getCrossSection (double ke) const
virtual G4double getCrossSectionSum (double ke) const
virtual G4int getMultiplicity (G4double ke) const
virtual void getOutgoingParticleTypes (std::vector< G4int > &kinds, G4int mult, G4double ke) const
virtual void printTable (std::ostream &os=G4cout) const

Detailed Description

template<class DATA, class SAMP>
class G4CascadeFunctions< DATA, SAMP >

Definition at line 55 of file G4CascadeFunctions.hh.


Constructor & Destructor Documentation

template<class DATA, class SAMP>
G4CascadeFunctions< DATA, SAMP >::G4CascadeFunctions (  ) 

Definition at line 49 of file G4CascadeFunctions.icc.

00049 : SAMP() {}

template<class DATA, class SAMP>
virtual G4CascadeFunctions< DATA, SAMP >::~G4CascadeFunctions (  )  [inline, virtual]

Definition at line 58 of file G4CascadeFunctions.hh.

00058 {}


Member Function Documentation

template<class DATA, class SAMP>
virtual G4double G4CascadeFunctions< DATA, SAMP >::getCrossSection ( double  ke  )  const [inline, virtual]

Implements G4CascadeChannel.

Definition at line 60 of file G4CascadeFunctions.hh.

00060                                                     {
00061     return this->findCrossSection(ke, DATA::data.tot);
00062   }

template<class DATA, class SAMP>
virtual G4double G4CascadeFunctions< DATA, SAMP >::getCrossSectionSum ( double  ke  )  const [inline, virtual]

Implements G4CascadeChannel.

Definition at line 64 of file G4CascadeFunctions.hh.

00064                                                        {
00065     return this->findCrossSection(ke, DATA::data.sum);
00066   }

template<class DATA, class SAMP>
G4int G4CascadeFunctions< DATA, SAMP >::getMultiplicity ( G4double  ke  )  const [virtual]

Implements G4CascadeChannel.

Definition at line 56 of file G4CascadeFunctions.icc.

References G4UniformRand.

00056                                                                       {
00057   // Use pointer comparison to see whether tot is just a ref to sum)
00058   if (&DATA::data.sum != &DATA::data.tot) {
00059     G4double summed = this->findCrossSection(ke, DATA::data.sum); 
00060     G4double total  = this->findCrossSection(ke, DATA::data.tot);
00061     if (G4UniformRand() > summed/total) return DATA::data.maxMultiplicity();
00062   }
00063 
00064   return this->findMultiplicity(ke, DATA::data.multiplicities);
00065 }

template<class DATA, class SAMP>
void G4CascadeFunctions< DATA, SAMP >::getOutgoingParticleTypes ( std::vector< G4int > &  kinds,
G4int  mult,
G4double  ke 
) const [virtual]

Implements G4CascadeChannel.

Definition at line 72 of file G4CascadeFunctions.icc.

References G4cerr, G4cout, and G4endl.

00073                                                         {
00074   const G4int maxMult = DATA::data.maxMultiplicity();
00075 
00076   if (mult > maxMult) {
00077     G4cerr << " Illegal multiplicity " << mult << " > " << maxMult << G4endl;
00078     mult = maxMult;
00079   }
00080 
00081   kinds.clear();
00082   kinds.reserve(mult);
00083 
00084   G4int channel = this->findFinalStateIndex(mult, ke, DATA::data.index,
00085                                             DATA::data.crossSections);
00086 #ifdef G4CASCADE_DEBUG_SAMPLER
00087   G4cout << " getOutgoingParticleTypes: mult=" << mult << " KE=" << ke
00088          << ": channel=" << channel << G4endl;
00089 #endif
00090 
00091   // Identify final-state array to be copied
00092   const G4int* chan = 0;
00093   if (mult == 2) chan = DATA::data.x2bfs[channel];
00094   if (mult == 3) chan = DATA::data.x3bfs[channel];
00095   if (mult == 4) chan = DATA::data.x4bfs[channel];
00096   if (mult == 5) chan = DATA::data.x5bfs[channel];
00097   if (mult == 6) chan = DATA::data.x6bfs[channel];
00098   if (mult == 7) chan = DATA::data.x7bfs[channel];
00099   if (mult == 8) chan = DATA::data.x8bfs[channel];
00100   if (mult == 9) chan = DATA::data.x9bfs[channel];
00101 
00102   if (!chan) {
00103     G4cerr << " getOutgoingParticleTypes: invalid multiplicity " << mult
00104            << G4endl;
00105     return;
00106   }
00107 
00108   kinds.insert(kinds.begin(), chan, chan+mult); // Transfer data into vector
00109   return;
00110 }

template<class DATA, class SAMP>
void G4CascadeFunctions< DATA, SAMP >::printTable ( std::ostream &  os = G4cout  )  const [virtual]

Implements G4CascadeChannel.

Definition at line 116 of file G4CascadeFunctions.icc.

References G4endl, and print().

00116                                                                    {
00117   os << " ---------- " << DATA::data.name << " ----------" << G4endl;
00118   SAMP::print(os);
00119   DATA::data.print(os);
00120   os << " ------------------------------" << G4endl;
00121 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:35 2013 for Geant4 by  doxygen 1.4.7