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
@@ -0,0 +1,45 @@
//
// ********************************************************************
// * 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 ActionInitialization.hh
/// @brief Define action initialization
#ifndef ACTION_INITIALIZATION_H
#define ACTION_INITIALIZATION_H
#include "G4VUserActionInitialization.hh"
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization();
~ActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
};
#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. *
// ********************************************************************
//
//
/// @file Analysis.hh
/// @brief Define histograms
#ifndef ANALYSIS_MANAGER_H
#define ANALYSIS_MANAGER_H
#include "G4ThreeVector.hh"
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
class TH1D;
class TH2D;
class Analysis
{
public:
~Analysis();
static Analysis* GetAnalysis();
void Update();
void Clear();
void Save(const G4String& fname);
void FillIncident(const G4ThreeVector& p);
void FillDose(const G4ThreeVector& p, G4double dedx);
void ClearIncidentFlag();
private:
Analysis();
DISALLOW_COPY_AND_ASSIGN(Analysis);
TH2D* fincident_map;
TH1D* fincident_x_hist;
TH2D* fdose_map;
TH1D* fdose_hist;
static G4ThreadLocal G4int fincidentFlag;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void Analysis::ClearIncidentFlag()
{
fincidentFlag = false;
}
#endif
@@ -0,0 +1,50 @@
//
// ********************************************************************
// * 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 DetectorConstruction.hh
/// @brief Define geometry
#ifndef DETECTOR_CONSTRUCTION_H
#define DETECTOR_CONSTRUCTION_H
#include "G4VUserDetectorConstruction.hh"
class G4LogicalVolume;
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
~DetectorConstruction();
virtual G4VPhysicalVolume* Construct();
virtual void ConstructSDandField();
private:
G4LogicalVolume* flv_voxel;
};
#endif
@@ -0,0 +1,45 @@
//
// ********************************************************************
// * 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 EventAction.hh
/// @brief Describe event actions
#ifndef EVENT_ACTION_H
#define EVENT_ACTION_H
#include "G4UserEventAction.hh"
class EventAction : public G4UserEventAction
{
public:
EventAction();
~EventAction();
virtual void BeginOfEventAction(const G4Event* aevent);
virtual void EndOfEventAction(const G4Event* aevent);
};
#endif
@@ -0,0 +1,168 @@
//
// ********************************************************************
// * 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 MedicalBeam.hh
/// @brief Define beam profile as primary generator
#ifndef MEDICAL_BEAM_H
#define MEDICAL_BEAM_H
#include "G4ThreeVector.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleDefinition;
class MedicalBeam : public G4VUserPrimaryGeneratorAction
{
public:
enum FieldShape
{
kSQUARE = 0,
kCIRCLE
};
MedicalBeam();
~MedicalBeam();
// set/get functions...
void SetParticleDefinition(G4ParticleDefinition* pd);
const G4ParticleDefinition* GetParticleDefinition() const;
void SetKineticE(G4double e);
G4double GetKineticE() const;
void SetSourcePosition(const G4ThreeVector& pos);
G4ThreeVector GetSourcePosition() const;
void SetFieldShape(FieldShape shape);
FieldShape GetFieldShape() const;
void SetSSD(G4double ssd);
G4double GetSSD() const;
void SetFieldXY(G4double fx, G4double fy);
G4double GetFieldX() const;
G4double GetFieldY() const;
void SetFieldR(G4double r);
G4double GetFieldR() const;
// methods...
virtual void GeneratePrimaries(G4Event* anEvent);
private:
// local methods...
G4ThreeVector GenerateBeamDirection() const;
G4ParticleDefinition* fparticle;
G4double fkineticE;
G4ThreeVector fsourcePosition;
G4double fSSD; // (SSD= Source Skin Depth)
FieldShape ffieldShape;
G4double ffieldXY[2];
G4double ffieldR;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void MedicalBeam::SetParticleDefinition(G4ParticleDefinition* pd)
{
fparticle = pd;
}
inline const G4ParticleDefinition* MedicalBeam::GetParticleDefinition() const
{
return fparticle;
}
inline void MedicalBeam::SetKineticE(G4double e)
{
fkineticE = e;
}
inline G4double MedicalBeam::GetKineticE() const
{
return fkineticE;
}
inline void MedicalBeam::SetSourcePosition(const G4ThreeVector& pos)
{
fsourcePosition = pos;
}
inline G4ThreeVector MedicalBeam::GetSourcePosition() const
{
return fsourcePosition;
}
inline void MedicalBeam::SetFieldShape(MedicalBeam::FieldShape shape)
{
ffieldShape = shape;
}
inline MedicalBeam::FieldShape MedicalBeam::GetFieldShape() const
{
return ffieldShape;
}
inline void MedicalBeam::SetSSD(G4double ssd)
{
fSSD = ssd;
}
inline G4double MedicalBeam::GetSSD() const
{
return fSSD;
}
inline void MedicalBeam::SetFieldXY(G4double fx, G4double fy)
{
ffieldXY[0] = fx;
ffieldXY[1] = fy;
}
inline G4double MedicalBeam::GetFieldX() const
{
return ffieldXY[0];
}
inline G4double MedicalBeam::GetFieldY() const
{
return ffieldXY[1];
}
inline void MedicalBeam::SetFieldR(G4double r)
{
ffieldR = r;
}
inline G4double MedicalBeam::GetFieldR() const
{
return ffieldR;
}
#endif
@@ -0,0 +1,45 @@
//
// ********************************************************************
// * 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 RunAction.hh
/// @brief Describe run actions
#ifndef RUN_ACTION_H
#define RUN_ACTION_H
#include "G4UserRunAction.hh"
class RunAction : public G4UserRunAction
{
public:
RunAction();
~RunAction();
virtual void BeginOfRunAction(const G4Run* arun);
virtual void EndOfRunAction(const G4Run* arun);
};
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * 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 VoxelParam.hh
/// @brief Define voxel parameterization
#ifndef VOXEL_PARAM_H
#define VOXEL_PARAM_H
#include "G4VPVParameterisation.hh"
class VoxelParam : public G4VPVParameterisation
{
public:
VoxelParam();
~VoxelParam();
virtual void ComputeTransformation(const G4int id, G4VPhysicalVolume* vol) const;
virtual void ComputeDimensions(G4Box& box, const G4int id, const G4VPhysicalVolume* vol) const;
virtual void ComputeDimensions(G4Trd&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Trap&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Cons&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Sphere&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Orb&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Ellipsoid&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Torus&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Para&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Hype&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Tubs&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Polycone&, const G4int, const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions(G4Polyhedra&, const G4int, const G4VPhysicalVolume*) const {}
};
#endif
@@ -0,0 +1,47 @@
//
// ********************************************************************
// * 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 VoxelSD.hh
/// @brief Define detector sensitivity on voxels
#ifndef VOXEL_SD_H
#define VOXEL_SD_H
#include "G4VSensitiveDetector.hh"
class VoxelSD : public G4VSensitiveDetector
{
public:
VoxelSD(const G4String& name);
~VoxelSD();
// virtual methods
virtual G4bool ProcessHits(G4Step* astep, G4TouchableHistory* rohist);
virtual void Initialize(G4HCofThisEvent* HCTE);
virtual void EndOfEvent(G4HCofThisEvent* HCTE);
};
#endif