Import Geant4 11.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2023-12-08 10:43:34 +01:00
parent dd1f179cda
commit 860a2b92bf
3962 changed files with 139318 additions and 164259 deletions
@@ -0,0 +1,54 @@
//
// ********************************************************************
// * 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 POl01/include/ActionInitialization.hh
/// \brief Definition of the ActionInitialization class
#ifndef ActionInitialization_h
#define ActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
class DetectorConstruction;
/// Action initialization class.
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization(DetectorConstruction*);
~ActionInitialization() override = default;
void BuildForMaster() const override;
void Build() const override;
private:
DetectorConstruction* fDetector;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -51,7 +51,8 @@ public:
public:
G4VPhysicalVolume* Construct();
G4VPhysicalVolume* Construct() override;
void ConstructSDandField() override;
void SetSizeXY (G4double);
void SetSizeZ (G4double);
@@ -70,6 +71,10 @@ public:
G4double GetBoxSizeZ() {return fBoxSizeZ;};
G4Material* GetMaterial() {return fTargetMaterial;};
private:
void ConstructMaterials();
void PrintParameters();
private:
@@ -33,29 +33,32 @@
#ifndef ProcessesCount_HH
#define ProcessesCount_HH
#include "G4VAccumulable.hh"
#include "globals.hh"
#include <vector>
#include <map>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ProcessCount
class ProcessesCount : public G4VAccumulable
{
public:
ProcessCount(G4String name) {fName=name; fCounter=0;};
~ProcessCount() {};
public:
G4String GetName() {return fName;};
G4int GetCounter() {return fCounter;};
void Count() {fCounter++;};
private:
G4String fName; // process name
G4int fCounter; // process counter
public:
ProcessesCount() = delete;
ProcessesCount(const G4String& name);
~ProcessesCount() = default;
G4int GetCounter(const G4String& procName) { return fProcCounter[procName]; };
void Count(const G4String& procName);
void Print();
void Merge(const G4VAccumulable&) override;
void Reset() override { fProcCounter.clear(); }
private:
std::map<G4String, G4int> fProcCounter;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
typedef std::vector<ProcessCount*> ProcessesCount;
#endif
@@ -35,7 +35,7 @@
#include "G4UserRunAction.hh"
#include "G4AnalysisManager.hh"
#include "ProcessesCount.hh"
#include "G4VAccumulable.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -49,15 +49,17 @@ class G4ParticleDefinition;
class RunAction : public G4UserRunAction
{
class ParticleStatistics {
class ParticleStatistics : public G4VAccumulable {
public:
ParticleStatistics();
ParticleStatistics(const G4String& name);
~ParticleStatistics();
void EventFinished();
void FillData(G4double kinEnergy, G4double costheta,
G4double longitudinalPolarization);
void PrintResults(G4int totalNumberOfEvents);
void Clear();
void Reset() override;
void Merge(const G4VAccumulable& other) override;
private:
G4int fCurrentNumber;
G4int fTotalNumber, fTotalNumber2;
@@ -68,13 +70,13 @@ class RunAction : public G4UserRunAction
public:
RunAction(DetectorConstruction*, PrimaryGeneratorAction*);
RunAction(DetectorConstruction*, PrimaryGeneratorAction* = nullptr);
virtual ~RunAction();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
void CountProcesses(G4String);
void CountProcesses(G4String&);
void FillData(const G4ParticleDefinition* particle,
G4double kinEnergy, G4double costheta, G4double phi,
@@ -93,15 +95,10 @@ private:
DetectorConstruction* fDetector;
PrimaryGeneratorAction* fPrimary;
ProcessesCount* fProcCounter;
G4AnalysisManager* fAnalysisManager;
G4int fTotalEventCount;
ParticleStatistics fPhotonStats;
ParticleStatistics fElectronStats;
ParticleStatistics fPositronStats;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......