Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Par04Hit Class Reference

Hit class to store energy deposited in the sensitive detector. More...

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par04Hit:
G4VHit

Public Member Functions

 Par04Hit ()
 
 Par04Hit (const Par04Hit &aRight)
 
virtual ~Par04Hit ()
 
const Par04Hitoperator= (const Par04Hit &aRight)
 
int operator== (const Par04Hit &aRight) const
 
void * operator new (size_t)
 
void operator delete (void *aHit)
 
virtual void Draw () final
 Visualise hits.
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs () const final
 Retrieve atributes' names in order to allow filtering.
 
virtual std::vector< G4AttValue > * CreateAttValues () const final
 Create attributes for the visualisation.
 
virtual void Print () final
 Print hit properties.
 
void SetPos (G4ThreeVector aXYZ)
 Set position.
 
G4ThreeVector GetPos () const
 Get position.
 
void SetRot (G4RotationMatrix aXYZ)
 Set rotation.
 
G4RotationMatrix GetRot () const
 Get rotation.
 
void SetEdep (G4double aEdep)
 Set energy.
 
void AddEdep (G4double aEdep)
 Add energy to previous value.
 
G4double GetEdep () const
 Get energy.
 
void SetNdep (G4int aNdep)
 Set number of deposits per hit/cell.
 
void AddNdep (G4int aNdep=1)
 Add number of deposits to previous value, by defualt increment.
 
G4int GetNdep () const
 Get number of deposits per hit/cell.
 
void SetZid (G4int aZ)
 Set Z id of the cell in the readout segmentation.
 
G4int GetZid () const
 Get Z id of the cell in the readout segmentation.
 
void SetRhoId (G4int aRho)
 Set Rho id of the cell in the readout segmentation.
 
G4int GetRhoId () const
 Get rho id of the cell in the readout segmentation.
 
void SetPhiId (G4int aPhi)
 Set phi id of the cell in the readout segmentation.
 
G4int GetPhiId () const
 Get phi id of the cell in the readout segmentation.
 
void SetTime (G4double aTime)
 Set time.
 
G4double GetTime () const
 Get time.
 
void SetType (G4int aType)
 Set type (0 = full sim, 1 = fast sim)
 
G4int GetType () const
 Get type (0 = full sim, 1 = fast sim)
 
void SetLogV (G4LogicalVolume *aLogVol)
 
const G4LogicalVolumeGetLogVol ()
 

Public Attributes

G4double fEdep = 0
 Energy deposit.
 
G4int fNdep = 0
 Counter of deposits in a hit/cell.
 
G4int fZId = -1
 Z ID of readout cell.
 
G4int fRhoId = -1
 Rho ID of readout cell.
 
G4int fPhiId = -1
 Phi ID of readout cell.
 
G4ThreeVector fPos = { -1, -1, -1 }
 Position.
 
G4RotationMatrix fRot
 Rotation.
 
G4double fTime = -1
 Time.
 
G4int fType = -1
 Type: 0 = full sim, 1 = fast sim.
 
G4LogicalVolumefLogVol = nullptr
 Pointer to logical volume for visualisation.
 

Detailed Description

Hit class to store energy deposited in the sensitive detector.

Hit class registers position and energy deposited within the sensitive detector. Cell ID is stored using identifiers of readout segmentation (z, phi, rho). Additionally, pointer to cell logical volume, its position and rotation are saved for visualisation purposes. Time allows to filter hits in visualisation. Type of hit allows to distinguish between hits originating from full simulation (type 0) and fast simulation (type 1).

Definition at line 83 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par04Hit() [1/2]

Par04Hit::Par04Hit ( )

Definition at line 53 of file Par04Hit.cc.

54 : G4VHit()
55{}

◆ Par04Hit() [2/2]

Par04Hit::Par04Hit ( const Par04Hit aRight)

Definition at line 63 of file Par04Hit.cc.

