GEMC  1.8
Geant4 Monte-Carlo Framework
MHit.cc
Go to the documentation of this file.
1 // %%%%%%%%%%
2 // G4 headers
3 // %%%%%%%%%%
4 #include "G4VVisManager.hh"
5 #include "G4Circle.hh"
6 #include "G4VisAttributes.hh"
7 #include "G4ParticleTable.hh"
8 
9 // %%%%%%%%%%%%%
10 // gemc headers
11 // %%%%%%%%%%%%%
12 #include "MHit.h"
13 
14 MHit::MHit() : G4VHit() {;}
16 
17 void MHit::Draw()
18 {
19  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
20  if(pVVisManager)
21  {
22  G4Circle circle(pos[0]);
23  circle.SetFillStyle(G4Circle::filled);
24  G4Colour colour_touch (0.0, 0.0, 1.0);
25  G4Colour colour_hit (1.0, 0.0, 0.0);
26  G4Colour colour_passby(0.0, 1.0, 0.0);
27 
28  // If the energy is above threshold, red circle.
29  // If the energy is below threshold, blue smaller circle.
30  // If no energy deposited, green smaller circle.
31  if(edep[0] > minEdep)
32  {
33  circle.SetVisAttributes(G4VisAttributes(colour_hit));
34  circle.SetScreenSize(5);
35  }
36  else if(edep[0] > 0 && edep[0] <= minEdep)
37  {
38  circle.SetVisAttributes(G4VisAttributes(colour_touch));
39  circle.SetScreenSize(4);
40  }
41  else if(edep[0] == 0)
42  {
43  circle.SetVisAttributes(G4VisAttributes(colour_passby));
44  circle.SetScreenSize(3);
45  }
46 
47  pVVisManager->Draw(circle);
48  }
49 }
50 
virtual ~MHit()
Definition: MHit.cc:15
void Draw()
Definition: MHit.cc:17
MHit()
Definition: MHit.cc:14