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: G4NeutronHPChannel.hh,v 1.15 2008/05/20 21:24:28 tkoi Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
29 | // |
---|
30 | // Hadronic Process: Very Low Energy Neutron X-Sections |
---|
31 | // original by H.P. Wellisch, TRIUMF, 14-Feb-97 |
---|
32 | // Builds and has the Cross-section data for one element and channel. |
---|
33 | // |
---|
34 | // Bug fixes and workarounds in the destructor, F.W.Jones 06-Jul-1999 |
---|
35 | // 070612 Fix memory leaking by T. Koi |
---|
36 | // |
---|
37 | // 080520 Delete unnecessary dependencies by T. Koi |
---|
38 | |
---|
39 | #ifndef G4NeutronHPChannel_h |
---|
40 | #define G4NeutronHPChannel_h 1 |
---|
41 | #include "globals.hh" |
---|
42 | #include "G4NeutronHPIsoData.hh" |
---|
43 | #include "G4NeutronHPVector.hh" |
---|
44 | #include "G4Material.hh" |
---|
45 | #include "G4HadProjectile.hh" |
---|
46 | //#include "G4NeutronInelasticProcess.hh" |
---|
47 | //#include "G4HadronFissionProcess.hh" |
---|
48 | //#include "G4HadronElasticProcess.hh" |
---|
49 | //#include "G4HadronCaptureProcess.hh" |
---|
50 | #include "G4StableIsotopes.hh" |
---|
51 | #include "G4NeutronHPCaptureFS.hh" |
---|
52 | #include "G4NeutronHPFinalState.hh" |
---|
53 | #include "G4Element.hh" |
---|
54 | |
---|
55 | class G4NeutronHPChannel |
---|
56 | { |
---|
57 | public: |
---|
58 | |
---|
59 | G4NeutronHPChannel() |
---|
60 | { |
---|
61 | theChannelData = new G4NeutronHPVector; |
---|
62 | theBuffer = 0; |
---|
63 | theIsotopeWiseData = 0; |
---|
64 | theFinalStates = 0; |
---|
65 | active = 0; |
---|
66 | registerCount = -1; |
---|
67 | } |
---|
68 | |
---|
69 | ~G4NeutronHPChannel() |
---|
70 | { |
---|
71 | delete theChannelData; |
---|
72 | // Following statement disabled to avoid SEGV |
---|
73 | // theBuffer is also deleted as "theChannelData" in |
---|
74 | // ~G4NeutronHPIsoData. FWJ 06-Jul-1999 |
---|
75 | //if(theBuffer != 0) delete theBuffer; |
---|
76 | if(theIsotopeWiseData != 0) delete [] theIsotopeWiseData; |
---|
77 | // Deletion of FinalStates disabled to avoid endless looping |
---|
78 | // in the destructor heirarchy. FWJ 06-Jul-1999 |
---|
79 | //if(theFinalStates != 0) |
---|
80 | //{ |
---|
81 | // for(i=0; i<niso; i++) |
---|
82 | // { |
---|
83 | // delete theFinalStates[i]; |
---|
84 | // } |
---|
85 | // delete [] theFinalStates; |
---|
86 | //} |
---|
87 | // FWJ experiment |
---|
88 | //if(active!=0) delete [] active; |
---|
89 | // T.K. |
---|
90 | if ( theFinalStates != 0 ) |
---|
91 | { |
---|
92 | for ( G4int i = 0 ; i < niso ; i++ ) |
---|
93 | { |
---|
94 | delete theFinalStates[i]; |
---|
95 | } |
---|
96 | delete [] theFinalStates; |
---|
97 | } |
---|
98 | if ( active != 0 ) delete [] active; |
---|
99 | |
---|
100 | } |
---|
101 | |
---|
102 | G4double GetXsec(G4double energy); |
---|
103 | |
---|
104 | G4double GetWeightedXsec(G4double energy, G4int isoNumber); |
---|
105 | |
---|
106 | G4double GetFSCrossSection(G4double energy, G4int isoNumber); |
---|
107 | |
---|
108 | inline G4bool IsActive(G4int isoNumber) { return active[isoNumber]; } |
---|
109 | |
---|
110 | inline G4bool HasFSData(G4int isoNumber) { return theFinalStates[isoNumber]->HasFSData(); } |
---|
111 | |
---|
112 | inline G4bool HasAnyData(G4int isoNumber) { return theFinalStates[isoNumber]->HasAnyData(); } |
---|
113 | |
---|
114 | G4bool Register(G4NeutronHPFinalState *theFS); |
---|
115 | |
---|
116 | void Init(G4Element * theElement, const G4String dirName); |
---|
117 | |
---|
118 | void Init(G4Element * theElement, const G4String dirName, const G4String fsType); |
---|
119 | |
---|
120 | void UpdateData(G4int A, G4int Z, G4int index, G4double abundance); |
---|
121 | |
---|
122 | void Harmonise(G4NeutronHPVector *& theStore, G4NeutronHPVector * theNew); |
---|
123 | |
---|
124 | G4HadFinalState * ApplyYourself(const G4HadProjectile & theTrack, G4int isoNumber=-1); |
---|
125 | |
---|
126 | inline G4int GetNiso() {return niso;} |
---|
127 | |
---|
128 | inline G4double GetN(G4int i) {return theFinalStates[i]->GetN();} |
---|
129 | inline G4double GetZ(G4int i) {return theFinalStates[i]->GetZ();} |
---|
130 | |
---|
131 | inline G4bool HasDataInAnyFinalState() |
---|
132 | { |
---|
133 | G4bool result = false; |
---|
134 | G4int i; |
---|
135 | for(i=0; i<niso; i++) |
---|
136 | { |
---|
137 | if(theFinalStates[i]->HasAnyData()) result = true; |
---|
138 | } |
---|
139 | return result; |
---|
140 | } |
---|
141 | |
---|
142 | private: |
---|
143 | G4NeutronHPVector * theChannelData; // total (element) cross-section for this channel |
---|
144 | G4NeutronHPVector * theBuffer; |
---|
145 | |
---|
146 | G4NeutronHPIsoData * theIsotopeWiseData; // these are the isotope-wise cross-sections for each final state. |
---|
147 | G4NeutronHPFinalState ** theFinalStates; // also these are isotope-wise pionters, parallel to the above. |
---|
148 | G4bool * active; |
---|
149 | G4int niso; |
---|
150 | |
---|
151 | G4StableIsotopes theStableOnes; |
---|
152 | |
---|
153 | G4String theDir; |
---|
154 | G4String theFSType; |
---|
155 | G4Element * theElement; |
---|
156 | |
---|
157 | G4int registerCount; |
---|
158 | |
---|
159 | }; |
---|
160 | |
---|
161 | #endif |
---|