Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/geometry/divisions/src/G4ParameterisationPara.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/G4ParameterisationPara.cc (Version 11.3.0) and /geometry/divisions/src/G4ParameterisationPara.cc (Version 10.4.p3)


  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 // class G4ParameterisationPara[X,Y,Z] impleme <<  26 //
                                                   >>  27 // $Id$
                                                   >>  28 //
                                                   >>  29 // class G4ParameterisationPara Implementation file
 27 //                                                 30 //
 28 // 26.05.03 - P.Arce, Initial version              31 // 26.05.03 - P.Arce, Initial version
 29 // 08.04.04 - I.Hrivnacova, Implemented reflec     32 // 08.04.04 - I.Hrivnacova, Implemented reflection
 30 // 21.04.10 - M.Asai, Added gaps                   33 // 21.04.10 - M.Asai, Added gaps
 31 // -------------------------------------------     34 // --------------------------------------------------------------------
 32                                                    35 
 33 #include "G4ParameterisationPara.hh"               36 #include "G4ParameterisationPara.hh"
 34                                                    37 
 35 #include <iomanip>                                 38 #include <iomanip>
 36                                                    39 
 37 #include "G4PhysicalConstants.hh"                  40 #include "G4PhysicalConstants.hh"
 38 #include "G4ThreeVector.hh"                        41 #include "G4ThreeVector.hh"
 39 #include "G4Transform3D.hh"                        42 #include "G4Transform3D.hh"
 40 #include "G4RotationMatrix.hh"                     43 #include "G4RotationMatrix.hh"
 41 #include "G4VPhysicalVolume.hh"                    44 #include "G4VPhysicalVolume.hh"
 42 #include "G4ReflectedSolid.hh"                     45 #include "G4ReflectedSolid.hh"
 43 #include "G4Para.hh"                               46 #include "G4Para.hh"
 44                                                    47 
 45 //--------------------------------------------     48 //--------------------------------------------------------------------------
 46 G4VParameterisationPara::                          49 G4VParameterisationPara::
 47 G4VParameterisationPara( EAxis axis, G4int nDi     50 G4VParameterisationPara( EAxis axis, G4int nDiv, G4double width,
 48                          G4double offset, G4VS     51                          G4double offset, G4VSolid* msolid,
 49                          DivisionType divType      52                          DivisionType divType )
 50   :  G4VDivisionParameterisation( axis, nDiv,      53   :  G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
 51 {                                                  54 {
 52   auto msol = (G4Para*)(msolid);               <<  55   G4Para* msol = (G4Para*)(msolid);
 53   if (msolid->GetEntityType() == "G4ReflectedS     56   if (msolid->GetEntityType() == "G4ReflectedSolid")
 54   {                                                57   {
 55     // Get constituent solid                       58     // Get constituent solid  
 56     G4VSolid* mConstituentSolid                    59     G4VSolid* mConstituentSolid 
 57        = ((G4ReflectedSolid*)msolid)->GetConst     60        = ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid();
 58     msol = (G4Para*)(mConstituentSolid);           61     msol = (G4Para*)(mConstituentSolid);
 59     fmotherSolid = msol;                           62     fmotherSolid = msol;
 60                                                    63 
 61     // Create a new solid with inversed parame     64     // Create a new solid with inversed parameters
 62     auto newSolid                              <<  65     G4Para* newSolid
 63       = new G4Para(msol->GetName(),                66       = new G4Para(msol->GetName(),
 64                    msol->GetXHalfLength(),         67                    msol->GetXHalfLength(), 
 65                    msol->GetYHalfLength(),         68                    msol->GetYHalfLength(),
 66                    msol->GetZHalfLength(),         69                    msol->GetZHalfLength(),
 67                    std::atan(msol->GetTanAlpha     70                    std::atan(msol->GetTanAlpha()),
 68                    pi - msol->GetSymAxis().the     71                    pi - msol->GetSymAxis().theta(),
 69                    msol->GetSymAxis().phi());      72                    msol->GetSymAxis().phi());
 70                                                    73    
 71     msol = newSolid;                               74     msol = newSolid;
 72     fmotherSolid = newSolid;                       75     fmotherSolid = newSolid;
 73     fReflectedSolid = true;                        76     fReflectedSolid = true;
 74     fDeleteSolid = true;                           77     fDeleteSolid = true;
 75   }                                                78   }    
 76 }                                                  79 }
 77                                                    80 
 78 //--------------------------------------------     81 //------------------------------------------------------------------------
 79 G4VParameterisationPara::~G4VParameterisationP <<  82 G4VParameterisationPara::~G4VParameterisationPara()
                                                   >>  83 {
                                                   >>  84 }
 80                                                    85 
 81 //--------------------------------------------     86 //------------------------------------------------------------------------
 82 G4ParameterisationParaX::                          87 G4ParameterisationParaX::
 83 G4ParameterisationParaX( EAxis axis, G4int nDi     88 G4ParameterisationParaX( EAxis axis, G4int nDiv,
 84                          G4double width, G4dou     89                          G4double width, G4double offset,
 85                          G4VSolid* msolid, Div     90                          G4VSolid* msolid, DivisionType divType )
 86   :  G4VParameterisationPara( axis, nDiv, widt     91   :  G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
 87 {                                                  92 {
 88   CheckParametersValidity();                       93   CheckParametersValidity();
 89   SetType( "DivisionParaX" );                      94   SetType( "DivisionParaX" );
 90                                                    95 
 91   auto mpara = (G4Para*)(fmotherSolid);        <<  96   G4Para* mpara = (G4Para*)(fmotherSolid);
 92   if( divType == DivWIDTH )                        97   if( divType == DivWIDTH )
 93   {                                                98   {
 94     fnDiv = CalculateNDiv( 2*mpara->GetXHalfLe     99     fnDiv = CalculateNDiv( 2*mpara->GetXHalfLength(), width, offset );
 95   }                                               100   }
 96   else if( divType == DivNDIV )                   101   else if( divType == DivNDIV )
 97   {                                               102   {
 98     fwidth = CalculateWidth( 2*mpara->GetXHalf    103     fwidth = CalculateWidth( 2*mpara->GetXHalfLength(), nDiv, offset );
 99   }                                               104   }
100                                                   105 
101 #ifdef G4DIVDEBUG                                 106 #ifdef G4DIVDEBUG
102   if( verbose >= 1 )                              107   if( verbose >= 1 )
103   {                                               108   {
104     G4cout << " G4ParameterisationParaX - # di    109     G4cout << " G4ParameterisationParaX - # divisions " << fnDiv
105            << " = " << nDiv << G4endl             110            << " = " << nDiv << G4endl
106            << " Offset " << foffset << " = " <    111            << " Offset " << foffset << " = " << offset << G4endl
107            << " Width " << fwidth << " = " <<     112            << " Width " << fwidth << " = " << width << G4endl;
108   }                                               113   }
109 #endif                                            114 #endif
110 }                                                 115 }
111                                                   116 
112 //--------------------------------------------    117 //------------------------------------------------------------------------
113 G4double G4ParameterisationParaX::GetMaxParame    118 G4double G4ParameterisationParaX::GetMaxParameter() const
114 {                                                 119 {
115   auto msol = (G4Para*)(fmotherSolid);         << 120   G4Para* msol = (G4Para*)(fmotherSolid);
116   return 2*msol->GetXHalfLength();                121   return 2*msol->GetXHalfLength();
117 }                                                 122 }
118                                                   123 
119 //--------------------------------------------    124 //------------------------------------------------------------------------
120 G4ParameterisationParaX::~G4ParameterisationPa << 125 G4ParameterisationParaX::~G4ParameterisationParaX()
                                                   >> 126 {
                                                   >> 127 }
121                                                   128 
122 //--------------------------------------------    129 //------------------------------------------------------------------------
123 void                                              130 void
124 G4ParameterisationParaX::                         131 G4ParameterisationParaX::
125 ComputeTransformation( const G4int copyNo, G4V    132 ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
126 {                                                 133 {
127   auto msol = (G4Para*)(fmotherSolid );        << 134   G4Para* msol = (G4Para*)(fmotherSolid );
128   G4double mdx = msol->GetXHalfLength( );         135   G4double mdx = msol->GetXHalfLength( );
129                                                   136 
130   //----- translation                             137   //----- translation 
131   G4ThreeVector origin(0.,0.,0.);                 138   G4ThreeVector origin(0.,0.,0.); 
132   G4double posi = -mdx + foffset+(copyNo+0.5)*    139   G4double posi = -mdx + foffset+(copyNo+0.5)*fwidth;
133   origin.setX( posi );                            140   origin.setX( posi ); 
134                                                   141   
135 #ifdef G4DIVDEBUG                                 142 #ifdef G4DIVDEBUG
136   if( verbose >= 2 )                              143   if( verbose >= 2 )
137   {                                               144   {
138     G4cout << std::setprecision(8) << " G4Para    145     G4cout << std::setprecision(8) << " G4ParameterisationParaX "
139            << copyNo << G4endl                    146            << copyNo << G4endl
140            << " Position: " << origin << " - A    147            << " Position: " << origin << " - Axis: " << faxis << G4endl;
141   }                                               148   }
142 #endif                                            149 #endif
143                                                   150 
144   //----- set translation                         151   //----- set translation 
145   physVol->SetTranslation( origin );              152   physVol->SetTranslation( origin );
146 }                                                 153 }
147                                                   154 
148 //--------------------------------------------    155 //--------------------------------------------------------------------------
149 void                                              156 void
150 G4ParameterisationParaX::                         157 G4ParameterisationParaX::
151 ComputeDimensions(G4Para& para, const G4int,      158 ComputeDimensions(G4Para& para, const G4int,
152                   const G4VPhysicalVolume*) co    159                   const G4VPhysicalVolume*) const
153 {                                                 160 {
154   //---- The division along X of a Para will r    161   //---- The division along X of a Para will result a Para
155   auto msol = (G4Para*)(fmotherSolid);         << 162   G4Para* msol = (G4Para*)(fmotherSolid);
156                                                   163 
157   //---- Get                                      164   //---- Get
158   G4double pDx = fwidth/2. - fhgap;               165   G4double pDx = fwidth/2. - fhgap;
159   G4double pDy = msol->GetYHalfLength();          166   G4double pDy = msol->GetYHalfLength();
160   G4double pDz = msol->GetZHalfLength();          167   G4double pDz = msol->GetZHalfLength();
161   G4double pAlpha = std::atan(msol->GetTanAlph    168   G4double pAlpha = std::atan(msol->GetTanAlpha());
162   G4double pTheta = msol->GetSymAxis().theta()    169   G4double pTheta = msol->GetSymAxis().theta();
163   G4double pPhi = msol->GetSymAxis().phi();       170   G4double pPhi = msol->GetSymAxis().phi();
164                                                   171  
165   para.SetAllParameters ( pDx, pDy, pDz, pAlph    172   para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
166                                                   173 
167 #ifdef G4DIVDEBUG                                 174 #ifdef G4DIVDEBUG
168   if( verbose >= 1 )                              175   if( verbose >= 1 )
169   {                                               176   {
170     G4cout << " G4ParameterisationParaX::Compu    177     G4cout << " G4ParameterisationParaX::ComputeDimensions()"
171            << " - Mother PARA " << G4endl;        178            << " - Mother PARA " << G4endl;
172     msol->DumpInfo();                             179     msol->DumpInfo();
173     G4cout << " - Parameterised PARA: " << G4e    180     G4cout << " - Parameterised PARA: " << G4endl;
174     para.DumpInfo();                              181     para.DumpInfo();
175   }                                               182   }
176 #endif                                            183 #endif
177 }                                                 184 }
178                                                   185 
179 //--------------------------------------------    186 //------------------------------------------------------------------------
180 G4ParameterisationParaY::                         187 G4ParameterisationParaY::
181 G4ParameterisationParaY( EAxis axis, G4int nDi    188 G4ParameterisationParaY( EAxis axis, G4int nDiv,
182                          G4double width, G4dou    189                          G4double width, G4double offset,
183                          G4VSolid* msolid, Div    190                          G4VSolid* msolid, DivisionType divType )
184   :  G4VParameterisationPara( axis, nDiv, widt    191   :  G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
185 {                                                 192 {
186   CheckParametersValidity();                      193   CheckParametersValidity();
187   SetType( "DivisionParaY" );                     194   SetType( "DivisionParaY" );
188                                                   195 
189   auto mpara = (G4Para*)(fmotherSolid);        << 196   G4Para* mpara = (G4Para*)(fmotherSolid);
190   if( divType == DivWIDTH )                       197   if( divType == DivWIDTH )
191   {                                               198   {
192     fnDiv = CalculateNDiv( 2*mpara->GetYHalfLe    199     fnDiv = CalculateNDiv( 2*mpara->GetYHalfLength(), width, offset );
193   }                                               200   }
194   else if( divType == DivNDIV )                   201   else if( divType == DivNDIV )
195   {                                               202   {
196     fwidth = CalculateWidth( 2*mpara->GetYHalf    203     fwidth = CalculateWidth( 2*mpara->GetYHalfLength(), nDiv, offset );
197   }                                               204   }
198                                                   205 
199 #ifdef G4DIVDEBUG                                 206 #ifdef G4DIVDEBUG
200   if( verbose >= 1 )                              207   if( verbose >= 1 )
201   {                                               208   {
202     G4cout << " G4ParameterisationParaY - # di    209     G4cout << " G4ParameterisationParaY - # divisions " << fnDiv
203            << " = " << nDiv << G4endl             210            << " = " << nDiv << G4endl
204            << " Offset " << foffset << " = " <    211            << " Offset " << foffset << " = " << offset << G4endl
205            << " Width " << fwidth << " = " <<     212            << " Width " << fwidth << " = " << width << G4endl;
206   }                                               213   }
207 #endif                                            214 #endif
208 }                                                 215 }
209                                                   216 
210 //--------------------------------------------    217 //------------------------------------------------------------------------
211 G4ParameterisationParaY::~G4ParameterisationPa << 218 G4ParameterisationParaY::~G4ParameterisationParaY()
                                                   >> 219 {
                                                   >> 220 }
212                                                   221 
213 //--------------------------------------------    222 //------------------------------------------------------------------------
214 G4double G4ParameterisationParaY::GetMaxParame    223 G4double G4ParameterisationParaY::GetMaxParameter() const
215 {                                                 224 {
216   auto msol = (G4Para*)(fmotherSolid);         << 225   G4Para* msol = (G4Para*)(fmotherSolid);
217   return 2*msol->GetYHalfLength();                226   return 2*msol->GetYHalfLength();
218 }                                                 227 }
219                                                   228 
220 //--------------------------------------------    229 //------------------------------------------------------------------------
221 void                                              230 void
222 G4ParameterisationParaY::                         231 G4ParameterisationParaY::
223 ComputeTransformation( const G4int copyNo, G4V    232 ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
224 {                                                 233 {
225   auto msol = (G4Para*)(fmotherSolid );        << 234   G4Para* msol = (G4Para*)(fmotherSolid );
226   G4double mdy = msol->GetYHalfLength( );         235   G4double mdy = msol->GetYHalfLength( );
227                                                   236 
228   //----- translation                             237   //----- translation 
229   G4ThreeVector origin(0.,0.,0.);                 238   G4ThreeVector origin(0.,0.,0.); 
230   G4double posiY = -mdy + foffset+(copyNo+0.5)    239   G4double posiY = -mdy + foffset+(copyNo+0.5)*fwidth;
231   origin.setY( posiY );                           240   origin.setY( posiY );
232   G4double posiX = posiY * msol->GetTanAlpha()    241   G4double posiX = posiY * msol->GetTanAlpha();
233   origin.setX( posiX );                           242   origin.setX( posiX );
234                                                   243 
235 #ifdef G4DIVDEBUG                                 244 #ifdef G4DIVDEBUG
236   if( verbose >= 2 )                              245   if( verbose >= 2 )
237   {                                               246   {
238     G4cout << std::setprecision(8) << " G4Para    247     G4cout << std::setprecision(8) << " G4ParameterisationParaY "
239            << copyNo << G4endl                    248            << copyNo << G4endl
240            << " Position: " << origin << " - A    249            << " Position: " << origin << " - Axis: " << faxis << G4endl;
241   }                                               250   }
242 #endif                                            251 #endif
243                                                   252 
244   //----- set translation                         253   //----- set translation 
245   physVol->SetTranslation( origin );              254   physVol->SetTranslation( origin );
246 }                                                 255 }
247                                                   256 
248 //--------------------------------------------    257 //--------------------------------------------------------------------------
249 void                                              258 void
250 G4ParameterisationParaY::                         259 G4ParameterisationParaY::
251 ComputeDimensions(G4Para& para, const G4int,      260 ComputeDimensions(G4Para& para, const G4int,
252                   const G4VPhysicalVolume*) co    261                   const G4VPhysicalVolume*) const
253 {                                                 262 {
254   //---- The division along Y of a Para will r    263   //---- The division along Y of a Para will result a Para
255   auto msol = (G4Para*)(fmotherSolid);         << 264   G4Para* msol = (G4Para*)(fmotherSolid);
256                                                   265 
257   //---- Get                                      266   //---- Get
258   G4double pDx = msol->GetXHalfLength();          267   G4double pDx = msol->GetXHalfLength();
259   G4double pDy = fwidth/2. - fhgap;               268   G4double pDy = fwidth/2. - fhgap;
260   G4double pDz = msol->GetZHalfLength();          269   G4double pDz = msol->GetZHalfLength();
261   G4double pAlpha = std::atan(msol->GetTanAlph    270   G4double pAlpha = std::atan(msol->GetTanAlpha());
262   G4double pTheta = msol->GetSymAxis().theta()    271   G4double pTheta = msol->GetSymAxis().theta();
263   G4double pPhi = msol->GetSymAxis().phi();       272   G4double pPhi = msol->GetSymAxis().phi();
264                                                   273  
265   para.SetAllParameters ( pDx, pDy, pDz, pAlph    274   para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
266                                                   275 
267 #ifdef G4DIVDEBUG                                 276 #ifdef G4DIVDEBUG
268   if( verbose >= -1 )                             277   if( verbose >= -1 )
269   {                                               278   {
270     G4cout << " G4ParameterisationParaY::Compu    279     G4cout << " G4ParameterisationParaY::ComputeDimensions()"
271            << " - Mother PARA " << G4endl;        280            << " - Mother PARA " << G4endl;
272     msol->DumpInfo();                             281     msol->DumpInfo();
273     G4cout << " - Parameterised PARA: " << G4e    282     G4cout << " - Parameterised PARA: " << G4endl;
274     para.DumpInfo();                              283     para.DumpInfo();
275   }                                               284   }
276 #endif                                            285 #endif
277 }                                                 286 }
278                                                   287 
279 //--------------------------------------------    288 //------------------------------------------------------------------------
280 G4ParameterisationParaZ::                         289 G4ParameterisationParaZ::
281 G4ParameterisationParaZ( EAxis axis, G4int nDi    290 G4ParameterisationParaZ( EAxis axis, G4int nDiv,
282                          G4double width, G4dou    291                          G4double width, G4double offset,
283                          G4VSolid* msolid, Div    292                          G4VSolid* msolid, DivisionType divType )
284   :  G4VParameterisationPara( axis, nDiv, widt    293   :  G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
285 {                                                 294 {
286   CheckParametersValidity();                      295   CheckParametersValidity();
287   SetType( "DivisionParaZ" );                     296   SetType( "DivisionParaZ" );
288                                                   297 
289   auto mpara = (G4Para*)(fmotherSolid);        << 298   G4Para* mpara = (G4Para*)(fmotherSolid);
290   if( divType == DivWIDTH )                       299   if( divType == DivWIDTH )
291   {                                               300   {
292     fnDiv = CalculateNDiv( 2*mpara->GetZHalfLe    301     fnDiv = CalculateNDiv( 2*mpara->GetZHalfLength(), width, offset );
293   }                                               302   }
294   else if( divType == DivNDIV )                   303   else if( divType == DivNDIV )
295   {                                               304   {
296     fwidth = CalculateWidth( 2*mpara->GetZHalf    305     fwidth = CalculateWidth( 2*mpara->GetZHalfLength(), nDiv, offset );
297   }                                               306   }
298                                                   307 
299 #ifdef G4DIVDEBUG                                 308 #ifdef G4DIVDEBUG
300   if( verbose >= -1 )                             309   if( verbose >= -1 )
301   {                                               310   {
302     G4cout << " G4ParameterisationParaZ - # di    311     G4cout << " G4ParameterisationParaZ - # divisions " << fnDiv
303            << " = " << nDiv << G4endl             312            << " = " << nDiv << G4endl
304            << " Offset " << foffset << " = " <    313            << " Offset " << foffset << " = " << offset << G4endl
305            << " Width " << fwidth << " = " <<     314            << " Width " << fwidth << " = " << width << G4endl;
306   }                                               315   }
307 #endif                                            316 #endif
308 }                                                 317 }
309                                                   318 
310 //--------------------------------------------    319 //------------------------------------------------------------------------
311 G4ParameterisationParaZ::~G4ParameterisationPa << 320 G4ParameterisationParaZ::~G4ParameterisationParaZ()
                                                   >> 321 {
                                                   >> 322 }
312                                                   323 
313 //--------------------------------------------    324 //------------------------------------------------------------------------
314 G4double G4ParameterisationParaZ::GetMaxParame    325 G4double G4ParameterisationParaZ::GetMaxParameter() const
315 {                                                 326 {
316   auto msol = (G4Para*)(fmotherSolid);         << 327   G4Para* msol = (G4Para*)(fmotherSolid);
317   return 2*msol->GetZHalfLength();                328   return 2*msol->GetZHalfLength();
318 }                                                 329 }
319                                                   330 
320 //--------------------------------------------    331 //------------------------------------------------------------------------
321 void                                              332 void
322 G4ParameterisationParaZ::                         333 G4ParameterisationParaZ::
323 ComputeTransformation( const G4int copyNo, G4V    334 ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
324 {                                                 335 {
325   auto msol = (G4Para*)(fmotherSolid );        << 336   G4Para* msol = (G4Para*)(fmotherSolid );
326   G4double mdz = msol->GetZHalfLength( );         337   G4double mdz = msol->GetZHalfLength( );
327                                                   338 
328   //----- translation                             339   //----- translation 
329   G4double posi = -mdz + OffsetZ() + (copyNo+0    340   G4double posi = -mdz + OffsetZ() + (copyNo+0.5)*fwidth;
330   G4ThreeVector symAxis = msol->GetSymAxis();     341   G4ThreeVector symAxis = msol->GetSymAxis();
331   G4ThreeVector origin( symAxis * posi / symAx    342   G4ThreeVector origin( symAxis * posi / symAxis.z() ); 
332                                                   343   
333 #ifdef G4DIVDEBUG                                 344 #ifdef G4DIVDEBUG
334   if( verbose >= 2 )                              345   if( verbose >= 2 )
335   {                                               346   {
336     G4cout << std::setprecision(8) << " G4Para    347     G4cout << std::setprecision(8) << " G4ParameterisationParaZ "
337            << copyNo << G4endl                    348            << copyNo << G4endl
338            << " Position: " << origin << " - A    349            << " Position: " << origin << " - Axis: " << faxis << G4endl;
339   }                                               350   }
340 #endif                                            351 #endif
341                                                   352 
342   //----- set translation                         353   //----- set translation 
343   physVol->SetTranslation( origin );              354   physVol->SetTranslation( origin );
344 }                                                 355 }
345                                                   356 
346 //--------------------------------------------    357 //--------------------------------------------------------------------------
347 void                                              358 void
348 G4ParameterisationParaZ::                         359 G4ParameterisationParaZ::
349 ComputeDimensions(G4Para& para, const G4int,      360 ComputeDimensions(G4Para& para, const G4int,
350                   const G4VPhysicalVolume*) co    361                   const G4VPhysicalVolume*) const
351 {                                                 362 {
352   //---- The division along Z of a Para will r    363   //---- The division along Z of a Para will result a Para
353   auto msol = (G4Para*)(fmotherSolid);         << 364   G4Para* msol = (G4Para*)(fmotherSolid);
354                                                   365 
355   //---- Get                                      366   //---- Get
356   G4double pDx = msol->GetXHalfLength();          367   G4double pDx = msol->GetXHalfLength();
357   G4double pDy = msol->GetYHalfLength();          368   G4double pDy = msol->GetYHalfLength();
358   G4double pDz = fwidth/2. - fhgap;               369   G4double pDz = fwidth/2. - fhgap;
359   G4double pAlpha = std::atan(msol->GetTanAlph    370   G4double pAlpha = std::atan(msol->GetTanAlpha());
360   G4double pTheta = msol->GetSymAxis().theta()    371   G4double pTheta = msol->GetSymAxis().theta();
361   G4double pPhi = msol->GetSymAxis().phi();       372   G4double pPhi = msol->GetSymAxis().phi();
362                                                   373  
363   para.SetAllParameters ( pDx, pDy, pDz, pAlph    374   para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
364                                                   375 
365 #ifdef G4DIVDEBUG                                 376 #ifdef G4DIVDEBUG
366   if( verbose >= -1 )                             377   if( verbose >= -1 )
367   {                                               378   {
368     G4cout << " G4ParameterisationParaZ::Compu    379     G4cout << " G4ParameterisationParaZ::ComputeDimensions()"
369            << " - Mother PARA " << G4endl;        380            << " - Mother PARA " << G4endl;
370     msol->DumpInfo();                             381     msol->DumpInfo();
371     G4cout << " - Parameterised PARA: " << G4e    382     G4cout << " - Parameterised PARA: " << G4endl;
372     para.DumpInfo();                              383     para.DumpInfo();
373   }                                               384   }
374 #endif                                            385 #endif
375 }                                                 386 }
376                                                   387