CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunManagerMTWorker.h
Go to the documentation of this file.
1 #ifndef SimG4Core_Application_RunManagerMTWorker_H
2 #define SimG4Core_Application_RunManagerMTWorker_H
3 
6 
9 
10 #include <memory>
11 
12 namespace edm {
13  class ParameterSet;
14  class Event;
15  class EventSetup;
16  class ConsumesCollector;
17  class HepMCProduct;
18 }
19 class Generator;
20 class RunManagerMT;
21 
22 class G4Event;
23 class G4SimEvent;
24 class G4Run;
25 class SimTrackManager;
26 
27 class RunAction;
28 class EventAction;
29 class TrackingAction;
30 class SteppingAction;
31 
34 
35 class SimWatcher;
36 class SimProducer;
37 
39 public:
42 
43  void beginRun(const RunManagerMT& runManagerMaster, const edm::EventSetup& es);
44  void endRun();
45 
46  void produce(const edm::Event& inpevt, const edm::EventSetup& es, const RunManagerMT& runManagerMaster);
47 
48  void abortEvent();
49  void abortRun(bool softAbort=false);
50 
51  G4SimEvent * simEvent() { return m_simEvent.get(); }
52  void Connect(RunAction*);
53  void Connect(EventAction*);
54  void Connect(TrackingAction*);
55  void Connect(SteppingAction*);
56 
58  std::vector<SensitiveTkDetector*>& sensTkDetectors();
59  std::vector<SensitiveCaloDetector*>& sensCaloDetectors();
60  std::vector<std::shared_ptr<SimProducer> > producers();
61 
62 private:
63  void initializeTLS();
64  void initializeThread(const RunManagerMT& runManagerMaster, const edm::EventSetup& es);
65  void initializeUserActions();
66 
67  void initializeRun();
68  void terminateRun();
69 
70  G4Event *generateEvent(const edm::Event& inpevt);
71  void resetGenParticleId(const edm::Event& inpevt);
72 
76  const bool m_nonBeam;
77  const bool m_pUseMagneticField;
78  const int m_EvtMgrVerbosity;
87 
88  struct TLSData;
89  static thread_local TLSData *m_tls;
90 
91  std::unique_ptr<G4SimEvent> m_simEvent;
92 };
93 
94 #endif
edm::ParameterSet m_pSteppingAction
int i
Definition: DBlmapReader.cc:9
SimTrackManager * GetSimTrackManager()
void beginRun(const RunManagerMT &runManagerMaster, const edm::EventSetup &es)
edm::EDGetTokenT< edm::HepMCProduct > m_InToken
const bool m_pUseMagneticField
G4SimEvent * simEvent()
edm::ParameterSet m_pEventAction
std::unique_ptr< G4SimEvent > m_simEvent
static thread_local TLSData * m_tls
edm::ParameterSet m_pRunAction
std::vector< SensitiveTkDetector * > & sensTkDetectors()
void resetGenParticleId(const edm::Event &inpevt)
void abortRun(bool softAbort=false)
RunManagerMTWorker(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&i)
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
edm::ParameterSet m_pTrackingAction
edm::ParameterSet m_pField
G4Event * generateEvent(const edm::Event &inpevt)
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_theLHCTlinkToken
void initializeThread(const RunManagerMT &runManagerMaster, const edm::EventSetup &es)
edm::ParameterSet m_pCustomUIsession
std::vector< std::shared_ptr< SimProducer > > producers()
edm::ParameterSet m_p
edm::ParameterSet m_pStackingAction
void Connect(RunAction *)
void produce(const edm::Event &inpevt, const edm::EventSetup &es, const RunManagerMT &runManagerMaster)