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 "G4GDMLParameterisation.hh"
00035
00036 G4int G4GDMLParameterisation::GetSize() const
00037 {
00038 return (G4int)parameterList.size();
00039 }
00040
00041 void G4GDMLParameterisation::AddParameter(const PARAMETER& newParameter)
00042 {
00043 parameterList.push_back(newParameter);
00044 }
00045
00046 void G4GDMLParameterisation::
00047 ComputeTransformation(const G4int index,G4VPhysicalVolume* physvol) const
00048 {
00049 physvol->SetTranslation(parameterList[index].position);
00050 physvol->SetRotation(parameterList[index].pRot);
00051 }
00052
00053 void G4GDMLParameterisation::
00054 ComputeDimensions(G4Box& box,const G4int index,const G4VPhysicalVolume*) const
00055 {
00056 box.SetXHalfLength(parameterList[index].dimension[0]);
00057 box.SetYHalfLength(parameterList[index].dimension[1]);
00058 box.SetZHalfLength(parameterList[index].dimension[2]);
00059 }
00060
00061 void G4GDMLParameterisation::
00062 ComputeDimensions(G4Trd& trd,const G4int index,const G4VPhysicalVolume*) const
00063 {
00064 trd.SetXHalfLength1(parameterList[index].dimension[0]);
00065 trd.SetXHalfLength2(parameterList[index].dimension[1]);
00066 trd.SetYHalfLength1(parameterList[index].dimension[2]);
00067 trd.SetYHalfLength2(parameterList[index].dimension[3]);
00068 trd.SetZHalfLength(parameterList[index].dimension[4]);
00069 }
00070
00071 void G4GDMLParameterisation::
00072 ComputeDimensions(G4Trap& trap,const G4int index,const G4VPhysicalVolume*) const
00073 {
00074 trap.SetAllParameters(parameterList[index].dimension[0],
00075 parameterList[index].dimension[1],
00076 parameterList[index].dimension[2],
00077 parameterList[index].dimension[3],
00078 parameterList[index].dimension[4],
00079 parameterList[index].dimension[5],
00080 parameterList[index].dimension[6],
00081 parameterList[index].dimension[7],
00082 parameterList[index].dimension[8],
00083 parameterList[index].dimension[9],
00084 parameterList[index].dimension[10]);
00085 }
00086
00087 void G4GDMLParameterisation::
00088 ComputeDimensions(G4Tubs& tubs,const G4int index,const G4VPhysicalVolume*) const
00089 {
00090 tubs.SetInnerRadius(parameterList[index].dimension[0]);
00091 tubs.SetOuterRadius(parameterList[index].dimension[1]);
00092 tubs.SetZHalfLength(parameterList[index].dimension[2]);
00093 tubs.SetStartPhiAngle(parameterList[index].dimension[3]);
00094 tubs.SetDeltaPhiAngle(parameterList[index].dimension[4]);
00095 }
00096
00097 void G4GDMLParameterisation::
00098 ComputeDimensions(G4Cons& cons,const G4int index,const G4VPhysicalVolume*) const
00099 {
00100 cons.SetInnerRadiusMinusZ(parameterList[index].dimension[0]);
00101 cons.SetOuterRadiusMinusZ(parameterList[index].dimension[1]);
00102 cons.SetInnerRadiusPlusZ(parameterList[index].dimension[2]);
00103 cons.SetOuterRadiusPlusZ(parameterList[index].dimension[3]);
00104 cons.SetZHalfLength(parameterList[index].dimension[4]);
00105 cons.SetStartPhiAngle(parameterList[index].dimension[5]);
00106 cons.SetDeltaPhiAngle(parameterList[index].dimension[6]);
00107 }
00108
00109 void G4GDMLParameterisation::
00110 ComputeDimensions(G4Sphere& sphere,const G4int index,const G4VPhysicalVolume*) const
00111 {
00112 sphere.SetInsideRadius(parameterList[index].dimension[0]);
00113 sphere.SetOuterRadius(parameterList[index].dimension[1]);
00114 sphere.SetStartPhiAngle(parameterList[index].dimension[2]);
00115 sphere.SetDeltaPhiAngle(parameterList[index].dimension[3]);
00116 sphere.SetStartThetaAngle(parameterList[index].dimension[4]);
00117 sphere.SetDeltaThetaAngle(parameterList[index].dimension[5]);
00118 }
00119
00120 void G4GDMLParameterisation::
00121 ComputeDimensions(G4Orb& orb,const G4int index,const G4VPhysicalVolume*) const
00122 {
00123 orb.SetRadius(parameterList[index].dimension[0]);
00124 }
00125
00126 void G4GDMLParameterisation::
00127 ComputeDimensions(G4Torus& torus,const G4int index,const G4VPhysicalVolume*) const
00128 {
00129 torus.SetAllParameters(parameterList[index].dimension[0],
00130 parameterList[index].dimension[1],
00131 parameterList[index].dimension[2],
00132 parameterList[index].dimension[3],
00133 parameterList[index].dimension[4]);
00134 }
00135
00136 void G4GDMLParameterisation::
00137 ComputeDimensions(G4Para& para,const G4int index,const G4VPhysicalVolume*) const
00138 {
00139 para.SetXHalfLength(parameterList[index].dimension[0]);
00140 para.SetYHalfLength(parameterList[index].dimension[1]);
00141 para.SetZHalfLength(parameterList[index].dimension[2]);
00142 para.SetAlpha(parameterList[index].dimension[3]);
00143 para.SetTanAlpha(std::tan(parameterList[index].dimension[3]));
00144 para.SetThetaAndPhi(parameterList[index].dimension[4],parameterList[index].dimension[5]);
00145 }
00146
00147 void G4GDMLParameterisation::
00148 ComputeDimensions(G4Hype& hype,const G4int index,const G4VPhysicalVolume*) const
00149 {
00150 hype.SetInnerRadius(parameterList[index].dimension[0]);
00151 hype.SetOuterRadius(parameterList[index].dimension[1]);
00152 hype.SetZHalfLength(parameterList[index].dimension[4]);
00153 hype.SetInnerStereo(parameterList[index].dimension[2]);
00154 hype.SetOuterStereo(parameterList[index].dimension[3]);
00155 }
00156
00157 void G4GDMLParameterisation::
00158 ComputeDimensions(G4Polycone&,const G4int,const G4VPhysicalVolume*) const
00159 {
00160 G4Exception("G4GDMLParameterisation::ComputeDimensions()",
00161 "InvalidSetup", FatalException,
00162 "Parameterisation of G4Polycone not implemented yet. Sorry!");
00163 }
00164
00165 void G4GDMLParameterisation::
00166 ComputeDimensions(G4Polyhedra&,const G4int,const G4VPhysicalVolume*) const
00167 {
00168 G4Exception("G4GDMLParameterisation::ComputeDimensions()",
00169 "InvalidSetup", FatalException,
00170 "Parameterisation of G4Polyhedra not implemented yet. Sorry!");
00171 }