1#include "BesEventAction.hh"
3#include "G4TrajectoryContainer.hh"
4#include "G4Trajectory.hh"
5#include "G4VVisManager.hh"
7#include "G4DigiManager.hh"
8#include "BesMdcDigitizer.hh"
9#include "BesTofDigitizer.hh"
10#include "BesMucDigitizer.hh"
11#include "BesEmcDigitizer.hh"
13#include "BesRunAction.hh"
14#include "G4RunManager.hh"
15#include "BesAsciiIO.hh"
16#include "BesMdcHit.hh"
17#include "BesRootIO.hh"
18#include "BesTDSWriter.hh"
19#include "BesTuningIO.hh"
21#include "BesSensitiveManager.hh"
22#include "BesTruthTrack.hh"
23#include "BesTruthVertex.hh"
26#include "GaudiKernel/SvcFactory.h"
27#include "GaudiKernel/ISvcLocator.h"
28#include "GaudiKernel/SmartDataPtr.h"
29#include "GaudiKernel/Bootstrap.h"
33#include "ReadBoostRoot.hh"
34#include "G4UImanager.hh"
37 :m_runAction(runAction)
39 ISvcLocator* svcLocator = Gaudi::svcLocator();
41 StatusCode sc = svcLocator->service(
"RealizationSvc",tmpReal);
44 std::cout <<
" Could not initialize Realization Service in BesEventAction" << std::endl;
49 m_DM = G4DigiManager::GetDMpointer();
54 m_DM->AddNewModule(mdcDM);
59 m_DM->AddNewModule(tofDM);
64 m_DM->AddNewModule(emcDM);
69 m_DM->AddNewModule(mucDM);
82 G4int eventId = evt->GetEventID();
86 G4UImanager* uiMgr = G4UImanager::GetUIpointer();
103 if (G4VVisManager::GetConcreteInstance())
105 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
106 G4int n_trajectories = 0;
107 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
109 for (G4int i=0; i<n_trajectories; i++)
111 G4Trajectory* trj = (G4Trajectory*)
112 ((*(evt->GetTrajectoryContainer()))[i]);
114 trj->DrawTrajectory(50);
168 m_DM->Digitize(
"BesMdcDigitizer");
172 m_DM->Digitize(
"BesTofDigitizer");
176 m_DM->Digitize(
"BesEmcDigitizer");
180 m_DM->Digitize(
"BesMucDigitizer");
void SaveHitAsciiEvents(G4int, const G4Event *)
void SaveAsciiEvents(G4int, const G4Event *)
virtual void EndOfEventAction(const G4Event *)
BesEventAction(BesRunAction *)
virtual void BeginOfEventAction(const G4Event *)
virtual ~BesEventAction()
void SaveHitRootEvent(G4int, const G4Event *)
BesTuningIO * GetTuningIO()
BesTDSWriter * GetTDSWriter()
BesAsciiIO * GetAsciiIO()
void EndOfTruthEvent(const G4Event *)
void BeginOfTruthEvent(const G4Event *)
static BesSensitiveManager * GetSensitiveManager()
void SaveAll(const G4Event *, int)
void GetRootEvent(int evtID)
static G4int GetFormatAR()