CMS 3D CMS Logo

RunManager.h

Go to the documentation of this file.
00001 #ifndef SimG4Core_RunManager_H
00002 #define SimG4Core_RunManager_H
00003 
00004 #include <memory>
00005 #include "DataFormats/Common/interface/EDProduct.h"
00006 #include "FWCore/Framework/interface/Event.h"
00007 // #include "DataFormats/Common/interface/Handle.h"
00008 #include "DataFormats/Common/interface/Handle.h"
00009 #include "FWCore/Framework/interface/EventSetup.h"
00010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00011 
00012 #include "SimG4Core/SensitiveDetector/interface/AttachSD.h"
00013 #include "SimG4Core/SensitiveDetector/interface/SensitiveDetector.h"
00014 #include "SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h"
00015 #include "SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h"
00016 
00017 #include "SimG4Core/Notification/interface/SimActivityRegistry.h"
00018 
00019 #include <memory>
00020 #include "boost/shared_ptr.hpp"
00021 
00022 namespace CLHEP {
00023   class HepJamesRandom;
00024 }
00025 
00026 namespace sim {
00027    class FieldBuilder;
00028 }
00029 
00030 class PrimaryTransformer;
00031 class Generator;
00032 class PhysicsList;
00033 
00034 class SimWatcher;
00035 class SimProducer;
00036 class G4SimEvent;
00037 class SimTrackManager;
00038 
00039 class DDDWorld;
00040 
00041 class G4RunManagerKernel;
00042 class G4Run;
00043 class G4Event;
00044 class G4UserRunAction;
00045 
00046 class ExceptionHandler ;
00047 
00048 class RunManager
00049 {
00050 public:
00051     RunManager(edm::ParameterSet const & p);
00052     //static RunManager * instance();
00053     //static RunManager * init(edm::ParameterSet const & p); 
00054     virtual ~RunManager();
00055     void initG4(const edm::EventSetup & es);
00056     void initializeUserActions();
00057     void initializeRun();
00058     void terminateRun();
00059     void abortRun(bool softAbort=false);
00060     const G4Run * currentRun() const { return m_currentRun; }
00061     void produce(edm::Event& inpevt, const edm::EventSetup & es);
00062     void abortEvent();
00063     const Generator * generator() const { return m_generator; }
00064     const G4Event * currentEvent() const { return m_currentEvent; }
00065     G4SimEvent * simEvent() { return m_simEvent; }
00066     std::vector<SensitiveTkDetector*>& sensTkDetectors() { return m_sensTkDets; }
00067     std::vector<SensitiveCaloDetector*>& sensCaloDetectors() { return m_sensCaloDets; }
00068 
00069     std::vector<boost::shared_ptr<SimProducer> > producers() const {
00070        return m_producers;
00071     }
00072 protected:
00073     G4Event * generateEvent( edm::Event& inpevt );
00074 private:
00075 
00076     // static RunManager * me;
00077     // explicit RunManager(edm::ParameterSet const & p);
00078     
00079     G4RunManagerKernel * m_kernel;
00080     
00081     Generator * m_generator;
00082     // edm::InputTag m_InTag ;
00083     std::string m_InTag ;
00084     
00085     bool m_nonBeam;
00086     std::auto_ptr<PhysicsList> m_physicsList;
00087     PrimaryTransformer * m_primaryTransformer;
00088     bool m_managerInitialized;
00089     bool m_geometryInitialized;
00090     bool m_physicsInitialized;
00091     bool m_runInitialized;
00092     bool m_runTerminated;
00093     bool m_runAborted;
00094     bool m_pUseMagneticField;
00095     G4Run * m_currentRun;
00096     G4Event * m_currentEvent;
00097     G4SimEvent * m_simEvent;
00098     G4UserRunAction * m_userRunAction;
00099     std::string m_PhysicsTablesDir;
00100     bool m_StorePhysicsTables;
00101     bool m_RestorePhysicsTables;
00102     int m_EvtMgrVerbosity;
00103     bool m_Override;
00104     bool m_check;
00105     edm::ParameterSet m_pGeometry;
00106     edm::ParameterSet m_pField;
00107     edm::ParameterSet m_pGenerator;   
00108     edm::ParameterSet m_pVertexGenerator;
00109     edm::ParameterSet m_pPhysics; 
00110     edm::ParameterSet m_pRunAction;      
00111     edm::ParameterSet m_pEventAction;
00112     edm::ParameterSet m_pStackingAction;
00113     edm::ParameterSet m_pTrackingAction;
00114     edm::ParameterSet m_pSteppingAction;
00115     std::vector<std::string> m_G4Commands;
00116     edm::ParameterSet m_p;
00117     ExceptionHandler* m_CustomExceptionHandler ;
00118 
00119     AttachSD * m_attach;
00120     std::vector<SensitiveTkDetector*> m_sensTkDets;
00121     std::vector<SensitiveCaloDetector*> m_sensCaloDets;
00122 
00123     SimActivityRegistry m_registry;
00124     std::vector<boost::shared_ptr<SimWatcher> > m_watchers;
00125     std::vector<boost::shared_ptr<SimProducer> > m_producers;
00126     
00127     std::auto_ptr<SimTrackManager> m_trackManager;
00128     std::auto_ptr<sim::FieldBuilder> m_fieldBuilder;
00129     
00130 };
00131 
00132 #endif

Generated on Tue Jun 9 17:46:59 2009 for CMSSW by  doxygen 1.5.4