Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/g3tog4/src/G3toG4MakeSolid.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /g3tog4/src/G3toG4MakeSolid.cc (Version 11.3.0) and /g3tog4/src/G3toG4MakeSolid.cc (Version 9.5.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
                                                   >>  27 // $Id: G3toG4MakeSolid.cc,v 1.10 2006-06-29 18:13:29 gunter Exp $
                                                   >>  28 // GEANT4 tag $Name: not supported by cvs2svn $
 27 //                                                 29 //
 28 // modified by I.Hrivnacova, V.Berejnoi 27 Sep     30 // modified by I.Hrivnacova, V.Berejnoi 27 Sep 99 
 29                                                    31 
 30 #include "globals.hh"                              32 #include "globals.hh"
 31 #include "G4Box.hh"                                33 #include "G4Box.hh"
 32 #include "G4Tubs.hh"                               34 #include "G4Tubs.hh"
 33 #include "G4Trd.hh"                                35 #include "G4Trd.hh"
 34 #include "G4Trap.hh"                               36 #include "G4Trap.hh"
 35 #include "G4Cons.hh"                               37 #include "G4Cons.hh"
 36 #include "G4Sphere.hh"                             38 #include "G4Sphere.hh"
 37 #include "G3toG4.hh"                               39 #include "G3toG4.hh"
 38 #include "G4Polycone.hh"                           40 #include "G4Polycone.hh"
 39 #include "G4Polyhedra.hh"                          41 #include "G4Polyhedra.hh"
 40 #include "G4Para.hh"                               42 #include "G4Para.hh"
 41 #include "G4Hype.hh"                               43 #include "G4Hype.hh"
 42 #include "G4EllipticalTube.hh"                     44 #include "G4EllipticalTube.hh"
 43 #include "G3toG4MakeSolid.hh"                      45 #include "G3toG4MakeSolid.hh"
 44 #include "G4SystemOfUnits.hh"                  <<  46         
 45                                                << 
 46 G4VSolid* G3toG4MakeSolid(const G4String& vnam     47 G4VSolid* G3toG4MakeSolid(const G4String& vname, const G4String& shape, 
 47         const G4double* rpar, const G4int npar <<  48         const G4double* Rpar, const G4int npar, 
 48         G4bool& NegVolPars, G4bool& Deferred,      49         G4bool& NegVolPars, G4bool& Deferred,
 49         G4bool* OKAxis){                           50         G4bool* OKAxis){
 50                                                    51     
 51   // Create the solid if no negative length pa     52   // Create the solid if no negative length parameters
 52   G4VSolid *solid = 0;                             53   G4VSolid *solid = 0;
 53                                                    54 
 54   NegVolPars = false;                              55   NegVolPars = false;
 55                                                    56 
 56   // if npar = 0 assume LV deferral                57   // if npar = 0 assume LV deferral
 57   Deferred = (npar == 0);                          58   Deferred = (npar == 0);
 58   // modified                                      59   // modified
 59   if (Deferred) return solid;                      60   if (Deferred) return solid;
 60                                                    61 
 61   for (G4int i=0;i<3;i++){                         62   for (G4int i=0;i<3;i++){
 62     OKAxis[i]=false;                               63     OKAxis[i]=false;
 63   };                                               64   };
 64                                                    65 
 65   if ( shape == "BOX" ) {                          66   if ( shape == "BOX" ) {
 66     G4double pX = rpar[0]*cm;                  <<  67     G4double pX = Rpar[0]*cm;
 67     G4double pY = rpar[1]*cm;                  <<  68     G4double pY = Rpar[1]*cm;
 68     G4double pZ = rpar[2]*cm;                  <<  69     G4double pZ = Rpar[2]*cm;
 69                                                    70 
 70     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;            71     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
 71                                                    72     
 72     NegVolPars = pX<0 || pY<0 || pZ<0;             73     NegVolPars = pX<0 || pY<0 || pZ<0;
 73                                                    74     
 74     if (!(NegVolPars || Deferred)) {               75     if (!(NegVolPars || Deferred)) { 
 75       solid = new G4Box(vname, pX, pY, pZ);        76       solid = new G4Box(vname, pX, pY, pZ);
 76     }                                              77     }
 77                                                    78 
 78   } else if ( shape == "TRD1" ) {                  79   } else if ( shape == "TRD1" ) {
 79     G4double pdx1 = rpar[0]*cm;                <<  80     G4double pdx1 = Rpar[0]*cm;
 80     G4double pdx2 = rpar[1]*cm;                <<  81     G4double pdx2 = Rpar[1]*cm;
 81     G4double pdy1 = rpar[2]*cm;                <<  82     G4double pdy1 = Rpar[2]*cm;
 82     G4double pdy2 = pdy1;                          83     G4double pdy2 = pdy1;
 83     G4double pdz  = rpar[3]*cm;                <<  84     G4double pdz  = Rpar[3]*cm;
 84                                                    85 
 85     OKAxis[1]=OKAxis[2]=true;                      86     OKAxis[1]=OKAxis[2]=true;
 86                                                    87 
 87     NegVolPars = pdx1<0 || pdx2<0 || pdy1<0 ||     88     NegVolPars = pdx1<0 || pdx2<0 || pdy1<0 || pdz<0;
 88                                                    89 
 89     if (!(NegVolPars || Deferred)) {               90     if (!(NegVolPars || Deferred)) {
 90       solid = new G4Trd(vname, pdx1, pdx2, pdy     91       solid = new G4Trd(vname, pdx1, pdx2, pdy1, pdy2, pdz);
 91     }                                              92     }
 92                                                    93 
 93   } else if ( shape == "TRD2" ) {                  94   } else if ( shape == "TRD2" ) {
 94     G4double pdx1 = rpar[0]*cm;                <<  95     G4double pdx1 = Rpar[0]*cm;
 95     G4double pdx2 = rpar[1]*cm;                <<  96     G4double pdx2 = Rpar[1]*cm;
 96     G4double pdy1 = rpar[2]*cm;                <<  97     G4double pdy1 = Rpar[2]*cm;
 97     G4double pdy2 = rpar[3]*cm;                <<  98     G4double pdy2 = Rpar[3]*cm;
 98     G4double pdz  = rpar[4]*cm;                <<  99     G4double pdz  = Rpar[4]*cm;
 99                                                   100 
100     OKAxis[2]=true;                               101     OKAxis[2]=true;
101                                                   102 
102     NegVolPars = pdx1<0 || pdx2<0 || pdy1<0 ||    103     NegVolPars = pdx1<0 || pdx2<0 || pdy1<0 || pdy2<0 || pdz<0;
103                                                   104  
104     if (!(NegVolPars || Deferred)) {              105     if (!(NegVolPars || Deferred)) {
105       solid = new G4Trd(vname, pdx1, pdx2, pdy    106       solid = new G4Trd(vname, pdx1, pdx2, pdy1, pdy2, pdz);
106     }                                             107     }
107                                                   108 
108   } else if ( shape == "TRAP" ) {                 109   } else if ( shape == "TRAP" ) {
109     G4double pDz    = rpar[0]*cm;              << 110     G4double pDz    = Rpar[0]*cm;
110     G4double pTheta = rpar[1]*deg;             << 111     G4double pTheta = Rpar[1]*deg;
111     G4double pPhi   = rpar[2]*deg;             << 112     G4double pPhi   = Rpar[2]*deg;
112     G4double pDy1   = rpar[3]*cm;              << 113     G4double pDy1   = Rpar[3]*cm;
113     G4double pDx1   = rpar[4]*cm;              << 114     G4double pDx1   = Rpar[4]*cm;
114     G4double pDx2   = rpar[5]*cm;              << 115     G4double pDx2   = Rpar[5]*cm;
115     G4double pAlp1  = rpar[6]*deg;             << 116     G4double pAlp1  = Rpar[6]*deg;
116     G4double pDy2   = rpar[7]*cm;              << 117     G4double pDy2   = Rpar[7]*cm;
117     G4double pDx3   = rpar[8]*cm;              << 118     G4double pDx3   = Rpar[8]*cm;
118     G4double pDx4   = rpar[9]*cm;              << 119     G4double pDx4   = Rpar[9]*cm;
119     G4double pAlp2  = rpar[10]*deg;            << 120     G4double pAlp2  = Rpar[10]*deg;
120                                                   121 
121     OKAxis[2]=true;                               122     OKAxis[2]=true;
122                                                   123 
123     NegVolPars= pDz<0 || pDy1<0 || pDx1<0 || p    124     NegVolPars= pDz<0 || pDy1<0 || pDx1<0 || pDx2<0 || pDy2<0 || pDx3<0 || pDx4<0;
124                                                   125 
125     if (!(NegVolPars || Deferred)) {              126     if (!(NegVolPars || Deferred)) {
126       // added for test only                      127       // added for test only 
127       if (!(pDz>0))  pDz  += 0.001*cm;            128       if (!(pDz>0))  pDz  += 0.001*cm;
128       if (!(pDy1>0)) pDy1 += 0.001*cm;            129       if (!(pDy1>0)) pDy1 += 0.001*cm;
129       if (!(pDx1>0)) pDx1 += 0.001*cm;            130       if (!(pDx1>0)) pDx1 += 0.001*cm;
130       if (!(pDx2>0)) pDx2 += 0.001*cm;            131       if (!(pDx2>0)) pDx2 += 0.001*cm;
131       if (!(pDy2>0)) pDy2 += 0.001*cm;            132       if (!(pDy2>0)) pDy2 += 0.001*cm;
132       if (!(pDx3>0)) pDx3 += 0.001*cm;            133       if (!(pDx3>0)) pDx3 += 0.001*cm;
133       if (!(pDx4>0)) pDx4 += 0.001*cm;            134       if (!(pDx4>0)) pDx4 += 0.001*cm;
134                                                   135     
135       solid = new                                 136       solid = new 
136   G4Trap(vname, pDz, pTheta, pPhi, pDy1, pDx1,    137   G4Trap(vname, pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, 
137          pDx4, pAlp2);                            138          pDx4, pAlp2);
138     }                                             139     }
139                                                   140 
140   } else if ( shape == "TUBE" ) {                 141   } else if ( shape == "TUBE" ) {
141     G4double pRMin = rpar[0]*cm;               << 142     G4double pRMin = Rpar[0]*cm;
142     G4double pRMax = rpar[1]*cm;               << 143     G4double pRMax = Rpar[1]*cm;
143     G4double pDz   = rpar[2]*cm;               << 144     G4double pDz   = Rpar[2]*cm;
144     G4double pSPhi = 0.*deg;                      145     G4double pSPhi = 0.*deg;
145     G4double pDPhi = 360.*deg;                    146     G4double pDPhi = 360.*deg;
146                                                   147     
147     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           148     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
148                                                   149 
149     NegVolPars = pRMin<0 || pRMax<0 || pDz<0;     150     NegVolPars = pRMin<0 || pRMax<0 || pDz<0;
150                                                   151     
151     if (!(NegVolPars || Deferred)) {              152     if (!(NegVolPars || Deferred)) {
152       solid = new G4Tubs(vname, pRMin, pRMax,     153       solid = new G4Tubs(vname, pRMin, pRMax, pDz, pSPhi, pDPhi);
153     }                                             154     }
154                                                   155 
155   } else if ( shape == "TUBS" ) {                 156   } else if ( shape == "TUBS" ) {
156     G4double pRMin = rpar[0]*cm;               << 157     G4double pRMin = Rpar[0]*cm;
157     G4double pRMax = rpar[1]*cm;               << 158     G4double pRMax = Rpar[1]*cm;
158     G4double pDz   = rpar[2]*cm;               << 159     G4double pDz   = Rpar[2]*cm;
159     G4double pSPhi = rpar[3]*deg;              << 160     G4double pSPhi = Rpar[3]*deg;
160     G4double pDPhi = rpar[4]*deg - pSPhi;      << 161     G4double pDPhi = Rpar[4]*deg - pSPhi;
161     if ( rpar[4]*deg <= pSPhi ) pDPhi = pDPhi  << 162     if ( Rpar[4]*deg <= pSPhi ) pDPhi = pDPhi + 360.*deg;
162                                                   163 
163     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           164     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
164                                                   165 
165     NegVolPars = pRMin<0 || pRMax<0 || pDz<0;     166     NegVolPars = pRMin<0 || pRMax<0 || pDz<0;
166                                                   167 
167     if (!(NegVolPars || Deferred)){               168     if (!(NegVolPars || Deferred)){
168       solid = new G4Tubs(vname, pRMin, pRMax,     169       solid = new G4Tubs(vname, pRMin, pRMax, pDz, pSPhi, pDPhi);
169     }                                             170     }
170                                                   171 
171   } else if ( shape == "CONE" ) {                 172   } else if ( shape == "CONE" ) {
172     G4double pDz    = rpar[0]*cm;              << 173     G4double pDz    = Rpar[0]*cm;
173     G4double pRmin1 = rpar[1]*cm;              << 174     G4double pRmin1 = Rpar[1]*cm;
174     G4double pRmax1 = rpar[2]*cm;              << 175     G4double pRmax1 = Rpar[2]*cm;
175     G4double pRmin2 = rpar[3]*cm;              << 176     G4double pRmin2 = Rpar[3]*cm;
176     G4double pRmax2 = rpar[4]*cm;              << 177     G4double pRmax2 = Rpar[4]*cm;
177     G4double pSPhi = 0.*deg;                      178     G4double pSPhi = 0.*deg;
178     G4double pDPhi = 360.*deg;                    179     G4double pDPhi = 360.*deg;
179                                                   180 
180     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           181     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
181                                                   182 
182     NegVolPars = pDz<0 || pRmin1<0 || pRmax1<0    183     NegVolPars = pDz<0 || pRmin1<0 || pRmax1<0 || pRmin2<0 || pRmax2<0;
183                                                   184 
184     if (!(NegVolPars || Deferred)){               185     if (!(NegVolPars || Deferred)){
185       solid = new                                 186       solid = new 
186   G4Cons(vname, pRmin1, pRmax1, pRmin2, pRmax2    187   G4Cons(vname, pRmin1, pRmax1, pRmin2, pRmax2, pDz, pSPhi, pDPhi);
187     }                                             188     }
188                                                   189 
189   } else if ( shape == "CONS" ) {                 190   } else if ( shape == "CONS" ) {
190     G4double pDz    = rpar[0]*cm;              << 191     G4double pDz    = Rpar[0]*cm;
191     G4double pRmin1 = rpar[1]*cm;              << 192     G4double pRmin1 = Rpar[1]*cm;
192     G4double pRmax1 = rpar[2]*cm;              << 193     G4double pRmax1 = Rpar[2]*cm;
193     G4double pRmin2 = rpar[3]*cm;              << 194     G4double pRmin2 = Rpar[3]*cm;
194     G4double pRmax2 = rpar[4]*cm;              << 195     G4double pRmax2 = Rpar[4]*cm;
195     G4double pSPhi  = rpar[5]*deg;             << 196     G4double pSPhi  = Rpar[5]*deg;
196     G4double pDPhi  = rpar[6]*deg - pSPhi;     << 197     G4double pDPhi  = Rpar[6]*deg - pSPhi;
197     if ( rpar[6]*deg <= pSPhi ) pDPhi = pDPhi  << 198     if ( Rpar[6]*deg <= pSPhi ) pDPhi = pDPhi + 360.*deg;
198                                                   199 
199     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           200     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
200                                                   201 
201     NegVolPars = pDz<0 || pRmin1<0 || pRmax1<0    202     NegVolPars = pDz<0 || pRmin1<0 || pRmax1<0 || pRmin2<0 || pRmax2<0;
202                                                   203 
203     if (!(NegVolPars || Deferred)){               204     if (!(NegVolPars || Deferred)){
204       solid = new                                 205       solid = new 
205   G4Cons(vname, pRmin1, pRmax1, pRmin2, pRmax2    206   G4Cons(vname, pRmin1, pRmax1, pRmin2, pRmax2, pDz, pSPhi, pDPhi);
206     }                                             207     }
207                                                   208 
208   } else if ( shape == "SPHE" ) {                 209   } else if ( shape == "SPHE" ) {
209     G4double pRmin  = rpar[0]*cm;              << 210     G4double pRmin  = Rpar[0]*cm;
210     G4double pRmax  = rpar[1]*cm;              << 211     G4double pRmax  = Rpar[1]*cm;
211     G4double pThe1  = rpar[2]*deg;             << 212     G4double pThe1  = Rpar[2]*deg;
212     G4double pThe2  = rpar[3]*deg;             << 213     G4double pThe2  = Rpar[3]*deg;
213     G4double pDThe  = pThe2 - pThe1;              214     G4double pDThe  = pThe2 - pThe1;
214     G4double pPhi1  = rpar[4]*deg;             << 215     G4double pPhi1  = Rpar[4]*deg;
215     G4double pPhi2  = rpar[5]*deg;             << 216     G4double pPhi2  = Rpar[5]*deg;
216     G4double pDPhi  = pPhi2 - pPhi1;              217     G4double pDPhi  = pPhi2 - pPhi1;
217                                                   218 
218     NegVolPars = pRmin<0 || pRmax<0;              219     NegVolPars = pRmin<0 || pRmax<0;
219                                                   220 
220     if (!(NegVolPars || Deferred)) {              221     if (!(NegVolPars || Deferred)) {
221       solid = new G4Sphere(vname, pRmin, pRmax    222       solid = new G4Sphere(vname, pRmin, pRmax, pPhi1, pDPhi, pThe1, pDThe);
222     }                                             223     }
223                                                   224 
224   } else if ( shape == "PARA" ) {                 225   } else if ( shape == "PARA" ) {
225     G4double pDx = rpar[0]*cm;                 << 226     G4double pDx = Rpar[0]*cm;
226     G4double pDy = rpar[1]*cm;                 << 227     G4double pDy = Rpar[1]*cm;
227     G4double pDz = rpar[2]*cm;                 << 228     G4double pDz = Rpar[2]*cm;
228     G4double pAlph = rpar[3]*deg;              << 229     G4double pAlph = Rpar[3]*deg;
229     G4double pThet = rpar[4]*deg;              << 230     G4double pThet = Rpar[4]*deg;
230     G4double pPhi  = rpar[5]*deg;              << 231     G4double pPhi  = Rpar[5]*deg;
231                                                   232 
232     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           233     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
233                                                   234 
234     NegVolPars = pDx<0 || pDy<0 || pDz<0;         235     NegVolPars = pDx<0 || pDy<0 || pDz<0;
235                                                   236 
236     if (!(NegVolPars || Deferred)){               237     if (!(NegVolPars || Deferred)){
237       solid = new G4Para(vname, pDx, pDy, pDz,    238       solid = new G4Para(vname, pDx, pDy, pDz, pAlph, pThet, pPhi);
238     }                                             239     }
239                                                   240 
240   } else if ( shape == "PGON" ) {                 241   } else if ( shape == "PGON" ) {
241     G4int i;                                      242     G4int i;
242     G4int npdv = G4int(rpar[2]);               << 243     G4int npdv = G4int(Rpar[2]);
243     G4int nz = G4int(rpar[3]);                 << 244     G4int nz = G4int(Rpar[3]);
244     G4double pPhi1 = rpar[0]*deg;              << 245     G4double pPhi1 = Rpar[0]*deg;
245     G4double dPhi  = rpar[1]*deg;              << 246     G4double dPhi  = Rpar[1]*deg;
246     G4double *DzArray = new G4double[nz];         247     G4double *DzArray = new G4double[nz];
247     G4double *Rmax    = new G4double[nz];         248     G4double *Rmax    = new G4double[nz];
248     G4double *Rmin    = new G4double[nz];         249     G4double *Rmin    = new G4double[nz];
249                                                   250 
250     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           251     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
251                                                   252 
252     NegVolPars = 0;                               253     NegVolPars = 0;
253                                                   254 
254     for(i=0; i<nz; i++) {                         255     for(i=0; i<nz; i++) {
255       G4int i4=3*i+4;                             256       G4int i4=3*i+4;
256       G4int i5=i4+1;                              257       G4int i5=i4+1;
257       G4int i6=i4+2;                              258       G4int i6=i4+2;
258       DzArray[i] = rpar[i4]*cm;                << 259       DzArray[i] = Rpar[i4]*cm;
259       Rmin[i] = rpar[i5]*cm;                   << 260       Rmin[i] = Rpar[i5]*cm;
260       Rmax[i] = rpar[i6]*cm;                   << 261       Rmax[i] = Rpar[i6]*cm;
261     }                                             262     }
262     solid = new G4Polyhedra(vname, pPhi1, dPhi    263     solid = new G4Polyhedra(vname, pPhi1, dPhi, npdv, nz, DzArray, Rmin, Rmax);
263     delete [] DzArray;                            264     delete [] DzArray;
264     delete [] Rmin;                               265     delete [] Rmin;
265     delete [] Rmax;                               266     delete [] Rmax;
266                                                   267 
267   } else if ( shape == "PCON" ) {                 268   } else if ( shape == "PCON" ) {
268     G4int i;                                      269     G4int i;
269     G4double pPhi1 =  rpar[0]*deg;             << 270     G4double pPhi1 =  Rpar[0]*deg;
270     G4double dPhi  = rpar[1]*deg;              << 271     G4double dPhi  = Rpar[1]*deg;    
271     G4int nz = G4int(rpar[2]);                 << 272     G4int nz = G4int(Rpar[2]);
272     G4double *DzArray = new G4double[nz];         273     G4double *DzArray = new G4double[nz];
273     G4double *Rmax    = new G4double[nz];         274     G4double *Rmax    = new G4double[nz];
274     G4double *Rmin    = new G4double[nz];         275     G4double *Rmin    = new G4double[nz];
275                                                   276 
276     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           277     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
277                                                   278 
278     NegVolPars = 0;                               279     NegVolPars = 0;
279                                                   280 
280     for(i=0; i<nz; i++){                          281     for(i=0; i<nz; i++){
281       G4int i4=3*i+3;                             282       G4int i4=3*i+3;
282       G4int i5=i4+1;                              283       G4int i5=i4+1;
283       G4int i6=i4+2;                              284       G4int i6=i4+2;
284       DzArray[i] = rpar[i4]*cm;                << 285       DzArray[i] = Rpar[i4]*cm;
285       Rmin[i] = rpar[i5]*cm;                   << 286       Rmin[i] = Rpar[i5]*cm;
286       Rmax[i] = rpar[i6]*cm;                   << 287       Rmax[i] = Rpar[i6]*cm;
287     }                                             288     }
288     solid = new G4Polycone(vname, pPhi1, dPhi,    289     solid = new G4Polycone(vname, pPhi1, dPhi, nz, DzArray, Rmin, Rmax);
289     delete [] DzArray;                            290     delete [] DzArray;
290     delete [] Rmin;                               291     delete [] Rmin;
291     delete [] Rmax;                               292     delete [] Rmax;
292                                                   293 
293   } else if ( shape == "ELTU" ) {                 294   } else if ( shape == "ELTU" ) {
294     G4double dX = rpar[0]*cm;                  << 295     G4double dX = Rpar[0]*cm;
295     G4double dY = rpar[1]*cm;                  << 296     G4double dY = Rpar[1]*cm;
296     G4double dZ = rpar[2]*cm;                  << 297     G4double dZ = Rpar[2]*cm;
297                                                   298 
298     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;           299     OKAxis[0]=OKAxis[1]=OKAxis[2]=true;
299                                                   300     
300     NegVolPars = dX<0 || dY<0 || dZ<0;            301     NegVolPars = dX<0 || dY<0 || dZ<0;
301                                                   302     
302     if (!(NegVolPars || Deferred)) {              303     if (!(NegVolPars || Deferred)) { 
303       solid = new G4EllipticalTube(vname, dX,     304       solid = new G4EllipticalTube(vname, dX, dY, dZ);
304     }                                             305     }
305                                                   306 
306   } else if ( shape == "HYPE" ) {                 307   } else if ( shape == "HYPE" ) {
307     G4double pRmin = rpar[0]*cm;               << 308     G4double pRmin = Rpar[0]*cm;
308     G4double pRmax = rpar[1]*cm;               << 309     G4double pRmax = Rpar[1]*cm;
309     G4double pDz   = rpar[2]*cm;               << 310     G4double pDz   = Rpar[2]*cm;
310     G4double pThet = rpar[3]*deg;              << 311     G4double pThet = Rpar[3]*deg;
311                                                   312 
312     NegVolPars = pRmin<0 || pRmax<0 || pDz<0;     313     NegVolPars = pRmin<0 || pRmax<0 || pDz<0;
313                                                   314 
314     if (!(NegVolPars || Deferred)){               315     if (!(NegVolPars || Deferred)){
315       solid = new G4Hype(vname, pRmin, pRmax,     316       solid = new G4Hype(vname, pRmin, pRmax, pThet, pThet, pDz);
316     } else {                                      317     } else {
317       G4cerr << "Negative length parameters no    318       G4cerr << "Negative length parameters not supported for shape " 
318        << shape << G4endl;                        319        << shape << G4endl;
319     }                                             320     }
320                                                   321 
321   } else if ( shape == "GTRA" ) {                 322   } else if ( shape == "GTRA" ) {
322     // $$$ not implemented.                       323     // $$$ not implemented.
323     G4cerr << "GTRA not supported" << G4endl;     324     G4cerr << "GTRA not supported" << G4endl;
324                                                   325 
325   } else if ( shape == "CTUB" ) {                 326   } else if ( shape == "CTUB" ) {
326     // $$$ not implemented.                       327     // $$$ not implemented.
327     G4cerr << "CTUB not supported" << G4endl;     328     G4cerr << "CTUB not supported" << G4endl;
328   }                                               329   }
329   return solid;                                   330   return solid;
330 }                                                 331 }
331                                                   332 
332                                                   333 
333                                                   334 
334                                                   335 
335                                                   336 
336                                                   337 
337                                                   338 
338                                                   339 
339                                                   340 
340                                                   341 
341                                                   342