64 : G4VHit()
65{
66 fEdep = aRight.fEdep;
67 fNdep = aRight.fNdep;
68 fZId = aRight.fZId;
69 fRhoId = aRight.fRhoId;
70 fPhiId = aRight.fPhiId;
71 fTime = aRight.fTime;
72 fPos = aRight.fPos;
73 fRot = aRight.fRot;
74 fType = aRight.fType;
75 fLogVol = aRight.fLogVol;
76}
G4int fZId
Z ID of readout cell.
Definition Par04Hit.hh:128
G4double fTime
Time.
Definition Par04Hit.hh:138
G4int fPhiId
Phi ID of readout cell.
Definition Par04Hit.hh:132
G4int fRhoId
Rho ID of readout cell.
Definition Par04Hit.hh:130
G4int fNdep
Counter of deposits in a hit/cell.
Definition Par04Hit.hh:126
G4ThreeVector fPos
Position.
Definition Par04Hit.hh:134
G4LogicalVolume * fLogVol
Pointer to logical volume for visualisation.
Definition Par04Hit.hh:142
G4RotationMatrix fRot
Rotation.
Definition Par04Hit.hh:136
G4double fEdep
Energy deposit.
Definition Par04Hit.hh:124
G4int fType
Type: 0 = full sim, 1 = fast sim.
Definition Par04Hit.hh:140

◆ ~Par04Hit()

Par04Hit::~Par04Hit ( )
virtualdefault

Member Function Documentation

◆ operator=()

const Par04Hit & Par04Hit::operator= ( const Par04Hit aRight)

Definition at line 80 of file Par04Hit.cc.

81{
82 fEdep = aRight.fEdep;
83 fNdep = aRight.fNdep;
84 fZId = aRight.fZId;
85 fRhoId = aRight.fRhoId;
86 fPhiId = aRight.fPhiId;
87 fTime = aRight.fTime;
88 fPos = aRight.fPos;
89 fRot = aRight.fRot;
90 fType = aRight.fType;
91 fLogVol = aRight.fLogVol;
92 return *this;
93}

◆ operator==()

int Par04Hit::operator== ( const Par04Hit aRight) const

Definition at line 97 of file Par04Hit.cc.

98{
99 return (fRhoId == aRight.fRhoId && fPhiId == aRight.fPhiId && fZId == aRight.fZId);
100}

◆ operator new()

void * Par04Hit::operator new ( size_t  )
inline

Definition at line 149 of file Par04Hit.hh.

150{
153 return (void*) Par04HitAllocator->MallocSingle();
154}
G4ThreadLocal G4Allocator< Par04Hit > * Par04HitAllocator
Definition Par04Hit.cc:49

◆ operator delete()

void Par04Hit::operator delete ( void *  aHit)
inline

Definition at line 156 of file Par04Hit.hh.

157{
158 Par04HitAllocator->FreeSingle((Par04Hit*) aHit);
159}
Hit class to store energy deposited in the sensitive detector.

◆ Draw()

void Par04Hit::Draw ( )
finalvirtual

Visualise hits.

If pointer to the logical volume was set, cell shape is drawn taking into account proper radial position (taken from fRhoId)

Arbitrary size corresponds to the example macros

Definition at line 104 of file Par04Hit.cc.

105{
106 /// Arbitrary size corresponds to the example macros
107 G4ThreeVector meshSize(2.325 * mm, 2 * CLHEP::pi / 50. * CLHEP::rad, 3.4 * mm);
108 G4int numPhiCells = CLHEP::pi * 2. / meshSize.y();
109 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
110 // Hits can be filtered out in visualisation
111 if(!pVVisManager->FilterHit(*this))
112 return;
113 // Do not plot hits from parallel world
114 if(fType >= 2)
115 return;
116 // Do not draw empty hits
117 if(fEdep <= 0)
118 return;
119 // Do not plot if default values were not changed
120 if(fRhoId == -1 && fZId == -1 && fPhiId == -1)
121 return;
122 if(pVVisManager)
123 {
124 G4Transform3D trans(fRot, fPos);
125 G4VisAttributes attribs;
126 G4Tubs solid("draw", fRhoId * meshSize.x(), (fRhoId + 1) * meshSize.x(), meshSize.z() / 2.,
127 (-numPhiCells / 2. + fPhiId) * meshSize.y(), meshSize.y());
128 // Set colours depending on type of hit (full/fast sim)
129 G4double colR = fType == 0 ? 0 : 1;
130 G4double colG = fType == 0 ? 1 : 0;
131 G4double colB = 0;
132 // Set transparency depending on the energy
133 // Arbitrary formula
134 G4double alpha = 2 * std::log10(fEdep + 1);
135 G4Colour colour(colR, colG, colB, alpha);
136 attribs.SetColour(colour);
137 attribs.SetForceSolid(true);
138 pVVisManager->Draw(solid, attribs, trans);
139 }
140}

