Import Geant4 11.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2025-06-26 09:17:29 +02:00
parent 20a218bbe1
commit a499fb82e9
1941 changed files with 203285 additions and 95593 deletions
@@ -61,6 +61,7 @@
class G4ParticleDefinition;
class G4VEmProcess;
class G4VEnergyLossProcess;
class G4EmDataRegistry;
class G4EmDataHandler
{
@@ -168,6 +169,7 @@ public:
private:
G4EmDataRegistry* fRegistry;
std::vector<G4PhysicsTable*> data;
std::vector<G4double>* fMaxXS;
std::vector<G4TwoPeaksXS*>* fXSpeaks;
@@ -176,8 +178,8 @@ private:
std::size_t tLength{0};
std::size_t eLength{0};
G4CrossSectionType fXSType{fEmNoIntegral};
G4String fName;
G4bool fUseBaseParticleTable{false};
G4String fName;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -52,6 +52,9 @@ class G4EmDataRegistry
// register a new handler
void Register(G4EmDataHandler*);
// register a new handler
void DeRegister(G4EmDataHandler*);
// hide assignment operator
G4EmDataRegistry& operator=(const G4EmDataRegistry &right) = delete;
G4EmDataRegistry(const G4EmDataRegistry&) = delete;
@@ -126,6 +126,8 @@ public:
G4double factor,
G4double energyLimit);
G4String CheckRegion(const G4String&) const;
// initialisation methods
void DefineRegParamForLoss(G4VEnergyLossProcess*) const;
void DefineRegParamForEM(G4VEmProcess*) const;
@@ -136,8 +138,6 @@ public:
private:
G4String CheckRegion(const G4String&) const;
void PrintWarning(G4ExceptionDescription& ed) const;
G4EmExtraParametersMessenger* theMessenger;
@@ -407,10 +407,14 @@ public:
// create and access saturation class
G4EmSaturation* GetEmSaturation();
// defined fluctuations per G4Region
void SetFluctuationsForRegion(const G4String& regionName, G4bool flag);
// initialisation methods
void DefineRegParamForLoss(G4VEnergyLossProcess*) const;
void DefineRegParamForEM(G4VEmProcess*) const;
void DefineRegParamForDeex(G4VAtomDeexcitation*) const;
void DefineFluctuationFlags(std::vector<G4bool>* theFluctFlags);
const G4String& GetDirLEDATA() const;
@@ -499,6 +503,7 @@ private:
G4PositronAtRestModelType fPositronium;
G4String fDirLEDATA;
std::vector<std::pair<G4String, G4bool> > fluctRegions;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -107,6 +107,7 @@ private:
G4UIcmdWithABool* mscPCmd;
G4UIcmdWithABool* pepicsCmd;
G4UIcmdWithABool* f3gCmd;
G4UIcmdWithABool* fRiGeCmd;
G4UIcmdWithADoubleAndUnit* minEnCmd;
G4UIcmdWithADoubleAndUnit* maxEnCmd;
@@ -144,6 +145,8 @@ private:
G4UIcmdWithAString* nffCmd;
G4UIcmdWithAString* ssCmd;
G4UIcmdWithAString* fluc1Cmd;
G4UIcmdWithAString* fluc2Cmd;
G4UIcmdWithAString* fluc3Cmd;
G4UIcmdWithAString* posiCmd;
G4UIcommand* dumpCmd;
@@ -78,6 +78,11 @@ public:
const G4DataVector& cuts,
const G4double emin,
const G4double emax);
// fluctuations per G4Region
static void FillFluctFlags(std::vector<std::pair<G4String, G4bool> >& reg,
std::vector<G4bool>* flags);
};
#endif
@@ -92,6 +92,8 @@ public:
static const std::vector<G4double>* GetDensityFactors();
static const std::vector<G4bool>* GetFluctuationFlags();
static G4bool GetFlag(std::size_t idx);
static G4bool GetBaseMaterialFlag();
@@ -116,6 +118,7 @@ private:
static std::vector<G4double>* theDensityFactor;
static std::vector<G4int>* theDensityIdx;
static std::vector<G4bool>* theFlag;
static std::vector<G4bool>* theFluct;
};
inline void G4LossTableBuilder::SetSplineFlag(G4bool flag)
@@ -73,6 +73,7 @@ class G4EmCorrections;
class G4LossTableBuilder;
class G4VAtomDeexcitation;
class G4VSubCutProducer;
class G4VXRayModel;
class G4LossTableManager
{
@@ -172,6 +173,10 @@ public:
void DeRegister(G4VEmFluctuationModel* p);
void Register(G4VXRayModel* p);
void DeRegister(G4VXRayModel* p);
void RegisterExtraParticle(const G4ParticleDefinition* aParticle,
G4VEnergyLossProcess* p);
@@ -296,6 +301,7 @@ private:
std::vector<G4VEmProcess*> emp_vector;
std::vector<G4VEmModel*> mod_vector;
std::vector<G4VEmFluctuationModel*> fmod_vector;
std::vector<G4VXRayModel*> xray_vector;
std::vector<G4VProcess*> p_vector;
std::map<PD,G4VEnergyLossProcess*,std::less<PD> > loss_map;
@@ -56,6 +56,7 @@
#include "G4ThreeVector.hh"
#include "G4Threading.hh"
#include <vector>
#include <memory>
class G4OpticalParametersMessenger;
class G4StateManager;
@@ -73,6 +74,12 @@ enum G4OpticalProcessIndex
kNoProcess ///< Number of processes, no selected process
};
enum G4XRayModelType
{
kCerenkovDefault = 0, // default model
kScintillationDefault, // default model
};
/// Return the name for a given optical process index
G4String G4OpticalProcessName(G4int);
@@ -177,6 +184,11 @@ class G4OpticalParameters
void SetMieVerboseLevel(G4int);
G4int GetMieVerboseLevel() const;
// active volumes
const std::vector<std::pair<G4XRayModelType, const G4String> >&
ActiveVolumes() const;
void SetActiveVolume(const G4String& name, G4XRayModelType type);
private:
G4OpticalParameters();
void Initialise();
@@ -244,6 +256,9 @@ class G4OpticalParameters
G4bool boundaryInvokeSD;
G4int boundaryVerboseLevel;
//////////////// active volumes
std::vector<std::pair<G4XRayModelType, const G4String> > xrayVolumes;
#ifdef G4MULTITHREADED
static G4Mutex opticalParametersMutex;
#endif
@@ -149,6 +149,7 @@ class G4OpticalParametersMessenger : public G4UImessenger
G4UIcmdWithAnInteger* fMieVerboseLevelCmd;
G4UIcommand* fDumpCmd;
G4UIcommand* fXRayCmd;
};
#endif // G4OpticalParametersMessenger_h
@@ -284,8 +284,10 @@ public:
void ActivateSecondaryBiasing(const G4String& region, G4double factor,
G4double energyLimit);
inline void SetLossFluctuations(G4bool val);
// obsolete method will be removed in the next major release
void SetLossFluctuations(G4bool);
// interpolation of cross section
inline void SetSpline(G4bool val);
inline void SetCrossSectionType(G4CrossSectionType val);
inline G4CrossSectionType CrossSectionType() const;
@@ -294,7 +296,7 @@ public:
void SetIonisation(G4bool val);
inline G4bool IsIonisationProcess() const;
// Redefine parameteters for stepping control
// Redefine parameteters of stepping control
void SetLinearLossLimit(G4double val);
void SetStepFunction(G4double v1, G4double v2);
void SetLowestEnergyLimit(G4double);
@@ -311,6 +313,7 @@ public:
void SetInverseRangeTable(G4PhysicsTable* p);
void SetLambdaTable(G4PhysicsTable* p);
// set properties of cross section shape
void SetTwoPeaksXS(std::vector<G4TwoPeaksXS*>*);
void SetEnergyOfCrossSectionMax(std::vector<G4double>*);
@@ -446,6 +449,7 @@ private:
const std::vector<G4int>* theDensityIdx = nullptr;
const std::vector<G4double>* theDensityFactor = nullptr;
const G4DataVector* theCuts = nullptr;
const std::vector<G4bool>* theFluctuationFlags = nullptr;
std::vector<G4double>* theEnergyOfCrossSectionMax = nullptr;
std::vector<G4TwoPeaksXS*>* fXSpeaks = nullptr;
@@ -517,8 +521,9 @@ private:
G4bool weightFlag = false;
G4bool isMaster = false;
G4bool baseMat = false;
// flags allowing define table parameters individual for the process
G4bool actLinLossLimit = false;
G4bool actLossFluc = false;
G4bool actBinning = false;
G4bool actMinKinEnergy = false;
G4bool actMaxKinEnergy = false;
@@ -859,14 +864,6 @@ G4VEnergyLossProcess::SecondaryParticle() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
{
lossFluctuationFlag = val;
actLossFluc = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetSpline(G4bool val)
{
spline = val;
@@ -0,0 +1,121 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4VXRayModel
//
// Author: Vladimir Ivanchenko
//
// Creation date: 28.04.2025
//
//
// Class Description:
//
// Abstract interface to a X-Ray production model
// -------------------------------------------------------------------
//
#ifndef G4VXRayModel_h
#define G4VXRayModel_h 1
#include "globals.hh"
#include <vector>
class G4LogicalVolume;
class G4ParticleDefinition;
class G4DynamicParticle;
class G4LossTableManager;
class G4Track;
class G4Step;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4VXRayModel
{
public:
explicit G4VXRayModel(const G4String& nam);
G4VXRayModel(const G4VXRayModel&);
virtual ~G4VXRayModel();
// return minimal beta for Cerenkov in these volumes
G4double Initialise(std::vector<const G4LogicalVolume*>*);
virtual G4double InitialiseModel() = 0;
// check applicability and propose step limit, which may be DBL_MAX
// if these methods return "false", then sampling of X-rays not possible
G4bool StepLimit(const G4LogicalVolume*, const G4Track&,
G4double preStepBeta, G4double& limit);
virtual G4bool StepLimitForVolume(G4double& limit) = 0;
// sampling is called if StepLimit(..) returns "true"
// produced X-rays are inside vector out
// each photon has time, position, and other parameters within the step
virtual void SampleXRays(std::vector<G4Track*>& out, const G4Step&) = 0;
// for automatic documentation
virtual void ModelDescription(std::ostream& outFile) const;
const G4String& GetName() const { return pName; };
G4int GetType() const { return pTypeInt; };
// hide assignment operator
G4VXRayModel& operator=(const G4VXRayModel& right) = delete;
private:
void Register();
protected:
std::vector<const G4LogicalVolume*>* pLogicalVolumes{nullptr};
G4LossTableManager* pEmManager{nullptr};
const G4LogicalVolume* pCurrentLV{nullptr};
const G4Track* pCurrentTrack{nullptr};
G4double pBetaMin{1.0};
G4double pPreStepBeta{0.0};
G4double pMaxBetaChange{0.1};
G4int pMaxPhotons{100};
G4int pNumPhotons{0};
G4int pTypeInt{0};
G4int pVerbose{1};
G4bool isMaster{false};
const G4String pName;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
#endif