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

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

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par03Hit:
G4VHit

Public Member Functions

 Par03Hit ()
 
 Par03Hit (const Par03Hit &aRight)
 
virtual ~Par03Hit ()
 
const Par03Hitoperator= (const Par03Hit &aRight)
 
int operator== (const Par03Hit &aRight) const
 
void * operator new (size_t)
 
void operator delete (void *aHit)
 
virtual void Draw ()
 Visualise hits.
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs () const
 Retrieve atributes' names in order to allow filtering.
 
virtual std::vector< G4AttValue > * CreateAttValues () const
 Create attributes for the visualisation.
 
virtual void Print ()
 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 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 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
 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 65 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par03Hit() [1/2]

Par03Hit::Par03Hit ( )

Definition at line 41 of file Par03Hit.cc.

42 : G4VHit()
43{}

◆ Par03Hit() [2/2]

Par03Hit::Par03Hit ( const Par03Hit aRight)

Definition at line 51 of file Par03Hit.cc.

52 : G4VHit()
53{
54 fEdep = aRight.fEdep;
55 fZId = aRight.fZId;
56 fRhoId = aRight.fRhoId;
57 fPhiId = aRight.fPhiId;
58 fTime = aRight.fTime;
59 fPos = aRight.fPos;
60 fRot = aRight.fRot;
61 fType = aRight.fType;
62 fLogVol = aRight.fLogVol;
63}
G4ThreeVector fPos
Position.
Definition Par03Hit.hh:121
G4int fPhiId
Phi ID of readout cell.
Definition Par03Hit.hh:119
G4int fType
Type: 0 = full sim, 1 = fast sim.
Definition Par03Hit.hh:127
G4double fEdep
Energy deposit.
Definition Par03Hit.hh:113
G4LogicalVolume * fLogVol
Pointer to logical volume for visualisation.
Definition Par03Hit.hh:129
G4int fRhoId
Rho ID of readout cell.
Definition Par03Hit.hh:117
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

◆ ~Par03Hit()

Par03Hit::~Par03Hit ( )
virtualdefault

Member Function Documentation

◆ operator=()

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

Definition at line 67 of file Par03Hit.cc.

68{
69 fEdep = aRight.fEdep;
70 fZId = aRight.fZId;
71 fRhoId = aRight.fRhoId;
72 fPhiId = aRight.fPhiId;
73 fTime = aRight.fTime;
74 fPos = aRight.fPos;
75 fRot = aRight.fRot;
76 fType = aRight.fType;
77 fLogVol = aRight.fLogVol;
78 return *this;
79}

◆ operator==()

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

Definition at line 83 of file Par03Hit.cc.

84{
85 return (fRhoId == aRight.fRhoId && fPhiId == aRight.fPhiId &&
86 fZId == aRight.fZId);
87}

◆ operator new()

void * Par03Hit::operator new ( size_t  )
inline

Definition at line 136 of file Par03Hit.hh.

137{
140 return (void*) Par03HitAllocator->MallocSingle();
141}
G4ThreadLocal G4Allocator< Par03Hit > * Par03HitAllocator
Definition Par03Hit.cc:39

◆ operator delete()

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

Definition at line 143 of file Par03Hit.hh.

144{
145 Par03HitAllocator->FreeSingle((Par03Hit*) aHit);
146}
Hit class to store energy deposited in the sensitive detector.

◆ Draw()

void Par03Hit::Draw ( )
virtual

Visualise hits.

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

Definition at line 91 of file Par03Hit.cc.

