Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4NeutronHPContAngularPar.hh
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//
27// $Id$
28//
29// 080718 Add ClearHistories method and related class member
30//
31#ifndef G4NeutronHPContAngularPar_h
32#define G4NeutronHPContAngularPar_h 1
33
34#include "G4ios.hh"
35#include <fstream>
36#include "globals.hh"
37#include "G4NeutronHPList.hh"
38#include "G4ReactionProduct.hh"
41
43{
44 public:
45
47 {
48 theAngular = 0;
49 currentMeanEnergy = -2;
50 fresh = true;
51 }
53 {
54 if(theAngular!=0) delete [] theAngular;
55 }
56
57 void Init(std::ifstream & aDataFile);
58
59 G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass,
60 G4int angularRep, G4int interpol);
61
62 G4double GetEnergy() { return theEnergy; }
63
65 {
66 thePrimary = aPrimary;
67 }
68
70 {
71 theTarget = aTarget;
72 }
73
74 void SetTargetCode(G4double aTargetCode) { theTargetCode = aTargetCode; }
75
76 void SetInterpolation(G4int theInterpolation)
77 {
78 theManager.Init(theInterpolation, nEnergies); // one range only
79 }
80
81 void Merge(G4double anEnergy, G4InterpolationScheme & aScheme,
83 G4NeutronHPContAngularPar & store2) // hmmmm, this interpolates legendre coefficients. Dangerous @@@
84 {
85 nDiscreteEnergies = store1.nDiscreteEnergies;
86 nAngularParameters = store1.nAngularParameters;
87 nEnergies = store1.nEnergies;
88 theManager = store1.theManager;
89 theEnergy = anEnergy;
90 if(theAngular != 0) delete [] theAngular;
91 theAngular = new G4NeutronHPList[nEnergies];
92 G4int i, ii;
93 G4double value;
94 for(i=0; i<nEnergies; i++)
95 {
96 theAngular[i].SetLabel(store1.theAngular[i].GetLabel());
97 for(ii=0; ii<nAngularParameters; ii++)
98 {
99// G4cout <<"test "<<i<<" "<<store1.theEnergy<<" "<<store2.theEnergy<<" "
100// << store1.theAngular[i].GetValue(ii)<<" "<<
101// store2.theAngular[i].GetValue(ii)<<G4endl;
102 value = theInt.Interpolate(aScheme, anEnergy,
103 store1.theEnergy, store2.theEnergy,
104 store1.theAngular[i].GetValue(ii),
105 store2.theAngular[i].GetValue(ii));
106 theAngular[i].SetValue(ii, value);
107 }
108 }
109 };
110
112 {
113 G4double result;
114 if(currentMeanEnergy<-1)
115 {
116 return 0;
117 // throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPContAngularPar: Logical error in Product class");
118 }
119 else
120 {
121 result = currentMeanEnergy;
122 }
123 currentMeanEnergy = -2;
124 return result;
125 }
126
127 private:
128
129 // incoming particle
130 G4double theEnergy;
131
132 // number of exit channel energies
133 G4int nEnergies;
134 // number of discrete exit channels
135 G4int nDiscreteEnergies;
136 // number of angular paramerers per channel
137 G4int nAngularParameters;
138 // knows the interpolation between List labels
139 G4InterpolationManager theManager;
140 // on per exit-channel energy
141 G4NeutronHPList * theAngular;
142
143 private:
144
146
147 G4double theTargetCode;
148 G4ReactionProduct * theTarget;
149 G4ReactionProduct * thePrimary;
150
151 G4double currentMeanEnergy;
152
153//080718
154 public:
155 void ClearHistories(){ fresh = true; };
156 private:
157 G4bool fresh;
158 G4double remaining_energy; // represent energy rest of cascade chain
159};
160#endif
G4InterpolationScheme
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
void Init(G4int aScheme, G4int aRange)
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass, G4int angularRep, G4int interpol)
void Init(std::ifstream &aDataFile)
void SetTarget(G4ReactionProduct *aTarget)
void SetPrimary(G4ReactionProduct *aPrimary)
void SetInterpolation(G4int theInterpolation)
void SetTargetCode(G4double aTargetCode)
void Merge(G4double anEnergy, G4InterpolationScheme &aScheme, G4NeutronHPContAngularPar &store1, G4NeutronHPContAngularPar &store2)
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
void SetLabel(G4double aLabel)
void SetValue(G4int i, G4double y)
G4double GetLabel()
G4double GetValue(G4int i)