00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00029
00030
00031
00032
00033
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #ifndef G4AdjointPosOnPhysVolGenerator_h
00054 #define G4AdjointPosOnPhysVolGenerator_h 1
00055
00056 #include "G4VPhysicalVolume.hh"
00057 #include "G4AffineTransform.hh"
00058 #include "G4ThreeVector.hh"
00059
00060 class G4VSolid;
00061
00062 class G4AdjointPosOnPhysVolGenerator
00064 {
00065
00066
00067 public:
00068
00069
00070 static G4AdjointPosOnPhysVolGenerator* GetInstance();
00071
00072
00073 public:
00074
00075 G4VPhysicalVolume* DefinePhysicalVolume(const G4String& aName);
00076 void DefinePhysicalVolume1(const G4String& aName);
00077 G4double ComputeAreaOfExtSurface();
00078 G4double ComputeAreaOfExtSurface(G4int NStat);
00079 G4double ComputeAreaOfExtSurface(G4double epsilon);
00080 G4double ComputeAreaOfExtSurface(G4VSolid* aSolid);
00081 G4double ComputeAreaOfExtSurface(G4VSolid* aSolid,G4int NStat);
00082 G4double ComputeAreaOfExtSurface(G4VSolid* aSolid,G4double epsilon);
00083
00084 void GenerateAPositionOnTheExtSurfaceOfASolid(G4VSolid* aSolid,G4ThreeVector& p, G4ThreeVector& direction);
00085 void GenerateAPositionOnTheExtSurfaceOfTheSolid(G4ThreeVector& p, G4ThreeVector& direction);
00086 void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector& p, G4ThreeVector& direction);
00087 void GenerateAPositionOnTheExtSurfaceOfThePhysicalVolume(G4ThreeVector& p, G4ThreeVector& direction,
00088 G4double& costh_to_normal);
00089
00090
00091
00092 inline void SetSolid(G4VSolid* aSolid){theSolid=aSolid;}
00093 inline G4double GetAreaOfExtSurfaceOfThePhysicalVolume(){return AreaOfExtSurfaceOfThePhysicalVolume;}
00094 inline G4double GetCosThDirComparedToNormal(){return CosThDirComparedToNormal;}
00095
00096
00097 private:
00098
00099 G4AdjointPosOnPhysVolGenerator();
00100 ~G4AdjointPosOnPhysVolGenerator();
00101 G4double ComputeAreaOfExtSurfaceStartingFromSphere(G4VSolid* aSolid,G4int NStat);
00102 G4double ComputeAreaOfExtSurfaceStartingFromBox(G4VSolid* aSolid,G4int NStat);
00103 void GenerateAPositionOnASolidBoundary(G4VSolid* aSolid,G4ThreeVector& p, G4ThreeVector& direction);
00104 G4double GenerateAPositionOnASphereBoundary(G4VSolid* aSolid,G4ThreeVector& p, G4ThreeVector& direction);
00105 G4double GenerateAPositionOnABoxBoundary(G4VSolid* aSolid,G4ThreeVector& p, G4ThreeVector& direction);
00106 void ComputeTransformationFromPhysVolToWorld();
00107
00108
00109 private:
00110
00111 static G4AdjointPosOnPhysVolGenerator* theInstance;
00112 G4VSolid* theSolid;
00113 G4VPhysicalVolume* thePhysicalVolume;
00114 G4bool UseSphere;
00115 G4String ModelOfSurfaceSource;
00116 G4AffineTransform theTransformationFromPhysVolToWorld;
00117 G4double AreaOfExtSurfaceOfThePhysicalVolume;
00118 G4double CosThDirComparedToNormal;
00119 };
00120
00121 #endif
00122