Import Geant4 11.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2022-12-09 14:43:28 +01:00
parent c07cea1fe0
commit 9f34590941
3810 changed files with 200490 additions and 182326 deletions
@@ -41,6 +41,8 @@
#include "GFlashHitMaker.hh"
#include "G4GFlashSpot.hh"
#include "G4Step.hh"
#include "G4StepPoint.hh"
GFlashHitMaker::GFlashHitMaker()
{
@@ -48,11 +50,20 @@ GFlashHitMaker::GFlashHitMaker()
fpNavigator = new G4Navigator();
fNaviSetup = false;
fWorldWithSdName = "";
fpSpotS = new G4Step();
fpSpotP = new G4StepPoint();
// N.B. Pre and Post step points are common.
fpSpotS->SetPreStepPoint(fpSpotP);
fpSpotS->SetPostStepPoint(fpSpotP);
}
GFlashHitMaker::~GFlashHitMaker()
{
delete fpNavigator;
delete fpSpotP;
fpSpotS->ResetPreStepPoint();
fpSpotS->ResetPostStepPoint();
delete fpSpotS;
}
void GFlashHitMaker::make(GFlashEnergySpot * aSpot, const G4FastTrack * aT)
@@ -80,13 +91,6 @@ void GFlashHitMaker::make(GFlashEnergySpot * aSpot, const G4FastTrack * aT)
fTouchableHandle());
}
//--------------------------------------
// Fills attribute of the G4Step needed
// by our sensitive detector:
//-------------------------------------
// set spot information:
G4GFlashSpot theSpot(aSpot, aT, fTouchableHandle);
///Navigator
//--------------------------------------
// Produce Hits
// call sensitive part: taken/adapted from the stepping:
@@ -102,21 +106,23 @@ void GFlashHitMaker::make(GFlashEnergySpot * aSpot, const G4FastTrack * aT)
dynamic_cast<G4VGFlashSensitiveDetector * > (pSensitive);
if( gflashSensitive )
{
// set spot information:
G4GFlashSpot theSpot(aSpot, aT, fTouchableHandle);
gflashSensitive->Hit(&theSpot);
}
else if (( pSensitive ) &&
( pCurrentVolume->GetLogicalVolume()->GetFastSimulationManager() )
) // Using gflash without implementing the
// gflashSensitive detector interface -> not allowed!
{
G4cerr << "ERROR - GFlashHitMaker::make()" << G4endl
<< " It is required to implement the "<< G4endl
<< " G4VGFlashSensitiveDetector interface in "<< G4endl
<< " addition to the usual SensitiveDetector class."
<< G4endl;
G4Exception("GFlashHitMaker::make()", "InvalidSetup", FatalException,
"G4VGFlashSensitiveDetector interface not implemented.");
else if( pSensitive )
{
fpSpotS->SetTotalEnergyDeposit(aSpot->GetEnergy());
fpSpotS->SetTrack(const_cast<G4Track*>(aT->GetPrimaryTrack()));
fpSpotP->SetWeight(aT->GetPrimaryTrack()->GetWeight());
fpSpotP->SetPosition(aSpot->GetPosition());
fpSpotP->SetGlobalTime(aT->GetPrimaryTrack()->GetGlobalTime());
fpSpotP->SetLocalTime(aT->GetPrimaryTrack()->GetLocalTime());
fpSpotP->SetProperTime(aT->GetPrimaryTrack()->GetProperTime());
fpSpotP->SetTouchableHandle(fTouchableHandle);
fpSpotP->SetProcessDefinedStep(fpProcess);
fpSpotP->SetStepStatus(fUserDefinedLimit);
pSensitive->Hit(fpSpotS);
}
}
else
@@ -239,8 +239,6 @@ GFlashShowerModel::ElectronDoIt(const G4FastTrack& fastTrack,
G4ThreeVector NewPositionShower = PositionShower;
G4double StepLenght = 0.00;
G4int NSpotDeposited =0;
//--------------------------
/// Begin Longitudinal Loop
//-------------------------
@@ -299,9 +297,8 @@ GFlashShowerModel::ElectronDoIt(const G4FastTrack& fastTrack,
StepLenght = Dz/2.00;
//generate spots & hits:
for (int i = 0; i < DNsp; i++)
for (G4int i = 0; i < DNsp; ++i)
{
NSpotDeposited++;
GFlashEnergySpot Spot;
//Spot energy: the same for all spots
@@ -62,10 +62,10 @@ G4double GVFlashShowerParameterisation::GetEffZ(const G4Material * mat )
// of given material
//
G4double z = 0.;
G4int nofElements = mat->GetNumberOfElements();
G4int nofElements = (G4int)mat->GetNumberOfElements();
if (nofElements > 1)
{
for (G4int i=0; i<nofElements; i++) {
for (G4int i=0; i<nofElements; ++i) {
G4double zOfElement = mat->GetElement(i)->GetZ();
G4double massFraction = mat->GetFractionVector()[i];
// cout << mat->GetElement(i)->GetName()
@@ -85,9 +85,9 @@ G4double GVFlashShowerParameterisation::GetEffA (const G4Material * mat )
// of given material
//
G4double a = 0.;
G4int nofElements = mat->GetNumberOfElements();
G4int nofElements = (G4int)mat->GetNumberOfElements();
if (nofElements > 1) {
for (G4int i=0; i<nofElements; i++) {
for (G4int i=0; i<nofElements; ++i) {
G4double aOfElement = mat->GetElement(i)->GetA()/(g/mole);
G4double massFraction = mat->GetFractionVector()[i];
a += aOfElement*massFraction;