Ignore:
Timestamp:
Apr 6, 2009, 12:30:29 PM (15 years ago)
Author:
garnier
Message:

update processes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/util/src/G4Fancy3DNucleus.cc

    r819 r962  
    3737#include "G4NuclearFermiDensity.hh"
    3838#include "G4NuclearShellModelDensity.hh"
    39 #include "G4NucleiPropertiesTable.hh"
     39#include "G4NucleiProperties.hh"
    4040#include "Randomize.hh"
    4141#include "G4ios.hh"
    4242#include <algorithm>
    4343#include "G4HadronicException.hh"
     44
    4445
    4546G4Fancy3DNucleus::G4Fancy3DNucleus()
     
    131132}
    132133
     134   bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon* nuc1, const G4Nucleon* nuc2)
     135{
     136        return nuc1->GetPosition().z() < nuc2->GetPosition().z();
     137}   
     138
     139void G4Fancy3DNucleus::SortNucleonsInZ()
     140{
     141       
     142        GetNucleons();   // make sure theRWNucleons is initialised
     143
     144        if (theRWNucleons.size() < 2 ) return;
     145
     146        sort( theRWNucleons.begin(),theRWNucleons.end(),G4Fancy3DNucleusHelperForSortInZ);
     147
     148// now copy sorted nucleons to theNucleons array. TheRWNucleons are pointers in theNucleons
     149//  so we need to copy to new, and then swap.
     150        G4Nucleon * sortedNucleons = new G4Nucleon[myA];
     151        for ( unsigned int i=0; i<theRWNucleons.size(); i++ )
     152        {
     153           sortedNucleons[i]= *(theRWNucleons[i]);
     154        }
     155
     156        theRWNucleons.clear();   // about to delete array these point to....
     157        delete [] theNucleons;
     158       
     159        theNucleons=sortedNucleons;
     160
     161        return;
     162}
     163
     164
    133165G4double G4Fancy3DNucleus::BindingEnergy()
    134166{
    135         return G4NucleiPropertiesTable::GetBindingEnergy(myZ,myA);
    136 }
     167  return G4NucleiProperties::GetBindingEnergy(myA,myZ);
     168}
     169
    137170
    138171G4double G4Fancy3DNucleus::GetNuclearRadius()
     
    261294        G4bool          freeplace;
    262295        static G4double nd2 = sqr(nucleondistance);
    263         G4double maxR=GetNuclearRadius(0.01);   //  there are no nucleons at a
     296        G4double maxR=GetNuclearRadius(0.001);   //  there are no nucleons at a
    264297                                                //  relative Density of 0.01
    265298        G4int jr=0;
Note: See TracChangeset for help on using the changeset viewer.