92{
93 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
94 // Hits can be filtered out in visualisation
95 if(!pVVisManager->FilterHit(*this))
96 return;
97 // Do not draw empty hits
98 if(fEdep < 0)
99 return;
100 if(pVVisManager)
101 {
102 G4Transform3D trans(fRot, fPos);
103 G4VisAttributes attribs;
104 // Create default dimensions
105 G4Tubs solid("draw", 0, 1 * cm, 1 * cm, 0, 0.05 * CLHEP::pi);
106 if(fLogVol)
107 {
108 const G4VisAttributes* pVA = fLogVol->GetVisAttributes();
109 if(pVA)
110 attribs = *pVA;
111 // Cannot use directly fLogVol due to rho parametrisation (change of
112 // solid!) Recalculation of radius is needed
113 solid = *dynamic_cast<G4Tubs*>(fLogVol->GetSolid());
114 double dR = solid.GetOuterRadius() - solid.GetInnerRadius();
115 solid.SetInnerRadius(solid.GetInnerRadius() + fRhoId * dR);
116 solid.SetOuterRadius(solid.GetOuterRadius() + fRhoId * dR);
117 }
118 // Set colours depending on type of hit (full/fast sim)
119 G4double colR = fType == 0 ? 0 : 1;
120 G4double colG = fType == 0 ? 1 : 0;
121 G4double colB = 0;
122 G4Colour colour(colR, colG, colB, 0.5);
123 attribs.SetColour(colour);
124 attribs.SetForceSolid(true);
125 pVVisManager->Draw(solid, attribs, trans);
126 }
127}

◆ GetAttDefs()

const std::map< G4String, G4AttDef > * Par03Hit::GetAttDefs ( ) const
virtual

Retrieve atributes' names in order to allow filtering.

Definition at line 131 of file Par03Hit.cc.

132{
133 G4bool isNew;
134 std::map<G4String, G4AttDef>* store =
135 G4AttDefStore::GetInstance("Par03Hit", isNew);
136 if(isNew)
137 {
138 (*store)["HitType"] =
139 G4AttDef("HitType", "Hit Type", "Physics", "", "G4String");
140 (*store)["Energy"] = G4AttDef("Energy", "Energy Deposited", "Physics",
141 "G4BestUnit", "G4double");
142 (*store)["Time"] =
143 G4AttDef("Time", "Time", "Physics", "G4BestUnit", "G4double");
144 (*store)["Pos"] =
145 G4AttDef("Pos", "Position", "Physics", "G4BestUnit", "G4ThreeVector");
146 }
147 return store;
148}

◆ CreateAttValues()

std::vector< G4AttValue > * Par03Hit::CreateAttValues ( ) const
virtual

Create attributes for the visualisation.

Definition at line 152 of file Par03Hit.cc.

153{
154 std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
155 values->push_back(G4AttValue("HitType", "HadPar03Hit", ""));
156 values->push_back(G4AttValue("Energy", G4BestUnit(fEdep, "Energy"), ""));
157 values->push_back(G4AttValue("Time", G4BestUnit(fTime, "Time"), ""));
158 values->push_back(G4AttValue("Pos", G4BestUnit(fPos, "Length"), ""));
159 return values;
160}

◆ Print()

void Par03Hit::Print ( )
virtual

Print hit properties.

Definition at line 164 of file Par03Hit.cc.

165{
166 std::cout << "\tHit " << fEdep / MeV << " MeV at " << fPos / cm
167 << " cm (R,phi,z)= (" << fRhoId << ", " << fPhiId << ", " << fZId
168 << "), " << fTime << " ns" << std::endl;
169}

◆ SetPos()

void Par03Hit::SetPos ( G4ThreeVector  aXYZ)
inline

Set position.

Definition at line 73 of file Par03Hit.hh.

73{ fPos = aXYZ; }

◆ GetPos()

G4ThreeVector Par03Hit::GetPos ( ) const
inline

Get position.

Definition at line 75 of file Par03Hit.hh.

75{ return fPos; }

◆ SetRot()

void Par03Hit::SetRot ( G4RotationMatrix  aXYZ)
inline

Set rotation.

Definition at line 77 of file Par03Hit.hh.

77{ fRot = aXYZ; }

◆ GetRot()

G4RotationMatrix Par03Hit::GetRot ( ) const
inline

Get rotation.

Definition at line 79 of file Par03Hit.hh.

79{ return fRot; }

◆ SetEdep()

void Par03Hit::SetEdep ( G4double  aEdep)
inline

Set energy.

Definition at line 81 of file Par03Hit.hh.

81{ fEdep = aEdep; }

◆ AddEdep()

void Par03Hit::AddEdep ( G4double  aEdep)
inline

