Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -0,0 +1,289 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// History:
// -----------
// 10 Oct 2011 M.Karamitros created
//
// -------------------------------------------------------------------
#ifndef G4MolecularConfiguration_
#define G4MolecularConfiguration_ 1
#include <G4MoleculeDefinition.hh>
#include <map>
#include <vector>
#include <CLHEP/Utility/memory.h>
struct comparator;
class G4MolecularConfiguration;
class G4MoleculeDefinition;
class G4ElectronOccupancy;
class G4MolecularDecayChannel;
/** The pointer G4MolecularConfiguration will be shared by all the
* molecules having the same molecule definition and the same
* electron occupancy
* BE CAREFUlL !!! : If you change the mass for instance of a OH^-,
* this will affect all the OH^- molecule diffusing around
*/
class G4MolecularConfiguration
{
public :
/////////////////
// Static methods
// Get for a given moleculeDefinition and a given electronic configuration, the mol conf
static G4MolecularConfiguration* GetMolecularConfiguration(const G4MoleculeDefinition*,
const G4ElectronOccupancy& electronOccupancy);
// Get ground state electronic configuration
static G4MolecularConfiguration* GetMolecularConfiguration(const G4MoleculeDefinition*);
// Release memory of the mol conf manager
static void DeleteManager();
///////////////
// Methods
const G4MoleculeDefinition* GetDefinition() const;
/** Returns the name of the molecule
*/
const G4String& GetName() const;
/** Returns the nomber of atoms compouning the molecule
*/
G4int GetAtomsNumber() const;
/** Method used in Geant4-DNA to excite water molecules
*/
G4MolecularConfiguration* ExciteMolecule(G4int);
/** Method used in Geant4-DNA to ionize water molecules
*/
G4MolecularConfiguration* IonizeMolecule(G4int);
/** Add n electrons to a given orbit.
* Note : You can add as many electrons to a given orbit, the result
* may be unrealist.
*/
G4MolecularConfiguration* AddElectron(G4int orbit, G4int n =1);
/** Remove n electrons to a given orbit.
*/
G4MolecularConfiguration* RemoveElectron(G4int,G4int number=1);
/** Move one electron from an orbit to another.
*/
G4MolecularConfiguration* MoveOneElectron(G4int /*orbit*/,G4int /*orbit*/);
/** Returns the number of electron.
*/
G4double GetNbElectrons() const;
/** Show the electronic state of the molecule.
*/
void PrintState() const;
const std::vector <const G4MolecularDecayChannel*>* GetDecayChannel() const;
G4int GetMoleculeID() const;
/** Sets the diffusion coefficient D of the molecule used in diffusion
* 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.
*/
inline void SetDiffusionCoefficient(G4double);
/** Returns the diffusion coefficient D.
*/
inline G4double GetDiffusionCoefficient() const;
/** Set the decay time of the molecule.
*/
inline void SetDecayTime(G4double);
/** Returns the decay time of the molecule.
*/
inline G4double GetDecayTime() const;
/** The Van Der Valls Radius of the molecule
*/
inline void SetVanDerVaalsRadius(G4double);
inline G4double GetVanDerVaalsRadius() const ;
/** Returns the object ElectronOccupancy describing the electronic
* configuration of the molecule.
*/
inline const G4ElectronOccupancy* GetElectronOccupancy() const;
/** Returns the charge of molecule.
*/
inline G4int GetCharge() const;
/** Set the total mass of the molecule.
*/
inline void SetMass(G4double);
/** Returns the total mass of the molecule.
*/
inline G4double GetMass() const;
protected :
G4MolecularConfiguration(const G4MoleculeDefinition*, const G4ElectronOccupancy&);
G4MolecularConfiguration(const G4MolecularConfiguration&);
G4MolecularConfiguration & operator=(G4MolecularConfiguration &right);
~G4MolecularConfiguration();
G4MolecularConfiguration* ChangeConfiguration(const G4ElectronOccupancy& newElectronOccupancy);
const G4MoleculeDefinition* fMoleculeDefinition;
const G4ElectronOccupancy* fElectronOccupancy;
struct G4MolecularConfigurationManager
{
G4MolecularConfigurationManager(){;}
~G4MolecularConfigurationManager();
typedef std::map<const G4MoleculeDefinition*, std::map<const G4ElectronOccupancy, G4MolecularConfiguration*, comparator> > MolecularConfigurationTable;
MolecularConfigurationTable fTable;
};
static G4MolecularConfigurationManager* fgManager;
static G4MolecularConfigurationManager* GetManager();
G4double fDynDiffusionCoefficient;
G4double fDynVanDerVaalsRadius;
G4double fDynDecayTime;
G4double fDynMass;
G4int fDynCharge;
mutable G4String fName; // mutable allowed this member to be changed in const methods
};
struct comparator
{
bool operator() (const G4ElectronOccupancy& occ1, const G4ElectronOccupancy& occ2) const
{
// Since this method is called a lot of time,
// we retrieve only once the totOcc
G4int totalOcc1 = occ1.GetTotalOccupancy() ;
G4int totalOcc2 = occ2.GetTotalOccupancy() ;
if ( totalOcc1!= totalOcc2)
{
return totalOcc1<totalOcc2;
}
else
{
G4int occupancy1 = -1 ;
G4int occupancy2 = -1 ;
const G4int sizeOrbit = occ1.GetSizeOfOrbit() ;
for (G4int i=0; i<occ1.GetSizeOfOrbit();)
{
// Since this method is called a lot of time,
// we retrieve only once the Occ
occupancy1 = occ1.GetOccupancy(i);
occupancy2 = occ2.GetOccupancy(i);
if (occupancy1 != occupancy2)
{
return occupancy1 < occupancy2;
}
else
{
i++;
if (i >= sizeOrbit) return false;
}
}
}
return false;
}
};
inline const G4MoleculeDefinition* G4MolecularConfiguration::GetDefinition() const
{
return fMoleculeDefinition;
}
inline const G4ElectronOccupancy* G4MolecularConfiguration::GetElectronOccupancy() const
{
return fElectronOccupancy ;
}
inline void G4MolecularConfiguration::SetDiffusionCoefficient(G4double dynDiffusionCoefficient)
{
fDynDiffusionCoefficient = dynDiffusionCoefficient ;
}
inline G4double G4MolecularConfiguration::GetDiffusionCoefficient() const
{
return fDynDiffusionCoefficient;
}
inline void G4MolecularConfiguration::SetDecayTime(G4double dynDecayTime)
{
fDynDecayTime = dynDecayTime;
}
inline G4double G4MolecularConfiguration::GetDecayTime() const
{
return fDynDecayTime;
}
inline void G4MolecularConfiguration::SetVanDerVaalsRadius(G4double dynVanDerVaalsRadius)
{
fDynVanDerVaalsRadius = dynVanDerVaalsRadius ;
}
inline G4double G4MolecularConfiguration::GetVanDerVaalsRadius() const
{
return fDynVanDerVaalsRadius;
}
inline G4int G4MolecularConfiguration::GetCharge() const
{
return fDynCharge ;
}
inline void G4MolecularConfiguration::SetMass(G4double aMass)
{
fDynMass = aMass ;
}
inline G4double G4MolecularConfiguration::GetMass() const
{
return fDynMass;
}
#endif
@@ -0,0 +1,185 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Contact: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// ----------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, Alfonso Mantero 6 Mar 2009
// ----------------------------------------------------------------
//
#ifndef G4MolecularDecayChannel_h
#define G4MolecularDecayChannel_h 1
#include <vector>
#include <map>
#include "G4VMolecularDecayDisplacer.hh"
#include "G4MoleculeHandleManager.hh"
// ######################################################################
// ### MolecularDecayChannel ###
// ######################################################################
class G4Molecule;
struct CompMoleculePointer;
class G4MolecularDecayChannel
{
// Class Description
// This is where are stored and can be retrieved data of one decay channel
// of excited or ionized molecules: products. energy and probability.
public: //With Description
G4MolecularDecayChannel();
G4MolecularDecayChannel(G4String);
~G4MolecularDecayChannel();
G4MolecularDecayChannel(const G4MolecularDecayChannel&);
G4MolecularDecayChannel & operator=(const G4MolecularDecayChannel &right);
public:
//Root Mean Square radial distance thermalisation of a product
G4double GetRMSRadialDisplacementOfProduct(const G4Molecule*);
// methods to construct decay channels "interactively"
void AddProduct(const G4Molecule*,G4double = 0);
inline void SetName(const G4String&);
inline void SetEnergy(G4double);
inline void SetProbability(G4double);
inline void SetDecayTime(G4double);
inline void SetRMSMotherMoleculeDisplacement(G4double);
inline void SetDisplacementType(DisplacementType);
// get methods to retrieve data
inline const G4String& GetName() const;
G4int GetNbProducts() const;
const G4Molecule* GetProduct(int) const;
inline const std::vector<G4double>& GetRMSProductsDisplacement() const;
inline G4double GetEnergy() const;
inline G4double GetProbability() const;
inline G4double GetDecayTime() const;
inline G4double GetRMSMotherMoleculeDisplacement() const;
inline DisplacementType GetDisplacementType() const;
private:
DisplacementType fDisplacementType;
G4String fName;
std::vector<G4MoleculeHandle>* fProductsVector;
G4double fReleasedEnergy;
G4double fProbability;
G4double fDecayTime; // To be taken into account in the next releases
//Root Mean Square radial distance jump of a excited/ionised MotherMolecule molecule
G4double fRMSMotherMoleculeDisplacement;
std::vector<G4double> fRMSProductsDisplacementVector;
};
inline void G4MolecularDecayChannel::SetName(const G4String& value)
{
fName = value;
}
inline void G4MolecularDecayChannel::SetEnergy(G4double value)
{
fReleasedEnergy = value;
}
inline void G4MolecularDecayChannel::SetProbability(G4double value)
{
fProbability = value;
}
inline void G4MolecularDecayChannel::SetDecayTime(G4double value)
{
fDecayTime = value;
}
inline void G4MolecularDecayChannel::SetRMSMotherMoleculeDisplacement(G4double value)
{
fRMSMotherMoleculeDisplacement = value;
}
inline const G4String& G4MolecularDecayChannel::GetName() const
{
return fName;
}
inline const std::vector<G4double>& G4MolecularDecayChannel::GetRMSProductsDisplacement() const
{
return fRMSProductsDisplacementVector;
}
inline G4double G4MolecularDecayChannel::GetEnergy() const
{
return fReleasedEnergy;
}
inline G4double G4MolecularDecayChannel::GetProbability() const
{
return fProbability;
}
inline G4double G4MolecularDecayChannel::GetDecayTime() const
{
return fDecayTime;
}
inline G4double G4MolecularDecayChannel::GetRMSMotherMoleculeDisplacement() const
{
return fRMSMotherMoleculeDisplacement;
}
inline void G4MolecularDecayChannel::SetDisplacementType(DisplacementType aDisplacementType)
{
fDisplacementType = aDisplacementType;
}
inline DisplacementType G4MolecularDecayChannel::GetDisplacementType() const
{
return fDisplacementType;
}
#endif
@@ -0,0 +1,147 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Contact: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// ----------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, Alfonso Mantero 4 Mar 2009
// ----------------------------------------------------------------
//
#ifndef G4MolecularDecayTable_h
#define G4MolecularDecayTable_h 1
#include <map>
#include <vector>
#include "G4ElectronOccupancy.hh"
class G4MolecularDecayChannel;
//°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
struct eOccComp
{
bool operator() (const G4ElectronOccupancy& occ1, const G4ElectronOccupancy& occ2) const
{
if (occ1.GetTotalOccupancy() != occ2.GetTotalOccupancy())
{
return occ1.GetTotalOccupancy()<occ2.GetTotalOccupancy();
}
else
{
for (G4int i=0; i<occ1.GetSizeOfOrbit();)
{
if (occ1.GetOccupancy(i) != occ2.GetOccupancy(i))
{
return occ1.GetOccupancy(i) < occ2.GetOccupancy(i);
}
else
{
i++;
if (i >= occ1.GetSizeOfOrbit()) return false;
}
}
}
return false;
}
};
//°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
typedef std::map<G4ElectronOccupancy, G4String, eOccComp> statesMap;
typedef std::map<G4String, std::vector<const G4MolecularDecayChannel*>, std::less <G4String> > channelsMap;
/** Class Description
* G4MolecularDecayTable operates as a container of deexcitation modes
* for excited or ionized molecules
*/
class G4MolecularDecayTable
{
public:
G4MolecularDecayTable();
~G4MolecularDecayTable();
G4MolecularDecayTable(const G4MolecularDecayTable&);
G4MolecularDecayTable & operator=(const G4MolecularDecayTable &right);
public:
//°°°°°°°°°°°°°°°°°°
// Create the table
////
// methods to construct the table "interactively"
void AddExcitedState(const G4String&); // creates an empty excited state
// creates or adds to an existing excited state an electronic configuration
void AddeConfToExcitedState(const G4String&,const G4ElectronOccupancy&);
void AddDecayChannel(const G4String&,const G4MolecularDecayChannel*);
void CheckDataConsistency() ;
// Checks that probabilities sum up to 100% for each excited state
//------------Inline fuctions------------
// Get methods to retrieve data
const std::vector<const G4MolecularDecayChannel*>* GetDecayChannels(const G4ElectronOccupancy*) const ;
const std::vector<const G4MolecularDecayChannel*>* GetDecayChannels(const G4String&) const ;
const G4String& GetExcitedState(const G4ElectronOccupancy*) const ;
const G4ElectronOccupancy& GetElectronOccupancy (const G4String&) const ;
inline const statesMap& GetExcitedStateMaps() const;
inline const channelsMap& GetDecayChannelsMap() const;
private:
statesMap fExcitedStatesMap ;
channelsMap fDecayChannelsMap ;
};
inline const statesMap& G4MolecularDecayTable::GetExcitedStateMaps() const
{
return fExcitedStatesMap;
}
inline const channelsMap& G4MolecularDecayTable::GetDecayChannelsMap() const
{
return fDecayChannelsMap;
}
#endif
@@ -0,0 +1,285 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Contact: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// ---------------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on G4DynamicParticle
// New dependency : G4VUserTrackInformation
//
// ---------------- G4Molecule ----------------
// first design&implementation by Alfonso Mantero, 7 Apr 2009
// New developments Alfonso Mantero & Mathieu Karamitros
// Oct/Nov 2009 Class Name changed to G4Molecule
// Removed dependency from G4DynamicParticle
// New constructors :
// copy constructor
// direct ionized/excited molecule
// New methods :
// Get : name,atoms' number,nb electrons,decayChannel
// PrintState //To get the electronic level and the
// corresponding name of the excitation
// Kinematic :
// BuildTrack,GetKineticEnergy,GetDiffusionVelocity
// Change the way dynCharge and eNb is calculated
// ---------------------------------------------------------------------
#ifndef G4Molecule_h
#define G4Molecule_h 1
#include "G4IT.hh"
#include "G4Allocator.hh"
#include "G4MoleculeDefinition.hh"
class G4Molecule;
class G4MolecularConfiguration;
class G4MoleculeDefinition;
class G4MolecularDecayChannel;
class G4DynamicParticle;
G4Molecule* GetMolecule(const G4Track& track) ;
G4Molecule* GetMolecule(const G4Track* track) ;
/** Class Description
* The dynamic molecule holds all the data that change for a molecule
* It has a pointer to G4MoleculeDefinition object, which holds
* all the "ground level" information.
*/
class G4Molecule : public G4IT
{
public: // With Description
ITDef(G4Molecule)
//From G4VUserTrackInformation
void Print() const;
// new/delete operators are overloded to use G4Allocator
inline void *operator new(size_t);
inline void operator delete(void *aVUserTrackInformation);
G4Molecule(const G4Molecule&);
G4Molecule & operator=(const G4Molecule &right);
G4bool operator==(const G4Molecule &right) const;
G4bool operator!=(const G4Molecule &right) const;
G4bool operator<(const G4Molecule &right) const;
private :
bool CompareElectronOccupancy (const G4ElectronOccupancy* /*elecOccupancy2*/,
const G4int& /*totalOcc1*/, const G4int& /*totalOcc2*/) const;
public:
//------ Constructors --------------------------
/** To build a molecule at ground state according to a given
* G4MoleculeDefinition that can be obtained from G4GenericMoleculeManager
*/
G4Molecule(G4MoleculeDefinition * molecule);
/** To build a molecule at a specific excitation/ionisation state according
* to a ground state that can be obtained from G4GenericMoleculeManager
*/
G4Molecule(G4MoleculeDefinition * molecule, G4int, G4int);
/** Specific builder for water molecules to be used in Geant4-DNA,
* the last option Excitation is true if the molecule is excited, is
* false is the molecule is ionized.
*/
G4Molecule(G4MoleculeDefinition * molecule, G4int, G4bool);
virtual ~G4Molecule();
//-------- Methods -------------------------------
//Get from static definition
/** Returns the name of the molecule
*/
const G4String& GetName() const;
/** Returns the nomber of atoms compouning the molecule
*/
G4int GetAtomsNumber() const;
/** Will set up the correct molecularConfiguration given
* an electron configuration
*/
void SetElectronOccupancy(const G4ElectronOccupancy*);
/** Method used in Geant4-DNA to excite water molecules
*/
void ExciteMolecule(G4int);
/** Method used in Geant4-DNA to ionize water molecules
*/
void IonizeMolecule(G4int);
/** Add n electrons to a given orbit.
* Note : You can add as many electrons to a given orbit, the result
* may be unrealist.
*/
void AddElectron(G4int orbit, G4int n =1);
/** Remove n electrons to a given orbit.
*/
void RemoveElectron(G4int,G4int number=1);
/** Move one electron from an orbit to another.
*/
void MoveOneElectron(G4int /*orbit*/,G4int /*orbit*/);
/** Returns the number of electron.
*/
G4double GetNbElectrons() const; //This method can be used to check if the electron s number is physical
/** Show the electronic state of the molecule.
*/
void PrintState() const;
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector& Position);
G4double GetKineticEnergy() const;
G4double GetDiffusionVelocity() const;
const std::vector <const G4MolecularDecayChannel*>* GetDecayChannel() const;
G4int GetMoleculeID() const;
//-------------Inline functions ---------------------
/** Get molecule definition. This G4MoleculeDefinition has the ground
* electronic state of the molecule.
*/
const G4MoleculeDefinition* GetDefinition() const;
//methods to set/get changing parameters
/////////////////////////////////////////////////////////////////////////////
/** Sets the diffusion coefficient D of the molecule used in diffusion
* 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.
*/
void SetDiffusionCoefficient(G4double);
/** Returns the diffusion coefficient D.
*/
G4double GetDiffusionCoefficient() const;
/** Set the decay time of the molecule.
*/
void SetDecayTime(G4double);
/** Returns the decay time of the molecule.
*/
G4double GetDecayTime() const;
/** The Van Der Valls Radius of the molecule
*/
void SetVanDerVaalsRadius(G4double);
G4double GetVanDerVaalsRadius() const ;
/** Returns the object ElectronOccupancy describing the electronic
* configuration of the molecule.
*/
G4ElectronOccupancy GetElectronOccupancy() const;
/** Returns the charge of molecule.
*/
G4int GetCharge() const;
/** Set the total mass of the molecule.
*/
void SetMass(G4double);
/** Returns the total mass of the molecule.
*/
G4double GetMass() const;
////////////////////////////////////////////////////////////////////////
inline G4MolecularConfiguration* GetMolecularConfiguration() ;
inline static void SetGlobalTemperature(double);
inline static double GetGlobalTemperature();
private:
/** Default molecule builder
*/
G4Molecule();
void Init();
G4DynamicParticle* fDynamicParticle;
G4MolecularConfiguration* fMolecularConfiguration;
static double fgTemperature;
};
#if defined G4EM_ALLOC_EXPORT
extern G4DLLEXPORT G4Allocator<G4Molecule> aMoleculeAllocator;
#else
extern G4DLLIMPORT G4Allocator<G4Molecule> aMoleculeAllocator;
#endif
//////////////////////////
inline void * G4Molecule::operator new(size_t)
//////////////////////////
{
void * aMolecule;
aMolecule = (void *) aMoleculeAllocator.MallocSingle();
return aMolecule;
}
//////////////////////////
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;
}
#endif
@@ -0,0 +1,234 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Contact: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
//
// 21 Oct 2009 first implementation by A. Mantero and M.Karamitros
// Based on prototype of A.Mantero
// **********************************************************************
//
#ifndef G4MoleculeDefinition_h
#define G4MoleculeDefinition_h 1
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#include "G4ios.hh"
#include "G4ElectronOccupancy.hh"
#include "G4MolecularDecayTable.hh"
#include "G4MolecularDecayChannel.hh"
#include "G4MoleculeID.hh"
// ######################################################################
// ### Molecule ###
// ######################################################################
class G4MolecularDecayChannel;
class G4MolecularDecayTable;
class G4MolecularConfiguration;
class G4MoleculeDefinition : public G4ParticleDefinition
{
// Class Description
// This is the base class for all molecules
// All molecules created are objects of this class.
public: //With Description
G4MoleculeDefinition(const G4String& name,
G4double mass,
G4int electronsNumber,
G4int electronicLevels,
G4double diffCoeff,
G4int atomsNumber = -1,
G4double radius = -1,
G4double lifetime = -1,
G4String aType = "",
G4MoleculeID ID = G4MoleculeID::Create()
);
virtual ~G4MoleculeDefinition();
// Set the electronic configuration at ground level
void SetLevelOccupation(G4int, G4int eNb=2);
// set the occupation(0(def), 1 or 2) of the level specified
//(levels numbering starts from 0)
//methods to set/get diffusion properties
inline void SetDiffusionCoefficient(G4double);
inline G4double GetDiffusionCoefficient() const;
inline void SetAtomsNumber(G4int);
inline G4int GetAtomsNumber() const;
inline void SetVanDerVaalsRadius(G4double);
inline G4double GetVanDerVaalsRadius() const;
//°°°°°°°°°°°°°°°°°°°°°°°°
// Build the decay table
void AddExcitedState(const G4String&) ;
const G4String& GetExcitedState(const G4ElectronOccupancy*) const;
void AddDecayChannel(const G4String&, const G4MolecularDecayChannel*) ;
void AddeConfToExcitedState(const G4String&,const G4ElectronOccupancy&, double decayTime = 0.);
//°°°°°°°°°°°°°°°°°°°°°°°°
// "Get" methods related to decay
const std::vector<const G4MolecularDecayChannel*>* GetDecayChannels(const G4ElectronOccupancy*) const;
const std::vector<const G4MolecularDecayChannel*>* GetDecayChannels(const G4String&) const;
//°°°°°°°°°°°°°°°°°°°°°°°°
// General "Get" methods
inline const G4ElectronOccupancy* GetGroundStateElectronOccupancy() const;
inline const G4String& GetName() const;
inline G4double GetMass() const;
inline const G4String& GetType() const;
inline G4int GetNbElectrons() const;
inline G4int GetNbMolecularShells() const;
inline const G4MolecularDecayTable* GetDecayTable() const ;
inline G4MolecularDecayTable* GetDecayTable() ;
inline G4double GetDecayTime() const;
protected :
G4MoleculeDefinition();
G4MoleculeDefinition(const G4MoleculeDefinition&);
private :
const G4MoleculeDefinition & operator=(const G4MoleculeDefinition &right);
private:
G4double fMass;
G4String fType;
G4int fNbOfElectrons;
G4int fNbOfMolecularShells;
// 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
G4double fDiffusionCoefficient;
G4int fAtomsNb;
G4double fVanDerVaalsRadius;
G4ElectronOccupancy* fElectronOccupancy;
G4MolecularDecayTable* fDecayTable;
};
inline void G4MoleculeDefinition::SetDiffusionCoefficient(G4double value)
{
fDiffusionCoefficient = value;
}
inline G4double G4MoleculeDefinition::GetDiffusionCoefficient() const
{
return fDiffusionCoefficient;
}
inline G4double G4MoleculeDefinition::GetDecayTime() const
{
return GetPDGLifeTime();
}
inline void G4MoleculeDefinition::SetAtomsNumber(G4int val)
{
fAtomsNb = val;
}
inline G4int G4MoleculeDefinition::GetAtomsNumber() const
{
return fAtomsNb;
}
inline void G4MoleculeDefinition::SetVanDerVaalsRadius(G4double val)
{
fVanDerVaalsRadius = val;
}
inline G4double G4MoleculeDefinition::GetVanDerVaalsRadius() const
{
return fVanDerVaalsRadius;
}
inline const G4ElectronOccupancy* G4MoleculeDefinition::GetGroundStateElectronOccupancy() const
{
return fElectronOccupancy;
}
inline const G4String& G4MoleculeDefinition::GetName() const
{
return GetParticleName();
}
inline G4double G4MoleculeDefinition::GetMass() const
{
return fMass;
}
inline const G4String& G4MoleculeDefinition::GetType() const
{
return GetParticleSubType();
}
inline G4int G4MoleculeDefinition::GetNbElectrons() const
{
return fNbOfElectrons;
}
inline G4int G4MoleculeDefinition::GetNbMolecularShells() const
{
return fNbOfMolecularShells;
}
inline const G4MolecularDecayTable* G4MoleculeDefinition::GetDecayTable() const
{
return fDecayTable;
}
inline G4MolecularDecayTable* G4MoleculeDefinition::GetDecayTable()
{
return fDecayTable;
}
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// History:
// -----------
// 10 Oct 2011 M.Karamitros created
//
// -------------------------------------------------------------------
#ifndef G4MOLECULEHANDLEMANAGER_HH
#define G4MOLECULEHANDLEMANAGER_HH
#include "globals.hh"
#include "G4ReferenceCountedHandle.hh"
#include <map>
#include <CLHEP/Utility/memory.h>
class G4Molecule;
typedef CLHEP::shared_ptr<const G4Molecule> G4MoleculeHandle;
class G4MoleculeHandleManager
{
public:
static G4MoleculeHandleManager* Instance();
~G4MoleculeHandleManager();
G4MoleculeHandle GetMoleculeHandle(const G4Molecule*);
static void DeleteInstance();
private:
G4MoleculeHandleManager();
static G4MoleculeHandleManager* fInstance;
struct CompMoleculePointer
{
G4bool operator()(const G4Molecule* mol1, const G4Molecule* mol2) const;
};
typedef std::map<const G4Molecule* const, G4MoleculeHandle, G4MoleculeHandleManager::CompMoleculePointer> MoleculeHandleMap;
MoleculeHandleMap fMoleculeHandle;
};
#endif // G4MOLECULEHANDLEMANAGER_HH
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// History:
// -----------
// 10 Oct 2011 M.Karamitros created
//
// -------------------------------------------------------------------
#ifndef G4MoleculeID_h
#define G4MoleculeID_h 1
class G4MoleculeID
{
private :
friend G4MoleculeID operator +(const G4MoleculeID& left,const int& right);
friend G4MoleculeID operator -(const G4MoleculeID& left,const int& right);
int fValue;
static int fLastValue;
public :
static int Last()
{
return fLastValue ;
}
static G4MoleculeID Create()
{
fLastValue ++;
return G4MoleculeID(fLastValue);
}
static G4MoleculeID Initialize(int i)
{
fLastValue = i;
return G4MoleculeID(i);
}
G4MoleculeID(const int d_) : fValue(d_){;}
G4MoleculeID(){fValue=0;}
G4MoleculeID(const G4MoleculeID & d_) : fValue(d_.fValue){;}
inline G4MoleculeID & operator=(const G4MoleculeID & rhs) { this->fValue = rhs.fValue; return *this;}
G4MoleculeID & operator=(const int & rhs) { this->fValue = rhs; return *this;}
inline operator int & () { return fValue; }
inline operator const int & () const { return fValue; }
inline bool operator==(const G4MoleculeID & rhs) const { return fValue == rhs.fValue; }
inline bool operator==(const int & rhs) const { return fValue == rhs; }
inline bool operator<(const G4MoleculeID & rhs) const { return fValue < rhs.fValue; }
};
extern G4MoleculeID gStartCounter;
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
//
// WARNING : This class is released as a prototype.
// It might strongly evolve or even disapear in the next releases.
//
// History:
// -----------
// 10 Oct 2011 M.Karamitros created
//
// -------------------------------------------------------------------
#ifndef G4VMolecularDecayDisplacer_h
#define G4VMolecularDecayDisplacer_h 1
#include "globals.hh"
#include "G4ThreeVector.hh"
#include <vector>
class G4Molecule;
class G4MolecularDecayChannel;
typedef int DisplacementType;
class G4VMolecularDecayDisplacer
{
public :
virtual std::vector<G4ThreeVector> GetProductsDisplacement(const G4MolecularDecayChannel*) const = 0;
virtual G4ThreeVector GetMotherMoleculeDisplacement(const G4MolecularDecayChannel*) const = 0;
inline void SetVerbose(G4int);
virtual ~G4VMolecularDecayDisplacer();
#if defined G4EM_ALLOC_EXPORT
G4DLLEXPORT static const DisplacementType NoDisplacement;
#else
G4DLLIMPORT static const DisplacementType NoDisplacement;
#endif
protected :
G4VMolecularDecayDisplacer();
G4int fVerbose ;
static DisplacementType AddDisplacement();
static DisplacementType Last;
};
void G4VMolecularDecayDisplacer :: SetVerbose(G4int verbose)
{
fVerbose = verbose ;
}
#endif