Changeset 1196 for trunk/source/processes/hadronic/models/util
- Timestamp:
- Nov 25, 2009, 5:13:58 PM (16 years ago)
- Location:
- trunk/source/processes/hadronic/models/util
- Files:
-
- 6 edited
-
History (modified) (1 diff)
-
include/G4Fancy3DNucleus.hh (modified) (1 diff)
-
include/G4Nucleon.hh (modified) (1 diff)
-
src/G4Fancy3DNucleus.cc (modified) (11 diffs)
-
src/G4KineticTrack.cc (modified) (1 diff)
-
src/G4Nucleon.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/util/History
r962 r1196 14 14 * Please list in reverse chronological order (last date on top) 15 15 --------------------------------------------------------------- 16 17 19 November 2009 Gunter Folger hadr-mod-util-V09-02-04 18 - Restore methods storing/retrieving G4SplitableHadron*, 19 now in use in FTF 20 21 13-November 2009 Gunter Folger hadr-mod-util-V09-02-03 22 -------------------------------------------------------- 23 - Correct use of G4ThreeVector, ie. avoid vector=0; 24 25 19 December 2008 V, Uzhinsky (hadr-mod-util-V09-02-02) 26 -------------------------------------------------------- 27 New method (SortNucleonsDecZ()) for sorting nucleons on decreasing Z-coordanates 28 is inserted in G4Fancy3DNucleus class. It is needed for nucleus-nucleus collision. 29 SortNucleonsInc() is re-named in SortNucleonsIncZ(). 30 31 12 December 2008 Gunter Folger (hadr-mod-util-V09-02-01) 32 ------------------------------------------------------- 33 - Correct G4Nucleon: typo, and ctor need to init isHit 34 35 10 December 2008 Gunter Folger (hadr-mod-util-V09-02-00) 36 ------------------------------------------------------- 37 - G4Nucleon.hh: Hit was storing G4SplitableHadron*, but this is no 38 longer used. Can use bool isHit instead. Avoids confusing reinterpret_cast. 16 39 17 40 24 October 2008 Dennis Wright (hadr-mod-util-V09-01-07) -
trunk/source/processes/hadronic/models/util/include/G4Fancy3DNucleus.hh
r962 r1196 85 85 void DoTranslation(const G4ThreeVector & theShift); 86 86 const G4VNuclearDensity * GetNuclearDensity() const; 87 void SortNucleonsInZ(); 87 void SortNucleonsIncZ(); // on increased Z-coordinates Uzhi 29.08.08 88 void SortNucleonsDecZ(); // on decreased Z-coordinates Uzhi 29.08.08 88 89 89 90 private: -
trunk/source/processes/hadronic/models/util/include/G4Nucleon.hh
r819 r1196 80 80 void Boost(const G4LorentzVector & aMomentum); 81 81 82 inline void Hit(G4VSplitableHadron * aHit) { theSplitableHadron=aHit;} 82 inline void Hit(G4VSplitableHadron *aHit) { theSplitableHadron=aHit;} 83 // inline void Hit(G4int ) { isHit=true;} 83 84 inline void Hit(G4int ) 84 85 { 85 86 theSplitableHadron=reinterpret_cast<G4VSplitableHadron *>(1111); 86 // G4cout << "$%$#%@%$#@%@%%% "<<theSplitableHadron<<G4endl;87 87 } 88 88 inline G4VSplitableHadron * GetSplitableHadron() const { return theSplitableHadron;} 89 90 inline G4bool AreYouHit() const 91 { 92 G4bool result = true; 93 if (theSplitableHadron==NULL) result = false; 94 return result; 95 } 96 89 inline G4bool AreYouHit() const { return theSplitableHadron!=0;} 90 97 91 private: 98 92 -
trunk/source/processes/hadronic/models/util/src/G4Fancy3DNucleus.cc
r962 r1196 68 68 if(theNucleons) delete [] theNucleons; 69 69 70 // this was delected already:71 // std::for_each(theRWNucleons.begin(), theRWNucleons.end(), DeleteNucleon());72 70 theRWNucleons.clear(); 73 71 … … 119 117 } 120 118 121 122 119 const std::vector<G4Nucleon *> & G4Fancy3DNucleus::GetNucleons() 123 120 { … … 132 129 } 133 130 131 //void G4Fancy3DNucleus::SortNucleonsIncZ() // on increased Z-coordinates Uzhi 29.08.08 132 134 133 bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon* nuc1, const G4Nucleon* nuc2) 135 134 { … … 137 136 } 138 137 139 void G4Fancy3DNucleus::SortNucleonsInZ() 138 //void G4Fancy3DNucleus::SortNucleonsInZ() 139 void G4Fancy3DNucleus::SortNucleonsIncZ() // on increased Z-coordinates Uzhi 29.08.08 140 140 { 141 141 … … 162 162 } 163 163 164 void G4Fancy3DNucleus::SortNucleonsDecZ() // on decreased Z-coordinates Uzhi 29.08.08 165 { 166 G4Nucleon * sortedNucleons = new G4Nucleon[myA]; 167 168 GetNucleons(); // make sure theRWNucleons is initialised 169 170 if (theRWNucleons.size() < 2 ) return; 171 sort( theRWNucleons.begin(),theRWNucleons.end(),G4Fancy3DNucleusHelperForSortInZ); 172 173 // now copy sorted nucleons to theNucleons array. TheRWNucleons are pointers in theNucleons 174 // so we need to copy to new, and then swap. 175 for ( unsigned int i=0; i<theRWNucleons.size(); i++ ) 176 { 177 sortedNucleons[i]= *(theRWNucleons[myA-1-i]); // Uzhi 29.08.08 178 } 179 theRWNucleons.clear(); // about to delete array elements these point to.... 180 delete [] theNucleons; 181 theNucleons=sortedNucleons; 182 183 return; 184 } 164 185 165 186 G4double G4Fancy3DNucleus::BindingEnergy() … … 300 321 G4double arand[600]; 301 322 G4double *prand=arand; 302 // G4int Attempt=0;303 323 while ( i < myA ) 304 324 { 305 325 do 306 326 { 307 // ++Attempt;308 327 if ( jr < 3 ) 309 328 { … … 350 369 } 351 370 } 352 // G4cout << "Att " << myA << " " << Attempt << G4endl;353 371 354 372 } … … 384 402 { 385 403 G4cerr << "G4Fancy3DNucleus: difficulty finding proton momentum" << G4endl; 386 mom= 0;404 mom=G4ThreeVector(0,0,0); 387 405 } 388 406 … … 400 418 // ; 401 419 // G4cout << "final sum / mag() " << sum << " / " << sum.mag() << G4endl; 402 403 420 404 421 G4double energy; … … 531 548 // Now we have a nucleon with a bigger Fermi Momentum. 532 549 // Exchange with last nucleon.. and iterate. 533 // G4cout << " Nucleon to swap with : " << swapit << G4endl;534 // G4cout << " Fermi momentum test, and better.. " << PFermi << " / "535 // << theFermi.GetFermiMomentum(density) << G4endl;536 // cout << theNucleons[swapit]<< G4endl << theNucleons[myA-1] << G4endl;537 // cout << momentum[swapit] << G4endl << momentum[myA-1] << G4endl;538 550 G4Nucleon swap= theNucleons[swapit]; 539 551 G4ThreeVector mom_swap=momentum[swapit]; … … 545 557 momentum[myA-1]=mom_swap; 546 558 pFermiM[myA-1]=pf; 547 // cout << "after swap" <<G4endl<< theNucleons[swapit] << G4endl << theNucleons[myA-1] << G4endl;548 // cout << momentum[swapit] << G4endl << momentum[myA-1] << G4endl;549 559 return ReduceSum(momentum,pFermiM); 550 560 } -
trunk/source/processes/hadronic/models/util/src/G4KineticTrack.cc
r819 r1196 487 487 // Select a possible decay channel 488 488 // 489 // G4int index1; 490 // for (index1 = nChannels - 1; index1 >= 0; index1--) 491 // cout << "DECAY Actual Width IND/ActualW " << index1 << " " << theActualWidth[index1] << G4endl; 492 // cout << "DECAY Actual Mass " << theActualMass << G4endl; 489 /* 490 G4int index1; 491 for (index1 = nChannels - 1; index1 >= 0; index1--) 492 G4cout << "DECAY Actual Width IND/ActualW " << index1 << " " << theActualWidth[index1] << G4endl; 493 G4cout << "DECAY Actual Mass " << theActualMass << G4endl; 494 */ 493 495 494 496 G4int chargeBalance = G4lrint(theDefinition->GetPDGCharge() ); -
trunk/source/processes/hadronic/models/util/src/G4Nucleon.cc
r819 r1196 37 37 38 38 G4Nucleon::G4Nucleon() 39 : theBindingE(0.) , theParticleType( NULL), theSplitableHadron(NULL)39 : theBindingE(0.) , theParticleType(0), theSplitableHadron(0) 40 40 {} 41 41
Note:
See TracChangeset
for help on using the changeset viewer.
