Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NuclearLevel.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// $Id$
27//
28// -------------------------------------------------------------------
29// GEANT 4 class file
30//
31// For information related to this code contact:
32// CERN, IT Division, ASD group
33// CERN, Geneva, Switzerland
34//
35// File name: G4NuclearLevel
36//
37// Author: Maria Grazia Pia ([email protected])
38//
39// Creation date: 24 October 1998
40//
41// Modifications:
42// 06 Oct 2010, M. Kelsey ([email protected])
43// Add friendship for G4NuclearLevelManager; define private
44// constructors without vectors.
45//
46// 09 Sep. 2002, Fan Lei ([email protected])
47// Added IC probability when calculate the channel probabilities in
48// MakeProbabilities().
49//
50// 21 Nov. 2001, Fan Lei ([email protected])
51// Added K->N+ internal conversion coefficiencies and their access
52// functions.
53//
54// 15 April 1999, Alessandro Brunengo ([email protected])
55// Added half-life, angular momentum, parity, emissioni type
56// reading from experimental data.
57//
58// 28 October 2010, V.Ivanchenko moved copy constructor to source, cleanup
59//
60// -------------------------------------------------------------------
61
62#include "G4NuclearLevel.hh"
63#include "globals.hh"
64
65G4int G4NuclearLevel::Increment(G4int aF)
66{
67 static G4int instanceCount = 0;
68 instanceCount+=aF;
69 return instanceCount;
70}
71
73 : _energy(0.), _halfLife(0.), _angularMomentum(0.), _nGammas(0) {
74 // G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
75}
76
78 G4double angularMomentum)
79 : _energy(energy), _halfLife(halfLife), _angularMomentum(angularMomentum),
80 _nGammas(0) {
81 // G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
82}
83
85 G4double angularMomentum,
86 const std::vector<G4double>& eGamma,
87 const std::vector<G4double>& wGamma,
88 const std::vector<G4double>& polarities,
89 const std::vector<G4double>& kCC, const std::vector<G4double>& l1CC,
90 const std::vector<G4double>& l2CC, const std::vector<G4double>& l3CC,
91 const std::vector<G4double>& m1CC, const std::vector<G4double>& m2CC,
92 const std::vector<G4double>& m3CC, const std::vector<G4double>& m4CC,
93 const std::vector<G4double>& m5CC, const std::vector<G4double>& nPlusCC,
94 const std::vector<G4double>& totalCC)
95
96 : _energies(eGamma), _weights(wGamma), _polarities(polarities),
97 _kCC(kCC), _l1CC(l1CC), _l2CC(l2CC), _l3CC(l3CC),
98 _m1CC(m1CC), _m2CC(m2CC), _m3CC(m3CC), _m4CC(m4CC), _m5CC(m5CC),
99 _nPlusCC(nPlusCC), _totalCC(totalCC),
100 _energy(energy), _halfLife(halfLife), _angularMomentum(angularMomentum)
101{
102 Finalize();
103 // G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
104}
105
107{
108 // G4cout << "####### Decrementing "<<Increment(-1)<<G4endl;
109}
110
112{
113 return (this == (G4NuclearLevel *) &right);
114}
115
116
118{
119 return (this != (G4NuclearLevel *) &right);
120}
121
123{
124 if (_energy < right.Energy()) return true;
125 else return false;
126}
127
128const std::vector<G4double>& G4NuclearLevel::GammaEnergies() const
129{
130 return _energies;
131}
132
133const std::vector<G4double>& G4NuclearLevel::GammaWeights() const
134{
135 return _weights;
136}
137
138
139const std::vector<G4double>& G4NuclearLevel::GammaProbabilities() const
140{
141 return _prob;
142}
143
144
145const std::vector<G4double>& G4NuclearLevel::GammaCumulativeProbabilities() const
146{
147 return _cumProb;
148}
149
150
151const std::vector<G4double>& G4NuclearLevel::GammaPolarities() const
152{
153 return _polarities;
154}
155
156const std::vector<G4double>& G4NuclearLevel::KConvertionProbabilities() const
157{
158 return _kCC;
159}
160
161const std::vector<G4double>& G4NuclearLevel::L1ConvertionProbabilities() const
162{
163 return _l1CC;
164}
165
166const std::vector<G4double>& G4NuclearLevel::L2ConvertionProbabilities() const
167{
168 return _l2CC;
169}
170
171const std::vector<G4double>& G4NuclearLevel::L3ConvertionProbabilities() const
172{
173 return _l3CC;
174}
175
176const std::vector<G4double>& G4NuclearLevel::M1ConvertionProbabilities() const
177{
178 return _m1CC;
179}
180
181const std::vector<G4double>& G4NuclearLevel::M2ConvertionProbabilities() const
182{
183 return _m2CC;
184}
185
186const std::vector<G4double>& G4NuclearLevel::M3ConvertionProbabilities() const
187{
188 return _m3CC;
189}
190
191const std::vector<G4double>& G4NuclearLevel::M4ConvertionProbabilities() const
192{
193 return _m4CC;
194}
195
196const std::vector<G4double>& G4NuclearLevel::M5ConvertionProbabilities() const
197{
198 return _m5CC;
199}
200
201const std::vector<G4double>& G4NuclearLevel::NPlusConvertionProbabilities() const
202{
203 return _nPlusCC;
204}
205
206const std::vector<G4double>& G4NuclearLevel::TotalConvertionProbabilities() const
207{
208 return _totalCC;
209}
210
212{
213 return _energy;
214}
215
217{
218 return _angularMomentum;
219}
220
222{
223 return _halfLife;
224}
225
227{
228 return _nGammas;
229}
230
231
233{
234 G4cout << "---- Level energy = " << _energy << ", angular momentum = "
235 << _angularMomentum << ", half life " << _halfLife
236 << ", " << _nGammas << " photons" << G4endl;
237 G4int i;
238 G4cout << " Gammas: ";
239 for (i=0; i<_nGammas; i++) { G4cout << _energies[i] << " "; }
240 G4cout << G4endl << " Weights: ";
241 for (i=0; i<_nGammas; i++) { G4cout << _weights[i] << " "; }
242 G4cout << G4endl << " Relative transition probabilities ";
243 for (i=0; i<_nGammas; i++) { G4cout << _prob[i] << " "; }
244 G4cout << G4endl << " Cumulative probabilities: ";
245 for (i=0; i<_nGammas; i++) { G4cout << _cumProb[i] << " "; }
246 G4cout << G4endl << " Polarities: ";
247 for (i=0; i<_nGammas; i++) { G4cout << _polarities[i] << " "; }
248 G4cout << G4endl;
249
250 return;
251}
252
253
254void G4NuclearLevel::Finalize() {
255 _nGammas = _energies.size();
256 MakeProbabilities();
257 MakeCumProb();
258}
259
260
261void G4NuclearLevel::MakeProbabilities()
262{
263 G4double sum = 0.;
264 G4int i = 0;
265 for (i=0; i<_nGammas; i++) {
266 sum += _weights[i]*(1.+_totalCC[i]);
267 }
268
269 if (sum <= 0.) _prob.resize(_nGammas, 1./_nGammas); // Fast fill
270 else {
271 _prob.reserve(_nGammas);
272 for (i=0; i<_nGammas; i++) {
273 _prob.push_back(_weights[i]*(1.+_totalCC[i])/sum);
274 }
275 }
276}
277
278
279void G4NuclearLevel::MakeCumProb()
280{
281 if (_nGammas <= 0) return;
282
283 _cumProb.reserve(_nGammas);
284
285 G4double sum = _prob[0];
286 _cumProb.push_back(sum);
287
288 for (G4int i=1; i<_nGammas; i++) {
289 sum += _prob[i];
290 _cumProb.push_back(sum);
291 }
292}
293
295{
296 if(this != &right)
297 {
298 _energies = right._energies;
299 _weights =right._weights;
300 _prob =right._prob;
301 _cumProb =right._cumProb;
302 _polarities =right._polarities;
303 _kCC = right._kCC;
304 _l1CC =right._l1CC;
305 _l2CC =right._l2CC;
306 _l3CC =right._l3CC;
307 _m1CC = right._m1CC;
308 _m2CC = right._m2CC;
309 _m3CC = right._m3CC;
310 _m4CC = right._m4CC;
311 _m5CC = right._m5CC;
312 _nPlusCC = right._nPlusCC;
313 _totalCC = right._totalCC;
314 _energy = right._energy;
315 _halfLife = right._halfLife;
316 _angularMomentum = right._angularMomentum;
317 _nGammas = right._nGammas;
318 }
319 return *this;
320}
321
323{
324 _energies = right._energies;
325 _weights =right._weights;
326 _prob =right._prob;
327 _cumProb =right._cumProb;
328 _polarities =right._polarities;
329 _kCC = right._kCC;
330 _l1CC =right._l1CC;
331 _l2CC =right._l2CC;
332 _l3CC =right._l3CC;
333 _m1CC = right._m1CC;
334 _m2CC = right._m2CC;
335 _m3CC = right._m3CC;
336 _m4CC = right._m4CC;
337 _m5CC = right._m5CC;
338 _nPlusCC = right._nPlusCC;
339 _totalCC = right._totalCC;
340 _energy = right._energy;
341 _halfLife = right._halfLife;
342 _angularMomentum = right._angularMomentum;
343 _nGammas = right._nGammas;
344}
345
346
347
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
const std::vector< G4double > & M4ConvertionProbabilities() const
G4NuclearLevel(G4double energy, G4double halfLife, G4double angularMomentum, const std::vector< G4double > &eGamma, const std::vector< G4double > &wGamma, const std::vector< G4double > &polarities, const std::vector< G4double > &kCC, const std::vector< G4double > &l1CC, const std::vector< G4double > &l2CC, const std::vector< G4double > &l3CC, const std::vector< G4double > &m1CC, const std::vector< G4double > &m2CC, const std::vector< G4double > &m3CC, const std::vector< G4double > &m4CC, const std::vector< G4double > &m5CC, const std::vector< G4double > &nPlusCC, const std::vector< G4double > &totalCC)
const std::vector< G4double > & GammaEnergies() const
G4double HalfLife() const
const std::vector< G4double > & M1ConvertionProbabilities() const
void PrintAll() const
const std::vector< G4double > & L3ConvertionProbabilities() const
G4double AngularMomentum() const
const std::vector< G4double > & L1ConvertionProbabilities() const
G4NuclearLevel & operator=(const G4NuclearLevel &right)
const std::vector< G4double > & M5ConvertionProbabilities() const
const std::vector< G4double > & GammaWeights() const
const std::vector< G4double > & GammaProbabilities() const
const std::vector< G4double > & L2ConvertionProbabilities() const
const std::vector< G4double > & GammaCumulativeProbabilities() const
G4double Energy() const
const std::vector< G4double > & TotalConvertionProbabilities() const
G4bool operator!=(const G4NuclearLevel &right) const
const std::vector< G4double > & GammaPolarities() const
const std::vector< G4double > & NPlusConvertionProbabilities() const
G4int NumberOfGammas() const
const std::vector< G4double > & KConvertionProbabilities() const
G4bool operator==(const G4NuclearLevel &right) const
const std::vector< G4double > & M3ConvertionProbabilities() const
const std::vector< G4double > & M2ConvertionProbabilities() const
G4bool operator<(const G4NuclearLevel &right) const