Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -7,7 +7,7 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:53:09 bmorgan Exp $
# $Id: CMakeLists.txt 66892 2013-01-17 10:57:59Z gunter $
#
#------------------------------------------------------------------------------
@@ -7,7 +7,7 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:53:09 bmorgan Exp $
# $Id: CMakeLists.txt 66892 2013-01-17 10:57:59Z gunter $
#
#------------------------------------------------------------------------------
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.8 2009/06/18 16:18:41 mantero Exp $
# $Id: GNUmakefile 66892 2013-01-17 10:57:59Z gunter $
# --------------------------------------------------------------------
# GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98.
# --------------------------------------------------------------------
@@ -111,7 +111,7 @@ public :
*/
G4double GetNbElectrons() const;
/** Show the electronic state of the molecule.
/** Display the electronic state of the molecule.
*/
void PrintState() const;
@@ -123,6 +123,12 @@ public :
* processes to calculate the mean square jump distance between two
* changes of direction. In three dimension : <x^2> = 6 D t where t is
* the mean jump time between two changes of direction.
*
* Note : Diffusion Coefficient in one medium only
* For the time being, we will consider only one diffusion
* coefficient for the all simulation => diffusion in one medium only
* If the user needs to use the diffusion in different materials,
* she/he should contact the developpers/mainteners of this package
*/
inline void SetDiffusionCoefficient(G4double);
@@ -170,6 +176,7 @@ protected :
const G4MoleculeDefinition* fMoleculeDefinition;
const G4ElectronOccupancy* fElectronOccupancy;
public:
struct G4MolecularConfigurationManager
{
G4MolecularConfigurationManager(){;}
@@ -179,7 +186,8 @@ protected :
MolecularConfigurationTable fTable;
};
static G4MolecularConfigurationManager* fgManager;
protected:
static G4ThreadLocal G4MolecularConfigurationManager* fgManager;
static G4MolecularConfigurationManager* GetManager();
@@ -41,7 +41,7 @@
#include <vector>
#include <map>
#include "G4VMolecularDecayDisplacer.hh"
#include "G4VMolecularDissociationDisplacer.hh"
#include "G4MoleculeHandleManager.hh"
// ######################################################################
@@ -88,7 +88,7 @@ public: // With Description
#ifdef __IBMCPP__
inline void *operator new(size_t sz, void* p) { return p; }
#endif
inline void operator delete(void *aVUserTrackInformation);
inline void operator delete(void*);
G4Molecule(const G4Molecule&);
G4Molecule & operator=(const G4Molecule &right);
@@ -226,29 +226,26 @@ public:
G4double GetMass() const;
////////////////////////////////////////////////////////////////////////
inline G4MolecularConfiguration* GetMolecularConfiguration() ;
G4MolecularConfiguration* GetMolecularConfiguration() const;
inline static void SetGlobalTemperature(double);
inline static double GetGlobalTemperature();
static void SetGlobalTemperature(G4double);
static G4double GetGlobalTemperature();
private:
/** Default molecule builder
*/
G4Molecule();
void Init();
G4DynamicParticle* fDynamicParticle;
G4MolecularConfiguration* fpMolecularConfiguration;
G4MolecularConfiguration* fMolecularConfiguration;
static double fgTemperature;
static /*G4ThreadLocal*/ double fgTemperature;
};
#if defined G4EM_ALLOC_EXPORT
extern G4DLLEXPORT G4Allocator<G4Molecule> aMoleculeAllocator;
extern G4DLLEXPORT G4ThreadLocal G4Allocator<G4Molecule> *aMoleculeAllocator;
#else
extern G4DLLIMPORT G4Allocator<G4Molecule> aMoleculeAllocator;
extern G4DLLIMPORT G4ThreadLocal G4Allocator<G4Molecule> *aMoleculeAllocator;
#endif
@@ -256,33 +253,15 @@ extern G4DLLIMPORT G4Allocator<G4Molecule> aMoleculeAllocator;
inline void * G4Molecule::operator new(size_t)
//////////////////////////
{
void * aMolecule;
aMolecule = (void *) aMoleculeAllocator.MallocSingle();
return aMolecule;
if (!aMoleculeAllocator) aMoleculeAllocator = new G4Allocator<G4Molecule>;
return (void *) aMoleculeAllocator->MallocSingle();
}
//////////////////////////
inline void G4Molecule::operator delete(void * aMolecule)
//////////////////////////
{
// DEBUG
// G4cout<<"G4Molecule::operator delete(void * aMolecule) called"<<G4endl;
aMoleculeAllocator.FreeSingle((G4Molecule *) aMolecule);
}
inline G4MolecularConfiguration* G4Molecule::GetMolecularConfiguration()
{
return fMolecularConfiguration ;
}
inline void G4Molecule::SetGlobalTemperature(double temperature)
{
fgTemperature = temperature;
}
inline double G4Molecule::GetGlobalTemperature()
{
return fgTemperature;
aMoleculeAllocator->FreeSingle((G4Molecule *) aMolecule);
}
#endif
@@ -28,16 +28,13 @@
#include "G4Molecule.hh"
#include <map>
#include "G4ParticleDefinition.hh"
#include <memory>
using namespace std;
struct compDoubleWithPrecision
{
bool operator() (const double& a, const double& b) const
{
if(fabs(a - b) < fPrecision)
if(std::fabs(a - b) < fPrecision)
{
return false;
}
@@ -47,39 +44,56 @@ struct compDoubleWithPrecision
}
}
static double fPrecision ;
static G4ThreadLocal double fPrecision ;
};
typedef map<G4double, G4int, compDoubleWithPrecision> NbMoleculeAgainstTime;
typedef std::map<G4double, G4int, compDoubleWithPrecision> NbMoleculeAgainstTime;
class G4MoleculeCounter
{
public:
typedef std::map<G4Molecule, NbMoleculeAgainstTime> CounterMapType;
#if __cplusplus > 199711L && !defined __clang__
typedef std::unique_ptr<std::vector<G4Molecule> > RecordedMolecules;
#else
typedef std::auto_ptr<std::vector<G4Molecule> > RecordedMolecules;
#endif
protected:
G4MoleculeCounter();
virtual ~G4MoleculeCounter(){;}
static G4MoleculeCounter* fpInstance;
typedef std::map<G4Molecule, NbMoleculeAgainstTime> CounterMapType;
static G4ThreadLocal G4MoleculeCounter* fpInstance;
CounterMapType fCounterMap;
std::map<const G4MoleculeDefinition*, G4bool> fDontRegister ;
G4bool fUse;
static G4bool fUse;
G4int fVerbose ;
friend class G4Molecule;
virtual void AddAMoleculeAtTime(const G4Molecule&, G4double);
virtual void RemoveAMoleculeAtTime(const G4Molecule&, G4double);
public:
static void DeleteInstance();
static G4MoleculeCounter* GetMoleculeCounter();
inline const NbMoleculeAgainstTime& GetNbMoleculeAgainstTime(const G4Molecule &molecule);
std::auto_ptr<vector<G4Molecule> > GetRecordedMolecules();
virtual void AddAMoleculeAtTime(const G4Molecule&, G4double);
virtual void RemoveAMoleculeAtTime(const G4Molecule&, G4double);
// inline void DontRegister(G4MoleculeID);
RecordedMolecules GetRecordedMolecules();
/*
* The dynamics of the given molecule won't be saved into memory.
*/
inline virtual void DontRegister(const G4MoleculeDefinition*);
inline virtual void ResetDontRegister();
inline virtual void RegisterAll();
/*
* If the molecule counter is used, it will be called
* at every creation/deletion of a molecule to
* to increase/decrease the number at a given time.
*/
void Use(G4bool flag = true)
{
fUse=flag;
@@ -92,6 +106,11 @@ public:
inline void SetVerbose(G4int);
inline G4int GetVerbose();
/*
* It sets the min time difference in between two time slices.
*/
void SetTimeSlice(double);
virtual void ResetCounter();
};
@@ -120,7 +139,7 @@ inline void G4MoleculeCounter::DontRegister(const G4MoleculeDefinition* molDef)
fDontRegister[molDef] = true ;
}
inline void G4MoleculeCounter::ResetDontRegister()
inline void G4MoleculeCounter::RegisterAll()
{
fDontRegister.clear();
}
@@ -44,8 +44,8 @@
#include "G4ParticleDefinition.hh"
#include "G4ios.hh"
#include "G4ElectronOccupancy.hh"
#include "G4MolecularDecayTable.hh"
#include "G4MolecularDecayChannel.hh"
#include "G4MolecularDissociationTable.hh"
#include "G4MolecularDissociationChannel.hh"
#include "G4MoleculeID.hh"
// ######################################################################
@@ -125,7 +125,6 @@ private :
private:
G4double fMass;
G4String fType;
G4int fNbOfElectrons;
G4int fNbOfMolecularShells;
@@ -133,8 +132,8 @@ private:
// Diffusion Coefficient in one medium only
// Note : For the time being, we will consider only one diffusion
// coefficient for the all simulation => diffusion in one medium only
// If the user needs to use the diffusion in different medium,
// he should contact the developpers/mainteners of this package
// If the user needs to use the diffusion in different materials,
// she/he should contact the developpers/mainteners of this package
G4double fDiffusionCoefficient;
G4int fAtomsNb;
@@ -58,7 +58,7 @@ public:
private:
G4MoleculeHandleManager();
static G4MoleculeHandleManager* fInstance;
static G4ThreadLocal G4MoleculeHandleManager* fInstance;
struct CompMoleculePointer
{
@@ -38,6 +38,8 @@
#ifndef G4MoleculeID_h
#define G4MoleculeID_h 1
#include "G4Types.hh"
class G4MoleculeID
{
private :
@@ -45,7 +47,7 @@ private :
friend G4MoleculeID operator -(const G4MoleculeID& left,const int& right);
int fValue;
static int fLastValue;
static G4ThreadLocal int fLastValue;
public :
@@ -65,7 +65,7 @@ protected :
G4VMolecularDecayDisplacer();
G4int fVerbose ;
static DisplacementType AddDisplacement();
static DisplacementType Last;
static /*G4ThreadLocal*/ DisplacementType *Last;
};
void G4VMolecularDecayDisplacer :: SetVerbose(G4int verbose)
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake,v 1.4 2010-11-15 08:24:43 gcosmo Exp $
# $Id: sources.cmake 74551 2013-10-14 12:59:14Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -36,24 +36,24 @@ include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4emdna-molman
HEADERS
G4MolecularConfiguration.hh
G4MolecularDecayChannel.hh
G4MolecularDecayTable.hh
G4MolecularDissociationChannel.hh
G4MolecularDissociationTable.hh
G4MoleculeCounter.hh
G4MoleculeDefinition.hh
G4MoleculeHandleManager.hh
G4Molecule.hh
G4MoleculeID.hh
G4VMolecularDecayDisplacer.hh
G4VMolecularDissociationDisplacer.hh
SOURCES
G4MolecularConfiguration.cc
G4MolecularDecayChannel.cc
G4MolecularDecayTable.cc
G4MolecularDissociationChannel.cc
G4MolecularDissociationTable.cc
G4MoleculeCounter.cc
G4Molecule.cc
G4MoleculeDefinition.cc
G4MoleculeHandleManager.cc
G4MoleculeID.cc
G4VMolecularDecayDisplacer.cc
G4VMolecularDissociationDisplacer.cc
GRANULAR_DEPENDENCIES
G4geometrymng
G4volumes
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MolecularConfiguration.cc 65022 2012-11-12 16:43:12Z gcosmo $
// $Id: G4MolecularConfiguration.cc 66872 2013-01-15 01:25:57Z japost $
//
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
@@ -40,7 +40,9 @@ using namespace std;
//°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
// G4MolecularConfigurationManager
G4MolecularConfiguration::G4MolecularConfigurationManager* G4MolecularConfiguration::fgManager = 0 ;
typedef G4MolecularConfiguration::G4MolecularConfigurationManager MolecularConfigurationManager;
G4ThreadLocal MolecularConfigurationManager* G4MolecularConfiguration::fgManager = 0 ;
G4MolecularConfiguration::G4MolecularConfigurationManager*
G4MolecularConfiguration::GetManager()
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MolecularDecayChannel.cc 65022 2012-11-12 16:43:12Z gcosmo $
// $Id: G4MolecularDissociationChannel.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -32,7 +32,7 @@
//
// **********************************************************************
#include "G4MolecularDecayChannel.hh"
#include "G4MolecularDissociationChannel.hh"
#include "G4Molecule.hh"
#include "G4MoleculeHandleManager.hh"
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MolecularDecayTable.cc 65022 2012-11-12 16:43:12Z gcosmo $
// $Id: G4MolecularDissociationTable.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
@@ -35,8 +35,8 @@
//
// ----------------------------------------------------------------
#include "G4MolecularDecayTable.hh"
#include "G4MolecularDecayChannel.hh"
#include "G4MolecularDissociationTable.hh"
#include "G4MolecularDissociationChannel.hh"
using namespace std;
@@ -22,7 +22,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4Molecule.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4Molecule.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// ---------------------------------------------------------------------
// GEANT 4 class header file
@@ -57,12 +57,12 @@
using namespace std;
double G4Molecule::fgTemperature = 310*kelvin;
/*G4ThreadLocal*/ G4double G4Molecule::fgTemperature = 310; // 310*kelvin;
// 37°C, used to shoot an energy
ITImp(G4Molecule)
G4Allocator<G4Molecule> aMoleculeAllocator;
G4ThreadLocal G4Allocator<G4Molecule> *aMoleculeAllocator = 0;
G4Molecule* GetMolecule(const G4Track& track)
{
@@ -82,21 +82,19 @@ void G4Molecule::Print() const
G4Molecule::G4Molecule(const G4Molecule& right) :
G4VUserTrackInformation("G4Molecule"), G4IT(right)
{
Init();
fMolecularConfiguration = right . fMolecularConfiguration;
fpMolecularConfiguration = right . fpMolecularConfiguration;
}
G4Molecule& G4Molecule::operator=(const G4Molecule& right)
{
if (&right==this) return *this;
Init();
fMolecularConfiguration = right . fMolecularConfiguration;
fpMolecularConfiguration = right . fpMolecularConfiguration;
return *this;
}
G4bool G4Molecule::operator==(const G4Molecule& right) const
{
if(fMolecularConfiguration==right.fMolecularConfiguration)
if(fpMolecularConfiguration==right.fpMolecularConfiguration)
{
return true;
}
@@ -115,13 +113,7 @@ G4bool G4Molecule::operator!=(const G4Molecule& right) const
G4bool G4Molecule::operator<(const G4Molecule& right) const
{
return fMolecularConfiguration < right.fMolecularConfiguration ;
}
////////////////////////////////////////////////////////////////////////
void G4Molecule::Init()
{
fMolecularConfiguration = 0 ;
fDynamicParticle = 0;
return fpMolecularConfiguration < right.fpMolecularConfiguration ;
}
////////////////////////////////////////////////////////////////////////
@@ -131,7 +123,7 @@ void G4Molecule::Init()
G4Molecule::G4Molecule() : G4VUserTrackInformation("G4Molecule"), G4IT()
//////////////////////////
{
Init();
fpMolecularConfiguration = 0 ;
}
//////////////////////////
@@ -147,10 +139,7 @@ G4Molecule::~G4Molecule()
}
fpTrack = 0;
}
fMolecularConfiguration = 0;
fDynamicParticle = 0;
// DEBUG
// G4cout<<"Molecule killed"<<G4endl;
fpMolecularConfiguration = 0;
}
/** Build a molecule at ground state according to a given
@@ -161,8 +150,7 @@ G4Molecule::G4Molecule(G4MoleculeDefinition * moleculeDefinition) :
G4VUserTrackInformation("G4Molecule"), G4IT()
//////////////////////////
{
Init();
fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition);
fpMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition);
}
/** Build a molecule at a specific excitation/ionisation state according
@@ -174,8 +162,6 @@ G4Molecule::G4Molecule(G4MoleculeDefinition * moleculeDefinition, G4int OrbitalT
G4VUserTrackInformation("G4Molecule"), G4IT()
//////////////////////////
{
Init();
G4ElectronOccupancy dynElectronOccupancy (*moleculeDefinition->GetGroundStateElectronOccupancy());
if (OrbitalToFill != 0)
@@ -191,7 +177,7 @@ G4Molecule::G4Molecule(G4MoleculeDefinition * moleculeDefinition, G4int OrbitalT
// dynElectronOccupancy.DumpInfo(); // DEBUG
}
fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition, dynElectronOccupancy);
fpMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition, dynElectronOccupancy);
}
/** Specific builder for water molecules to be used in Geant4-DNA,
@@ -202,8 +188,6 @@ G4Molecule::G4Molecule(G4MoleculeDefinition * moleculeDefinition, G4int OrbitalT
G4Molecule::G4Molecule(G4MoleculeDefinition * moleculeDefinition, G4int Level, G4bool Excitation):
G4VUserTrackInformation("G4Molecule"), G4IT()
{
Init();
G4ElectronOccupancy dynElectronOccupancy (*moleculeDefinition->GetGroundStateElectronOccupancy());
if (Excitation == true)
@@ -219,61 +203,61 @@ G4Molecule::G4Molecule(G4MoleculeDefinition * moleculeDefinition, G4int Level, G
// dynElectronOccupancy.DumpInfo(); // DEBUG
}
fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition, dynElectronOccupancy);
fpMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition, dynElectronOccupancy);
}
void G4Molecule::SetElectronOccupancy(const G4ElectronOccupancy* occ)
{
fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(fMolecularConfiguration->GetDefinition(), *occ);
fpMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(fpMolecularConfiguration->GetDefinition(), *occ);
}
/** Method used in Geant4-DNA to excite water molecules
*/
void G4Molecule::ExciteMolecule(G4int ExcitedLevel)
{
fMolecularConfiguration = fMolecularConfiguration->ExciteMolecule(ExcitedLevel);
fpMolecularConfiguration = fpMolecularConfiguration->ExciteMolecule(ExcitedLevel);
}
/** Method used in Geant4-DNA to ionize water molecules
*/
void G4Molecule::IonizeMolecule(G4int IonizedLevel)
{
fMolecularConfiguration = fMolecularConfiguration->IonizeMolecule(IonizedLevel);
fpMolecularConfiguration = fpMolecularConfiguration->IonizeMolecule(IonizedLevel);
}
void G4Molecule::AddElectron(G4int orbit, G4int number)
{
fMolecularConfiguration = fMolecularConfiguration->AddElectron(orbit,number);
fpMolecularConfiguration = fpMolecularConfiguration->AddElectron(orbit,number);
}
void G4Molecule::RemoveElectron(G4int orbit,G4int number)
{
fMolecularConfiguration = fMolecularConfiguration->RemoveElectron(orbit,number);
fpMolecularConfiguration = fpMolecularConfiguration->RemoveElectron(orbit,number);
}
void G4Molecule::MoveOneElectron(G4int orbitToFree,G4int orbitToFill)
{
fMolecularConfiguration = fMolecularConfiguration->MoveOneElectron(orbitToFree,orbitToFill);
fpMolecularConfiguration = fpMolecularConfiguration->MoveOneElectron(orbitToFree,orbitToFill);
}
const G4String& G4Molecule::GetName() const
{
return fMolecularConfiguration->GetName();
return fpMolecularConfiguration->GetName();
}
G4int G4Molecule::GetAtomsNumber() const
{
return fMolecularConfiguration->GetAtomsNumber();
return fpMolecularConfiguration->GetAtomsNumber();
}
G4double G4Molecule::GetNbElectrons() const
{
return fMolecularConfiguration->GetNbElectrons();
return fpMolecularConfiguration->GetNbElectrons();
}
void G4Molecule::PrintState() const
{
fMolecularConfiguration->PrintState();
fpMolecularConfiguration->PrintState();
}
G4Track * G4Molecule::BuildTrack(G4double globalTime, const G4ThreeVector& Position)
@@ -296,8 +280,8 @@ G4Track * G4Molecule::BuildTrack(G4double globalTime, const G4ThreeVector& Posit
G4ThreeVector MomentumDirection(xMomentum, yMomentum, zMomentum);
G4double KineticEnergy = GetKineticEnergy();
// G4cout << " **** KineticEnergy : " << KineticEnergy << G4endl;
fDynamicParticle = new G4DynamicParticle(fMolecularConfiguration->GetDefinition(),
G4DynamicParticle* dynamicParticle = new G4DynamicParticle(fpMolecularConfiguration->GetDefinition(),
MomentumDirection,
KineticEnergy);
@@ -305,7 +289,7 @@ G4Track * G4Molecule::BuildTrack(G4double globalTime, const G4ThreeVector& Posit
G4MoleculeCounter::GetMoleculeCounter()->AddAMoleculeAtTime(*this,globalTime);
//Set the Track
fpTrack = new G4Track(fDynamicParticle, globalTime, Position);
fpTrack = new G4Track(dynamicParticle, globalTime, Position);
fpTrack -> SetUserInformation (this);
return fpTrack;
@@ -316,14 +300,14 @@ G4double G4Molecule::GetKineticEnergy() const
////
// Ideal Gaz case
double v = GetDiffusionVelocity();
double E = (fMolecularConfiguration->GetMass()/(c_squared))*(v*v)/2.;
double E = (fpMolecularConfiguration->GetMass()/(c_squared))*(v*v)/2.;
////
return E;
}
G4double G4Molecule::GetDiffusionVelocity() const
{
double moleculeMass = fMolecularConfiguration->GetMass()/(c_squared);
double moleculeMass = fpMolecularConfiguration->GetMass()/(c_squared);
////
// Different possibilities
@@ -344,65 +328,80 @@ G4double G4Molecule::GetDiffusionVelocity() const
// added - to be transformed in a "Decay method"
const vector <const G4MolecularDecayChannel*>* G4Molecule::GetDecayChannel() const
{
return fMolecularConfiguration->GetDecayChannel();
return fpMolecularConfiguration->GetDecayChannel();
}
G4int G4Molecule::GetMoleculeID() const
{
return fMolecularConfiguration->GetMoleculeID();
return fpMolecularConfiguration->GetMoleculeID();
}
void G4Molecule::SetDecayTime(G4double dynDecayTime)
{
fMolecularConfiguration->SetDecayTime(dynDecayTime);
fpMolecularConfiguration->SetDecayTime(dynDecayTime);
}
G4double G4Molecule::GetDecayTime() const
{
return fMolecularConfiguration->GetDecayTime();
return fpMolecularConfiguration->GetDecayTime();
}
void G4Molecule::SetVanDerVaalsRadius(G4double dynVanDerVaalsRadius)
{
fMolecularConfiguration->SetVanDerVaalsRadius(dynVanDerVaalsRadius);
fpMolecularConfiguration->SetVanDerVaalsRadius(dynVanDerVaalsRadius);
}
G4double G4Molecule::GetVanDerVaalsRadius() const
{
return fMolecularConfiguration->GetVanDerVaalsRadius();
return fpMolecularConfiguration->GetVanDerVaalsRadius();
}
G4int G4Molecule::GetCharge() const
{
return fMolecularConfiguration->GetCharge() ;
return fpMolecularConfiguration->GetCharge() ;
}
void G4Molecule::SetMass(G4double aMass)
{
fMolecularConfiguration->SetMass(aMass);
fpMolecularConfiguration->SetMass(aMass);
}
G4double G4Molecule::GetMass() const
{
return fMolecularConfiguration->GetMass();
return fpMolecularConfiguration->GetMass();
}
const G4ElectronOccupancy* G4Molecule::GetElectronOccupancy() const
{
return fMolecularConfiguration->GetElectronOccupancy();
return fpMolecularConfiguration->GetElectronOccupancy();
}
const G4MoleculeDefinition* G4Molecule::GetDefinition() const
{
return fMolecularConfiguration->GetDefinition();
return fpMolecularConfiguration->GetDefinition();
}
void G4Molecule::SetDiffusionCoefficient(G4double dynDiffusionCoefficient)
{
fMolecularConfiguration->SetDiffusionCoefficient(dynDiffusionCoefficient);
fpMolecularConfiguration->SetDiffusionCoefficient(dynDiffusionCoefficient);
}
G4double G4Molecule::GetDiffusionCoefficient() const
{
return fMolecularConfiguration->GetDiffusionCoefficient();
return fpMolecularConfiguration->GetDiffusionCoefficient();
}
G4MolecularConfiguration* G4Molecule::GetMolecularConfiguration() const
{
return fpMolecularConfiguration ;
}
void G4Molecule::SetGlobalTemperature(G4double temperature)
{
fgTemperature = temperature;
}
G4double G4Molecule::GetGlobalTemperature()
{
return fgTemperature;
}
@@ -23,22 +23,24 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MoleculeCounter.cc 65022 2012-11-12 16:43:12Z gcosmo $
// $Id: G4MoleculeCounter.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
#include "G4MoleculeCounter.hh"
#include "G4UIcommand.hh"
#include "G4UnitsTable.hh"
#include <iomanip>
double compDoubleWithPrecision::fPrecision = 5e-13;
using namespace std;
G4ThreadLocal double compDoubleWithPrecision::fPrecision = 5e-13;
G4bool G4MoleculeCounter::fUse = FALSE;
G4MoleculeCounter::G4MoleculeCounter()
{
fUse = FALSE;
fVerbose = 0 ;
}
G4MoleculeCounter* G4MoleculeCounter::fpInstance = 0;
G4ThreadLocal G4MoleculeCounter* G4MoleculeCounter::fpInstance = 0;
G4MoleculeCounter* G4MoleculeCounter::GetMoleculeCounter()
{
@@ -57,52 +59,33 @@ void G4MoleculeCounter::DeleteInstance()
}
}
void G4MoleculeCounter::SetTimeSlice(double timeSlice)
{
compDoubleWithPrecision::fPrecision = timeSlice;
}
void G4MoleculeCounter::AddAMoleculeAtTime(const G4Molecule& molecule, G4double time)
{
if(fVerbose > 1)
{
G4cout<<"G4MoleculeCounter::AddAMoleculeAtTime : "<< molecule.GetName()
<< " at time : " << G4BestUnit(time, "Time") <<G4endl;
}
if(fDontRegister[molecule.GetDefinition()]) return ;
// G4double pstime = time/picosecond;
//
// G4double fractpart=-1, intpart=-1;
// fractpart = modf (pstime , &intpart);
//
// if(pstime<10.1)
// {
// fractpart *= 10 ;
// fractpart = floor(fractpart)/10;
// pstime = intpart+fractpart;
// }
//
// else
// {
// pstime = intpart;
// }
// time = pstime*picosecond ;
if(fVerbose)
{
G4cout<<"-------------------------"<<G4endl ;
G4cout << "G4MoleculeCounter::AddAMoleculeAtTime " << G4endl;
G4cout<<"!! Molecule = " << molecule.GetName() << G4endl;
G4cout<<"!! At Time = "<< G4BestUnit(time, "Time") <<G4endl;
G4cout<<"G4MoleculeCounter::AddAMoleculeAtTime : "<< molecule.GetName()
<< " at time : " << G4BestUnit(time, "Time") <<G4endl;
}
CounterMapType::iterator counterMap_i = fCounterMap.find(molecule) ;
if(counterMap_i == fCounterMap.end())
{
if(fVerbose) G4cout << " !! ***** Map is empty " << G4endl;
// DEBUG
// if(fVerbose) G4cout << " !! ***** Map is empty " << G4endl;
fCounterMap[molecule][time] = 1;
}
else if(counterMap_i->second.empty())
{
if(fVerbose) G4cout << " !! ***** Map is empty " << G4endl;
// DEBUG
// if(fVerbose) G4cout << " !! ***** Map is empty " << G4endl;
counterMap_i->second[time] = 1;
}
else
@@ -110,8 +93,9 @@ void G4MoleculeCounter::AddAMoleculeAtTime(const G4Molecule& molecule, G4double
NbMoleculeAgainstTime::iterator end = counterMap_i->second.end();
end--;
if(fVerbose)
G4cout<<"!! End Time = "<< G4BestUnit(end->first, "Time") <<G4endl;
// DEBUG
// if(fVerbose)
// G4cout<<"!! End Time = "<< G4BestUnit(end->first, "Time") <<G4endl;
if(end->first <= time)
{
@@ -123,43 +107,45 @@ void G4MoleculeCounter::AddAMoleculeAtTime(const G4Molecule& molecule, G4double
while(it->first > time && it!=counterMap_i->second.begin())
{
if(fVerbose)
G4cout<<"!! ********** Is going back!!!!"<<G4endl;
// DEBUG
// if(fVerbose)
// G4cout<<"!! ********** Is going back!!!!"<<G4endl;
it--;
}
if(it==counterMap_i->second.begin() && it->first > time)
{
if(fVerbose)
G4cout<<"!! ********** Illegal !!!!"<<G4endl;
// DEBUG
// if(fVerbose)
// G4cout<<"!! ********** Illegal !!!!"<<G4endl;
return ;
}
if(fVerbose)
{
G4cout<<"!! PREVIOUS NB = "<< it->second <<G4endl;
G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it->first,"Time") <<G4endl;
}
// DEBUG
// if(fVerbose)
// {
// G4cout<<"!! PREVIOUS NB = "<< it->second <<G4endl;
// G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it->first,"Time") <<G4endl;
// }
counterMap_i->second[time]=it->second + 1;
}
}
if(fVerbose)
G4cout<<"!! NB = "<< fCounterMap[molecule][time]<<G4endl;
// DEBUG
// if(fVerbose)
// G4cout<<"!! NB = "<< fCounterMap[molecule][time]<<G4endl;
}
void G4MoleculeCounter::RemoveAMoleculeAtTime(const G4Molecule& molecule, G4double time)
{
if(fVerbose > 1)
if(fDontRegister[molecule.GetDefinition()]) return ;
if(fVerbose)
{
G4cout<<"-------------------------"<<G4endl ;
G4cout<<"G4MoleculeCounter::RemoveAMoleculeAtTime : "<< molecule.GetName()
<< " at time : " << G4BestUnit(time,"Time") <<G4endl;
G4cout<<"-------------------------"<<G4endl ;
}
if(fDontRegister[molecule.GetDefinition()]) return ;
NbMoleculeAgainstTime& nbMolPerTime = fCounterMap[molecule];
if(nbMolPerTime.empty())
@@ -179,8 +165,9 @@ void G4MoleculeCounter::RemoveAMoleculeAtTime(const G4Molecule& molecule, G4doub
if(nbMolPerTime.size() == 1)
{
it = nbMolPerTime.begin() ;
if(fVerbose)
G4cout << "!! fCounterMap[molecule].size() == 1" << G4endl;
// DEBUG
// if(fVerbose)
// G4cout << "!! fCounterMap[molecule].size() == 1" << G4endl;
}
else
{
@@ -189,8 +176,9 @@ void G4MoleculeCounter::RemoveAMoleculeAtTime(const G4Molecule& molecule, G4doub
if(it==nbMolPerTime.end())
{
if(fVerbose)
G4cout << " ********** NO ITERATOR !!!!!!!!! " << G4endl;
// DEBUG
// if(fVerbose)
// G4cout << " ********** NO ITERATOR !!!!!!!!! " << G4endl;
it--;
if(time<it->first)
@@ -201,21 +189,23 @@ void G4MoleculeCounter::RemoveAMoleculeAtTime(const G4Molecule& molecule, G4doub
}
}
if(fVerbose)
{
// G4cout << "G4MoleculeCounter::RemoveAMoleculeAtTime " << G4endl;
G4cout<<"!! Molecule = " << molecule.GetName() << G4endl;
G4cout<<"!! At Time = "<< G4BestUnit(time,"Time") <<G4endl;
G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it->first,"Time")<<G4endl;
G4cout<<"!! PREVIOUS Nb = "<< it->second <<G4endl;
}
// DEBUG
// if(fVerbose)
// {
//// G4cout << "G4MoleculeCounter::RemoveAMoleculeAtTime " << G4endl;
// G4cout<<"!! Molecule = " << molecule.GetName() << G4endl;
// G4cout<<"!! At Time = "<< G4BestUnit(time,"Time") <<G4endl;
// G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it->first,"Time")<<G4endl;
// G4cout<<"!! PREVIOUS Nb = "<< it->second <<G4endl;
// }
// If valgrind problem on the line below, it means that the pointer "it"
// points nowhere
if(nbMolPerTime.value_comp()(*it, *nbMolPerTime.begin()))
{
if(fVerbose)
G4cout<<"!! ***** In value_comp ... " << G4endl;
// DEBUG
// if(fVerbose)
// G4cout<<"!! ***** In value_comp ... " << G4endl;
it++;
if(time<it->first)
{
@@ -227,35 +217,40 @@ void G4MoleculeCounter::RemoveAMoleculeAtTime(const G4Molecule& molecule, G4doub
while(it->first - time > compDoubleWithPrecision::fPrecision && it!=nbMolPerTime.begin())
{
if(fVerbose)
{
G4cout<<"!! ***** Is going back!!!!"<<G4endl;
G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it-> first,"Time") <<G4endl;
}
// DEBUG
// if(fVerbose)
// {
// G4cout<<"!! ***** Is going back!!!!"<<G4endl;
// G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it-> first,"Time") <<G4endl;
// }
it--;
}
if(it==nbMolPerTime.begin() && it->first > time)
{
if(fVerbose)
G4cout<<"!! ********** Illegal !!!!"<<G4endl;
// DEBUG
// if(fVerbose)
// G4cout<<"!! ********** Illegal !!!!"<<G4endl;
return ;
}
if(fVerbose)
{
G4cout<<"!! PREVIOUS NB = "<< (*it).second <<G4endl;
G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it->first,"Time")<<G4endl;
}
// DEBUG
// if(fVerbose)
// {
// G4cout<<"!! PREVIOUS NB = "<< (*it).second <<G4endl;
// G4cout<<"!! PREVIOUS TIME = "<< G4BestUnit(it->first,"Time")<<G4endl;
// }
nbMolPerTime[time]=it->second - 1;
}
if(fVerbose)
{
G4cout<<"!! NB = "<< nbMolPerTime[time]<<G4endl;
}
// DEBUG
// if(fVerbose)
// {
// G4cout<<"!! NB = "<< nbMolPerTime[time]<<G4endl;
// }
}
std::auto_ptr<vector<G4Molecule> > G4MoleculeCounter::GetRecordedMolecules()
G4MoleculeCounter::RecordedMolecules G4MoleculeCounter::GetRecordedMolecules()
{
if(fVerbose > 1)
{
@@ -263,11 +258,11 @@ std::auto_ptr<vector<G4Molecule> > G4MoleculeCounter::GetRecordedMolecules()
}
CounterMapType::iterator it;
std::auto_ptr< vector<G4Molecule> > output (new vector<G4Molecule>) ;
RecordedMolecules output (new vector<G4Molecule>) ;
for(it = fCounterMap.begin() ; it != fCounterMap.end() ; it++)
{
output->push_back((*it).first);
output->push_back(it->first);
}
return output;
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MoleculeDefinition.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4MoleculeDefinition.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -113,7 +113,6 @@ void G4MoleculeDefinition::AddExcitedState(const G4String& val)
}
fDecayTable->AddExcitedState(val);
}
//___________________________________________________________________________
const G4String& G4MoleculeDefinition::GetExcitedState(const G4ElectronOccupancy* occ) const
@@ -193,7 +192,7 @@ G4MoleculeDefinition::G4MoleculeDefinition(const G4MoleculeDefinition& right):
{
fDecayTable = new G4MolecularDecayTable(*(right.fDecayTable));
}
else fDecayTable =0;
else fDecayTable = 0;
}
//___________________________________________________________________________
@@ -23,14 +23,14 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MoleculeHandleManager.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4MoleculeHandleManager.cc 66872 2013-01-15 01:25:57Z japost $
//
#include "G4MoleculeHandleManager.hh"
#include "G4Molecule.hh"
using namespace std;
G4MoleculeHandleManager* G4MoleculeHandleManager::fInstance (0);
G4ThreadLocal G4MoleculeHandleManager* G4MoleculeHandleManager::fInstance (0);
G4MoleculeHandleManager::G4MoleculeHandleManager()
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MoleculeID.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4MoleculeID.cc 71827 2013-06-25 15:58:24Z gcosmo $
//
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
@@ -36,5 +36,4 @@
#include "G4MoleculeID.hh"
int G4MoleculeID::fLastValue(0);
G4MoleculeID gStartCounter(G4MoleculeID::Initialize(999666999));
G4ThreadLocal int G4MoleculeID::fLastValue(999666999);
@@ -23,16 +23,17 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VMolecularDecayDisplacer.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4VMolecularDissociationDisplacer.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
#include "G4VMolecularDecayDisplacer.hh"
#include "G4VMolecularDissociationDisplacer.hh"
#include "G4Molecule.hh"
DisplacementType G4VMolecularDecayDisplacer::Last = 0;
/*G4ThreadLocal*/ DisplacementType *G4VMolecularDecayDisplacer::Last = 0;
const DisplacementType G4VMolecularDecayDisplacer::NoDisplacement = G4VMolecularDecayDisplacer::AddDisplacement();
G4VMolecularDecayDisplacer::G4VMolecularDecayDisplacer()
{
if (!Last) Last = new DisplacementType ( 0) ;
fVerbose = 0;
}
@@ -43,7 +44,8 @@ G4VMolecularDecayDisplacer::~G4VMolecularDecayDisplacer()
DisplacementType G4VMolecularDecayDisplacer::AddDisplacement()
{
DisplacementType output = Last;
Last++;
if (!Last) Last = new DisplacementType ( 0) ;
DisplacementType output = *Last;
(*Last)++;
return output;
}
@@ -7,7 +7,7 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:53:09 bmorgan Exp $
# $Id: CMakeLists.txt 66892 2013-01-17 10:57:59Z gunter $
#
#------------------------------------------------------------------------------
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.8 2009/06/18 16:18:41 mantero Exp $
# $Id: GNUmakefile 66892 2013-01-17 10:57:59Z gunter $
# --------------------------------------------------------------------
# GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98.
# --------------------------------------------------------------------
@@ -50,7 +50,7 @@
class G4Electron_aq : public G4MoleculeDefinition
{
private:
static G4Electron_aq* theInstance;
static /*G4ThreadLocal*/ G4Electron_aq* theInstance;
G4Electron_aq() {}
virtual ~G4Electron_aq() {}
@@ -50,7 +50,7 @@
class G4H2 : public G4MoleculeDefinition
{
private:
static G4H2* theInstance;
static /*G4ThreadLocal*/ G4H2* theInstance;
G4H2() {}
virtual ~G4H2() {}
@@ -50,7 +50,7 @@
class G4H2O : public G4MoleculeDefinition
{
private:
static G4H2O* theInstance;
static /*G4ThreadLocal*/ G4H2O* theInstance;
G4H2O() {}
virtual ~G4H2O() {}
@@ -50,7 +50,7 @@
class G4H2O2 : public G4MoleculeDefinition
{
private:
static G4H2O2* theInstance;
static /*G4ThreadLocal*/ G4H2O2* theInstance;
G4H2O2() {}
virtual ~G4H2O2() {}
@@ -50,7 +50,7 @@
class G4H3O : public G4MoleculeDefinition
{
private:
static G4H3O* theInstance;
static /*G4ThreadLocal*/ G4H3O* theInstance;
G4H3O() {}
virtual ~G4H3O() {}
@@ -50,7 +50,7 @@
class G4Hydrogen : public G4MoleculeDefinition
{
private:
static G4Hydrogen* theInstance;
static /*G4ThreadLocal*/ G4Hydrogen* theInstance;
G4Hydrogen() {}
virtual ~G4Hydrogen() {}
@@ -50,7 +50,7 @@
class G4OH : public G4MoleculeDefinition
{
private:
static G4OH* theInstance;
static /*G4ThreadLocal*/ G4OH* theInstance;
G4OH() {}
~G4OH() {}
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake,v 1.4 2010-11-15 08:24:43 gcosmo Exp $
# $Id: sources.cmake 66892 2013-01-17 10:57:59Z gunter $
#
#------------------------------------------------------------------------------
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4Electron_aq.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4Electron_aq.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// Author: Mathieu Karamitors
//
@@ -41,7 +41,7 @@
// ######################################################################
// ### Electron_aq ###
// ######################################################################
G4Electron_aq* G4Electron_aq::theInstance = 0;
/*G4ThreadLocal*/ G4Electron_aq* G4Electron_aq::theInstance = 0;
G4Electron_aq* G4Electron_aq::Definition()
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4H2.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4H2.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// Author: Mathieu Karamitors
//
@@ -41,7 +41,7 @@
// ######################################################################
// ### Hydrogen ###
// ######################################################################
G4H2* G4H2::theInstance = 0;
/*G4ThreadLocal*/ G4H2* G4H2::theInstance = 0;
G4H2* G4H2::Definition()
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4H2O.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4H2O.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// Author: Mathieu Karamitors
//
@@ -41,7 +41,7 @@
// ######################################################################
// ### Hydrogen ###
// ######################################################################
G4H2O* G4H2O::theInstance = 0;
/*G4ThreadLocal*/ G4H2O* G4H2O::theInstance = 0;
G4H2O* G4H2O::Definition()
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4H2O2.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4H2O2.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// Author: Mathieu Karamitors
//
@@ -41,7 +41,7 @@
// ######################################################################
// ### Peroxyde ###
// ######################################################################
G4H2O2* G4H2O2::theInstance = 0;
/*G4ThreadLocal*/ G4H2O2* G4H2O2::theInstance = 0;
G4H2O2* G4H2O2::Definition()
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4H3O.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4H3O.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// Author: Mathieu Karamitors
//
@@ -42,7 +42,7 @@
// ### H3O ###
// ### oxonium is the usual name for H3O+ (hydronium) ###
// ######################################################################
G4H3O* G4H3O::theInstance = 0;
/*G4ThreadLocal*/ G4H3O* G4H3O::theInstance = 0;
G4H3O* G4H3O::Definition()
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4Hydrogen.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4Hydrogen.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// Author: Mathieu Karamitors
//
@@ -41,7 +41,7 @@
// ######################################################################
// ### Hydrogen ###
// ######################################################################
G4Hydrogen* G4Hydrogen::theInstance = 0;
/*G4ThreadLocal*/ G4Hydrogen* G4Hydrogen::theInstance = 0;
G4Hydrogen* G4Hydrogen::Definition()
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4OH.cc 64057 2012-10-30 15:04:49Z gcosmo $
// $Id: G4OH.cc 74551 2013-10-14 12:59:14Z gcosmo $
//
// Author: Mathieu Karamitors
//
@@ -41,7 +41,7 @@
// ######################################################################
// ### Hydroxyl ###
// ######################################################################
G4OH* G4OH::theInstance = 0;
/*G4ThreadLocal*/ G4OH* G4OH::theInstance = 0;
G4OH* G4OH::Definition()
{