Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:04:21

0001 #include "SimG4Core/Application/interface/SimRunInterface.h"
0002 #include "SimG4Core/Application/interface/RunManagerMT.h"
0003 #include "SimG4Core/Application/interface/RunManagerMTWorker.h"
0004 #include "SimG4Core/Application/interface/RunAction.h"
0005 #include "SimG4Core/Application/interface/EventAction.h"
0006 #include "SimG4Core/Application/interface/TrackingAction.h"
0007 #include "SimG4Core/Application/interface/SteppingAction.h"
0008 #include "SimG4Core/Notification/interface/TmpSimEvent.h"
0009 
0010 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0011 
0012 SimRunInterface::SimRunInterface(RunManagerMT* runm, bool master)
0013     : m_runManagerMT(runm), m_runManagerMTWorker(nullptr), m_SimTrackManager(nullptr), m_isMaster(master) {}
0014 
0015 SimRunInterface::SimRunInterface(RunManagerMTWorker* runm, bool master)
0016     : m_runManagerMT(nullptr), m_runManagerMTWorker(runm), m_SimTrackManager(nullptr), m_isMaster(master) {
0017   if (m_runManagerMTWorker) {
0018     m_SimTrackManager = m_runManagerMTWorker->getSimTrackManager();
0019   }
0020 }
0021 
0022 void SimRunInterface::setRunManagerMTWorker(RunManagerMTWorker* run) { m_runManagerMTWorker = run; }
0023 
0024 void SimRunInterface::Connect(RunAction* runAction) {
0025   if (m_runManagerMT) {
0026     m_runManagerMT->Connect(runAction);
0027   } else if (m_runManagerMTWorker) {
0028     m_runManagerMTWorker->Connect(runAction);
0029   }
0030 }
0031 
0032 void SimRunInterface::Connect(EventAction* eventAction) {
0033   if (m_runManagerMTWorker) {
0034     m_runManagerMTWorker->Connect(eventAction);
0035   }
0036 }
0037 
0038 void SimRunInterface::Connect(TrackingAction* trackAction) {
0039   if (m_runManagerMTWorker) {
0040     m_runManagerMTWorker->Connect(trackAction);
0041   }
0042 }
0043 
0044 void SimRunInterface::Connect(SteppingAction* stepAction) {
0045   if (m_runManagerMTWorker) {
0046     m_runManagerMTWorker->Connect(stepAction);
0047   }
0048 }
0049 
0050 SimTrackManager* SimRunInterface::GetSimTrackManager() { return m_SimTrackManager; }
0051 
0052 void SimRunInterface::abortEvent() {
0053   if (m_runManagerMTWorker) {
0054     m_runManagerMTWorker->abortEvent();
0055   }
0056 }
0057 
0058 void SimRunInterface::abortRun(bool softAbort) {
0059   if (m_runManagerMTWorker) {
0060     m_runManagerMTWorker->abortRun(softAbort);
0061   }
0062 }
0063 
0064 TmpSimEvent* SimRunInterface::simEvent() {
0065   TmpSimEvent* ptr = nullptr;
0066   if (m_runManagerMTWorker) {
0067     ptr = m_runManagerMTWorker->simEvent();
0068   }
0069   return ptr;
0070 }
0071 
0072 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......