Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4PreCompoundFragmentVector.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4PreCompoundFragmentVector.cc 108685 2018-02-27 07:58:38Z gcosmo $
27 //
28 // Hadronic Process: Nuclear Preequilibrium
29 // by V. Lara
30 //
31 // Modified:
32 // 27.08.2010 V.Ivanchenko moved constructor and destructor to source,
33 // simplify run time computations making inlined
34 //
35 
37 
39  : theChannels(nullptr), nChannels(0)
40 {
41  SetVector(avector);
42 }
43 
45 {
46  if(avector != theChannels) {
47  delete theChannels;
48  theChannels = avector;
49  }
50  if(theChannels) {
51  nChannels = theChannels->size();
52  probabilities.resize(nChannels, 0.0);
53  } else {
54  nChannels = 0;
55  probabilities.clear();
56  }
57 }
58 
59 //for inverse cross section choice
61 {
62  for (G4int i=0; i<nChannels; ++i) {
63  (*theChannels)[i]->SetOPTxs(opt);
64  }
65 }
66 
67 //for superimposed Coulomb Barrier for inverse cross sections
69 {
70  for (G4int i=0; i< nChannels; ++i) {
71  (*theChannels)[i]->UseSICB(use);
72  }
73 }
74 
76  const G4Fragment & aFragment)
77 {
78  //G4cout << "## G4PreCompoundFragmentVector::CalculateProbabilities nCh= "
79  // << nChannels << G4endl;
80  G4double probtot = 0.0;
81  for (G4int i=0; i< nChannels; ++i) {
82  (*theChannels)[i]->Initialize(aFragment);
83  G4double prob = ((*theChannels)[i]->IsItPossible(aFragment))
84  ? (*theChannels)[i]->CalcEmissionProbability(aFragment)
85  : 0.0;
86  probtot += prob;
87  probabilities[i] = probtot;
88  //G4cout<<" prob= " << prob << " probtot= " << probtot
89  // << " for "<< i << "-th channel" <<G4endl;
90  }
91  return probtot;
92 }
93 
95 {
96  //G4cout << "## G4PreCompoundFragmentVector::ChooseFragment nCh= "
97  // << nChannels << G4endl;
99  G4int i=0;
100  for (; i<nChannels; ++i) {
101  if(x <= probabilities[i]) { break; }
102  }
103  return (*theChannels)[i];
104 }
105 
Float_t x
Definition: compare.C:6
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
#define G4UniformRand()
Definition: Randomize.hh:53
std::vector< G4VPreCompoundFragment * > pcfvector
int G4int
Definition: G4Types.hh:78
G4double CalculateProbabilities(const G4Fragment &aFragment)
G4VPreCompoundFragment * ChooseFragment()