Loading...
Searching...
No Matches
Par03Hit.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26#ifndef PAR03HIT_HH
27#define PAR03HIT_HH
28
29#include "G4VHit.hh"
30#include "G4THitsCollection.hh"
31#include "G4Allocator.hh"
32#include "G4ThreeVector.hh"
33#include "G4RotationMatrix.hh"
34
35class G4AttDef;
36class G4AttValue;
37class G4LogicalVolume;
38
39/**
40 * @brief Hit class to store energy deposited in the sensitive detector.
41 *
42 * Hit class registers position and energy deposited within the sensitive
43 * detector. Cell ID is stored using identifiers of readout segmentation (z,
44 * phi, rho). Additionally, pointer to cell logical volume, its position and
45 * rotation are saved for visualisation purposes. Time allows to filter hits in
46 * visualisation. Type of hit allows to distinguish between hits originating
47 * from full simulation (type 0) and fast simulation (type 1).
48 *
49 */
50
51class Par03Hit : public G4VHit
52{
53 public:
54 Par03Hit();
55 Par03Hit(const Par03Hit& aRight);
56 virtual ~Par03Hit();
57
58 const Par03Hit& operator=(const Par03Hit& aRight);
59 int operator==(const Par03Hit& aRight) const;
60
61 inline void* operator new(size_t);
62 inline void operator delete(void* aHit);
63 /// Visualise hits. If pointer to the logical volume was set, cell shape is
64 /// drawn taking into account proper radial position (taken from fRhoId)
65 virtual void Draw();
66 /// Retrieve atributes' names in order to allow filtering
67 virtual const std::map<G4String, G4AttDef>* GetAttDefs() const;
68 /// Create attributes for the visualisation.
69 virtual std::vector<G4AttValue>* CreateAttValues() const;
70 /// Print hit properties.
71 virtual void Print();
72 /// Set position
73 inline void SetPos(G4ThreeVector aXYZ) { fPos = aXYZ; }
74 /// Get position
75 inline G4ThreeVector GetPos() const { return fPos; }
76 /// Set rotation
77 inline void SetRot(G4RotationMatrix aXYZ) { fRot = aXYZ; }
78 /// Get rotation
79 inline G4RotationMatrix GetRot() const { return fRot; }
80 /// Set energy
81 inline void SetEdep(G4double aEdep) { fEdep = aEdep; }
82 /// Add energy to previous value
83 inline void AddEdep(G4double aEdep) { fEdep += aEdep; }
84 /// Get energy
85 inline G4double GetEdep() const { return fEdep; }
86 /// Set Z id of the cell in the readout segmentation
87 inline void SetZid(G4int aZ) { fZId = aZ; }
88 /// Get Z id of the cell in the readout segmentation
89 inline G4int GetZid() const { return fZId; }
90 /// Set Rho id of the cell in the readout segmentation
91 inline void SetRhoId(G4int aRho) { fRhoId = aRho; }
92 /// Get rho id of the cell in the readout segmentation
93 inline G4int GetRhoId() const { return fRhoId; }
94 /// Set phi id of the cell in the readout segmentation
95 inline void SetPhiId(G4int aPhi) { fPhiId = aPhi; }
96 /// Get phi id of the cell in the readout segmentation
97 inline G4int GetPhiId() const { return fPhiId; }
98 /// Set time
99 inline void SetTime(G4double aTime) { fTime = aTime; }
100 /// Get time
101 inline G4double GetTime() const { return fTime; }
102 /// Set type (0 = full sim, 1 = fast sim)
103 inline void SetType(G4int aType) { fType = aType; }
104 /// Get type (0 = full sim, 1 = fast sim)
105 inline G4int GetType() const { return fType; }
106 // Set pointer to cell logical volume
107 inline void SetLogV(G4LogicalVolume* aLogVol) { fLogVol = aLogVol; }
108 // Get pointer to cell logical volume
109 inline const G4LogicalVolume* GetLogVol() { return fLogVol; }
110
111 public:
112 /// Energy deposit
113 G4double fEdep = 0;
114 /// Z ID of readout cell
115 G4int fZId = -1;
116 /// Rho ID of readout cell
117 G4int fRhoId = -1;
118 /// Phi ID of readout cell
119 G4int fPhiId = -1;
120 /// Position
121 G4ThreeVector fPos;
122 /// Rotation
123 G4RotationMatrix fRot;
124 /// Time
125 G4double fTime = -1;
126 /// Type: 0 = full sim, 1 = fast sim
127 G4int fType = -1;
128 /// Pointer to logical volume for visualisation
130};
131
133
134extern G4ThreadLocal G4Allocator<Par03Hit>* Par03HitAllocator;
135
136inline void* Par03Hit::operator new(size_t)
137{
140 return (void*) Par03HitAllocator->MallocSingle();
141}
142
143inline void Par03Hit::operator delete(void* aHit)
144{
145 Par03HitAllocator->FreeSingle((Par03Hit*) aHit);
146}
147
148#endif /* PAR03HIT_HH */
G4THitsCollection< Par03Hit > Par03HitsCollection
Definition Par03Hit.hh:132
G4ThreadLocal G4Allocator< Par03Hit > * Par03HitAllocator
Definition Par03Hit.cc:39
Hit class to store energy deposited in the sensitive detector.
virtual void Print()
Print hit properties.
Definition Par03Hit.cc:164
G4int GetRhoId() const
Get rho id of the cell in the readout segmentation.
Definition Par03Hit.hh:93
G4ThreeVector GetPos() const
Get position.
Definition Par03Hit.hh:75
G4ThreeVector fPos
Position.
Definition Par03Hit.hh:121
void SetPhiId(G4int aPhi)
Set phi id of the cell in the readout segmentation.
Definition Par03Hit.hh:95
void SetZid(G4int aZ)
Set Z id of the cell in the readout segmentation.
Definition Par03Hit.hh:87
G4int fPhiId
Phi ID of readout cell.
Definition Par03Hit.hh:119
G4int fType
Type: 0 = full sim, 1 = fast sim.
Definition Par03Hit.hh:127
virtual void Draw()
Visualise hits.
Definition Par03Hit.cc:91
void SetRhoId(G4int aRho)
Set Rho id of the cell in the readout segmentation.
Definition Par03Hit.hh:91
G4double GetTime() const
Get time.
Definition Par03Hit.hh:101
const G4LogicalVolume * GetLogVol()
Definition Par03Hit.hh:109
void SetEdep(G4double aEdep)
Set energy.
Definition Par03Hit.hh:81
void SetType(G4int aType)
Set type (0 = full sim, 1 = fast sim)
Definition Par03Hit.hh:103
G4RotationMatrix GetRot() const
Get rotation.
Definition Par03Hit.hh:79
void SetTime(G4double aTime)
Set time.
Definition Par03Hit.hh:99
G4double fEdep
Energy deposit.
Definition Par03Hit.hh:113
void SetRot(G4RotationMatrix aXYZ)
Set rotation.
Definition Par03Hit.hh:77
G4LogicalVolume * fLogVol
Pointer to logical volume for visualisation.
Definition Par03Hit.hh:129
G4int GetZid() const
Get Z id of the cell in the readout segmentation.
Definition Par03Hit.hh:89
G4int fRhoId
Rho ID of readout cell.
Definition Par03Hit.hh:117
void AddEdep(G4double aEdep)
Add energy to previous value.
Definition Par03Hit.hh:83
G4int GetType() const
Get type (0 = full sim, 1 = fast sim)
Definition Par03Hit.hh:105
G4int GetPhiId() const
Get phi id of the cell in the readout segmentation.
Definition Par03Hit.hh:97
void SetLogV(G4LogicalVolume *aLogVol)
Definition Par03Hit.hh:107
G4double GetEdep() const
Get energy.
Definition Par03Hit.hh:85
G4RotationMatrix fRot
Rotation.
Definition Par03Hit.hh:123
G4double fTime
Time.
Definition Par03Hit.hh:125
G4int fZId
Z ID of readout cell.
Definition Par03Hit.hh:115
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
Retrieve atributes' names in order to allow filtering.
Definition Par03Hit.cc:131
virtual std::vector< G4AttValue > * CreateAttValues() const
Create attributes for the visualisation.
Definition Par03Hit.cc:152
int operator==(const Par03Hit &aRight) const
Definition Par03Hit.cc:83
void SetPos(G4ThreeVector aXYZ)
Set position.
Definition Par03Hit.hh:73
const Par03Hit & operator=(const Par03Hit &aRight)
Definition Par03Hit.cc:67
virtual ~Par03Hit()

Applications | User Support | Publications | Collaboration