CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunManager.h
Go to the documentation of this file.
1 #ifndef SimG4Core_RunManager_H
2 #define SimG4Core_RunManager_H
3 
4 #include <memory>
6 // #include "DataFormats/Common/interface/Handle.h"
11 
16 
18 
19 #include <memory>
20 #include "boost/shared_ptr.hpp"
21 
24 
26 
27 namespace CLHEP {
28  class HepJamesRandom;
29 }
30 
31 namespace sim {
32  class FieldBuilder;
33 }
34 
35 class PrimaryTransformer;
36 class Generator;
37 class PhysicsList;
38 
39 class SimWatcher;
40 class SimProducer;
41 class G4SimEvent;
42 class SimTrackManager;
43 
44 class DDDWorld;
45 
46 class G4RunManagerKernel;
47 class G4Run;
48 class G4Event;
49 class G4UserRunAction;
50 
51 class ExceptionHandler ;
52 
54 {
55 public:
56 
58  ~RunManager();
59  void initG4(const edm::EventSetup & es);
60  void initializeUserActions();
61  void initializeRun();
62  void terminateRun();
63  void abortRun(bool softAbort=false);
64  const G4Run * currentRun() const { return m_currentRun; }
65  void produce(edm::Event& inpevt, const edm::EventSetup& es);
66  void abortEvent();
67  const Generator * generator() const { return m_generator; }
68  const G4Event * currentEvent() const { return m_currentEvent; }
69  G4SimEvent * simEvent() { return m_simEvent; }
70  std::vector<SensitiveTkDetector*>& sensTkDetectors() { return m_sensTkDets; }
71  std::vector<SensitiveCaloDetector*>& sensCaloDetectors() { return m_sensCaloDets; }
72 
73  std::vector<boost::shared_ptr<SimProducer> > producers() const {
74  return m_producers;
75  }
76 protected:
77  G4Event * generateEvent( edm::Event& inpevt );
78 
79  void resetGenParticleId( edm::Event& inpevt );
80 private:
81 
82  G4RunManagerKernel * m_kernel;
83 
86 
87  bool m_nonBeam;
88  std::auto_ptr<PhysicsList> m_physicsList;
91  // bool m_geometryInitialized;
92  // bool m_physicsInitialized;
96  bool firstRun;
98  G4Run * m_currentRun;
99  G4Event * m_currentEvent;
101  G4UserRunAction * m_userRunAction;
106  //bool m_Override;
107  bool m_check;
118  std::vector<std::string> m_G4Commands;
121 
123  std::vector<SensitiveTkDetector*> m_sensTkDets;
124  std::vector<SensitiveCaloDetector*> m_sensCaloDets;
125 
127  std::vector<boost::shared_ptr<SimWatcher> > m_watchers;
128  std::vector<boost::shared_ptr<SimProducer> > m_producers;
129 
130  std::auto_ptr<SimTrackManager> m_trackManager;
132 
135 
137 
139 };
140 
141 #endif
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
Definition: RunManager.h:71
bool m_check
Definition: RunManager.h:107
edm::ParameterSet m_pGenerator
Definition: RunManager.h:110
std::auto_ptr< SimTrackManager > m_trackManager
Definition: RunManager.h:130
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition: RunManager.h:134
G4UserRunAction * m_userRunAction
Definition: RunManager.h:101
G4Event * m_currentEvent
Definition: RunManager.h:99
void abortRun(bool softAbort=false)
Definition: RunManager.cc:469
SimActivityRegistry m_registry
Definition: RunManager.h:126
edm::ParameterSet m_p
Definition: RunManager.h:119
void initializeRun()
Definition: RunManager.cc:438
const G4Event * currentEvent() const
Definition: RunManager.h:68
void initializeUserActions()
Definition: RunManager.cc:401
Generator * m_generator
Definition: RunManager.h:84
bool m_pUseMagneticField
Definition: RunManager.h:97
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
Definition: RunManager.h:133
const Generator * generator() const
Definition: RunManager.h:67
std::vector< SensitiveTkDetector * > & sensTkDetectors()
Definition: RunManager.h:70
Definition: sim.h:19
ExceptionHandler * m_CustomExceptionHandler
Definition: RunManager.h:120
void abortEvent()
Definition: RunManager.cc:367
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: RunManager.h:124
std::vector< SensitiveTkDetector * > m_sensTkDets
Definition: RunManager.h:123
bool m_nonBeam
Definition: RunManager.h:87
int m_EvtMgrVerbosity
Definition: RunManager.h:105
std::auto_ptr< PhysicsList > m_physicsList
Definition: RunManager.h:88
std::string m_WriteFile
Definition: RunManager.h:138
const G4Run * currentRun() const
Definition: RunManager.h:64
bool firstRun
Definition: RunManager.h:96
void terminateRun()
Definition: RunManager.cc:449
bool m_RestorePhysicsTables
Definition: RunManager.h:104
G4Run * m_currentRun
Definition: RunManager.h:98
void resetGenParticleId(edm::Event &inpevt)
Definition: RunManager.cc:479
edm::ParameterSet m_pStackingAction
Definition: RunManager.h:115
edm::ParameterSet m_pEventAction
Definition: RunManager.h:114
bool m_runTerminated
Definition: RunManager.h:94
edm::ParameterSet m_pField
Definition: RunManager.h:109
edm::ParameterSet m_pPhysics
Definition: RunManager.h:112
edm::ParameterSet m_pVertexGenerator
Definition: RunManager.h:111
edm::ParameterSet m_pSteppingAction
Definition: RunManager.h:117
std::vector< boost::shared_ptr< SimProducer > > producers() const
Definition: RunManager.h:73
std::string m_InTag
Definition: RunManager.h:85
G4Event * generateEvent(edm::Event &inpevt)
Definition: RunManager.cc:336
bool m_runInitialized
Definition: RunManager.h:93
G4SimEvent * simEvent()
Definition: RunManager.h:69
AttachSD * m_attach
Definition: RunManager.h:122
PrimaryTransformer * m_primaryTransformer
Definition: RunManager.h:89
sim::FieldBuilder * m_fieldBuilder
Definition: RunManager.h:131
std::string m_PhysicsTablesDir
Definition: RunManager.h:102
bool m_StorePhysicsTables
Definition: RunManager.h:103
edm::ParameterSet m_pGeometry
Definition: RunManager.h:108
std::vector< boost::shared_ptr< SimProducer > > m_producers
Definition: RunManager.h:128
std::vector< boost::shared_ptr< SimWatcher > > m_watchers
Definition: RunManager.h:127
edm::ParameterSet m_pRunAction
Definition: RunManager.h:113
RunManager(edm::ParameterSet const &p)
Definition: RunManager.cc:119
edm::ParameterSet m_pTrackingAction
Definition: RunManager.h:116
std::vector< std::string > m_G4Commands
Definition: RunManager.h:118
G4SimEvent * m_simEvent
Definition: RunManager.h:100
bool m_managerInitialized
Definition: RunManager.h:90
void initG4(const edm::EventSetup &es)
Definition: RunManager.cc:168
edm::InputTag m_theLHCTlinkTag
Definition: RunManager.h:136
G4RunManagerKernel * m_kernel
Definition: RunManager.h:82
bool m_runAborted
Definition: RunManager.h:95
void produce(edm::Event &inpevt, const edm::EventSetup &es)
Definition: RunManager.cc:305