Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
@@ -40,6 +40,7 @@
#define G4ATOMICFORMFACTOR_HH 1
#include "G4Exp.hh"
#include <CLHEP/Units/PhysicalConstants.h>
#include "globals.hh"
#include <map>
@@ -62,9 +63,9 @@ class G4AtomicFormFactor
LoadCoefficiencts(GetIndex(Z, charge));
}
G4double result = 0.;
G4double kVecOn4PiSquared =
(kScatteringVector / 1.e-7 / 3.1415926536) * 0.125; // (k/(4pi))/ angstrom
kVecOn4PiSquared = kVecOn4PiSquared * kVecOn4PiSquared; // (k/(4pi))^2
// Convert k from mm^-1 to Å^-1 and divide by 4π , then square.
const G4double kVecOn4Pi = (kScatteringVector * 1.0e-7) * (1.0 / (4.0 * CLHEP::pi));
G4double kVecOn4PiSquared = kVecOn4Pi * kVecOn4Pi; // (k/(4π))^2 in Å^-2
for (unsigned int i0 = 0; i0 < 4; i0++) {
result += theCoefficients[i0 * 2] * G4Exp(-theCoefficients[i0 * 2 + 1] * kVecOn4PiSquared);
+16 -1
View File
@@ -53,6 +53,8 @@
#include <vector>
class G4ElementDataRegistry;
class G4ElementData
{
public:
@@ -64,6 +66,10 @@ class G4ElementData
G4ElementData& operator=(const G4ElementData& right) = delete;
G4ElementData(const G4ElementData&) = delete;
// reservation of memory for better data layout
void Reserve1D(std::size_t);
void Reserve2D(std::size_t);
// add cross section for the element
void InitialiseForElement(G4int Z, G4PhysicsVector* v);
@@ -82,6 +88,12 @@ class G4ElementData
// prepare vector of 2D components
void Add2DComponent(G4int Z, G4int id, G4Physics2DVector* v);
// make new 1D free vector
G4PhysicsVector* New1DVector(G4int Z, G4int ne);
// make new 2D vector
G4Physics2DVector* New2DVector(G4int Z, G4int ny, G4int ne);
// set name of the dataset (optional)
inline void SetName(const G4String& nam);
@@ -141,9 +153,12 @@ class G4ElementData
const G4int maxNumElm;
G4ElementDataRegistry* fRegistry{nullptr};
std::vector<G4PhysicsVector*> elmData;
std::vector<G4Physics2DVector*> elm2Data;
std::vector<std::vector<std::pair<G4int, G4PhysicsVector*> >* > compData;
std::vector<G4Physics2DVector*> elm2Data;
std::vector<std::vector<std::pair<G4int, G4Physics2DVector*> >* > comp2D;
G4String name{""};
@@ -52,6 +52,8 @@ class G4ElementDataRegistry
G4ElementData* GetElementDataByName(const G4String&);
G4ElementData* NewElementData(const G4String&, G4int length);
private:
G4ElementDataRegistry();
+53
View File
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * 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 header G4MatUtils
//
// Author V.Ivanchenko 30.09.2025
//
// Utilities used at initialisation of material properties
//
#ifndef G4MatUtils_HH
#define G4MatUtils_HH
#include "globals.hh"
#include "G4ExtendedPhysicsVector.hh"
class G4MatUtils
{
public:
// Build G4ExtendedPhysicsVector using data provided in the fixed format
// of length = number of strings with the same data:
// energy and N partial cross sections
static G4ExtendedPhysicsVector*
BuildExtendedVector(const G4String& dirpath, const G4String& filename,
const G4int N, const G4int length,
const G4double unitE = 1.0, const G4double unitS = 1.0);
};
#endif