Geant4 11.1.1
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 102 of file G4AdjointPosOnPhysVolGenerator.cc.

103{
104 return ComputeAreaOfExtSurface(theSolid);
105}

Referenced by ComputeAreaOfExtSurface().

◆ ComputeAreaOfExtSurface() [2/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4double  epsilon)

Definition at line 116 of file G4AdjointPosOnPhysVolGenerator.cc.

117{
118 return ComputeAreaOfExtSurface(theSolid,eps);
119}

◆ ComputeAreaOfExtSurface() [3/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4int  NStat)

Definition at line 109 of file G4AdjointPosOnPhysVolGenerator.cc.

110{
111 return ComputeAreaOfExtSurface(theSolid,NStats);
112}

◆ ComputeAreaOfExtSurface() [4/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid)

Definition at line 124 of file G4AdjointPosOnPhysVolGenerator.cc.

125{
126 return ComputeAreaOfExtSurface(aSolid,1.e-3);
127}

◆ ComputeAreaOfExtSurface() [5/6]

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

Definition at line 157 of file G4AdjointPosOnPhysVolGenerator.cc.

159{
160 G4int Nstats = G4int(1./(eps*eps));
161 return ComputeAreaOfExtSurface(aSolid,Nstats);
162}
int G4int
Definition: G4Types.hh:85

◆ ComputeAreaOfExtSurface() [6/6]

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

Definition at line 132 of file G4AdjointPosOnPhysVolGenerator.cc.

134{
135 if (ModelOfSurfaceSource == "OnSolid")
136 {
137 if (UseSphere)
138 {
139 return ComputeAreaOfExtSurfaceStartingFromSphere(aSolid,NStats);
140 }
141
142 return ComputeAreaOfExtSurfaceStartingFromBox(aSolid,NStats);
143 }
144
145 G4ThreeVector p, dir;
146 if (ModelOfSurfaceSource == "ExternalSphere")
147 {
148 return GenerateAPositionOnASphereBoundary(aSolid, p,dir);
149 }
150
151 return GenerateAPositionOnABoxBoundary(aSolid, p,dir);
152}

◆ DefinePhysicalVolume()

G4VPhysicalVolume * G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume ( const G4String aName)

Definition at line 59 of file G4AdjointPosOnPhysVolGenerator.cc.

60{
61 thePhysicalVolume = nullptr;
62 theSolid = nullptr;
64 for ( unsigned int i=0; i< thePhysVolStore->size(); ++i )
65 {
66 G4String vol_name =(*thePhysVolStore)[i]->GetName();
67 if (vol_name.empty())
68 {
69 vol_name = (*thePhysVolStore)[i]->GetLogicalVolume()->GetName();
70 }
71 if (vol_name == aName)
72 {
73 thePhysicalVolume = (*thePhysVolStore)[i];
74 }
75 }
76 if (thePhysicalVolume != nullptr)
77 {
78 theSolid = thePhysicalVolume->GetLogicalVolume()->GetSolid();
79 ComputeTransformationFromPhysVolToWorld();
80 }
81 else
82 {
83 G4cout << "The physical volume with name " << aName
84 << " does not exist!!" << G4endl;
85 G4cout << "Before generating a source on an external surface " << G4endl
86 << "of a volume you should select another physical volume."
87 << G4endl;
88 }
89 return thePhysicalVolume;
90}
#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 95 of file G4AdjointPosOnPhysVolGenerator.cc.

96{
97 thePhysicalVolume = DefinePhysicalVolume(aName);
98}
G4VPhysicalVolume * DefinePhysicalVolume(const G4String &aName)

Referenced by G4AdjointPrimaryGenerator::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume().

◆ GenerateAPositionOnTheExtSurfaceOfASolid()

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

Definition at line 166 of file G4AdjointPosOnPhysVolGenerator.cc.

169{
170 if (ModelOfSurfaceSource == "OnSolid")
171 {
172 GenerateAPositionOnASolidBoundary(aSolid, p,direction);
173 return;
174 }
175 if (ModelOfSurfaceSource == "ExternalSphere")
176 {
177 GenerateAPositionOnASphereBoundary(aSolid, p, direction);
178 return;
179 }
180 GenerateAPositionOnABoxBoundary(aSolid, p, direction);
181 return;
182}

Referenced by GenerateAPositionOnTheExtSurfaceOfTheSolid().

◆ GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume() [1/2]

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

Definition at line 418 of file G4AdjointPosOnPhysVolGenerator.cc.

421{
422 if (thePhysicalVolume == nullptr)
423 {
424 G4cout << "Before generating a source on an external surface" << G4endl
425 << "of volume you should select a physical volume" << G4endl;
426 return;
427 }
429 p = theTransformationFromPhysVolToWorld.TransformPoint(p);
430 direction = theTransformationFromPhysVolToWorld.TransformAxis(direction);
431}
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 435 of file G4AdjointPosOnPhysVolGenerator.cc.

439{
441 costh_to_normal = CosThDirComparedToNormal;
442}
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector &p, G4ThreeVector &direction)

◆ GenerateAPositionOnTheExtSurfaceOfTheSolid()

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

Definition at line 186 of file G4AdjointPosOnPhysVolGenerator.cc.

189{
190 GenerateAPositionOnTheExtSurfaceOfASolid(theSolid,p,direction);
191}
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: