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
00028
00029
00030
00031
00032
00033
00034 #include "G4PVDivisionFactory.hh"
00035 #include "G4PVDivision.hh"
00036 #include "G4VDivisionParameterisation.hh"
00037
00038
00039
00040 G4PVDivisionFactory::G4PVDivisionFactory()
00041 : G4VPVDivisionFactory()
00042 {
00043
00044
00045 }
00046
00047
00048
00049 G4PVDivisionFactory::~G4PVDivisionFactory()
00050 {
00051 }
00052
00053
00054
00055 G4PVDivisionFactory* G4PVDivisionFactory::GetInstance()
00056 {
00057 static G4PVDivisionFactory * theFactory = new G4PVDivisionFactory;
00058 if (!fgInstance)
00059 {
00060 fgInstance = theFactory;
00061 }
00062 return theFactory;
00063 }
00064
00065
00066
00067 G4VPhysicalVolume*
00068 G4PVDivisionFactory::CreatePVDivision(const G4String& pName,
00069 G4LogicalVolume* pLogical,
00070 G4LogicalVolume* pMotherLogical,
00071 const EAxis pAxis,
00072 const G4int nReplicas,
00073 const G4double width,
00074 const G4double offset )
00075 {
00076
00077
00078
00079 return new G4PVDivision(pName, pLogical, pMotherLogical,
00080 pAxis, nReplicas, width, offset);
00081 }
00082
00083
00084
00085 G4VPhysicalVolume*
00086 G4PVDivisionFactory::CreatePVDivision(const G4String& pName,
00087 G4LogicalVolume* pLogical,
00088 G4LogicalVolume* pMotherLogical,
00089 const EAxis pAxis,
00090 const G4int nReplicas,
00091 const G4double offset )
00092 {
00093
00094
00095
00096 return new G4PVDivision(pName, pLogical, pMotherLogical,
00097 pAxis, nReplicas, offset);
00098 }
00099
00100
00101
00102 G4VPhysicalVolume*
00103 G4PVDivisionFactory::CreatePVDivision(const G4String& pName,
00104 G4LogicalVolume* pLogical,
00105 G4LogicalVolume* pMotherLogical,
00106 const EAxis pAxis,
00107 const G4double width,
00108 const G4double offset )
00109 {
00110
00111
00112
00113 return new G4PVDivision(pName, pLogical, pMotherLogical,
00114 pAxis, width, offset);
00115 }
00116
00117
00118
00119 G4VPhysicalVolume*
00120 G4PVDivisionFactory::CreatePVDivision(const G4String& pName,
00121 G4LogicalVolume* pLogical,
00122 G4LogicalVolume* pMotherLogical,
00123 const G4VPVParameterisation* param)
00124 {
00125
00126
00127
00128
00129
00130 const G4VDivisionParameterisation* divParam
00131 = dynamic_cast<const G4VDivisionParameterisation*>(param);
00132
00133 if (!divParam)
00134 {
00135 G4Exception("G4PVDivisionFactory::CreatePVDivision()",
00136 "GeomDiv0001", FatalException,
00137 "Unexpected parameterisation type!");
00138 return 0;
00139 }
00140 else
00141 {
00142 EAxis axis = divParam->GetAxis();
00143 G4int nofDivisions = divParam->GetNoDiv();
00144 G4double width = divParam->GetWidth();
00145 G4double offset = divParam->GetOffset();
00146
00147 return new G4PVDivision(pName, pLogical, pMotherLogical,
00148 axis, nofDivisions, width, offset);
00149 }
00150 }
00151
00152
00153
00154 G4bool G4PVDivisionFactory::IsPVDivision(const G4VPhysicalVolume* pv) const
00155 {
00156
00157
00158
00159 if (dynamic_cast<const G4PVDivision*>(pv))
00160 return true;
00161 else
00162 return false;
00163 }
00164