ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimSilGeantHit.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 ActarSimSilGeantHit
11 /// A Geant Hit in the Silicon volume. It represents
12 /// the information of each step with energy deposited.
13 /////////////////////////////////////////////////////////////////
14 
15 #include "ActarSimSilGeantHit.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<ActarSimSilGeantHit> ActarSimSilGeantHitAllocator;
26 
27 //////////////////////////////////////////////////////////////////
28 /// Constructor. Nothing to do.
30 }
31 
32 //////////////////////////////////////////////////////////////////
33 /// Destructor. Nothing to do.
35 }
36 
37 //////////////////////////////////////////////////////////////////
38 /// Copy constructor
40  edep = right.edep;
41  eBeforeSil = right.eBeforeSil;
42  eAfterSil = right.eAfterSil;
43  pos = right.pos;
44  prePos = right.prePos;
45  localPos = right.localPos;
46  localPrePos = right.localPrePos;
47  detName = right.detName;
48  postDetName = right.postDetName;
49  preDetName = right.preDetName;
50  detID = right.detID;
51  toF = right.toF;
52  trackID = right.trackID;
53  parentID = right.parentID;
54  particleID = right.particleID;
56  particleMass = right.particleMass;
57 }
58 
59 //////////////////////////////////////////////////////////////////
60 /// Operator =
62  edep = right.edep;
63  eBeforeSil = right.eBeforeSil;
64  eAfterSil = right.eAfterSil;
65  pos = right.pos;
66  prePos = right.prePos;
67  localPos = right.localPos;
68  localPrePos = right.localPrePos;
69  detName = right.detName;
70  postDetName = right.postDetName;
71  preDetName = right.preDetName;
72  detID = right.detID;
73  toF = right.toF;
74  trackID = right.trackID;
75  parentID = right.parentID;
76  particleID = right.particleID;
78  particleMass = right.particleMass;
79 
80  return *this;
81 }
82 
83 //////////////////////////////////////////////////////////////////
84 /// Operator ==
86  return (this==&right) ? 1 : 0;
87 }
88 
89 //////////////////////////////////////////////////////////////////
90 /// Draws the Hit. A clear red point on the Hit position
92  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
93  if(pVVisManager){
94  G4Circle circle(pos);
95  circle.SetScreenSize(4);
96  circle.SetFillStyle(G4Circle::filled);
97  G4Colour colour(1.,0.,0.);
98  G4VisAttributes attribs(colour);
99  circle.SetVisAttributes(attribs);
100  pVVisManager->Draw(circle);
101  }
102 }
103 
104 //////////////////////////////////////////////////////////////////
105 /// Prints full information about the calGeantHit
107  G4cout << "##################################################################"
108  << G4endl
109  << "############### ActarSimSilGeantHit::Print() ###################"
110  << G4endl
111  << "trackID: " << trackID
112  << ", parentID: " << parentID
113  << ", particleID: " << particleID
114  << ", particleCharge: " << particleCharge << G4endl;
115  G4cout << "detID: " << detID
116  << ", detName: " << detName
117  << ", postDetName: " << postDetName
118  << ", preDetName: " << preDetName
119  << G4endl;
120  G4cout << "edep: " << edep / MeV << " MeV"
121  << ", pos: " << pos << " mm" << G4endl
122  << ", prePos: " << prePos << " mm" << G4endl;
123  G4cout << "toF: " << toF / ns << " ns" << ", localPos: " << localPos << " mm"
124  << ", localPrePos: " << localPrePos << " mm" << G4endl;
125  G4cout << "##################################################################"
126  << G4endl;
127 }
G4int operator==(const ActarSimSilGeantHit &) const
Operator ==.
G4int detID
ID (copy) of the detector where the interaction takes place.
G4double eBeforeSil
Energy before entering silicon.
G4ThreeVector localPrePos
Local (for the given detName and detID) coordinates of interaction (postStep)
G4String preDetName
Name of the volume at the following step.
ActarSimSilGeantHit()
Constructor. Nothing to do.
G4Allocator< ActarSimSilGeantHit > ActarSimSilGeantHitAllocator
G4double particleCharge
Particle charge.
G4ThreeVector localPos
Local (for the given detName and detID) coordinates of interaction (postStep)
G4int parentID
Parent ID.
G4String postDetName
Name of the volume at the previous step.
G4double toF
ToF of the interaction (postStep)
G4ThreeVector prePos
PreStep position of the step.
const ActarSimSilGeantHit & operator=(const ActarSimSilGeantHit &)
Operator =.
~ActarSimSilGeantHit()
Destructor. Nothing to do.
G4String detName
Name of the volume where the interaction takes place.
G4double edep
Energy deposited in the step.
G4int particleID
Particle ID.
G4double eAfterSil
Energy when exiting silicon.
G4double particleMass
Particle mass.
void Print()
Prints full information about the calGeantHit.
void Draw()
Draws the Hit. A clear red point on the Hit position.
G4ThreeVector pos
PostStep position of the step.