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
@@ -58,14 +58,13 @@ class G4Navigator;
class G4AdjointPrimaryGenerator
{
public:
static G4AdjointPrimaryGenerator* GetInstance();
G4AdjointPrimaryGenerator();
~G4AdjointPrimaryGenerator();
G4AdjointPrimaryGenerator(const G4AdjointPrimaryGenerator&) = delete;
G4AdjointPrimaryGenerator& operator=(const G4AdjointPrimaryGenerator&) = delete;
public:
G4AdjointPrimaryGenerator();
~G4AdjointPrimaryGenerator();
void GenerateAdjointPrimaryVertex(G4Event* anEvt,
G4ParticleDefinition* adj_part,
@@ -81,13 +80,13 @@ class G4AdjointPrimaryGenerator
G4ParticleDefinition* aPDef);
G4double SampleDistanceAlongBackRayAndComputeWeightCorrection(G4double& weight_corr);
private: // attributes
// The class responsible for the random generation of positions
// and direction of primaries for adjoint source set on the external
// surface of a G4 volume
//
//static G4ThreadLocal G4AdjointPrimaryGenerator* theInstance;
G4AdjointPosOnPhysVolGenerator* theG4AdjointPosOnPhysVolGenerator = nullptr;
G4SingleParticleSource* theSingleParticleSource = nullptr;
+6 -1
View File
@@ -282,17 +282,21 @@ class G4Event
private:
G4Event* motherEvent = nullptr;
G4int subEventType = -1;
const G4SubEvent* fSubEvent = nullptr;
public:
void FlagAsSubEvent(G4Event* me, G4int ty)
void FlagAsSubEvent(G4Event* me, G4int ty, const G4SubEvent* se)
{
motherEvent = me;
subEventType = ty;
fSubEvent = se;
}
inline G4Event* GetMotherEvent() const
{ return motherEvent; }
inline G4int GetSubEventType() const
{ return subEventType; }
inline const G4SubEvent* GetSubEvent() const
{ return fSubEvent; }
private:
mutable G4bool scoresRecorded = false;
@@ -302,6 +306,7 @@ class G4Event
G4bool ScoresAlreadyRecorded() const { return scoresRecorded; }
void EventCompleted() const { eventCompleted = true; }
G4bool IsEventCompleted() const { return eventCompleted; }
};
extern G4EVENT_DLL G4Allocator<G4Event>*& anEventAllocator();
+22
View File
@@ -208,6 +208,28 @@ class G4EventManager
G4String randomNumberStatusToG4Event;
G4StateManager* stateManager = nullptr;
//---------------------------------------------------------------
// Following methods and data members are used only by the G4EventManager
// used in the worker thread in Sub-event parallel mode
public:
inline G4Event* RetrieveCompletedSubEvent()
{
G4Event* evt = nullptr;
if(!completedEvents.empty())
{
evt = completedEvents.back();
completedEvents.pop_back();
}
return evt;
}
inline G4int GetNumberOfRemainingSubEvents()
{ return (G4int)processingEvents.size(); }
private:
std::vector<G4Event*> completedEvents;
std::vector<G4Event*> processingEvents;
};
#endif
+6
View File
@@ -75,11 +75,17 @@ class G4SubEvent : public std::vector<G4StackedTrack>
inline void SetEvent(G4Event* evt) { fpEvent = evt; }
inline G4Event* GetEvent() const { return fpEvent; }
// flag if all tracks of this sub-event have been tracked
// and thus ready to be merged to the corresponding event
inline void SetCompleted(G4bool val=true) const { fCompleted = val; }
inline G4bool IsCompleted() const { return fCompleted; }
private:
G4int fSubEventType = -1;
std::size_t fMaxEnt = 1000;
G4Event* fpEvent = nullptr;
mutable G4bool fCompleted = false;
};