◆ GetAttDefs()

const std::map< G4String, G4AttDef > * Par04Hit::GetAttDefs ( ) const
finalvirtual

Retrieve atributes' names in order to allow filtering.

Definition at line 144 of file Par04Hit.cc.

145{
146 G4bool isNew;
147 std::map<G4String, G4AttDef>* store = G4AttDefStore::GetInstance("Par04Hit", isNew);
148 if(isNew)
149 {
150 (*store)["HitType"] = G4AttDef("HitType", "Hit Type", "Physics", "", "G4String");
151 (*store)["Energy"] =
152 G4AttDef("Energy", "Energy Deposited", "Physics", "G4BestUnit", "G4double");
153 (*store)["Time"] = G4AttDef("Time", "Time", "Physics", "G4BestUnit", "G4double");
154 (*store)["Pos"] = G4AttDef("Pos", "Position", "Physics", "G4BestUnit", "G4ThreeVector");
155 }
156 return store;
157}

◆ CreateAttValues()

std::vector< G4AttValue > * Par04Hit::CreateAttValues ( ) const
finalvirtual

Create attributes for the visualisation.

Definition at line 161 of file Par04Hit.cc.

162{
163 std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
164 values->push_back(G4AttValue("HitType", "HadPar04Hit", ""));
165 values->push_back(G4AttValue("Energy", G4BestUnit(fEdep, "Energy"), ""));
166 values->push_back(G4AttValue("Time", G4BestUnit(fTime, "Time"), ""));
167 values->push_back(G4AttValue("Pos", G4BestUnit(fPos, "Length"), ""));
168 return values;
169}

◆ Print()

void Par04Hit::Print ( )
finalvirtual

Print hit properties.

Definition at line 173 of file Par04Hit.cc.

174{
175 std::cout << "\tHit " << fEdep / MeV << " MeV from " << fNdep << " deposits at " << fPos / cm
176 << " cm rotation " << fRot << " (R,phi,z)= (" << fRhoId << ", " << fPhiId
177 << ", " << fZId << "), " << fTime << " ns" << std::endl;
178}

◆ SetPos()

void Par04Hit::SetPos ( G4ThreeVector  aXYZ)
inline

Set position.

Definition at line 78 of file Par04Hit.hh.

78{ fPos = aXYZ; }

◆ GetPos()

G4ThreeVector Par04Hit::GetPos ( ) const
inline

Get position.

Definition at line 80 of file Par04Hit.hh.

80{ return fPos; }

◆ SetRot()

void Par04Hit::SetRot ( G4RotationMatrix  aXYZ)
inline

Set rotation.

Definition at line 82 of file Par04Hit.hh.

82{ fRot = aXYZ; }

◆ GetRot()

G4RotationMatrix Par04Hit::GetRot ( ) const
inline

Get rotation.

Definition at line 84 of file Par04Hit.hh.

84{ return fRot; }

◆ SetEdep()

void Par04Hit::SetEdep ( G4double  aEdep)
inline

Set energy.

Definition at line 86 of file Par04Hit.hh.

86{ fEdep = aEdep; }

◆ AddEdep()

void Par04Hit::AddEdep ( G4double  aEdep)
inline

Add energy to previous value.

Definition at line 88 of file Par04Hit.hh.

88{ fEdep += aEdep; }

◆ GetEdep()

G4double Par04Hit::GetEdep ( ) const
inline

Get energy.

Definition at line 90 of file Par04Hit.hh.

90{ return fEdep; }

◆ SetNdep()

void Par04Hit::SetNdep ( G4int  aNdep)
inline

Set number of deposits per hit/cell.

Definition at line 92 of file Par04Hit.hh.

92{ fNdep = aNdep; }

◆ AddNdep()

void Par04Hit::AddNdep ( G4int  aNdep = 1)
inline

Add number of deposits to previous value, by defualt increment.

Definition at line 94 of file Par04Hit.hh.

94{ fNdep += aNdep; }

◆ GetNdep()

