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
@@ -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. *
// ********************************************************************
//
//
#ifndef ActionInitialization_h
#define ActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
class DetectorConstruction;
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization(DetectorConstruction*);
~ActionInitialization() override;
void BuildForMaster() const override;
void Build() const override;
private:
DetectorConstruction* fDetectorConstruction;
};
#endif
@@ -0,0 +1,198 @@
//
// ********************************************************************
// * 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 electromagnetic/TestEm14/include/DetectorConstruction.hh
/// \brief Definition of the DetectorConstruction class
//
// $Id: DetectorConstruction.hh 84208 2014-10-10 14:44:50Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4Box.hh"
#include "MicroElecSdSey.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Sphere.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4PVPlacement.hh"
#include "G4UserLimits.hh"
#include "G4VisAttributes.hh"
class G4LogicalVolume;
class G4Material;
class DetectorMessenger;
class G4UserLimits;
class G4Region;
class ElectroMagneticFieldSetup;
const G4int kMaxAbsor = 1;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
~DetectorConstruction();
public:
G4Region* GetTargetRegion() { return fRegion; }
G4VPhysicalVolume* Construct() override;
void ConstructSDandField() override;
void SetSize (G4double);
void SetWidth (G4double);
void SetMaterial (G4String);
void SetSizeSurface(G4double);
void SetMaterialSurface(G4String);
void SetSizeLayer1(G4double);
void SetMaterialLayer1(G4String);
void SetSizeLayer2(G4double);
void SetMaterialLayer2(G4String);
void SetSizeLayer3(G4double);
void SetMaterialLayer3(G4String);
void SetSizeLayer4(G4double);
void SetMaterialLayer4(G4String);
void UpdateGeometry();
G4Material* DefaultMaterial;
G4Material* My_TiN;
G4Material* My_BN;
G4Material* My_SiO2;
G4Material* My_Kapton;
public:
const
G4VPhysicalVolume* GetWorld() {return fPBox;};
G4double GetSize() {return fBoxSize;};
G4double GetWidth() { return fBoxWidth; };
G4Material* GetMaterial() {return fMaterial;};
G4double GetSizeSurface() { return fBoxSizeSurface; };
G4Material* GetMaterialSurface() { return fMaterialSurface; };
G4double GetSizeLayer1() { return fBoxSizeLayer1; };
G4Material* GetMaterialLayer1() { return fMaterialLayer1; };
G4double GetSizeLayer2() { return fBoxSizeLayer2; };
G4Material* GetMaterialLayer2() { return fMaterialLayer2; };
G4double GetSizeLayer3() { return fBoxSizeLayer3; };
G4Material* GetMaterialLayer3() { return fMaterialLayer3; };
G4double GetSizeLayer4() { return fBoxSizeLayer4; };
G4Material* GetMaterialLayer4() { return fMaterialLayer4; };
//SDTrajectoires* GetSensitiveDetector() { return pSDTrajectoires; };
void PrintParameters();
private:
G4Region* fRegion;
G4double fWorldSizeX;
G4double fWorldSizeY;
G4double fWorldSizeZ;
G4Material* World_Material;
G4Box* fSolidWorld;
G4LogicalVolume* fLogicWorld;
G4VPhysicalVolume* fPhysiWorld;
G4double WorldDim;
G4double WorldRay;
// substrate
G4Box* fSBox;
G4LogicalVolume* fLBox;
G4VPhysicalVolume* fPBox;
G4double fBoxSize;
G4double fBoxWidth;
G4Material* fMaterial;
// surface
G4Box* fSBoxSurface;
G4VPhysicalVolume* fPBoxSurface;
G4LogicalVolume* fLBoxSurface;
G4double fBoxSizeSurface;
G4Material* fMaterialSurface;
// Layer 1 just below the surface
G4Box* fSBoxLayer1;
G4VPhysicalVolume* fPBoxLayer1;
G4LogicalVolume* fLBoxLayer1;
G4double fBoxSizeLayer1;
G4Material* fMaterialLayer1;
// Layer 2 just below the layer1
G4Box* fSBoxLayer2;
G4VPhysicalVolume* fPBoxLayer2;
G4LogicalVolume* fLBoxLayer2;
G4double fBoxSizeLayer2;
G4Material* fMaterialLayer2;
// Layer 3 just below the layer2
G4Box* fSBoxLayer3;
G4VPhysicalVolume* fPBoxLayer3;
G4LogicalVolume* fLBoxLayer3;
G4double fBoxSizeLayer3;
G4Material* fMaterialLayer3;
// Layer 4 just below the layer3 on top of the substrate
G4Box* fSBoxLayer4;
G4VPhysicalVolume* fPBoxLayer4;
G4LogicalVolume* fLBoxLayer4;
G4double fBoxSizeLayer4;
G4Material* fMaterialLayer4;
G4Sphere* Detector_1_box;
G4LogicalVolume* Detector_1_log;
G4VPhysicalVolume* Detector_1_phys;
G4Material* detectorMat;
G4double DetectorRay;
DetectorMessenger* fDetectorMessenger;
private:
void DefineMaterials();
G4VPhysicalVolume* ConstructVolumes();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,87 @@
//
// ********************************************************************
// * 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 electromagnetic/MicroElec-SEYv1/include/DetectorMessenger.hh
/// \brief Definition of the DetectorMessenger class
//
// $Id: DetectorMessenger.hh 84208 2014-10-10 14:44:50Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorMessenger_h
#define DetectorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class DetectorConstruction;
class G4UIdirectory;
class G4UIcommand;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithADouble;
class G4UIcmdWithABool;
class G4UIcmdWithAnInteger;
class G4UIcmdWith3Vector;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorMessenger: public G4UImessenger
{
public:
DetectorMessenger(DetectorConstruction* );
~DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String) override;
private:
DetectorConstruction* fDetector;
G4UIdirectory* fTestemDir;
G4UIdirectory* fDetDir;
G4UIcmdWithAString* fMaterCmd;
G4UIcmdWithAString* fMaterSurfCmd;
G4UIcmdWithAString* fMaterLayer1Cmd;
G4UIcmdWithAString* fMaterLayer2Cmd;
G4UIcmdWithAString* fMaterLayer3Cmd;
G4UIcmdWithAString* fMaterLayer4Cmd;
G4UIcmdWithADoubleAndUnit* fSizeCmd;
G4UIcmdWithADoubleAndUnit* fWidthCmd;
G4UIcmdWithADoubleAndUnit* fSizeSurfCmd;
G4UIcmdWithADoubleAndUnit* fSizeLayer1Cmd;
G4UIcmdWithADoubleAndUnit* fSizeLayer2Cmd;
G4UIcmdWithADoubleAndUnit* fSizeLayer3Cmd;
G4UIcmdWithADoubleAndUnit* fSizeLayer4Cmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,153 @@
// ********************************************************************
// * 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 MicroElecHitSey.cc
/// \brief Implementation of the MicroElecHitSey class
//
//-
#ifndef __MICROELECHITSEY_H__
#define __MICROELECHITSEY_H__ 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
class MicroElecHitSey : public G4VHit
{
public:
MicroElecHitSey();
~MicroElecHitSey();
MicroElecHitSey(const MicroElecHitSey&);
const MicroElecHitSey& operator=(const MicroElecHitSey&);
int operator==(const MicroElecHitSey&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void Print();
public:
void SetNbPrim (G4int nbprim) { NbPrim=nbprim; };
void SetNbSec (G4int nbsec) { NbSec = nbsec; };
void SetNbSup50 (G4int nbsup50) { NbSup50 = nbsup50; };
void SetPDGEncoding (G4int pdgencoding) { PDGEncoding = pdgencoding; };
void SetParentID (G4int parent) { ParentID = parent; };
void SetTrackID (G4int track) { trackID = track; };
void SetParticleType (G4String nameT) { ParticleType = nameT; };
void SetParticleName (G4String name) { ParticleName = name; };
void SetVolumeName (G4String nameV) { VolumeName = nameV; };
void SetZ (G4int z) { Z = z; };
void SetA (G4int a) { A = a; };
void SetVertexKineticEnergy (G4double VQ) { VertexKineticEnergy = VQ; };
void SetVertexPos(G4ThreeVector xyz) { VertexPos = xyz; };
void SetVertexMomentum(G4ThreeVector xyz) { VertexMomentum = xyz; };
void SetPreStepKineticEnergy (G4double Q) { PreStepKineticEnergy = Q; };
void SetPostStepKineticEnergy (G4double Q) { PostStepKineticEnergy = Q; };
void SetEdep (G4double de) { Edep = de; };
void SetNi_Edep (G4double NIde) { Ni_Edep = NIde; };
void SetStepLength (G4double length) { StepLength = length; };
void SetPrePos (G4ThreeVector xyz) { PrePos = xyz; };
void SetPostPos (G4ThreeVector xyz) { PostPos = xyz; };
void SetPreStepMomentum (G4ThreeVector xyz) { PreStepMomentum = xyz; };
void SetPostStepMomentum (G4ThreeVector xyz) { PostStepMomentum = xyz; };
G4int GetNbPrim() { return NbPrim; };
G4int GetNbSec() { return NbSec; };
G4int GetNbSup50() { return NbSup50; };
G4int GetPDGEncoding () { return PDGEncoding; };
G4int GetParentID () { return ParentID; };
G4int GetTrackID () { return trackID; };
G4String GetParticleType () { return ParticleType; };
G4String GetParticleName () { return ParticleName; };
G4String GetVolumeName () { return VolumeName; };
G4int GetZ () { return Z; };
G4int GetA () { return A; };
G4double GetVertexKineticEnergy (){ return VertexKineticEnergy; };
G4ThreeVector GetVertexPos() { return VertexPos; };
G4ThreeVector GetVertexMomentum() { return VertexMomentum ; };
G4double GetPreStepKineticEnergy(){ return PreStepKineticEnergy; };
G4double GetPostStepKineticEnergy(){ return PostStepKineticEnergy;};
G4double GetEdep () { return Edep; };
G4double GetNi_Edep () { return Ni_Edep; };
G4ThreeVector GetPrePos () { return PrePos; };
G4ThreeVector GetPostPos () { return PostPos; };
G4ThreeVector GetPreStepMomentum () { return PreStepMomentum; };
G4ThreeVector GetPostStepMomentum () { return PostStepMomentum; };
G4double GetStepLength () { return StepLength; };
//-------------------
//New due to the use of touchables to identify the different sensitive detectors
void SetVolumeCopyNumber(int value){VolumeCopyNumber = value;};
G4int GetVolumeCopyNumber(){return VolumeCopyNumber;};
private:
G4int NbPrim;
G4int NbSec;
G4int NbSup50;
G4int PDGEncoding;
G4int ParentID;
G4int trackID;
G4String ParticleType;
G4String ParticleName;
G4String VolumeName;
G4int Z;
G4int A;
G4double VertexKineticEnergy;
G4double PreStepKineticEnergy;
G4double PostStepKineticEnergy;
G4double Edep;
G4double Ni_Edep;
G4double StepLength;
G4ThreeVector PrePos;
G4ThreeVector PostPos;
G4ThreeVector VertexPos;
G4ThreeVector PreStepMomentum;
G4ThreeVector PostStepMomentum;
G4ThreeVector VertexMomentum;
//-------------------
//New due to the use of touchables to identify the different sensitive detectors
G4int VolumeCopyNumber;
};
typedef G4THitsCollection<MicroElecHitSey> MicroElecHitSeyCollection;
extern G4ThreadLocal G4Allocator<MicroElecHitSey>* MicroElecHitSeyAllocator;
inline void* MicroElecHitSey::operator new(size_t){
void *aHit;
if (!MicroElecHitSeyAllocator) { MicroElecHitSeyAllocator = new G4Allocator<MicroElecHitSey>; }
aHit = (void *) MicroElecHitSeyAllocator->MallocSingle();
return aHit;
}
inline void MicroElecHitSey::operator delete(void *aHit){MicroElecHitSeyAllocator->FreeSingle((MicroElecHitSey*) aHit);}
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// -------------------------------------------------------------------
// -------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef MicroElecPhysics_h
#define MicroElecPhysics_h 1
#include "G4VUserPhysicsList.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class MicroElecPhysics: public G4VUserPhysicsList
{
public:
MicroElecPhysics();
~MicroElecPhysics()override;
void SetGammaCut(G4double);
void SetElectronCut(G4double);
void SetPositronCut(G4double);
void SetProtonCut(G4double);
protected:
// these methods construct particles
void ConstructBosons();
void ConstructLeptons();
void ConstructBarions();
// these methods construct physics processes and register them
void ConstructGeneral();
void ConstructEM();
// Construct particle and physics
void ConstructParticle() override;
void ConstructProcess() override;
private:
G4double cutForGamma;
G4double cutForElectron;
G4double cutForPositron;
G4double cutForProton;
};
#endif
@@ -0,0 +1,81 @@
//
// ********************************************************************
// * 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 MicroElecRun.cc
/// \brief Implementation of the MicroElecRun class
//
//
#ifndef MicroElecRun_h
#define MicroElecRun_h 1
#include "globals.hh"
#include "G4Run.hh"
#include "G4THitsMap.hh"
class G4Event;
class MicroElecRun : public G4Run
{
public:
MicroElecRun();
~MicroElecRun() override;
void RecordEvent(const G4Event*) override;
void Merge(const G4Run*) override;
G4double GetElecPrimScorer() { return ElecPrimScorer; }
G4double GetElecSecoScorer() { return ElecSecoScorer; }
G4double GetElecSup50Scorer() { return ElecSup50Scorer; }
G4double GetElecTotaScorer() { return ElecTotaScorer; }
G4double GetElecEneIncPart() { return ElecEneIncPart; }
void SetElecPrimScorer(G4double elecprimscorer) { ElecPrimScorer= elecprimscorer; }
void SetElecSecoScorer(G4double elecsecoscorer) { ElecSecoScorer= elecsecoscorer; }
void SetElecSup50Scorer(G4double elecsup50scorer) { ElecSup50Scorer= elecsup50scorer; }
void SetElecTotaScorer(G4double electotascorer) { ElecTotaScorer= electotascorer; }
void SetElecEneIncPart(G4double eleceneincPart) { ElecEneIncPart = eleceneincPart; }
void AddElecPrimScorer(G4double elecprimscorer) { ElecPrimScorer += elecprimscorer; }
void AddElecSecoScorer(G4double elecsecoscorer) { ElecSecoScorer += elecsecoscorer; }
void AddElecSup50Scorer(G4double elecsup50scorer) { ElecSup50Scorer += elecsup50scorer; }
void AddElecTotaScorer(G4double electotascorer) { ElecTotaScorer += electotascorer; }
private:
G4double ElecPrimScorer;
G4double ElecSecoScorer;
G4double ElecTotaScorer;
G4double ElecSup50Scorer;
G4double ElecEneIncPart;
};
#endif
@@ -0,0 +1,106 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//---------------------------------------------------------------------------
//
// ClassName: MicroElecSdSey
//
// Description: The process to kill e- to save CPU
//
// Author: C. Inguimbert 16/02/2022
// ONERA
//----------------------------------------------------------------------------
//
// Class description:
//
// SEY : Secondary Electron Emission Yield
// detecteor to be used to count the number of secondary electrons
// emitted by a surface of irradiated material
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef SD_MicroElecSdSey
#define SD_MicroElecSdSey 1
#include <iostream>
#include <fstream>
#include <vector>
#include "MicroElecHitSey.hh"
#include "globals.hh"
#include "G4Timer.hh"
#include "G4VSensitiveDetector.hh"
#include "G4GeneralParticleSource.hh"
#include "G4Vector3D.hh"
#include "G4LogicalVolume.hh"
class G4Step;
class G4HCofThisEvent;
class MicroElecSdSey : public G4VSensitiveDetector
{
public:
MicroElecSdSey(const G4String& name,
const G4String& hitsCollectionName);
~MicroElecSdSey();
G4double nbHitsTotal_;
G4double nbHitsTotal_bis;
void Initialize(G4HCofThisEvent*);
G4bool ProcessHits(G4Step*, G4TouchableHistory*);
void EndOfEvent(G4HCofThisEvent*);
G4double GetCompteurPrim() { return compteurPrimaire; };
G4double GetCompteurSec() { return compteurSec; };
G4double GetCompteurTot() { return compteurTot; };
G4double GetCompteur50() { return compteur50; };
void ResetCounters() {
compteurPrimaire = 0; compteurSec = 0; compteurTot = 0; compteur50=0;
}
inline void SetEdep(G4double de) { Sensitive_Detector_Edep = de; };
inline G4double GetEdep() { return Sensitive_Detector_Edep; };
inline void AddEdep(G4double de) { Sensitive_Detector_Edep = Sensitive_Detector_Edep + de; };
private:
G4double compteurPrimaire, compteurSec, compteurTot, compteur50, nbPrim, nbSec, nbSup50;
MicroElecHitSeyCollection* fHitsCollection;
public:
G4bool FileFlag;
G4double Sensitive_Detector_Edep;
};
#endif
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// -------------------------------------------------------------------
// -------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "G4GeneralParticleSource.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
~PrimaryGeneratorAction();
void GeneratePrimaries(G4Event*);
inline G4GeneralParticleSource* GetParticleGPS() { return GPSParticleGun; }
G4double GetEnergy() { return Einc; };
private:
G4GeneralParticleSource* GPSParticleGun;
G4double Einc;
};
#endif
@@ -0,0 +1,95 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// -------------------------------------------------------------------
// -------------------------------------------------------------------
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
#include <iostream>
#include "MicroElecSdSey.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G4Run;
class TrackingAction;
class MicroElecRun;
class RunAction : public G4UserRunAction
{
public:
RunAction();
~RunAction();
void BeginOfRunAction(const G4Run*) override;
void EndOfRunAction(const G4Run*) override;
G4Run* GenerateRun() override;
void SetSEYFileName(G4String& name);
private:
MicroElecRun* fRun;
/////////////////
// Histogramming
void CreateSEYHistogram();
void WriteSEYHistogram();
/////////////////
// Worker
//
void BeginMaster(const G4Run*);
void EndMaster(const G4Run*);
/////////////////
// Worker
//
void InitializeWorker(const G4Run*);
void BeginWorker(const G4Run*);
void EndWorker(const G4Run*);
/////////////////
// Print Info
//
void PrintRunInfo(const G4Run* run);
/////////////////
// Attributes
//
TrackingAction* fpTrackingAction;
G4String fFileName;
bool fInitialized;
bool fDebug;
G4String SEYntupleName, SEYfileName;
G4int NbOfIncidentPart;
G4double EnergyOfIncidentPart;
};
#endif
@@ -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. *
// ********************************************************************
//
// -------------------------------------------------------------------
// -------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef SteppingAction_h
#define SteppingAction_h 1
#include "G4UserSteppingAction.hh"
class RunAction;
class DetectorConstruction;
class PrimaryGeneratorAction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class SteppingAction : public G4UserSteppingAction
{
public:
SteppingAction();
~SteppingAction();
void UserSteppingAction(const G4Step*);
};
#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. *
// ********************************************************************
//
// -------------------------------------------------------------------
// -------------------------------------------------------------------
#ifndef TrackingAction_h
#define TrackingAction_h
#include "G4UserTrackingAction.hh"
#include <map>
class G4Region;
class G4ParticleDefinition;
class DetectorConstruction;
class TrackingAction : public G4UserTrackingAction
{
public:
TrackingAction(DetectorConstruction* detector = 0);
~TrackingAction();
void PreUserTrackingAction(const G4Track*) override;
void SetDetector(DetectorConstruction* detector)
{
fDetector = detector;
}
std::map<const G4ParticleDefinition*, int>& GetNParticlesCreatedInTarget()
{
return fNParticleInTarget;
}
std::map<const G4ParticleDefinition*, int>& GetNParticlesCreatedInWorld()
{
return fNParticleInWorld;
}
private:
DetectorConstruction* fDetector;
G4Region* fTargetRegion;
std::map<const G4ParticleDefinition*, int> fNParticleInTarget;
std::map<const G4ParticleDefinition*, int> fNParticleInWorld;
};
#endif