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/src/G4PreCompoundFragmentVector.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PreCompoundFragmentVector.cc,v 1.11 2009/02/10 16:01:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundFragmentVector.cc,v 1.12 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2828//
    2929// Hadronic Process: Nuclear Preequilibrium
    3030// by V. Lara
     31//
     32// Modified:
     33// 27.08.2010 V.Ivanchenko moved constructor and destructor to source,
     34//            simplify run time computations making inlined
     35//
    3136
    3237#include "G4PreCompoundFragmentVector.hh"
    33 #include "G4HadronicException.hh"
    3438
    35 const G4PreCompoundFragmentVector &
    36 G4PreCompoundFragmentVector::
    37 operator=(const G4PreCompoundFragmentVector &)
     39G4PreCompoundFragmentVector::G4PreCompoundFragmentVector(pcfvector * avector)
     40  : theChannels(0), nChannels(0)
    3841{
    39     throw G4HadronicException(__FILE__, __LINE__, "G4PreCompoundFragmentVector::operator= meant to not be accessable");
    40     return *this;
     42  SetVector(avector);
    4143}
    4244
     45G4PreCompoundFragmentVector::~G4PreCompoundFragmentVector()
     46{}
    4347
    44 G4bool G4PreCompoundFragmentVector::
    45 operator==(const G4PreCompoundFragmentVector &) const
     48void G4PreCompoundFragmentVector::SetVector(pcfvector * avector)
    4649{
    47     return false;
     50  theChannels = avector;
     51  if(theChannels) {
     52    nChannels = theChannels->size();
     53    probabilities.resize(nChannels);
     54  }
    4855}
    4956
    50 G4bool G4PreCompoundFragmentVector::
    51 operator!=(const G4PreCompoundFragmentVector &) const
    52 {
    53     return true;
     57//for inverse cross section choice
     58void G4PreCompoundFragmentVector::SetOPTxs(G4int opt)
     59{   
     60  for (G4int i=0; i< nChannels; ++i) {
     61    (*theChannels)[i]->SetOPTxs(opt);
     62  }
    5463}
    5564
    56 
    57 
    58 G4double G4PreCompoundFragmentVector::
    59 CalculateProbabilities(const G4Fragment & aFragment)
    60 {
    61   TotalEmissionProbability = 0.0;
    62   pcfvector::iterator aChannel;
    63   for (aChannel=theChannels->begin(); aChannel != theChannels->end();
    64        aChannel++)
    65     {
    66       // Calculate emission probailities
    67       // Compute total (integrated over kinetic energy) emission
    68       // probability of a fragment and
    69       // Summing channel emission probabilities
    70       TotalEmissionProbability += (*aChannel)->CalcEmissionProbability(aFragment);
    71     }
    72   return TotalEmissionProbability;
     65//for superimposed Coulomb Barrier for inverse  cross sections
     66void G4PreCompoundFragmentVector::UseSICB(G4bool use)
     67{   
     68  for (G4int i=0; i< nChannels; ++i) {
     69    (*theChannels)[i]->UseSICB(use);
     70  }
    7371}
    7472
    75 
    76 G4VPreCompoundFragment * G4PreCompoundFragmentVector::
    77 ChooseFragment(void)
    78 {
    79   const G4int NumOfFrags = theChannels->size();
    80   std::vector<G4double> running;
    81   running.reserve(NumOfFrags);
    82  
    83   pcfvector::iterator i;
    84   G4double accumulation = 0.0;
    85   for (i = theChannels->begin(); i != theChannels->end(); ++i) {
    86     accumulation += (*i)->GetEmissionProbability();
    87 
    88     running.push_back(accumulation);
    89   }
    90        
    91   // Choose an emission channel
    92   G4double aChannel = G4UniformRand()*TotalEmissionProbability;
    93   G4int ChosenChannel = -1;
    94   std::vector<G4double>::iterator ich;
    95   for (ich = running.begin(); ich != running.end(); ++ich)
    96     {
    97       if (aChannel <= *ich)
    98         {
    99 #ifdef G4NO_ISO_VECDIST
    100           std::vector<G4double>::difference_type n = 0;
    101           std::distance(running.begin(),ich,n);
    102           ChosenChannel = n;
    103 #else
    104           ChosenChannel = std::distance(running.begin(),ich);
    105 #endif
    106           break;
    107         }
    108     }
    109   running.clear();
    110   if (ChosenChannel < 0)
    111     {
    112       G4cerr
    113         << "G4PreCompoundFragmentVector::ChooseFragment: I can't determine a channel\n"
    114         << "Probabilities: ";
    115       for (i = theChannels->begin(); i != theChannels->end(); ++i)
    116         {
    117           G4cout << (*i)->GetEmissionProbability() << "  ";
    118         }
    119       G4cout << '\n';
    120       return 0;
    121     }
    122   else
    123     {
    124       for (i = theChannels->begin(); i != theChannels->end(); ++i)
    125         {
    126           (*i)->IncrementStage();
    127         }
    128     }
    129 
    130   return theChannels->operator[](ChosenChannel);
    131 }
Note: See TracChangeset for help on using the changeset viewer.