Public Member Functions | Private Attributes | List of all members
larg4::VisualizationAction Class Reference

#include <VisualizationAction.h>

Inheritance diagram for larg4::VisualizationAction:

Public Member Functions

 VisualizationAction ()
 
virtual ~VisualizationAction ()
 
virtual void BeginOfRunAction (const G4Run *)
 
virtual void EndOfRunAction (const G4Run *)
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
G4double GetTrackEnergyCutoff () const
 Acessors, if we need them: More...
 
void SetTrackEnergyCutoff (const G4double e)
 

Private Attributes

G4double m_energyCutoff
 Don't draw particles with energies less than this cut. More...
 
G4bool m_drawNeutrals
 Whether or not to draw neutral tracks (default is no). More...
 

Detailed Description

Definition at line 37 of file VisualizationAction.h.

Constructor & Destructor Documentation

larg4::VisualizationAction::VisualizationAction ( )

Definition at line 28 of file VisualizationAction.cxx.

29  {
33 
34  }
double VisualizationEnergyCut() const
G4bool m_drawNeutrals
Whether or not to draw neutral tracks (default is no).
static constexpr double GeV
Definition: Units.h:28
G4double m_energyCutoff
Don&#39;t draw particles with energies less than this cut.
bool DrawNeutrals() const
larg4::VisualizationAction::~VisualizationAction ( )
virtual

Definition at line 36 of file VisualizationAction.cxx.

37  {
38  }

Member Function Documentation

void larg4::VisualizationAction::BeginOfEventAction ( const G4Event *  )
virtual

Definition at line 58 of file VisualizationAction.cxx.

59  {}
void larg4::VisualizationAction::BeginOfRunAction ( const G4Run *  )
virtual

Definition at line 40 of file VisualizationAction.cxx.

41  {
42  // If graphics is ON
43  if(G4VVisManager::GetConcreteInstance()){
44  G4cout << "Geant4 visualisation is ON" << G4endl;
45  G4UImanager* UI = G4UImanager::GetUIpointer();
46  UI->ApplyCommand("/tracking/storeTrajectory 1");
47  UI->ApplyCommand("/vis/scene/notifyhandlers");
48  }
49  }
void larg4::VisualizationAction::EndOfEventAction ( const G4Event *  a_event)
virtual

Definition at line 61 of file VisualizationAction.cxx.

62  {
63  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
64 
65  if (pVVisManager)
66  {
67  G4TrajectoryContainer* trajectoryContainer = a_event->GetTrajectoryContainer();
68  G4int n_trajectories = 0;
69  if (trajectoryContainer)
70  n_trajectories = trajectoryContainer->entries();
71 
72  for (G4int i=0; i < n_trajectories; i++)
73  {
74  G4VTrajectory* trajectory = (*trajectoryContainer)[i];
75 
76  // Only draw "interesting" trajectories, according to cuts
77  // and limits set by the user.
78 
79  G4bool drawThisTrack = false;
80  if ( trajectory->GetInitialMomentum().mag() > m_energyCutoff )
81  drawThisTrack = true;
82 
83  if ( ! m_drawNeutrals )
84  {
85  G4double charge = trajectory->GetCharge();
86  // electron-, muon-, and tau-neutrino codes:
87  if ( charge == 0 )
88  drawThisTrack = false;
89  }
90 
91  if ( drawThisTrack )
92  trajectory->DrawTrajectory();
93  //trajectory->DrawTrajectory(50);
94  }
95  }
96  }
G4bool m_drawNeutrals
Whether or not to draw neutral tracks (default is no).
G4double m_energyCutoff
Don&#39;t draw particles with energies less than this cut.
void larg4::VisualizationAction::EndOfRunAction ( const G4Run *  )
virtual

Definition at line 51 of file VisualizationAction.cxx.

52  {
53  // If graphics is ON
54  if (G4VVisManager::GetConcreteInstance())
55  G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
56  }
G4double larg4::VisualizationAction::GetTrackEnergyCutoff ( ) const
inline

Acessors, if we need them:

Definition at line 49 of file VisualizationAction.h.

49 {return m_energyCutoff;}
G4double m_energyCutoff
Don&#39;t draw particles with energies less than this cut.
void larg4::VisualizationAction::SetTrackEnergyCutoff ( const G4double  e)
inline

Definition at line 50 of file VisualizationAction.h.

50 {m_energyCutoff = e;}
const double e
G4double m_energyCutoff
Don&#39;t draw particles with energies less than this cut.

Member Data Documentation

G4bool larg4::VisualizationAction::m_drawNeutrals
private

Whether or not to draw neutral tracks (default is no).

Definition at line 57 of file VisualizationAction.h.

G4double larg4::VisualizationAction::m_energyCutoff
private

Don't draw particles with energies less than this cut.

Definition at line 54 of file VisualizationAction.h.


The documentation for this class was generated from the following files: