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 
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
RunManagerMTWorker::m_theLHCTlinkToken
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_theLHCTlinkToken
Definition: RunManagerMTWorker.h:84
RunManagerMTWorker::m_tls
static thread_local TLSData * m_tls
Definition: RunManagerMTWorker.h:100
RunManagerMTWorker::sensTkDetectors
std::vector< SensitiveTkDetector * > & sensTkDetectors()
Definition: RunManagerMTWorker.cc:412
SimTrackManager
Definition: SimTrackManager.h:35
mps_fire.i
i
Definition: mps_fire.py:355
RunManagerMTWorker::abortRun
void abortRun(bool softAbort=false)
Definition: RunManagerMTWorker.cc:546
EventAction
Definition: EventAction.h:23
G4SimEvent
Definition: G4SimEvent.h:14
RunManagerMTWorker::m_simEvent
G4SimEvent * m_simEvent
Definition: RunManagerMTWorker.h:104
RunManagerMTWorker::resetTLS
static void resetTLS()
Definition: RunManagerMTWorker.cc:188
SensitiveTkDetector
Definition: SensitiveTkDetector.h:8
edm::EDGetTokenT< edm::HepMCProduct >
edm
HLT enums.
Definition: AlignableModifier.h:19
RunManagerMTWorker::m_generator
Generator m_generator
Definition: RunManagerMTWorker.h:82
RunManagerMTWorker::abortEvent
void abortEvent()
Definition: RunManagerMTWorker.cc:529
SteppingAction
Definition: SteppingAction.h:30
RunManagerMTWorker::simEvent
G4SimEvent * simEvent()
Definition: RunManagerMTWorker.h:55
CMSSteppingVerbose
Definition: CMSSteppingVerbose.h:25
RunManagerMTWorker::m_pEventAction
edm::ParameterSet m_pEventAction
Definition: RunManagerMTWorker.h:93
RunManagerMTWorker::Connect
void Connect(RunAction *)
Definition: RunManagerMTWorker.cc:389
RunManagerMTWorker::m_EvtMgrVerbosity
int m_EvtMgrVerbosity
Definition: RunManagerMTWorker.h:89
RunManagerMTWorker::m_pCustomUIsession
edm::ParameterSet m_pCustomUIsession
Definition: RunManagerMTWorker.h:97
RunManagerMTWorker::GetSimTrackManager
SimTrackManager * GetSimTrackManager()
Definition: RunManagerMTWorker.cc:408
RunManagerMTWorker::~RunManagerMTWorker
~RunManagerMTWorker()
Definition: RunManagerMTWorker.cc:169
RunManagerMTWorker::sensCaloDetectors
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
Definition: RunManagerMTWorker.cc:416
TrackingAction
Definition: TrackingAction.h:16
RunManagerMTWorker::m_p
edm::ParameterSet m_p
Definition: RunManagerMTWorker.h:98
SensitiveCaloDetector
Definition: SensitiveCaloDetector.h:10
RunManagerMTWorker::initializeThread
void initializeThread(RunManagerMT &runManagerMaster, const edm::EventSetup &es)
Definition: RunManagerMTWorker.cc:241
RunManagerMTWorker::initializeUserActions
void initializeUserActions()
Definition: RunManagerMTWorker.cc:363
RunManagerMTWorker::m_hasWatchers
bool m_hasWatchers
Definition: RunManagerMTWorker.h:88
Generator.h
Event
RunManagerMTWorker::DumpMagneticField
void DumpMagneticField(const G4Field *, const std::string &) const
Definition: RunManagerMTWorker.cc:590
RunManagerMTWorker::m_pStackingAction
edm::ParameterSet m_pStackingAction
Definition: RunManagerMTWorker.h:94
EDGetToken.h
RunManagerMTWorker::initializeRun
void initializeRun()
Definition: RunManagerMTWorker.cc:425
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RunManagerMTWorker::generateEvent
G4Event * generateEvent(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:554
RunManagerMT
Definition: RunManagerMT.h:55
RunManagerMTWorker::m_pSteppingAction
edm::ParameterSet m_pSteppingAction
Definition: RunManagerMTWorker.h:96
RunManagerMTWorker::terminateRun
void terminateRun()
Definition: RunManagerMTWorker.cc:433
RunAction
Definition: RunAction.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
RunManagerMTWorker::m_pField
edm::ParameterSet m_pField
Definition: RunManagerMTWorker.h:91
ParameterSet
Definition: Functions.h:16
SimProducer
Definition: SimProducer.h:64
RunManagerMTWorker::m_nonBeam
bool m_nonBeam
Definition: RunManagerMTWorker.h:86
RunManagerMTWorker::produce
std::unique_ptr< G4SimEvent > produce(const edm::Event &inpevt, const edm::EventSetup &es, RunManagerMT &runManagerMaster)
Definition: RunManagerMTWorker.cc:451
SimWatcher
Definition: SimWatcher.h:33
RunManagerMTWorker::m_sVerbose
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
Definition: RunManagerMTWorker.h:105
edm::EventSetup
Definition: EventSetup.h:57
RunManagerMTWorker::endRun
void endRun()
Definition: RunManagerMTWorker.cc:214
RunManagerMTWorker::resetGenParticleId
void resetGenParticleId(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:582
RunManagerMTWorker
Definition: RunManagerMTWorker.h:41
Generator
Definition: Generator.h:19
RunManagerMTWorker::m_InToken
edm::EDGetTokenT< edm::HepMCProduct > m_InToken
Definition: RunManagerMTWorker.h:83
RunManagerMTWorker::TLSData
Definition: RunManagerMTWorker.cc:114
RunManagerMTWorker::producers
std::vector< std::shared_ptr< SimProducer > > & producers()
Definition: RunManagerMTWorker.cc:420
RunManagerMTWorker::RunManagerMTWorker
RunManagerMTWorker(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&i)
Definition: RunManagerMTWorker.cc:145
HepMCProduct
RunManagerMTWorker::initializeTLS
void initializeTLS()
Definition: RunManagerMTWorker.cc:216
EventSetup
RunManagerMTWorker::m_pTrackingAction
edm::ParameterSet m_pTrackingAction
Definition: RunManagerMTWorker.h:95
RunManagerMTWorker::dumpMF
static thread_local bool dumpMF
Definition: RunManagerMTWorker.h:102
edm::Event
Definition: Event.h:73
RunManagerMTWorker::m_pUseMagneticField
bool m_pUseMagneticField
Definition: RunManagerMTWorker.h:87
RunID.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
RunManagerMTWorker::m_pRunAction
edm::ParameterSet m_pRunAction
Definition: RunManagerMTWorker.h:92