Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/persistency/gdml/src/G4GDMLReadParamvol.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 /persistency/gdml/src/G4GDMLReadParamvol.cc (Version 11.3.0) and /persistency/gdml/src/G4GDMLReadParamvol.cc (Version 9.2.p4)


  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 // G4GDMLReadParamvol implementation           <<  26 // $Id: G4GDMLReadParamvol.cc,v 1.10.2.2 2009/08/11 08:27:49 gcosmo Exp $
                                                   >>  27 // GEANT4 tag $Name: geant4-09-02-patch-04 $
 27 //                                                 28 //
 28 // Author: Zoltan Torzsok, November 2007       <<  29 // class G4GDMLReadParamvol Implementation
 29 // ------------------------------------------- <<  30 //
                                                   >>  31 // History:
                                                   >>  32 // - Created.                                  Zoltan Torzsok, November 2007
                                                   >>  33 // -------------------------------------------------------------------------
 30                                                    34 
 31 #include "G4GDMLReadParamvol.hh"                   35 #include "G4GDMLReadParamvol.hh"
 32 #include "G4GDMLReadSolids.hh"                 << 
 33 #include "G4LogicalVolume.hh"                  << 
 34 #include "G4PVParameterised.hh"                << 
 35 #include "G4PVPlacement.hh"                    << 
 36 #include "G4VPhysicalVolume.hh"                << 
 37 #include "G4UnitsTable.hh"                     << 
 38                                                << 
 39 // ------------------------------------------- << 
 40 G4GDMLReadParamvol::G4GDMLReadParamvol()       << 
 41   : G4GDMLReadSetup()                          << 
 42 {                                              << 
 43 }                                              << 
 44                                                << 
 45 G4GDMLReadParamvol::~G4GDMLReadParamvol()      << 
 46 {                                              << 
 47 }                                              << 
 48                                                << 
 49 // ------------------------------------------- << 
 50 void G4GDMLReadParamvol::Box_dimensionsRead(   << 
 51   const xercesc::DOMElement* const element,    << 
 52   G4GDMLParameterisation::PARAMETER& parameter << 
 53 {                                              << 
 54   G4double lunit = 1.0;                        << 
 55                                                << 
 56   const xercesc::DOMNamedNodeMap* const attrib << 
 57   XMLSize_t attributeCount                     << 
 58                                                << 
 59   for(XMLSize_t attribute_index = 0; attribute << 
 60       ++attribute_index)                       << 
 61   {                                            << 
 62     xercesc::DOMNode* attribute_node = attribu << 
 63                                                << 
 64     if(attribute_node->getNodeType() != xerces << 
 65     {                                          << 
 66       continue;                                << 
 67     }                                          << 
 68                                                << 
 69     const xercesc::DOMAttr* const attribute =  << 
 70       dynamic_cast<xercesc::DOMAttr*>(attribut << 
 71     if(attribute == nullptr)                   << 
 72     {                                          << 
 73       G4Exception("G4GDMLReadParamvol::Box_dim << 
 74                   FatalException, "No attribut << 
 75       return;                                  << 
 76     }                                          << 
 77     const G4String attName  = Transcode(attrib << 
 78     const G4String attValue = Transcode(attrib << 
 79                                                << 
 80     if(attName == "lunit")                     << 
 81     {                                          << 
 82       lunit = G4UnitDefinition::GetValueOf(att << 
 83       if(G4UnitDefinition::GetCategory(attValu << 
 84       {                                        << 
 85         G4Exception("G4GDMLReadParamvol::Box_d << 
 86                     FatalException, "Invalid u << 
 87       }                                        << 
 88     }                                          << 
 89     else if(attName == "x")                    << 
 90     {                                          << 
 91       parameter.dimension[0] = eval.Evaluate(a << 
 92     }                                          << 
 93     else if(attName == "y")                    << 
 94     {                                          << 
 95       parameter.dimension[1] = eval.Evaluate(a << 
 96     }                                          << 
 97     else if(attName == "z")                    << 
 98     {                                          << 
 99       parameter.dimension[2] = eval.Evaluate(a << 
100     }                                          << 
101   }                                            << 
102                                                << 
103   parameter.dimension[0] *= 0.5 * lunit;       << 
104   parameter.dimension[1] *= 0.5 * lunit;       << 
105   parameter.dimension[2] *= 0.5 * lunit;       << 
106 }                                              << 
107                                                << 
108 // ------------------------------------------- << 
109 void G4GDMLReadParamvol::Trd_dimensionsRead(   << 
110   const xercesc::DOMElement* const element,    << 
111   G4GDMLParameterisation::PARAMETER& parameter << 
112 {                                              << 
113   G4double lunit = 1.0;                        << 
114                                                << 
115   const xercesc::DOMNamedNodeMap* const attrib << 
116   XMLSize_t attributeCount                     << 
117                                                << 
118   for(XMLSize_t attribute_index = 0; attribute << 
119       ++attribute_index)                       << 
120   {                                            << 
121     xercesc::DOMNode* attribute_node = attribu << 
122                                                << 
123     if(attribute_node->getNodeType() != xerces << 
124     {                                          << 
125       continue;                                << 
126     }                                          << 
127                                                << 
128     const xercesc::DOMAttr* const attribute =  << 
129       dynamic_cast<xercesc::DOMAttr*>(attribut << 
130     if(attribute == nullptr)                   << 
131     {                                          << 
132       G4Exception("G4GDMLReadParamvol::Trd_dim << 
133                   FatalException, "No attribut << 
134       return;                                  << 
135     }                                          << 
136     const G4String attName  = Transcode(attrib << 
137     const G4String attValue = Transcode(attrib << 
138                                                << 
139     if(attName == "lunit")                     << 
140     {                                          << 
141       lunit = G4UnitDefinition::GetValueOf(att << 
142       if(G4UnitDefinition::GetCategory(attValu << 
143       {                                        << 
144         G4Exception("G4GDMLReadParamvol::Trd_d << 
145                     FatalException, "Invalid u << 
146       }                                        << 
147     }                                          << 
148     else if(attName == "x1")                   << 
149     {                                          << 
150       parameter.dimension[0] = eval.Evaluate(a << 
151     }                                          << 
152     else if(attName == "x2")                   << 
153     {                                          << 
154       parameter.dimension[1] = eval.Evaluate(a << 
155     }                                          << 
156     else if(attName == "y1")                   << 
157     {                                          << 
158       parameter.dimension[2] = eval.Evaluate(a << 
159     }                                          << 
160     else if(attName == "y2")                   << 
161     {                                          << 
162       parameter.dimension[3] = eval.Evaluate(a << 
163     }                                          << 
164     else if(attName == "z")                    << 
165     {                                          << 
166       parameter.dimension[4] = eval.Evaluate(a << 
167     }                                          << 
168   }                                            << 
169                                                << 
170   parameter.dimension[0] *= 0.5 * lunit;       << 
171   parameter.dimension[1] *= 0.5 * lunit;       << 
172   parameter.dimension[2] *= 0.5 * lunit;       << 
173   parameter.dimension[3] *= 0.5 * lunit;       << 
174   parameter.dimension[4] *= 0.5 * lunit;       << 
175 }                                              << 
176                                                << 
177 // ------------------------------------------- << 
178 void G4GDMLReadParamvol::Trap_dimensionsRead(  << 
179   const xercesc::DOMElement* const element,    << 
180   G4GDMLParameterisation::PARAMETER& parameter << 
181 {                                              << 
182   G4double lunit = 1.0;                        << 
183   G4double aunit = 1.0;                        << 
184                                                << 
185   const xercesc::DOMNamedNodeMap* const attrib << 
186   XMLSize_t attributeCount                     << 
187                                                << 
188   for(XMLSize_t attribute_index = 0; attribute << 
189       ++attribute_index)                       << 
190   {                                            << 
191     xercesc::DOMNode* attribute_node = attribu << 
192                                                << 
193     if(attribute_node->getNodeType() != xerces << 
194     {                                          << 
195       continue;                                << 
196     }                                          << 
197                                                << 
198     const xercesc::DOMAttr* const attribute =  << 
199       dynamic_cast<xercesc::DOMAttr*>(attribut << 
200     if(attribute == nullptr)                   << 
201     {                                          << 
202       G4Exception("G4GDMLReadParamvol::Trap_di << 
203                   FatalException, "No attribut << 
204       return;                                  << 
205     }                                          << 
206     const G4String attName  = Transcode(attrib << 
207     const G4String attValue = Transcode(attrib << 
208                                                << 
209     if(attName == "lunit")                     << 
210     {                                          << 
211       lunit = G4UnitDefinition::GetValueOf(att << 
212       if(G4UnitDefinition::GetCategory(attValu << 
213       {                                        << 
214         G4Exception("G4GDMLReadParamvol::Trap_ << 
215                     FatalException, "Invalid u << 
216       }                                        << 
217     }                                          << 
218     else if(attName == "aunit")                << 
219     {                                          << 
220       aunit = G4UnitDefinition::GetValueOf(att << 
221       if(G4UnitDefinition::GetCategory(attValu << 
222       {                                        << 
223         G4Exception("G4GDMLReadParamvol::Trap_ << 
224                     FatalException, "Invalid u << 
225       }                                        << 
226     }                                          << 
227     else if(attName == "z")                    << 
228     {                                          << 
229       parameter.dimension[0] = eval.Evaluate(a << 
230     }                                          << 
231     else if(attName == "theta")                << 
232     {                                          << 
233       parameter.dimension[1] = eval.Evaluate(a << 
234     }                                          << 
235     else if(attName == "phi")                  << 
236     {                                          << 
237       parameter.dimension[2] = eval.Evaluate(a << 
238     }                                          << 
239     else if(attName == "y1")                   << 
240     {                                          << 
241       parameter.dimension[3] = eval.Evaluate(a << 
242     }                                          << 
243     else if(attName == "x1")                   << 
244     {                                          << 
245       parameter.dimension[4] = eval.Evaluate(a << 
246     }                                          << 
247     else if(attName == "x2")                   << 
248     {                                          << 
249       parameter.dimension[5] = eval.Evaluate(a << 
250     }                                          << 
251     else if(attName == "alpha1")               << 
252     {                                          << 
253       parameter.dimension[6] = eval.Evaluate(a << 
254     }                                          << 
255     else if(attName == "y2")                   << 
256     {                                          << 
257       parameter.dimension[7] = eval.Evaluate(a << 
258     }                                          << 
259     else if(attName == "x3")                   << 
260     {                                          << 
261       parameter.dimension[8] = eval.Evaluate(a << 
262     }                                          << 
263     else if(attName == "x4")                   << 
264     {                                          << 
265       parameter.dimension[9] = eval.Evaluate(a << 
266     }                                          << 
267     else if(attName == "alpha2")               << 
268     {                                          << 
269       parameter.dimension[10] = eval.Evaluate( << 
270     }                                          << 
271   }                                            << 
272                                                << 
273   parameter.dimension[0] *= 0.5 * lunit;       << 
274   parameter.dimension[1] *= aunit;             << 
275   parameter.dimension[2] *= aunit;             << 
276   parameter.dimension[3] *= 0.5 * lunit;       << 
277   parameter.dimension[4] *= 0.5 * lunit;       << 
278   parameter.dimension[5] *= 0.5 * lunit;       << 
279   parameter.dimension[6] *= aunit;             << 
280   parameter.dimension[7] *= 0.5 * lunit;       << 
281   parameter.dimension[8] *= 0.5 * lunit;       << 
282   parameter.dimension[9] *= 0.5 * lunit;       << 
283   parameter.dimension[10] *= aunit;            << 
284 }                                              << 
285                                                << 
286 // ------------------------------------------- << 
287 void G4GDMLReadParamvol::Tube_dimensionsRead(  << 
288   const xercesc::DOMElement* const element,    << 
289   G4GDMLParameterisation::PARAMETER& parameter << 
290 {                                              << 
291   G4double lunit = 1.0;                        << 
292   G4double aunit = 1.0;                        << 
293                                                << 
294   const xercesc::DOMNamedNodeMap* const attrib << 
295   XMLSize_t attributeCount                     << 
296                                                << 
297   for(XMLSize_t attribute_index = 0; attribute << 
298       ++attribute_index)                       << 
299   {                                            << 
300     xercesc::DOMNode* attribute_node = attribu << 
301                                                << 
302     if(attribute_node->getNodeType() != xerces << 
303     {                                          << 
304       continue;                                << 
305     }                                          << 
306                                                << 
307     const xercesc::DOMAttr* const attribute =  << 
308       dynamic_cast<xercesc::DOMAttr*>(attribut << 
309     if(attribute == nullptr)                   << 
310     {                                          << 
311       G4Exception("G4GDMLReadParamvol::Tube_di << 
312                   FatalException, "No attribut << 
313       return;                                  << 
314     }                                          << 
315     const G4String attName  = Transcode(attrib << 
316     const G4String attValue = Transcode(attrib << 
317                                                << 
318     if(attName == "lunit")                     << 
319     {                                          << 
320       lunit = G4UnitDefinition::GetValueOf(att << 
321       if(G4UnitDefinition::GetCategory(attValu << 
322       {                                        << 
323         G4Exception("G4GDMLReadParamvol::Tube_ << 
324                     FatalException, "Invalid u << 
325       }                                        << 
326     }                                          << 
327     else if(attName == "aunit")                << 
328     {                                          << 
329       aunit = G4UnitDefinition::GetValueOf(att << 
330       if(G4UnitDefinition::GetCategory(attValu << 
331       {                                        << 
332         G4Exception("G4GDMLReadParamvol::Tube_ << 
333                     FatalException, "Invalid u << 
334       }                                        << 
335     }                                          << 
336     else if(attName == "InR")                  << 
337     {                                          << 
338       parameter.dimension[0] = eval.Evaluate(a << 
339     }                                          << 
340     else if(attName == "OutR")                 << 
341     {                                          << 
342       parameter.dimension[1] = eval.Evaluate(a << 
343     }                                          << 
344     else if(attName == "hz")                   << 
345     {                                          << 
346       parameter.dimension[2] = eval.Evaluate(a << 
347     }                                          << 
348     else if(attName == "StartPhi")             << 
349     {                                          << 
350       parameter.dimension[3] = eval.Evaluate(a << 
351     }                                          << 
352     else if(attName == "DeltaPhi")             << 
353     {                                          << 
354       parameter.dimension[4] = eval.Evaluate(a << 
355     }                                          << 
356   }                                            << 
357                                                << 
358   parameter.dimension[0] *= lunit;             << 
359   parameter.dimension[1] *= lunit;             << 
360   parameter.dimension[2] *= 0.5 * lunit;       << 
361   parameter.dimension[3] *= aunit;             << 
362   parameter.dimension[4] *= aunit;             << 
363 }                                              << 
364                                                << 
365 // ------------------------------------------- << 
366 void G4GDMLReadParamvol::Cone_dimensionsRead(  << 
367   const xercesc::DOMElement* const element,    << 
368   G4GDMLParameterisation::PARAMETER& parameter << 
369 {                                              << 
370   G4double lunit = 1.0;                        << 
371   G4double aunit = 1.0;                        << 
372                                                << 
373   const xercesc::DOMNamedNodeMap* const attrib << 
374   XMLSize_t attributeCount                     << 
375                                                << 
376   for(XMLSize_t attribute_index = 0; attribute << 
377       ++attribute_index)                       << 
378   {                                            << 
379     xercesc::DOMNode* attribute_node = attribu << 
380                                                << 
381     if(attribute_node->getNodeType() != xerces << 
382     {                                          << 
383       continue;                                << 
384     }                                          << 
385                                                << 
386     const xercesc::DOMAttr* const attribute =  << 
387       dynamic_cast<xercesc::DOMAttr*>(attribut << 
388     if(attribute == nullptr)                   << 
389     {                                          << 
390       G4Exception("G4GDMLReadParamvol::Cone_di << 
391                   FatalException, "No attribut << 
392       return;                                  << 
393     }                                          << 
394     const G4String attName  = Transcode(attrib << 
395     const G4String attValue = Transcode(attrib << 
396                                                << 
397     if(attName == "lunit")                     << 
398     {                                          << 
399       lunit = G4UnitDefinition::GetValueOf(att << 
400       if(G4UnitDefinition::GetCategory(attValu << 
401       {                                        << 
402         G4Exception("G4GDMLReadParamvol::Cone_ << 
403                     FatalException, "Invalid u << 
404       }                                        << 
405     }                                          << 
406     else if(attName == "aunit")                << 
407     {                                          << 
408       aunit = G4UnitDefinition::GetValueOf(att << 
409       if(G4UnitDefinition::GetCategory(attValu << 
410       {                                        << 
411         G4Exception("G4GDMLReadParamvol::Cone_ << 
412                     FatalException, "Invalid u << 
413       }                                        << 
414     }                                          << 
415     else if(attName == "rmin1")                << 
416     {                                          << 
417       parameter.dimension[0] = eval.Evaluate(a << 
418     }                                          << 
419     else if(attName == "rmax1")                << 
420     {                                          << 
421       parameter.dimension[1] = eval.Evaluate(a << 
422     }                                          << 
423     else if(attName == "rmin2")                << 
424     {                                          << 
425       parameter.dimension[2] = eval.Evaluate(a << 
426     }                                          << 
427     else if(attName == "rmax2")                << 
428     {                                          << 
429       parameter.dimension[3] = eval.Evaluate(a << 
430     }                                          << 
431     else if(attName == "z")                    << 
432     {                                          << 
433       parameter.dimension[4] = eval.Evaluate(a << 
434     }                                          << 
435     else if(attName == "startphi")             << 
436     {                                          << 
437       parameter.dimension[5] = eval.Evaluate(a << 
438     }                                          << 
439     else if(attName == "deltaphi")             << 
440     {                                          << 
441       parameter.dimension[6] = eval.Evaluate(a << 
442     }                                          << 
443   }                                            << 
444                                                << 
445   parameter.dimension[0] *= lunit;             << 
446   parameter.dimension[1] *= lunit;             << 
447   parameter.dimension[2] *= lunit;             << 
448   parameter.dimension[3] *= lunit;             << 
449   parameter.dimension[4] *= 0.5 * lunit;       << 
450   parameter.dimension[5] *= aunit;             << 
451   parameter.dimension[6] *= aunit;             << 
452 }                                              << 
453                                                << 
454 // ------------------------------------------- << 
455 void G4GDMLReadParamvol::Sphere_dimensionsRead << 
456   const xercesc::DOMElement* const element,    << 
457   G4GDMLParameterisation::PARAMETER& parameter << 
458 {                                              << 
459   G4double lunit = 1.0;                        << 
460   G4double aunit = 1.0;                        << 
461                                                << 
462   const xercesc::DOMNamedNodeMap* const attrib << 
463   XMLSize_t attributeCount                     << 
464                                                << 
465   for(XMLSize_t attribute_index = 0; attribute << 
466       ++attribute_index)                       << 
467   {                                            << 
468     xercesc::DOMNode* attribute_node = attribu << 
469                                                << 
470     if(attribute_node->getNodeType() != xerces << 
471     {                                          << 
472       continue;                                << 
473     }                                          << 
474                                                << 
475     const xercesc::DOMAttr* const attribute =  << 
476       dynamic_cast<xercesc::DOMAttr*>(attribut << 
477     if(attribute == nullptr)                   << 
478     {                                          << 
479       G4Exception("G4GDMLReadParamvol::Sphere_ << 
480                   FatalException, "No attribut << 
481       return;                                  << 
482     }                                          << 
483     const G4String attName  = Transcode(attrib << 
484     const G4String attValue = Transcode(attrib << 
485                                                << 
486     if(attName == "lunit")                     << 
487     {                                          << 
488       lunit = G4UnitDefinition::GetValueOf(att << 
489       if(G4UnitDefinition::GetCategory(attValu << 
490       {                                        << 
491         G4Exception("G4GDMLReadParamvol::Spher << 
492                     "InvalidRead", FatalExcept << 
493       }                                        << 
494     }                                          << 
495     else if(attName == "aunit")                << 
496     {                                          << 
497       aunit = G4UnitDefinition::GetValueOf(att << 
498       if(G4UnitDefinition::GetCategory(attValu << 
499       {                                        << 
500         G4Exception("G4GDMLReadParamvol::Spher << 
501                     "InvalidRead", FatalExcept << 
502       }                                        << 
503     }                                          << 
504     else if(attName == "rmin")                 << 
505     {                                          << 
506       parameter.dimension[0] = eval.Evaluate(a << 
507     }                                          << 
508     else if(attName == "rmax")                 << 
509     {                                          << 
510       parameter.dimension[1] = eval.Evaluate(a << 
511     }                                          << 
512     else if(attName == "startphi")             << 
513     {                                          << 
514       parameter.dimension[2] = eval.Evaluate(a << 
515     }                                          << 
516     else if(attName == "deltaphi")             << 
517     {                                          << 
518       parameter.dimension[3] = eval.Evaluate(a << 
519     }                                          << 
520     else if(attName == "starttheta")           << 
521     {                                          << 
522       parameter.dimension[4] = eval.Evaluate(a << 
523     }                                          << 
524     else if(attName == "deltatheta")           << 
525     {                                          << 
526       parameter.dimension[5] = eval.Evaluate(a << 
527     }                                          << 
528   }                                            << 
529                                                << 
530   parameter.dimension[0] *= lunit;             << 
531   parameter.dimension[1] *= lunit;             << 
532   parameter.dimension[2] *= aunit;             << 
533   parameter.dimension[3] *= aunit;             << 
534   parameter.dimension[4] *= aunit;             << 
535   parameter.dimension[5] *= aunit;             << 
536 }                                              << 
537                                                    36 
538 // ------------------------------------------- <<  37 G4GDMLReadParamvol::G4GDMLReadParamvol() : G4GDMLReadSetup()
539 void G4GDMLReadParamvol::Orb_dimensionsRead(   << 
540   const xercesc::DOMElement* const element,    << 
541   G4GDMLParameterisation::PARAMETER& parameter << 
542 {                                                  38 {
543   G4double lunit = 1.0;                        << 
544                                                << 
545   const xercesc::DOMNamedNodeMap* const attrib << 
546   XMLSize_t attributeCount                     << 
547                                                << 
548   for(XMLSize_t attribute_index = 0; attribute << 
549       ++attribute_index)                       << 
550   {                                            << 
551     xercesc::DOMNode* attribute_node = attribu << 
552                                                << 
553     if(attribute_node->getNodeType() != xerces << 
554     {                                          << 
555       continue;                                << 
556     }                                          << 
557                                                << 
558     const xercesc::DOMAttr* const attribute =  << 
559       dynamic_cast<xercesc::DOMAttr*>(attribut << 
560     if(attribute == nullptr)                   << 
561     {                                          << 
562       G4Exception("G4GDMLReadParamvol::Orb_dim << 
563                   FatalException, "No attribut << 
564       return;                                  << 
565     }                                          << 
566     const G4String attName  = Transcode(attrib << 
567     const G4String attValue = Transcode(attrib << 
568                                                << 
569     if(attName == "lunit")                     << 
570     {                                          << 
571       lunit = G4UnitDefinition::GetValueOf(att << 
572     }                                          << 
573     if(G4UnitDefinition::GetCategory(attValue) << 
574     {                                          << 
575       G4Exception("G4GDMLReadParamvol::Orb_dim << 
576                   FatalException, "Invalid uni << 
577     }                                          << 
578     else if(attName == "r")                    << 
579     {                                          << 
580       parameter.dimension[0] = eval.Evaluate(a << 
581     }                                          << 
582   }                                            << 
583                                                << 
584   parameter.dimension[0] *= lunit;             << 
585 }                                                  39 }
586                                                    40 
587 // ------------------------------------------- <<  41 G4GDMLReadParamvol::~G4GDMLReadParamvol()
588 void G4GDMLReadParamvol::Torus_dimensionsRead( << 
589   const xercesc::DOMElement* const element,    << 
590   G4GDMLParameterisation::PARAMETER& parameter << 
591 {                                              << 
592   G4double lunit = 1.0;                        << 
593   G4double aunit = 1.0;                        << 
594                                                << 
595   const xercesc::DOMNamedNodeMap* const attrib << 
596   XMLSize_t attributeCount                     << 
597                                                << 
598   for(XMLSize_t attribute_index = 0; attribute << 
599       ++attribute_index)                       << 
600   {                                            << 
601     xercesc::DOMNode* attribute_node = attribu << 
602                                                << 
603     if(attribute_node->getNodeType() != xerces << 
604     {                                          << 
605       continue;                                << 
606     }                                          << 
607                                                << 
608     const xercesc::DOMAttr* const attribute =  << 
609       dynamic_cast<xercesc::DOMAttr*>(attribut << 
610     if(attribute == nullptr)                   << 
611     {                                          << 
612       G4Exception("G4GDMLReadParamvol::Torus_d << 
613                   FatalException, "No attribut << 
614       return;                                  << 
615     }                                          << 
616     const G4String attName  = Transcode(attrib << 
617     const G4String attValue = Transcode(attrib << 
618                                                << 
619     if(attName == "lunit")                     << 
620     {                                          << 
621       lunit = G4UnitDefinition::GetValueOf(att << 
622       if(G4UnitDefinition::GetCategory(attValu << 
623       {                                        << 
624         G4Exception("G4GDMLReadParamvol::Torus << 
625                     FatalException, "Invalid u << 
626       }                                        << 
627     }                                          << 
628     else if(attName == "aunit")                << 
629     {                                          << 
630       aunit = G4UnitDefinition::GetValueOf(att << 
631       if(G4UnitDefinition::GetCategory(attValu << 
632       {                                        << 
633         G4Exception("G4GDMLReadParamvol::Torus << 
634                     FatalException, "Invalid u << 
635       }                                        << 
636     }                                          << 
637     else if(attName == "rmin")                 << 
638     {                                          << 
639       parameter.dimension[0] = eval.Evaluate(a << 
640     }                                          << 
641     else if(attName == "rmax")                 << 
642     {                                          << 
643       parameter.dimension[1] = eval.Evaluate(a << 
644     }                                          << 
645     else if(attName == "rtor")                 << 
646     {                                          << 
647       parameter.dimension[2] = eval.Evaluate(a << 
648     }                                          << 
649     else if(attName == "startphi")             << 
650     {                                          << 
651       parameter.dimension[3] = eval.Evaluate(a << 
652     }                                          << 
653     else if(attName == "deltaphi")             << 
654     {                                          << 
655       parameter.dimension[4] = eval.Evaluate(a << 
656     }                                          << 
657   }                                            << 
658                                                << 
659   parameter.dimension[0] *= lunit;             << 
660   parameter.dimension[1] *= lunit;             << 
661   parameter.dimension[2] *= lunit;             << 
662   parameter.dimension[3] *= aunit;             << 
663   parameter.dimension[4] *= aunit;             << 
664 }                                              << 
665                                                << 
666 // ------------------------------------------- << 
667 void G4GDMLReadParamvol::Ellipsoid_dimensionsR << 
668   const xercesc::DOMElement* const element,    << 
669   G4GDMLParameterisation::PARAMETER& parameter << 
670 {                                              << 
671   G4double lunit                               << 
672   const xercesc::DOMNamedNodeMap* const attrib << 
673   XMLSize_t attributeCount                     << 
674                                                << 
675   for(XMLSize_t attribute_index = 0; attribute << 
676       ++attribute_index)                       << 
677   {                                            << 
678     xercesc::DOMNode* attribute_node = attribu << 
679                                                << 
680     if(attribute_node->getNodeType() != xerces << 
681     {                                          << 
682       continue;                                << 
683     }                                          << 
684                                                << 
685     const xercesc::DOMAttr* const attribute =  << 
686       dynamic_cast<xercesc::DOMAttr*>(attribut << 
687     if(attribute == nullptr)                   << 
688     {                                          << 
689       G4Exception("G4GDMLReadParamvol::Ellipso << 
690                   "InvalidRead", FatalExceptio << 
691       return;                                  << 
692     }                                          << 
693     const G4String attName  = Transcode(attrib << 
694     const G4String attValue = Transcode(attrib << 
695                                                << 
696     if(attName == "lunit")                     << 
697     {                                          << 
698       lunit = G4UnitDefinition::GetValueOf(att << 
699       if(G4UnitDefinition::GetCategory(attValu << 
700       {                                        << 
701         G4Exception("G4GDMLReadParamvol::Ellip << 
702                     "InvalidRead", FatalExcept << 
703       }                                        << 
704     }                                          << 
705     else if(attName == "ax")                   << 
706     {                                          << 
707       parameter.dimension[0] = eval.Evaluate(a << 
708     }                                          << 
709     else if(attName == "by")                   << 
710     {                                          << 
711       parameter.dimension[1] = eval.Evaluate(a << 
712     }                                          << 
713     else if(attName == "cz")                   << 
714     {                                          << 
715       parameter.dimension[2] = eval.Evaluate(a << 
716     }                                          << 
717     else if(attName == "zcut1")                << 
718     {                                          << 
719       parameter.dimension[3] = eval.Evaluate(a << 
720     }                                          << 
721     else if(attName == "zcut2")                << 
722     {                                          << 
723       parameter.dimension[4] = eval.Evaluate(a << 
724     }                                          << 
725   }                                            << 
726                                                << 
727   parameter.dimension[0] *= lunit;             << 
728   parameter.dimension[1] *= lunit;             << 
729   parameter.dimension[2] *= lunit;             << 
730   parameter.dimension[3] *= lunit;             << 
731   parameter.dimension[4] *= lunit;             << 
732 }                                              << 
733                                                << 
734 // ------------------------------------------- << 
735 void G4GDMLReadParamvol::Para_dimensionsRead(  << 
736   const xercesc::DOMElement* const element,    << 
737   G4GDMLParameterisation::PARAMETER& parameter << 
738 {                                              << 
739   G4double lunit = 1.0;                        << 
740   G4double aunit = 1.0;                        << 
741                                                << 
742   const xercesc::DOMNamedNodeMap* const attrib << 
743   XMLSize_t attributeCount                     << 
744                                                << 
745   for(XMLSize_t attribute_index = 0; attribute << 
746       ++attribute_index)                       << 
747   {                                            << 
748     xercesc::DOMNode* attribute_node = attribu << 
749                                                << 
750     if(attribute_node->getNodeType() != xerces << 
751     {                                          << 
752       continue;                                << 
753     }                                          << 
754                                                << 
755     const xercesc::DOMAttr* const attribute =  << 
756       dynamic_cast<xercesc::DOMAttr*>(attribut << 
757     if(attribute == nullptr)                   << 
758     {                                          << 
759       G4Exception("G4GDMLReadParamvol::Para_di << 
760                   FatalException, "No attribut << 
761       return;                                  << 
762     }                                          << 
763     const G4String attName  = Transcode(attrib << 
764     const G4String attValue = Transcode(attrib << 
765                                                << 
766     if(attName == "lunit")                     << 
767     {                                          << 
768       lunit = G4UnitDefinition::GetValueOf(att << 
769       if(G4UnitDefinition::GetCategory(attValu << 
770       {                                        << 
771         G4Exception("G4GDMLReadParamvol::Para_ << 
772                     FatalException, "Invalid u << 
773       }                                        << 
774     }                                          << 
775     else if(attName == "aunit")                << 
776     {                                          << 
777       aunit = G4UnitDefinition::GetValueOf(att << 
778       if(G4UnitDefinition::GetCategory(attValu << 
779       {                                        << 
780         G4Exception("G4GDMLReadParamvol::Para_ << 
781                     FatalException, "Invalid u << 
782       }                                        << 
783     }                                          << 
784     else if(attName == "x")                    << 
785     {                                          << 
786       parameter.dimension[0] = eval.Evaluate(a << 
787     }                                          << 
788     else if(attName == "y")                    << 
789     {                                          << 
790       parameter.dimension[1] = eval.Evaluate(a << 
791     }                                          << 
792     else if(attName == "z")                    << 
793     {                                          << 
794       parameter.dimension[2] = eval.Evaluate(a << 
795     }                                          << 
796     else if(attName == "alpha")                << 
797     {                                          << 
798       parameter.dimension[3] = eval.Evaluate(a << 
799     }                                          << 
800     else if(attName == "theta")                << 
801     {                                          << 
802       parameter.dimension[4] = eval.Evaluate(a << 
803     }                                          << 
804     else if(attName == "phi")                  << 
805     {                                          << 
806       parameter.dimension[5] = eval.Evaluate(a << 
807     }                                          << 
808   }                                            << 
809                                                << 
810   parameter.dimension[0] = 0.5 * lunit;        << 
811   parameter.dimension[1] = 0.5 * lunit;        << 
812   parameter.dimension[2] = 0.5 * lunit;        << 
813   parameter.dimension[3] = aunit;              << 
814   parameter.dimension[4] = aunit;              << 
815   parameter.dimension[5] = aunit;              << 
816 }                                              << 
817                                                << 
818 // ------------------------------------------- << 
819 void G4GDMLReadParamvol::Hype_dimensionsRead(  << 
820   const xercesc::DOMElement* const element,    << 
821   G4GDMLParameterisation::PARAMETER& parameter << 
822 {                                              << 
823   G4double lunit = 1.0;                        << 
824   G4double aunit = 1.0;                        << 
825                                                << 
826   const xercesc::DOMNamedNodeMap* const attrib << 
827   XMLSize_t attributeCount                     << 
828                                                << 
829   for(XMLSize_t attribute_index = 0; attribute << 
830       ++attribute_index)                       << 
831   {                                            << 
832     xercesc::DOMNode* attribute_node = attribu << 
833                                                << 
834     if(attribute_node->getNodeType() != xerces << 
835     {                                          << 
836       continue;                                << 
837     }                                          << 
838                                                << 
839     const xercesc::DOMAttr* const attribute =  << 
840       dynamic_cast<xercesc::DOMAttr*>(attribut << 
841     if(attribute == nullptr)                   << 
842     {                                          << 
843       G4Exception("G4GDMLReadParamvol::Hype_di << 
844                   FatalException, "No attribut << 
845       return;                                  << 
846     }                                          << 
847     const G4String attName  = Transcode(attrib << 
848     const G4String attValue = Transcode(attrib << 
849                                                << 
850     if(attName == "lunit")                     << 
851     {                                          << 
852       lunit = G4UnitDefinition::GetValueOf(att << 
853       if(G4UnitDefinition::GetCategory(attValu << 
854       {                                        << 
855         G4Exception("G4GDMLReadParamvol::Hype_ << 
856                     FatalException, "Invalid u << 
857       }                                        << 
858     }                                          << 
859     else if(attName == "aunit")                << 
860     {                                          << 
861       aunit = G4UnitDefinition::GetValueOf(att << 
862       if(G4UnitDefinition::GetCategory(attValu << 
863       {                                        << 
864         G4Exception("G4GDMLReadParamvol::Hype_ << 
865                     FatalException, "Invalid u << 
866       }                                        << 
867     }                                          << 
868     else if(attName == "rmin")                 << 
869     {                                          << 
870       parameter.dimension[0] = eval.Evaluate(a << 
871     }                                          << 
872     else if(attName == "rmax")                 << 
873     {                                          << 
874       parameter.dimension[1] = eval.Evaluate(a << 
875     }                                          << 
876     else if(attName == "inst")                 << 
877     {                                          << 
878       parameter.dimension[2] = eval.Evaluate(a << 
879     }                                          << 
880     else if(attName == "outst")                << 
881     {                                          << 
882       parameter.dimension[3] = eval.Evaluate(a << 
883     }                                          << 
884     else if(attName == "z")                    << 
885     {                                          << 
886       parameter.dimension[4] = eval.Evaluate(a << 
887     }                                          << 
888   }                                            << 
889                                                << 
890   parameter.dimension[0] = lunit;              << 
891   parameter.dimension[1] = lunit;              << 
892   parameter.dimension[2] = aunit;              << 
893   parameter.dimension[3] = aunit;              << 
894   parameter.dimension[4] = 0.5 * lunit;        << 
895 }                                              << 
896                                                << 
897 // ------------------------------------------- << 
898 void G4GDMLReadParamvol::Polycone_dimensionsRe << 
899   const xercesc::DOMElement* const element,    << 
900   G4GDMLParameterisation::PARAMETER& parameter << 
901 {                                              << 
902   G4double lunit = 1.0;                        << 
903   G4double aunit = 1.0;                        << 
904                                                << 
905   std::vector<zplaneType> zplaneList;          << 
906                                                << 
907   const xercesc::DOMNamedNodeMap* const attrib << 
908   XMLSize_t attributeCount                     << 
909                                                << 
910   for(XMLSize_t attribute_index = 0; attribute << 
911       ++attribute_index)                       << 
912   {                                            << 
913     xercesc::DOMNode* attribute_node = attribu << 
914                                                << 
915     if(attribute_node->getNodeType() != xerces << 
916     {                                          << 
917       continue;                                << 
918     }                                          << 
919                                                << 
920     const xercesc::DOMAttr* const attribute =  << 
921       dynamic_cast<xercesc::DOMAttr*>(attribut << 
922     if(attribute == nullptr)                   << 
923     {                                          << 
924       G4Exception("G4GDMLReadParamvol::Polycon << 
925                   "InvalidRead", FatalExceptio << 
926       return;                                  << 
927     }                                          << 
928     const G4String attName  = Transcode(attrib << 
929     const G4String attValue = Transcode(attrib << 
930                                                << 
931     if(attName == "lunit")                     << 
932     {                                          << 
933       lunit = G4UnitDefinition::GetValueOf(att << 
934       if(G4UnitDefinition::GetCategory(attValu << 
935       {                                        << 
936         G4Exception("G4GDMLReadParamvol::Polyc << 
937                     "InvalidRead", FatalExcept << 
938       }                                        << 
939     }                                          << 
940     else if(attName == "aunit")                << 
941     {                                          << 
942       aunit = G4UnitDefinition::GetValueOf(att << 
943       if(G4UnitDefinition::GetCategory(attValu << 
944       {                                        << 
945         G4Exception("G4GDMLReadParamvol::Polyc << 
946                     "InvalidRead", FatalExcept << 
947       }                                        << 
948     }                                          << 
949     else if(attName == "startPhi")             << 
950     {                                          << 
951       parameter.dimension[0] = eval.Evaluate(a << 
952     }                                          << 
953     else if(attName == "openPhi")              << 
954     {                                          << 
955       parameter.dimension[1] = eval.Evaluate(a << 
956     }                                          << 
957     else if(attName == "numRZ")                << 
958     {                                          << 
959       parameter.dimension[2] = eval.Evaluate(a << 
960     }                                          << 
961   }                                            << 
962                                                << 
963   parameter.dimension[0] *= aunit;             << 
964   parameter.dimension[1] *= aunit;             << 
965                                                << 
966   for(xercesc::DOMNode* iter = element->getFir << 
967       iter                   = iter->getNextSi << 
968   {                                            << 
969     if(iter->getNodeType() != xercesc::DOMNode << 
970     {                                          << 
971       continue;                                << 
972     }                                          << 
973                                                << 
974     const xercesc::DOMElement* const child =   << 
975       dynamic_cast<xercesc::DOMElement*>(iter) << 
976     if(child == nullptr)                       << 
977     {                                          << 
978       G4Exception("G4GDMLReadParamVol::Polycon << 
979                   "InvalidRead", FatalExceptio << 
980       return;                                  << 
981     }                                          << 
982     const G4String tag = Transcode(child->getT << 
983                                                << 
984     if(tag == "zplane")                        << 
985     {                                          << 
986       zplaneList.push_back(ZplaneRead(child)); << 
987     }                                          << 
988   }                                            << 
989                                                << 
990   std::size_t numZPlanes = zplaneList.size();  << 
991   for(std::size_t i = 0; i < numZPlanes; ++i)  << 
992   {                                            << 
993     parameter.dimension[3 + i * 3] = zplaneLis << 
994     parameter.dimension[4 + i * 3] = zplaneLis << 
995     parameter.dimension[5 + i * 3] = zplaneLis << 
996   }                                            << 
997 }                                              << 
998                                                << 
999 // ------------------------------------------- << 
1000 void G4GDMLReadParamvol::Polyhedra_dimensions << 
1001   const xercesc::DOMElement* const element,   << 
1002   G4GDMLParameterisation::PARAMETER& paramete << 
1003 {                                                 42 {
1004   G4double lunit = 1.0;                       << 
1005   G4double aunit = 1.0;                       << 
1006                                               << 
1007   std::vector<zplaneType> zplaneList;         << 
1008                                               << 
1009   const xercesc::DOMNamedNodeMap* const attri << 
1010   XMLSize_t attributeCount                    << 
1011                                               << 
1012   for(XMLSize_t attribute_index = 0; attribut << 
1013       ++attribute_index)                      << 
1014   {                                           << 
1015     xercesc::DOMNode* attribute_node = attrib << 
1016                                               << 
1017     if(attribute_node->getNodeType() != xerce << 
1018     {                                         << 
1019       continue;                               << 
1020     }                                         << 
1021                                               << 
1022     const xercesc::DOMAttr* const attribute = << 
1023       dynamic_cast<xercesc::DOMAttr*>(attribu << 
1024     if(attribute == nullptr)                  << 
1025     {                                         << 
1026       G4Exception("G4GDMLReadParamvol::Polyco << 
1027                   "InvalidRead", FatalExcepti << 
1028       return;                                 << 
1029     }                                         << 
1030     const G4String attName  = Transcode(attri << 
1031     const G4String attValue = Transcode(attri << 
1032                                               << 
1033     if(attName == "lunit")                    << 
1034     {                                         << 
1035       lunit = G4UnitDefinition::GetValueOf(at << 
1036       if(G4UnitDefinition::GetCategory(attVal << 
1037       {                                       << 
1038         G4Exception("G4GDMLReadParamvol::Poly << 
1039                     "InvalidRead", FatalExcep << 
1040       }                                       << 
1041     }                                         << 
1042     else if(attName == "aunit")               << 
1043     {                                         << 
1044       aunit = G4UnitDefinition::GetValueOf(at << 
1045       if(G4UnitDefinition::GetCategory(attVal << 
1046       {                                       << 
1047         G4Exception("G4GDMLReadParamvol::Poly << 
1048                     "InvalidRead", FatalExcep << 
1049       }                                       << 
1050     }                                         << 
1051     else if(attName == "startPhi")            << 
1052     {                                         << 
1053       parameter.dimension[0] = eval.Evaluate( << 
1054     }                                         << 
1055     else if(attName == "openPhi")             << 
1056     {                                         << 
1057       parameter.dimension[1] = eval.Evaluate( << 
1058     }                                         << 
1059     else if(attName == "numRZ")               << 
1060     {                                         << 
1061       parameter.dimension[2] = eval.Evaluate( << 
1062     }                                         << 
1063     else if(attName == "numSide")             << 
1064     {                                         << 
1065       parameter.dimension[3] = eval.Evaluate( << 
1066     }                                         << 
1067   }                                           << 
1068                                               << 
1069   parameter.dimension[0] *= aunit;            << 
1070   parameter.dimension[1] *= aunit;            << 
1071                                               << 
1072   for(auto iter = element->getFirstChild(); i << 
1073            iter = iter->getNextSibling())     << 
1074   {                                           << 
1075     if(iter->getNodeType() != xercesc::DOMNod << 
1076     {                                         << 
1077       continue;                               << 
1078     }                                         << 
1079                                               << 
1080     const xercesc::DOMElement* const child =  << 
1081       dynamic_cast<xercesc::DOMElement*>(iter << 
1082     if(child == nullptr)                      << 
1083     {                                         << 
1084       G4Exception("G4GDMLReadParamvo::Polyhed << 
1085                   FatalException, "No child f << 
1086       return;                                 << 
1087     }                                         << 
1088     const G4String tag = Transcode(child->get << 
1089                                               << 
1090     if(tag == "zplane")                       << 
1091     {                                         << 
1092       zplaneList.push_back(ZplaneRead(child)) << 
1093     }                                         << 
1094   }                                           << 
1095                                               << 
1096   std::size_t numZPlanes = zplaneList.size(); << 
1097   for(std::size_t i = 0; i < numZPlanes; ++i) << 
1098   {                                           << 
1099     parameter.dimension[4 + i * 3] = zplaneLi << 
1100     parameter.dimension[5 + i * 3] = zplaneLi << 
1101     parameter.dimension[6 + i * 3] = zplaneLi << 
1102   }                                           << 
1103 }                                                 43 }
1104                                                   44 
1105 // ------------------------------------------ <<  45 void G4GDMLReadParamvol::
1106 void G4GDMLReadParamvol::ParametersRead(      <<  46 Box_dimensionsRead( const xercesc::DOMElement* const element,
1107   const xercesc::DOMElement* const element)   <<  47                     G4GDMLParameterisation::PARAMETER& parameter )
1108 {                                             <<  48 {
1109   G4ThreeVector rotation(0.0, 0.0, 0.0);      <<  49    G4double lunit = 1.0;
1110   G4ThreeVector position(0.0, 0.0, 0.0);      <<  50 
1111                                               <<  51    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
1112   G4GDMLParameterisation::PARAMETER parameter <<  52    XMLSize_t attributeCount = attributes->getLength();
1113                                               <<  53 
1114   for(xercesc::DOMNode* iter = element->getFi <<  54    for (XMLSize_t attribute_index=0;
1115       iter                   = iter->getNextS <<  55         attribute_index<attributeCount; attribute_index++)
1116   {                                           <<  56    {
1117     if(iter->getNodeType() != xercesc::DOMNod <<  57       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1118     {                                         <<  58 
1119       continue;                               <<  59       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1120     }                                         <<  60         { continue; }
1121                                               <<  61 
1122     const xercesc::DOMElement* const child =  <<  62       const xercesc::DOMAttr* const attribute
1123       dynamic_cast<xercesc::DOMElement*>(iter <<  63             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
1124     if(child == nullptr)                      <<  64       const G4String attName = Transcode(attribute->getName());
1125     {                                         <<  65       const G4String attValue = Transcode(attribute->getValue());
1126       G4Exception("G4GDMLReadParamvol::Parame <<  66 
1127                   FatalException, "No child f <<  67       if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1128       return;                                 <<  68       if (attName=="x") { parameter.dimension[0] = eval.Evaluate(attValue); } else
1129     }                                         <<  69       if (attName=="y") { parameter.dimension[1] = eval.Evaluate(attValue); } else
1130     const G4String tag = Transcode(child->get <<  70       if (attName=="z") { parameter.dimension[2] = eval.Evaluate(attValue); }
1131     if(tag == "rotation")                     <<  71    }
1132     {                                         <<  72 
1133       VectorRead(child, rotation);            <<  73    parameter.dimension[0] *= 0.5*lunit;
1134     }                                         <<  74    parameter.dimension[1] *= 0.5*lunit;
1135     else if(tag == "position")                <<  75    parameter.dimension[2] *= 0.5*lunit;
1136     {                                         <<  76 }
1137       VectorRead(child, position);            <<  77 
1138     }                                         <<  78 void G4GDMLReadParamvol::
1139     else if(tag == "positionref")             <<  79 Trd_dimensionsRead( const xercesc::DOMElement* const element,
1140     {                                         <<  80                     G4GDMLParameterisation::PARAMETER& parameter )
1141       position = GetPosition(GenerateName(Ref <<  81 {
1142     }                                         <<  82    G4double lunit = 1.0;
1143     else if(tag == "rotationref")             <<  83 
1144     {                                         <<  84    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
1145       rotation = GetRotation(GenerateName(Ref <<  85    XMLSize_t attributeCount = attributes->getLength();
1146     }                                         <<  86 
1147     else if(tag == "box_dimensions")          <<  87    for (XMLSize_t attribute_index=0;
1148     {                                         <<  88         attribute_index<attributeCount; attribute_index++)
1149       Box_dimensionsRead(child, parameter);   <<  89    {
1150     }                                         <<  90       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1151     else if(tag == "trd_dimensions")          <<  91 
1152     {                                         <<  92       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1153       Trd_dimensionsRead(child, parameter);   <<  93         { continue; }
1154     }                                         <<  94 
1155     else if(tag == "trap_dimensions")         <<  95       const xercesc::DOMAttr* const attribute
1156     {                                         <<  96             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
1157       Trap_dimensionsRead(child, parameter);  <<  97       const G4String attName = Transcode(attribute->getName());
1158     }                                         <<  98       const G4String attValue = Transcode(attribute->getValue());
1159     else if(tag == "tube_dimensions")         <<  99 
1160     {                                         << 100       if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1161       Tube_dimensionsRead(child, parameter);  << 101       if (attName=="x1") { parameter.dimension[0]=eval.Evaluate(attValue); } else
1162     }                                         << 102       if (attName=="x2") { parameter.dimension[1]=eval.Evaluate(attValue); } else
1163     else if(tag == "cone_dimensions")         << 103       if (attName=="y1") { parameter.dimension[2]=eval.Evaluate(attValue); } else
1164     {                                         << 104       if (attName=="y2") { parameter.dimension[3]=eval.Evaluate(attValue); } else
1165       Cone_dimensionsRead(child, parameter);  << 105       if (attName=="z")  { parameter.dimension[4]=eval.Evaluate(attValue); }
1166     }                                         << 106    }
1167     else if(tag == "sphere_dimensions")       << 107 
1168     {                                         << 108    parameter.dimension[0] *= 0.5*lunit;
1169       Sphere_dimensionsRead(child, parameter) << 109    parameter.dimension[1] *= 0.5*lunit;
1170     }                                         << 110    parameter.dimension[2] *= 0.5*lunit;
1171     else if(tag == "orb_dimensions")          << 111    parameter.dimension[3] *= 0.5*lunit;
1172     {                                         << 112    parameter.dimension[4] *= 0.5*lunit;
1173       Orb_dimensionsRead(child, parameter);   << 113 }
1174     }                                         << 114 
1175     else if(tag == "torus_dimensions")        << 115 void G4GDMLReadParamvol::
1176     {                                         << 116 Trap_dimensionsRead( const xercesc::DOMElement* const element,
1177       Torus_dimensionsRead(child, parameter); << 117                      G4GDMLParameterisation::PARAMETER& parameter )
1178     }                                         << 118 {
1179     else if(tag == "ellipsoid_dimensions")    << 119    G4double lunit = 1.0;
1180     {                                         << 120    G4double aunit = 1.0;
1181       Ellipsoid_dimensionsRead(child, paramet << 121 
1182     }                                         << 122    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
1183     else if(tag == "para_dimensions")         << 123    XMLSize_t attributeCount = attributes->getLength();
1184     {                                         << 124 
1185       Para_dimensionsRead(child, parameter);  << 125    for (XMLSize_t attribute_index=0;
1186     }                                         << 126         attribute_index<attributeCount; attribute_index++)
1187     else if(tag == "polycone_dimensions")     << 127    {
1188     {                                         << 128       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1189       Polycone_dimensionsRead(child, paramete << 129 
1190     }                                         << 130       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1191     else if(tag == "polyhedra_dimensions")    << 131         { continue; }
1192     {                                         << 132 
1193       Polyhedra_dimensionsRead(child, paramet << 133       const xercesc::DOMAttr* const attribute
1194     }                                         << 134             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
1195     else if(tag == "hype_dimensions")         << 135       const G4String attName = Transcode(attribute->getName());
1196     {                                         << 136       const G4String attValue = Transcode(attribute->getValue());
1197       Hype_dimensionsRead(child, parameter);  << 137 
1198     }                                         << 138       if (attName=="lunit")
1199     else                                      << 139         { lunit = eval.Evaluate(attValue); } else
1200     {                                         << 140       if (attName=="aunit")
1201       G4String error_msg = "Unknown tag in pa << 141         { aunit = eval.Evaluate(attValue); } else
1202       G4Exception("G4GDMLReadParamvol::Parame << 142       if (attName=="z")
1203                   FatalException, error_msg); << 143         { parameter.dimension[0] = eval.Evaluate(attValue); } else
1204     }                                         << 144       if (attName=="theta")
1205   }                                           << 145         { parameter.dimension[1] = eval.Evaluate(attValue); } else
1206                                               << 146       if (attName=="phi")
1207   parameter.pRot = new G4RotationMatrix();    << 147         { parameter.dimension[2] = eval.Evaluate(attValue); } else
1208                                               << 148       if (attName=="y1")
1209   parameter.pRot->rotateX(rotation.x());      << 149         { parameter.dimension[3] = eval.Evaluate(attValue); } else
1210   parameter.pRot->rotateY(rotation.y());      << 150       if (attName=="x1")
1211   parameter.pRot->rotateZ(rotation.z());      << 151         { parameter.dimension[4] = eval.Evaluate(attValue); } else
1212                                               << 152       if (attName=="x2")
1213   parameter.position = position;              << 153         { parameter.dimension[5] = eval.Evaluate(attValue); } else
1214                                               << 154       if (attName=="alpha1")
1215   parameterisation->AddParameter(parameter);  << 155         { parameter.dimension[6] = eval.Evaluate(attValue); } else
1216 }                                             << 156       if (attName=="y2")
1217                                               << 157         { parameter.dimension[7] = eval.Evaluate(attValue); } else
1218 // ------------------------------------------ << 158       if (attName=="x3")
1219 void G4GDMLReadParamvol::ParameterisedRead(   << 159         { parameter.dimension[8] = eval.Evaluate(attValue); } else
1220   const xercesc::DOMElement* const element)   << 160       if (attName=="x4")
1221 {                                             << 161         { parameter.dimension[9] = eval.Evaluate(attValue); } else
1222   for(xercesc::DOMNode* iter = element->getFi << 162       if (attName=="alpha2")
1223       iter                   = iter->getNextS << 163         { parameter.dimension[10] = eval.Evaluate(attValue); }
1224   {                                           << 164    }
1225     if(iter->getNodeType() != xercesc::DOMNod << 165 
1226     {                                         << 166    parameter.dimension[0] *= 0.5*lunit;
1227       continue;                               << 167    parameter.dimension[1] *= aunit;
1228     }                                         << 168    parameter.dimension[2] *= aunit;
1229                                               << 169    parameter.dimension[3] *= 0.5*lunit;
1230     const xercesc::DOMElement* const child =  << 170    parameter.dimension[4] *= 0.5*lunit;
1231       dynamic_cast<xercesc::DOMElement*>(iter << 171    parameter.dimension[5] *= 0.5*lunit;
1232     if(child == nullptr)                      << 172    parameter.dimension[6] *= aunit;
1233     {                                         << 173    parameter.dimension[7] *= 0.5*lunit;
1234       G4Exception("G4GDMLReadParamvol::Parame << 174    parameter.dimension[8] *= 0.5*lunit;
1235                   FatalException, "No child f << 175    parameter.dimension[9] *= 0.5*lunit;
1236       return;                                 << 176    parameter.dimension[10] *= aunit;
1237     }                                         << 177 }
1238     const G4String tag = Transcode(child->get << 178 
1239                                               << 179 void G4GDMLReadParamvol::
1240     if(tag == "parameters")                   << 180 Tube_dimensionsRead( const xercesc::DOMElement* const element,
1241     {                                         << 181                      G4GDMLParameterisation::PARAMETER& parameter )
1242       const xercesc::DOMNamedNodeMap* const a << 182 {
1243         element->getAttributes();             << 183    G4double lunit = 1.0;
1244       XMLSize_t attributeCount = attributes-> << 184    G4double aunit = 1.0;
1245       for(XMLSize_t attribute_index = 0; attr << 185 
1246           ++attribute_index)                  << 186    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
1247       {                                       << 187    XMLSize_t attributeCount = attributes->getLength();
1248         xercesc::DOMNode* attribute_node = at << 188 
1249                                               << 189    for (XMLSize_t attribute_index=0;
1250         if(attribute_node->getNodeType() != x << 190         attribute_index<attributeCount; attribute_index++)
                                                   >> 191    {
                                                   >> 192       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
                                                   >> 193 
                                                   >> 194       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
                                                   >> 195         { continue; }
                                                   >> 196 
                                                   >> 197       const xercesc::DOMAttr* const attribute
                                                   >> 198             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
                                                   >> 199       const G4String attName = Transcode(attribute->getName());
                                                   >> 200       const G4String attValue = Transcode(attribute->getValue());
                                                   >> 201     
                                                   >> 202       if (attName=="lunit")
                                                   >> 203         { lunit = eval.Evaluate(attValue); } else
                                                   >> 204       if (attName=="aunit")
                                                   >> 205         { aunit = eval.Evaluate(attValue); } else
                                                   >> 206       if (attName=="InR")
                                                   >> 207         { parameter.dimension[0] = eval.Evaluate(attValue); } else
                                                   >> 208       if (attName=="OutR")
                                                   >> 209         { parameter.dimension[1] = eval.Evaluate(attValue); } else
                                                   >> 210       if (attName=="hz")
                                                   >> 211         { parameter.dimension[2] = eval.Evaluate(attValue); } else
                                                   >> 212       if (attName=="StartPhi")
                                                   >> 213         { parameter.dimension[3] = eval.Evaluate(attValue); } else
                                                   >> 214       if (attName=="DeltaPhi")
                                                   >> 215         { parameter.dimension[4] = eval.Evaluate(attValue); }
                                                   >> 216    }
                                                   >> 217 
                                                   >> 218    parameter.dimension[0] *= lunit;
                                                   >> 219    parameter.dimension[1] *= lunit;
                                                   >> 220    parameter.dimension[2] *= 0.5*lunit;
                                                   >> 221    parameter.dimension[3] *= aunit;
                                                   >> 222    parameter.dimension[4] *= aunit;
                                                   >> 223 }
                                                   >> 224 
                                                   >> 225 void G4GDMLReadParamvol::
                                                   >> 226 Cone_dimensionsRead( const xercesc::DOMElement* const element,
                                                   >> 227                      G4GDMLParameterisation::PARAMETER& parameter )
                                                   >> 228 {
                                                   >> 229    G4double lunit = 1.0;
                                                   >> 230    G4double aunit = 1.0;
                                                   >> 231 
                                                   >> 232    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
                                                   >> 233    XMLSize_t attributeCount = attributes->getLength();
                                                   >> 234 
                                                   >> 235    for (XMLSize_t attribute_index=0;
                                                   >> 236         attribute_index<attributeCount; attribute_index++)
                                                   >> 237    {
                                                   >> 238       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
                                                   >> 239 
                                                   >> 240       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
                                                   >> 241         { continue; }
                                                   >> 242 
                                                   >> 243       const xercesc::DOMAttr* const attribute
                                                   >> 244             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
                                                   >> 245       const G4String attName = Transcode(attribute->getName());
                                                   >> 246       const G4String attValue = Transcode(attribute->getValue());
                                                   >> 247 
                                                   >> 248       if (attName=="lunit")
                                                   >> 249         { lunit = eval.Evaluate(attValue); } else
                                                   >> 250       if (attName=="aunit")
                                                   >> 251         { aunit = eval.Evaluate(attValue); } else
                                                   >> 252       if (attName=="rmin1")
                                                   >> 253         { parameter.dimension[0] = eval.Evaluate(attValue); } else
                                                   >> 254       if (attName=="rmax1")
                                                   >> 255         { parameter.dimension[1] = eval.Evaluate(attValue); } else
                                                   >> 256       if (attName=="rmin2")
                                                   >> 257         { parameter.dimension[2] = eval.Evaluate(attValue); } else
                                                   >> 258       if (attName=="rmax2")
                                                   >> 259         { parameter.dimension[3] = eval.Evaluate(attValue); } else
                                                   >> 260       if (attName=="z")
                                                   >> 261         { parameter.dimension[4] = eval.Evaluate(attValue); } else
                                                   >> 262       if (attName=="startphi")
                                                   >> 263         { parameter.dimension[5] = eval.Evaluate(attValue); } else
                                                   >> 264       if (attName=="deltaphi")
                                                   >> 265         { parameter.dimension[6] = eval.Evaluate(attValue); }
                                                   >> 266    }
                                                   >> 267 
                                                   >> 268    parameter.dimension[0] *= lunit;
                                                   >> 269    parameter.dimension[1] *= lunit;
                                                   >> 270    parameter.dimension[2] *= lunit;
                                                   >> 271    parameter.dimension[3] *= lunit;
                                                   >> 272    parameter.dimension[4] *= 0.5*lunit;
                                                   >> 273    parameter.dimension[5] *= aunit;
                                                   >> 274    parameter.dimension[6] *= aunit;
                                                   >> 275 }
                                                   >> 276 
                                                   >> 277 void G4GDMLReadParamvol::
                                                   >> 278 Sphere_dimensionsRead( const xercesc::DOMElement* const element,
                                                   >> 279                        G4GDMLParameterisation::PARAMETER& parameter ) 
                                                   >> 280 {
                                                   >> 281    G4double lunit = 1.0;
                                                   >> 282    G4double aunit = 1.0;
                                                   >> 283 
                                                   >> 284    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
                                                   >> 285    XMLSize_t attributeCount = attributes->getLength();
                                                   >> 286 
                                                   >> 287    for (XMLSize_t attribute_index=0;
                                                   >> 288         attribute_index<attributeCount; attribute_index++)
                                                   >> 289    {
                                                   >> 290       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
                                                   >> 291 
                                                   >> 292       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
                                                   >> 293         { continue; }
                                                   >> 294 
                                                   >> 295       const xercesc::DOMAttr* const attribute
                                                   >> 296             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
                                                   >> 297       const G4String attName = Transcode(attribute->getName());
                                                   >> 298       const G4String attValue = Transcode(attribute->getValue());
                                                   >> 299 
                                                   >> 300       if (attName=="lunit")
                                                   >> 301         { lunit = eval.Evaluate(attValue); } else
                                                   >> 302       if (attName=="aunit")
                                                   >> 303         { aunit = eval.Evaluate(attValue); } else
                                                   >> 304       if (attName=="rmin")
                                                   >> 305         { parameter.dimension[0] = eval.Evaluate(attValue); } else
                                                   >> 306       if (attName=="rmax")
                                                   >> 307         { parameter.dimension[1] = eval.Evaluate(attValue); } else
                                                   >> 308       if (attName=="startphi")
                                                   >> 309         { parameter.dimension[2] = eval.Evaluate(attValue); } else
                                                   >> 310       if (attName=="deltaphi")
                                                   >> 311         { parameter.dimension[3] = eval.Evaluate(attValue); } else
                                                   >> 312       if (attName=="starttheta")
                                                   >> 313         { parameter.dimension[4] = eval.Evaluate(attValue); } else
                                                   >> 314       if (attName=="deltatheta")
                                                   >> 315         { parameter.dimension[5] = eval.Evaluate(attValue); }
                                                   >> 316    }
                                                   >> 317 
                                                   >> 318    parameter.dimension[0] *= lunit;
                                                   >> 319    parameter.dimension[1] *= lunit;
                                                   >> 320    parameter.dimension[2] *= aunit;
                                                   >> 321    parameter.dimension[3] *= aunit;
                                                   >> 322    parameter.dimension[4] *= aunit;
                                                   >> 323    parameter.dimension[5] *= aunit;
                                                   >> 324 }
                                                   >> 325 
                                                   >> 326 void G4GDMLReadParamvol::
                                                   >> 327 Orb_dimensionsRead( const xercesc::DOMElement* const element,
                                                   >> 328                     G4GDMLParameterisation::PARAMETER& parameter )
                                                   >> 329 {
                                                   >> 330    G4double lunit = 1.0;
                                                   >> 331 
                                                   >> 332    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
                                                   >> 333    XMLSize_t attributeCount = attributes->getLength();
                                                   >> 334 
                                                   >> 335    for (XMLSize_t attribute_index=0;
                                                   >> 336         attribute_index<attributeCount; attribute_index++)
                                                   >> 337    {
                                                   >> 338       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
                                                   >> 339 
                                                   >> 340       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
                                                   >> 341         { continue; }
                                                   >> 342 
                                                   >> 343       const xercesc::DOMAttr* const attribute
                                                   >> 344             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
                                                   >> 345       const G4String attName = Transcode(attribute->getName());
                                                   >> 346       const G4String attValue = Transcode(attribute->getValue());
                                                   >> 347 
                                                   >> 348       if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
                                                   >> 349       if (attName=="r") { parameter.dimension[0] = eval.Evaluate(attValue); }
                                                   >> 350    }
                                                   >> 351 
                                                   >> 352    parameter.dimension[0] *= lunit;
                                                   >> 353 }
                                                   >> 354 
                                                   >> 355 void G4GDMLReadParamvol::
                                                   >> 356 Torus_dimensionsRead( const xercesc::DOMElement* const element,
                                                   >> 357                       G4GDMLParameterisation::PARAMETER& parameter )
                                                   >> 358 {
                                                   >> 359    G4double lunit = 1.0;
                                                   >> 360    G4double aunit = 1.0;
                                                   >> 361 
                                                   >> 362    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
                                                   >> 363    XMLSize_t attributeCount = attributes->getLength();
                                                   >> 364 
                                                   >> 365    for (XMLSize_t attribute_index=0;
                                                   >> 366         attribute_index<attributeCount; attribute_index++)
                                                   >> 367    {
                                                   >> 368       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
                                                   >> 369 
                                                   >> 370       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
                                                   >> 371         { continue; }
                                                   >> 372 
                                                   >> 373       const xercesc::DOMAttr* const attribute
                                                   >> 374             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
                                                   >> 375       const G4String attName = Transcode(attribute->getName());
                                                   >> 376       const G4String attValue = Transcode(attribute->getValue());
                                                   >> 377 
                                                   >> 378       if (attName=="lunit")
                                                   >> 379         { lunit = eval.Evaluate(attValue); } else
                                                   >> 380       if (attName=="aunit")
                                                   >> 381         { aunit = eval.Evaluate(attValue); } else
                                                   >> 382       if (attName=="rmin")
                                                   >> 383         { parameter.dimension[0] = eval.Evaluate(attValue); } else
                                                   >> 384       if (attName=="rmax")
                                                   >> 385         { parameter.dimension[1] = eval.Evaluate(attValue); } else
                                                   >> 386       if (attName=="rtor")
                                                   >> 387         { parameter.dimension[2] = eval.Evaluate(attValue); } else
                                                   >> 388       if (attName=="startphi")
                                                   >> 389         { parameter.dimension[3] = eval.Evaluate(attValue); } else
                                                   >> 390       if (attName=="deltaphi")
                                                   >> 391         { parameter.dimension[4] = eval.Evaluate(attValue); }
                                                   >> 392    }
                                                   >> 393 
                                                   >> 394    parameter.dimension[0] *= lunit;
                                                   >> 395    parameter.dimension[1] *= lunit;
                                                   >> 396    parameter.dimension[2] *= lunit;
                                                   >> 397    parameter.dimension[3] *= aunit;
                                                   >> 398    parameter.dimension[4] *= aunit;
                                                   >> 399 }
                                                   >> 400 
                                                   >> 401 void G4GDMLReadParamvol::
                                                   >> 402 Para_dimensionsRead( const xercesc::DOMElement* const element,
                                                   >> 403                      G4GDMLParameterisation::PARAMETER& parameter )
                                                   >> 404 {
                                                   >> 405    G4double lunit = 1.0;
                                                   >> 406    G4double aunit = 1.0;
                                                   >> 407 
                                                   >> 408    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
                                                   >> 409    XMLSize_t attributeCount = attributes->getLength();
                                                   >> 410 
                                                   >> 411    for (XMLSize_t attribute_index=0;
                                                   >> 412         attribute_index<attributeCount; attribute_index++)
                                                   >> 413    {
                                                   >> 414       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
                                                   >> 415 
                                                   >> 416       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
                                                   >> 417         { continue; }
                                                   >> 418 
                                                   >> 419       const xercesc::DOMAttr* const attribute
                                                   >> 420             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
                                                   >> 421       const G4String attName = Transcode(attribute->getName());
                                                   >> 422       const G4String attValue = Transcode(attribute->getValue());
                                                   >> 423 
                                                   >> 424       if (attName=="lunit")
                                                   >> 425         { lunit = eval.Evaluate(attValue); } else
                                                   >> 426       if (attName=="aunit")
                                                   >> 427         { aunit = eval.Evaluate(attValue); } else
                                                   >> 428       if (attName=="x")
                                                   >> 429         { parameter.dimension[0] = eval.Evaluate(attValue); } else
                                                   >> 430       if (attName=="y")
                                                   >> 431         { parameter.dimension[1] = eval.Evaluate(attValue); } else
                                                   >> 432       if (attName=="z")
                                                   >> 433         { parameter.dimension[2] = eval.Evaluate(attValue); } else
                                                   >> 434       if (attName=="alpha")
                                                   >> 435         { parameter.dimension[3] = eval.Evaluate(attValue); } else
                                                   >> 436       if (attName=="theta")
                                                   >> 437         { parameter.dimension[4] = eval.Evaluate(attValue); } else
                                                   >> 438       if (attName=="phi")
                                                   >> 439         { parameter.dimension[5] = eval.Evaluate(attValue); }
                                                   >> 440    }
                                                   >> 441 
                                                   >> 442    parameter.dimension[0] = 0.5*lunit;
                                                   >> 443    parameter.dimension[1] = 0.5*lunit;
                                                   >> 444    parameter.dimension[2] = 0.5*lunit;
                                                   >> 445    parameter.dimension[3] = aunit;
                                                   >> 446    parameter.dimension[4] = aunit;
                                                   >> 447    parameter.dimension[5] = aunit;
                                                   >> 448 }
                                                   >> 449 
                                                   >> 450 void G4GDMLReadParamvol::
                                                   >> 451 Hype_dimensionsRead( const xercesc::DOMElement* const element,
                                                   >> 452                      G4GDMLParameterisation::PARAMETER& parameter )
                                                   >> 453 {
                                                   >> 454    G4double lunit = 1.0;
                                                   >> 455    G4double aunit = 1.0;
                                                   >> 456 
                                                   >> 457    const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
                                                   >> 458    XMLSize_t attributeCount = attributes->getLength();
                                                   >> 459 
                                                   >> 460    for (XMLSize_t attribute_index=0;
                                                   >> 461         attribute_index<attributeCount; attribute_index++)
                                                   >> 462    {
                                                   >> 463       xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
                                                   >> 464 
                                                   >> 465       if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
                                                   >> 466         { continue; }
                                                   >> 467 
                                                   >> 468       const xercesc::DOMAttr* const attribute
                                                   >> 469             = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
                                                   >> 470       const G4String attName = Transcode(attribute->getName());
                                                   >> 471       const G4String attValue = Transcode(attribute->getValue());
                                                   >> 472 
                                                   >> 473       if (attName=="lunit")
                                                   >> 474         { lunit = eval.Evaluate(attValue); } else
                                                   >> 475       if (attName=="aunit")
                                                   >> 476         { aunit = eval.Evaluate(attValue); } else
                                                   >> 477       if (attName=="rmin")
                                                   >> 478         { parameter.dimension[0] = eval.Evaluate(attValue); } else
                                                   >> 479       if (attName=="rmax")
                                                   >> 480         { parameter.dimension[1] = eval.Evaluate(attValue); } else
                                                   >> 481       if (attName=="inst")
                                                   >> 482         { parameter.dimension[2] = eval.Evaluate(attValue); } else
                                                   >> 483       if (attName=="outst")
                                                   >> 484         { parameter.dimension[3] = eval.Evaluate(attValue); } else
                                                   >> 485       if (attName=="z")
                                                   >> 486         { parameter.dimension[4] = eval.Evaluate(attValue); }
                                                   >> 487    }
                                                   >> 488 
                                                   >> 489    parameter.dimension[0] = lunit;
                                                   >> 490    parameter.dimension[1] = lunit;
                                                   >> 491    parameter.dimension[2] = aunit;
                                                   >> 492    parameter.dimension[3] = aunit;
                                                   >> 493    parameter.dimension[4] = 0.5*lunit;
                                                   >> 494 }
                                                   >> 495 
                                                   >> 496 void G4GDMLReadParamvol::
                                                   >> 497 ParametersRead(const xercesc::DOMElement* const element) {
                                                   >> 498 
                                                   >> 499    G4ThreeVector rotation(0.0,0.0,0.0);
                                                   >> 500    G4ThreeVector position(0.0,0.0,0.0);
                                                   >> 501 
                                                   >> 502    G4GDMLParameterisation::PARAMETER parameter;
                                                   >> 503 
                                                   >> 504    for (xercesc::DOMNode* iter = element->getFirstChild();
                                                   >> 505         iter != 0; iter = iter->getNextSibling())
                                                   >> 506    {
                                                   >> 507       if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)  { continue; }
                                                   >> 508 
                                                   >> 509       const xercesc::DOMElement* const child
                                                   >> 510             = dynamic_cast<xercesc::DOMElement*>(iter);
                                                   >> 511       const G4String tag = Transcode(child->getTagName());
                                                   >> 512       if (tag=="rotation") { VectorRead(child,rotation); } else
                                                   >> 513       if (tag=="position") { VectorRead(child,position); } else
                                                   >> 514       if (tag=="positionref")
                                                   >> 515         { position = GetPosition(GenerateName(RefRead(child))); } else
                                                   >> 516       if (tag=="rotationref")
                                                   >> 517         { rotation = GetRotation(GenerateName(RefRead(child))); } else
                                                   >> 518       if (tag=="box_dimensions") { Box_dimensionsRead(child,parameter); } else
                                                   >> 519       if (tag=="trd_dimensions") { Trd_dimensionsRead(child,parameter); } else
                                                   >> 520       if (tag=="trap_dimensions") { Trap_dimensionsRead(child,parameter); } else
                                                   >> 521       if (tag=="tube_dimensions") { Tube_dimensionsRead(child,parameter); } else
                                                   >> 522       if (tag=="cone_dimensions") { Cone_dimensionsRead(child,parameter); } else
                                                   >> 523       if (tag=="sphere_dimensions") { Cone_dimensionsRead(child,parameter); } else
                                                   >> 524       if (tag=="orb_dimensions") { Cone_dimensionsRead(child,parameter); } else
                                                   >> 525       if (tag=="torus_dimensions") { Cone_dimensionsRead(child,parameter); } else
                                                   >> 526       if (tag=="para_dimensions") { Cone_dimensionsRead(child,parameter); } else
                                                   >> 527       if (tag=="hype_dimensions") { Hype_dimensionsRead(child,parameter); }
                                                   >> 528       else
                                                   >> 529       {
                                                   >> 530         G4String error_msg = "Unknown tag in parameters: " + tag;
                                                   >> 531         G4Exception("G4GDMLReadParamvol::ParametersRead()", "ReadError",
                                                   >> 532                     FatalException, error_msg);
                                                   >> 533       }
                                                   >> 534    }
                                                   >> 535 
                                                   >> 536    parameter.pRot = new G4RotationMatrix();
                                                   >> 537    
                                                   >> 538    parameter.pRot->rotateX(rotation.x());
                                                   >> 539    parameter.pRot->rotateY(rotation.y());
                                                   >> 540    parameter.pRot->rotateZ(rotation.z());
                                                   >> 541 
                                                   >> 542    parameter.position = position;
                                                   >> 543 
                                                   >> 544    parameterisation->AddParameter(parameter);
                                                   >> 545 }
                                                   >> 546 
                                                   >> 547 void G4GDMLReadParamvol::
                                                   >> 548 ParameterisedRead(const xercesc::DOMElement* const element)
                                                   >> 549 {
                                                   >> 550    for (xercesc::DOMNode* iter = element->getFirstChild();
                                                   >> 551         iter != 0; iter = iter->getNextSibling())
                                                   >> 552    {
                                                   >> 553      if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)  { continue; }
                                                   >> 554 
                                                   >> 555      const xercesc::DOMElement* const child
                                                   >> 556            = dynamic_cast<xercesc::DOMElement*>(iter);
                                                   >> 557      const G4String tag = Transcode(child->getTagName());
                                                   >> 558  
                                                   >> 559      if (tag=="parameters")
                                                   >> 560      {
                                                   >> 561         G4double number = 1;
                                                   >> 562         const xercesc::DOMNamedNodeMap* const attributes
                                                   >> 563               = element->getAttributes();
                                                   >> 564         XMLSize_t attributeCount = attributes->getLength();
                                                   >> 565         for (XMLSize_t attribute_index=0;
                                                   >> 566              attribute_index<attributeCount; attribute_index++)
1251         {                                        567         {
1252           continue;                           << 568           xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1253         }                                     << 
1254                                                  569 
1255         const xercesc::DOMAttr* const attribu << 570           if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1256           dynamic_cast<xercesc::DOMAttr*>(att << 571             { continue; }
1257         if(attribute == nullptr)              << 
1258         {                                     << 
1259           G4Exception("G4GDMLReadParamvol::Pa << 
1260                       FatalException, "No att << 
1261           return;                             << 
1262         }                                     << 
1263         const G4String attName  = Transcode(a << 
1264         const G4String attValue = Transcode(a << 
1265                                                  572 
1266         if(attName == "number")               << 573           const xercesc::DOMAttr* const attribute
1267         {                                     << 574                 = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
1268           eval.Evaluate(attValue);            << 575           const G4String attName = Transcode(attribute->getName());
                                                   >> 576           const G4String attValue = Transcode(attribute->getValue());
                                                   >> 577 
                                                   >> 578           if (attName=="number")  { number = eval.Evaluate(attValue); }
1269         }                                        579         }
                                                   >> 580         ParametersRead(child);
1270       }                                          581       }
1271       ParametersRead(child);                  << 582       else
1272     }                                         << 
1273     else                                      << 
1274     {                                         << 
1275       if(tag == "loop")                       << 
1276       {                                          583       {
1277         LoopRead(child, &G4GDMLRead::Paramvol << 584         if (tag=="loop") { LoopRead(child,&G4GDMLRead::Paramvol_contentRead); }
1278       }                                          585       }
1279     }                                            586     }
1280   }                                           << 
1281 }                                                587 }
1282                                                  588 
1283 // ------------------------------------------ << 589 void G4GDMLReadParamvol::
1284 void G4GDMLReadParamvol::Paramvol_contentRead << 590 Paramvol_contentRead(const xercesc::DOMElement* const element)
1285   const xercesc::DOMElement* const element)   << 
1286 {                                                591 {
1287   for(xercesc::DOMNode* iter = element->getFi << 592    for (xercesc::DOMNode* iter = element->getFirstChild();
1288       iter                   = iter->getNextS << 593         iter != 0; iter = iter->getNextSibling())
1289   {                                           << 594    {
1290     if(iter->getNodeType() != xercesc::DOMNod << 595       if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)  { continue; }
1291     {                                         << 
1292       continue;                               << 
1293     }                                         << 
1294                                                  596 
1295     const xercesc::DOMElement* const child =  << 597       const xercesc::DOMElement* const child
1296       dynamic_cast<xercesc::DOMElement*>(iter << 598             = dynamic_cast<xercesc::DOMElement*>(iter);
1297     if(child == nullptr)                      << 599       const G4String tag = Transcode(child->getTagName());
1298     {                                         << 600       if (tag=="parameterised_position_size") { ParameterisedRead(child); }else
1299       G4Exception("G4GDMLReadParamvol::Paramv << 601       if (tag=="loop") { LoopRead(child,&G4GDMLRead::Paramvol_contentRead); }
1300                   FatalException, "No child f << 
1301       return;                                 << 
1302     }                                         << 
1303     const G4String tag = Transcode(child->get << 
1304     if(tag == "parameterised_position_size")  << 
1305     {                                         << 
1306       ParameterisedRead(child);               << 
1307     }                                            602     }
1308     else if(tag == "loop")                    << 
1309     {                                         << 
1310       LoopRead(child, &G4GDMLRead::Paramvol_c << 
1311     }                                         << 
1312   }                                           << 
1313 }                                                603 }
1314                                                  604 
1315 // ------------------------------------------ << 605 void G4GDMLReadParamvol::
1316 void G4GDMLReadParamvol::ParamvolRead(const x << 606 ParamvolRead(const xercesc::DOMElement* const element, G4LogicalVolume* mother)
1317                                       G4Logic << 
1318 {                                                607 {
1319   G4String volumeref;                         << 608    G4String volumeref;
1320                                                  609 
1321   parameterisation = new G4GDMLParameterisati << 610    parameterisation = new G4GDMLParameterisation();
1322   for(xercesc::DOMNode* iter = element->getFi << 
1323       iter                   = iter->getNextS << 
1324   {                                           << 
1325     if(iter->getNodeType() != xercesc::DOMNod << 
1326     {                                         << 
1327       continue;                               << 
1328     }                                         << 
1329                                                  611 
1330     const xercesc::DOMElement* const child =  << 612    for (xercesc::DOMNode* iter = element->getFirstChild();
1331       dynamic_cast<xercesc::DOMElement*>(iter << 613         iter != 0; iter = iter->getNextSibling())
1332     if(child == nullptr)                      << 614    {
1333     {                                         << 615       if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)  { continue; }
1334       G4Exception("G4GDMLReadParamvol::Paramv << 
1335                   FatalException, "No child f << 
1336       return;                                 << 
1337     }                                         << 
1338     const G4String tag = Transcode(child->get << 
1339                                                  616 
1340     if(tag == "volumeref")                    << 617       const xercesc::DOMElement* const child
1341     {                                         << 618             = dynamic_cast<xercesc::DOMElement*>(iter);
1342       volumeref = RefRead(child);             << 619       const G4String tag = Transcode(child->getTagName());
1343     }                                         << 620 
1344   }                                           << 621       if (tag=="volumeref") { volumeref = RefRead(child); }
                                                   >> 622      
                                                   >> 623    }
1345                                                  624 
1346   Paramvol_contentRead(element);              << 625    Paramvol_contentRead(element);
1347                                                  626 
1348   G4LogicalVolume* logvol = GetVolume(Generat << 627    G4LogicalVolume* logvol = GetVolume(GenerateName(volumeref));
1349                                                  628 
1350   if(parameterisation->GetSize() == 0)        << 629    if (parameterisation->GetSize()==0)
1351   {                                           << 630    {
1352     G4Exception("G4GDMLReadParamvol::Paramvol << 631      G4Exception("G4GDMLReadParamvol::ParamvolRead()",
1353                 FatalException,               << 632                  "ReadError", FatalException,
1354                 "No parameters are defined in << 633                  "No parameters are defined in parameterised volume!");
1355   }                                           << 634    }
1356   G4String pv_name = logvol->GetName() + "_pa << 635    G4String pv_name = logvol->GetName() + "_param";
1357   new G4PVParameterised(pv_name, logvol, moth << 636    new G4PVParameterised(pv_name, logvol, mother, kUndefined,
1358                         parameterisation->Get << 637                          parameterisation->GetSize(), parameterisation, check);
1359 }                                                638 }
1360                                                  639