19 #include "art/Framework/Services/Registry/ServiceHandle.h"
21 #include "Geant4/G4Event.hh"
22 #include "Geant4/G4UImanager.hh"
23 #include "Geant4/G4VVisManager.hh"
24 #include "Geant4/G4TrajectoryContainer.hh"
25 #include "Geant4/G4ios.hh"
32 art::ServiceHandle<sim::LArG4Parameters const> lgp;
45 if(G4VVisManager::GetConcreteInstance()){
46 G4cout <<
"Geant4 visualisation is ON" << G4endl;
47 G4UImanager* UI = G4UImanager::GetUIpointer();
48 UI->ApplyCommand(
"/tracking/storeTrajectory 1");
49 UI->ApplyCommand(
"/vis/scene/notifyhandlers");
56 if (G4VVisManager::GetConcreteInstance())
57 G4UImanager::GetUIpointer()->ApplyCommand(
"/vis/viewer/update");
65 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
69 G4TrajectoryContainer* trajectoryContainer = a_event->GetTrajectoryContainer();
70 G4int n_trajectories = 0;
71 if (trajectoryContainer)
72 n_trajectories = trajectoryContainer->entries();
74 for (G4int i=0; i < n_trajectories; i++)
76 G4VTrajectory* trajectory = (*trajectoryContainer)[i];
81 G4bool drawThisTrack =
false;
87 G4double charge = trajectory->GetCharge();
90 drawThisTrack =
false;
94 trajectory->DrawTrajectory();
util::quantities::gigaelectronvolt GeV
Store parameters for running LArG4.
G4bool m_drawNeutrals
Whether or not to draw neutral tracks (default is no).
virtual void BeginOfEventAction(const G4Event *)
virtual void BeginOfRunAction(const G4Run *)
virtual ~VisualizationAction()
virtual void EndOfEventAction(const G4Event *)
virtual void EndOfRunAction(const G4Run *)
G4double m_energyCutoff
Don't draw particles with energies less than this cut.