Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AdjointPosOnPhysVolGenerator Class Reference

#include <G4AdjointPosOnPhysVolGenerator.hh>

Public Member Functions

G4VPhysicalVolumeDefinePhysicalVolume (const G4String &aName)
 
void DefinePhysicalVolume1 (const G4String &aName)
 
G4double ComputeAreaOfExtSurface ()
 
G4double ComputeAreaOfExtSurface (G4int NStat)
 
G4double ComputeAreaOfExtSurface (G4double epsilon)
 
G4double ComputeAreaOfExtSurface (G4VSolid *aSolid)
 
G4double ComputeAreaOfExtSurface (G4VSolid *aSolid, G4int NStat)
 
G4double ComputeAreaOfExtSurface (G4VSolid *aSolid, G4double epsilon)
 
void GenerateAPositionOnTheExtSurfaceOfASolid (G4VSolid *aSolid, G4ThreeVector &p, G4ThreeVector &direction)
 
void GenerateAPositionOnTheExtSurfaceOfTheSolid (G4ThreeVector &p, G4ThreeVector &direction)
 
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume (G4ThreeVector &p, G4ThreeVector &direction)
 
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume (G4ThreeVector &p, G4ThreeVector &direction, G4double &costh_to_normal)
 
void SetSolid (G4VSolid *aSolid)
 
G4double GetAreaOfExtSurfaceOfThePhysicalVolume ()
 
G4double GetCosThDirComparedToNormal ()
 

Static Public Member Functions

static G4AdjointPosOnPhysVolGeneratorGetInstance ()
 

Detailed Description

Definition at line 58 of file G4AdjointPosOnPhysVolGenerator.hh.

Member Function Documentation

◆ ComputeAreaOfExtSurface() [1/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( )

Definition at line 116 of file G4AdjointPosOnPhysVolGenerator.cc.

117{
118 return ComputeAreaOfExtSurface(theSolid);
119}

Referenced by ComputeAreaOfExtSurface().

◆ ComputeAreaOfExtSurface() [2/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4double  epsilon)

Definition at line 130 of file G4AdjointPosOnPhysVolGenerator.cc.

131{
132 return ComputeAreaOfExtSurface(theSolid,eps);
133}

◆ ComputeAreaOfExtSurface() [3/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4int  NStat)

Definition at line 123 of file G4AdjointPosOnPhysVolGenerator.cc.

124{
125 return ComputeAreaOfExtSurface(theSolid,NStats);
126}

◆ ComputeAreaOfExtSurface() [4/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid)

Definition at line 138 of file G4AdjointPosOnPhysVolGenerator.cc.

139{
140 return ComputeAreaOfExtSurface(aSolid,1.e-3);
141}

◆ ComputeAreaOfExtSurface() [5/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid,
G4double  epsilon 
)

Definition at line 174 of file G4AdjointPosOnPhysVolGenerator.cc.

176{
177 G4int Nstats = G4int(1./(eps*eps));
178 return ComputeAreaOfExtSurface(aSolid,Nstats);
179}
int G4int
Definition: G4Types.hh:85

◆ ComputeAreaOfExtSurface() [6/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid,
G4int  NStat 
)

Definition at line 146 of file G4AdjointPosOnPhysVolGenerator.cc.

148{
149 if (ModelOfSurfaceSource == "OnSolid")
150 {
151 if (UseSphere)
152 {
153 return ComputeAreaOfExtSurfaceStartingFromSphere(aSolid,NStats);
154 }
155 else
156 {
157 return ComputeAreaOfExtSurfaceStartingFromBox(aSolid,NStats);
158 }
159 }
160 else
161 {
162 G4ThreeVector p, dir;
163 if (ModelOfSurfaceSource == "ExternalSphere")
164 {
165 return GenerateAPositionOnASphereBoundary(aSolid, p,dir);
166 }
167 return GenerateAPositionOnABoxBoundary(aSolid, p,dir);
168 }
169}

◆ DefinePhysicalVolume()

G4VPhysicalVolume * G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume ( const G4String aName)

Definition at line 73 of file G4AdjointPosOnPhysVolGenerator.cc.

74{
75 thePhysicalVolume = nullptr;
76 theSolid = nullptr;
78 for ( unsigned int i=0; i< thePhysVolStore->size(); ++i )
79 {
80 G4String vol_name =(*thePhysVolStore)[i]->GetName();
81 if (vol_name == "")
82 {
83 vol_name = (*thePhysVolStore)[i]->GetLogicalVolume()->GetName();
84 }
85 if (vol_name == aName)
86 {
87 thePhysicalVolume = (*thePhysVolStore)[i];
88 }
89 }
90 if (thePhysicalVolume != nullptr)
91 {
92 theSolid = thePhysicalVolume->GetLogicalVolume()->GetSolid();
93 ComputeTransformationFromPhysVolToWorld();
94 }
95 else
96 {
97 G4cout << "The physical volume with name " << aName
98 << " does not exist!!" << G4endl;
99 G4cout << "Before generating a source on an external surface " << G4endl
100 << "of a volume you should select another physical volume."
101 << G4endl;
102 }
103 return thePhysicalVolume;
104}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4VSolid * GetSolid() const
static G4PhysicalVolumeStore * GetInstance()
G4LogicalVolume * GetLogicalVolume() const

Referenced by DefinePhysicalVolume1().

◆ DefinePhysicalVolume1()

void G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume1 ( const G4String aName)

Definition at line 109 of file G4AdjointPosOnPhysVolGenerator.cc.

110{
111 thePhysicalVolume = DefinePhysicalVolume(aName);
112}
G4VPhysicalVolume * DefinePhysicalVolume(const G4String &aName)

Referenced by G4AdjointPrimaryGenerator::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume().

◆ GenerateAPositionOnTheExtSurfaceOfASolid()

void G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfASolid ( G4VSolid aSolid,
G4ThreeVector p,
G4ThreeVector direction 
)

Definition at line 183 of file G4AdjointPosOnPhysVolGenerator.cc.

186{
187 if (ModelOfSurfaceSource == "OnSolid")
188 {
189 GenerateAPositionOnASolidBoundary(aSolid, p,direction);
190 return;
191 }
192 if (ModelOfSurfaceSource == "ExternalSphere")
193 {
194 GenerateAPositionOnASphereBoundary(aSolid, p, direction);
195 return;
196 }
197 GenerateAPositionOnABoxBoundary(aSolid, p, direction);
198 return;
199}

Referenced by GenerateAPositionOnTheExtSurfaceOfTheSolid().

◆ GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume() [1/2]

void G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume ( G4ThreeVector p,
G4ThreeVector direction 
)

Definition at line 435 of file G4AdjointPosOnPhysVolGenerator.cc.

438{
439 if (thePhysicalVolume == nullptr)
440 {
441 G4cout << "Before generating a source on an external surface" << G4endl
442 << "of volume you should select a physical volume" << G4endl;
443 return;
444 }
446 p = theTransformationFromPhysVolToWorld.TransformPoint(p);
447 direction = theTransformationFromPhysVolToWorld.TransformAxis(direction);
448}
void GenerateAPositionOnTheExtSurfaceOfTheSolid(G4ThreeVector &p, G4ThreeVector &direction)
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const

Referenced by G4AdjointPrimaryGenerator::GenerateAdjointPrimaryVertex(), GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(), and G4AdjointPrimaryGenerator::GenerateFwdPrimaryVertex().

◆ GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume() [2/2]

void G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume ( G4ThreeVector p,
G4ThreeVector direction,
G4double costh_to_normal 
)

Definition at line 452 of file G4AdjointPosOnPhysVolGenerator.cc.

456{
458 costh_to_normal = CosThDirComparedToNormal;
459}
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector &p, G4ThreeVector &direction)

