Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ContinuumGammaDeexcitation.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: G4ContinuumGammaDeexcitation.cc 68724 2013-04-05 09:26:32Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 // GEANT 4 class file
30 //
31 // CERN, Geneva, Switzerland
32 //
33 // File name: G4ContinuumGammaDeexcitation
34 //
35 // Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
36 // Maria Grazia Pia (pia@genova.infn.it)
37 //
38 // Creation date: 23 October 1998
39 //
40 // Modifications:
41 //
42 // 02 May 2003, Vladimir Ivanchenko change interface to G4NuclearlevelManager
43 //
44 // 19 April 2010 J. M. Quesada: smaller value of tolerance parameter
45 //
46 // -------------------------------------------------------------------
47 //
48 // Class G4ContinuumGammaDeexcitation.cc
49 //
50 // Concrete class derived from G4VGammaDeexcitation
51 //
52 //
54 
55 #include "G4Gamma.hh"
57 #include "G4NuclearLevelManager.hh"
58 #include "G4NuclearLevelStore.hh"
59 #include "G4Fragment.hh"
61 
62 //
63 // Constructor
64 //
65 
67  : _nucleusZ(0), _nucleusA(0), _levelManager(0)
68 {}
69 
71 {}
72 
74 {
75  G4Fragment* nucleus = GetNucleus();
76  G4int Z = nucleus->GetZ_asInt();
77  G4int A = nucleus->GetA_asInt();
78  G4double excitation = nucleus->GetExcitationEnergy();
79 
80  if (_nucleusA != A || _nucleusZ != Z)
81  {
82  _levelManager = G4NuclearLevelStore::GetInstance()->GetManager(Z,A);
83  _nucleusA = A;
84  _nucleusZ = Z;
85  }
86 
87  if (_verbose > 1) {
88  G4cout << "G4ContinuumGammaDeexcitation::CreateTransition "
89  << " Z= " << Z << " A= " << A << " Eex= " << excitation
90  << " " << _levelManager
91  << G4endl;
92  }
93  G4VGammaTransition* gt =
94  new G4ContinuumGammaTransition(_levelManager,Z,A,excitation,_verbose );
95 
96  return gt;
97 }
98 
99 
101 {
102  //JMQ: far too small, creating sometimes continuum gammas instead
103  // of the right discrete ones (when excitation energy is slightly
104  // over maximum discrete energy): changed
105  // G4double tolerance = 10*eV;
106  static const G4double tolerance = CLHEP::keV;
107 
108  if (_transition == 0)
109  {
110  if (_verbose > 0) {
111  G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Null transition "
112  << G4endl;
113  }
114  return false;
115  }
116 
117  G4Fragment* nucleus = GetNucleus();
118  G4double excitation = nucleus->GetExcitationEnergy();
119 
120  if (_nucleusZ < 2 || _nucleusA < 3)
121  {
122  if (_verbose > 1) {
123  G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - n/p/H"
124  << G4endl;
125  }
126  return false;
127  }
128 
129  if (excitation <= tolerance)
130  {
131  if (_verbose > 1) {
132  G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Excitation "
133  << excitation/CLHEP::keV << " keV is too small"
134  << G4endl;
135  }
136  return false;
137  }
138  if (excitation <= (_levelManager->MaxLevelEnergy() + tolerance))
139  {
140  if (_verbose > 0) {
141  G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Excitation "
142  << excitation << " below max discrete level "
143  << _levelManager->MaxLevelEnergy() << G4endl;
144  }
145  return false;
146  }
147 
148  if (_verbose > 1) {
149  G4cout <<"G4ContinuumGammaDeexcitation::CanDoTransition - CanDo"
150  << " Eex(keV)= " << excitation/CLHEP::keV
151  << " Emax(keV)= " << _levelManager->MaxLevelEnergy()/CLHEP::keV
152  << " Z= " << _nucleusZ << " A= " << _nucleusA
153  << G4endl;
154  }
155  return true;
156 }
157 
158 
159 
static G4NuclearLevelStore * GetInstance()
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4int GetA_asInt() const
Definition: G4Fragment.hh:238
bool G4bool
Definition: G4Types.hh:79
virtual G4VGammaTransition * CreateTransition()
G4NuclearLevelManager * GetManager(G4int Z, G4int A)
G4VGammaTransition * _transition
G4int GetZ_asInt() const
Definition: G4Fragment.hh:243
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double MaxLevelEnergy() const
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:255