CMS 3D CMS Logo

RunManager.h
Go to the documentation of this file.
1 #ifndef SimG4Core_RunManager_H
2 #define SimG4Core_RunManager_H
3 
6 
8 
14 
17 
18 #include <memory>
19 
20 namespace edm {
21  class ParameterSet;
22  class Event;
23  class EventSetup;
24  class ConsumesCollector;
25  class HepMCProduct;
26 } // namespace edm
27 
28 class PrimaryTransformer;
29 class Generator;
30 class PhysicsList;
31 
32 class SimWatcher;
33 class SimProducer;
34 class G4SimEvent;
35 class SimTrackManager;
36 
37 class RunAction;
38 class EventAction;
39 class TrackingAction;
40 class SteppingAction;
41 class CMSSteppingVerbose;
42 
43 class DDDWorld;
44 class CustomUIsession;
45 
46 class G4RunManagerKernel;
47 class G4Run;
48 class G4Event;
49 class G4Field;
50 class RunAction;
51 
52 class SimRunInterface;
53 
54 class RunManager {
55 public:
57  ~RunManager();
58  void initG4(const edm::EventSetup& es);
59  void initializeUserActions();
60  void initializeRun();
61 
62  void stopG4();
63  void terminateRun();
64  void abortRun(bool softAbort = false);
65 
66  const G4Run* currentRun() const { return m_currentRun; }
67  void produce(edm::Event& inpevt, const edm::EventSetup& es);
68  void abortEvent();
69  const Generator* generator() const { return m_generator; }
70  const G4Event* currentEvent() const { return m_currentEvent; }
72  std::vector<SensitiveTkDetector*>& sensTkDetectors() { return m_sensTkDets; }
73  std::vector<SensitiveCaloDetector*>& sensCaloDetectors() { return m_sensCaloDets; }
74  std::vector<std::shared_ptr<SimProducer> > producers() const { return m_producers; }
75 
77  void Connect(RunAction*);
78  void Connect(EventAction*);
79  void Connect(TrackingAction*);
80  void Connect(SteppingAction*);
81 
82 protected:
83  G4Event* generateEvent(edm::Event& inpevt);
84  void resetGenParticleId(edm::Event& inpevt);
85  void DumpMagneticField(const G4Field*) const;
86 
87 private:
88  G4RunManagerKernel* m_kernel;
89 
91 
94 
95  bool m_nonBeam;
97  std::unique_ptr<PhysicsList> m_physicsList;
99 
104  bool firstRun;
107 
108  G4Run* m_currentRun;
109  G4Event* m_currentEvent;
113 
119  bool m_check;
129  std::vector<std::string> m_G4Commands;
131 
132  std::vector<SensitiveTkDetector*> m_sensTkDets;
133  std::vector<SensitiveCaloDetector*> m_sensCaloDets;
134 
135  std::unique_ptr<CMSSteppingVerbose> m_sVerbose;
137  std::vector<std::shared_ptr<SimWatcher> > m_watchers;
138  std::vector<std::shared_ptr<SimProducer> > m_producers;
139 
140  std::unique_ptr<SimTrackManager> m_trackManager;
141 
144 
148 };
149 
150 #endif
RunManager::m_g4overlap
edm::ParameterSet m_g4overlap
Definition: RunManager.h:128
RunManager::idealGeomRcdWatcher_
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
Definition: RunManager.h:142
SimTrackManager
Definition: SimTrackManager.h:35
mps_fire.i
i
Definition: mps_fire.py:428
RunManager::currentEvent
const G4Event * currentEvent() const
Definition: RunManager.h:70
EventAction
Definition: EventAction.h:23
G4SimEvent
Definition: G4SimEvent.h:14
RunManager::m_pEventAction
edm::ParameterSet m_pEventAction
Definition: RunManager.h:124
SensitiveCaloDetector.h
RunManager::m_sensCaloDets
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: RunManager.h:133
edm::ESWatcher< IdealGeometryRecord >
RunManager::m_sVerbose
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
Definition: RunManager.h:135
DDDWorld
Definition: DDDWorld.h:14
RunManager::m_pPhysics
edm::ParameterSet m_pPhysics
Definition: RunManager.h:122
RunManager::m_primaryTransformer
PrimaryTransformer * m_primaryTransformer
Definition: RunManager.h:98
RunManager::m_sensTkDets
std::vector< SensitiveTkDetector * > m_sensTkDets
Definition: RunManager.h:132
RunManager::m_pSteppingAction
edm::ParameterSet m_pSteppingAction
Definition: RunManager.h:127
RunManager::stopG4
void stopG4()
Definition: RunManager.cc:387
edm::EDGetTokenT< edm::HepMCProduct >
edm
HLT enums.
Definition: AlignableModifier.h:19
RunManager::produce
void produce(edm::Event &inpevt, const edm::EventSetup &es)
Definition: RunManager.cc:394
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
RunManager::m_UIsession
CustomUIsession * m_UIsession
Definition: RunManager.h:96
RunManager::m_UseParametrisedEMPhysics
bool m_UseParametrisedEMPhysics
Definition: RunManager.h:117
RunManager::m_runInterface
SimRunInterface * m_runInterface
Definition: RunManager.h:112
RunManager::m_managerInitialized
bool m_managerInitialized
Definition: RunManager.h:100
RunManager::initG4
void initG4(const edm::EventSetup &es)
Definition: RunManager.cc:190
SteppingAction
Definition: SteppingAction.h:31
RunManager::m_runAborted
bool m_runAborted
Definition: RunManager.h:103
CMSSteppingVerbose
Definition: CMSSteppingVerbose.h:25
RunManager::m_userRunAction
RunAction * m_userRunAction
Definition: RunManager.h:111
RunManager::m_currentEvent
G4Event * m_currentEvent
Definition: RunManager.h:109
RunManager::m_runTerminated
bool m_runTerminated
Definition: RunManager.h:102
RunManager::m_pField
edm::ParameterSet m_pField
Definition: RunManager.h:120
RunManager::m_simEvent
G4SimEvent * m_simEvent
Definition: RunManager.h:110
RunManager::m_registry
SimActivityRegistry m_registry
Definition: RunManager.h:136
RunManager::m_physicsList
std::unique_ptr< PhysicsList > m_physicsList
Definition: RunManager.h:97
SensitiveTkDetector.h
RunManager::m_PhysicsTablesDir
std::string m_PhysicsTablesDir
Definition: RunManager.h:114
SimActivityRegistry.h
TrackingAction
Definition: TrackingAction.h:16
PrimaryTransformer
Definition: PrimaryTransformer.h:6
RunManager::Connect
void Connect(RunAction *)
Definition: RunManager.cc:568
RunManager::m_RegionFile
std::string m_RegionFile
Definition: RunManager.h:147
RunManager::DumpMagneticField
void DumpMagneticField(const G4Field *) const
Definition: RunManager.cc:587
RunManager::m_watchers
std::vector< std::shared_ptr< SimWatcher > > m_watchers
Definition: RunManager.h:137
RunManager::m_producers
std::vector< std::shared_ptr< SimProducer > > m_producers
Definition: RunManager.h:138
RunManager::resetGenParticleId
void resetGenParticleId(edm::Event &inpevt)
Definition: RunManager.cc:558
IdealMagneticFieldRecord.h
Event
PhysicsList
Definition: PhysicsList.h:7
RunManager::m_check
bool m_check
Definition: RunManager.h:119
RunManager::m_p
edm::ParameterSet m_p
Definition: RunManager.h:130
EDGetToken.h
RunManager::generateEvent
G4Event * generateEvent(edm::Event &inpevt)
Definition: RunManager.cc:423
RunManager::m_G4Commands
std::vector< std::string > m_G4Commands
Definition: RunManager.h:129
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RunManager::m_StorePhysicsTables
bool m_StorePhysicsTables
Definition: RunManager.h:115
RunManager
Definition: RunManager.h:54
RunAction
Definition: RunAction.h:15
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
RunManager::m_trackManager
std::unique_ptr< SimTrackManager > m_trackManager
Definition: RunManager.h:140
SimProducer
Definition: SimProducer.h:64
RunManager::m_LHCtr
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_LHCtr
Definition: RunManager.h:93
RunManager::m_pGenerator
edm::ParameterSet m_pGenerator
Definition: RunManager.h:121
RunManager::m_HepMC
edm::EDGetTokenT< edm::HepMCProduct > m_HepMC
Definition: RunManager.h:92
RunManager::firstRun
bool firstRun
Definition: RunManager.h:104
RunManager::m_runInitialized
bool m_runInitialized
Definition: RunManager.h:101
RunManager::generator
const Generator * generator() const
Definition: RunManager.h:69
IdealGeometryRecord.h
SimWatcher
Definition: SimWatcher.h:33
edm::EventSetup
Definition: EventSetup.h:57
RunManager::m_pRunAction
edm::ParameterSet m_pRunAction
Definition: RunManager.h:123
RunManager::m_FieldFile
std::string m_FieldFile
Definition: RunManager.h:145
RunManager::GetSimTrackManager
SimTrackManager * GetSimTrackManager()
Definition: RunManager.cc:566
AttachSD.h
RunManager::m_RestorePhysicsTables
bool m_RestorePhysicsTables
Definition: RunManager.h:116
RunManager::RunManager
RunManager(edm::ParameterSet const &p, edm::ConsumesCollector &&i)
Definition: RunManager.cc:117
RunManager::terminateRun
void terminateRun()
Definition: RunManager.cc:523
Generator
Definition: Generator.h:19
RunManager::sensCaloDetectors
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
Definition: RunManager.h:73
SimActivityRegistry
Definition: SimActivityRegistry.h:43
RunManager::m_EvtMgrVerbosity
int m_EvtMgrVerbosity
Definition: RunManager.h:118
CustomUIsession
Definition: CustomUIsession.h:13
SensitiveDetector.h
RunManager::m_pTrackingAction
edm::ParameterSet m_pTrackingAction
Definition: RunManager.h:126
ESWatcher.h
RunManager::idealMagRcdWatcher_
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition: RunManager.h:143
RunManager::m_kernel
G4RunManagerKernel * m_kernel
Definition: RunManager.h:88
RunManager::m_nonBeam
bool m_nonBeam
Definition: RunManager.h:95
RunManager::initializeUserActions
void initializeUserActions()
Definition: RunManager.cc:477
RunManager::m_pUseMagneticField
bool m_pUseMagneticField
Definition: RunManager.h:105
RunManager::producers
std::vector< std::shared_ptr< SimProducer > > producers() const
Definition: RunManager.h:74
RunManager::sensTkDetectors
std::vector< SensitiveTkDetector * > & sensTkDetectors()
Definition: RunManager.h:72
RunManager::m_pStackingAction
edm::ParameterSet m_pStackingAction
Definition: RunManager.h:125
HepMCProduct
RunManager::m_generator
Generator * m_generator
Definition: RunManager.h:90
EventSetup
RunManager::initializeRun
void initializeRun()
Definition: RunManager.cc:510
edm::Event
Definition: Event.h:73
RunManager::m_hasWatchers
bool m_hasWatchers
Definition: RunManager.h:106
RunManager::m_currentRun
G4Run * m_currentRun
Definition: RunManager.h:108
RunManager::m_WriteFile
std::string m_WriteFile
Definition: RunManager.h:146
RunManager::abortRun
void abortRun(bool softAbort=false)
Definition: RunManager.cc:543
RunManager::simEvent
G4SimEvent * simEvent()
Definition: RunManager.h:71
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
RunManager::currentRun
const G4Run * currentRun() const
Definition: RunManager.h:66
RunManager::abortEvent
void abortEvent()
Definition: RunManager.cc:457
RunManager::~RunManager
~RunManager()
Definition: RunManager.cc:179
SimRunInterface
Definition: SimRunInterface.h:18