GEMC  2.3
Geant4 Monte-Carlo Framework
Hit.cc
Go to the documentation of this file.
1 // G4 headers
2 #include "G4VVisManager.hh"
3 #include "G4Circle.hh"
4 #include "G4VisAttributes.hh"
5 #include "G4ParticleTable.hh"
6 
7 // gemc headers
8 #include "Hit.h"
9 
11 {
12  // If the energy is above threshold, red circle.
13  // If the energy is below threshold, blue smaller circle.
14  // If no energy deposited, green smaller circle.
15 
16  colour_touch = G4Colour(0.0, 0.0, 1.0);
17  colour_hit = G4Colour(1.0, 0.0, 0.0);
18  colour_passby = G4Colour(0.0, 1.0, 0.0);
19 
20  hasTrigger = 0;
21 }
22 
24 
25 void MHit::Draw()
26 {
27  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
28  if(pVVisManager)
29  {
30  G4Circle circle(pos[0]);
31  circle.SetFillStyle(G4Circle::filled);
32 
33 
34  // summing all energies
35  double Etot = 0;
36  for(unsigned int i=0; i<edep.size(); i++)
37  Etot += edep[i];
38 
39  if(Etot > SID.signalThreshold)
40  {
41  circle.SetVisAttributes(G4VisAttributes(colour_hit));
42  circle.SetScreenSize(5);
43  }
44  else if(Etot > 0 && Etot <= SID.signalThreshold)
45  {
46  circle.SetVisAttributes(G4VisAttributes(colour_touch));
47  circle.SetScreenSize(4);
48  }
49  else if(Etot == 0)
50  {
51  circle.SetVisAttributes(G4VisAttributes(colour_passby));
52  circle.SetScreenSize(3);
53  }
54 
55  pVVisManager->Draw(circle);
56  }
57 }
58 
G4Colour colour_touch
Definition: Hit.h:32
virtual ~MHit()
Definition: Hit.cc:23
G4Colour colour_passby
Definition: Hit.h:32
void Draw()
Definition: Hit.cc:25
G4Colour colour_hit
Definition: Hit.h:32
MHit()
Definition: Hit.cc:10
double signalThreshold
Minimum energy of the hit to be recorded in the output stream.
Definition: sensitiveID.h:30