All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 30 of file VisualizationAction.cxx.

31  {
32  art::ServiceHandle<sim::LArG4Parameters const> lgp;
33  m_energyCutoff = lgp->VisualizationEnergyCut()*CLHEP::GeV;
34  m_drawNeutrals = lgp->DrawNeutrals();
35 
36  }
util::quantities::gigaelectronvolt GeV
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.
larg4::VisualizationAction::~VisualizationAction ( )
virtual

Definition at line 38 of file VisualizationAction.cxx.

39  {
40  }

Member Function Documentation

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

Definition at line 60 of file VisualizationAction.cxx.

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

Definition at line 42 of file VisualizationAction.cxx.

43  {
44  // If graphics is ON
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");
50  }
51  }
void larg4::VisualizationAction::EndOfEventAction ( const G4Event *  a_event)
virtual

Definition at line 63 of file VisualizationAction.cxx.

64  {
65  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
66 
67  if (pVVisManager)
68  {
69  G4TrajectoryContainer* trajectoryContainer = a_event->GetTrajectoryContainer();
70  G4int n_trajectories = 0;
71  if (trajectoryContainer)
72  n_trajectories = trajectoryContainer->entries();
73 
74  for (G4int i=0; i < n_trajectories; i++)
75  {
76  G4VTrajectory* trajectory = (*trajectoryContainer)[i];
77 
78  // Only draw "interesting" trajectories, according to cuts
79  // and limits set by the user.
80 
81  G4bool drawThisTrack = false;
82  if ( trajectory->GetInitialMomentum().mag() > m_energyCutoff )
83  drawThisTrack = true;
84 
85  if ( ! m_drawNeutrals )
86  {
87  G4double charge = trajectory->GetCharge();
88  // electron-, muon-, and tau-neutrino codes:
89  if ( charge == 0 )
90  drawThisTrack = false;
91  }
92 
93  if ( drawThisTrack )
94  trajectory->DrawTrajectory();
95  //trajectory->DrawTrajectory(50);
96  }
97  }
98  }
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 53 of file VisualizationAction.cxx.

54  {
55  // If graphics is ON
56  if (G4VVisManager::GetConcreteInstance())
57  G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
58  }
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;}
do i 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: