G4StatMFMacroCanonical Class Reference

#include <G4StatMFMacroCanonical.hh>

Inheritance diagram for G4StatMFMacroCanonical:

G4VStatMFEnsemble

Public Member Functions

 G4StatMFMacroCanonical (G4Fragment const &theFragment)
 ~G4StatMFMacroCanonical ()
G4StatMFChannelChooseAandZ (const G4Fragment &theFragment)

Data Structures

struct  DeleteFragment

Detailed Description

Definition at line 49 of file G4StatMFMacroCanonical.hh.


Constructor & Destructor Documentation

G4StatMFMacroCanonical::G4StatMFMacroCanonical ( G4Fragment const &  theFragment  ) 

Definition at line 44 of file G4StatMFMacroCanonical.cc.

References G4StatMFMacroCanonical(), and G4Fragment::GetA_asInt().

Referenced by G4StatMFMacroCanonical().

00045 {
00046 
00047   // Get memory for clusters
00048   _theClusters.push_back(new G4StatMFMacroNucleon);              // Size 1
00049   _theClusters.push_back(new G4StatMFMacroBiNucleon);            // Size 2
00050   _theClusters.push_back(new G4StatMFMacroTriNucleon);           // Size 3
00051   _theClusters.push_back(new G4StatMFMacroTetraNucleon);         // Size 4
00052   for (G4int i = 4; i < theFragment.GetA_asInt(); i++)   
00053     _theClusters.push_back(new G4StatMFMacroMultiNucleon(i+1)); // Size 5 ... A
00054   
00055   // Perform class initialization
00056   Initialize(theFragment);
00057     
00058 }

G4StatMFMacroCanonical::~G4StatMFMacroCanonical (  ) 

Definition at line 61 of file G4StatMFMacroCanonical.cc.

00062 {
00063   // garbage collection
00064   if (!_theClusters.empty()) 
00065     {
00066       std::for_each(_theClusters.begin(),_theClusters.end(),DeleteFragment());
00067     }
00068 }


Member Function Documentation

G4StatMFChannel * G4StatMFMacroCanonical::ChooseAandZ ( const G4Fragment theFragment  )  [virtual]

Implements G4VStatMFEnsemble.

Definition at line 127 of file G4StatMFMacroCanonical.cc.

References G4Fragment::GetA_asInt(), and G4Fragment::GetZ_asInt().

Referenced by G4StatMF::BreakItUp().

00129 {
00130   G4int A = theFragment.GetA_asInt();
00131   G4int Z = theFragment.GetZ_asInt();
00132   
00133   std::vector<G4int> ANumbers(A);
00134   
00135   G4double Multiplicity = ChooseA(A,ANumbers);
00136   
00137   std::vector<G4int> FragmentsA;
00138   
00139   G4int i = 0;  
00140     for (i = 0; i < A; i++) 
00141       {
00142         for (G4int j = 0; j < ANumbers[i]; j++) FragmentsA.push_back(i+1);
00143       }
00144     
00145     // Sort fragments in decreasing order
00146     G4int im = 0;
00147     for (G4int j = 0; j < Multiplicity; j++) 
00148       {
00149         G4int FragmentsAMax = 0;
00150         im = j;
00151         for (i = j; i < Multiplicity; i++) 
00152           {
00153             if (FragmentsA[i] <= FragmentsAMax) { continue; }
00154             else 
00155               {
00156                 im = i;
00157                 FragmentsAMax = FragmentsA[im];
00158               }
00159           }
00160         
00161         if (im != j) 
00162           {
00163             FragmentsA[im] = FragmentsA[j];
00164             FragmentsA[j]  = FragmentsAMax;
00165           }
00166       }
00167     
00168     return ChooseZ(Z,FragmentsA);
00169 }


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