Geant4  10.01.p03
G4DiscreteGammaDeexcitation.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: G4DiscreteGammaDeexcitation.cc 88987 2015-03-17 10:39:50Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 // GEANT 4 class file
30 //
31 // CERN, Geneva, Switzerland
32 //
33 // File name: G4DiscreteGammaDeexcitation
34 //
35 // Author: Maria Grazia Pia (pia@genova.infn.it)
36 //
37 // Creation date: 23 October 1998
38 //
39 // Modifications:
40 // 8 March 2001, Fan Lei (flei@space.qinetiq.com)
41 // Added the following as part if the IC implementation
42 // void SetICM(G4bool hl) { _icm = hl; };
43 // void SetRDM(G4bool hl) { _rdm = hl; };
44 // void SetHL(G4double hl) { _max_hl = hl; };
45 // Changed in CreateTransition() from
46 // return new G4DiscreteGammaTransition(*level);
47 // To
48 // return new G4DiscreteGammaTransition(*level,Z);
49 // Added in CanDoTransition
50 // if (level->HalfLife() > _max_hl && !_rdm ) canDo = false;
51 //
52 // 3 November 2011 L. Desorgher
53 // remove the Z<= 98 limit
54 //
55 // -------------------------------------------------------------------
56 
59 #include "G4NuclearLevelManager.hh"
60 #include "G4NuclearLevelStore.hh"
61 #include "G4SystemOfUnits.hh"
62 
64  nucleusZ(0), nucleusA(0), maxhl(1e-6*CLHEP::second), icm(false),
65  rdm(false), levelManager(0), dtransition(0)
66 {
68 }
69 
71 {}
72 
74 {
75  G4int Z = nucleus->GetZ_asInt();
76  G4int A = nucleus->GetA_asInt();
77  G4double excitation = nucleus->GetExcitationEnergy();
78 
79  if(excitation <= _tolerance) {
80  if (_verbose > 1) {
81  G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition fails; Z= " << Z
82  << " A= " << A << " Eex(meV)= " << excitation/MeV << G4endl;
83  }
84  return false;
85  }
86 
87  if (nucleusA != A || nucleusZ != Z) {
89  nucleusA = A;
90  nucleusZ = Z;
91  }
92  if(!levelManager ||
93  excitation > levelManager->MaxLevelEnergy() + _tolerance) { return false; }
94 
95  if (_verbose > 1) {
96  G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition "
97  << " Z= " << Z << " A= " << A << " Eex= " << excitation
98  << G4endl;
99  }
100 
101  const G4NuclearLevel* level = levelManager->NearestLevel(excitation);
102 
103  // long lived level
104  if (!level || level->HalfLife() > maxhl) { return false; }
105  // if (!level || (level->HalfLife() > maxhl && !rdm) ) { return false; }
106 
107  if (_verbose > 1) {
108  G4cout << "G4DiscreteGammaDeexcitation: Elevel(MeV)= "
109  << level->Energy()/MeV << ", Eex(MeV)= " << excitation << G4endl;
110  }
111  if(!_transition) {
115  } else {
116  dtransition->Update(level,Z);
117  }
118  // control on ICM
119  if(level->HalfLife() > _timeLimit) {
120  dtransition->SetICM(true);
121  } else {
123  }
124 
125  dtransition->SetEnergyFrom(excitation);
126 
127  if (_verbose > 1) {
128  G4cout << "CanDoTransition done: Eex(MeV)= "
129  << excitation/MeV << ", level enrgies: Emin(MeV)= "
130  << levelManager->MinLevelEnergy()/MeV << " Emax(MeV)= "
132  }
133  return true;
134 }
135 
static const double MeV
Definition: G4SIunits.hh:193
G4double HalfLife() const
G4double Energy() const
G4double MinLevelEnergy() const
virtual G4bool CanDoTransition(G4Fragment *nucleus)
static G4NuclearLevelStore * GetInstance()
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4int GetA_asInt() const
Definition: G4Fragment.hh:243
bool G4bool
Definition: G4Types.hh:79
static const double second
Definition: G4SIunits.hh:138
static const G4double A[nN]
G4NuclearLevelManager * GetManager(G4int Z, G4int A)
G4VGammaTransition * _transition
G4int GetZ_asInt() const
Definition: G4Fragment.hh:248
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double MaxLevelEnergy() const
const G4NuclearLevel * NearestLevel(G4double energy, G4double eDiffMax=1.e+8) const
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:260
G4DiscreteGammaTransition * dtransition
void Update(const G4NuclearLevel *level, G4int Z)
virtual void SetEnergyFrom(G4double energy)