Import Geant4 11.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2024-12-06 11:11:40 +01:00
parent e58e650b32
commit 32390e802b
1984 changed files with 98713 additions and 83996 deletions
@@ -48,81 +48,66 @@
#include "G4GFlashSpot.hh"
#include "G4VSensitiveDetector.hh"
class G4VGFlashSensitiveDetector
class G4VGFlashSensitiveDetector
{
public: // with description
G4VGFlashSensitiveDetector() {}
G4VGFlashSensitiveDetector(const G4VGFlashSensitiveDetector&) {}
// Constructors. The user's concrete class must use one of these
// constructors by the constructor initializer of the derived class.
// The name of the sensitive detector must be the same as for the
// corresponding GG4VSensitiveDetector.
public: // with description
public: // without description
virtual ~G4VGFlashSensitiveDetector() {}
G4VGFlashSensitiveDetector() {}
G4VGFlashSensitiveDetector(const G4VGFlashSensitiveDetector &) {}
// Constructors. The user's concrete class must use one of these
// constructors by the constructor initializer of the derived class.
// The name of the sensitive detector must be the same as for the
// corresponding GG4VSensitiveDetector.
G4bool operator==(const G4VGFlashSensitiveDetector& right) const { return this == &right; }
G4bool operator!=(const G4VGFlashSensitiveDetector& right) const { return this != &right; }
public: // without description
public: // without description
inline G4bool Hit(G4GFlashSpot* aSpot)
{
// This is the public method invoked by GFlashHitMaker for generating
// hits. The actual user's implementation for generating hits must be
// implemented in GenerateHits() virtual protected method.
virtual ~G4VGFlashSensitiveDetector() {}
G4bool operator==(const G4VGFlashSensitiveDetector &right) const
{return this == &right;}
G4bool operator!=(const G4VGFlashSensitiveDetector &right) const
{return this != &right;}
public: // without description
inline G4bool Hit(G4GFlashSpot * aSpot)
{
// This is the public method invoked by GFlashHitMaker for generating
// hits. The actual user's implementation for generating hits must be
// implemented in GenerateHits() virtual protected method.
G4bool result = true;
G4VSensitiveDetector * This
= dynamic_cast<G4VSensitiveDetector *>(this);
if(!This)
{
G4Exception("G4VGFlashSensitiveDetector::Hit()",
"InvalidSetup", FatalException,
"Needs also to inherit from G4VSensitiveDetector!");
return false;
}
if(This->isActive())
{
G4VReadOutGeometry * ROgeometry = 0;
G4TouchableHistory* ROhis = 0;
if(This) ROgeometry = This->GetROgeometry();
if(ROgeometry)
{
// fake pre-step point for touchable from read-out geometry.
G4Step fakeStep;
G4StepPoint * tmpPoint = fakeStep.GetPreStepPoint();
tmpPoint->SetTouchableHandle(aSpot->GetTouchableHandle());
tmpPoint->SetPosition(aSpot->GetPosition());
tmpPoint->SetMomentumDirection(aSpot->GetOriginatorTrack()
->GetPrimaryTrack()->GetMomentumDirection());
result = ROgeometry->CheckROVolume(&fakeStep, ROhis);
}
if(result) result = ProcessHits(aSpot, ROhis);
}
else
{
result = false;
}
return result;
G4bool result = true;
G4VSensitiveDetector* This = dynamic_cast<G4VSensitiveDetector*>(this);
if (!This) {
G4Exception("G4VGFlashSensitiveDetector::Hit()", "InvalidSetup", FatalException,
"Needs also to inherit from G4VSensitiveDetector!");
return false;
}
if (This->isActive()) {
G4VReadOutGeometry* ROgeometry = 0;
G4TouchableHistory* ROhis = 0;
protected: // with description
if (This) ROgeometry = This->GetROgeometry();
if (ROgeometry) {
// fake pre-step point for touchable from read-out geometry.
G4Step fakeStep;
G4StepPoint* tmpPoint = fakeStep.GetPreStepPoint();
tmpPoint->SetTouchableHandle(aSpot->GetTouchableHandle());
tmpPoint->SetPosition(aSpot->GetPosition());
tmpPoint->SetMomentumDirection(
aSpot->GetOriginatorTrack()->GetPrimaryTrack()->GetMomentumDirection());
result = ROgeometry->CheckROVolume(&fakeStep, ROhis);
}
if (result) result = ProcessHits(aSpot, ROhis);
}
else {
result = false;
}
return result;
}
virtual G4bool ProcessHits(G4GFlashSpot*aSpot,
G4TouchableHistory*ROhist) = 0;
// The user MUST implement this method for generating hit(s) from the
// GFlashSpots. Be aware that this method is a protected method and it
// will be invoked by Hit() method of the Base class once the Readout
// geometry that may be associated to the corresponding
// G4VSensitiveDetector was taken into account.
protected: // with description
virtual G4bool ProcessHits(G4GFlashSpot* aSpot, G4TouchableHistory* ROhist) = 0;
// The user MUST implement this method for generating hit(s) from the
// GFlashSpots. Be aware that this method is a protected method and it
// will be invoked by Hit() method of the Base class once the Readout
// geometry that may be associated to the corresponding
// G4VSensitiveDetector was taken into account.
};
#endif