Changeset 1340 for trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4PreCompoundFragmentVector.hh
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4PreCompoundFragmentVector.hh
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4PreCompoundFragmentVector.hh,v 1.6 2009/02/10 16:01:37 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 26 // $Id: G4PreCompoundFragmentVector.hh,v 1.7 2010/08/28 15:16:55 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-ref-09 $ 29 28 // 30 29 // Hadronic Process: Nuclear Preequilibrium 31 30 // by V. Lara 32 31 // 33 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse 32 // Modified: 33 // 03.09.2008 by J. M. Quesada for external choice of inverse 34 34 // cross section option 35 // JMQ (06 September 2008) Also external choice has been added for: 36 // - superimposed Coulomb barrier (if useSICB=true) 35 // 06.09.2008 JMQ Also external choice has been added for: 36 // - superimposed Coulomb barrier (if useSICB=true) 37 // 27.08.2010 V.Ivanchenko simplify and make more efficient by adding extra 38 // vector of probabilities, moved constructor and destructor to source, 39 // simplify run time computations making inlined 40 // 37 41 38 42 #ifndef G4PreCompoundFragmentVector_h … … 40 44 41 45 #include "G4VPreCompoundFragment.hh" 46 #include "G4DataVector.hh" 47 #include "Randomize.hh" 48 #include "globals.hh" 49 #include <vector> 50 51 typedef std::vector<G4VPreCompoundFragment*> pcfvector; 42 52 43 53 class G4PreCompoundFragmentVector 44 54 { 45 typedef std::vector<G4VPreCompoundFragment*> pcfvector;46 55 public: 47 inline G4PreCompoundFragmentVector(pcfvector * avector); 48 inline ~G4PreCompoundFragmentVector(); 49 56 57 G4PreCompoundFragmentVector(pcfvector * avector); 58 59 ~G4PreCompoundFragmentVector(); 60 61 void SetVector(pcfvector * avector); 62 63 void SetOPTxs(G4int); 64 65 void UseSICB(G4bool); 66 67 inline void Initialize(const G4Fragment & aFragment); 68 69 inline G4double CalculateProbabilities(const G4Fragment & aFragment); 70 71 inline G4VPreCompoundFragment * ChooseFragment(); 72 50 73 private: 74 51 75 G4PreCompoundFragmentVector(const G4PreCompoundFragmentVector &right); 52 76 const G4PreCompoundFragmentVector& … … 55 79 G4bool operator!=(const G4PreCompoundFragmentVector &right) const; 56 80 57 public: 81 pcfvector * theChannels; 82 G4DataVector probabilities; 58 83 59 inline void Initialize(const G4Fragment & aFragment); 60 inline void ResetStage(); 61 inline void SetVector(pcfvector * avector); 62 63 G4double CalculateProbabilities(const G4Fragment & aFragment); 64 65 G4VPreCompoundFragment * ChooseFragment(void); 66 67 private: 68 69 pcfvector * theChannels; 70 71 G4double TotalEmissionProbability; 72 73 //for inverse cross section choice 74 public: 75 inline void SetOPTxs(G4int); 76 //for superimposed CoulomBarrier for inverse cross sections 77 inline void UseSICB(G4bool); 78 84 G4int nChannels; 79 85 80 86 }; 81 87 82 #include "G4PreCompoundFragmentVector.icc" 88 inline void 89 G4PreCompoundFragmentVector::Initialize(const G4Fragment & aFragment) 90 { 91 for (G4int i=0; i< nChannels; ++i) { 92 (*theChannels)[i]->Initialize(aFragment); 93 } 94 } 95 96 inline G4double 97 G4PreCompoundFragmentVector::CalculateProbabilities(const G4Fragment & aFragment) 98 { 99 //G4cout << "## G4PreCompoundFragmentVector::CalculateProbabilities" << G4endl; 100 G4double probtot = 0.0; 101 for (G4int i=0; i< nChannels; ++i) { 102 G4double prob = (*theChannels)[i]->CalcEmissionProbability(aFragment); 103 probtot += prob; 104 probabilities[i] = probtot; 105 //G4cout<<" prob= "<<prob<<" for "<<(*theChannels)[i]->GetName()<<G4endl; 106 } 107 return probtot; 108 } 109 110 inline G4VPreCompoundFragment* G4PreCompoundFragmentVector::ChooseFragment() 111 { 112 G4double x = probabilities[nChannels-1]*G4UniformRand(); 113 G4int i=0; 114 for (; i<nChannels; ++i) { 115 if(x <= probabilities[i]) { break; } 116 } 117 return (*theChannels)[i]; 118 } 83 119 84 120 #endif
Note: See TracChangeset
for help on using the changeset viewer.