Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
@@ -44,8 +44,7 @@ namespace G4ConversionUtils
template <typename Value>
G4bool Convert(const G4String& myInput, Value& output)
{
G4String input(myInput);
input = input.strip();
G4String input = G4StrUtil::strip_copy(myInput);
std::istringstream is(input);
char tester;
@@ -57,8 +56,7 @@ namespace G4ConversionUtils
template<>
inline G4bool Convert(const G4String& myInput, G4DimensionedDouble& output)
{
G4String input(myInput);
input = input.strip();
G4String input = G4StrUtil::strip_copy(myInput);
G4double value;
G4String unit;
@@ -76,8 +74,7 @@ namespace G4ConversionUtils
template<> inline G4bool Convert(const G4String& myInput,
G4DimensionedThreeVector& output)
{
G4String input(myInput);
input = input.strip();
G4String input = G4StrUtil::strip_copy(myInput);
G4double value1, value2, value3;
G4String unit;
@@ -94,8 +91,7 @@ namespace G4ConversionUtils
template<> inline G4bool Convert(const G4String& myInput, G4ThreeVector& output)
{
G4String input(myInput);
input = input.strip();
G4String input = G4StrUtil::strip_copy(myInput);
G4double value1, value2, value3;
@@ -114,8 +110,7 @@ namespace G4ConversionUtils
template <typename Value> G4bool Convert(const G4String& myInput, Value& value1,
Value& value2)
{
G4String input(myInput);
input = input.strip();
G4String input = G4StrUtil::strip_copy(myInput);
std::istringstream is(input);
char tester;
@@ -127,8 +122,7 @@ namespace G4ConversionUtils
template<> inline G4bool Convert(const G4String& myInput, G4DimensionedDouble& min,
G4DimensionedDouble& max)
{
G4String input(myInput);
input = input.strip();
G4String input = G4StrUtil::strip_copy(myInput);
G4double valueMin, valueMax;
G4String unitsMin, unitsMax;
@@ -147,8 +141,7 @@ namespace G4ConversionUtils
template<> inline G4bool Convert(const G4String& myInput, G4DimensionedThreeVector& min,
G4DimensionedThreeVector& max)
{
G4String input(myInput);
input = input.strip();
G4String input = G4StrUtil::strip_copy(myInput);
G4double valueMinX, valueMinY, valueMinZ;
G4double valueMaxX, valueMaxY, valueMaxZ;
@@ -168,9 +161,8 @@ namespace G4ConversionUtils
template<> inline G4bool Convert(const G4String& myInput, G4ThreeVector& min,
G4ThreeVector& max)
{
G4String input(myInput);
input = input.strip();
{
G4String input = G4StrUtil::strip_copy(myInput);
G4double valueMinX, valueMinY, valueMinZ;
G4double valueMaxX, valueMaxY, valueMaxZ;
+90
View File
@@ -0,0 +1,90 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Guy Barrand 25th September 2021
//
#ifndef G4PLOTTER_HH
#define G4PLOTTER_HH
#include "G4String.hh"
#include <utility>
#include <vector>
namespace tools {namespace histo {class h1d;}}
namespace tools {namespace histo {class h2d;}}
class G4Plotter {
public:
using RegionStyle = std::pair<unsigned int,G4String>;
using Parameter = std::pair<G4String,G4String>;
using RegionParameter = std::pair<unsigned int,Parameter>;
using Region_h1d = std::pair<unsigned int,tools::histo::h1d*>;
using Region_h2d = std::pair<unsigned int,tools::histo::h2d*>;
using Region_h1 = std::pair<unsigned int,int>;
using Region_h2 = std::pair<unsigned int,int>;
G4Plotter();
virtual ~G4Plotter() = default;
G4Plotter(const G4Plotter&);
G4Plotter& operator = (const G4Plotter&);
void SetLayout(unsigned int colums,unsigned int rows);
void AddStyle(const G4String& style);
void AddRegionStyle(unsigned int region,const G4String& style);
void AddRegionParameter(unsigned int region,const G4String& parameter,const G4String& value);
void AddRegionHistogram(unsigned int region,tools::histo::h1d* histo);
void AddRegionHistogram(unsigned int region,tools::histo::h2d* histo);
void AddRegionH1(unsigned int region,int id);
void AddRegionH2(unsigned int region,int id);
void Reset();
void Clear();
void ClearRegion(unsigned int region);
unsigned int GetColumns() const {return fColumns;}
unsigned int GetRows() const {return fRows;}
const std::vector<G4String>& GetStyles() const {return fStyles;}
const std::vector<RegionStyle>& GetRegionStyles() const {return fRegionStyles;}
const std::vector<RegionParameter>& GetRegionParameters() const {return fRegionParameters;}
const std::vector<Region_h1d>& GetRegionH1Ds() const {return fRegion_h1ds;}
const std::vector<Region_h2d>& GetRegionH2Ds() const {return fRegion_h2ds;}
const std::vector<Region_h1>& GetRegionH1s() const {return fRegion_h1s;}
const std::vector<Region_h2>& GetRegionH2s() const {return fRegion_h2s;}
private:
unsigned int fColumns;
unsigned int fRows;
std::vector<G4String> fStyles;
std::vector<RegionStyle> fRegionStyles;
std::vector<RegionParameter> fRegionParameters;
std::vector<Region_h1d> fRegion_h1ds;
std::vector<Region_h2d> fRegion_h2ds;
std::vector<Region_h1> fRegion_h1s;
std::vector<Region_h2> fRegion_h2s;
};
#endif
-92
View File
@@ -1,92 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 21st July 2001.
#ifndef G4SCALE_HH
#define G4SCALE_HH
#include "G4VMarker.hh"
#include "globals.hh"
class G4Scale: public G4VMarker {
public: // With description
enum Direction {x, y, z};
G4Scale (G4double length, const G4String& annotation = "",
Direction direction = x,
G4bool autoPlacing = true,
G4double xmid = 0., G4double ymid = 0., G4double zmid = 0.,
G4double annotationSize = 12.);
// This creates a representation of annotated line in the specified
// direction with tick marks at the end. If autoPlacing is true it
// is required to be centred at the front, right, bottom corner of
// the world space, comfortably outside the existing bounding
// box/sphere so that existing objects do not obscure it. Otherwise
// it is required to be drawn with mid-point at (xmid, ymid, zmid).
// Annotation size is size of text labels in pixels.
//
// The auto placing algorithm might be:
// x = xmin + (1 + comfort) * (xmax - xmin)
// y = ymin - comfort * (ymax - ymin)
// z = zmin + (1 + comfort) * (zmax - zmin)
// if direction == x then (x - length,y,z) to (x,y,z)
// if direction == y then (x,y,z) to (x,y + length,z)
// if direction == z then (x,y,z - length) to (x,y,z)
// Uses compiler-generated copy constructor.
~G4Scale ();
G4double GetLength() const;
const G4String& GetAnnotation() const;
G4double GetAnnotationSize() const;
Direction GetDirection() const;
G4bool GetAutoPlacing() const;
G4double GetXmid() const;
G4double GetYmid() const;
G4double GetZmid() const;
static const G4String& GetGuidanceString();
private:
G4double fLength;
G4String fAnnotation;
G4double fAnnotationSize;
Direction fDirection;
G4bool fAutoPlacing;
G4double fXmid, fYmid, fZmid;
static const G4String GuidanceString;
};
#include "G4Scale.icc"
#endif
-61
View File
@@ -1,61 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 21st July 2001.
inline G4double G4Scale::GetLength() const {
return fLength;
}
inline const G4String& G4Scale::GetAnnotation() const {
return fAnnotation;
}
inline G4double G4Scale::GetAnnotationSize() const {
return fAnnotationSize;
}
inline G4Scale::Direction G4Scale::GetDirection() const {
return fDirection;
}
inline G4bool G4Scale::GetAutoPlacing() const {
return fAutoPlacing;
}
inline G4double G4Scale::GetXmid() const {
return fXmid;
}
inline G4double G4Scale::GetYmid() const {
return fYmid;
}
inline G4double G4Scale::GetZmid() const {
return fZmid;
}
+5 -3
View File
@@ -74,12 +74,14 @@ class G4Text: public G4VMarker {
public: // With description
enum Layout {left, centre, right};
G4Text (const G4String& text);
G4Text (const G4String& text = "none");
G4Text (const G4String& text, const G4Point3D& position);
G4Text (const G4VMarker&);
G4Text (const G4Text&);
G4Text (const G4Text&) = default;
G4Text (G4Text&&) = default;
virtual ~G4Text ();
G4Text& operator= (const G4Text&);
G4Text& operator= (const G4Text&) = default;
G4Text& operator= (G4Text&&) = default;
G4String GetText () const;
Layout GetLayout () const;
@@ -61,7 +61,6 @@ class G4VHit;
class G4VDigi;
template <typename T> class G4THitsMap;
class G4Polyline;
class G4Scale;
class G4Text;
class G4Circle;
class G4Square;
@@ -70,6 +69,7 @@ class G4Polyhedron;
class G4VisExtent;
class G4StatDouble;
class G4Mesh;
class G4Plotter;
class G4VGraphicsScene {
@@ -155,13 +155,13 @@ public: // With description
// z-coordinate is ignored.
virtual void AddPrimitive (const G4Polyline&) = 0;
virtual void AddPrimitive (const G4Scale&) = 0;
virtual void AddPrimitive (const G4Text&) = 0;
virtual void AddPrimitive (const G4Circle&) = 0;
virtual void AddPrimitive (const G4Square&) = 0;
virtual void AddPrimitive (const G4Polymarker&) = 0;
virtual void AddPrimitive (const G4Polyhedron&) = 0;
virtual void AddPrimitive (const G4Plotter&) = 0;
virtual const G4VisExtent& GetExtent() const;
// The concrete class should overload this or a null extent will be returned.
// See G4VScenHandler for example.
+5 -2
View File
@@ -99,7 +99,8 @@ public: // With description
//////////////////////////////////////////////////////
// Constructors...
G4VMarker ();
G4VMarker (const G4VMarker&);
G4VMarker (const G4VMarker&) = default;
G4VMarker (G4VMarker&& ) = default;
G4VMarker (const G4Point3D& position);
//////////////////////////////////////////////////////
@@ -108,11 +109,13 @@ public: // With description
//////////////////////////////////////////////////////
// Assignment...
G4VMarker& operator = (const G4VMarker&);
G4VMarker& operator = (const G4VMarker&) = default;
G4VMarker& operator = (G4VMarker&&) = default;
//////////////////////////////////////////////////////
// Logical...
G4bool operator != (const G4VMarker&) const;
G4bool operator == (const G4VMarker&) const;
/////////////////////////////////////////////////////
// Get functions...
@@ -27,6 +27,9 @@
//
//
inline G4bool G4VMarker::operator==(const G4VMarker& mk) const
{ return !(*this != mk); }
inline G4Point3D G4VMarker::GetPosition () const {
return fPosition;
}
@@ -77,7 +77,6 @@
class G4Polyline;
class G4Text;
class G4Circle;
class G4Scale;
class G4Square;
class G4Polymarker;
class G4Polyhedron;
@@ -120,9 +119,6 @@ public: // With description
virtual void Draw (const G4Polymarker&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Scale&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Square&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
@@ -52,11 +52,13 @@ public: // With description
G4Visible ();
G4Visible (const G4Visible&);
G4Visible (G4Visible&&);
G4Visible (const G4VisAttributes*);
virtual ~G4Visible ();
G4Visible& operator= (const G4Visible&);
G4Visible& operator= (G4Visible&&);
G4bool operator != (const G4Visible& right) const;