ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimSciGeantHit.cc
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 04/2008
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 //////////////////////////////////////////////////////////////////
10 /// \class ActarSimSciGeantHit
11 /// A Geant Hit in the Scintillator volume. It represents
12 /// the information of each step with energy deposited.
13 /////////////////////////////////////////////////////////////////
14 
15 #include "ActarSimSciGeantHit.hh"
16 #include "G4UnitsTable.hh"
17 #include "G4VVisManager.hh"
18 #include "G4Circle.hh"
19 #include "G4Colour.hh"
20 #include "G4VisAttributes.hh"
21 
22 #include "G4PhysicalConstants.hh"
23 #include "G4SystemOfUnits.hh"
24 
25 G4Allocator<ActarSimSciGeantHit> ActarSimSciGeantHitAllocator;
26 
27 //////////////////////////////////////////////////////////////////
28 /// Constructor. Makes nothing.
30 }
31 
32 //////////////////////////////////////////////////////////////////
33 /// Destructor. Makes nothing.
35 }
36 
37 //////////////////////////////////////////////////////////////////
38 /// Copy constructor
40  edep = right.edep;
41  pos = right.pos;
42  prePos = right.prePos;
43  localPos = right.localPos;
44  localPrePos = right.localPrePos;
45  detName = right.detName;
46  postDetName = right.postDetName;
47  preDetName = right.preDetName;
48  detID = right.detID;
49  toF = right.toF;
50  trackID = right.trackID;
51  parentID = right.parentID;
52  particleID = right.particleID;
54  particleMass = right.particleMass;
55 }
56 
57 //////////////////////////////////////////////////////////////////
58 /// Operator =
60  edep = right.edep;
61  pos = right.pos;
62  prePos = right.prePos;
63  localPos = right.localPos;
64  localPrePos = right.localPrePos;
65  detName = right.detName;
66  postDetName = right.postDetName;
67  preDetName = right.preDetName;
68  detID = right.detID;
69  toF = right.toF;
70  trackID = right.trackID;
71  parentID = right.parentID;
72  particleID = right.particleID;
74  particleMass = right.particleMass;
75 
76  return *this;
77 }
78 
79 //////////////////////////////////////////////////////////////////
80 /// Operator ==
82  return (this==&right) ? 1 : 0;
83 }
84 
85 //////////////////////////////////////////////////////////////////
86 /// Draws the Hit. A clear red point on the Hit position
88  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
89  if(pVVisManager) {
90  G4Circle circle(pos);
91  circle.SetScreenSize(4);
92  circle.SetFillStyle(G4Circle::filled);
93  G4Colour colour(1.,0.,0.);
94  G4VisAttributes attribs(colour);
95  circle.SetVisAttributes(attribs);
96  pVVisManager->Draw(circle);
97  }
98 }
99 
100 //////////////////////////////////////////////////////////////////
101 /// Prints full information about the calGeantHit
103  G4cout << "##################################################################"
104  << G4endl
105  << "############### ActarSimSciGeantHit::Print() ###################" << G4endl
106  << "trackID: " << trackID
107  << ", parentID: " << parentID
108  << ", particleID: " << particleID
109  << ", particleCharge: " << particleCharge << G4endl;
110  G4cout << "detID: " << detID
111  << ", detName: " << detName
112  << ", postDetName: " << postDetName
113  << ", preDetName: " << preDetName
114  << G4endl;
115  G4cout << "edep: " << edep / MeV << " MeV"
116  << ", pos: " << pos << " mm" << G4endl
117  << ", prePos: " << prePos << " mm" << G4endl;
118  G4cout << "toF: " << toF / ns << " ns" << ", localPos: " << localPos << " mm"
119  << ", localPrePos: " << localPrePos << " mm" << G4endl;
120  G4cout << "##################################################################"
121  << G4endl;
122 }
G4ThreeVector localPrePos
Local (for the given detName and detID) coordinates of interaction (preStep)
G4double particleMass
Particle mass.
G4ThreeVector prePos
PreStep position of the step.
G4int operator==(const ActarSimSciGeantHit &) const
Operator ==.
G4String detName
Name of the volume where the interaction takes place.
void Draw()
Draws the Hit. A clear red point on the Hit position.
G4double particleCharge
Particle charge.
void Print()
Prints full information about the calGeantHit.
G4int detID
ID (copy) of the detector where the interaction takes place.
G4ThreeVector pos
PostStep position of the step.
G4int parentID
Particle parent track ID.
G4double toF
ToF of the interaction (postStep)
G4ThreeVector localPos
Local (for the given detName and detID) coordinates of interaction (postStep)
G4String postDetName
Name of the volume at the previous step.
const ActarSimSciGeantHit & operator=(const ActarSimSciGeantHit &)
Operator =.
G4int particleID
Particle trackID.
ActarSimSciGeantHit()
Constructor. Makes nothing.
G4String preDetName
Name of the volume at the following step.
G4int trackID
Particle trackID.
G4double edep
Energy deposited in the step.
G4Allocator< ActarSimSciGeantHit > ActarSimSciGeantHitAllocator
~ActarSimSciGeantHit()
Destructor. Makes nothing.