Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/geometry/divisions/src/G4ParameterisationTubs.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 /geometry/divisions/src/G4ParameterisationTubs.cc (Version 11.3.0) and /geometry/divisions/src/G4ParameterisationTubs.cc (Version 10.7.p2)


  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 // G4ParameterisationTubs[Rho/Phi/Z] implement     26 // G4ParameterisationTubs[Rho/Phi/Z] implementation
 27 //                                                 27 //
 28 // 26.05.03 - P.Arce, Initial version              28 // 26.05.03 - P.Arce, Initial version
 29 // 08.04.04 - I.Hrivnacova, Implemented reflec     29 // 08.04.04 - I.Hrivnacova, Implemented reflection
 30 // 21.04.10 - M.Asai, Added gaps                   30 // 21.04.10 - M.Asai, Added gaps
 31 // -------------------------------------------     31 // --------------------------------------------------------------------
 32                                                    32 
 33 #include "G4ParameterisationTubs.hh"               33 #include "G4ParameterisationTubs.hh"
 34                                                    34 
 35 #include <iomanip>                                 35 #include <iomanip>
 36 #include "G4ThreeVector.hh"                        36 #include "G4ThreeVector.hh"
 37 #include "G4RotationMatrix.hh"                     37 #include "G4RotationMatrix.hh"
 38 #include "G4VPhysicalVolume.hh"                    38 #include "G4VPhysicalVolume.hh"
 39 #include "G4LogicalVolume.hh"                      39 #include "G4LogicalVolume.hh"
 40 #include "G4ReflectedSolid.hh"                     40 #include "G4ReflectedSolid.hh"
 41 #include "G4Tubs.hh"                               41 #include "G4Tubs.hh"
 42                                                    42 
 43 //--------------------------------------------     43 //--------------------------------------------------------------------------
 44 G4VParameterisationTubs::                          44 G4VParameterisationTubs::
 45 G4VParameterisationTubs( EAxis axis, G4int nDi     45 G4VParameterisationTubs( EAxis axis, G4int nDiv, G4double width,
 46                          G4double offset, G4VS     46                          G4double offset, G4VSolid* msolid,
 47                          DivisionType divType      47                          DivisionType divType )
 48   : G4VDivisionParameterisation( axis, nDiv, w     48   : G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
 49 {                                                  49 {
 50   auto msol = (G4Tubs*)(msolid);               <<  50   G4Tubs* msol = (G4Tubs*)(msolid);
 51   if (msolid->GetEntityType() == "G4ReflectedS     51   if (msolid->GetEntityType() == "G4ReflectedSolid")
 52   {                                                52   {
 53     //----- get constituent solid                  53     //----- get constituent solid  
 54     G4VSolid* mConstituentSolid                    54     G4VSolid* mConstituentSolid 
 55        = ((G4ReflectedSolid*)msolid)->GetConst     55        = ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid();
 56     msol = (G4Tubs*)(mConstituentSolid);           56     msol = (G4Tubs*)(mConstituentSolid);
 57     fmotherSolid = msol;                           57     fmotherSolid = msol;
 58     fReflectedSolid = true;                        58     fReflectedSolid = true;
 59   }                                                59   }    
 60 }                                                  60 }
 61                                                    61 
 62 //--------------------------------------------     62 //------------------------------------------------------------------------
 63 G4VParameterisationTubs::~G4VParameterisationT <<  63 G4VParameterisationTubs::~G4VParameterisationTubs()
                                                   >>  64 {
                                                   >>  65 }
 64                                                    66 
 65 //--------------------------------------------     67 //--------------------------------------------------------------------------
 66 G4ParameterisationTubsRho::                        68 G4ParameterisationTubsRho::
 67 G4ParameterisationTubsRho( EAxis axis, G4int n     69 G4ParameterisationTubsRho( EAxis axis, G4int nDiv,
 68                            G4double width, G4d     70                            G4double width, G4double offset,
 69                            G4VSolid* msolid, D     71                            G4VSolid* msolid, DivisionType divType )
 70   : G4VParameterisationTubs( axis, nDiv, width     72   : G4VParameterisationTubs( axis, nDiv, width, offset, msolid, divType )
 71 {                                                  73 {
 72   CheckParametersValidity();                       74   CheckParametersValidity();
 73   SetType( "DivisionTubsRho" );                    75   SetType( "DivisionTubsRho" );
 74                                                    76 
 75   auto msol = (G4Tubs*)(fmotherSolid);         <<  77   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
 76   if( divType == DivWIDTH )                        78   if( divType == DivWIDTH )
 77   {                                                79   {
 78     fnDiv = CalculateNDiv( msol->GetOuterRadiu     80     fnDiv = CalculateNDiv( msol->GetOuterRadius() - msol->GetInnerRadius(),
 79                            width, offset );        81                            width, offset );
 80   }                                                82   }
 81   else if( divType == DivNDIV )                    83   else if( divType == DivNDIV )
 82   {                                                84   {
 83     fwidth = CalculateWidth( msol->GetOuterRad     85     fwidth = CalculateWidth( msol->GetOuterRadius() - msol->GetInnerRadius(),
 84                              nDiv, offset );       86                              nDiv, offset );
 85   }                                                87   }
 86                                                    88 
 87 #ifdef G4DIVDEBUG                                  89 #ifdef G4DIVDEBUG
 88   if( verbose >= 1 )                               90   if( verbose >= 1 )
 89   {                                                91   {
 90     G4cout << " G4ParameterisationTubsRho - no     92     G4cout << " G4ParameterisationTubsRho - no divisions " << fnDiv << " = "
 91            << nDiv << G4endl                       93            << nDiv << G4endl
 92            << " Offset " << foffset << " = " <     94            << " Offset " << foffset << " = " << offset << G4endl
 93            << " Width " << fwidth << " = " <<      95            << " Width " << fwidth << " = " << width << G4endl
 94            << " DivType " << divType << G4endl     96            << " DivType " << divType << G4endl;
 95   }                                                97   }
 96 #endif                                             98 #endif
 97 }                                                  99 }
 98                                                   100 
 99 //--------------------------------------------    101 //--------------------------------------------------------------------------
100 G4ParameterisationTubsRho::~G4Parameterisation << 102 G4ParameterisationTubsRho::~G4ParameterisationTubsRho()
                                                   >> 103 {
                                                   >> 104 }
101                                                   105 
102 //--------------------------------------------    106 //------------------------------------------------------------------------
103 G4double G4ParameterisationTubsRho::GetMaxPara    107 G4double G4ParameterisationTubsRho::GetMaxParameter() const
104 {                                                 108 {
105   auto msol = (G4Tubs*)(fmotherSolid);         << 109   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
106   return msol->GetOuterRadius() - msol->GetInn    110   return msol->GetOuterRadius() - msol->GetInnerRadius();
107 }                                                 111 }
108                                                   112 
109                                                   113 
110 //--------------------------------------------    114 //--------------------------------------------------------------------------
111 void                                              115 void
112 G4ParameterisationTubsRho::                       116 G4ParameterisationTubsRho::
113 ComputeTransformation(const G4int, G4VPhysical    117 ComputeTransformation(const G4int, G4VPhysicalVolume* physVol) const
114 {                                                 118 {
115   //----- translation                             119   //----- translation 
116   G4ThreeVector origin(0.,0.,0.);                 120   G4ThreeVector origin(0.,0.,0.); 
117   //----- set translation                         121   //----- set translation 
118   physVol->SetTranslation( origin );              122   physVol->SetTranslation( origin );
119                                                   123 
120   //----- calculate rotation matrix: unit         124   //----- calculate rotation matrix: unit
121                                                   125 
122 #ifdef G4DIVDEBUG                                 126 #ifdef G4DIVDEBUG
123   if( verbose >= 2 )                              127   if( verbose >= 2 )
124   {                                               128   {
125     G4cout << " G4ParameterisationTubsRho " <<    129     G4cout << " G4ParameterisationTubsRho " << G4endl
126            << " Offset: " << foffset/CLHEP::de << 130            << " Offset: " << foffset/deg
127            << " - Width: " << fwidth/CLHEP::de << 131            << " - Width: " << fwidth/deg << G4endl;
128   }                                               132   }
129 #endif                                            133 #endif
130                                                   134 
131   ChangeRotMatrix( physVol );                     135   ChangeRotMatrix( physVol );
132                                                   136 
133 #ifdef G4DIVDEBUG                                 137 #ifdef G4DIVDEBUG
134   if( verbose >= 2 )                              138   if( verbose >= 2 )
135   {                                               139   {
136     G4cout << std::setprecision(8) << " G4Para    140     G4cout << std::setprecision(8) << " G4ParameterisationTubsRho " << G4endl
137            << " Position: " << origin << " - W    141            << " Position: " << origin << " - Width: " << fwidth
138            << " - Axis " << faxis  << G4endl;     142            << " - Axis " << faxis  << G4endl;
139   }                                               143   }
140 #endif                                            144 #endif
141 }                                                 145 }
142                                                   146 
143 //--------------------------------------------    147 //--------------------------------------------------------------------------
144 void                                              148 void
145 G4ParameterisationTubsRho::                       149 G4ParameterisationTubsRho::
146 ComputeDimensions( G4Tubs& tubs, const G4int c    150 ComputeDimensions( G4Tubs& tubs, const G4int copyNo,
147                    const G4VPhysicalVolume* )     151                    const G4VPhysicalVolume* ) const
148 {                                                 152 {
149   auto msol = (G4Tubs*)(fmotherSolid);         << 153   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
150                                                   154 
151   G4double pRMin = msol->GetInnerRadius() + fo    155   G4double pRMin = msol->GetInnerRadius() + foffset + fwidth*copyNo + fhgap;
152   G4double pRMax = msol->GetInnerRadius() + fo    156   G4double pRMax = msol->GetInnerRadius() + foffset + fwidth*(copyNo+1) - fhgap;
153   G4double pDz = msol->GetZHalfLength();          157   G4double pDz = msol->GetZHalfLength();
154   //- already rotated  G4double pSR = foffset     158   //- already rotated  G4double pSR = foffset + copyNo*fwidth;
155   G4double pSPhi = msol->GetStartPhiAngle();      159   G4double pSPhi = msol->GetStartPhiAngle();
156   G4double pDPhi = msol->GetDeltaPhiAngle();;     160   G4double pDPhi = msol->GetDeltaPhiAngle();;
157                                                   161 
158   tubs.SetInnerRadius( pRMin );                   162   tubs.SetInnerRadius( pRMin );
159   tubs.SetOuterRadius( pRMax );                   163   tubs.SetOuterRadius( pRMax );
160   tubs.SetZHalfLength( pDz );                     164   tubs.SetZHalfLength( pDz );
161   tubs.SetStartPhiAngle( pSPhi, false );          165   tubs.SetStartPhiAngle( pSPhi, false );
162   tubs.SetDeltaPhiAngle( pDPhi );                 166   tubs.SetDeltaPhiAngle( pDPhi );
163                                                   167 
164 #ifdef G4DIVDEBUG                                 168 #ifdef G4DIVDEBUG
165   if( verbose >= 2 )                              169   if( verbose >= 2 )
166   {                                               170   {
167     G4cout << " G4ParameterisationTubsRho::Com    171     G4cout << " G4ParameterisationTubsRho::ComputeDimensions()" << G4endl
168            << " pRMin: " << pRMin << " - pRMax    172            << " pRMin: " << pRMin << " - pRMax: " << pRMax << G4endl;
169     tubs.DumpInfo();                              173     tubs.DumpInfo();
170   }                                               174   }
171 #endif                                            175 #endif
172 }                                                 176 }
173                                                   177 
174 //--------------------------------------------    178 //--------------------------------------------------------------------------
175 G4ParameterisationTubsPhi::                       179 G4ParameterisationTubsPhi::
176 G4ParameterisationTubsPhi( EAxis axis, G4int n    180 G4ParameterisationTubsPhi( EAxis axis, G4int nDiv,
177                            G4double width, G4d    181                            G4double width, G4double offset,
178                            G4VSolid* msolid, D    182                            G4VSolid* msolid, DivisionType divType )
179   : G4VParameterisationTubs( axis, nDiv, width    183   : G4VParameterisationTubs( axis, nDiv, width, offset, msolid, divType )
180 {                                                 184 { 
181   CheckParametersValidity();                      185   CheckParametersValidity();
182   SetType( "DivisionTubsPhi" );                   186   SetType( "DivisionTubsPhi" );
183                                                   187 
184   auto msol = (G4Tubs*)(fmotherSolid);         << 188   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
185   if( divType == DivWIDTH )                       189   if( divType == DivWIDTH )
186   {                                               190   {
187     fnDiv = CalculateNDiv( msol->GetDeltaPhiAn    191     fnDiv = CalculateNDiv( msol->GetDeltaPhiAngle(), width, offset );
188   }                                               192   }
189   else if( divType == DivNDIV )                   193   else if( divType == DivNDIV )
190   {                                               194   {
191     fwidth = CalculateWidth( msol->GetDeltaPhi    195     fwidth = CalculateWidth( msol->GetDeltaPhiAngle(), nDiv, offset );
192   }                                               196   }
193                                                   197 
194 #ifdef G4DIVDEBUG                                 198 #ifdef G4DIVDEBUG
195   if( verbose >= 1 )                              199   if( verbose >= 1 )
196   {                                               200   {
197     G4cout << " G4ParameterisationTubsPhi no d    201     G4cout << " G4ParameterisationTubsPhi no divisions " << fnDiv << " = "
198            << nDiv << G4endl                      202            << nDiv << G4endl
199            << " Offset " << foffset << " = " <    203            << " Offset " << foffset << " = " << offset << G4endl
200            << " Width " << fwidth << " = " <<     204            << " Width " << fwidth << " = " << width << G4endl;
201   }                                               205   }
202 #endif                                            206 #endif
203 }                                                 207 }
204                                                   208 
205 //--------------------------------------------    209 //--------------------------------------------------------------------------
206 G4ParameterisationTubsPhi::~G4Parameterisation << 210 G4ParameterisationTubsPhi::~G4ParameterisationTubsPhi()
                                                   >> 211 {
                                                   >> 212 }
207                                                   213 
208 //--------------------------------------------    214 //------------------------------------------------------------------------
209 G4double G4ParameterisationTubsPhi::GetMaxPara    215 G4double G4ParameterisationTubsPhi::GetMaxParameter() const
210 {                                                 216 {
211   auto msol = (G4Tubs*)(fmotherSolid);         << 217   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
212   return msol->GetDeltaPhiAngle();                218   return msol->GetDeltaPhiAngle();
213 }                                                 219 }
214                                                   220 
215 //--------------------------------------------    221 //--------------------------------------------------------------------------
216 void                                              222 void
217 G4ParameterisationTubsPhi::                       223 G4ParameterisationTubsPhi::
218 ComputeTransformation(const G4int copyNo, G4VP    224 ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
219 {                                                 225 {
220   //----- translation                             226   //----- translation 
221   G4ThreeVector origin(0.,0.,0.);                 227   G4ThreeVector origin(0.,0.,0.); 
222   //----- set translation                         228   //----- set translation 
223   physVol->SetTranslation( origin );              229   physVol->SetTranslation( origin );
224                                                   230 
225   //----- calculate rotation matrix (so that a    231   //----- calculate rotation matrix (so that all volumes point to the centre)
226   G4double posi = foffset  + copyNo*fwidth;       232   G4double posi = foffset  + copyNo*fwidth;
227                                                   233 
228 #ifdef G4DIVDEBUG                                 234 #ifdef G4DIVDEBUG
229   if( verbose >= 2 )                              235   if( verbose >= 2 )
230   {                                               236   {
231     G4cout << " G4ParameterisationTubsPhi - po << 237     G4cout << " G4ParameterisationTubsPhi - position: " << posi/deg << G4endl
232            << " copyNo: " << copyNo << " - fof << 238            << " copyNo: " << copyNo << " - foffset: " << foffset/deg
233            << " - fwidth: " << fwidth/CLHEP::d << 239            << " - fwidth: " << fwidth/deg << G4endl;
234   }                                               240   }
235 #endif                                            241 #endif
236                                                   242 
237   ChangeRotMatrix( physVol, -posi );              243   ChangeRotMatrix( physVol, -posi );
238                                                   244 
239 #ifdef G4DIVDEBUG                                 245 #ifdef G4DIVDEBUG
240   if( verbose >= 2 )                              246   if( verbose >= 2 )
241   {                                               247   {
242     G4cout << std::setprecision(8) << " G4Para    248     G4cout << std::setprecision(8) << " G4ParameterisationTubsPhi " << copyNo
243            << G4endl                              249            << G4endl
244            << " Position: " << origin << " - W    250            << " Position: " << origin << " - Width: " << fwidth
245            << " - Axis: " << faxis  << G4endl;    251            << " - Axis: " << faxis  << G4endl;
246   }                                               252   }
247 #endif                                            253 #endif
248 }                                                 254 }
249                                                   255 
250 //--------------------------------------------    256 //--------------------------------------------------------------------------
251 void                                              257 void
252 G4ParameterisationTubsPhi::                       258 G4ParameterisationTubsPhi::
253 ComputeDimensions( G4Tubs& tubs, const G4int,     259 ComputeDimensions( G4Tubs& tubs, const G4int,
254                    const G4VPhysicalVolume* )     260                    const G4VPhysicalVolume* ) const
255 {                                                 261 {
256   auto msol = (G4Tubs*)(fmotherSolid);         << 262   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
257                                                   263 
258   G4double pRMin = msol->GetInnerRadius();        264   G4double pRMin = msol->GetInnerRadius();
259   G4double pRMax = msol->GetOuterRadius();        265   G4double pRMax = msol->GetOuterRadius();
260   G4double pDz = msol->GetZHalfLength();          266   G4double pDz = msol->GetZHalfLength();
261   //----- already rotated in 'ComputeTransform    267   //----- already rotated in 'ComputeTransformation'
262   G4double pSPhi = msol->GetStartPhiAngle() +     268   G4double pSPhi = msol->GetStartPhiAngle() + fhgap;
263   G4double pDPhi = fwidth - 2.*fhgap;             269   G4double pDPhi = fwidth - 2.*fhgap;
264                                                   270 
265   tubs.SetInnerRadius( pRMin );                   271   tubs.SetInnerRadius( pRMin );
266   tubs.SetOuterRadius( pRMax );                   272   tubs.SetOuterRadius( pRMax );
267   tubs.SetZHalfLength( pDz );                     273   tubs.SetZHalfLength( pDz );
268   tubs.SetStartPhiAngle( pSPhi, false );          274   tubs.SetStartPhiAngle( pSPhi, false );
269   tubs.SetDeltaPhiAngle( pDPhi );                 275   tubs.SetDeltaPhiAngle( pDPhi );
270                                                   276 
271 #ifdef G4DIVDEBUG                                 277 #ifdef G4DIVDEBUG
272   if( verbose >= 2 )                              278   if( verbose >= 2 )
273   {                                               279   {
274     G4cout << " G4ParameterisationTubsPhi::Com    280     G4cout << " G4ParameterisationTubsPhi::ComputeDimensions" << G4endl
275            << " pSPhi: " << pSPhi << " - pDPhi    281            << " pSPhi: " << pSPhi << " - pDPhi: " << pDPhi << G4endl;
276     tubs.DumpInfo();                              282     tubs.DumpInfo();
277   }                                               283   }
278 #endif                                            284 #endif
279 }                                                 285 }
280                                                   286 
281 //--------------------------------------------    287 //--------------------------------------------------------------------------
282 G4ParameterisationTubsZ::                         288 G4ParameterisationTubsZ::
283 G4ParameterisationTubsZ( EAxis axis, G4int nDi    289 G4ParameterisationTubsZ( EAxis axis, G4int nDiv,
284                          G4double width, G4dou    290                          G4double width, G4double offset,
285                          G4VSolid* msolid, Div    291                          G4VSolid* msolid, DivisionType divType )
286   : G4VParameterisationTubs( axis, nDiv, width    292   : G4VParameterisationTubs( axis, nDiv, width, offset, msolid, divType )
287 {                                                 293 { 
288   CheckParametersValidity();                      294   CheckParametersValidity();
289   SetType( "DivisionTubsZ" );                     295   SetType( "DivisionTubsZ" );
290                                                   296 
291   auto msol = (G4Tubs*)(fmotherSolid);         << 297   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
292   if( divType == DivWIDTH )                       298   if( divType == DivWIDTH )
293   {                                               299   {
294     fnDiv = CalculateNDiv( 2*msol->GetZHalfLen    300     fnDiv = CalculateNDiv( 2*msol->GetZHalfLength(), width, offset );
295   }                                               301   }
296   else if( divType == DivNDIV )                   302   else if( divType == DivNDIV )
297   {                                               303   {
298     fwidth = CalculateWidth( 2*msol->GetZHalfL    304     fwidth = CalculateWidth( 2*msol->GetZHalfLength(), nDiv, offset );
299   }                                               305   }
300                                                   306 
301 #ifdef G4DIVDEBUG                                 307 #ifdef G4DIVDEBUG
302   if( verbose >= 1 )                              308   if( verbose >= 1 )
303   {                                               309   {
304     G4cout << " G4ParameterisationTubsZ: # div    310     G4cout << " G4ParameterisationTubsZ: # divisions " << fnDiv << " = "
305            << nDiv << G4endl                      311            << nDiv << G4endl
306            << " Offset " << foffset << " = " <    312            << " Offset " << foffset << " = " << offset << G4endl
307            << " Width " << fwidth << " = " <<     313            << " Width " << fwidth << " = " << width << G4endl;
308   }                                               314   }
309 #endif                                            315 #endif
310 }                                                 316 }
311                                                   317 
312 //--------------------------------------------    318 //--------------------------------------------------------------------------
313 G4ParameterisationTubsZ::~G4ParameterisationTu << 319 G4ParameterisationTubsZ::~G4ParameterisationTubsZ()
                                                   >> 320 {
                                                   >> 321 }
314                                                   322 
315 //--------------------------------------------    323 //------------------------------------------------------------------------
316 G4double G4ParameterisationTubsZ::GetMaxParame    324 G4double G4ParameterisationTubsZ::GetMaxParameter() const
317 {                                                 325 {
318   auto msol = (G4Tubs*)(fmotherSolid);         << 326   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
319   return 2*msol->GetZHalfLength();                327   return 2*msol->GetZHalfLength();
320 }                                                 328 }
321                                                   329 
322 //--------------------------------------------    330 //--------------------------------------------------------------------------
323 void                                              331 void
324 G4ParameterisationTubsZ::                         332 G4ParameterisationTubsZ::
325 ComputeTransformation(const G4int copyNo, G4VP    333 ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
326 {                                                 334 {
327   //----- set translation: along Z axis           335   //----- set translation: along Z axis
328   auto motherTubs = (G4Tubs*)(fmotherSolid);   << 336   G4Tubs* motherTubs = (G4Tubs*)(fmotherSolid);
329   G4double posi = - motherTubs->GetZHalfLength    337   G4double posi = - motherTubs->GetZHalfLength() + OffsetZ() 
330                   + fwidth/2 + copyNo*fwidth;     338                   + fwidth/2 + copyNo*fwidth;
331   G4ThreeVector origin(0.,0.,posi);               339   G4ThreeVector origin(0.,0.,posi); 
332   physVol->SetTranslation( origin );              340   physVol->SetTranslation( origin );
333                                                   341 
334   //----- calculate rotation matrix: unit         342   //----- calculate rotation matrix: unit
335                                                   343 
336 #ifdef G4DIVDEBUG                                 344 #ifdef G4DIVDEBUG
337   if( verbose >= 2 )                              345   if( verbose >= 2 )
338   {                                               346   {
339     G4cout << " G4ParameterisationTubsZ::Compu    347     G4cout << " G4ParameterisationTubsZ::ComputeTransformation()" << G4endl
340            << " Position: " << posi << " - cop    348            << " Position: " << posi << " - copyNo: " << copyNo << G4endl
341            << " foffset " << foffset/CLHEP::de << 349            << " foffset " << foffset/deg << " - fwidth " << fwidth/deg
342            << G4endl;                             350            << G4endl;
343   }                                               351   }
344 #endif                                            352 #endif
345                                                   353 
346   ChangeRotMatrix( physVol );                     354   ChangeRotMatrix( physVol );
347                                                   355 
348 #ifdef G4DIVDEBUG                                 356 #ifdef G4DIVDEBUG
349   if( verbose >= 2 )                              357   if( verbose >= 2 )
350   {                                               358   {
351     G4cout << std::setprecision(8) << " G4Para    359     G4cout << std::setprecision(8) << " G4ParameterisationTubsZ " << copyNo
352            << G4endl                              360            << G4endl
353            << " Position: " << origin << " - W    361            << " Position: " << origin << " - Width: " << fwidth
354            << " - Axis: " << faxis  << G4endl;    362            << " - Axis: " << faxis  << G4endl; 
355   }                                               363   }
356 #endif                                            364 #endif
357 }                                                 365 }
358                                                   366 
359 //--------------------------------------------    367 //--------------------------------------------------------------------------
360 void                                              368 void
361 G4ParameterisationTubsZ::                         369 G4ParameterisationTubsZ::
362 ComputeDimensions( G4Tubs& tubs, const G4int,     370 ComputeDimensions( G4Tubs& tubs, const G4int,
363                    const G4VPhysicalVolume* )     371                    const G4VPhysicalVolume* ) const
364 {                                                 372 {
365   auto msol = (G4Tubs*)(fmotherSolid);         << 373   G4Tubs* msol = (G4Tubs*)(fmotherSolid);
366                                                   374 
367   G4double pRMin = msol->GetInnerRadius();        375   G4double pRMin = msol->GetInnerRadius();
368   G4double pRMax = msol->GetOuterRadius();        376   G4double pRMax = msol->GetOuterRadius();
369   //  G4double pDz = msol->GetZHalfLength() /     377   //  G4double pDz = msol->GetZHalfLength() / GetNoDiv();
370   G4double pDz = fwidth/2. - fhgap;               378   G4double pDz = fwidth/2. - fhgap;
371   G4double pSPhi = msol->GetStartPhiAngle();      379   G4double pSPhi = msol->GetStartPhiAngle();
372   G4double pDPhi = msol->GetDeltaPhiAngle();      380   G4double pDPhi = msol->GetDeltaPhiAngle();
373                                                   381 
374   tubs.SetInnerRadius( pRMin );                   382   tubs.SetInnerRadius( pRMin );
375   tubs.SetOuterRadius( pRMax );                   383   tubs.SetOuterRadius( pRMax );
376   tubs.SetZHalfLength( pDz );                     384   tubs.SetZHalfLength( pDz );
377   tubs.SetStartPhiAngle( pSPhi, false );          385   tubs.SetStartPhiAngle( pSPhi, false );
378   tubs.SetDeltaPhiAngle( pDPhi );                 386   tubs.SetDeltaPhiAngle( pDPhi );
379                                                   387 
380 #ifdef G4DIVDEBUG                                 388 #ifdef G4DIVDEBUG
381   if( verbose >= 2 )                              389   if( verbose >= 2 )
382   {                                               390   {
383     G4cout << " G4ParameterisationTubsZ::Compu    391     G4cout << " G4ParameterisationTubsZ::ComputeDimensions()" << G4endl
384            << " pDz: " << pDz << G4endl;          392            << " pDz: " << pDz << G4endl;
385     tubs.DumpInfo();                              393     tubs.DumpInfo();
386   }                                               394   }
387 #endif                                            395 #endif
388 }                                                 396 }
389                                                   397