◆ GenerateAPositionOnTheExtSurfaceOfTheSolid()

void G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfTheSolid ( G4ThreeVector p,
G4ThreeVector direction 
)

Definition at line 203 of file G4AdjointPosOnPhysVolGenerator.cc.

206{
207 GenerateAPositionOnTheExtSurfaceOfASolid(theSolid,p,direction);
208}
void GenerateAPositionOnTheExtSurfaceOfASolid(G4VSolid *aSolid, G4ThreeVector &p, G4ThreeVector &direction)

Referenced by GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume().

◆ GetAreaOfExtSurfaceOfThePhysicalVolume()

G4double G4AdjointPosOnPhysVolGenerator::GetAreaOfExtSurfaceOfThePhysicalVolume ( )
inline

Definition at line 88 of file G4AdjointPosOnPhysVolGenerator.hh.

89 { return AreaOfExtSurfaceOfThePhysicalVolume; }

◆ GetCosThDirComparedToNormal()

G4double G4AdjointPosOnPhysVolGenerator::GetCosThDirComparedToNormal ( )
inline

Definition at line 90 of file G4AdjointPosOnPhysVolGenerator.hh.

91 { return CosThDirComparedToNormal; }

◆ GetInstance()

G4AdjointPosOnPhysVolGenerator * G4AdjointPosOnPhysVolGenerator::GetInstance ( )
static

Definition at line 47 of file G4AdjointPosOnPhysVolGenerator.cc.

48{
49 if(theInstance == nullptr)
50 {
51 theInstance = new G4AdjointPosOnPhysVolGenerator;
52 }
53 return theInstance;
54}

Referenced by G4AdjointPrimaryGenerator::G4AdjointPrimaryGenerator().

◆ SetSolid()

void G4AdjointPosOnPhysVolGenerator::SetSolid ( G4VSolid aSolid)
inline

Definition at line 86 of file G4AdjointPosOnPhysVolGenerator.hh.

87 { theSolid=aSolid; }

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