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 }
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 
36 
37 class SimWatcher;
38 class SimProducer;
39 
41 public:
44 
45  void endRun();
46 
47  std::unique_ptr<G4SimEvent>
48  produce(const edm::Event& inpevt, const edm::EventSetup& es, RunManagerMT& runManagerMaster);
49 
50  void abortEvent();
51  void abortRun(bool softAbort=false);
52 
53  inline G4SimEvent * simEvent() { return m_simEvent; }
54 
55  void Connect(RunAction*);
56  void Connect(EventAction*);
57  void Connect(TrackingAction*);
58  void Connect(SteppingAction*);
59 
60  SimTrackManager* GetSimTrackManager();
61  std::vector<SensitiveTkDetector*>& sensTkDetectors();
62  std::vector<SensitiveCaloDetector*>& sensCaloDetectors();
63  std::vector<std::shared_ptr<SimProducer> > producers();
64 
65 private:
66 
67  void initializeTLS();
68  void initializeThread(RunManagerMT& runManagerMaster, const edm::EventSetup& es);
69  void initializeUserActions();
70 
71  void initializeRun();
72  void terminateRun();
73 
74  G4Event *generateEvent(const edm::Event& inpevt);
75  void resetGenParticleId(const edm::Event& inpevt);
76 
80 
81  bool m_nonBeam;
85 
94 
95  struct TLSData;
96  static thread_local TLSData* m_tls;
97  static void resetTLS();
98 
100  std::unique_ptr<CMSSteppingVerbose> m_sVerbose;
101 };
102 
103 #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 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