Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/include/G4PreCompoundFragmentVector.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    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 $
    2928//
    3029// Hadronic Process: Nuclear Preequilibrium
    3130// by V. Lara
    3231//
    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
    3434// 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//
    3741
    3842#ifndef G4PreCompoundFragmentVector_h
     
    4044
    4145#include "G4VPreCompoundFragment.hh"
     46#include "G4DataVector.hh"
     47#include "Randomize.hh"
     48#include "globals.hh"
     49#include <vector>
     50
     51typedef std::vector<G4VPreCompoundFragment*>  pcfvector;
    4252
    4353class G4PreCompoundFragmentVector
    4454{
    45   typedef std::vector<G4VPreCompoundFragment*>  pcfvector;
    4655public:
    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                 
    5073private:
     74
    5175  G4PreCompoundFragmentVector(const G4PreCompoundFragmentVector &right);
    5276  const G4PreCompoundFragmentVector&
     
    5579  G4bool operator!=(const G4PreCompoundFragmentVector &right) const;   
    5680 
    57 public:
     81  pcfvector * theChannels;
     82  G4DataVector probabilities;
    5883
    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;
    7985
    8086};
    8187
    82 #include "G4PreCompoundFragmentVector.icc"
     88inline void
     89G4PreCompoundFragmentVector::Initialize(const G4Fragment & aFragment)
     90{
     91  for (G4int i=0; i< nChannels; ++i) {
     92    (*theChannels)[i]->Initialize(aFragment);
     93  }
     94}
     95
     96inline G4double
     97G4PreCompoundFragmentVector::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
     110inline 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}
    83119
    84120#endif
Note: See TracChangeset for help on using the changeset viewer.