Import Geant4 10.3.1 source tree

This commit is contained in:
Gabriele Cosmo
2017-02-28 16:18:37 +01:00
parent 4597adb7c4
commit 3a5407696b
563 changed files with 0 additions and 95641 deletions
@@ -1,80 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ContinuumGammaDeexcitation.hh 85841 2014-11-05 15:35:06Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4ContinuumGammaDeexcitation
//
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
// Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// -------------------------------------------------------------------
//
//
// Class G4ContinuumGammaDeexcitation.hh
//
#ifndef G4ContinuumGammaDeexcitation_hh
#define G4ContinuumGammaDeexcitation_hh 1
#include "G4VGammaDeexcitation.hh"
#include "globals.hh"
#include "G4ContinuumGammaTransition.hh"
#include "G4Fragment.hh"
class G4NuclearLevelManager;
class G4NuclearLevelStore;
class G4DiscreteGammaTransition;
class G4ContinuumGammaDeexcitation : public G4VGammaDeexcitation
{
public:
G4ContinuumGammaDeexcitation();
virtual ~G4ContinuumGammaDeexcitation();
virtual G4bool CanDoTransition(G4Fragment* aNucleus);
private:
G4int nucleusZ;
G4int nucleusA;
G4NuclearLevelStore* store;
G4NuclearLevelManager* levelManager;
G4ContinuumGammaTransition* ctransition;
};
#endif
@@ -1,106 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ContinuumGammaTransition.hh 87017 2014-11-21 16:26:26Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4ContinuumGammaTransition
//
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
// Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added creation time evaluation for products of evaporation
// 02 May 2003, Vladimir Ivanchenko change interface to G4NuclearlevelManager
//
// -------------------------------------------------------------------
//
// Header file for G4ContinuumGammaTransition
//
#ifndef G4ContinuumGammaTransition_hh
#define G4ContinuumGammaTransition_hh 1
#include "globals.hh"
#include "G4VGammaTransition.hh"
#include "G4ConstantLevelDensityParameter.hh"
#include <vector>
class G4NuclearLevelManager;
class G4Pow;
class G4ContinuumGammaTransition : public G4VGammaTransition
{
public:
G4ContinuumGammaTransition(const G4NuclearLevelManager* manager,
G4int Z, G4int A, G4double exc, G4int ver);
virtual ~G4ContinuumGammaTransition();
virtual void SetEnergyFrom(G4double energy);
virtual G4double GetGammaEnergy();
virtual G4double GetGammaCreationTime();
virtual void SelectGamma();
void Update(const G4NuclearLevelManager* manager,
G4int Z, G4int A, G4double exc);
private:
G4double E1Pdf(G4double energy);
G4double GammaTime();
G4int nucleusA;
G4int nucleusZ;
G4int nBins;
G4int verbose;
G4double eMin;
G4double eMax;
G4double minLevelE;
G4double excitation;
G4double eGamma;
G4double gammaCreationTime;
G4double energyGDR2;
G4double widthGDR;
G4double widthGDR2;
std::vector<G4double> sampleArray;
const G4NuclearLevelManager* levelManager;
G4Pow* g4pow;
G4ConstantLevelDensityParameter ldPar;
};
#endif
@@ -1,100 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DiscreteGammaDeexcitation.hh 85841 2014-11-05 15:35:06Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4DiscreteGammaDeexcitation
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 8 March 2001, Fan Lei (flei@space.qinetiq.com)
// added the following as part if the IC implementation
// void SetICM(G4bool hl) { _icm = hl; };
// void SetRDM(G4bool hl) { _rdm = hl; };
// void SetHL(G4double hl) { _max_hl = hl; };
// private:
// G4double _max_hl;
// G4bool _icm;
// G4bool _rdm;
//
//
// -------------------------------------------------------------------
//
#ifndef G4DiscreteGammaDeexcitation_hh
#define G4DiscreteGammaDeexcitation_hh
#include "G4VGammaDeexcitation.hh"
#include "globals.hh"
#include "G4DiscreteGammaTransition.hh"
#include "G4Fragment.hh"
class G4NuclearLevelManager;
class G4NuclearLevelStore;
class G4DiscreteGammaTransition;
class G4DiscreteGammaDeexcitation : public G4VGammaDeexcitation {
public:
G4DiscreteGammaDeexcitation();
virtual ~G4DiscreteGammaDeexcitation();
virtual G4bool CanDoTransition(G4Fragment* nucleus);
inline void SetICM(G4bool hl) { icm = hl; };
inline void SetRDM(G4bool hl) { rdm = hl; };
inline void SetHL(G4double hl) { maxhl = hl; };
private:
G4int nucleusZ;
G4int nucleusA;
G4double maxhl;
G4bool icm;
G4bool rdm;
G4NuclearLevelStore* store;
G4NuclearLevelManager* levelManager;
G4DiscreteGammaTransition* dtransition;
};
#endif
@@ -1,122 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DiscreteGammaTransition.hh 85841 2014-11-05 15:35:06Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4DiscreteGammaTransition
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 8 March 2002, Fan Lei (flei@space.qinetiq.com)
// added
// 1) SetRDM () to switch on/off IC process
// 2) GetOrbitNumber () to return the CE oribit number
// 3) GetBondEnergy() for the converted e-
// 4) IsaGamma() to separate CE from gamma
//
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
// i) added G4int _nucleusZ initialise it through the constructor
// ii) modified SelectGamma() to allow the generation of conversion electrons
// iii) added #include G4AtomicShells.hh
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added creation time evaluation for products of evaporation
//
//
// 19 April 2010, J. M. Quesada.
// Corrections added for taking into account mismatch between tabulated
// gamma energies and level energy differences (fake photons eliminated)
//
// 6 October 2010, M. Kelsey
// Store NuclearLevel as const-reference, not as copied value.
//
// 5 May 2011, V.Ivanchenko removed unused constructor
//
// -------------------------------------------------------------------
#ifndef G4DiscreteGammaTransition_hh
#define G4DiscreteGammaTransition_hh
#include "globals.hh"
#include "G4VGammaTransition.hh"
class G4NuclearLevel;
class G4NuclearLevelManager;
class G4DiscreteGammaTransition : public G4VGammaTransition
{
public:
G4DiscreteGammaTransition(const G4NuclearLevel* level,
G4int Z, G4int ver);
virtual ~G4DiscreteGammaTransition();
virtual void SetEnergyFrom(G4double energy);
virtual G4double GetGammaEnergy();
virtual G4double GetGammaCreationTime();
virtual void SelectGamma();
inline void SetICM(G4bool ic) { icm = ic; };
inline G4bool GetICM() const { return icm;};
inline G4double GetBondEnergy () { return bondE;};
inline G4int GetOrbitNumber () { return orbitE;};
inline G4bool IsAGamma() { return aGamma;};
inline void Update(const G4NuclearLevel* level, G4int Z)
{
aLevel = level;
nucleusZ = Z;
}
private:
G4int nucleusZ;
G4int orbitE;
G4int verbose;
G4double bondE;
G4double gammaEnergy;
G4double excitation;
G4double gammaCreationTime;
G4bool aGamma;
G4bool icm;
const G4NuclearLevel* aLevel;
};
#endif
@@ -1,84 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4E1Probability.hh 88709 2015-03-06 15:33:12Z gcosmo $
//
//---------------------------------------------------------------------
//
// Geant4 header G4E1Probability
//
// by V. Lara (May 2003)
//
// Modifications:
// 18.05.2010 V.Ivanchenko trying to speedup the most slow method
// by usage of G4Pow, integer A and introduction of const members
//
//
#ifndef G4E1Probability_hh
#define G4E1Probability_hh
#include "globals.hh"
#include "G4VEmissionProbability.hh"
#include "G4Fragment.hh"
class G4Pow;
class G4E1Probability : public G4VEmissionProbability
{
public:
G4E1Probability();
virtual ~G4E1Probability();
G4double EmissionProbability(const G4Fragment& frag, G4double excite);
G4double EmissionProbDensity(const G4Fragment& frag, G4double ePhoton);
private:
G4E1Probability(const G4E1Probability& right);
const G4E1Probability& operator=(const G4E1Probability& right);
G4bool operator==(const G4E1Probability& right) const;
G4bool operator!=(const G4E1Probability& right) const;
// Integrator (simple Gaussian quadrature)
G4double EmissionIntegration(const G4Fragment& frag,
G4double lowLim, G4double upLim);
// members
G4Pow* fG4pow;
G4double theLevelDensityPerNucleon;
G4double normC;
G4double aLevelDensityParam;
G4double sigma0;
G4double Egdp;
G4double GammaR;
G4int Afrag;
};
#endif
@@ -1,177 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearLevel.hh 86986 2014-11-21 13:00:05Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// CERN, Geneva, Switzerland
//
// File name: G4NuclearLevel
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 25 October 1998
//
// Modifications:
// 06 Oct 2010, M. Kelsey (kelsey@slac.stanford.edu)
// Add friendship for G4NuclearLevelManager; define private
// constructors without vectors.
//
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
// Added K->N+ internal conversion coefficiencies and their access
// functions
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added half-life, angular momentum, parity, emissioni type
// reading from experimental data.
//
// 28 October 2010, V.Ivanchenko moved copy constructor to source, cleanup
//
//
// -------------------------------------------------------------------
#ifndef G4NUCLEARLEVEL_HH
#define G4NUCLEARLEVEL_HH 1
#include "globals.hh"
#include <vector>
class G4NuclearLevel
{
public:
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);
~G4NuclearLevel();
const std::vector<G4double>& GammaEnergies() const;
const std::vector<G4double>& GammaWeights() const;
const std::vector<G4double>& GammaProbabilities() const;
const std::vector<G4double>& GammaCumulativeProbabilities() const;
const std::vector<G4double>& GammaPolarities() const;
const std::vector<G4double>& KConvertionProbabilities() const;
const std::vector<G4double>& L1ConvertionProbabilities() const;
const std::vector<G4double>& L2ConvertionProbabilities() const;
const std::vector<G4double>& L3ConvertionProbabilities() const;
const std::vector<G4double>& M1ConvertionProbabilities() const;
const std::vector<G4double>& M2ConvertionProbabilities() const;
const std::vector<G4double>& M3ConvertionProbabilities() const;
const std::vector<G4double>& M4ConvertionProbabilities() const;
const std::vector<G4double>& M5ConvertionProbabilities() const;
const std::vector<G4double>& NPlusConvertionProbabilities() const;
const std::vector<G4double>& TotalConvertionProbabilities() const;
G4double Energy() const;
G4double AngularMomentum() const;
G4double HalfLife() const;
G4int NumberOfGammas() const;
void PrintAll() const;
void PrintLevels() const;
G4bool operator==(const G4NuclearLevel &right) const;
G4bool operator!=(const G4NuclearLevel &right) const;
G4bool operator<(const G4NuclearLevel &right) const;
G4NuclearLevel& operator=(const G4NuclearLevel &right);
G4NuclearLevel(const G4NuclearLevel &right);
private:
friend class G4NuclearLevelManager;
G4NuclearLevel();
G4NuclearLevel(G4double energy, G4double halfLife,
G4double angularMomentum);
void Finalize();
void MakeProbabilities();
void MakeCumProb();
G4int Increment(G4int aF);
std::vector<G4double> _energies;
std::vector<G4double> _weights;
std::vector<G4double> _prob;
std::vector<G4double> _cumProb;
std::vector<G4double> _polarities;
std::vector<G4double> _kCC;
std::vector<G4double> _l1CC;
std::vector<G4double> _l2CC;
std::vector<G4double> _l3CC;
std::vector<G4double> _m1CC;
std::vector<G4double> _m2CC;
std::vector<G4double> _m3CC;
std::vector<G4double> _m4CC;
std::vector<G4double> _m5CC;
std::vector<G4double> _nPlusCC;
std::vector<G4double> _totalCC;
G4double _energy;
G4double _halfLife;
G4double _angularMomentum;
G4int _nGammas;
};
#endif
@@ -1,140 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearLevelManager.hh 87163 2014-11-26 08:46:54Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4NuclearLevelManager
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 25 October 1998
//
// Modifications:
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
// Added K->N+ internal conversion coefficiencies and their access
// functions
//
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added half-life, angular momentum, parity, emissioni type
// reading from experimental data.
// 02 May 2003, Vladimir Ivanchenko remove rublic copy contructor
// 06 Oct 2010, M. Kelsey -- Use object storage, not pointers, drop
// public access to list
// -------------------------------------------------------------------
#ifndef G4NUCLEARLEVELMANAGER_HH
#define G4NUCLEARLEVELMANAGER_HH 1
#include <iosfwd>
#include <CLHEP/Units/SystemOfUnits.h>
#include "globals.hh"
#include "G4PtrLevelVector.hh"
class G4NuclearLevel;
class G4NuclearLevelManager
{
public:
G4NuclearLevelManager(G4int Z, G4int A, const G4String& filename);
G4NuclearLevelManager(const G4NuclearLevelManager & right);
~G4NuclearLevelManager();
void SetNucleus(G4int Z, G4int A, const G4String& filename);
inline G4bool IsValid() const { return _validity; }
inline G4int NumberOfLevels() const { return (_levels ? _levels->size() : 0); }
const G4NuclearLevel* GetLevel(G4int i) const;
const G4NuclearLevel* NearestLevel(G4double energy,
G4double eDiffMax=1.e+8) const;
const G4NuclearLevel* LowestLevel() const;
const G4NuclearLevel* HighestLevel() const;
G4double MinLevelEnergy() const;
G4double MaxLevelEnergy() const;
void PrintLevels();
void PrintAll();
private:
const G4NuclearLevelManager& operator=(const G4NuclearLevelManager &right);
G4bool operator==(const G4NuclearLevelManager &right) const;
G4bool operator!=(const G4NuclearLevelManager &right) const;
G4bool Read(std::ifstream& aDataFile);
G4bool ReadDataLine(std::ifstream& dataFile);
G4bool ReadDataItem(std::istream& dataFile, G4double& x);
void ProcessDataLine();
void MakeLevels(const G4String& filename);
void ClearLevels();
G4NuclearLevel* UseLevelOrMakeNew(G4NuclearLevel* level);
void AddDataToLevel(G4NuclearLevel* level);
void FinishLevel(G4NuclearLevel* level);
G4int _nucleusA;
G4int _nucleusZ;
//G4String _fileName;
G4bool _validity;
G4PtrLevelVector* _levels;
// Buffers for reading data file
//char buffer[30]; // For doubles in scientific notation
static G4double _levelEnergy;
static G4double _gammaEnergy;
static G4double _probability;
static G4double _polarity;
static G4double _halfLife;
static G4double _angularMomentum;
static G4double _kCC;
static G4double _l1CC;
static G4double _l2CC;
static G4double _l3CC;
static G4double _m1CC;
static G4double _m2CC;
static G4double _m3CC;
static G4double _m4CC;
static G4double _m5CC;
static G4double _nPlusCC;
static G4double _totalCC;
};
#endif
@@ -1,94 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearLevelStore.hh 88406 2015-02-18 09:13:29Z gcosmo $
//
// 04-10-2010 M. Kelsey -- Replace G4String keys with integers (ZZZAAA),
// move string operation to GenerateFilename()
// 17-11-2010 V. Ivanchenko - make as a classical singleton.
//
// 17-10-2011 L. Desorgher -- Allow the user to replace the radioactive
// decay data provided in Geant4 by its own data file for
// a given isotope
// 06-01-2012 V. Ivanchenko - added nuclear level data structure for
// usage in HEP where internal conversion is neglected;
// cleanup the code; new method GetLevelManager
// 19-11-2014 M. Asai - protection against reading the same file from
// more than one worker threads
#ifndef G4NuclearLevelStore_hh
#define G4NuclearLevelStore_hh 1
#include "G4NuclearLevelManager.hh"
#include "G4ThreadLocalSingleton.hh"
#include "globals.hh"
#include <map>
class G4NuclearLevelStore
{
friend class G4ThreadLocalSingleton<G4NuclearLevelStore>;
private:
G4NuclearLevelStore();
public:
static G4NuclearLevelStore* GetInstance();
G4NuclearLevelManager* GetManager(G4int Z, G4int A);
~G4NuclearLevelStore();
void AddUserEvaporationDataFile(G4int Z, G4int A,
const G4String& filename);
private:
G4int GenerateKey(G4int Z, G4int A) const { return Z*1000+A; }
G4String GenerateFileName(G4int Z, G4int A) const;
typedef std::map<G4int,G4NuclearLevelManager*> ManagersMap;
ManagersMap theManagers;
G4String dirName;
static G4ThreadLocal G4NuclearLevelStore* theInstance;
#ifdef G4MULTITHREADED
static G4NuclearLevelStore* theShadowInstance;
#endif
G4bool userFiles;
std::map<G4int, G4String> theUserDataFiles;
#ifdef G4MULTITHREADED
public:
static G4Mutex nuclearLevelStoreMutex;
#endif
};
#endif
@@ -1,145 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhotonEvaporationOLD.hh 89158 2015-03-21 19:15:25Z vnivanch $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4PhotonEvaporationOLD
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
//Modifications:
//
// 18 October 2002, Fan Lei (flei@space.qinetiq.com)
//
// Implementation of Internal Convertion process in discrete deexcitation
// The following public methods have been added.
//
// void SetICM (G4bool);
// void RDMForced(G4bool);
// void SetMaxHalfLife(G4double) ;
// void SetEOccupancy( G4ElectronOccupancy eOccupancy) ;
// G4ElectronOccupancy GetEOccupancy () ;
// G4int GetVacantShellNumber () { return _vShellNumber;};
//
// and the following priivate menbers
//
// G4ElectronOccupancy _eOccupancy;
// G4int _vShellNumber;
//
// 11 May 2010, V.Ivanchenko added EmittedFragment and BreakUpFragment
// methods
//
// 22 October 2015, V.Ivanchenko renamed to G4PhotonEvaporationOLD
//
// -------------------------------------------------------------------
#ifndef G4PHOTONEVAPORATIONOLD_HH
#define G4PHOTONEVAPORATIONOLD_HH 1
#include "globals.hh"
#include "G4VEvaporationChannel.hh"
#include "G4VEmissionProbability.hh"
#include "G4VGammaDeexcitation.hh"
#include "G4ElectronOccupancy.hh"
class G4Fragment;
class G4PhotonEvaporationOLD : public G4VEvaporationChannel {
public:
G4PhotonEvaporationOLD(const G4String & aName = "");
virtual ~G4PhotonEvaporationOLD();
// returns one gamma or e-
virtual G4Fragment* EmittedFragment(G4Fragment* theNucleus);
// returns "false", emitted gamma and e- are added to the results
virtual G4bool
BreakUpChain(G4FragmentVector* theResult, G4Fragment* theNucleus);
// emitted gamma and e- are added to the results
virtual G4FragmentVector* BreakUpFragment(G4Fragment* theNucleus);
// emitted gamma, e-, and residual fragment are added to the results
virtual G4FragmentVector * BreakItUp(const G4Fragment & nucleus);
// emitted gamma, e-, and residual fragment are added to the results
virtual G4FragmentVector * BreakUp(const G4Fragment & nucleus);
virtual G4double GetEmissionProbability(G4Fragment* theNucleus);
virtual void SetEmissionStrategy(G4VEmissionProbability * probAlgorithm);
void SetVerboseLevel(G4int verbose);
virtual void SetICM (G4bool);
virtual void RDMForced (G4bool);
void SetMaxHalfLife(G4double);
void SetTimeLimit(G4double value);
void SetEOccupancy( G4ElectronOccupancy eOccupancy) ;
inline G4ElectronOccupancy GetEOccupancy () { return eOccupancy;} ;
inline G4int GetVacantShellNumber () { return vShellNumber;};
private:
G4int verbose;
G4bool myOwnProbAlgorithm;
G4VEmissionProbability * probAlgorithm;
G4VGammaDeexcitation * discrDeexcitation;
G4VGammaDeexcitation * contDeexcitation;
G4ElectronOccupancy eOccupancy;
G4int vShellNumber;
G4Fragment* nucleus;
G4double gammaE;
G4PhotonEvaporationOLD(const G4PhotonEvaporationOLD & right);
const G4PhotonEvaporationOLD & operator = (const G4PhotonEvaporationOLD & right);
G4bool operator == (const G4PhotonEvaporationOLD & right) const;
G4bool operator != (const G4PhotonEvaporationOLD & right) const;
};
#endif
@@ -1,53 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PtrLevelVector.hh 67983 2013-03-13 10:42:03Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4PtrLevelVector
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 25 October 1998
//
// Modifications:
//
// -------------------------------------------------------------------
#ifndef G4PTRLEVELVECTOR_HH
#define G4PTRLEVELVECTOR_HH 1
#include "G4NuclearLevel.hh"
#include <vector>
typedef std::vector<G4NuclearLevel *> G4PtrLevelVector;
struct DeleteLevel { void operator () (G4NuclearLevel * aL) {delete aL;} };
#endif
@@ -1,124 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VGammaDeexcitation.hh 88191 2015-02-02 17:27:37Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4VGammaDeexcitation
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added creation time evaluation for products of evaporation
//
// 21 Nov 2001, Fan Lei (flei@space.qinetiq.com)
// Modified GenerateGamma() and UpdateUncleus() for implementation
// of Internal Conversion processs
//
// 8 March 2002, Fan Lei (flei@space.qinetiq.com)
// Added SetEO () , GetEO(), UpdateElectrons() to allow the assignment
// and modification of electron configuration.
//
// 18 October 2002, F. Lei
// Added GetVaccantSN() and _vSN in order to link to ARM in low-e em
// _vSN is updated in UpdateElectron()
// Added SetVaccantSN(). It is need to to re-set _vSN after each
// IC happened.
//
// 28 April 2010, V.Ivanchenko cleanup methods
//
// -------------------------------------------------------------------
//
#ifndef G4VGAMMADEEXCITATION_HH
#define G4VGAMMADEEXCITATION_HH 1
#include "globals.hh"
#include "G4VGammaTransition.hh"
#include "G4Fragment.hh"
#include "G4FragmentVector.hh"
#include "G4ElectronOccupancy.hh"
class G4VGammaDeexcitation {
public:
G4VGammaDeexcitation();
virtual ~G4VGammaDeexcitation();
virtual G4bool CanDoTransition(G4Fragment* aNucleus) = 0;
// Chain of gamma transitions
void DoChain(G4FragmentVector*, G4Fragment* nucleus);
G4Fragment * GenerateGamma(G4Fragment* nucleus);
inline void SetVerboseLevel(G4int verbose){ _verbose = verbose; };
//inline void Initialise();
inline void SetEO(G4ElectronOccupancy eo) { _electronO = eo; };
inline void SetVaccantSN( G4int val ) { _vSN = val;};
inline G4ElectronOccupancy GetEO() { return _electronO; };
inline G4int GetVacantSN() { return _vSN;};
inline void SetTimeLimit(G4double value) { _timeLimit = value; }
protected:
G4VGammaTransition* _transition;
G4int _verbose;
G4double _tolerance;
G4double _timeLimit;
private:
G4VGammaDeexcitation(const G4VGammaDeexcitation & right);
const G4VGammaDeexcitation & operator = (const G4VGammaDeexcitation & right);
G4bool operator == (const G4VGammaDeexcitation & right) const;
G4bool operator != (const G4VGammaDeexcitation & right) const;
G4ElectronOccupancy _electronO;
G4int _vSN;
};
#endif
@@ -1,122 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ContinuumGammaDeexcitation.cc 87585 2014-12-11 14:22:21Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4ContinuumGammaDeexcitation
//
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
// Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 02 May 2003, Vladimir Ivanchenko change interface to G4NuclearlevelManager
//
// 19 April 2010 J. M. Quesada: smaller value of tolerance parameter
//
// -------------------------------------------------------------------
//
// Class G4ContinuumGammaDeexcitation.cc
//
// Concrete class derived from G4VGammaDeexcitation
//
//
#include "G4ContinuumGammaDeexcitation.hh"
#include "G4Gamma.hh"
#include "G4ContinuumGammaTransition.hh"
#include "G4NuclearLevelManager.hh"
#include "G4NuclearLevelStore.hh"
#include "G4Fragment.hh"
#include "G4ConstantLevelDensityParameter.hh"
G4ContinuumGammaDeexcitation::G4ContinuumGammaDeexcitation()
: nucleusZ(0), nucleusA(0), levelManager(0), ctransition(0)
{
store = G4NuclearLevelStore::GetInstance();
}
G4ContinuumGammaDeexcitation::~G4ContinuumGammaDeexcitation()
{}
G4bool G4ContinuumGammaDeexcitation::CanDoTransition(G4Fragment* nucleus)
{
G4int Z = nucleus->GetZ_asInt();
G4int A = nucleus->GetA_asInt();
G4double excitation = nucleus->GetExcitationEnergy();
if (excitation <= _tolerance) {
if (_verbose > 1) {
G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition fails; Z= " << Z
<< " A= " << A << " Eex(meV)= " << excitation << G4endl;
}
return false;
}
if (nucleusA != A || nucleusZ != Z) {
levelManager = store->GetManager(Z,A);
nucleusA = A;
nucleusZ = Z;
}
if (_verbose > 1) {
G4cout << "G4ContinuumGammaDeexcitation: "
<< " Z= " << Z << " A= " << A << " Eex= " << excitation
<< G4endl;
}
if (levelManager && excitation <= levelManager->MaxLevelEnergy() + _tolerance) {
if (_verbose > 0) {
G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Excitation "
<< excitation << " below max discrete level "
<< levelManager->MaxLevelEnergy() << G4endl;
}
return false;
}
if(!ctransition) {
ctransition =
new G4ContinuumGammaTransition(levelManager,Z,A,excitation,_verbose);
_transition = ctransition;
} else {
ctransition->Update(levelManager,Z,A,excitation);
}
/*
G4cout <<"G4ContinuumGammaDeexcitation::CanDoTransition: "
<< " Eex(MeV)= " << excitation
<< " Emax(MeV)= " << levelManager->MaxLevelEnergy()
<< " Z= " << Z << " A= " << A << G4endl;
*/
return true;
}
@@ -1,244 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ContinuumGammaTransition.cc 91886 2015-08-10 07:08:25Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4ContinuumGammaTransition
//
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
// Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added creation time evaluation for products of evaporation
// 02 May 2003, V. Ivanchenko change interface to G4NuclearlevelManager
// 06 Oct 2010, M. Kelsey -- follow changes to G4NuclearLevelManager
// 17 Nov 2010, V. Ivanchenko use exponential law for sampling of time
// and extra cleanup
// ----------------------------------------------------------------------------
//
// Class G4ContinuumGammaTransition.cc
//
#include "G4ContinuumGammaTransition.hh"
#include "G4NuclearLevelManager.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"
#include "G4Pow.hh"
#include "G4Log.hh"
//static const G4double normC = CLHEP::millibarn/
// (CLHEP::pi*CLHEP::hbarc*CLHEP::pi*CLHEP::hbarc);
static const G4double factor = 5;
static const G4double tolerance = 0.1*CLHEP::keV;
G4ContinuumGammaTransition::G4ContinuumGammaTransition(
const G4NuclearLevelManager* manager,
G4int Z, G4int A, G4double exc, G4int verb)
{
nBins = 100;
verbose = verb;
eMin = keV;
eMax = minLevelE = eGamma = gammaCreationTime = 0.0;
sampleArray.resize(nBins+1,0.0);
g4pow = G4Pow::GetInstance();
Update(manager, Z, A, exc);
}
G4ContinuumGammaTransition::~G4ContinuumGammaTransition()
{}
void G4ContinuumGammaTransition::Update(const G4NuclearLevelManager* manager,
G4int Z, G4int A, G4double exc)
{
levelManager = manager;
nucleusZ = Z;
nucleusA = A;
excitation = exc;
eGamma = 0.;
gammaCreationTime = 0.;
minLevelE = DBL_MAX;
if(levelManager) {
minLevelE = std::max(0.5*levelManager->MinLevelEnergy(), tolerance);
}
// Energy range for photon generation;
// upper limit is defined 5*Gamma(GDR) from GDR peak
// Giant Dipole Resonance energy
G4double energyGDR = (40.3 / g4pow->powZ(nucleusA,0.2) ) * MeV;
energyGDR2 = energyGDR*energyGDR;
// Giant Dipole Resonance width
widthGDR = 0.30 * energyGDR;
widthGDR2 = widthGDR*widthGDR;
// Extend
eMax = energyGDR + factor * widthGDR;
if (eMax > excitation) { eMax = excitation; }
}
void G4ContinuumGammaTransition::SelectGamma()
{
eGamma = 0.;
sampleArray[0] = 0.0;
G4int i;
G4double del = (eMax - eMin) / G4double(nBins);
G4double sum = 0;
G4double w1 = E1Pdf(eMin);
G4double w2;
//G4cout << eMin << " " << eMax << " " << del << G4endl;
for (i=1; i<=nBins; i++) {
G4double e = eMin + del * i;
w2 = E1Pdf(e);
sum += 0.5*(w1 + w2);
w1 = w2;
sampleArray[i] = sum;
if(verbose > 1) {
G4cout << "*---* G4ContinuumTransition: e = " << e
<< " pdf = " << sampleArray[i] << G4endl;
}
}
sum *= G4UniformRand();
eGamma = eMax;
for (i=1; i<=nBins; i++) {
if(sum <= sampleArray[i]) {
eGamma = eMin + del * i;
G4double w = sampleArray[i] - sampleArray[i-1];
//G4cout << eGamma << " " << w << G4endl;
if(w != 0.0) {
eGamma -= (sampleArray[i] - sum)*del/w;
}
break;
}
}
G4double finalExcitation = excitation - eGamma;
if(verbose > 1) {
G4cout << "*---*---* G4ContinuumTransition: eGamma = " << eGamma
<< " finalExcitation = " << finalExcitation << G4endl;
}
if(finalExcitation <= minLevelE) {
eGamma = excitation;
} else {
finalExcitation = levelManager->NearestLevel(finalExcitation)->Energy();
eGamma = excitation - finalExcitation;
}
gammaCreationTime = GammaTime();
if(verbose > 1) {
G4cout << "*---*---* G4ContinuumTransition: gammaCreationTime = "
<< gammaCreationTime/second << G4endl;
}
}
G4double G4ContinuumGammaTransition::GetGammaEnergy()
{
return eGamma;
}
G4double G4ContinuumGammaTransition::GetGammaCreationTime()
{
return gammaCreationTime;
}
void G4ContinuumGammaTransition::SetEnergyFrom(G4double energy)
{
excitation = energy;
}
G4double G4ContinuumGammaTransition::E1Pdf(G4double e)
{
G4double theProb = 0.0;
G4double U = excitation - e;
if(U < 0.0) { return theProb; }
G4double aLevelDensityParam =
ldPar.LevelDensityParameter(nucleusA,nucleusZ,excitation);
//G4double levelDensBef = G4Exp(2.0*std::sqrt(aLevelDensityParam*excitation));
//G4double levelDensAft = G4Exp(2.0*std::sqrt(aLevelDensityParam*(excitation - e)));
G4double coeff = G4Exp(2.0*(std::sqrt(aLevelDensityParam*U)
- std::sqrt(aLevelDensityParam*excitation)));
//if(verbose > 20)
// G4cout << nucleusA << " LevelDensityParameter = " << aLevelDensityParam
// << " Bef Aft " << levelDensBef << " " << levelDensAft << G4endl;
// Now form the probability density
// Define constants for the photoabsorption cross-section (the reverse
// process of our de-excitation)
G4double sigma0 = 2.5 * nucleusA;
G4double e2 = e*e;
G4double numerator = sigma0 * e2 * widthGDR2;
G4double denominator = (e2 - energyGDR2)* (e2 - energyGDR2) + widthGDR2*e2;
// if (denominator < 1.0e-9) denominator = 1.0e-9;
G4double sigmaAbs = numerator/denominator;
if(verbose > 2) {
G4cout << "E_GDR(MeV)= " << std::sqrt(energyGDR2) << " W_GDR(MeV)= " << widthGDR
<< " sigAbs= " << sigmaAbs
<< " E(MeV)= " << e << " coeff= " << coeff
<< G4endl;
}
theProb = sigmaAbs * e2 * coeff;
return theProb;
}
G4double G4ContinuumGammaTransition::GammaTime()
{
G4double tau = hbar_Planck/widthGDR;
G4double creationTime = -tau*G4Log(G4UniformRand());
return creationTime;
}
@@ -1,135 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DiscreteGammaDeexcitation.cc 88191 2015-02-02 17:27:37Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4DiscreteGammaDeexcitation
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
// 8 March 2001, Fan Lei (flei@space.qinetiq.com)
// Added the following as part if the IC implementation
// void SetICM(G4bool hl) { _icm = hl; };
// void SetRDM(G4bool hl) { _rdm = hl; };
// void SetHL(G4double hl) { _max_hl = hl; };
// Changed in CreateTransition() from
// return new G4DiscreteGammaTransition(*level);
// To
// return new G4DiscreteGammaTransition(*level,Z);
// Added in CanDoTransition
// if (level->HalfLife() > _max_hl && !_rdm ) canDo = false;
//
// 3 November 2011 L. Desorgher
// remove the Z<= 98 limit
//
// -------------------------------------------------------------------
#include "G4DiscreteGammaDeexcitation.hh"
#include "G4DiscreteGammaTransition.hh"
#include "G4NuclearLevelManager.hh"
#include "G4NuclearLevelStore.hh"
#include "G4SystemOfUnits.hh"
G4DiscreteGammaDeexcitation::G4DiscreteGammaDeexcitation():
nucleusZ(0), nucleusA(0), maxhl(1e-6*CLHEP::second), icm(false),
rdm(false), levelManager(0), dtransition(0)
{
store = G4NuclearLevelStore::GetInstance();
}
G4DiscreteGammaDeexcitation::~G4DiscreteGammaDeexcitation()
{}
G4bool G4DiscreteGammaDeexcitation::CanDoTransition(G4Fragment* nucleus)
{
G4int Z = nucleus->GetZ_asInt();
G4int A = nucleus->GetA_asInt();
G4double excitation = nucleus->GetExcitationEnergy();
if(excitation <= _tolerance) {
if (_verbose > 1) {
G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition fails; Z= " << Z
<< " A= " << A << " Eex(meV)= " << excitation/MeV << G4endl;
}
return false;
}
if (nucleusA != A || nucleusZ != Z) {
levelManager = store->GetManager(Z,A);
nucleusA = A;
nucleusZ = Z;
}
if(!levelManager ||
excitation > levelManager->MaxLevelEnergy() + _tolerance) { return false; }
if (_verbose > 1) {
G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition "
<< " Z= " << Z << " A= " << A << " Eex= " << excitation
<< G4endl;
}
const G4NuclearLevel* level = levelManager->NearestLevel(excitation);
// long lived level
if (!level || level->HalfLife() > maxhl) { return false; }
// if (!level || (level->HalfLife() > maxhl && !rdm) ) { return false; }
if (_verbose > 1) {
G4cout << "G4DiscreteGammaDeexcitation: Elevel(MeV)= "
<< level->Energy()/MeV << ", Eex(MeV)= " << excitation << G4endl;
}
if(!_transition) {
dtransition = new G4DiscreteGammaTransition(level,Z,_verbose);
dtransition->SetICM(icm);
_transition = dtransition;
} else {
dtransition->Update(level,Z);
}
// control on ICM
if(level->HalfLife() > _timeLimit) {
dtransition->SetICM(true);
} else {
dtransition->SetICM(icm);
}
dtransition->SetEnergyFrom(excitation);
if (_verbose > 1) {
G4cout << "CanDoTransition done: Eex(MeV)= "
<< excitation/MeV << ", level enrgies: Emin(MeV)= "
<< levelManager->MinLevelEnergy()/MeV << " Emax(MeV)= "
<< levelManager->MaxLevelEnergy()/MeV << G4endl;
}
return true;
}
@@ -1,255 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DiscreteGammaTransition.cc 91886 2015-08-10 07:08:25Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4DiscreteGammaTransition
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added creation time evaluation for products of evaporation
//
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
// i) added G4int _nucleusZ initialise it through the constructor
// ii) modified SelectGamma() to allow the generation of
// conversion e-
// iii) added #include G4AtomicShells.hh
//
// 09 Sep. 2002, Fan Lei (flei@space.qinetiq.com)
// Added renormalization to determine whether transition leads to
// electron or gamma in SelectGamma()
//
// 19 April 2010, J. M. Quesada.
// Corrections added for taking into account mismatch between
// tabulated gamma energies and level energy differences
// (fake photons eliminated)
//
// 9 May 2010, V.Ivanchenko
// Removed unphysical corretions of gamma energy; fixed default
// particle as gamma; do not subtract bounding energy in case of
// electron emmision
//
// 3 November 2011, L. Desorgher
// Extend the use of the code for Z>100 by not calling
// G4AtomicShells::GetBindingEnergy for Z>100
// For Z>100 the binding energy is set to 0 and atomic
// relaxation is not simulated in G4RadDecay
//
// -------------------------------------------------------------------
#include "G4DiscreteGammaTransition.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"
#include "G4AtomicShells.hh"
#include "G4NuclearLevel.hh"
#include "G4NuclearLevelStore.hh"
#include "G4Pow.hh"
#include "G4Log.hh"
static const G4double tolerance = 0.1*CLHEP::keV;
G4DiscreteGammaTransition::G4DiscreteGammaTransition(
const G4NuclearLevel* level, G4int Z, G4int verb)
: orbitE(-1), bondE(0.), gammaEnergy(0.), excitation(0.),
gammaCreationTime(0.), aGamma(true), icm(false)
{
verbose = verb;
Update(level, Z);
}
G4DiscreteGammaTransition::~G4DiscreteGammaTransition()
{}
void G4DiscreteGammaTransition::SelectGamma()
{
// default gamma
aGamma = true;
gammaEnergy = 0.;
G4int nGammas = aLevel->NumberOfGammas();
if (nGammas > 0) {
G4int iGamma = 0;
if(1 < nGammas) {
G4double random = G4UniformRand();
//G4cout << "G4DiscreteGammaTransition::SelectGamma N= "
// << nGammas << " rand= " << random << G4endl;
for(iGamma=0; iGamma<nGammas; ++iGamma) {
//G4cout << iGamma << " prob= "
// << (aLevel->GammaCumulativeProbabilities())[iGamma] << G4endl;
if(random <= (aLevel->GammaCumulativeProbabilities())[iGamma])
{ break; }
}
}
/*
G4cout << "Elevel(MeV)= " << aLevel->Energy()
<< " Etran(MeV)= " << (aLevel->GammaEnergies())[iGamma]
<< " Eexc(MeV)= " << excitation << G4endl;
*/
// VI 2014: initial excitation energy may be not exactly energy of the level
// final excitation energy is always energy of some level or zero
// transition to the ground state should be always equal to
// the excitation energy
gammaEnergy = (aLevel->GammaEnergies())[iGamma]
+ excitation - aLevel->Energy();
// this check is needed to remove cases when nucleaus is left in
// slightly excited state which will require very low energy
// gamma emission
if(excitation <= gammaEnergy + tolerance) { gammaEnergy = excitation; }
//JMQ:
//1)If chosen gamma energy is close enough to excitation energy,
// the later is used instead for gamma dacey to gs (it guarantees
// energy conservation)
//2)For energy conservation, level energy differences instead of
// tabulated gamma energies must be used (origin of final fake photons)
// VI: remove fake photons - applied only for the last transition
// do not applied on each transition
//if(std::fabs(excitation - gammaEnergy) < tolerance) {
// gammaEnergy = excitation;
//}
// JMQ: Warning: the following check is needed to avoid loops:
// Due essentially to missing nuclear levels in data files, it is
// possible that gammaEnergy is so low as the nucleus doesn't change
// its level after the transition.
// When such case is found, force the full deexcitation of the nucleus.
//
// NOTE: you should force the transition to the next lower level,
// but this change needs a more complex revision of actual
// design.
// I leave this for a later revision.
// VI: the check is needed to remove very low-energy gamma
if (gammaEnergy <= tolerance) { gammaEnergy = excitation; }
/*
G4cout << "G4DiscreteGammaTransition::SelectGamma: " << gammaEnergy
<< " Eexc= " << excitation
<< " icm: " << icm << G4endl;
*/
// now decide whether Internal Coversion electron should be emitted instead
if (icm) {
G4double random = G4UniformRand();
if ( random <= (aLevel->TotalConvertionProbabilities())[iGamma]
*(aLevel->GammaWeights())[iGamma]
/((aLevel->TotalConvertionProbabilities())[iGamma]
*(aLevel->GammaWeights())[iGamma]
+(aLevel->GammaWeights())[iGamma]))
{
G4int iShell = 9;
random = G4UniformRand() ;
if ( random <= (aLevel->KConvertionProbabilities())[iGamma])
{ iShell = 0;}
else if ( random <= (aLevel->L1ConvertionProbabilities())[iGamma])
{ iShell = 1;}
else if ( random <= (aLevel->L2ConvertionProbabilities())[iGamma])
{ iShell = 2;}
else if ( random <= (aLevel->L3ConvertionProbabilities())[iGamma])
{ iShell = 3;}
else if ( random <= (aLevel->M1ConvertionProbabilities())[iGamma])
{ iShell = 4;}
else if ( random <= (aLevel->M2ConvertionProbabilities())[iGamma])
{ iShell = 5;}
else if ( random <= (aLevel->M3ConvertionProbabilities())[iGamma])
{ iShell = 6;}
else if ( random <= (aLevel->M4ConvertionProbabilities())[iGamma])
{ iShell = 7;}
else if ( random <= (aLevel->M5ConvertionProbabilities())[iGamma])
{ iShell = 8;}
// the following is needed to match the ishell to that used in
// G4AtomicShells
if ( iShell == 9) {
if ( (nucleusZ < 28) && (nucleusZ > 20)) {
iShell--;
} else if ( nucleusZ == 20 || nucleusZ == 19 ) {
iShell = iShell -2;
}
}
//L.Desorgher 02/11/2011
//Atomic shell information is available in Geant4 only up top Z=100
//To extend the photo evaporation code to Z>100 the call
// to G4AtomicShells::GetBindingEnergy should be forbidden for Z>100
bondE = 0.;
if (nucleusZ <=100) {
bondE = G4AtomicShells::GetBindingEnergy(nucleusZ, iShell);
}
if (verbose > 1) {
G4cout << "G4DiscreteGammaTransition: nucleusZ = " <<nucleusZ
<< " , iShell = " << iShell
<< " , Shell binding energy = " << bondE/keV
<< " keV " << G4endl;
}
// last check on energy
if(gammaEnergy > bondE + tolerance) {
orbitE = iShell;
aGamma = false ; // emitted is not a gamma now
gammaEnergy -= bondE;
}
//G4cout << "gammaEnergy = " << gammaEnergy << G4endl;
}
}
G4double tau = aLevel->HalfLife() / G4Pow::GetInstance()->logZ(2);
//09.05.2010 VI rewrite samling of decay time
// assuming ordinary exponential low
gammaCreationTime = 0.;
if(tau > 0.0) { gammaCreationTime = -tau*G4Log(G4UniformRand()); }
}
//G4cout << "G4DiscreteGammaTransition end nGamma= " << nGammas
// << " Egamma= " << gammaEnergy << G4endl;
}
G4double G4DiscreteGammaTransition::GetGammaEnergy()
{
return gammaEnergy;
}
G4double G4DiscreteGammaTransition::GetGammaCreationTime()
{
return gammaCreationTime;
}
void G4DiscreteGammaTransition::SetEnergyFrom(G4double energy)
{
excitation = energy;
}
@@ -1,165 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4E1Probability.cc 92144 2015-08-19 14:25:18Z gcosmo $
//
//---------------------------------------------------------------------
//
// Geant4 class G4E1Probability
//
// by V. Lara (May 2003)
//
// Modifications:
// 18.05.2010 V.Ivanchenko trying to speedup the most slow method
// by usage of G4Pow, integer A and introduction of const members
// 17.11.2010 V.Ivanchenko perform general cleanup and simplification
// of integration method; low-limit of integration is defined
// by gamma energy or is zero (was always zero before)
//
#include "G4E1Probability.hh"
#include "Randomize.hh"
#include "G4Pow.hh"
#include "G4Exp.hh"
#include "G4SystemOfUnits.hh"
static const G4double tolerance = 0.1*CLHEP::keV;
G4E1Probability::G4E1Probability():G4VEmissionProbability()
{
G4double x = CLHEP::pi*CLHEP::hbarc;
normC = 1.0 / (x*x);
theLevelDensityPerNucleon = 0.125/MeV;
aLevelDensityParam = sigma0 = Egdp = GammaR = 0.0;
Afrag = 0;
fG4pow = G4Pow::GetInstance();
}
G4E1Probability::~G4E1Probability()
{}
G4double G4E1Probability::EmissionProbDensity(const G4Fragment& frag,
G4double gammaE)
{
// Calculate the probability density here
// From nuclear fragment properties and the excitation energy, calculate
// the probability density for photon evaporation from U to U - gammaE
// (U = nucleus excitation energy, gammaE = total evaporated photon
// energy). Fragment = nuclear fragment BEFORE de-excitation
G4double theProb = 0.0;
if(gammaE > tolerance) {
G4double Uexcite = frag.GetExcitationEnergy();
G4double U = std::max(0.0, Uexcite - gammaE);
// Need a level density parameter.
// For now, just use the constant approximation (not reliable near magic
// nuclei) - is equivalent to G4ConstantLevelDensityParameter class
if(Afrag != frag.GetA_asInt()) {
Afrag = frag.GetA_asInt();
aLevelDensityParam = Afrag*theLevelDensityPerNucleon;
// Define constants for the photoabsorption cross-section (the reverse
// process of our de-excitation)
sigma0 = 2.5 * Afrag * millibarn;
Egdp = (40.3 / fG4pow->powZ(Afrag,0.2) )*MeV;
GammaR = 0.30 * Egdp;
}
// VI reduce number of calls to exp
G4double levelDens =
G4Exp(2*(std::sqrt(aLevelDensityParam*U)-
std::sqrt(aLevelDensityParam*Uexcite)));
//G4cout<<" Uexcite, gammaE = "<<Uexcite<<" "<<gammaE<<G4endl;
//cout<<" lev density param = "<<aLevelDensityParam<<G4endl;
//cout<<" level densities = "<<levelDensBef<<" "<<levelDensAft<<G4endl;
//cout<<" sigma0 = "<<sigma0<<G4endl;
//cout<<" Egdp, GammaR = "<<Egdp<<" "<<GammaR<<G4endl;
//cout<<" normC = "<<normC<<G4endl;
// VI implementation 18.05.2010
G4double gammaE2 = gammaE*gammaE;
G4double gammaR2 = gammaE2*GammaR*GammaR;
G4double egdp2 = gammaE2 - Egdp*Egdp;
G4double sigmaAbs = sigma0*gammaR2/(egdp2*egdp2 + gammaR2);
theProb = normC * sigmaAbs * gammaE2 * levelDens;
//G4cout<<" sigmaAbs = "<<sigmaAbs <<" Probability = "<<theProb<<G4endl;
}
return theProb;
}
G4double G4E1Probability::EmissionProbability(const G4Fragment& frag,
G4double gammaE)
{
// From nuclear fragment properties and the excitation energy, calculate
// the probability for photon evaporation down to last ground level.
// fragment = nuclear fragment BEFORE de-excitation
G4double upperLim = gammaE;
G4double lowerLim = 0.0;
//G4cout << "G4E1Probability::EmissionProbability: Emin= " << lowerLim
// << " Emax= " << upperLim << G4endl;
if( upperLim - lowerLim <= tolerance) { return 0.0; }
// Need to integrate EmissionProbDensity from lowerLim to upperLim
// and multiply by factor 3 (?!)
G4double integ = EmissionIntegration(frag,lowerLim,upperLim);
return integ;
}
G4double G4E1Probability::EmissionIntegration(const G4Fragment& frag,
G4double lowLim, G4double upLim)
{
// Simple integration
// VI replace by direct integration over 100 point
static const G4int numIters = 100;
G4double Step = (upLim-lowLim)/G4double(numIters);
G4double res = 0.0;
G4double x = lowLim - 0.5*Step;
for(G4int i = 0; i < numIters; ++i) {
x += Step;
res += EmissionProbDensity(frag, x);
}
if(res > 0.0) { res *= Step; }
else { res = 0.0; }
return res;
}
@@ -1,350 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearLevel.cc 86986 2014-11-21 13:00:05Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// CERN, Geneva, Switzerland
//
// File name: G4NuclearLevel
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 24 October 1998
//
// Modifications:
// 06 Oct 2010, M. Kelsey (kelsey@slac.stanford.edu)
// Add friendship for G4NuclearLevelManager; define private
// constructors without vectors.
//
// 09 Sep. 2002, Fan Lei (flei@space.qinetiq.com)
// Added IC probability when calculate the channel probabilities in
// MakeProbabilities().
//
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
// Added K->N+ internal conversion coefficiencies and their access
// functions.
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added half-life, angular momentum, parity, emissioni type
// reading from experimental data.
//
// 28 October 2010, V.Ivanchenko moved copy constructor to source, cleanup
//
// -------------------------------------------------------------------
#include "G4NuclearLevel.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
G4int G4NuclearLevel::Increment(G4int aF)
{
static G4ThreadLocal G4int instanceCount = 0;
instanceCount+=aF;
return instanceCount;
}
G4NuclearLevel::G4NuclearLevel()
: _energy(0.), _halfLife(0.), _angularMomentum(0.), _nGammas(0) {
// G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
}
G4NuclearLevel::G4NuclearLevel(G4double energy, G4double halfLife,
G4double angularMomentum)
: _energy(energy), _halfLife(halfLife), _angularMomentum(angularMomentum),
_nGammas(0) {
// G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
}
G4NuclearLevel::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)
: _energies(eGamma), _weights(wGamma), _polarities(polarities),
_kCC(kCC), _l1CC(l1CC), _l2CC(l2CC), _l3CC(l3CC),
_m1CC(m1CC), _m2CC(m2CC), _m3CC(m3CC), _m4CC(m4CC), _m5CC(m5CC),
_nPlusCC(nPlusCC), _totalCC(totalCC),
_energy(energy), _halfLife(halfLife), _angularMomentum(angularMomentum)
{
Finalize();
// G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
}
G4NuclearLevel::~G4NuclearLevel()
{
// G4cout << "####### Decrementing "<<Increment(-1)<<G4endl;
}
G4bool G4NuclearLevel::operator==(const G4NuclearLevel &right) const
{
return (this == (G4NuclearLevel *) &right);
}
G4bool G4NuclearLevel::operator!=(const G4NuclearLevel &right) const
{
return (this != (G4NuclearLevel *) &right);
}
G4bool G4NuclearLevel::operator<(const G4NuclearLevel &right) const
{
if (_energy < right.Energy()) return true;
else return false;
}
const std::vector<G4double>& G4NuclearLevel::GammaEnergies() const
{
return _energies;
}
const std::vector<G4double>& G4NuclearLevel::GammaWeights() const
{
return _weights;
}
const std::vector<G4double>& G4NuclearLevel::GammaProbabilities() const
{
return _prob;
}
const std::vector<G4double>& G4NuclearLevel::GammaCumulativeProbabilities() const
{
return _cumProb;
}
const std::vector<G4double>& G4NuclearLevel::GammaPolarities() const
{
return _polarities;
}
const std::vector<G4double>& G4NuclearLevel::KConvertionProbabilities() const
{
return _kCC;
}
const std::vector<G4double>& G4NuclearLevel::L1ConvertionProbabilities() const
{
return _l1CC;
}
const std::vector<G4double>& G4NuclearLevel::L2ConvertionProbabilities() const
{
return _l2CC;
}
const std::vector<G4double>& G4NuclearLevel::L3ConvertionProbabilities() const
{
return _l3CC;
}
const std::vector<G4double>& G4NuclearLevel::M1ConvertionProbabilities() const
{
return _m1CC;
}
const std::vector<G4double>& G4NuclearLevel::M2ConvertionProbabilities() const
{
return _m2CC;
}
const std::vector<G4double>& G4NuclearLevel::M3ConvertionProbabilities() const
{
return _m3CC;
}
const std::vector<G4double>& G4NuclearLevel::M4ConvertionProbabilities() const
{
return _m4CC;
}
const std::vector<G4double>& G4NuclearLevel::M5ConvertionProbabilities() const
{
return _m5CC;
}
const std::vector<G4double>& G4NuclearLevel::NPlusConvertionProbabilities() const
{
return _nPlusCC;
}
const std::vector<G4double>& G4NuclearLevel::TotalConvertionProbabilities() const
{
return _totalCC;
}
G4double G4NuclearLevel::Energy() const
{
return _energy;
}
G4double G4NuclearLevel::AngularMomentum() const
{
return _angularMomentum;
}
G4double G4NuclearLevel::HalfLife() const
{
return _halfLife;
}
G4int G4NuclearLevel::NumberOfGammas() const
{
return _nGammas;
}
void G4NuclearLevel::PrintAll() const
{
G4cout << "---- Level energy = " << _energy << ", angular momentum = "
<< _angularMomentum << ", half life " << _halfLife
<< ", " << _nGammas << " photons" << G4endl;
G4int i;
G4cout << " Gammas: ";
for (i=0; i<_nGammas; i++) { G4cout << _energies[i] << " "; }
G4cout << G4endl << " Weights: ";
for (i=0; i<_nGammas; i++) { G4cout << _weights[i] << " "; }
G4cout << G4endl << " Relative transition probabilities ";
for (i=0; i<_nGammas; i++) { G4cout << _prob[i] << " "; }
G4cout << G4endl << " Cumulative probabilities: ";
for (i=0; i<_nGammas; i++) { G4cout << _cumProb[i] << " "; }
G4cout << G4endl << " Polarities: ";
for (i=0; i<_nGammas; i++) { G4cout << _polarities[i] << " "; }
G4cout << G4endl;
}
void G4NuclearLevel::PrintLevels() const
{
G4cout << " Eexc(MeV)= " << _energy
<< " Time(ns)= " << _halfLife/ns << " Ntrans= " << _nGammas
<< G4endl;
}
void G4NuclearLevel::Finalize() {
_nGammas = _energies.size();
MakeProbabilities();
MakeCumProb();
}
void G4NuclearLevel::MakeProbabilities()
{
G4double sum = 0.;
G4int i = 0;
for (i=0; i<_nGammas; i++) {
sum += _weights[i]*(1.+_totalCC[i]);
}
if (sum <= 0.) _prob.resize(_nGammas, 1./_nGammas); // Fast fill
else {
_prob.reserve(_nGammas);
for (i=0; i<_nGammas; i++) {
_prob.push_back(_weights[i]*(1.+_totalCC[i])/sum);
}
}
}
void G4NuclearLevel::MakeCumProb()
{
if (_nGammas <= 0) return;
_cumProb.reserve(_nGammas);
G4double sum = _prob[0];
_cumProb.push_back(sum);
for (G4int i=1; i<_nGammas; i++) {
sum += _prob[i];
_cumProb.push_back(sum);
}
}
G4NuclearLevel& G4NuclearLevel::operator=(const G4NuclearLevel &right)
{
if(this != &right)
{
_energies = right._energies;
_weights =right._weights;
_prob =right._prob;
_cumProb =right._cumProb;
_polarities =right._polarities;
_kCC = right._kCC;
_l1CC =right._l1CC;
_l2CC =right._l2CC;
_l3CC =right._l3CC;
_m1CC = right._m1CC;
_m2CC = right._m2CC;
_m3CC = right._m3CC;
_m4CC = right._m4CC;
_m5CC = right._m5CC;
_nPlusCC = right._nPlusCC;
_totalCC = right._totalCC;
_energy = right._energy;
_halfLife = right._halfLife;
_angularMomentum = right._angularMomentum;
_nGammas = right._nGammas;
}
return *this;
}
G4NuclearLevel::G4NuclearLevel(const G4NuclearLevel &right)
{
_energies = right._energies;
_weights =right._weights;
_prob =right._prob;
_cumProb =right._cumProb;
_polarities =right._polarities;
_kCC = right._kCC;
_l1CC =right._l1CC;
_l2CC =right._l2CC;
_l3CC =right._l3CC;
_m1CC = right._m1CC;
_m2CC = right._m2CC;
_m3CC = right._m3CC;
_m4CC = right._m4CC;
_m5CC = right._m5CC;
_nPlusCC = right._nPlusCC;
_totalCC = right._totalCC;
_energy = right._energy;
_halfLife = right._halfLife;
_angularMomentum = right._angularMomentum;
_nGammas = right._nGammas;
}
@@ -1,428 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearLevelManager.cc 93357 2015-10-19 13:40:13Z gcosmo $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4NuclearLevelManager
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 24 October 1998
//
// Modifications:
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added half-life, angular momentum, parity, emissioni type
// reading from experimental data.
// 02 May 2003, Vladimir Ivanchenko remove rublic copy constructor
// 06 Oct 2010, M. Kelsey -- Use object storage, not pointers, drop
// public access to list, simplify list construction
// -------------------------------------------------------------------
#include <stdlib.h>
#include <fstream>
#include <sstream>
#include <algorithm>
#include "G4NuclearLevelManager.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "G4NuclearLevel.hh"
#include "G4ios.hh"
#include "G4HadronicException.hh"
#include "G4HadTmpUtil.hh"
#include "G4NucleiProperties.hh"
#include "G4PhysicalConstants.hh"
G4double G4NuclearLevelManager::_levelEnergy=0.;
G4double G4NuclearLevelManager::_gammaEnergy=0.;
G4double G4NuclearLevelManager::_probability=0.;
G4double G4NuclearLevelManager::_polarity=0.;
G4double G4NuclearLevelManager::_halfLife=0.;
G4double G4NuclearLevelManager::_angularMomentum=0.;
G4double G4NuclearLevelManager::_kCC=0.;
G4double G4NuclearLevelManager::_l1CC=0.;
G4double G4NuclearLevelManager::_l2CC=0.;
G4double G4NuclearLevelManager::_l3CC=0.;
G4double G4NuclearLevelManager::_m1CC=0.;
G4double G4NuclearLevelManager::_m2CC=0.;
G4double G4NuclearLevelManager::_m3CC=0.;
G4double G4NuclearLevelManager::_m4CC=0.;
G4double G4NuclearLevelManager::_m5CC=0.;
G4double G4NuclearLevelManager::_nPlusCC=0.;
G4double G4NuclearLevelManager::_totalCC=0.;
G4NuclearLevelManager::G4NuclearLevelManager(G4int Z, G4int A,
const G4String& filename) :
_nucleusA(A), _nucleusZ(Z), _validity(false),
_levels(0)
{
if (A <= 0 || Z <= 0 || Z > A ) {
throw G4HadronicException(__FILE__, __LINE__,
"==== G4NuclearLevelManager ==== (Z,A) <0, or Z>A");
}
MakeLevels(filename);
/*
G4cout << "+++++ New G4NuclearLevelManager Z= " << Z << " A= " << A
<< " " << _levels;
if(_levels) { G4cout << " Nlevels= " << _levels->size(); }
G4cout << G4endl;
*/
}
G4NuclearLevelManager::~G4NuclearLevelManager()
{
ClearLevels();
}
void G4NuclearLevelManager::SetNucleus(G4int Z, G4int A, const G4String& filename)
{
if (A <= 0 || Z <= 0 || Z > A ) {
throw G4HadronicException(__FILE__, __LINE__,
"==== G4NuclearLevelManager ==== (Z,A) <0, or Z>A");
}
if (_nucleusZ != Z || _nucleusA != A)
{
_nucleusA = A;
_nucleusZ = Z;
MakeLevels(filename);
}
}
const G4NuclearLevel* G4NuclearLevelManager::GetLevel(G4int i) const {
return (i>=0 && i<NumberOfLevels()) ? (*_levels)[i] : 0;
}
const G4NuclearLevel*
G4NuclearLevelManager::NearestLevel(G4double energy, G4double) const
{
if (NumberOfLevels() <= 0) return 0;
G4int iNear = -1;
//G4cout << "G4NuclearLevelManager::NearestLevel E(MeV)= "
// << energy/MeV << " dEmax(MeV)= " << eDiffMax/MeV << G4endl;
G4double diff = 1.e+10;
for (unsigned int i=0; i<_levels->size(); ++i)
{
G4double e = GetLevel(i)->Energy();
G4double eDiff = std::fabs(e - energy);
//G4cout << i << ". eDiff(MeV)= " << eDiff/MeV << G4endl;
if (eDiff <= diff)
{
diff = eDiff;
iNear = i;
}
}
return GetLevel(iNear); // Includes range checking on iNear
}
G4double G4NuclearLevelManager::MinLevelEnergy() const
{
return (NumberOfLevels() > 0) ? _levels->front()->Energy() : 9999.*GeV;
}
G4double G4NuclearLevelManager::MaxLevelEnergy() const
{
return (NumberOfLevels() > 0) ? _levels->back()->Energy() : 0.*GeV;
}
const G4NuclearLevel* G4NuclearLevelManager::HighestLevel() const
{
return (NumberOfLevels() > 0) ? _levels->front() : 0;
}
const G4NuclearLevel* G4NuclearLevelManager::LowestLevel() const
{
return (NumberOfLevels() > 0) ? _levels->back() : 0;
}
G4bool G4NuclearLevelManager::Read(std::ifstream& dataFile)
{
G4bool goodRead = ReadDataLine(dataFile);
if (goodRead) ProcessDataLine();
return goodRead;
}
// NOTE: Standard stream I/O generates a 45 byte std::string per item!
G4bool G4NuclearLevelManager::ReadDataLine(std::ifstream& dataFile) {
/***** DO NOT USE REGULAR STREAM I/O
G4bool result = true;
if (dataFile >> _levelEnergy)
{
dataFile >> _gammaEnergy >> _probability >> _polarity >> _halfLife
>> _angularMomentum >> _totalCC >> _kCC >> _l1CC >> _l2CC
>> _l3CC >> _m1CC >> _m2CC >> _m3CC >> _m4CC >> _m5CC
>> _nPlusCC;
}
else result = false;
*****/
// Each item will return iostream status
return (ReadDataItem(dataFile, _levelEnergy) &&
ReadDataItem(dataFile, _gammaEnergy) &&
ReadDataItem(dataFile, _probability) &&
ReadDataItem(dataFile, _polarity) &&
ReadDataItem(dataFile, _halfLife) &&
ReadDataItem(dataFile, _angularMomentum) &&
ReadDataItem(dataFile, _totalCC) &&
ReadDataItem(dataFile, _kCC) &&
ReadDataItem(dataFile, _l1CC) &&
ReadDataItem(dataFile, _l2CC) &&
ReadDataItem(dataFile, _l3CC) &&
ReadDataItem(dataFile, _m1CC) &&
ReadDataItem(dataFile, _m2CC) &&
ReadDataItem(dataFile, _m3CC) &&
ReadDataItem(dataFile, _m4CC) &&
ReadDataItem(dataFile, _m5CC) &&
ReadDataItem(dataFile, _nPlusCC) );
}
G4bool
G4NuclearLevelManager::ReadDataItem(std::istream& dataFile, G4double& x)
{
// G4bool okay = (dataFile >> buffer) != 0; // Get next token
// if (okay) x = strtod(buffer, NULL);
char buffer[30];
for(G4int i=0; i<30; ++i) { buffer[i] = 0; }
G4bool okay = true;
dataFile >> buffer;
if(dataFile.fail()) { okay = false; }
else { x = strtod(buffer, NULL); }
return okay;
}
void G4NuclearLevelManager::ProcessDataLine()
{
const G4double minProbability = 1e-8;
// Assign units for dimensional quantities
_levelEnergy *= keV;
_gammaEnergy *= keV;
_halfLife *= second;
// The following adjustment is needed to take care of anomalies in
// data files, where some transitions show up with relative probability
// zero
if (_probability < minProbability) _probability = minProbability;
// the folowwing is to convert icc probability to accumulative ones
_l1CC += _kCC;
_l2CC += _l1CC;
_l3CC += _l2CC;
_m1CC += _l3CC;
_m2CC += _m1CC;
_m3CC += _m2CC;
_m4CC += _m3CC;
_m5CC += _m4CC;
_nPlusCC += _m5CC;
if (_nPlusCC!=0) { // Normalize to probabilities
_kCC /= _nPlusCC;
_l1CC /= _nPlusCC;
_l2CC /= _nPlusCC;
_l3CC /= _nPlusCC;
_m1CC /= _nPlusCC;
_m2CC /= _nPlusCC;
_m3CC /= _nPlusCC;
_m4CC /= _nPlusCC;
_m5CC /= _nPlusCC;
_nPlusCC /= _nPlusCC;
} else { // Total was zero, reset to unity
_kCC = 1;
_l1CC = 1;
_l2CC = 1;
_l3CC = 1;
_m1CC = 1;
_m2CC = 1;
_m3CC = 1;
_m4CC = 1;
_m5CC = 1;
_nPlusCC = 1;
}
// G4cout << "Read " << _levelEnergy << " " << _gammaEnergy << " " << _probability << G4endl;
}
void G4NuclearLevelManager::ClearLevels()
{
_validity = false;
if (NumberOfLevels() > 0) {
std::for_each(_levels->begin(), _levels->end(), DeleteLevel());
_levels->clear();
}
delete _levels;
_levels = 0;
}
void G4NuclearLevelManager::MakeLevels(const G4String& filename)
{
_validity = false;
if (NumberOfLevels() > 0) ClearLevels(); // Discard existing data
std::ifstream inFile(filename, std::ios::in);
if (! inFile)
{
#ifdef GAMMAFILEWARNING
if (_nucleusZ > 10) G4cout << " G4NuclearLevelManager: nuclide ("
<< _nucleusZ << "," << _nucleusA
<< ") does not have a gamma levels file" << G4endl;
#endif
return;
}
_levels = new G4PtrLevelVector;
// Read individual gamma data and fill levels for this nucleus
G4NuclearLevel* thisLevel = 0;
G4int nData = 0;
// Loop checking, 05-Aug-2015, Vladimir Ivanchenko
while (Read(inFile)) {
thisLevel = UseLevelOrMakeNew(thisLevel); // May create new pointer
AddDataToLevel(thisLevel);
nData++; // For debugging purposes
}
FinishLevel(thisLevel); // Final must be completed by hand
// ---- MGP ---- Don't forget to close the file
inFile.close();
// G4cout << " ==== MakeLevels ===== " << nData << " data read " << G4endl;
G4PtrSort<G4NuclearLevel>(_levels);
_validity = true;
return;
}
G4NuclearLevel*
G4NuclearLevelManager::UseLevelOrMakeNew(G4NuclearLevel* level)
{
if (level && _levelEnergy == level->Energy()) return level; // No change
if (level) FinishLevel(level); // Save what we have up to now
// G4cout << "Making a new level... " << _levelEnergy << G4endl;
return new G4NuclearLevel(_levelEnergy, _halfLife, _angularMomentum);
}
void G4NuclearLevelManager::AddDataToLevel(G4NuclearLevel* level)
{
if (!level) return; // Sanity check
level->_energies.push_back(_gammaEnergy);
level->_weights.push_back(_probability);
level->_polarities.push_back(_polarity);
level->_kCC.push_back(_kCC);
level->_l1CC.push_back(_l1CC);
level->_l2CC.push_back(_l2CC);
level->_l3CC.push_back(_l3CC);
level->_m1CC.push_back(_m1CC);
level->_m2CC.push_back(_m2CC);
level->_m3CC.push_back(_m3CC);
level->_m4CC.push_back(_m4CC);
level->_m5CC.push_back(_m5CC);
level->_nPlusCC.push_back(_nPlusCC);
level->_totalCC.push_back(_totalCC);
}
void G4NuclearLevelManager::FinishLevel(G4NuclearLevel* level)
{
if (!level || !_levels) return; // Sanity check
level->Finalize();
_levels->push_back(level);
}
void G4NuclearLevelManager::PrintAll()
{
G4int nLevels = NumberOfLevels();
G4cout << " ==== G4NuclearLevelManager ==== (" << _nucleusZ << ", " << _nucleusA
<< ") has " << nLevels << " levels" << G4endl
<< "Highest level is at energy " << MaxLevelEnergy() << " MeV "
<< G4endl << "Lowest level is at energy " << MinLevelEnergy()
<< " MeV " << G4endl;
for (G4int i=0; i<nLevels; ++i) {
GetLevel(i)->PrintAll();
}
}
void G4NuclearLevelManager::PrintLevels()
{
G4int nLevels = NumberOfLevels();
G4double efermi = G4NucleiProperties::GetNuclearMass(_nucleusA-1, _nucleusZ)
+ neutron_mass_c2 -
G4NucleiProperties::GetNuclearMass(_nucleusA, _nucleusZ);
G4cout << "Z= " << _nucleusZ << " A= " << _nucleusA
<< " " << nLevels << " levels"
<< " Efermi(MeV)= " << efermi << G4endl;
for (G4int i=0; i<nLevels; ++i) {
GetLevel(i)->PrintLevels();
}
}
G4NuclearLevelManager::G4NuclearLevelManager(const G4NuclearLevelManager &right)
{
_nucleusA = right._nucleusA;
_nucleusZ = right._nucleusZ;
_validity = right._validity;
if (right._levels != 0)
{
_levels = new G4PtrLevelVector;
G4int n = right._levels->size();
G4int i;
for (i=0; i<n; ++i)
{
_levels->push_back(new G4NuclearLevel(*(right.GetLevel(i))));
}
G4PtrSort<G4NuclearLevel>(_levels);
}
else
{
_levels = 0;
}
}
@@ -1,188 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearLevelStore.cc 88406 2015-02-18 09:13:29Z gcosmo $
//
// 06-10-2010 M. Kelsey -- Drop static data members.
// 17-11-2010 V. Ivanchenko - make as a classical singleton.
// 17-10-2011 V. L. Desorgher - allows to define separate datafile for
// given isotope
// 06-01-2012 V. Ivanchenko - cleanup the code; new method GetLevelManager
// 19-11-2014 M. Asai - protection against reading the same file from
// more than one worker threads
//
#include "G4NuclearLevelStore.hh"
#include <sstream>
#include <fstream>
G4ThreadLocal G4NuclearLevelStore* G4NuclearLevelStore::theInstance = 0;
#ifdef G4MULTITHREADED
G4NuclearLevelStore* G4NuclearLevelStore::theShadowInstance = 0;
G4Mutex G4NuclearLevelStore::nuclearLevelStoreMutex = G4MUTEX_INITIALIZER;
#endif
G4NuclearLevelStore* G4NuclearLevelStore::GetInstance()
{
if(!theInstance) {
static G4ThreadLocalSingleton<G4NuclearLevelStore> inst;
theInstance = inst.Instance();
}
#ifdef G4MULTITHREADED
if(!theShadowInstance) {
static G4NuclearLevelStore shadowInst;
theShadowInstance = &shadowInst;
}
#endif
return theInstance;
}
G4NuclearLevelStore::G4NuclearLevelStore()
{
userFiles = false;
char* env = getenv("G4LEVELGAMMADATA");
if (env == 0)
{
G4cout << "G4NuclarLevelStore: please set the G4LEVELGAMMADATA environment variable\n";
dirName = "";
}
else
{
dirName = env;
dirName += '/';
}
}
G4NuclearLevelStore::~G4NuclearLevelStore()
{
#ifdef G4MULTITHREADED
if(this==theShadowInstance) // G4NuclearLevelManager object should be deleted only by the master
{
#endif
ManagersMap::iterator i;
for (i = theManagers.begin(); i != theManagers.end(); ++i)
{ delete i->second; }
#ifdef G4MULTITHREADED
}
#endif
}
void
G4NuclearLevelStore::AddUserEvaporationDataFile(G4int Z, G4int A,
const G4String& filename)
{
if (Z<1 || A<2) {
G4cout<<"G4NuclearLevelStore::AddUserEvaporationDataFile "
<<" Z= " << Z << " and A= " << A << " not valid!"<<G4endl;
}
std::ifstream DecaySchemeFile(filename);
if (DecaySchemeFile){
G4int ID_ion=Z*1000+A;//A*1000+Z;
theUserDataFiles[ID_ion]=filename;
userFiles = true;
}
else {
G4cout<<"The file "<<filename<<" does not exist!"<<G4endl;
}
}
G4String
G4NuclearLevelStore::GenerateFileName(G4int Z, G4int A) const
{
std::ostringstream streamName;
streamName << 'z' << Z << ".a" << A;
G4String name(streamName.str());
return name;
}
G4NuclearLevelManager*
G4NuclearLevelStore::GetManager(G4int Z, G4int A)
{
G4NuclearLevelManager * result = 0;
if (A < 1 || Z < 1 || A < Z)
{
//G4cout << "G4NuclearLevelStore::GetManager: Wrong values Z = " << Z
// << " A = " << A << '\n';
return result;
}
// Generate the key = filename
G4int key = Z*1000+A; //GenerateKey(Z,A);
// Check if already exists that key
ManagersMap::iterator idx = theManagers.find(key);
#ifdef G4MULTITHREADED
// If doesn't exists then check the master
if ( idx == theManagers.end() )
{
G4MUTEXLOCK(&G4NuclearLevelStore::nuclearLevelStoreMutex);
ManagersMap::iterator idxS = theShadowInstance->theManagers.find(key);
if ( idxS == theShadowInstance->theManagers.end() )
{
// If doesn't exists then create it
G4String file = dirName + GenerateFileName(Z,A);
//Check if data have been provided by the user
if(userFiles) {
G4String file1 = theUserDataFiles[key];//1000*A+Z];
if (file1 != "") { file = file1; }
}
result = new G4NuclearLevelManager(Z,A,file);
theShadowInstance->theManagers.insert(std::make_pair(key,result));
}
else
{
// if it exists in the master
result = idxS->second;
}
// register to the local map
theManagers.insert(std::make_pair(key,result));
G4MUTEXUNLOCK(&G4NuclearLevelStore::nuclearLevelStoreMutex);
}
#else
// If doesn't exists then create it
if ( idx == theManagers.end() )
{
G4String file = dirName + GenerateFileName(Z,A);
//Check if data have been provided by the user
if(userFiles) {
G4String file1 = theUserDataFiles[key];//1000*A+Z];
if (file1 != "") { file = file1; }
}
result = new G4NuclearLevelManager(Z,A,file);
theManagers.insert(std::make_pair(key,result));
}
#endif
else
// But if it exists...
{
result = idx->second;
}
return result;
}
@@ -1,248 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhotonEvaporationOLD.cc 91873 2015-08-07 17:50:24Z vnivanch $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4PhotonEvaporationOLD
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 8 March 2002, Fan Lei (flei@space.qinetiq.com)
//
// Implementation of Internal Convertion process in discrete deexcitation
// The following public methods have been added.
//
// void SetICM (G4bool);
// void CallFromRDM(G4bool);
// void SetMaxHalfLife(G4double) ;
// void SetEOccupancy( G4ElectronOccupancy eOccupancy) ;
// G4ElectronOccupancy GetEOccupancy () ;
//
// 11 May 2010, V.Ivanchenko add implementation of EmittedFragment and
// BreakUpFragment methods; cleanup logic
//
// 22 October 2015, V.Ivanchenko renamed to G4PhotonEvaporationOLD
//
// -------------------------------------------------------------------
//
#include "G4PhotonEvaporationOLD.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"
#include "G4Gamma.hh"
#include "G4LorentzVector.hh"
#include "G4VGammaTransition.hh"
#include "G4Fragment.hh"
#include "G4FragmentVector.hh"
#include "G4ContinuumGammaDeexcitation.hh"
#include "G4DiscreteGammaDeexcitation.hh"
#include "G4E1Probability.hh"
#include "G4NuclearLevelStore.hh"
static const G4double tolerance = 0.1*CLHEP::keV;
G4PhotonEvaporationOLD::G4PhotonEvaporationOLD(const G4String & aName)
: G4VEvaporationChannel(aName),
verbose(0), myOwnProbAlgorithm(true),
eOccupancy(0), vShellNumber(-1), gammaE(0.)
{
G4Exception ("G4PhotonEvaporationOLD: ", "had001", JustWarning,
"This class is obsolete and will be removed for the next public release");
probAlgorithm = new G4E1Probability;
contDeexcitation = new G4ContinuumGammaDeexcitation;
G4DiscreteGammaDeexcitation* p = new G4DiscreteGammaDeexcitation();
discrDeexcitation = p;
p->SetICM(false);
// Time limits
G4double timeLimit = DBL_MAX;
char* env = getenv("G4AddTimeLimitToPhotonEvaporation");
if(env) { timeLimit = 1.e-16*second; }
// Time for short-cut simulation of photon evaporationOLD
p->SetTimeLimit(timeLimit);
// Default time limit for isomere production
SetMaxHalfLife(DBL_MAX);
// SetMaxHalfLife(1.e-6*second);
nucleus = 0;
}
G4PhotonEvaporationOLD::~G4PhotonEvaporationOLD()
{
if(myOwnProbAlgorithm) delete probAlgorithm;
delete discrDeexcitation;
delete contDeexcitation;
}
G4Fragment* G4PhotonEvaporationOLD::EmittedFragment(G4Fragment* aNucleus)
{
//G4cout << "G4PhotonEvaporationOLD::EmittedFragment" << G4endl;
vShellNumber = -1;
G4Fragment* gamma = 0;
if(contDeexcitation->CanDoTransition(aNucleus)) {
gamma = contDeexcitation->GenerateGamma(aNucleus);
if(gamma && verbose > 1) {
G4cout << "G4PhotonEvaporationOLD::EmittedFragment continium deex: "
<< gamma << G4endl;
G4cout << " Residual: " << aNucleus << G4endl;
}
} else if(discrDeexcitation->CanDoTransition(aNucleus)) {
// Do one photon emission by the discrete deexcitation
gamma = discrDeexcitation->GenerateGamma(aNucleus);
if(gamma) {
vShellNumber = discrDeexcitation->GetVacantSN();
if (verbose > 1) {
G4cout << "G4PhotonEvaporationOLD::EmittedFragment discrete deex: "
<< gamma << G4endl;
G4cout << " Residual: " << aNucleus << G4endl;
}
}
}
return gamma;
}
G4bool G4PhotonEvaporationOLD::BreakUpChain(G4FragmentVector* products,
G4Fragment* aNucleus)
{
//G4cout << "G4PhotonEvaporationOLD::BreakUpChain" << G4endl;
G4Fragment* gamma = 0;
// one continues emission is not excluded
if(contDeexcitation->CanDoTransition(aNucleus)) {
gamma = contDeexcitation->GenerateGamma(aNucleus);
if(gamma) {
if (verbose > 1) {
G4cout << "G4PhotonEvaporationOLD::EmittedFragment continium deex: "
<< gamma << G4endl;
G4cout << " Residual: " << aNucleus << G4endl;
}
products->push_back(gamma);
}
}
// main emissions are discrete
discrDeexcitation->DoChain(products, aNucleus);
return false;
}
G4FragmentVector* G4PhotonEvaporationOLD::BreakUpFragment(G4Fragment* aNucleus)
{
//G4cout << "G4PhotonEvaporationOLD::BreakUpFragment" << G4endl;
G4FragmentVector* products = new G4FragmentVector();
BreakUpChain(products, aNucleus);
return products;
}
G4FragmentVector* G4PhotonEvaporationOLD::BreakUp(const G4Fragment& theNucleus)
{
//G4cout << "G4PhotonEvaporationOLD::BreakUp" << G4endl;
G4Fragment* aNucleus = new G4Fragment(theNucleus);
G4FragmentVector* products = new G4FragmentVector();
//discrDeexcitation->DoChain(products, aNucleus);
BreakUpChain(products, aNucleus);
products->push_back(aNucleus);
return products;
}
G4FragmentVector* G4PhotonEvaporationOLD::BreakItUp(const G4Fragment& theNucleus)
{
//G4cout << "G4PhotonEvaporationOLD::BreakItUp" << G4endl;
G4Fragment* aNucleus = new G4Fragment(theNucleus);
G4FragmentVector* products = new G4FragmentVector();
BreakUpChain(products, aNucleus);
products->push_back(aNucleus);
return products;
}
G4double
G4PhotonEvaporationOLD::GetEmissionProbability(G4Fragment* theNucleus)
{
G4double prob = 0.0;
G4int Z = theNucleus->GetZ_asInt();
G4int A = theNucleus->GetA_asInt();
G4double eexc = theNucleus->GetExcitationEnergy();
if(0 < Z && Z < A && eexc > tolerance) {
prob = probAlgorithm->EmissionProbability(*theNucleus, eexc);
}
return prob;
}
void
G4PhotonEvaporationOLD::SetEmissionStrategy(G4VEmissionProbability * alg)
{
if(myOwnProbAlgorithm) { delete probAlgorithm; }
probAlgorithm = alg;
myOwnProbAlgorithm = false;
}
void G4PhotonEvaporationOLD::SetVerboseLevel(G4int verb)
{
verbose = verb;
contDeexcitation->SetVerboseLevel(verbose);
discrDeexcitation->SetVerboseLevel(verbose);
}
void G4PhotonEvaporationOLD::SetICM(G4bool ic)
{
static_cast<G4DiscreteGammaDeexcitation*>(discrDeexcitation)->SetICM(ic);
}
void G4PhotonEvaporationOLD::SetMaxHalfLife(G4double hl)
{
static_cast<G4DiscreteGammaDeexcitation*>(discrDeexcitation)->SetHL(hl);
}
void G4PhotonEvaporationOLD::SetTimeLimit(G4double val)
{
discrDeexcitation->SetTimeLimit(val);
}
void G4PhotonEvaporationOLD::RDMForced(G4bool fromRDM)
{
static_cast<G4DiscreteGammaDeexcitation*>(discrDeexcitation)->SetRDM(fromRDM);
}
void G4PhotonEvaporationOLD::SetEOccupancy(G4ElectronOccupancy eo)
{
discrDeexcitation->SetEO(eo);
}
@@ -1,214 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VGammaDeexcitation.cc 94676 2015-12-02 09:51:20Z gunter $
//
// -------------------------------------------------------------------
// GEANT 4 class file
//
// CERN, Geneva, Switzerland
//
// File name: G4VGammaDeexcitation
//
// Author: Maria Grazia Pia (pia@genova.infn.it)
//
// Creation date: 23 October 1998
//
// Modifications:
//
// 21 Nov 2001, Fan Lei (flei@space.qinetiq.com)
// Modified GenerateGamma() and UpdateUncleus() for implementation
// of Internal Conversion processs
//
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
// Added creation time evaluation for products of evaporation
//
// 19 April 2010, J. M. Quesada calculations in CM system
// pending final boost to lab system (not critical)
//
// 23 April 2010, V.Ivanchenko rewite kinematic part using PDG formula
// for 2-body decay
//
// 07 May 2011, V.Ivanchenko implement check ICM flag - produce or not e-
//
// -------------------------------------------------------------------
#include "G4VGammaDeexcitation.hh"
#include "globals.hh"
#include "G4PhysicalConstants.hh"
#include "Randomize.hh"
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4LorentzVector.hh"
#include "G4VGammaTransition.hh"
#include "G4Fragment.hh"
#include "G4FragmentVector.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4DiscreteGammaTransition.hh"
G4VGammaDeexcitation::G4VGammaDeexcitation(): _transition(0), _verbose(0),
_electronO (0), _vSN(-1)
{
_tolerance = 0.1*CLHEP::keV;
_timeLimit = DBL_MAX;
}
G4VGammaDeexcitation::~G4VGammaDeexcitation()
{
delete _transition;
}
void G4VGammaDeexcitation::DoChain(G4FragmentVector* products,
G4Fragment* nucleus)
{
if (_verbose > 1) { G4cout << "G4VGammaDeexcitation::DoChain" << G4endl; }
if(CanDoTransition(nucleus)) {
for(size_t i=0; i<100; ++i) {
_transition->SetEnergyFrom(nucleus->GetExcitationEnergy());
G4Fragment* gamma = GenerateGamma(nucleus);
if (gamma) { products->push_back(gamma); }
else { break; }
//G4cout << i << ". Egamma(MeV)= " << gamma->GetMomentum().e()
// << "; new Eex(MeV)= " << nucleus->GetExcitationEnergy()
// << G4endl;
if(nucleus->GetExcitationEnergy() <= _tolerance) { break; }
}
}
if (_verbose > 1) {
G4cout << "G4VGammaDeexcitation::DoChain - end" << G4endl;
}
}
G4Fragment* G4VGammaDeexcitation::GenerateGamma(G4Fragment* aNucleus)
{
G4Fragment * thePhoton = 0;
_vSN = -1;
_transition->SelectGamma(); // it can be conversion electron too
G4double etrans = _transition->GetGammaEnergy();
//L.Desorgher 05/01/2015 need to add the bond energy for correct
// computation of a transition in case of ICM
G4DiscreteGammaTransition* dtransition =
dynamic_cast <G4DiscreteGammaTransition*> (_transition);
G4double bond_energy=0.;
if (dtransition && !dtransition->IsAGamma()) {
bond_energy = dtransition->GetBondEnergy();
}
etrans += bond_energy;
//G4cout << "G4VGammaDeexcitation::GenerateGamma - Etrans(MeV)= "
// << etrans << G4endl;
if(etrans <= 0.0) { return thePhoton; }
// final excitation
G4double excitation = aNucleus->GetExcitationEnergy() - etrans;
if(excitation <= _tolerance) { excitation = 0.0; }
G4double gammaTime = _transition->GetGammaCreationTime();
if (_verbose > 1) {
G4cout << "G4VGammaDeexcitation::GenerateGamma - Edeexc(MeV)= "
<< etrans << "; Time(ns)= " << gammaTime/CLHEP::ns
<< "; left Eexc(MeV)= " << excitation << G4endl;
}
// Do complete Lorentz computation
G4LorentzVector lv = aNucleus->GetMomentum();
G4double Mass = aNucleus->GetGroundStateMass() + excitation;
// select secondary
G4ParticleDefinition* gamma = G4Gamma::Gamma();
if (dtransition && !dtransition->IsAGamma() ) {
gamma = G4Electron::Electron();
_vSN = dtransition->GetOrbitNumber();
_electronO.RemoveElectron(_vSN);
//L. Desorgher 05/01/2015 need to remove atomic bond energy
// of the IC electron
lv += G4LorentzVector(0.0,0.0,0.0,
CLHEP::electron_mass_c2 - bond_energy);
}
G4double cosTheta = 1. - 2. * G4UniformRand();
G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
G4double phi = twopi * G4UniformRand();
G4double eMass = gamma->GetPDGMass();
G4LorentzVector Gamma4P;
/*
G4cout << " Mass= " << eMass << " t= " << gammaTime
<< " tlim= " << _timeLimit << G4endl;
*/
// 2-body decay in rest frame
G4double Ecm = lv.mag();
G4ThreeVector bst = lv.boostVector();
G4double GammaEnergy = 0.5*((Ecm - Mass)*(Ecm + Mass) + eMass*eMass)/Ecm;
if(GammaEnergy < eMass) { GammaEnergy = eMass; }
G4double mom = std::sqrt((GammaEnergy - eMass)*(GammaEnergy + eMass));
Gamma4P.set(mom * sinTheta * std::cos(phi),
mom * sinTheta * std::sin(phi),
mom * cosTheta, GammaEnergy);
// Lab system in normal case (_timeLimit = DBL_MAX)
if(gammaTime <= _timeLimit) {
Gamma4P.boost(bst);
lv -= Gamma4P;
} else {
// In exceptional case sample decay at rest at not correct position
// of stopping ion, 4-momentum balance is breaked but gamma energy
// is correct
lv -= Gamma4P;
G4double E = lv.e();
G4double P2= (E - Mass)*(E + Mass);
G4ThreeVector v = lv.vect().unit();
G4double p = 0.0;
if(P2 > 0.0) { p = std::sqrt(P2); }
else { E = Mass; }
lv.set(v.x()*p, v.y()*p, v.z()*p, E);
}
// modified primary fragment
gammaTime += aNucleus->GetCreationTime();
aNucleus->SetMomentum(lv);
aNucleus->SetCreationTime(gammaTime);
// gamma or e- are produced
thePhoton = new G4Fragment(Gamma4P,gamma);
thePhoton->SetCreationTime(gammaTime);
//G4cout << "G4VGammaDeexcitation::GenerateGamma : " << thePhoton << G4endl;
//G4cout << " Left nucleus: " << aNucleus << G4endl;
return thePhoton;
}