Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLBase.hh,v 1.3 2007/11/30 11:58:46 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// class G4GDMLBase
//
// Class description:
//
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLBASE_INCLUDED_
#define _G4GDMLBASE_INCLUDED_
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/dom/DOM.hpp>
#include <sstream>
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4GDMLEvaluator.hh"
class G4GDMLBase {
private:
xercesc::XercesDOMParser* parser; // This should be a static member
G4String prename;
protected:
G4GDMLEvaluator eval;
G4String GenerateName(const G4String&);
virtual void defineRead(const xercesc::DOMElement* const)=0;
virtual void materialsRead(const xercesc::DOMElement* const)=0;
virtual void solidsRead(const xercesc::DOMElement* const)=0;
virtual void structureRead(const xercesc::DOMElement* const)=0;
virtual void setupRead(const xercesc::DOMElement* const)=0;
virtual G4LogicalVolume* getVolume(const G4String&) const=0;
virtual G4String getSetup(const G4String&)=0;
public:
G4GDMLBase();
~G4GDMLBase();
void Parse(const G4String& fileName);
G4PVPlacement* getTopVolume(const G4String& setupName);
};
#endif
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLDefine.hh,v 1.11 2007/11/30 11:58:46 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4GDMLDefine
//
// Class description:
//
// GDML class for positionings and transformations according to
// specifications in Geant4.
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLDEFINE_INCLUDED_
#define _G4GDMLDEFINE_INCLUDED_
#include <map>
#include "G4ThreeVector.hh"
#include "G4GDMLBase.hh"
class G4GDMLDefine : public G4GDMLBase {
private:
std::map<G4String,G4ThreeVector*> positionMap;
std::map<G4String,G4ThreeVector*> rotationMap;
std::map<G4String,G4ThreeVector*> scaleMap;
void constantRead(const xercesc::DOMElement* const);
void positionRead(const xercesc::DOMElement* const);
void rotationRead(const xercesc::DOMElement* const);
void scaleRead(const xercesc::DOMElement* const);
void variableRead(const xercesc::DOMElement* const);
void defineRead(const xercesc::DOMElement* const);
protected:
G4ThreeVector* getPosition(const G4String&);
G4ThreeVector* getRotation(const G4String&);
G4ThreeVector* getScale(const G4String&);
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLEvaluator.hh,v 1.10 2007/11/28 10:27:18 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4GDMLEvaluator
//
// Class description:
//
// GDML class for evaluation of expressions.
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLEVALUATOR_INCLUDED_
#define _G4GDMLEVALUATOR_INCLUDED_
#include <CLHEP/Evaluator/Evaluator.h>
#include "G4Types.hh"
#include "G4String.hh"
#include "G4Box.hh"
class G4GDMLEvaluator {
HepTool::Evaluator eval;
std::vector<G4String> variableList;
public:
G4GDMLEvaluator();
void defineConstant(const G4String&,G4double);
void defineVariable(const G4String&,G4double);
void setVariable(const G4String&,G4double);
void checkVariable(const G4String&);
G4double Evaluate(const G4String&);
G4int EvaluateInteger(const G4String&);
};
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLMaterials.hh,v 1.10 2007/11/30 11:58:46 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4GDMLMaterials
//
// Class description:
//
// GDML class for loading isotopes, elements and materials according to
// specifications in Geant4.
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLMATERIALS_INCLUDED_
#define _G4GDMLMATERIALS_INCLUDED_
#include "G4GDMLDefine.hh"
#include "G4Element.hh"
#include "G4Isotope.hh"
#include "G4Material.hh"
class G4GDMLMaterials : public G4GDMLDefine {
private:
G4double atomRead(const xercesc::DOMElement* const);
G4double DRead(const xercesc::DOMElement* const);
void elementRead(const xercesc::DOMElement* const);
G4double fractionRead(const xercesc::DOMElement* const,G4String&);
void isotopeRead(const xercesc::DOMElement* const);
void materialRead(const xercesc::DOMElement* const);
void mixtureRead(const xercesc::DOMElement* const,G4Element*);
void mixtureRead(const xercesc::DOMElement* const,G4Material*);
void materialsRead(const xercesc::DOMElement* const);
protected:
G4Isotope* getIsotope(const G4String&) const;
G4Material* getMaterial(const G4String&) const;
};
#endif
@@ -0,0 +1,51 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLParser.hh,v 1.10 2007/11/30 11:58:46 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4GDMLParser
//
// Class description:
//
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLPARSER_INCLUDED_
#define _G4GDMLPARSER_INCLUDED_
#include "G4GDMLStructure.hh"
class G4GDMLParser {
G4GDMLStructure structure;
public:
void Read(const G4String& fileName) { structure.Parse(fileName); }
G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default") { return structure.getTopVolume(setupName); }
};
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLSetup.hh,v 1.9 2007/11/29 13:13:06 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4GDMLSetup
//
// Class description:
//
// GDML class for geometry setup of physical volumes.
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLSETUP_INCLUDED_
#define _G4GDMLSETUP_INCLUDED_
#include <map>
#include "G4String.hh"
#include "G4GDMLSolids.hh"
class G4GDMLSetup : public G4GDMLSolids {
private:
std::map<G4String,G4String> setupMap;
protected:
void setupRead(const xercesc::DOMElement* const element);
public:
G4String getSetup(const G4String&);
};
#endif
@@ -0,0 +1,111 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLSolids.hh,v 1.16 2007/11/30 14:51:20 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4GDMLSolids
//
// Class description:
//
// GDML class for loading solids according to specifications in Geant4.
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLSOLIDS_INCLUDED_
#define _G4GDMLSOLIDS_INCLUDED_
#include "G4Box.hh"
#include "G4Cons.hh"
#include "G4Ellipsoid.hh"
#include "G4EllipticalTube.hh"
#include "G4ExtrudedSolid.hh"
#include "G4Hype.hh"
#include "G4IntersectionSolid.hh"
#include "G4Orb.hh"
#include "G4Para.hh"
#include "G4Polycone.hh"
#include "G4Polyhedra.hh"
#include "G4QuadrangularFacet.hh"
#include "G4ReflectedSolid.hh"
#include "G4Sphere.hh"
#include "G4SolidStore.hh"
#include "G4SubtractionSolid.hh"
#include "G4TessellatedSolid.hh"
#include "G4Tet.hh"
#include "G4Torus.hh"
#include "G4Transform3D.hh"
#include "G4Trap.hh"
#include "G4Trd.hh"
#include "G4TriangularFacet.hh"
#include "G4Tubs.hh"
#include "G4UnionSolid.hh"
#include "G4GDMLMaterials.hh"
class G4GDMLSolids : public G4GDMLMaterials {
private:
enum BooleanOp {UNION,SUBTRACTION,INTERSECTION};
typedef struct zplaneType { G4double rmin,rmax,z; };
void booleanRead(const xercesc::DOMElement* const,const BooleanOp);
void boxRead(const xercesc::DOMElement* const);
void coneRead(const xercesc::DOMElement* const);
void ellipsoidRead(const xercesc::DOMElement* const);
void eltubeRead(const xercesc::DOMElement* const);
void hypeRead(const xercesc::DOMElement* const);
void loopRead(const xercesc::DOMElement* const);
void orbRead(const xercesc::DOMElement* const);
void paraRead(const xercesc::DOMElement* const);
void polyconeRead(const xercesc::DOMElement* const);
void polyhedraRead(const xercesc::DOMElement* const);
G4QuadrangularFacet* quadrangularRead(const xercesc::DOMElement* const);
G4String refRead(const xercesc::DOMElement* const);
void reflectedSolidRead(const xercesc::DOMElement* const);
G4ExtrudedSolid::ZSection sectionRead(const xercesc::DOMElement* const,G4double);
void sphereRead(const xercesc::DOMElement* const);
void tessellatedRead(const xercesc::DOMElement* const);
void tetRead(const xercesc::DOMElement* const);
void torusRead(const xercesc::DOMElement* const);
void trapRead(const xercesc::DOMElement* const);
void trdRead(const xercesc::DOMElement* const);
G4TriangularFacet* triangularRead(const xercesc::DOMElement* const);
void tubeRead(const xercesc::DOMElement* const);
G4TwoVector twoDimVertexRead(const xercesc::DOMElement* const,G4double);
void xtruRead(const xercesc::DOMElement* const);
zplaneType zplaneRead(const xercesc::DOMElement* const,G4double);
void solidsRead(const xercesc::DOMElement* const);
protected:
G4ThreeVector positionRead(const xercesc::DOMElement* const);
G4ThreeVector rotationRead(const xercesc::DOMElement* const);
G4ThreeVector scaleRead(const xercesc::DOMElement* const);
G4VSolid* getSolid(const G4String&) const;
};
#endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GDMLStructure.hh,v 1.16 2007/11/30 14:51:20 ztorzsok Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// class G4GDMLStructure
//
// Class description:
//
// GDML class for loading physical volumes according to various
// specifications in Geant4.
// History:
// - Created. Zoltan Torzsok, November 2007
// -------------------------------------------------------------------------
#ifndef _G4GDMLSTRUCTURE_INCLUDED_
#define _G4GDMLSTRUCTURE_INCLUDED_
#include "G4LogicalVolume.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4PVDivision.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4SolidStore.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ReflectionFactory.hh"
#include "G4GDMLSetup.hh"
class G4GDMLStructure : public G4GDMLSetup {
private:
EAxis directionRead(const xercesc::DOMElement* const);
void divisionvolRead(const xercesc::DOMElement* const,G4LogicalVolume*);
G4LogicalVolume* fileRead(const xercesc::DOMElement* const);
void loopRead(const xercesc::DOMElement* const);
void paramvolRead(const xercesc::DOMElement* const,G4LogicalVolume*);
void physvolRead(const xercesc::DOMElement* const,G4LogicalVolume*);
G4double quantityRead(const xercesc::DOMElement* const);
G4String refRead(const xercesc::DOMElement* const);
void replicate_along_axisRead(const xercesc::DOMElement* const,G4double&,G4double&,EAxis&);
void replicavolRead(const xercesc::DOMElement* const,G4LogicalVolume*);
void volumeRead(const xercesc::DOMElement* const);
void volume_contentRead(const xercesc::DOMElement* const,G4LogicalVolume*);
void volume_loopRead(const xercesc::DOMElement* const,G4LogicalVolume*);
void structureRead(const xercesc::DOMElement* const);
protected:
G4LogicalVolume* getVolume(const G4String&) const;
};
#endif