Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
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
G4AdjointPosOnPhysVolGenerator
GetInstance ()
 

Detailed Description

Definition at line 62 of file G4AdjointPosOnPhysVolGenerator.hh.

Member Function Documentation

G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( )

Definition at line 109 of file G4AdjointPosOnPhysVolGenerator.cc.

Referenced by ComputeAreaOfExtSurface().

110 {
111  return ComputeAreaOfExtSurface(theSolid);
112 }
G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4int  NStat)

Definition at line 115 of file G4AdjointPosOnPhysVolGenerator.cc.

References ComputeAreaOfExtSurface().

116 {
117  return ComputeAreaOfExtSurface(theSolid,NStats);
118 }
G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4double  epsilon)

Definition at line 121 of file G4AdjointPosOnPhysVolGenerator.cc.

References ComputeAreaOfExtSurface().

122 {
123  return ComputeAreaOfExtSurface(theSolid,eps);
124 }
G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid)

Definition at line 127 of file G4AdjointPosOnPhysVolGenerator.cc.

References ComputeAreaOfExtSurface().

128 {
129  return ComputeAreaOfExtSurface(aSolid,1.e-3);
130 }
G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid,
G4int  NStat 
)

Definition at line 133 of file G4AdjointPosOnPhysVolGenerator.cc.

134 {
135  if (ModelOfSurfaceSource == "OnSolid" ){
136  if (UseSphere){
137  return ComputeAreaOfExtSurfaceStartingFromSphere(aSolid,NStats);
138  }
139  else {
140  return ComputeAreaOfExtSurfaceStartingFromBox(aSolid,NStats);
141  }
142  }
143  else {
144  G4ThreeVector p,dir;
145  if (ModelOfSurfaceSource == "ExternalSphere" ) return GenerateAPositionOnASphereBoundary(aSolid, p,dir);
146  return GenerateAPositionOnABoxBoundary(aSolid, p,dir);
147  }
148 }
const char * p
Definition: xmltok.h:285
G4double G4AdjointPosOnPhysVolGenerator::ComputeAreaOfExtSurface ( G4VSolid aSolid,
G4double  epsilon 
)

Definition at line 151 of file G4AdjointPosOnPhysVolGenerator.cc.

References ComputeAreaOfExtSurface().

152 {
153  G4int Nstats = G4int(1./(eps*eps));
154  return ComputeAreaOfExtSurface(aSolid,Nstats);
155 }
int G4int
Definition: G4Types.hh:78
G4VPhysicalVolume * G4AdjointPosOnPhysVolGenerator::DefinePhysicalVolume ( const G4String aName)

Definition at line 75 of file G4AdjointPosOnPhysVolGenerator.cc.

References G4cout, G4PhysicalVolumeStore::GetInstance(), G4VPhysicalVolume::GetLogicalVolume(), and G4LogicalVolume::GetSolid().

Referenced by DefinePhysicalVolume1().

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

Definition at line 103 of file G4AdjointPosOnPhysVolGenerator.cc.

References DefinePhysicalVolume().

Referenced by G4AdjointPrimaryGenerator::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume().

104 {
105  thePhysicalVolume = DefinePhysicalVolume(aName);
106 }
G4VPhysicalVolume * DefinePhysicalVolume(const G4String &aName)
void G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfASolid ( G4VSolid aSolid,
G4ThreeVector p,
G4ThreeVector direction 
)

Definition at line 157 of file G4AdjointPosOnPhysVolGenerator.cc.

Referenced by GenerateAPositionOnTheExtSurfaceOfTheSolid().

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

Definition at line 369 of file G4AdjointPosOnPhysVolGenerator.cc.

References G4cout, GenerateAPositionOnTheExtSurfaceOfTheSolid(), G4AffineTransform::TransformAxis(), and G4AffineTransform::TransformPoint().

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

370 {
371  if (!thePhysicalVolume) {
372  G4cout<<"Before generating a source on an external surface of volume you should select a physical volume"<<std::endl;
373  return;
374  };
376  p = theTransformationFromPhysVolToWorld.TransformPoint(p);
377  direction = theTransformationFromPhysVolToWorld.TransformAxis(direction);
378 }
void GenerateAPositionOnTheExtSurfaceOfTheSolid(G4ThreeVector &p, G4ThreeVector &direction)
G4GLOB_DLL std::ostream G4cout
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
void G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume ( G4ThreeVector p,
G4ThreeVector direction,
G4double costh_to_normal 
)

Definition at line 381 of file G4AdjointPosOnPhysVolGenerator.cc.

References GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume().

383 {
385  costh_to_normal = CosThDirComparedToNormal;
386 }
void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector &p, G4ThreeVector &direction)
void G4AdjointPosOnPhysVolGenerator::GenerateAPositionOnTheExtSurfaceOfTheSolid ( G4ThreeVector p,
G4ThreeVector direction 
)

Definition at line 171 of file G4AdjointPosOnPhysVolGenerator.cc.

References GenerateAPositionOnTheExtSurfaceOfASolid().

Referenced by GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume().

172 {
173  GenerateAPositionOnTheExtSurfaceOfASolid(theSolid,p,direction);
174 }
void GenerateAPositionOnTheExtSurfaceOfASolid(G4VSolid *aSolid, G4ThreeVector &p, G4ThreeVector &direction)
G4double G4AdjointPosOnPhysVolGenerator::GetAreaOfExtSurfaceOfThePhysicalVolume ( )
inline

Definition at line 93 of file G4AdjointPosOnPhysVolGenerator.hh.

93 {return AreaOfExtSurfaceOfThePhysicalVolume;}
G4double G4AdjointPosOnPhysVolGenerator::GetCosThDirComparedToNormal ( )
inline

Definition at line 94 of file G4AdjointPosOnPhysVolGenerator.hh.

94 {return CosThDirComparedToNormal;}
G4AdjointPosOnPhysVolGenerator * G4AdjointPosOnPhysVolGenerator::GetInstance ( void  )
static

Definition at line 49 of file G4AdjointPosOnPhysVolGenerator.cc.

Referenced by G4AdjointPrimaryGenerator::G4AdjointPrimaryGenerator().

50 {
51  if(!theInstance)
52  {
53  theInstance = new G4AdjointPosOnPhysVolGenerator;
54  }
55  return theInstance;
56 }
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: