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
+14 -2
View File
@@ -1,9 +1,21 @@
# Category gflash History
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
which **must** added in reverse chronological order (newest at the top). It must **not**
be used as a substitute for writing good git commit messages!
which **must** added in reverse chronological order (newest at the top).
It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2022-11-18 Gabriele Cosmo (gflash-V11-00-03)
- Fixed compilation warnings for implicit type conversions on macOS/XCode 14.1.
## 2022-10-07 Gabriele Cosmo (gflash-V11-00-02)
- Fixed compilation warning on Intel/icx compiler for variable set
but not used in GFlashShowerModel::ElectronDoIt().
## 2022-09-07 Makoto Asai (gflash-V11-00-01)
- GFlashHitMaker : making compatible to command-based scorer
co-working with track-V11-00-08
## 2021-12-10 Ben Morgan (gflash-V11-00-00)
- Change to new Markdown History format
@@ -48,6 +48,10 @@
#include "G4GFlashSpot.hh"
#include "G4FastTrack.hh"
class G4Step;
class G4StepPoint;
class G4VProcess;
class GFlashHitMaker
{
public:
@@ -58,6 +62,8 @@ class GFlashHitMaker
void make(GFlashEnergySpot * aSpot, const G4FastTrack * aT );
inline void SetNameOfWorldWithSD(const G4String& aName) {fWorldWithSdName = aName;};
inline void SetProcess(G4VProcess* proc) { fpProcess = proc; }
private:
G4TouchableHandle fTouchableHandle;
@@ -66,6 +72,10 @@ class GFlashHitMaker
/// Name of the world containing the sensitive detector. If empty, default mass world is used.
G4String fWorldWithSdName;
G4Step* fpSpotS;
G4StepPoint* fpSpotP;
G4VProcess* fpProcess = nullptr;
private:
GFlashHitMaker(const GFlashHitMaker & ) {}
@@ -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;