Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
+19
View File
@@ -17,6 +17,25 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
25 October 2012 Gabriele Cosmo (gdml-V09-05-05)
- Added inclusion of headers to G4STRead.cc to make it self consistent.
18 July 2012 Witek Pokorski (gdml-V09-05-04)
- Corrected handling of constant material properties.
5 July 2012 - Gabriele Cosmo (gdml-V09-05-03)
- Explicitly use inclusion of headers for system of units and physical
constants, in plan to remove implicit inclusion from globals.hh.
30 May 2012 - Gabriele Cosmo (gdml-V09-05-02)
- Fixed typo introduced in previous tag...
25 May 2012 - Gabriele Cosmo (gdml-V09-05-01)
- Fixed trivial cases of variable shadowing.
20 March 2012 Witek Pokorski (gdml-V09-05-00, gdml-V09-04-11)
- Bug fix in material properties.
23 November 2011 Gabriele Cosmo (gdml-V09-04-10)
- Additional fix on G4EllipticalTube, to not consider units in import for
semi-axes ratios.
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLEvaluator.hh,v 1.18 2010-10-25 10:15:41 witoldp Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLEvaluator
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLMessenger.hh,v 1.3 2010-11-02 11:44:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLMessenger
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLParameterisation.hh,v 1.11 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLParameterisation
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLParser.hh,v 1.66 2010-11-30 08:55:52 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLParser
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLParser.icc,v 1.15 2010-11-17 10:47:02 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLParser inline methods
@@ -87,8 +86,8 @@ G4LogicalVolume* G4GDMLParser::ParseST(const G4String& filename,
G4Material* medium,
G4Material* solid)
{
G4STRead reader;
return reader.Read(filename, medium, solid);
G4STRead STreader;
return STreader.Read(filename, medium, solid);
}
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLRead.hh,v 1.33 2010-11-17 10:47:02 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLRead
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLReadMaterials.hh,v 1.11 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLReadMaterials
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLReadParamvol.hh,v 1.8 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLReadParamvol
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLReadSetup.hh,v 1.6 2009-03-24 15:47:33 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLReadSetup
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLReadSolids.hh,v 1.16 2010-06-02 13:53:04 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLReadSolids
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLReadStructure.hh,v 1.32 2010-11-02 10:39:27 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLReadStructure
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWrite.hh,v 1.42 2010-02-18 17:39:00 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLWrite
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteDefine.hh,v 1.14 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLWriteDefine
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteMaterials.hh,v 1.17 2009-04-27 07:22:36 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLWriteMaterials
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteParamvol.hh,v 1.13 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLWriteParamvol
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteSetup.hh,v 1.9 2009-04-15 13:29:30 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLWriteSetup
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteSolids.hh,v 1.39 2010-06-02 13:53:04 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLWriteSolids
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteStructure.hh,v 1.39 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLWriteStructure
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4STRead.hh,v 1.4 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4STRead
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLEvaluator.cc,v 1.26 2010-11-04 11:33:49 gcosmo Exp $
// $Id$
// GEANT4 tag $ Name:$
//
// class G4GDMLEvaluator Implementation
@@ -36,6 +36,7 @@
#include <sstream>
#include "G4GDMLEvaluator.hh"
#include "G4SystemOfUnits.hh"
G4GDMLEvaluator::G4GDMLEvaluator()
{
@@ -88,6 +89,7 @@ void G4GDMLEvaluator::DefineMatrix(const G4String& name,
G4Exception("G4GDMLEvaluator::DefineMatrix()", "InvalidSize",
FatalException, error_msg);
}
/*
if (size == 1)
{
G4String error_msg = "Matrix '" + name
@@ -96,6 +98,8 @@ void G4GDMLEvaluator::DefineMatrix(const G4String& name,
G4Exception("G4GDMLEvaluator::DefineMatrix()", "InvalidSize",
FatalException, error_msg);
}
*/
if (size % coldim != 0)
{
G4String error_msg = "Matrix '" + name + "' is not filled correctly!";
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLMessenger.cc,v 1.3 2010-11-02 11:44:15 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLMessenger Implementation
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLParameterisation.cc,v 1.11 2008-07-16 15:46:34 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLParameterisation Implementation
//
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLParser.cc,v 1.18 2010-11-17 11:36:45 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//
// class G4GDMLParser Implementation
+1 -2
View File
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLRead.cc,v 1.50 2010-11-17 10:47:02 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLRead Implementation
//
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadDefine.cc,v 1.26 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLReadDefine Implementation
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLReadMaterials.cc,v 1.21 2010-10-14 16:19:40 gcosmo Exp $
// $Id$
// GEANT4 tag $ Name:$
//
// class G4GDMLReadMaterials Implementation
@@ -35,6 +35,8 @@
#include "G4GDMLReadMaterials.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Element.hh"
#include "G4Isotope.hh"
#include "G4Material.hh"
@@ -636,6 +638,7 @@ PropertyRead(const xercesc::DOMElement* const propertyElement,
if (attName=="ref") { matrix = GetMatrix(ref=attValue); }
}
/*
if (matrix.GetCols() != 2)
{
G4String error_msg = "Referenced matrix '" + ref
@@ -644,6 +647,8 @@ PropertyRead(const xercesc::DOMElement* const propertyElement,
G4Exception("G4GDMLReadMaterials::PropertyRead()", "InvalidRead",
FatalException, error_msg);
}
*/
if (matrix.GetRows() == 0) { return; }
G4MaterialPropertiesTable* matprop=material->GetMaterialPropertiesTable();
@@ -658,7 +663,7 @@ PropertyRead(const xercesc::DOMElement* const propertyElement,
}
else // build the material properties vector
{
G4MaterialPropertyVector* propvect = new G4MaterialPropertyVector(0,0,0);
G4MaterialPropertyVector* propvect = new G4MaterialPropertyVector();
for (size_t i=0; i<matrix.GetRows(); i++)
{
propvect->InsertValues(matrix.Get(i,0),matrix.Get(i,1));
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadParamvol.cc,v 1.14 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLReadParamvol Implementation
//
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadSetup.cc,v 1.11 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLReadSetup Implementation
//
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadSolids.cc,v 1.32 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLReadSolids Implementation
//
@@ -82,7 +81,7 @@ BooleanRead(const xercesc::DOMElement* const booleanElement, const BooleanOp op)
{
G4String name;
G4String first;
G4String second;
G4String scnd;
G4ThreeVector position(0.0,0.0,0.0);
G4ThreeVector rotation(0.0,0.0,0.0);
G4ThreeVector firstposition(0.0,0.0,0.0);
@@ -130,7 +129,7 @@ BooleanRead(const xercesc::DOMElement* const booleanElement, const BooleanOp op)
const G4String tag = Transcode(child->getTagName());
if (tag=="first") { first = RefRead(child); } else
if (tag=="second") { second = RefRead(child); } else
if (tag=="second") { scnd = RefRead(child); } else
if (tag=="position") { VectorRead(child,position); } else
if (tag=="rotation") { VectorRead(child,rotation); } else
if (tag=="positionref")
@@ -152,7 +151,7 @@ BooleanRead(const xercesc::DOMElement* const booleanElement, const BooleanOp op)
}
G4VSolid* firstSolid = GetSolid(GenerateName(first));
G4VSolid* secondSolid = GetSolid(GenerateName(second));
G4VSolid* secondSolid = GetSolid(GenerateName(scnd));
G4Transform3D transform(GetRotationMatrix(rotation),position);
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadStructure.cc,v 1.67 2010-11-02 10:39:27 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLReadStructure Implementation
//
+1 -2
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWrite.cc,v 1.58 2010-11-02 10:55:03 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLWrite Implementation
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteDefine.cc,v 1.20 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLWriteDefine Implementation
//
@@ -34,6 +33,7 @@
// --------------------------------------------------------------------
#include "G4GDMLWriteDefine.hh"
#include "G4SystemOfUnits.hh"
const G4double G4GDMLWriteDefine::kRelativePrecision = DBL_EPSILON;
const G4double G4GDMLWriteDefine::kAngularPrecision = DBL_EPSILON;
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteMaterials.cc,v 1.26 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLWriteMaterials Implementation
//
@@ -34,8 +33,11 @@
// --------------------------------------------------------------------
#include <sstream>
#include "G4GDMLWriteMaterials.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Element.hh"
#include "G4Isotope.hh"
#include "G4Material.hh"
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteParamvol.cc,v 1.25 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLParamVol Implementation
//
@@ -35,6 +34,7 @@
#include "G4GDMLWriteParamvol.hh"
#include "G4SystemOfUnits.hh"
#include "G4Box.hh"
#include "G4Trd.hh"
#include "G4Trap.hh"
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteSetup.cc,v 1.13 2009-04-24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLWriteSetup Implementation
//
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteSolids.cc,v 1.69 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLWriteSolids Implementation
//
@@ -35,6 +34,7 @@
#include "G4GDMLWriteSolids.hh"
#include "G4SystemOfUnits.hh"
#include "G4BooleanSolid.hh"
#include "G4Box.hh"
#include "G4Cons.hh"
@@ -78,7 +78,7 @@ G4GDMLWriteSolids::~G4GDMLWriteSolids()
}
void G4GDMLWriteSolids::
BooleanWrite(xercesc::DOMElement* solidsElement,
BooleanWrite(xercesc::DOMElement* solElement,
const G4BooleanSolid* const boolean)
{
G4int displaced=0;
@@ -161,7 +161,7 @@ BooleanWrite(xercesc::DOMElement* solidsElement,
xercesc::DOMElement* secondElement = NewElement("second");
secondElement->setAttributeNode(NewAttribute("ref",secondref));
booleanElement->appendChild(secondElement);
solidsElement->appendChild(booleanElement);
solElement->appendChild(booleanElement);
// Add the boolean solid AFTER the constituent solids!
if ( (std::fabs(pos.x()) > kLinearPrecision)
@@ -194,7 +194,7 @@ BooleanWrite(xercesc::DOMElement* solidsElement,
}
void G4GDMLWriteSolids::
BoxWrite(xercesc::DOMElement* solidsElement, const G4Box* const box)
BoxWrite(xercesc::DOMElement* solElement, const G4Box* const box)
{
const G4String& name = GenerateName(box->GetName(),box);
@@ -204,11 +204,11 @@ BoxWrite(xercesc::DOMElement* solidsElement, const G4Box* const box)
boxElement->setAttributeNode(NewAttribute("y",2.0*box->GetYHalfLength()/mm));
boxElement->setAttributeNode(NewAttribute("z",2.0*box->GetZHalfLength()/mm));
boxElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(boxElement);
solElement->appendChild(boxElement);
}
void G4GDMLWriteSolids::
ConeWrite(xercesc::DOMElement* solidsElement, const G4Cons* const cone)
ConeWrite(xercesc::DOMElement* solElement, const G4Cons* const cone)
{
const G4String& name = GenerateName(cone->GetName(),cone);
@@ -230,11 +230,11 @@ ConeWrite(xercesc::DOMElement* solidsElement, const G4Cons* const cone)
setAttributeNode(NewAttribute("deltaphi",cone->GetDeltaPhiAngle()/degree));
coneElement->setAttributeNode(NewAttribute("aunit","deg"));
coneElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(coneElement);
solElement->appendChild(coneElement);
}
void G4GDMLWriteSolids::
ElconeWrite(xercesc::DOMElement* solidsElement,
ElconeWrite(xercesc::DOMElement* solElement,
const G4EllipticalCone* const elcone)
{
const G4String& name = GenerateName(elcone->GetName(),elcone);
@@ -246,11 +246,11 @@ ElconeWrite(xercesc::DOMElement* solidsElement,
elconeElement->setAttributeNode(NewAttribute("zmax",elcone->GetZMax()/mm));
elconeElement->setAttributeNode(NewAttribute("zcut",elcone->GetZTopCut()/mm));
elconeElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(elconeElement);
solElement->appendChild(elconeElement);
}
void G4GDMLWriteSolids::
EllipsoidWrite(xercesc::DOMElement* solidsElement,
EllipsoidWrite(xercesc::DOMElement* solElement,
const G4Ellipsoid* const ellipsoid)
{
const G4String& name = GenerateName(ellipsoid->GetName(),ellipsoid);
@@ -269,11 +269,11 @@ EllipsoidWrite(xercesc::DOMElement* solidsElement,
setAttributeNode(NewAttribute("zcut2",ellipsoid->GetZTopCut()/mm));
ellipsoidElement->
setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(ellipsoidElement);
solElement->appendChild(ellipsoidElement);
}
void G4GDMLWriteSolids::
EltubeWrite(xercesc::DOMElement* solidsElement,
EltubeWrite(xercesc::DOMElement* solElement,
const G4EllipticalTube* const eltube)
{
const G4String& name = GenerateName(eltube->GetName(),eltube);
@@ -284,11 +284,11 @@ EltubeWrite(xercesc::DOMElement* solidsElement,
eltubeElement->setAttributeNode(NewAttribute("dy",eltube->GetDy()/mm));
eltubeElement->setAttributeNode(NewAttribute("dz",eltube->GetDz()/mm));
eltubeElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(eltubeElement);
solElement->appendChild(eltubeElement);
}
void G4GDMLWriteSolids::
XtruWrite(xercesc::DOMElement* solidsElement,
XtruWrite(xercesc::DOMElement* solElement,
const G4ExtrudedSolid* const xtru)
{
const G4String& name = GenerateName(xtru->GetName(),xtru);
@@ -296,7 +296,7 @@ XtruWrite(xercesc::DOMElement* solidsElement,
xercesc::DOMElement* xtruElement = NewElement("xtru");
xtruElement->setAttributeNode(NewAttribute("name",name));
xtruElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(xtruElement);
solElement->appendChild(xtruElement);
const G4int NumVertex = xtru->GetNofVertices();
@@ -332,7 +332,7 @@ XtruWrite(xercesc::DOMElement* solidsElement,
}
void G4GDMLWriteSolids::
HypeWrite(xercesc::DOMElement* solidsElement, const G4Hype* const hype)
HypeWrite(xercesc::DOMElement* solElement, const G4Hype* const hype)
{
const G4String& name = GenerateName(hype->GetName(),hype);
@@ -350,11 +350,11 @@ HypeWrite(xercesc::DOMElement* solidsElement, const G4Hype* const hype)
2.0*hype->GetZHalfLength()/mm));
hypeElement->setAttributeNode(NewAttribute("aunit","deg"));
hypeElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(hypeElement);
solElement->appendChild(hypeElement);
}
void G4GDMLWriteSolids::
OrbWrite(xercesc::DOMElement* solidsElement, const G4Orb* const orb)
OrbWrite(xercesc::DOMElement* solElement, const G4Orb* const orb)
{
const G4String& name = GenerateName(orb->GetName(),orb);
@@ -362,11 +362,11 @@ OrbWrite(xercesc::DOMElement* solidsElement, const G4Orb* const orb)
orbElement->setAttributeNode(NewAttribute("name",name));
orbElement->setAttributeNode(NewAttribute("r",orb->GetRadius()/mm));
orbElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(orbElement);
solElement->appendChild(orbElement);
}
void G4GDMLWriteSolids::
ParaWrite(xercesc::DOMElement* solidsElement, const G4Para* const para)
ParaWrite(xercesc::DOMElement* solElement, const G4Para* const para)
{
const G4String& name = GenerateName(para->GetName(),para);
@@ -389,11 +389,11 @@ ParaWrite(xercesc::DOMElement* solidsElement, const G4Para* const para)
paraElement->setAttributeNode(NewAttribute("phi",phi/degree));
paraElement->setAttributeNode(NewAttribute("aunit","deg"));
paraElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(paraElement);
solElement->appendChild(paraElement);
}
void G4GDMLWriteSolids::
ParaboloidWrite(xercesc::DOMElement* solidsElement,
ParaboloidWrite(xercesc::DOMElement* solElement,
const G4Paraboloid* const paraboloid)
{
const G4String& name = GenerateName(paraboloid->GetName(),paraboloid);
@@ -407,11 +407,11 @@ ParaboloidWrite(xercesc::DOMElement* solidsElement,
paraboloidElement->setAttributeNode(NewAttribute("dz",
paraboloid->GetZHalfLength()/mm));
paraboloidElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(paraboloidElement);
solElement->appendChild(paraboloidElement);
}
void G4GDMLWriteSolids::
PolyconeWrite(xercesc::DOMElement* solidsElement,
PolyconeWrite(xercesc::DOMElement* solElement,
const G4Polycone* const polycone)
{
const G4String& name = GenerateName(polycone->GetName(),polycone);
@@ -424,7 +424,7 @@ PolyconeWrite(xercesc::DOMElement* solidsElement,
polycone->GetOriginalParameters()->Opening_angle/degree));
polyconeElement->setAttributeNode(NewAttribute("aunit","deg"));
polyconeElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(polyconeElement);
solElement->appendChild(polyconeElement);
const size_t num_zplanes = polycone->GetOriginalParameters()->Num_z_planes;
const G4double* z_array = polycone->GetOriginalParameters()->Z_values;
@@ -438,7 +438,7 @@ PolyconeWrite(xercesc::DOMElement* solidsElement,
}
void G4GDMLWriteSolids::
PolyhedraWrite(xercesc::DOMElement* solidsElement,
PolyhedraWrite(xercesc::DOMElement* solElement,
const G4Polyhedra* const polyhedra)
{
const G4String& name = GenerateName(polyhedra->GetName(),polyhedra);
@@ -453,7 +453,7 @@ PolyhedraWrite(xercesc::DOMElement* solidsElement,
polyhedra->GetOriginalParameters()->numSide));
polyhedraElement->setAttributeNode(NewAttribute("aunit","deg"));
polyhedraElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(polyhedraElement);
solElement->appendChild(polyhedraElement);
const size_t num_zplanes = polyhedra->GetOriginalParameters()->Num_z_planes;
const G4double* z_array = polyhedra->GetOriginalParameters()->Z_values;
@@ -472,7 +472,7 @@ PolyhedraWrite(xercesc::DOMElement* solidsElement,
}
void G4GDMLWriteSolids::
SphereWrite(xercesc::DOMElement* solidsElement, const G4Sphere* const sphere)
SphereWrite(xercesc::DOMElement* solElement, const G4Sphere* const sphere)
{
const G4String& name = GenerateName(sphere->GetName(),sphere);
@@ -492,11 +492,11 @@ SphereWrite(xercesc::DOMElement* solidsElement, const G4Sphere* const sphere)
sphere->GetDeltaThetaAngle()/degree));
sphereElement->setAttributeNode(NewAttribute("aunit","deg"));
sphereElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(sphereElement);
solElement->appendChild(sphereElement);
}
void G4GDMLWriteSolids::
TessellatedWrite(xercesc::DOMElement* solidsElement,
TessellatedWrite(xercesc::DOMElement* solElement,
const G4TessellatedSolid* const tessellated)
{
const G4String& solid_name = tessellated->GetName();
@@ -506,7 +506,7 @@ TessellatedWrite(xercesc::DOMElement* solidsElement,
tessellatedElement->setAttributeNode(NewAttribute("name",name));
tessellatedElement->setAttributeNode(NewAttribute("aunit","deg"));
tessellatedElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(tessellatedElement);
solElement->appendChild(tessellatedElement);
std::map<G4ThreeVector, G4String> vertexMap;
@@ -539,7 +539,7 @@ TessellatedWrite(xercesc::DOMElement* solidsElement,
name_stream << "vertex" << (j+1);
ref_stream << solid_name << "_v" << NumVertex;
const G4String& name = name_stream.str(); // facet's tag variable
const G4String& fname = name_stream.str(); // facet's tag variable
G4String ref = ref_stream.str(); // vertex tag to be associated
// Now search for the existance of the current vertex in the
@@ -563,13 +563,13 @@ TessellatedWrite(xercesc::DOMElement* solidsElement,
// Now create association of the vertex with its facet
//
facetElement->setAttributeNode(NewAttribute(name,ref));
facetElement->setAttributeNode(NewAttribute(fname,ref));
}
}
}
void G4GDMLWriteSolids::
TetWrite(xercesc::DOMElement* solidsElement, const G4Tet* const tet)
TetWrite(xercesc::DOMElement* solElement, const G4Tet* const tet)
{
const G4String& solid_name = tet->GetName();
const G4String& name = GenerateName(solid_name, tet);
@@ -583,7 +583,7 @@ TetWrite(xercesc::DOMElement* solidsElement, const G4Tet* const tet)
tetElement->setAttributeNode(NewAttribute("vertex3",solid_name+"_v3"));
tetElement->setAttributeNode(NewAttribute("vertex4",solid_name+"_v4"));
tetElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(tetElement);
solElement->appendChild(tetElement);
AddPosition(solid_name+"_v1",vertexList[0]);
AddPosition(solid_name+"_v2",vertexList[1]);
@@ -592,7 +592,7 @@ TetWrite(xercesc::DOMElement* solidsElement, const G4Tet* const tet)
}
void G4GDMLWriteSolids::
TorusWrite(xercesc::DOMElement* solidsElement, const G4Torus* const torus)
TorusWrite(xercesc::DOMElement* solElement, const G4Torus* const torus)
{
const G4String& name = GenerateName(torus->GetName(),torus);
@@ -607,11 +607,11 @@ TorusWrite(xercesc::DOMElement* solidsElement, const G4Torus* const torus)
setAttributeNode(NewAttribute("deltaphi",torus->GetDPhi()/degree));
torusElement->setAttributeNode(NewAttribute("aunit","deg"));
torusElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(torusElement);
solElement->appendChild(torusElement);
}
void G4GDMLWriteSolids::
GenTrapWrite(xercesc::DOMElement* solidsElement,
GenTrapWrite(xercesc::DOMElement* solElement,
const G4GenericTrap* const gtrap)
{
const G4String& name = GenerateName(gtrap->GetName(),gtrap);
@@ -639,11 +639,11 @@ GenTrapWrite(xercesc::DOMElement* solidsElement,
gtrapElement->setAttributeNode(NewAttribute("v8x", vertices[7].x()));
gtrapElement->setAttributeNode(NewAttribute("v8y", vertices[7].y()));
gtrapElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(gtrapElement);
solElement->appendChild(gtrapElement);
}
void G4GDMLWriteSolids::
TrapWrite(xercesc::DOMElement* solidsElement, const G4Trap* const trap)
TrapWrite(xercesc::DOMElement* solElement, const G4Trap* const trap)
{
const G4String& name = GenerateName(trap->GetName(),trap);
@@ -676,11 +676,11 @@ TrapWrite(xercesc::DOMElement* solidsElement, const G4Trap* const trap)
trapElement->setAttributeNode(NewAttribute("alpha2",alpha2/degree));
trapElement->setAttributeNode(NewAttribute("aunit","deg"));
trapElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(trapElement);
solElement->appendChild(trapElement);
}
void G4GDMLWriteSolids::
TrdWrite(xercesc::DOMElement* solidsElement, const G4Trd* const trd)
TrdWrite(xercesc::DOMElement* solElement, const G4Trd* const trd)
{
const G4String& name = GenerateName(trd->GetName(),trd);
@@ -697,11 +697,11 @@ TrdWrite(xercesc::DOMElement* solidsElement, const G4Trd* const trd)
trdElement->setAttributeNode(NewAttribute("z",
2.0*trd->GetZHalfLength()/mm));
trdElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(trdElement);
solElement->appendChild(trdElement);
}
void G4GDMLWriteSolids::
TubeWrite(xercesc::DOMElement* solidsElement, const G4Tubs* const tube)
TubeWrite(xercesc::DOMElement* solElement, const G4Tubs* const tube)
{
const G4String& name = GenerateName(tube->GetName(),tube);
@@ -719,11 +719,11 @@ TubeWrite(xercesc::DOMElement* solidsElement, const G4Tubs* const tube)
tube->GetDeltaPhiAngle()/degree));
tubeElement->setAttributeNode(NewAttribute("aunit","deg"));
tubeElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(tubeElement);
solElement->appendChild(tubeElement);
}
void G4GDMLWriteSolids::
CutTubeWrite(xercesc::DOMElement* solidsElement, const G4CutTubs* const cuttube)
CutTubeWrite(xercesc::DOMElement* solElement, const G4CutTubs* const cuttube)
{
const G4String& name = GenerateName(cuttube->GetName(),cuttube);
@@ -753,11 +753,11 @@ CutTubeWrite(xercesc::DOMElement* solidsElement, const G4CutTubs* const cuttube)
cuttube->GetHighNorm().getZ()/mm));
cuttubeElement->setAttributeNode(NewAttribute("aunit","deg"));
cuttubeElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(cuttubeElement);
solElement->appendChild(cuttubeElement);
}
void G4GDMLWriteSolids::
TwistedboxWrite(xercesc::DOMElement* solidsElement,
TwistedboxWrite(xercesc::DOMElement* solElement,
const G4TwistedBox* const twistedbox)
{
const G4String& name = GenerateName(twistedbox->GetName(),twistedbox);
@@ -774,11 +774,11 @@ TwistedboxWrite(xercesc::DOMElement* solidsElement,
twistedbox->GetPhiTwist()/degree));
twistedboxElement->setAttributeNode(NewAttribute("aunit","deg"));
twistedboxElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(twistedboxElement);
solElement->appendChild(twistedboxElement);
}
void G4GDMLWriteSolids::
TwistedtrapWrite(xercesc::DOMElement* solidsElement,
TwistedtrapWrite(xercesc::DOMElement* solElement,
const G4TwistedTrap* const twistedtrap)
{
const G4String& name = GenerateName(twistedtrap->GetName(),twistedtrap);
@@ -810,11 +810,11 @@ TwistedtrapWrite(xercesc::DOMElement* solidsElement,
twistedtrapElement->setAttributeNode(NewAttribute("aunit","deg"));
twistedtrapElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(twistedtrapElement);
solElement->appendChild(twistedtrapElement);
}
void G4GDMLWriteSolids::
TwistedtrdWrite(xercesc::DOMElement* solidsElement,
TwistedtrdWrite(xercesc::DOMElement* solElement,
const G4TwistedTrd* const twistedtrd)
{
const G4String& name = GenerateName(twistedtrd->GetName(),twistedtrd);
@@ -835,11 +835,11 @@ TwistedtrdWrite(xercesc::DOMElement* solidsElement,
twistedtrd->GetPhiTwist()/degree));
twistedtrdElement->setAttributeNode(NewAttribute("aunit","deg"));
twistedtrdElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(twistedtrdElement);
solElement->appendChild(twistedtrdElement);
}
void G4GDMLWriteSolids::
TwistedtubsWrite(xercesc::DOMElement* solidsElement,
TwistedtubsWrite(xercesc::DOMElement* solElement,
const G4TwistedTubs* const twistedtubs)
{
const G4String& name = GenerateName(twistedtubs->GetName(),twistedtubs);
@@ -858,7 +858,7 @@ TwistedtubsWrite(xercesc::DOMElement* solidsElement,
twistedtubs->GetDPhi()/degree));
twistedtubsElement->setAttributeNode(NewAttribute("aunit","deg"));
twistedtubsElement->setAttributeNode(NewAttribute("lunit","mm"));
solidsElement->appendChild(twistedtubsElement);
solElement->appendChild(twistedtubsElement);
}
void G4GDMLWriteSolids::
@@ -873,7 +873,7 @@ ZplaneWrite(xercesc::DOMElement* element, const G4double& z,
}
void G4GDMLWriteSolids::
OpticalSurfaceWrite(xercesc::DOMElement* solidsElement,
OpticalSurfaceWrite(xercesc::DOMElement* solElement,
const G4OpticalSurface* const surf)
{
xercesc::DOMElement* optElement = NewElement("opticalsurface");
@@ -886,7 +886,7 @@ OpticalSurfaceWrite(xercesc::DOMElement* solidsElement,
optElement->setAttributeNode(NewAttribute("type", surf->GetType()));
optElement->setAttributeNode(NewAttribute("value", sval));
solidsElement->appendChild(optElement);
solElement->appendChild(optElement);
}
void G4GDMLWriteSolids::SolidsWrite(xercesc::DOMElement* gdmlElement)
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteStructure.cc,v 1.83 2010-10-14 16:19:40 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4GDMLWriteStructure Implementation
//
+3 -2
View File
@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4STRead.cc,v 1.6 2010-11-02 10:39:27 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
// class G4STRead Implementation
//
@@ -43,6 +42,8 @@
#include "G4TessellatedSolid.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4AffineTransform.hh"
#include "G4VoxelLimits.hh"
void G4STRead::TessellatedRead(const std::string& line)
{