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
@@ -32,10 +32,10 @@
// with a crystal extension. The class handles the orientation
// of the crystal axes wrt the solid to which the crystal is attached.
// 21-04-16, created by E.Bagli
// Author: Enrico Bagli (Ferrara Univ.), 21.04.2016
// ---------------------------------------------------------------------------
#ifndef G4LOGICALCRYSTALVOLUME_HH
#define G4LOGICALCRYSTALVOLUME_HH 1
#define G4LOGICALCRYSTALVOLUME_HH
#include <vector>
#include "G4LogicalVolume.hh"
@@ -43,10 +43,31 @@
class G4CrystalExtension;
class G4ExtendedMaterial;
/**
* @brief G4LogicalCrystalVolume is a specialised logical volume for the
* description of crystals. The object can be created only with an extended
* material with a crystal extension. The class handles the orientation
* of the crystal axes wrt the solid to which the crystal is attached.
*/
class G4LogicalCrystalVolume : public G4LogicalVolume
{
public:
/**
* Constructor for G4LogicalCrystalVolume.
* @param[in] pSolid Pointer to the associated solid primitive.
* @param[in] pMaterial Pointer to the associated extended crystal material.
* @param[in] name The volume name.
* @param[in] pFieldMgr Pointer to optional magnetic field manager.
* @param[in] pSDetector Pointer to optional associated sensitive detector.
* @param[in] pULimits Pointer to optional user limits.
* @param[in] optimise Flag to enable/disable optimisation structure.
* @param[in] h Miller orientation parameter h.
* @param[in] k Miller orientation parameter k.
* @param[in] l Miller orientation parameter l.
* @param[in] rot Miller rotation parameter.
*/
G4LogicalCrystalVolume(G4VSolid* pSolid,
G4ExtendedMaterial* pMaterial,
const G4String& name,
@@ -59,36 +80,60 @@ class G4LogicalCrystalVolume : public G4LogicalVolume
G4int l = 0,
G4double rot = 0.0);
/**
* Destructor.
*/
~G4LogicalCrystalVolume() override;
G4bool IsExtended() const override { return true; }
// Return true if it is not a base-class object.
/**
* Returns true as it is not a base-class object.
*/
inline G4bool IsExtended() const override { return true; }
/**
* Sets the physical lattice orientation, relative to G4VSolid coordinates.
* Miller orientation aligns lattice normal (hkl) with geometry +Z.
*/
void SetMillerOrientation(G4int h, G4int k, G4int l, G4double rot = 0.0);
// Set physical lattice orientation, relative to G4VSolid coordinates
// Miller orientation aligns lattice normal (hkl) with geometry +Z
/**
* Methods to rotate input vector between lattice and solid orientations.
* @returns The new vector value for convenience.
*/
const G4ThreeVector& RotateToLattice(G4ThreeVector& dir) const;
const G4ThreeVector& RotateToSolid(G4ThreeVector& dir) const;
// Rotate input vector between lattice and solid orientations
// Returns new vector value for convenience
/**
* Returns a pointer to the crystal extension object.
*/
const G4CrystalExtension* GetCrystal() const;
/**
* Calls through to get crystal basis vectors.
*/
const G4ThreeVector& GetBasis(G4int i) const;
// Call through to get crystal basis vectors
void SetVerbose(G4int aInt) { verboseLevel = aInt; }
/**
* Setter for verbosity level.
*/
inline void SetVerbose(G4int aInt) { verboseLevel = aInt; }
/**
* Returns true if the logical volume 'aLV' is a lattice.
*/
static G4bool IsLattice(G4LogicalVolume* aLV);
private:
G4RotationMatrix fOrient; // Rotate geometry into lattice frame
/** Rotates geometry into lattice frame. */
G4RotationMatrix fOrient;
G4RotationMatrix fInverse;
G4int hMiller = 1, kMiller = 1, lMiller = 0; // Save Miller indices for dump
/** Cached Miller indices for dump. */
G4int hMiller = 1, kMiller = 1, lMiller = 0;
G4double fRot = 0.0;
/** Verbosity level. */
G4int verboseLevel = 0;
static std::vector<G4LogicalVolume*> fLCVvec;