CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunManagerMT.h
Go to the documentation of this file.
1 #ifndef SimG4Core_RunManagerMT_H
2 #define SimG4Core_RunManagerMT_H
3 
4 #include <memory>
10 
12 
17 
20 
21 #include <memory>
22 #include "boost/shared_ptr.hpp"
23 
26 
28 
29 namespace CLHEP {
30  class HepJamesRandom;
31 }
32 
33 namespace sim {
34  class FieldBuilder;
35 }
36 
37 class PrimaryTransformer;
38 class Generator;
39 class PhysicsList;
40 
41 class SimWatcher;
42 class SimProducer;
43 class G4SimEvent;
44 class SimTrackManager;
45 
46 class RunAction;
47 class EventAction;
48 class TrackingAction;
49 class SteppingAction;
50 
51 class DDDWorld;
52 
53 class G4RunManagerKernel;
54 class G4Run;
55 class G4Event;
56 class G4Field;
57 class RunAction;
58 
59 class SimRunInterface;
60 class ExceptionHandler;
61 
62 class RunManagerMT : public RunManager
63 {
64 public:
65 
66  //RunManagerMT(edm::ParameterSet const & p, edm::ConsumesCollector && iC);
68  ~RunManagerMT();
69  void initG4(const edm::EventSetup & es);
70  void initializeUserActions();
71  void initializeRun();
72 
73  void stopG4();
74  void terminateRun();
75  void abortRun(bool softAbort=false);
76  const G4Run * currentRun() const { return m_currentRun; }
77  void produce(edm::Event& inpevt, const edm::EventSetup& es);
78  void abortEvent();
79  const Generator * generator() const { return m_generator; }
80  const G4Event * currentEvent() const { return m_currentEvent; }
81  G4SimEvent * simEvent() { return m_simEvent; }
82  std::vector<SensitiveTkDetector*>& sensTkDetectors() {
83  return m_sensTkDets;
84  }
85  std::vector<SensitiveCaloDetector*>& sensCaloDetectors() {
86  return m_sensCaloDets;
87  }
88  std::vector<boost::shared_ptr<SimProducer> > producers() const {
89  return m_producers;
90  }
91 
93  void Connect(RunAction*);
94  void Connect(EventAction*);
95  void Connect(TrackingAction*);
96  void Connect(SteppingAction*);
97 
98 protected:
99 
100  G4Event * generateEvent( edm::Event& inpevt );
101  void resetGenParticleId( edm::Event& inpevt );
102  void DumpMagneticField( const G4Field*) const;
103 
104 private:
105 
106  G4RunManagerKernel * m_kernel;
107 
110 
111  bool m_nonBeam;
112  std::auto_ptr<PhysicsList> m_physicsList;
118  bool firstRun;
120  G4Run * m_currentRun;
121  G4Event * m_currentEvent;
125 
126  //edm::EDGetTokenT<edm::HepMCProduct> m_HepMC;
127 
132  bool m_check;
143  std::vector<std::string> m_G4Commands;
146 
148  std::vector<SensitiveTkDetector*> m_sensTkDets;
149  std::vector<SensitiveCaloDetector*> m_sensCaloDets;
150 
152  std::vector<boost::shared_ptr<SimWatcher> > m_watchers;
153  std::vector<boost::shared_ptr<SimProducer> > m_producers;
154 
155  std::auto_ptr<SimTrackManager> m_trackManager;
157 
160 
162 
165 };
166 
167 #endif
void Connect(RunAction *)
bool m_managerInitialized
Definition: RunManagerMT.h:114
AttachSD * m_attach
Definition: RunManagerMT.h:147
edm::ParameterSet m_pStackingAction
Definition: RunManagerMT.h:140
G4SimEvent * m_simEvent
Definition: RunManagerMT.h:122
SimTrackManager * GetSimTrackManager()
edm::ParameterSet m_pRunAction
Definition: RunManagerMT.h:138
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition: RunManagerMT.h:159
void initG4(const edm::EventSetup &es)
void abortEvent()
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: RunManagerMT.h:149
edm::ParameterSet m_pGenerator
Definition: RunManagerMT.h:135
void terminateRun()
std::auto_ptr< SimTrackManager > m_trackManager
Definition: RunManagerMT.h:155
void abortRun(bool softAbort=false)
PrimaryTransformer * m_primaryTransformer
Definition: RunManagerMT.h:113
const Generator * generator() const
Definition: RunManagerMT.h:79
ExceptionHandler * m_CustomExceptionHandler
Definition: RunManagerMT.h:145
bool m_runTerminated
Definition: RunManagerMT.h:116
sim::FieldBuilder * m_fieldBuilder
Definition: RunManagerMT.h:156
bool m_runInitialized
Definition: RunManagerMT.h:115
std::vector< std::string > m_G4Commands
Definition: RunManagerMT.h:143
G4Run * m_currentRun
Definition: RunManagerMT.h:120
void initializeUserActions()
Definition: sim.h:19
const G4Run * currentRun() const
Definition: RunManagerMT.h:76
int m_EvtMgrVerbosity
Definition: RunManagerMT.h:131
std::string m_WriteFile
Definition: RunManagerMT.h:164
RunManagerMT(edm::ParameterSet const &p)
std::vector< SensitiveTkDetector * > m_sensTkDets
Definition: RunManagerMT.h:148
Generator * m_generator
Definition: RunManagerMT.h:108
void initializeRun()
G4Event * m_currentEvent
Definition: RunManagerMT.h:121
edm::ParameterSet m_pTrackingAction
Definition: RunManagerMT.h:141
const G4Event * currentEvent() const
Definition: RunManagerMT.h:80
edm::ParameterSet m_pVertexGenerator
Definition: RunManagerMT.h:136
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
Definition: RunManagerMT.h:85
std::vector< boost::shared_ptr< SimProducer > > producers() const
Definition: RunManagerMT.h:88
G4RunManagerKernel * m_kernel
Definition: RunManagerMT.h:106
std::vector< boost::shared_ptr< SimProducer > > m_producers
Definition: RunManagerMT.h:153
bool m_pUseMagneticField
Definition: RunManagerMT.h:119
edm::ParameterSet m_p
Definition: RunManagerMT.h:144
edm::InputTag m_theLHCTlinkTag
Definition: RunManagerMT.h:161
edm::ParameterSet m_pSteppingAction
Definition: RunManagerMT.h:142
std::vector< boost::shared_ptr< SimWatcher > > m_watchers
Definition: RunManagerMT.h:152
void DumpMagneticField(const G4Field *) const
bool m_StorePhysicsTables
Definition: RunManagerMT.h:129
std::auto_ptr< PhysicsList > m_physicsList
Definition: RunManagerMT.h:112
std::string m_FieldFile
Definition: RunManagerMT.h:163
edm::ParameterSet m_pField
Definition: RunManagerMT.h:134
edm::ParameterSet m_pPhysics
Definition: RunManagerMT.h:137
std::string m_InTag
Definition: RunManagerMT.h:109
bool m_RestorePhysicsTables
Definition: RunManagerMT.h:130
edm::ParameterSet m_pEventAction
Definition: RunManagerMT.h:139
edm::ParameterSet m_pGeometry
Definition: RunManagerMT.h:133
std::vector< SensitiveTkDetector * > & sensTkDetectors()
Definition: RunManagerMT.h:82
G4SimEvent * simEvent()
Definition: RunManagerMT.h:81
G4Event * generateEvent(edm::Event &inpevt)
std::string m_PhysicsTablesDir
Definition: RunManagerMT.h:128
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
Definition: RunManagerMT.h:158
RunAction * m_userRunAction
Definition: RunManagerMT.h:123
void produce(edm::Event &inpevt, const edm::EventSetup &es)
void resetGenParticleId(edm::Event &inpevt)
SimRunInterface * m_runInterface
Definition: RunManagerMT.h:124
SimActivityRegistry m_registry
Definition: RunManagerMT.h:151