#include <G4PSSphereSurfaceCurrent.hh>
Definition at line 58 of file G4PSSphereSurfaceCurrent.hh.
◆ G4PSSphereSurfaceCurrent() [1/2]
G4PSSphereSurfaceCurrent::G4PSSphereSurfaceCurrent |
( |
G4String | name, |
|
|
G4int | direction, |
|
|
G4int | depth = 0 ) |
◆ G4PSSphereSurfaceCurrent() [2/2]
Definition at line 60 of file G4PSSphereSurfaceCurrent.cc.
65 , HCID(-1)
66 , fDirection(direction)
67 , EvtMap(nullptr)
68 , weighted(true)
69 , divideByArea(true)
70{
73}
virtual void DefineUnitAndCategory()
virtual void SetUnit(const G4String &unit)
G4VPrimitiveScorer(G4String name, G4int depth=0)
◆ ~G4PSSphereSurfaceCurrent()
G4PSSphereSurfaceCurrent::~G4PSSphereSurfaceCurrent |
( |
| ) |
|
|
overridedefault |
◆ clear()
void G4PSSphereSurfaceCurrent::clear |
( |
| ) |
|
|
overridevirtual |
◆ DefineUnitAndCategory()
void G4PSSphereSurfaceCurrent::DefineUnitAndCategory |
( |
| ) |
|
|
protectedvirtual |
◆ DivideByArea()
void G4PSSphereSurfaceCurrent::DivideByArea |
( |
G4bool | flg = true | ) |
|
|
inline |
◆ Initialize()
Reimplemented from G4VPrimitiveScorer.
Definition at line 165 of file G4PSSphereSurfaceCurrent.cc.
166{
168 if(HCID < 0)
171}
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4MultiFunctionalDetector * detector
G4int GetCollectionID(G4int)
◆ IsSelectedSurface()
Definition at line 110 of file G4PSSphereSurfaceCurrent.cc.
112{
117
119 {
120
124 G4double localR2 = localpos1.
x() * localpos1.
x() +
125 localpos1.
y() * localpos1.
y() +
126 localpos1.
z() * localpos1.
z();
127
128
129
131 if(localR2 >
133 localR2 <
135 {
137 }
138 }
139
141 {
142
146 G4double localR2 = localpos2.
x() * localpos2.
x() +
147 localpos2.
y() * localpos2.
y() +
148 localpos2.
z() * localpos2.
z();
149
150
151
153 if(localR2 >
155 localR2 <
157 {
159 }
160 }
161
162 return -1;
163}
const G4double kCarTolerance
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
const G4AffineTransform & GetTopTransform() const
G4double GetInnerRadius() const
G4StepStatus GetStepStatus() const
const G4ThreeVector & GetPosition() const
const G4TouchableHandle & GetTouchableHandle() const
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
virtual const G4NavigationHistory * GetHistory() const
Referenced by ProcessHits().
◆ PrintAll()
void G4PSSphereSurfaceCurrent::PrintAll |
( |
| ) |
|
|
overridevirtual |
Reimplemented from G4VPrimitiveScorer.
Definition at line 175 of file G4PSSphereSurfaceCurrent.cc.
176{
180 for(
const auto& [copy, current] : *(EvtMap->
GetMap()))
181 {
182 G4cout <<
" copy no.: " <<
copy <<
" current : ";
183 if(divideByArea)
184 {
186 }
187 else
188 {
189 G4cout << *(current) <<
" [tracks]";
190 }
192 }
193}
G4GLOB_DLL std::ostream G4cout
const G4String & GetUnit() const
G4double GetUnitValue() const
void copy(G4double dst[], const G4double src[], std::size_t size=G4FieldTrack::ncompSVEC)
◆ ProcessHits()
Implements G4VPrimitiveScorer.
Definition at line 75 of file G4PSSphereSurfaceCurrent.cc.
76{
79 assert(
dynamic_cast<G4Sphere*
>(solid) !=
nullptr);
80
81 auto sphereSolid =
static_cast<G4Sphere*
>(solid);
82
84 if(dirFlag > 0)
85 {
87 {
88 G4double radi = sphereSolid->GetInnerRadius();
89 G4double dph = sphereSolid->GetDeltaPhiAngle() / radian;
90 G4double stth = sphereSolid->GetStartThetaAngle() / radian;
91 G4double enth = stth + sphereSolid->GetDeltaThetaAngle() / radian;
93 if(weighted)
95 if(divideByArea)
96 {
98 radi * radi * dph * (-std::cos(enth) + std::cos(stth));
99 current = current / square;
100 }
101
103 EvtMap->
add(index, current);
104 }
105 }
106
107 return true;
108}
G4int IsSelectedSurface(G4Step *, G4Sphere *)
G4double GetWeight() const
virtual G4int GetIndex(G4Step *)
G4VSolid * ComputeCurrentSolid(G4Step *aStep)
size_t add(const G4int &key, U *&aHit) const
◆ SetUnit()
void G4PSSphereSurfaceCurrent::SetUnit |
( |
const G4String & | unit | ) |
|
|
virtual |
◆ Weighted()
void G4PSSphereSurfaceCurrent::Weighted |
( |
G4bool | flg = true | ) |
|
|
inline |
The documentation for this class was generated from the following files: