- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/util/src/G4Fancy3DNucleus.cc
r819 r962 37 37 #include "G4NuclearFermiDensity.hh" 38 38 #include "G4NuclearShellModelDensity.hh" 39 #include "G4NucleiProperties Table.hh"39 #include "G4NucleiProperties.hh" 40 40 #include "Randomize.hh" 41 41 #include "G4ios.hh" 42 42 #include <algorithm> 43 43 #include "G4HadronicException.hh" 44 44 45 45 46 G4Fancy3DNucleus::G4Fancy3DNucleus() … … 131 132 } 132 133 134 bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon* nuc1, const G4Nucleon* nuc2) 135 { 136 return nuc1->GetPosition().z() < nuc2->GetPosition().z(); 137 } 138 139 void 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 133 165 G4double G4Fancy3DNucleus::BindingEnergy() 134 166 { 135 return G4NucleiPropertiesTable::GetBindingEnergy(myZ,myA); 136 } 167 return G4NucleiProperties::GetBindingEnergy(myA,myZ); 168 } 169 137 170 138 171 G4double G4Fancy3DNucleus::GetNuclearRadius() … … 261 294 G4bool freeplace; 262 295 static G4double nd2 = sqr(nucleondistance); 263 G4double maxR=GetNuclearRadius(0.0 1); // there are no nucleons at a296 G4double maxR=GetNuclearRadius(0.001); // there are no nucleons at a 264 297 // relative Density of 0.01 265 298 G4int jr=0;
Note: See TracChangeset
for help on using the changeset viewer.