Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History 76885 2013-11-18 12:55:15Z gcosmo $
|
||||
$Id: History 84196 2014-10-10 14:31:48Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,16 @@ committal in the SVN repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
8 October 2014 Michael Kelsey (prophonon-V10-00-01)
|
||||
----------------------------------------------------
|
||||
- G4LatticeManager: Change to globally shared object (simple "static", not
|
||||
G4ThreadLocal). Fixes null-pointer crash in MT phononExample.
|
||||
|
||||
13 March 2014 Gabriele Cosmo (prophonon-V10-00-00)
|
||||
---------------------------------------------------
|
||||
- Removed inline keywords in methods in G4PhononDownconversion.cc
|
||||
and make coherent use of G4 types.
|
||||
|
||||
15 November 2013 Michael Kelsey (prophonon-V09-06-07)
|
||||
------------------------------------------------------
|
||||
- G4PhononDownconversion.cc: Address Coverity #53462, initialize data
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
/// \file materials/include/G4LatticeManager.hh
|
||||
/// \brief Definition of the G4LatticeManager class
|
||||
//
|
||||
// $Id: G4LatticeManager.hh 76885 2013-11-18 12:55:15Z gcosmo $
|
||||
// $Id: G4LatticeManager.hh 84196 2014-10-10 14:31:48Z gcosmo $
|
||||
//
|
||||
// 20131113 Add registry to carry unique lattice pointers, for EOJ deletion
|
||||
// 20131115 Drop lattice counters, not used anywhere
|
||||
// 20141008 Change to global singleton; must be shared across worker threads
|
||||
|
||||
#ifndef G4LatticeManager_h
|
||||
#define G4LatticeManager_h 1
|
||||
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include <map>
|
||||
#include <set>
|
||||
@@ -47,7 +47,7 @@ class G4VPhysicalVolume;
|
||||
|
||||
class G4LatticeManager {
|
||||
private:
|
||||
static G4ThreadLocal G4LatticeManager* fLM; // Singleton
|
||||
static G4LatticeManager* fLM; // Global, shared singleton
|
||||
|
||||
public:
|
||||
static G4LatticeManager* GetLatticeManager();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file processes/phonon/include/G4PhononDownconversion.hh
|
||||
/// \brief Definition of the G4PhononDownconversion class
|
||||
//
|
||||
// $Id: G4PhononDownconversion.hh 75725 2013-11-05 16:52:30Z mkelsey $
|
||||
// $Id: G4PhononDownconversion.hh 79778 2014-03-13 17:24:53Z gcosmo $
|
||||
//
|
||||
#ifndef G4PhononDownconversion_h
|
||||
#define G4PhononDownconversion_h 1
|
||||
@@ -47,17 +47,17 @@ protected:
|
||||
|
||||
private:
|
||||
// relative probability that anharmonic decay occurs L->L'+T'
|
||||
inline double GetLTDecayProb(G4double, G4double) const;
|
||||
inline double GetTTDecayProb(G4double, G4double) const;
|
||||
inline double MakeLDeviation(G4double, G4double) const;
|
||||
inline double MakeTTDeviation(G4double, G4double) const;
|
||||
inline double MakeTDeviation(G4double, G4double) const;
|
||||
G4double GetLTDecayProb(G4double, G4double) const;
|
||||
G4double GetTTDecayProb(G4double, G4double) const;
|
||||
G4double MakeLDeviation(G4double, G4double) const;
|
||||
G4double MakeTTDeviation(G4double, G4double) const;
|
||||
G4double MakeTDeviation(G4double, G4double) const;
|
||||
|
||||
void MakeTTSecondaries(const G4Track&);
|
||||
void MakeLTSecondaries(const G4Track&);
|
||||
|
||||
private:
|
||||
double fBeta, fGamma, fLambda, fMu; // Local buffers for calculations
|
||||
G4double fBeta, fGamma, fLambda, fMu; // Local buffers for calculations
|
||||
|
||||
// hide assignment operator as private
|
||||
G4PhononDownconversion(G4PhononDownconversion&);
|
||||
@@ -65,13 +65,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file processes/phonon/include/G4PhononPolarization.hh
|
||||
/// \brief Definition of the G4PhononPolarization enum
|
||||
//
|
||||
// $Id: G4PhononPolarization.hh 75725 2013-11-05 16:52:30Z mkelsey $
|
||||
// $Id: G4PhononPolarization.hh 75844 2013-11-06 17:35:56Z gcosmo $
|
||||
//
|
||||
#ifndef G4PhononPolarization_h
|
||||
#define G4PhononPolarization_h 1
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file processes/phonon/include/G4PhononReflection.hh
|
||||
/// \brief Definition of the G4PhononReflection class
|
||||
//
|
||||
// $Id: G4PhononReflection.hh 75725 2013-11-05 16:52:30Z mkelsey $
|
||||
// $Id: G4PhononReflection.hh 75844 2013-11-06 17:35:56Z gcosmo $
|
||||
//
|
||||
#ifndef G4PhononReflection_h
|
||||
#define G4PhononReflection_h 1
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file processes/phonon/include/G4PhononScattering.hh
|
||||
/// \brief Definition of the G4PhononScattering class
|
||||
//
|
||||
// $Id: G4PhononScattering.hh 75725 2013-11-05 16:52:30Z mkelsey $
|
||||
// $Id: G4PhononScattering.hh 75844 2013-11-06 17:35:56Z gcosmo $
|
||||
//
|
||||
#ifndef G4PhononScattering_h
|
||||
#define G4PhononScattering_h 1
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file processes/phonon/include/G4VPhononProcess.hh
|
||||
/// \brief Definition of the G4VPhononProcess base class
|
||||
//
|
||||
// $Id: G4VPhononProcess.hh 75725 2013-11-05 16:52:30Z mkelsey $
|
||||
// $Id: G4VPhononProcess.hh 75844 2013-11-06 17:35:56Z gcosmo $
|
||||
//
|
||||
#ifndef G4VPhononProcess_h
|
||||
#define G4VPhononProcess_h 1
|
||||
|
||||
@@ -26,11 +26,13 @@
|
||||
/// \file materials/src/G4LatticeManager.cc
|
||||
/// \brief Implementation of the G4LatticeManager class
|
||||
//
|
||||
// $Id: G4LatticeManager.cc 76693 2013-11-14 08:47:37Z gcosmo $
|
||||
// $Id: G4LatticeManager.cc 84196 2014-10-10 14:31:48Z gcosmo $
|
||||
//
|
||||
// 20131113 Delete lattices in (new) registry, not in lookup maps
|
||||
// 20141008 Change to global singleton; must be shared across worker threads
|
||||
|
||||
#include "G4LatticeManager.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
#include "G4LatticeLogical.hh"
|
||||
#include "G4LatticePhysical.hh"
|
||||
#include "G4LatticeReader.hh"
|
||||
@@ -38,10 +40,14 @@
|
||||
#include "G4Material.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include <fstream>
|
||||
|
||||
G4ThreadLocal G4LatticeManager* G4LatticeManager::fLM = 0;
|
||||
G4LatticeManager* G4LatticeManager::fLM = 0; // Global (shared) singleton
|
||||
|
||||
namespace {
|
||||
G4Mutex latMutex = G4MUTEX_INITIALIZER; // For thread protection
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -82,8 +88,11 @@ void G4LatticeManager::Clear() {
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4LatticeManager* G4LatticeManager::GetLatticeManager() {
|
||||
//if no lattice manager exists, create one.
|
||||
// if no lattice manager exists, create one.
|
||||
G4AutoLock latLock(&latMutex); // Protect before changing pointer
|
||||
if (!fLM) fLM = new G4LatticeManager();
|
||||
latLock.unlock();
|
||||
|
||||
return fLM;
|
||||
}
|
||||
|
||||
@@ -95,8 +104,10 @@ G4bool G4LatticeManager::RegisterLattice(G4Material* Mat,
|
||||
G4LatticeLogical* Lat) {
|
||||
if (!Mat || !Lat) return false; // Don't register null pointers
|
||||
|
||||
G4AutoLock latLock(&latMutex); // Protect before changing registry
|
||||
fLLattices.insert(Lat); // Take ownership in registry
|
||||
fLLatticeList[Mat] = Lat;
|
||||
latLock.unlock();
|
||||
|
||||
if (verboseLevel) {
|
||||
G4cout << "G4LatticeManager::RegisterLattice: "
|
||||
@@ -162,12 +173,16 @@ G4bool G4LatticeManager::RegisterLattice(G4VPhysicalVolume* Vol,
|
||||
G4LatticePhysical* Lat) {
|
||||
if (!Vol || !Lat) return false; // Don't register null pointers
|
||||
|
||||
G4AutoLock latLock(&latMutex); // Protect before changing registry
|
||||
|
||||
// SPECIAL: Register first lattice with a null volume to act as default
|
||||
if (fPLatticeList.empty()) fPLatticeList[0] = Lat;
|
||||
|
||||
fPLattices.insert(Lat);
|
||||
fPLatticeList[Vol] = Lat;
|
||||
|
||||
latLock.unlock();
|
||||
|
||||
if (verboseLevel) {
|
||||
G4cout << "G4LatticeManager::RegisterLattice: "
|
||||
<< " Total number of physical lattices: " << fPLatticeList.size()-1
|
||||
@@ -201,7 +216,6 @@ G4LatticeLogical* G4LatticeManager::GetLattice(G4Material* Mat) const {
|
||||
return latFind->second;
|
||||
}
|
||||
|
||||
|
||||
if (verboseLevel)
|
||||
G4cerr << "G4LatticeManager:: Found no matching lattices for "
|
||||
<< (Mat?Mat->GetName():"NULL") << "." << G4endl;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file processes/phonon/src/G4PhononDownconversion.cc
|
||||
/// \brief Implementation of the G4PhononDownconversion class
|
||||
//
|
||||
// $Id: G4PhononDownconversion.cc 76885 2013-11-18 12:55:15Z gcosmo $
|
||||
// $Id: G4PhononDownconversion.cc 79778 2014-03-13 17:24:53Z gcosmo $
|
||||
//
|
||||
// 20131111 Add verbose output for MFP calculation
|
||||
// 20131115 Initialize data buffers in ctor
|
||||
@@ -108,7 +108,7 @@ G4bool G4PhononDownconversion::IsApplicable(const G4ParticleDefinition& aPD) {
|
||||
|
||||
//probability density of energy distribution of L'-phonon in L->L'+T process
|
||||
|
||||
inline double G4PhononDownconversion::GetLTDecayProb(double d, double x) const {
|
||||
G4double G4PhononDownconversion::GetLTDecayProb(G4double d, G4double x) const {
|
||||
//d=delta= ratio of group velocities vl/vt and x is the fraction of energy in the longitudinal mode, i.e. x=EL'/EL
|
||||
return (1/(x*x))*(1-x*x)*(1-x*x)*((1+x)*(1+x)-d*d*((1-x)*(1-x)))*(1+x*x-d*d*(1-x)*(1-x))*(1+x*x-d*d*(1-x)*(1-x));
|
||||
}
|
||||
@@ -116,8 +116,7 @@ inline double G4PhononDownconversion::GetLTDecayProb(double d, double x) const {
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
//probability density of energy distribution of T-phonon in L->T+T process
|
||||
|
||||
inline double G4PhononDownconversion::GetTTDecayProb(double d, double x) const {
|
||||
G4double G4PhononDownconversion::GetTTDecayProb(G4double d, G4double x) const {
|
||||
//dynamic constants from Tamura, PRL31, 1985
|
||||
G4double A = 0.5*(1-d*d)*(fBeta+fLambda+(1+d*d)*(fGamma+fMu));
|
||||
G4double B = fBeta+fLambda+2*d*d*(fGamma+fMu);
|
||||
@@ -130,7 +129,7 @@ inline double G4PhononDownconversion::GetTTDecayProb(double d, double x) const {
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
inline double G4PhononDownconversion::MakeLDeviation(double d, double x) const {
|
||||
G4double G4PhononDownconversion::MakeLDeviation(G4double d, G4double x) const {
|
||||
//change in L'-phonon propagation direction after decay
|
||||
|
||||
return std::acos((1+(x*x)-((d*d)*(1-x)*(1-x)))/(2*x));
|
||||
@@ -139,7 +138,7 @@ inline double G4PhononDownconversion::MakeLDeviation(double d, double x) const {
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
inline double G4PhononDownconversion::MakeTDeviation(double d, double x) const {
|
||||
G4double G4PhononDownconversion::MakeTDeviation(G4double d, G4double x) const {
|
||||
//change in T-phonon propagation direction after decay (L->L+T process)
|
||||
|
||||
return std::acos((1-x*x+d*d*(1-x)*(1-x))/(2*d*(1-x)));
|
||||
@@ -148,7 +147,7 @@ inline double G4PhononDownconversion::MakeTDeviation(double d, double x) const {
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
inline double G4PhononDownconversion::MakeTTDeviation(double d, double x) const {
|
||||
G4double G4PhononDownconversion::MakeTTDeviation(G4double d, G4double x) const {
|
||||
//change in T-phonon propagation direction after decay (L->T+T process)
|
||||
|
||||
return std::acos((1-d*d*(1-x)*(1-x)+d*d*x*x)/(2*d*x));
|
||||
@@ -247,7 +246,7 @@ void G4PhononDownconversion::MakeLTSecondaries(const G4Track& aTrack) {
|
||||
G4double Esec1 = x*E, Esec2 = E-Esec1;
|
||||
|
||||
// First secondary is longitudnal
|
||||
int polarization1 = G4PhononPolarization::Long;
|
||||
G4int polarization1 = G4PhononPolarization::Long;
|
||||
|
||||
// Make FT or ST phonon (0. means no longitudinal)
|
||||
G4int polarization2 = ChoosePolarization(0., theLattice->GetSTDOS(),
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file processes/phonon/src/G4PhononPolarization.cc
|
||||
/// \brief implementation of the G4PhononPolarization enum
|
||||
//
|
||||
// $Id: G4PhononPolarization.cc 75725 2013-11-05 16:52:30Z mkelsey $
|
||||
// $Id: G4PhononPolarization.cc 75844 2013-11-06 17:35:56Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4PhononPolarization.hh"
|
||||
|
||||
Reference in New Issue
Block a user