Geant4  10.01.p02
G4NeutronHPContEnergyAngular.cc
Go to the documentation of this file.
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 // neutron_hp -- source file
27 // J.P. Wellisch, Nov-1996
28 // A prototype of the low energy neutron transport model.
29 //
30 // 080721 To be "ClearHistories" effective, the selection scheme of angular distribution is modified by T. Koi
31 //
32 //
34 
36 {
37  G4ReactionProduct * result;
38  G4int i(0);
39  G4int it(0);
40  for(i=0;i<nEnergy;i++)
41  {
42  it = i;
43  if(theAngular[i].GetEnergy()>anEnergy) break;
44  }
45  G4double targetMass = GetTarget()->GetMass();
46  if(it==0)
47  {
51  result = theAngular[0].Sample(anEnergy, massCode, targetMass,
53  //currentMeanEnergy = theAngular[0].MeanEnergyOfThisInteraction();
55  }
56  else
57  {
58  // interpolation through alternating sampling. This needs improvement @@@
59  // This is the cause of the He3 problem !!!!!!!!
60  // See to it, if you can improve this.
61  //080714 TK commnet Randomizing use angular distribution
62  //080714 TK Always use the upper side distribution. enabling ClearHistories method.
63  //G4double random = G4UniformRand();
64  //G4double deltaE = theAngular[it].GetEnergy()-theAngular[it-1].GetEnergy();
65  //G4double offset = theAngular[it].GetEnergy()-anEnergy;
66  //if(random<offset/deltaE) it--;
70  result = theAngular[it].Sample(anEnergy, massCode, targetMass,
72  //currentMeanEnergy = theAngular[it].MeanEnergyOfThisInteraction();
74  }
75  return result;
76 }
77 
80 {
81  G4double result(0);
82  if(currentMeanEnergy.Get()<-1)
83  {
84  throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPContEnergyAngular: Logical error in Product class");
85  }
86  else
87  {
88  result = currentMeanEnergy.Get();
89  }
90  currentMeanEnergy.Put( -2 );
91  return result;
92 }
93 
94 
95 
97 {
98  if ( theAngular!= NULL )
99  {
100  for ( G4int i = 0 ; i< nEnergy ; i++ )
102  }
103 }
value_type & Get() const
Definition: G4Cache.hh:282
void SetTarget(G4ReactionProduct *aTarget)
int G4int
Definition: G4Types.hh:78
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass, G4int angularRep, G4int interpol)
void SetPrimary(G4ReactionProduct *aPrimary)
G4NeutronHPContAngularPar * theAngular
void SetTargetCode(G4double aTargetCode)
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass)
double G4double
Definition: G4Types.hh:76
void Put(const value_type &val) const
Definition: G4Cache.hh:286
G4double GetMass() const