Geant4 9.6.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 62 of file G4AdjointPosOnPhysVolGenerator.hh.

Member Function Documentation

◆ ComputeAreaOfExtSurface() [1/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( )

Definition at line 110 of file G4AdjointPosOnPhysVolGenerator.cc.

111{
112 return ComputeAreaOfExtSurface(theSolid);
113}

Referenced by ComputeAreaOfExtSurface().

◆ ComputeAreaOfExtSurface() [2/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4double  epsilon)

Definition at line 122 of file G4AdjointPosOnPhysVolGenerator.cc.

123{
124 return ComputeAreaOfExtSurface(theSolid,eps);
125}

◆ ComputeAreaOfExtSurface() [3/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4int  NStat)

Definition at line 116 of file G4AdjointPosOnPhysVolGenerator.cc.

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

◆ ComputeAreaOfExtSurface() [4/6]

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid)

Definition at line 128 of file G4AdjointPosOnPhysVolGenerator.cc.

129{
130 return ComputeAreaOfExtSurface(aSolid,1.e-3);
131}

◆ ComputeAreaOfExtSurface() [5/6]

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

Definition at line 152 of file G4AdjointPosOnPhysVolGenerator.cc.

153{
154 G4int Nstats = G4int(1./(eps*eps));
155 return ComputeAreaOfExtSurface(aSolid,Nstats);
156}
int G4int
Definition: G4Types.hh:66

◆ ComputeAreaOfExtSurface() [6/6]

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

Definition at line 134 of file G4AdjointPosOnPhysVolGenerator.cc.

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

◆ DefinePhysicalVolume()

G4VPhysicalVolume * G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume ( const G4String aName)

Definition at line 76 of file G4AdjointPosOnPhysVolGenerator.cc.

77{
78 thePhysicalVolume = 0;
79 theSolid =0;
81 for ( unsigned int i=0; i< thePhysVolStore->size();i++){
82 G4String vol_name =(*thePhysVolStore)[i]->GetName();
83 if (vol_name == ""){
84 vol_name = (*thePhysVolStore)[i]->GetLogicalVolume()->GetName();
85 }
86 if (vol_name == aName){
87 thePhysicalVolume = (*thePhysVolStore)[i];
88 }
89 }
90 if (thePhysicalVolume){
91 theSolid = thePhysicalVolume->GetLogicalVolume()->GetSolid();
92 ComputeTransformationFromPhysVolToWorld();
93 /*AreaOfExtSurfaceOfThePhysicalVolume=ComputeAreaOfExtSurface(1.e-3);
94 G4cout<<"Monte Carlo Estimate of the area of the external surface :"<<AreaOfExtSurfaceOfThePhysicalVolume/m/m<<" m2"<<std::endl;*/
95 }
96 else {
97 G4cout<<"The physical volume with name "<<aName<<" does not exist!!"<<std::endl;
98 G4cout<<"Before generating a source on an external surface of a volume you should select another physical volume"<<std::endl;
99 }
100 return thePhysicalVolume;
101}
G4DLLIMPORT 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 104 of file G4AdjointPosOnPhysVolGenerator.cc.

105{
106 thePhysicalVolume = DefinePhysicalVolume(aName);
107}
G4VPhysicalVolume * DefinePhysicalVolume(const G4String &aName)

Referenced by G4AdjointPrimaryGenerator::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume().

◆ GenerateAPositionOnTheExtSurfaceOfASolid()

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

Definition at line 158 of file G4AdjointPosOnPhysVolGenerator.cc.

159{
160 if (ModelOfSurfaceSource == "OnSolid" ){
161 GenerateAPositionOnASolidBoundary(aSolid, p,direction);
162 return;
163 }
164 if (ModelOfSurfaceSource == "ExternalSphere" ) {
165 GenerateAPositionOnASphereBoundary(aSolid, p, direction);
166 return;
167 }
168 GenerateAPositionOnABoxBoundary(aSolid, p, direction);
169 return;
170}

Referenced by GenerateAPositionOnTheExtSurfaceOfTheSolid().

◆ GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume() [1/2]

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

Definition at line 373 of file G4AdjointPosOnPhysVolGenerator.cc.

374{
375 if (!thePhysicalVolume) {
376 G4cout<<"Before generating a source on an external surface of volume you should select a physical volume"<<std::endl;
377 return;
378 };
380 p = theTransformationFromPhysVolToWorld.TransformPoint(p);
381 direction = theTransformationFromPhysVolToWorld.TransformAxis(direction);
382}
void GenerateAPositionOnTheExtSurfaceOfTheSolid(G4ThreeVector &p, G4ThreeVector &direction)
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const

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

◆ GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume() [2/2]

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

Definition at line 385 of file G4AdjointPosOnPhysVolGenerator.cc.

387{
389 costh_to_normal = CosThDirComparedToNormal;
390}
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector &p, G4ThreeVector &direction)

◆ GenerateAPositionOnTheExtSurfaceOfTheSolid()

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

Definition at line 172 of file G4AdjointPosOnPhysVolGenerator.cc.

173{
174 GenerateAPositionOnTheExtSurfaceOfASolid(theSolid,p,direction);
175}
void GenerateAPositionOnTheExtSurfaceOfASolid(G4VSolid *aSolid, G4ThreeVector &p, G4ThreeVector &direction)

Referenced by GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume().

◆ GetAreaOfExtSurfaceOfThePhysicalVolume()

G4double G4AdjointPosOnPhysVolGenerator::GetAreaOfExtSurfaceOfThePhysicalVolume ( )
inline

Definition at line 93 of file G4AdjointPosOnPhysVolGenerator.hh.

93{return AreaOfExtSurfaceOfThePhysicalVolume;}

◆ GetCosThDirComparedToNormal()

G4double G4AdjointPosOnPhysVolGenerator::GetCosThDirComparedToNormal ( )
inline

Definition at line 94 of file G4AdjointPosOnPhysVolGenerator.hh.

94{return CosThDirComparedToNormal;}

◆ GetInstance()

G4AdjointPosOnPhysVolGenerator * G4AdjointPosOnPhysVolGenerator::GetInstance ( )
static

Definition at line 49 of file G4AdjointPosOnPhysVolGenerator.cc.

50{
51 if(theInstance == 0) {
52 static G4AdjointPosOnPhysVolGenerator manager;
53 theInstance = &manager;
54 }
55 return theInstance;
56}

Referenced by G4AdjointPrimaryGenerator::G4AdjointPrimaryGenerator().

◆ SetSolid()

void G4AdjointPosOnPhysVolGenerator::SetSolid ( G4VSolid aSolid)
inline

Definition at line 92 of file G4AdjointPosOnPhysVolGenerator.hh.

92{theSolid=aSolid;}

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