Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 10:49:55 +02:00
parent 3a5407696b
commit 1a1316fea4
2180 changed files with 237880 additions and 59109 deletions
@@ -0,0 +1,106 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file materials/include/G4LatticeManager.hh
/// \brief Definition of the G4LatticeManager class
//
// $Id: G4LatticeManager.hh 84149 2014-10-08 18:04:16Z mkelsey $
//
// 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>
class G4LatticeLogical;
class G4LatticePhysical;
class G4Material;
class G4VPhysicalVolume;
class G4LatticeManager {
private:
static G4LatticeManager* fLM; // Global, shared singleton
public:
static G4LatticeManager* GetLatticeManager();
void SetVerboseLevel(G4int vb) { verboseLevel = vb; }
void Reset(); // Remove and delete all registered lattices
// Users may register physical or logical lattices with volumes
G4bool RegisterLattice(G4VPhysicalVolume*, G4LatticePhysical*);
G4bool RegisterLattice(G4VPhysicalVolume*, G4LatticeLogical*);
// Logical lattices are associated with materials
G4bool RegisterLattice(G4Material*, G4LatticeLogical*);
// Logical lattices may be read from <latDir>/config.txt data file
G4LatticeLogical* LoadLattice(G4Material*, const G4String& latDir);
G4LatticeLogical* GetLattice(G4Material*) const;
G4bool HasLattice(G4Material*) const;
// Combine loading and registration (Material extracted from volume)
G4LatticePhysical* LoadLattice(G4VPhysicalVolume*, const G4String& latDir);
// NOTE: Passing Vol==0 will return the default lattice
G4LatticePhysical* GetLattice(G4VPhysicalVolume*) const;
G4bool HasLattice(G4VPhysicalVolume*) const;
G4double MapKtoV(G4VPhysicalVolume*, G4int, const G4ThreeVector &) const;
G4ThreeVector MapKtoVDir(G4VPhysicalVolume*, G4int,
const G4ThreeVector&) const;
protected:
void Clear(); // Remove entries from lookup tables w/o deletion
protected:
G4int verboseLevel; // Allow users to enable diagnostic messages
typedef std::map<G4Material*, G4LatticeLogical*> LatticeMatMap;
typedef std::set<G4LatticeLogical*> LatticeLogReg;
LatticeLogReg fLLattices; // Registry of unique lattice pointers
LatticeMatMap fLLatticeList;
typedef std::map<G4VPhysicalVolume*, G4LatticePhysical*> LatticeVolMap;
typedef std::set<G4LatticePhysical*> LatticePhyReg;
LatticePhyReg fPLattices; // Registry of unique lattice pointers
LatticeVolMap fPLatticeList;
private:
G4LatticeManager();
virtual ~G4LatticeManager();
};
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file processes/phonon/include/G4LatticeReader.hh
/// \brief Definition of the G4LatticeReader class
//
// NOTE: This reader class for logical lattices should be moved to
// materials/ after the 10.0 release (and this comment removed).
// $Id: G4LatticeReader.hh 76799 2013-11-15 20:30:53Z mkelsey $
//
// 20131115 Move ctor, dtor implementations to .cc file.
#ifndef G4LatticeReader_h
#define G4LatticeReader_h 1
#include "globals.hh"
#include <iosfwd>
class G4LatticeLogical;
class G4LatticeReader {
public:
G4LatticeReader(G4int vb=0);
~G4LatticeReader();
void SetVerboseLevel(G4int vb) { verboseLevel = vb; }
G4LatticeLogical* MakeLattice(const G4String& filepath);
protected:
G4bool OpenFile(const G4String& filepath);
G4bool ProcessToken();
G4bool ProcessValue(const G4String& name); // Numerical parameters
G4bool ProcessConstants(); // Four dynamical constants
G4bool ProcessMap(); // Velocity magnitudes file
G4bool ProcessNMap(); // Direction vectors file
G4bool ReadMapInfo(); // Get map file parameters
G4bool SkipComments(); // Everything after '#'
void CloseFile();
private:
G4int verboseLevel; // For reporting progress, also use G4VERBOSE
std::ifstream* psLatfile; // Configuration file being read
G4LatticeLogical* pLattice; // Lattice under construction (not owned)
G4String fMapPath; // Path to config file to find velocity maps
G4String fToken; // Reusable buffers for reading file
G4double fValue; // ... floating point data values
G4String fMap, fsPol; // ... map filename and polarization code
G4int fPol, fNX, fNY; // ... map binning in each direction
static const G4String fDataDir; // Directory path ($G4LATTICEDATA)
};
#endif /* G4LatticeReader_h */
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file processes/phonon/include/G4PhononDownconversion.hh
/// \brief Definition of the G4PhononDownconversion class
//
// $Id: G4PhononDownconversion.hh 79766 2014-03-13 16:11:36Z gcosmo $
//
#ifndef G4PhononDownconversion_h
#define G4PhononDownconversion_h 1
#include "G4VPhononProcess.hh"
class G4PhononDownconversion : public G4VPhononProcess {
public:
G4PhononDownconversion(const G4String& processName ="phononDownconversion");
virtual ~G4PhononDownconversion();
virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step& );
virtual G4bool IsApplicable(const G4ParticleDefinition&);
protected:
virtual G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*);
private:
// relative probability that anharmonic decay occurs L->L'+T'
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:
G4double fBeta, fGamma, fLambda, fMu; // Local buffers for calculations
// hide assignment operator as private
G4PhononDownconversion(G4PhononDownconversion&);
G4PhononDownconversion& operator=(const G4PhononDownconversion& right);
};
#endif
@@ -0,0 +1,46 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file processes/phonon/include/G4PhononPolarization.hh
/// \brief Definition of the G4PhononPolarization enum
//
// $Id: G4PhononPolarization.hh 75725 2013-11-05 16:52:30Z mkelsey $
//
#ifndef G4PhononPolarization_h
#define G4PhononPolarization_h 1
#include "globals.hh"
class G4ParticleDefinition;
namespace G4PhononPolarization {
enum { Long=0, TransSlow=1, TransFast=2, UNKNOWN=-1 };
G4int Get(const G4ParticleDefinition* aPD);
G4ParticleDefinition* Get(G4int pol);
}
#endif /* G4PhononPolarization_h */
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file processes/phonon/include/G4PhononReflection.hh
/// \brief Definition of the G4PhononReflection class
//
// $Id: G4PhononReflection.hh 75725 2013-11-05 16:52:30Z mkelsey $
//
#ifndef G4PhononReflection_h
#define G4PhononReflection_h 1
#include "G4VPhononProcess.hh"
class G4PhononReflection : public G4VPhononProcess {
public:
G4PhononReflection(const G4String& processName ="phononReflection" );
virtual ~G4PhononReflection();
virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step& );
protected:
virtual G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*);
private:
G4double kCarTolerance;
private:
// hide assignment operator as private
G4PhononReflection(G4PhononReflection&);
G4PhononReflection& operator=(const G4PhononReflection& right);
};
#endif
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file processes/phonon/include/G4PhononScattering.hh
/// \brief Definition of the G4PhononScattering class
//
// $Id: G4PhononScattering.hh 75725 2013-11-05 16:52:30Z mkelsey $
//
#ifndef G4PhononScattering_h
#define G4PhononScattering_h 1
#include "G4VPhononProcess.hh"
class G4PhononScattering : public G4VPhononProcess {
public:
G4PhononScattering(const G4String& processName ="phononScattering" );
virtual ~G4PhononScattering();
virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step& );
protected:
virtual G4double GetMeanFreePath(const G4Track&, G4double,
G4ForceCondition* );
private:
// hide assignment operator as private
G4PhononScattering(G4PhononScattering&);
G4PhononScattering& operator=(const G4PhononScattering& right);
};
#endif
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file processes/phonon/include/G4PhononTrackMap.hh
/// \brief Definition of the G4PhononTrackMap base class
//
// $Id: G4PhononTrackMap.hh 76492 2013-11-11 17:15:04Z mkelsey $
//
// 20131111 Move implementation of Clear() to .cc file
#ifndef G4PhononTrackMap_h
#define G4PhononTrackMap_h 1
#include "G4ThreeVector.hh"
#include <map>
class G4Track;
class G4PhononTrackMap {
public:
typedef std::map<const G4Track*, G4ThreeVector> TrkIDKmap;
static G4ThreadLocal G4PhononTrackMap* theTrackMap;
public:
static G4PhononTrackMap* GetPhononTrackMap(); // Synonyms for access
static G4PhononTrackMap* GetInstance() { return GetPhononTrackMap(); }
// Update the wavevector for specified track, add track if not found
void SetK(const G4Track* track, const G4ThreeVector& K);
void SetK(const G4Track& track, const G4ThreeVector& K) { SetK(&track, K); }
// Access current wavevector for specified track (NULL if doesn't exist)
const G4ThreeVector& GetK(const G4Track* track) const;
const G4ThreeVector& GetK(const G4Track& track) const { return GetK(&track); }
// Check if specified track is already loaded
G4bool Find(const G4Track* track) const;
G4bool Find(const G4Track& track) const { return Find(&track); }
// Remove specified track from map (used by EndTracking)
void RemoveTrack(const G4Track* track);
void Clear(); // Remove all entries from map
private:
TrkIDKmap theMap; // Associate track ID numbers with vectors
private:
G4PhononTrackMap() { Clear(); } // Ensure map is empty
~G4PhononTrackMap() {;}
};
#endif /* G4PhononTrackMap_h */
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file processes/phonon/include/G4VPhononProcess.hh
/// \brief Definition of the G4VPhononProcess base class
//
// $Id: G4VPhononProcess.hh 75725 2013-11-05 16:52:30Z mkelsey $
//
#ifndef G4VPhononProcess_h
#define G4VPhononProcess_h 1
#include "globals.hh"
#include "G4VDiscreteProcess.hh"
#include "G4ThreeVector.hh"
class G4PhononTrackMap;
class G4LatticePhysical;
class G4VPhononProcess : public G4VDiscreteProcess {
public:
G4VPhononProcess(const G4String& processName);
virtual ~G4VPhononProcess();
virtual G4bool IsApplicable(const G4ParticleDefinition& aPD);
// Initialize wave vectors for currently active track(s)
// NOTE: These functions must call back to base class implementations!
virtual void StartTracking(G4Track* track);
virtual void EndTracking();
protected:
// For convenience, map phonon type to polarization code
virtual G4int GetPolarization(const G4Track& track) const;
virtual G4int GetPolarization(const G4Track* track) const {
return GetPolarization(*track);
}
// For convenience, generate random polarization from density of states
// Values passed may be zero to suppress particular states
virtual G4int ChoosePolarization(G4double Ldos, G4double STdos,
G4double FTdos) const;
// Construct new track with correct momentum, position, etc.
virtual G4Track* CreateSecondary(G4int polarization, const G4ThreeVector& K,
G4double energy) const;
protected:
G4PhononTrackMap* trackKmap; // For convenient access by processes
const G4LatticePhysical* theLattice;
private:
const G4Track* currentTrack; // For use by Start/EndTracking
// hide assignment operators as private
G4VPhononProcess(G4VPhononProcess&);
G4VPhononProcess& operator=(const G4VPhononProcess& right);
};
#endif /* G4VPhononProcess_h */