Add energy to previous value.

Definition at line 83 of file Par03Hit.hh.

83{ fEdep += aEdep; }

◆ GetEdep()

G4double Par03Hit::GetEdep ( ) const
inline

Get energy.

Definition at line 85 of file Par03Hit.hh.

85{ return fEdep; }

◆ SetZid()

void Par03Hit::SetZid ( G4int  aZ)
inline

Set Z id of the cell in the readout segmentation.

Definition at line 87 of file Par03Hit.hh.

87{ fZId = aZ; }

◆ GetZid()

G4int Par03Hit::GetZid ( ) const
inline

Get Z id of the cell in the readout segmentation.

Definition at line 89 of file Par03Hit.hh.

89{ return fZId; }

◆ SetRhoId()

void Par03Hit::SetRhoId ( G4int  aRho)
inline

Set Rho id of the cell in the readout segmentation.

Definition at line 91 of file Par03Hit.hh.

91{ fRhoId = aRho; }

◆ GetRhoId()

G4int Par03Hit::GetRhoId ( ) const
inline

Get rho id of the cell in the readout segmentation.

Definition at line 93 of file Par03Hit.hh.

93{ return fRhoId; }

◆ SetPhiId()

void Par03Hit::SetPhiId ( G4int  aPhi)
inline

Set phi id of the cell in the readout segmentation.

Definition at line 95 of file Par03Hit.hh.

95{ fPhiId = aPhi; }

◆ GetPhiId()

G4int Par03Hit::GetPhiId ( ) const
inline

Get phi id of the cell in the readout segmentation.

Definition at line 97 of file Par03Hit.hh.

97{ return fPhiId; }

◆ SetTime()

void Par03Hit::SetTime ( G4double  aTime)
inline

Set time.

Definition at line 99 of file Par03Hit.hh.

99{ fTime = aTime; }

◆ GetTime()

G4double Par03Hit::GetTime ( ) const
inline

Get time.

Definition at line 101 of file Par03Hit.hh.

101{ return fTime; }

◆ SetType()

void Par03Hit::SetType ( G4int  aType)
inline

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

Definition at line 103 of file Par03Hit.hh.

103{ fType = aType; }

◆ GetType()

G4int Par03Hit::GetType ( ) const
inline

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

Definition at line 105 of file Par03Hit.hh.

105{ return fType; }

◆ SetLogV()

void Par03Hit::SetLogV ( G4LogicalVolume aLogVol)
inline

Definition at line 107 of file Par03Hit.hh.

107{ fLogVol = aLogVol; }

◆ GetLogVol()

const G4LogicalVolume * Par03Hit::GetLogVol ( )
inline

Definition at line 109 of file Par03Hit.hh.

109{ return fLogVol; }

Member Data Documentation

◆ fEdep

G4double Par03Hit::fEdep = 0

Energy deposit.

Definition at line 113 of file Par03Hit.hh.

◆ fZId

G4int Par03Hit::fZId = -1

Z ID of readout cell.

Definition at line 115 of file Par03Hit.hh.

◆ fRhoId

G4int Par03Hit::fRhoId = -1

Rho ID of readout cell.

Definition at line 117 of file Par03Hit.hh.

◆ fPhiId

G4int Par03Hit::fPhiId = -1

Phi ID of readout cell.

Definition at line 119 of file Par03Hit.hh.

◆ fPos

G4ThreeVector Par03Hit::fPos

Position.

Definition at line 121 of file Par03Hit.hh.

◆ fRot

G4RotationMatrix Par03Hit::fRot

Rotation.

Definition at line 123 of file Par03Hit.hh.

◆ fTime

G4double Par03Hit::fTime = -1

Time.

Definition at line 125 of file Par03Hit.hh.

◆ fType

G4int Par03Hit::fType = -1

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

Definition at line 127 of file Par03Hit.hh.

◆ fLogVol

G4LogicalVolume* Par03Hit::fLogVol = nullptr

Pointer to logical volume for visualisation.

Definition at line 129 of file Par03Hit.hh.


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

Applications | User Support | Publications | Collaboration