G4int Par04Hit::GetNdep ( ) const
inline

Get number of deposits per hit/cell.

Definition at line 96 of file Par04Hit.hh.

96{ return fNdep; }

◆ SetZid()

void Par04Hit::SetZid ( G4int  aZ)
inline

Set Z id of the cell in the readout segmentation.

Definition at line 98 of file Par04Hit.hh.

98{ fZId = aZ; }

◆ GetZid()

G4int Par04Hit::GetZid ( ) const
inline

Get Z id of the cell in the readout segmentation.

Definition at line 100 of file Par04Hit.hh.

100{ return fZId; }

◆ SetRhoId()

void Par04Hit::SetRhoId ( G4int  aRho)
inline

Set Rho id of the cell in the readout segmentation.

Definition at line 102 of file Par04Hit.hh.

102{ fRhoId = aRho; }

◆ GetRhoId()

G4int Par04Hit::GetRhoId ( ) const
inline

Get rho id of the cell in the readout segmentation.

Definition at line 104 of file Par04Hit.hh.

104{ return fRhoId; }

◆ SetPhiId()

void Par04Hit::SetPhiId ( G4int  aPhi)
inline

Set phi id of the cell in the readout segmentation.

Definition at line 106 of file Par04Hit.hh.

106{ fPhiId = aPhi; }

◆ GetPhiId()

G4int Par04Hit::GetPhiId ( ) const
inline

Get phi id of the cell in the readout segmentation.

Definition at line 108 of file Par04Hit.hh.

108{ return fPhiId; }

◆ SetTime()

void Par04Hit::SetTime ( G4double  aTime)
inline

Set time.

Definition at line 110 of file Par04Hit.hh.

110{ fTime = aTime; }

◆ GetTime()

G4double Par04Hit::GetTime ( ) const
inline

Get time.

Definition at line 112 of file Par04Hit.hh.

112{ return fTime; }

◆ SetType()

void Par04Hit::SetType ( G4int  aType)
inline

Set type (0 = full sim, 1 = fast sim)

Definition at line 114 of file Par04Hit.hh.

114{ fType = aType; }

◆ GetType()

G4int Par04Hit::GetType ( ) const
inline

Get type (0 = full sim, 1 = fast sim)

Definition at line 116 of file Par04Hit.hh.

116{ return fType; }

◆ SetLogV()

void Par04Hit::SetLogV ( G4LogicalVolume aLogVol)
inline

Definition at line 118 of file Par04Hit.hh.

118{ fLogVol = aLogVol; }

◆ GetLogVol()

const G4LogicalVolume * Par04Hit::GetLogVol ( )
inline

Definition at line 120 of file Par04Hit.hh.

120{ return fLogVol; }

Member Data Documentation

◆ fEdep

G4double Par04Hit::fEdep = 0

Energy deposit.

Definition at line 124 of file Par04Hit.hh.

◆ fNdep

G4int Par04Hit::fNdep = 0

Counter of deposits in a hit/cell.

Definition at line 126 of file Par04Hit.hh.

◆ fZId

G4int Par04Hit::fZId = -1

Z ID of readout cell.

Definition at line 128 of file Par04Hit.hh.

◆ fRhoId

G4int Par04Hit::fRhoId = -1

Rho ID of readout cell.

Definition at line 130 of file Par04Hit.hh.

◆ fPhiId

G4int Par04Hit::fPhiId = -1

Phi ID of readout cell.

Definition at line 132 of file Par04Hit.hh.

◆ fPos

G4ThreeVector Par04Hit::fPos = { -1, -1, -1 }

Position.

Definition at line 134 of file Par04Hit.hh.

134{ -1, -1, -1 };

◆ fRot

G4RotationMatrix Par04Hit::fRot

Rotation.

Definition at line 136 of file Par04Hit.hh.

◆ fTime

G4double Par04Hit::fTime = -1

Time.

Definition at line 138 of file Par04Hit.hh.

◆ fType

G4int Par04Hit::fType = -1

Type: 0 = full sim, 1 = fast sim.

Definition at line 140 of file Par04Hit.hh.

◆ fLogVol

G4LogicalVolume* Par04Hit::fLogVol = nullptr

Pointer to logical volume for visualisation.

Definition at line 142 of file Par04Hit.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration