CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/SimG4Core/Application/interface/EventAction.h

Go to the documentation of this file.
00001 #ifndef SimG4Core_EventAction_H
00002 #define SimG4Core_EventAction_H
00003 
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 
00006 #include "SimG4Core/Application/interface/G4SimEvent.h"
00007 #include "SimG4Core/Application/interface/SimTrackManager.h"
00008 #include "SimG4Core/Notification/interface/TrackWithHistory.h"
00009 #include "SimG4Core/Notification/interface/TrackContainer.h" 
00010 #include "SimG4Core/Notification/interface/SimActivityRegistry.h" 
00011 
00012 #include "G4UserEventAction.hh"
00013 
00014 #include "CLHEP/Vector/LorentzVector.h"
00015 #include "CLHEP/Vector/ThreeVector.h"
00016 
00017 #include <vector>
00018 #include <map>
00019  
00020 class RunManager;
00021 class BeginOfEvent;
00022 class EndOfEvent;
00023  
00024 class EventAction: public G4UserEventAction
00025 {
00026 public:
00027     //EventAction(const edm::ParameterSet & ps);
00028     EventAction(const edm::ParameterSet& ps,
00029                 RunManager*,
00030                 SimTrackManager*);
00031     ~EventAction();
00032     // void SetRunManager( RunManager* rm ) { m_runManager = rm ; return ; }
00033     void BeginOfEventAction(const G4Event * evt);
00034     void EndOfEventAction(const G4Event * evt);
00035 
00036     const TrackContainer * trackContainer() const { 
00037       return m_trackManager->trackContainer();
00038     }
00039     void addTrack(TrackWithHistory* iTrack, bool inHistory, bool withAncestor);
00040     void addTkCaloStateInfo(uint32_t t,std::pair<math::XYZVectorD,math::XYZTLorentzVectorD> p); 
00041     void prepareForNewPrimary() { m_trackManager->cleanTracksWithHistory(); }
00042 
00043     SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal;
00044     SimActivityRegistry::EndOfEventSignal m_endOfEventSignal;
00045 
00046 private:
00047     //does not own the manager
00048     RunManager*      m_runManager;
00049     SimTrackManager* m_trackManager;
00050     std::string m_stopFile;
00051     bool m_debug;
00052 };
00053 
00054 #endif
00055 
00056 
00057