CMS 3D CMS Logo

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 #include <tbb/concurrent_vector.h>
12 
13 namespace edm {
14  class ParameterSet;
15  class Event;
16  class EventSetup;
17  class ConsumesCollector;
18  class HepMCProduct;
19 } // namespace edm
20 class Generator;
21 class RunManagerMT;
22 
23 class G4Event;
24 class G4SimEvent;
25 class G4Run;
26 class SimTrackManager;
27 
28 class RunAction;
29 class EventAction;
30 class TrackingAction;
31 class SteppingAction;
32 class CMSSteppingVerbose;
33 class G4Field;
34 
37 
38 class SimWatcher;
39 class SimProducer;
40 
42 public:
45 
46  void endRun();
47 
48  std::unique_ptr<G4SimEvent> produce(const edm::Event& inpevt,
49  const edm::EventSetup& es,
50  RunManagerMT& runManagerMaster);
51 
52  void abortEvent();
53  void abortRun(bool softAbort = false);
54 
55  inline G4SimEvent* simEvent() { return m_simEvent; }
56 
57  void Connect(RunAction*);
58  void Connect(EventAction*);
59  void Connect(TrackingAction*);
60  void Connect(SteppingAction*);
61 
62  SimTrackManager* GetSimTrackManager();
63  std::vector<SensitiveTkDetector*>& sensTkDetectors();
64  std::vector<SensitiveCaloDetector*>& sensCaloDetectors();
65  std::vector<std::shared_ptr<SimProducer> >& producers();
66 
67 private:
68  void initializeTLS();
69  void initializeThread(RunManagerMT& runManagerMaster, const edm::EventSetup& es);
70  void initializeUserActions();
71 
72  void initializeRun();
73  void terminateRun();
74 
75  G4Event* generateEvent(const edm::Event& inpevt);
76  void resetGenParticleId(const edm::Event& inpevt);
77 
78  void DumpMagneticField(const G4Field*, const std::string&) const;
79 
80  static void resetTLS();
81 
85 
86  bool m_nonBeam;
90 
99 
100  struct TLSData;
101  static thread_local TLSData* m_tls;
102  static thread_local bool dumpMF;
103 
105  std::unique_ptr<CMSSteppingVerbose> m_sVerbose;
106 };
107 
108 #endif
edm::ParameterSet m_pSteppingAction
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
edm::EDGetTokenT< edm::HepMCProduct > m_InToken
G4SimEvent * simEvent()
edm::ParameterSet m_pEventAction
static thread_local bool dumpMF
static thread_local TLSData * m_tls
edm::ParameterSet m_pRunAction
edm::ParameterSet m_pTrackingAction
edm::ParameterSet m_pField
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_theLHCTlinkToken
HLT enums.
edm::ParameterSet m_pCustomUIsession
edm::ParameterSet m_p
edm::ParameterSet m_pStackingAction