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  void initializeG4(RunManagerMT* runManagerMaster, const edm::EventSetup& es);
68 
69 private:
70  void initializeTLS();
71  void initializeUserActions();
72 
73  void initializeRun();
74  void terminateRun();
75 
76  G4Event* generateEvent(const edm::Event& inpevt);
77  void resetGenParticleId(const edm::Event& inpevt);
78 
79  void DumpMagneticField(const G4Field*, const std::string&) const;
80 
81  static void resetTLS();
82 
87 
88  bool m_nonBeam;
93 
102 
103  struct TLSData;
104  static thread_local TLSData* m_tls;
105  static thread_local bool dumpMF;
106 
108  std::unique_ptr<CMSSteppingVerbose> m_sVerbose;
109 };
110 
111 #endif
RunManagerMTWorker::m_theLHCTlinkToken
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_theLHCTlinkToken
Definition: RunManagerMTWorker.h:86
RunManagerMTWorker::m_tls
static thread_local TLSData * m_tls
Definition: RunManagerMTWorker.h:103
RunManagerMTWorker::initializeG4
void initializeG4(RunManagerMT *runManagerMaster, const edm::EventSetup &es)
Definition: RunManagerMTWorker.cc:248
RunManagerMTWorker::sensTkDetectors
std::vector< SensitiveTkDetector * > & sensTkDetectors()
Definition: RunManagerMTWorker.cc:421
SimTrackManager
Definition: SimTrackManager.h:35
mps_fire.i
i
Definition: mps_fire.py:428
RunManagerMTWorker::abortRun
void abortRun(bool softAbort=false)
Definition: RunManagerMTWorker.cc:560
EventAction
Definition: EventAction.h:23
G4SimEvent
Definition: G4SimEvent.h:14
RunManagerMTWorker::m_simEvent
G4SimEvent * m_simEvent
Definition: RunManagerMTWorker.h:107
RunManagerMTWorker::resetTLS
static void resetTLS()
Definition: RunManagerMTWorker.cc:192
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:83
RunManagerMTWorker::abortEvent
void abortEvent()
Definition: RunManagerMTWorker.cc:543
RunManagerMTWorker::m_LHCTransport
bool m_LHCTransport
Definition: RunManagerMTWorker.h:91
SteppingAction
Definition: SteppingAction.h:31
RunManagerMTWorker::simEvent
G4SimEvent * simEvent()
Definition: RunManagerMTWorker.h:55
CMSSteppingVerbose
Definition: CMSSteppingVerbose.h:25
RunManagerMTWorker::m_pEventAction
edm::ParameterSet m_pEventAction
Definition: RunManagerMTWorker.h:96
RunManagerMTWorker::Connect
void Connect(RunAction *)
Definition: RunManagerMTWorker.cc:398
RunManagerMTWorker::m_EvtMgrVerbosity
int m_EvtMgrVerbosity
Definition: RunManagerMTWorker.h:92
RunManagerMTWorker::m_pCustomUIsession
edm::ParameterSet m_pCustomUIsession
Definition: RunManagerMTWorker.h:100
RunManagerMTWorker::GetSimTrackManager
SimTrackManager * GetSimTrackManager()
Definition: RunManagerMTWorker.cc:417
RunManagerMTWorker::~RunManagerMTWorker
~RunManagerMTWorker()
Definition: RunManagerMTWorker.cc:177
RunManagerMTWorker::sensCaloDetectors
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
Definition: RunManagerMTWorker.cc:425
TrackingAction
Definition: TrackingAction.h:16
RunManagerMTWorker::m_p
edm::ParameterSet m_p
Definition: RunManagerMTWorker.h:101
SensitiveCaloDetector
Definition: SensitiveCaloDetector.h:10
RunManagerMTWorker::initializeUserActions
void initializeUserActions()
Definition: RunManagerMTWorker.cc:372
RunManagerMTWorker::m_hasWatchers
bool m_hasWatchers
Definition: RunManagerMTWorker.h:90
Generator.h
Event
RunManagerMTWorker::DumpMagneticField
void DumpMagneticField(const G4Field *, const std::string &) const
Definition: RunManagerMTWorker.cc:608
RunManagerMTWorker::m_pStackingAction
edm::ParameterSet m_pStackingAction
Definition: RunManagerMTWorker.h:97
EDGetToken.h
RunManagerMTWorker::initializeRun
void initializeRun()
Definition: RunManagerMTWorker.cc:434
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RunManagerMTWorker::m_LHCToken
edm::EDGetTokenT< edm::HepMCProduct > m_LHCToken
Definition: RunManagerMTWorker.h:85
RunManagerMTWorker::generateEvent
G4Event * generateEvent(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:568
RunManagerMT
Definition: RunManagerMT.h:55
RunManagerMTWorker::m_pSteppingAction
edm::ParameterSet m_pSteppingAction
Definition: RunManagerMTWorker.h:99
RunManagerMTWorker::terminateRun
void terminateRun()
Definition: RunManagerMTWorker.cc:444
RunAction
Definition: RunAction.h:15
edm::ParameterSet
Definition: ParameterSet.h:47
RunManagerMTWorker::m_pField
edm::ParameterSet m_pField
Definition: RunManagerMTWorker.h:94
ParameterSet
Definition: Functions.h:16
SimProducer
Definition: SimProducer.h:64
RunManagerMTWorker::m_nonBeam
bool m_nonBeam
Definition: RunManagerMTWorker.h:88
RunManagerMTWorker::produce
std::unique_ptr< G4SimEvent > produce(const edm::Event &inpevt, const edm::EventSetup &es, RunManagerMT &runManagerMaster)
Definition: RunManagerMTWorker.cc:465
SimWatcher
Definition: SimWatcher.h:33
RunManagerMTWorker::m_sVerbose
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
Definition: RunManagerMTWorker.h:108
edm::EventSetup
Definition: EventSetup.h:57
RunManagerMTWorker::endRun
void endRun()
Definition: RunManagerMTWorker.cc:217
RunManagerMTWorker::resetGenParticleId
void resetGenParticleId(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:600
RunManagerMTWorker
Definition: RunManagerMTWorker.h:41
Generator
Definition: Generator.h:19
RunManagerMTWorker::m_InToken
edm::EDGetTokenT< edm::HepMCProduct > m_InToken
Definition: RunManagerMTWorker.h:84
RunManagerMTWorker::TLSData
Definition: RunManagerMTWorker.cc:116
RunManagerMTWorker::producers
std::vector< std::shared_ptr< SimProducer > > & producers()
Definition: RunManagerMTWorker.cc:429
RunManagerMTWorker::RunManagerMTWorker
RunManagerMTWorker(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&i)
Definition: RunManagerMTWorker.cc:147
HepMCProduct
RunManagerMTWorker::initializeTLS
void initializeTLS()
Definition: RunManagerMTWorker.cc:223
EventSetup
RunManagerMTWorker::m_pTrackingAction
edm::ParameterSet m_pTrackingAction
Definition: RunManagerMTWorker.h:98
RunManagerMTWorker::dumpMF
static thread_local bool dumpMF
Definition: RunManagerMTWorker.h:105
edm::Event
Definition: Event.h:73
RunManagerMTWorker::m_pUseMagneticField
bool m_pUseMagneticField
Definition: RunManagerMTWorker.h:89
RunID.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
RunManagerMTWorker::m_pRunAction
edm::ParameterSet m_pRunAction
Definition: RunManagerMTWorker.h:95