Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -32,6 +32,8 @@
#include "G4Step.hh"
#include "G4TouchableHistory.hh"
#include "G4UnitsTable.hh"
#include "G4VSolid.hh"
#include "G4VPVParameterisation.hh"
G4VPrimitiveScorer::G4VPrimitiveScorer(G4String name, G4int depth)
:primitiveName(name),detector(nullptr),filter(nullptr),verboseLevel(0),indexDepth(depth),
@@ -82,3 +84,43 @@ void G4VPrimitiveScorer::CheckAndSetUnit(const G4String& unit,
G4Exception("G4VPrimitiveScorer::CheckAndSetUnit","Det0151",JustWarning,msg);
}
}
G4VSolid* G4VPrimitiveScorer::ComputeSolid(G4Step* aStep, G4int replicaIdx )
{
G4VSolid* solid = nullptr;
G4StepPoint* preStep= aStep->GetPreStepPoint();
auto physVol = preStep->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
if(physParam)
{ // for parameterized volume
if(replicaIdx<0)
{
G4ExceptionDescription desc;
desc << "Incorrect replica number --- GetReplicaNumber : " << replicaIdx << G4endl;
G4Exception("G4VPrimitiveScorer::ComputeSolid","DetPS0001",JustWarning,desc);
// replicaIdx= 0; // You must ensure that it's in range !!!
}
solid = physParam->ComputeSolid(replicaIdx, physVol);
solid->ComputeDimensions(physParam,replicaIdx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
return solid;
}
G4VSolid* G4VPrimitiveScorer::ComputeCurrentSolid(G4Step* aStep )
{
G4StepPoint* preStep= aStep->GetPreStepPoint();
// The only difference: did not know the replica number
G4int replicaIdx = (static_cast<const G4TouchableHistory*>(preStep->GetTouchable()))
->GetReplicaNumber(indexDepth);
return ComputeSolid(aStep, replicaIdx);
}
@@ -110,7 +110,7 @@ G4bool G4VReadOutGeometry::CheckROVolume(G4Step*currentStep,G4TouchableHistory*&
{
ROhist = nullptr;
G4bool incFlg = true;
G4VPhysicalVolume* PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
auto PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
if((fexcludeList)&&(fexcludeList->CheckPV(PV)))
{ incFlg = false; }
else if ((fincludeList)&&(fincludeList->CheckPV(PV)))
@@ -162,7 +162,7 @@ G4bool G4VReadOutGeometry::FindROTouchable(G4Step*currentStep)
// at the safety value only.
// checks if volume is sensitive:
G4VPhysicalVolume* currentVolume = touchableHistory->GetVolume();
auto currentVolume = touchableHistory->GetVolume();
// checks first if a physical volume exists here:
if ( currentVolume )
{