// Class: RAT::AuxSimInfo // // Brief: Singleton class to provide interface to exchange information // between PEnergy and G4RunManager // // Author: W. Heintzelman // // REVISION HISTORY: // 11/01/2018 : W Heintzelman - New class // // Detail: Auxiliary event simulations are initiated by PEnergy rather // than by G4RunManager, and hence the currentEvent pointer in // G4RunManager does not point to the auxiliary event. If the // auxiliary Geant simulation must be aborted, G4RunManager needs to // have access to the auxiliary event pointer to set the abort status // and PEnergy must be able to test if the simulation failed. This // class provides the interface to pass that information. // // PEnergy calls SetSimType(true) and SetEventPointer before simulating // an auxiliary event. G4RunManager calls SetSimEvtStatus(false) to // set the event status to failed if the event aborted. // ///////////////////////////////////////////////////////////////////////////// #ifndef __RAT_AuxSimInfo_ #define __RAT_AuxSimInfo_ #include namespace RAT { class AuxSimInfo { public: static AuxSimInfo* GetAuxSimInfo(); // Returns singleton pointer ~AuxSimInfo(); void SetSimType( bool simType ); bool IsAuxSim(); void SetEventPointer( G4Event* evtPtr); G4Event* GetEventPointer(); void SetSimEvtStatus( bool evtStatus); bool IsSimEvtGood(); private: AuxSimInfo(); // private because this is a singleton class static AuxSimInfo* fPtrSelf; // Pointer to singleton of this class bool fSimTypeFlag; // true for an auxiliary simulation G4Event* fEvtPointer; // pointer to auxiliary simulated event bool fEventGood; // true if event simulation was successful }; } #endif