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 4.0)


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