source: trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4NuclearLevel.cc @ 1245

Last change on this file since 1245 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 7.9 KB
Line 
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// -------------------------------------------------------------------
28//      GEANT 4 class file
29//
30//      For information related to this code contact:
31//      CERN, IT Division, ASD group
32//      CERN, Geneva, Switzerland
33//
34//      File name:     G4NuclearLevel
35//
36//      Author:        Maria Grazia Pia (pia@genova.infn.it)
37//
38//      Creation date: 24 October 1998
39//
40//      Modifications:
41//
42//        09 Sep. 2002, Fan Lei  (flei@space.qinetiq.com)
43//              Added IC probability when calculate the channel probabilities in
44//              MakeProbabilities().
45//
46//        21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
47//              Added K->N+ internal  conversion coefficiencies and their access
48//              functions.
49//     
50//        15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
51//              Added half-life, angular momentum, parity, emissioni type
52//              reading from experimental data.
53//     
54// -------------------------------------------------------------------
55
56#include "G4NuclearLevel.hh"
57
58#include "globals.hh"
59
60G4int G4NuclearLevel::Increment(G4int aF)
61{
62  static G4int instanceCount = 0;
63  instanceCount+=aF;
64  return instanceCount;
65}
66
67G4NuclearLevel::G4NuclearLevel(const G4double energy, const G4double halfLife,
68                               const G4double angularMomentum,
69                               const std::vector<double>& eGamma,
70                               const std::vector<double>& wGamma,
71                               const std::vector<double>& polarities,
72                               const std::vector<double>& kCC, const std::vector<double>& l1CC,
73                               const std::vector<double>& l2CC, const std::vector<double>& l3CC,
74                               const std::vector<double>& m1CC, const std::vector<double>& m2CC,
75                               const std::vector<double>& m3CC, const std::vector<double>& m4CC,
76                               const std::vector<double>& m5CC, const std::vector<double>& nPlusCC,
77                               const std::vector<double>& totalCC)
78
79{
80  _energy = energy;
81  _halfLife = halfLife;
82  _angularMomentum = angularMomentum;
83  unsigned int i;
84  for (i=0; i<eGamma.size(); i++)
85    {
86      _energies.push_back(eGamma[i]);
87      _weights.push_back(wGamma[i]);
88      _polarities.push_back(polarities[i]);
89      _kCC.push_back( kCC[i]);
90      _l1CC.push_back( l1CC[i]);
91      _l2CC.push_back( l2CC[i]);
92      _l3CC.push_back( l3CC[i]);
93      _m1CC.push_back( m1CC[i]);
94      _m2CC.push_back( m2CC[i]);
95      _m3CC.push_back( m3CC[i]);
96      _m4CC.push_back( m4CC[i]);
97      _m5CC.push_back( m5CC[i]);
98      _nPlusCC.push_back( nPlusCC[i]);
99      _totalCC.push_back( totalCC[i]);
100    }
101  _nGammas = _energies.size();
102  MakeProbabilities();
103  MakeCumProb();
104 // G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
105}
106
107G4NuclearLevel::~G4NuclearLevel()
108{ 
109 // G4cout << "####### Decrementing "<<Increment(-1)<<G4endl;
110}
111
112
113G4bool G4NuclearLevel::operator==(const G4NuclearLevel &right) const
114{
115  return (this == (G4NuclearLevel *) &right);
116}
117
118
119G4bool G4NuclearLevel::operator!=(const G4NuclearLevel &right) const
120{
121  return (this != (G4NuclearLevel *) &right);
122}
123
124
125G4bool G4NuclearLevel::operator<(const G4NuclearLevel &right) const 
126{
127  if (_energy < right.Energy()) return true;
128  else return false;
129}
130
131
132const std::vector<double>& G4NuclearLevel::GammaEnergies() const
133{
134  return _energies;
135}
136 
137const std::vector<double>& G4NuclearLevel::GammaWeights() const
138{
139  return _weights;
140}
141 
142
143const std::vector<double>& G4NuclearLevel::GammaProbabilities() const
144{
145  return _prob;
146}
147 
148
149const std::vector<double>& G4NuclearLevel::GammaCumulativeProbabilities() const
150{
151  return _cumProb;
152}
153 
154
155const std::vector<double>& G4NuclearLevel::GammaPolarities() const
156{
157  return _polarities;
158}
159 
160const std::vector<double>& G4NuclearLevel::KConvertionProbabilities() const
161{
162  return _kCC;
163}
164 
165const std::vector<double>& G4NuclearLevel::L1ConvertionProbabilities() const
166{
167  return _l1CC;
168}
169 
170const std::vector<double>& G4NuclearLevel::L2ConvertionProbabilities() const
171{
172  return _l2CC;
173}
174 
175const std::vector<double>& G4NuclearLevel::L3ConvertionProbabilities() const
176{
177  return _l3CC;
178}
179 
180const std::vector<double>& G4NuclearLevel::M1ConvertionProbabilities() const
181{
182  return _m1CC;
183}
184 
185const std::vector<double>& G4NuclearLevel::M2ConvertionProbabilities() const
186{
187  return _m2CC;
188}
189 
190const std::vector<double>& G4NuclearLevel::M3ConvertionProbabilities() const
191{
192  return _m3CC;
193}
194 
195const std::vector<double>& G4NuclearLevel::M4ConvertionProbabilities() const
196{
197  return _m4CC;
198}
199 
200const std::vector<double>& G4NuclearLevel::M5ConvertionProbabilities() const
201{
202  return _m5CC;
203}
204 
205const std::vector<double>& G4NuclearLevel::NPlusConvertionProbabilities() const
206{
207  return _nPlusCC;
208}
209 
210const std::vector<double>& G4NuclearLevel::TotalConvertionProbabilities() const
211{
212  return _totalCC;
213}
214 
215G4double G4NuclearLevel::Energy() const
216{
217  return _energy;
218}
219 
220G4double G4NuclearLevel::AngularMomentum() const
221{
222  return _angularMomentum;
223}
224 
225G4double G4NuclearLevel::HalfLife() const
226{
227  return _halfLife;
228}
229 
230
231G4int G4NuclearLevel::NumberOfGammas() const
232{
233  return _nGammas;
234}
235 
236
237void G4NuclearLevel::PrintAll() const 
238{
239  G4cout << "---- Level energy = " << _energy << ", angular momentum = "
240         << _angularMomentum << ", half life " << _halfLife
241         << ", " << _nGammas << " photons" << G4endl;
242  G4int i;
243  G4cout << "     Gammas: ";
244  for (i=0; i<_nGammas; i++) { G4cout << _energies[i] << " "; }
245  G4cout << G4endl << "     Weights: ";
246  for (i=0; i<_nGammas; i++) { G4cout << _weights[i] << " "; }
247  G4cout << G4endl << "     Relative transition probabilities ";
248  for (i=0; i<_nGammas; i++) { G4cout << _prob[i] << " "; }
249  G4cout << G4endl << "     Cumulative probabilities: ";
250  for (i=0; i<_nGammas; i++) { G4cout << _cumProb[i] << " "; }
251  G4cout << G4endl << "     Polarities: ";
252  for (i=0; i<_nGammas; i++) { G4cout << _polarities[i] << " "; }
253  G4cout << G4endl;     
254
255  return;
256}
257 
258
259void G4NuclearLevel::MakeProbabilities()
260{
261  G4double sum = 0.;
262  G4int i = 0;
263  for (i=0; i<_nGammas; i++)
264    {
265      sum += _weights[i]*(1+_totalCC[i]);
266    }
267
268  for (i=0; i<_nGammas; i++)
269    {
270      if (sum > 0.) { _prob.push_back(_weights[i]*(1+_totalCC[i])/ sum); }
271      else { _prob.push_back(1./_nGammas); }
272    }
273  return;
274}
275
276
277void G4NuclearLevel::MakeCumProb()
278{
279  if (_nGammas > 0)
280    {
281      G4double sum = _prob[0];
282      _cumProb.push_back(sum);
283     
284      G4int i = 0;
285      for (i=1; i<_nGammas; i++)
286        {
287          sum += _prob[i];
288          _cumProb.push_back(sum);
289        }
290    }
291  return;
292}
293
294
295
Note: See TracBrowser for help on using the repository browser.