From d995e0809bb0b42d9137a84c8e32ec7bdf268e54 Mon Sep 17 00:00:00 2001 From: "Richard T. Jones" Date: Thu, 30 Nov 2023 12:27:16 -0500 Subject: [PATCH] * add header files from the G4ROOT/source/geometry/divisions/include source tree into G4.10.07.p03fixes to make sure that all instances of #include "G4VDivisionParameterisation.hh" pick up the modified version of that file. [rtj] --- src/G4.10.07.p04fixes/G4PVDivision.hh | 163 ++++++++++++ .../G4ParameterisationBox.hh | 202 +++++++++++++++ .../G4ParameterisationCons.hh | 202 +++++++++++++++ .../G4ParameterisationPara.hh | 206 +++++++++++++++ .../G4ParameterisationPolycone.hh | 231 +++++++++++++++++ .../G4ParameterisationPolyhedra.hh | 238 ++++++++++++++++++ .../G4ParameterisationTrd.hh | 213 ++++++++++++++++ .../G4ParameterisationTubs.hh | 202 +++++++++++++++ src/G4.10.07.p04fixes/G4ReplicatedSlice.hh | 181 +++++++++++++ 9 files changed, 1838 insertions(+) create mode 100644 src/G4.10.07.p04fixes/G4PVDivision.hh create mode 100644 src/G4.10.07.p04fixes/G4ParameterisationBox.hh create mode 100644 src/G4.10.07.p04fixes/G4ParameterisationCons.hh create mode 100644 src/G4.10.07.p04fixes/G4ParameterisationPara.hh create mode 100644 src/G4.10.07.p04fixes/G4ParameterisationPolycone.hh create mode 100644 src/G4.10.07.p04fixes/G4ParameterisationPolyhedra.hh create mode 100644 src/G4.10.07.p04fixes/G4ParameterisationTrd.hh create mode 100644 src/G4.10.07.p04fixes/G4ParameterisationTubs.hh create mode 100644 src/G4.10.07.p04fixes/G4ReplicatedSlice.hh diff --git a/src/G4.10.07.p04fixes/G4PVDivision.hh b/src/G4.10.07.p04fixes/G4PVDivision.hh new file mode 100644 index 0000000..d383968 --- /dev/null +++ b/src/G4.10.07.p04fixes/G4PVDivision.hh @@ -0,0 +1,163 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4PVDivision +// +// Class description: +// +// Represents many touchable detector elements differing only in their +// positioning. The elements' positions are calculated by means of a simple +// linear formula. +// +// G4PVDivision(const G4String& pName, +// G4LogicalVolume* pLogical, +// G4LogicalVolume* pMother, +// const EAxis pAxis, +// const G4int nReplicas, +// const G4double width, +// const G4double offset=0) +// +// Division may occur along: +// +// o Cartesian axes (kXAxis,kYAxis,kZAxis) +// +// The divisions, of specified width have coordinates of +// form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1 +// for the case of kXAxis, and are unrotated. +// +// o Radial axis (cylindrical polar) (kRho) +// +// The divisions are cons/tubs sections, centred on the origin +// and are unrotated. +// They have radii of width*n+offset to width*(n+1)+offset +// where n=0..nReplicas-1 +// +// o Phi axis (cylindrical polar) (kPhi) +// The divisions are `phi sections' or wedges, and of cons/tubs form +// They have phi of offset+n*width to offset+(n+1)*width where +// n=0..nReplicas-1 + +// 09.05.01 - P.Arce, Initial version +// ---------------------------------------------------------------------- +#ifndef G4PVDIVISION_HH +#define G4PVDIVISION_HH + +#include "geomdefs.hh" +#include "G4PVReplica.hh" +#include "G4VDivisionParameterisation.hh" + +class G4LogicalVolume; +class G4VSolid; + +class G4PVDivision : public G4PVReplica +{ + public: // with description + + G4PVDivision(const G4String& pName, + G4LogicalVolume* pLogical, + G4LogicalVolume* pMother, + const EAxis pAxis, + const G4int nReplicas, + const G4double width, + const G4double offset ); + // Constructor with number of divisions and width + + G4PVDivision(const G4String& pName, + G4LogicalVolume* pLogical, + G4LogicalVolume* pMotherLogical, + const EAxis pAxis, + const G4int nReplicas, + const G4double offset ); + // Constructor with number of divisions + + G4PVDivision(const G4String& pName, + G4LogicalVolume* pLogical, + G4LogicalVolume* pMotherLogical, + const EAxis pAxis, + const G4double width, + const G4double offset ); + // Constructor with width + + G4PVDivision(const G4String& pName, + G4LogicalVolume* pLogical, + G4VPhysicalVolume* pMother, + const EAxis pAxis, + const G4int nReplicas, + const G4double width, + const G4double offset); + // Constructor in mother physical volume (same as first constructor) + + virtual ~G4PVDivision(); + + G4PVDivision(const G4PVDivision&) = delete; + G4PVDivision& operator=(const G4PVDivision&) = delete; + + virtual G4bool IsMany() const; + virtual G4bool IsReplicated() const; + virtual G4int GetMultiplicity() const; + virtual G4VPVParameterisation* GetParameterisation() const; + virtual void GetReplicationData( EAxis& axis, + G4int& nReplicas, + G4double& width, + G4double& offset, + G4bool& consuming ) const; + EAxis GetDivisionAxis() const; + G4bool IsParameterised() const; + + virtual EVolume VolumeType() const; + // Characterise the type of volume - normal/replicated/parameterised. + + G4bool IsRegularStructure() const; + G4int GetRegularStructureId() const; + // Methods to identify volume that can have revised 'regular' navigation. + // Currently divisions do not qualify for this. + + private: + + void CheckAndSetParameters( const EAxis pAxis, + const G4int nDivs, + const G4double width, + const G4double offset, + DivisionType divType, + const G4LogicalVolume* pMotherLogical ); + + void SetParameterisation( G4LogicalVolume* motherLogical, + const EAxis pAxis, + const G4int nReplicas, + const G4double width, + const G4double offset, + DivisionType divType ); + void ErrorInAxis( EAxis axis, G4VSolid* solid ); + + protected: + + EAxis faxis; // axis of optimisation + EAxis fdivAxis; // axis of division + G4int fnReplicas = 0; + G4double fwidth = 0.0, foffset = 0.0; + G4VDivisionParameterisation* fparam = nullptr; +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ParameterisationBox.hh b/src/G4.10.07.p04fixes/G4ParameterisationBox.hh new file mode 100644 index 0000000..76cb564 --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ParameterisationBox.hh @@ -0,0 +1,202 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ParameterisationBox[X/Y/Z] +// +// Class description: +// +// These classes represent the parameterised positioning equivalent to +// dividing a G4Box along one of each axis X, Y, Z. + +// 09.05.01 - P.Arce, Initial version +// 08.04.04 - I.Hrivnacova, Implemented reflection +// -------------------------------------------------------------------- +#ifndef G4PARAMETERISATIONBOX_HH +#define G4PARAMETERISATIONBOX_HH 1 + +#include "G4VDivisionParameterisation.hh" + +class G4VSolid; +class G4VPhysicalVolume; + +// Dummy declarations to get rid of warnings ... +// +class G4Cons; +class G4Trd; +class G4Sphere; +class G4Orb; +class G4Ellipsoid; +class G4Torus; +class G4Para; +class G4Hype; +class G4Tubs; +class G4Polycone; +class G4Polyhedra; + +class G4VParameterisationBox : public G4VDivisionParameterisation +{ + public: // with description + + G4VParameterisationBox( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + + virtual ~G4VParameterisationBox(); +}; + +class G4ParameterisationBoxX : public G4VParameterisationBox +{ + public: // with description + + G4ParameterisationBoxX( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + ~G4ParameterisationBoxX(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions(G4Box& box, const G4int copyNo, + const G4VPhysicalVolume* physVol) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +class G4ParameterisationBoxY : public G4VParameterisationBox +{ + public: // with description + + G4ParameterisationBoxY( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + ~G4ParameterisationBoxY(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + + void ComputeDimensions(G4Box& box, const G4int copyNo, + const G4VPhysicalVolume* physVol) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +class G4ParameterisationBoxZ : public G4VParameterisationBox +{ + public: // with description + + G4ParameterisationBoxZ( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + ~G4ParameterisationBoxZ(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions(G4Box& box, const G4int copyNo, + const G4VPhysicalVolume* physVol) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ParameterisationCons.hh b/src/G4.10.07.p04fixes/G4ParameterisationCons.hh new file mode 100644 index 0000000..27f41e8 --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ParameterisationCons.hh @@ -0,0 +1,202 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ParameterisationCons[Rho/Phi/Z] +// +// Class description: +// +// These classes represent the parameterised positioning equivalent to +// dividing a G4Cons along one of each axis Rho, Phi, Z. + +// 09.05.01 - P.Arce, Initial version +// 08.04.04 - I.Hrivnacova, Implemented reflection +// -------------------------------------------------------------------- +#ifndef G4PARAMETERISATIONCONS_HH +#define G4PARAMETERISATIONCONS_HH 1 + +#include "G4VDivisionParameterisation.hh" + +class G4VSolid; +class G4VPhysicalVolume; + +// Dummy declarations to get rid of warnings ... +// +class G4Trd; +class G4Trap; +class G4Box; +class G4Sphere; +class G4Orb; +class G4Ellipsoid; +class G4Torus; +class G4Para; +class G4Hype; +class G4Tubs; +class G4Polycone; +class G4Polyhedra; + +class G4VParameterisationCons : public G4VDivisionParameterisation +{ + public: // with description + + G4VParameterisationCons( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + + virtual ~G4VParameterisationCons(); +}; + +class G4ParameterisationConsRho : public G4VParameterisationCons +{ + public: // with description + + G4ParameterisationConsRho( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationConsRho(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Cons& tubs, const G4int copyNo, + const G4VPhysicalVolume* physVol) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +class G4ParameterisationConsPhi : public G4VParameterisationCons +{ + public: // with description + + G4ParameterisationConsPhi( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationConsPhi(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Cons& tubs, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +class G4ParameterisationConsZ : public G4VParameterisationCons +{ + public: // with description + + G4ParameterisationConsZ( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationConsZ(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Cons& tubs, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ParameterisationPara.hh b/src/G4.10.07.p04fixes/G4ParameterisationPara.hh new file mode 100644 index 0000000..b420f21 --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ParameterisationPara.hh @@ -0,0 +1,206 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ParameterisationPara[X,Y,Z] +// +// Class description: +// +// These classes represent the parameterised positioning equivalent to +// dividing a G4Para along one of each axis X, Y, Z. + +// 09.05.01 - P.Arce, Initial version +// 08.04.04 - I.Hrivnacova, Implemented reflection +// -------------------------------------------------------------------- +#ifndef G4PARAMETERISATIONPARA_HH +#define G4PARAMETERISATIONPARA_HH 1 + +#include "G4VDivisionParameterisation.hh" + +class G4VSolid; +class G4VPhysicalVolume; + +// Dummy declarations to get rid of warnings ... +// +class G4Cons; +class G4Cons; +class G4Sphere; +class G4Orb; +class G4Ellipsoid; +class G4Torus; +class G4Trd; +class G4Hype; +class G4Tubs; +class G4Polycone; +class G4Polyhedra; + +class G4VParameterisationPara : public G4VDivisionParameterisation +{ + public: // with description + + G4VParameterisationPara( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + + virtual ~G4VParameterisationPara(); +}; + +class G4ParameterisationParaX : public G4VParameterisationPara +{ + public: // with description + + G4ParameterisationParaX( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + ~G4ParameterisationParaX(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions(G4Para& para, const G4int copyNo, + const G4VPhysicalVolume* pv) const; + + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + + +class G4ParameterisationParaY : public G4VParameterisationPara +{ + public: // with description + + G4ParameterisationParaY( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + ~G4ParameterisationParaY(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions(G4Para& para, const G4int copyNo, + const G4VPhysicalVolume* pv) const; + + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + + +class G4ParameterisationParaZ : public G4VParameterisationPara +{ + public: // with description + + G4ParameterisationParaZ( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + ~G4ParameterisationParaZ(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions(G4Para& para, const G4int copyNo, + const G4VPhysicalVolume* pv) const; + + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ParameterisationPolycone.hh b/src/G4.10.07.p04fixes/G4ParameterisationPolycone.hh new file mode 100644 index 0000000..bfe07ed --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ParameterisationPolycone.hh @@ -0,0 +1,231 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ParameterisationPolycone[Rho/Phi/Z] +// +// Class description: +// +// These classes represent the parameterised positioning equivalent to +// dividing a G4Polycone along one of each axis Rho, Phi, Z. + +// 09.05.01 - P.Arce, Initial version +// 08.04.04 - I.Hrivnacova, Implemented reflection +//--------------------------------------------------------------------- +#ifndef G4PARAMETERISATIONPOLYCONE_HH +#define G4PARAMETERISATIONPOLYCONE_HH 1 + +#include "G4VDivisionParameterisation.hh" +#include "G4Polycone.hh" + +class G4VPhysicalVolume; + +// Dummy declarations to get rid of warnings ... +// +class G4Trd; +class G4Trap; +class G4Cons; +class G4Orb; +class G4Ellipsoid; +class G4Sphere; +class G4Torus; +class G4Para; +class G4Hype; +class G4Tubs; +class G4Polyhedra; + +class G4VParameterisationPolycone : public G4VDivisionParameterisation +{ + public: // with description + + G4VParameterisationPolycone( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + + virtual ~G4VParameterisationPolycone(); +}; + +//--------------------------------------------------------------------- +// Class G4ParameterisationPolyconeRho +//--------------------------------------------------------------------- + +class G4ParameterisationPolyconeRho : public G4VParameterisationPolycone +{ + public: // with description + + G4ParameterisationPolyconeRho( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, + DivisionType divType ); + ~G4ParameterisationPolyconeRho(); + + void CheckParametersValidity(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Polycone& pcone, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +//--------------------------------------------------------------------- +// Class G4ParameterisationPolyconePhi +//--------------------------------------------------------------------- + +class G4ParameterisationPolyconePhi : public G4VParameterisationPolycone +{ + public: // with description + + G4ParameterisationPolyconePhi( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, + DivisionType divType ); + ~G4ParameterisationPolyconePhi(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Polycone& pcone, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +//--------------------------------------------------------------------- +// Class G4ParameterisationPolyconeZ +//--------------------------------------------------------------------- + +class G4ParameterisationPolyconeZ : public G4VParameterisationPolycone +{ + public: // with description + + G4ParameterisationPolyconeZ( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, + DivisionType divType ); + ~G4ParameterisationPolyconeZ(); + + void CheckParametersValidity(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Polycone& pcone, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: + + G4double GetR(G4double z, G4double z1, G4double r1, + G4double z2, G4double r2) const; + G4double GetRmin(G4double z, G4int nsegment) const; + G4double GetRmax(G4double z, G4int nsegment) const; + + // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} + private: + + G4int fNSegment = 0; + G4PolyconeHistorical* fOrigParamMother = nullptr; +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ParameterisationPolyhedra.hh b/src/G4.10.07.p04fixes/G4ParameterisationPolyhedra.hh new file mode 100644 index 0000000..f67a692 --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ParameterisationPolyhedra.hh @@ -0,0 +1,238 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ParameterisationPolyhedra[Rho/Phi/Z] +// +// Class description: +// +// These classes represent the parameterised positioning equivalent to +// dividing a G4Polyhedra along one of each axis Rho, Phi, Z. + +// 09.05.01 - P.Arce, Initial version +// 08.04.04 - I.Hrivnacova, Implemented reflection +//--------------------------------------------------------------------- +#ifndef G4PARAMETERISATIONPOLYHEDRA_HH +#define G4PARAMETERISATIONPOLYHEDRA_HH 1 + +#include "G4VDivisionParameterisation.hh" +#include "G4Polyhedra.hh" + +class G4VPhysicalVolume; + +// Dummy declarations to get rid of warnings ... +// +class G4Trd; +class G4Trap; +class G4Cons; +class G4Sphere; +class G4Orb; +class G4Ellipsoid; +class G4Torus; +class G4Para; +class G4Hype; +class G4Tubs; +class G4Polycone; + +class G4VParameterisationPolyhedra : public G4VDivisionParameterisation +{ + public: // with description + + G4VParameterisationPolyhedra( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + + virtual ~G4VParameterisationPolyhedra(); + + private: + + G4double ConvertRadiusFactor(const G4Polyhedra& phedra) const; + // Converts radius of the sides to radius of the corners: + // r_corners = r_sides/factor +}; + +//--------------------------------------------------------------------- +// Class G4ParameterisationPolyhedraRho +//--------------------------------------------------------------------- + +class G4ParameterisationPolyhedraRho : public G4VParameterisationPolyhedra +{ + public: // with description + + G4ParameterisationPolyhedraRho( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, + DivisionType divType ); + ~G4ParameterisationPolyhedraRho(); + + void CheckParametersValidity(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +//--------------------------------------------------------------------- +// Class G4ParameterisationPolyhedraPhi +//--------------------------------------------------------------------- + +class G4ParameterisationPolyhedraPhi : public G4VParameterisationPolyhedra +{ + public: // with description + + G4ParameterisationPolyhedraPhi( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, + DivisionType divType ); + ~G4ParameterisationPolyhedraPhi(); + + void CheckParametersValidity(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +//--------------------------------------------------------------------- +// Class G4ParameterisationPolyhedraZ +//--------------------------------------------------------------------- + +class G4ParameterisationPolyhedraZ : public G4VParameterisationPolyhedra +{ + public: // with description + + G4ParameterisationPolyhedraZ( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, + DivisionType divType ); + ~G4ParameterisationPolyhedraZ(); + + void CheckParametersValidity(); + + G4double GetMaxParameter() const; + + void ComputeTransformation( const G4int copyNo, + G4VPhysicalVolume* physVol ) const; + void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, + const G4VPhysicalVolume* physVol ) const; + + private: + + G4double GetR(G4double z, G4double z1, G4double r1, + G4double z2, G4double r2) const; + G4double GetRmin(G4double z, G4int nsegment) const; + G4double GetRmax(G4double z, G4int nsegment) const; + + // Dummy declarations to get rid of warnings ... + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + private: + + G4int fNSegment = 0; + G4PolyhedraHistorical* fOrigParamMother = nullptr; +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ParameterisationTrd.hh b/src/G4.10.07.p04fixes/G4ParameterisationTrd.hh new file mode 100644 index 0000000..cde01cb --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ParameterisationTrd.hh @@ -0,0 +1,213 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ParameterisationTrd[X/Y/Z] +// +// Class description: +// +// This class represents the parameterised positioning equivalent to +// dividing a trapezoid along one of each axis X, Y, Z. + +// 09.05.01 - P.Arce, Initial version +// 08.04.04 - I.Hrivnacova, Implemented reflection +// -------------------------------------------------------------------- +#ifndef G4PARAMETERISATIONTRD_HH +#define G4PARAMETERISATIONTRD_HH 1 + +#include + +#include "G4VDivisionParameterisation.hh" +#include "G4VSolid.hh" + +class G4VPhysicalVolume; + +// Dummy declarations to get rid of warnings ... +// +class G4Cons; +class G4Box; +class G4Sphere; +class G4Orb; +class G4Ellipsoid; +class G4Torus; +class G4Para; +class G4Hype; +class G4Tubs; +class G4Polycone; +class G4Polyhedra; + +class G4VParameterisationTrd : public G4VDivisionParameterisation +{ + public: // with description + + G4VParameterisationTrd( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + + virtual ~G4VParameterisationTrd(); + + protected: + + G4bool bDivInTrap = false; +}; + +class G4ParameterisationTrdX : public G4VParameterisationTrd +{ + public: // with description + + G4ParameterisationTrdX( EAxis axis, G4int nCopies, + G4double width, G4double offset, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationTrdX(); + + G4double GetMaxParameter() const; + + void ComputeTransformation(const G4int copyNo, + G4VPhysicalVolume* physVol) const; + + void ComputeDimensions(G4Trd& trd, const G4int copyNo, + const G4VPhysicalVolume* pv) const; + + void ComputeDimensions(G4Trap& trd, const G4int copyNo, + const G4VPhysicalVolume* pv) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + + +class G4ParameterisationTrdY : public G4VParameterisationTrd +{ + public: // with description + + G4ParameterisationTrdY( EAxis axis, G4int nCopies, + G4double width, G4double offset, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationTrdY(); + + G4double GetMaxParameter() const; + + void ComputeTransformation(const G4int copyNo, + G4VPhysicalVolume *physVol) const; + + void ComputeDimensions(G4Trd& trd, const G4int copyNo, + const G4VPhysicalVolume* pv) const; + + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + + +class G4ParameterisationTrdZ : public G4VParameterisationTrd +{ + public: // with description + + G4ParameterisationTrdZ( EAxis axis, G4int nCopies, + G4double width, G4double offset, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationTrdZ(); + + G4double GetMaxParameter() const; + + void ComputeTransformation(const G4int copyNo, + G4VPhysicalVolume* physVol) const; + void ComputeDimensions(G4Trd& trd, const G4int copyNo, + const G4VPhysicalVolume* pv) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Tubs&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ParameterisationTubs.hh b/src/G4.10.07.p04fixes/G4ParameterisationTubs.hh new file mode 100644 index 0000000..d54b04f --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ParameterisationTubs.hh @@ -0,0 +1,202 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ParameterisationTubs[Rho/Phi/Z] +// +// Class description: +// +// This class represents the parameterised positioning equivalent to +// dividing a G4Tubs along one of each axis Rho, Phi, Z. + +// 09.05.01 - P.Arce, Initial version +// 08.04.04 - I.Hrivnacova, Implemented reflection +// -------------------------------------------------------------------- +#ifndef G4PARAMETERISATIONTUBS_HH +#define G4PARAMETERISATIONTUBS_HH 1 + +#include "G4VDivisionParameterisation.hh" + +class G4VPhysicalVolume; + +// Dummy declarations to get rid of warnings ... +// +class G4Trd; +class G4Trap; +class G4Cons; +class G4Sphere; +class G4Orb; +class G4Ellipsoid; +class G4Torus; +class G4Para; +class G4Hype; +class G4Polycone; +class G4Polyhedra; + +class G4VParameterisationTubs : public G4VDivisionParameterisation +{ + public: // with description + + G4VParameterisationTubs( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* msolid, DivisionType divType ); + + virtual ~G4VParameterisationTubs(); +}; + +class G4ParameterisationTubsRho : public G4VParameterisationTubs +{ + public: // with description + + G4ParameterisationTubsRho( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationTubsRho(); + + G4double GetMaxParameter() const; + + void ComputeTransformation(const G4int copyNo, + G4VPhysicalVolume* physVol) const; + void ComputeDimensions(G4Tubs& tubs, const G4int copyNo, + const G4VPhysicalVolume* physVol) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + + +class G4ParameterisationTubsPhi : public G4VParameterisationTubs +{ + public: // with description + + G4ParameterisationTubsPhi( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationTubsPhi(); + + G4double GetMaxParameter() const; + + void ComputeTransformation(const G4int copyNo, + G4VPhysicalVolume* physVol) const; + void ComputeDimensions(G4Tubs& tubs, const G4int copyNo, + const G4VPhysicalVolume* physVol) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + + +class G4ParameterisationTubsZ : public G4VParameterisationTubs +{ + public: // with description + + G4ParameterisationTubsZ( EAxis axis, G4int nCopies, + G4double offset, G4double step, + G4VSolid* motherSolid, DivisionType divType ); + ~G4ParameterisationTubsZ(); + + G4double GetMaxParameter() const; + + void ComputeTransformation(const G4int copyNo, + G4VPhysicalVolume* physVol) const; + void ComputeDimensions(G4Tubs& tubs, const G4int copyNo, + const G4VPhysicalVolume* physVol) const; + + private: // Dummy declarations to get rid of warnings ... + + void ComputeDimensions (G4Trd&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Trap&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Box&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Sphere&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Orb&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Ellipsoid&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Torus&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Para&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Hype&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Cons&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polycone&,const G4int, + const G4VPhysicalVolume*) const {} + void ComputeDimensions (G4Polyhedra&,const G4int, + const G4VPhysicalVolume*) const {} +}; + +#endif diff --git a/src/G4.10.07.p04fixes/G4ReplicatedSlice.hh b/src/G4.10.07.p04fixes/G4ReplicatedSlice.hh new file mode 100644 index 0000000..a871e7d --- /dev/null +++ b/src/G4.10.07.p04fixes/G4ReplicatedSlice.hh @@ -0,0 +1,181 @@ +// +// ******************************************************************** +// * 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. * +// ******************************************************************** +// +// G4ReplicatedSlice +// +// Class description: +// +// G4ReplicatedSlice represents many touchable detector elements differing +// only in their positioning. The elements' positions are calculated by means +// of a simple linear formula. +// +// Division may occur along: +// +// o Cartesian axes (kXAxis,kYAxis,kZAxis) +// +// The divisions, of specified width have coordinates of +// form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1 +// for the case of kXAxis, and are unrotated. +// +// o Radial axis (cylindrical polar) (kRho) +// +// The divisions are cons/tubs sections, centred on the origin +// and are unrotated. +// They have radii of width*n+offset to width*(n+1)+offset +// where n=0..nReplicas-1 +// +// o Phi axis (cylindrical polar) (kPhi) +// The divisions are `phi sections' or wedges, and of cons/tubs form +// They have phi of offset+n*width to offset+(n+1)*width where +// n=0..nReplicas-1 + +// Author: M.Asai (SLAC), 20/04/2010 - Extended from G4PVDivision +// ---------------------------------------------------------------------- +#ifndef G4REPLICATEDSLICE_HH +#define G4REPLICATEDSLICE_HH 1 + +#include "geomdefs.hh" +#include "G4PVReplica.hh" +#include "G4VDivisionParameterisation.hh" + +class G4LogicalVolume; +class G4VSolid; + +class G4ReplicatedSlice : public G4PVReplica +{ + public: + + G4ReplicatedSlice(const G4String& pName, + G4LogicalVolume* pLogical, + G4LogicalVolume* pMotherLogical, + const EAxis pAxis, + const G4int nReplicas, + const G4double width, + const G4double half_gap, + const G4double offset ); + // Constructor with number of divisions and width + + G4ReplicatedSlice(const G4String& pName, + G4LogicalVolume* pLogical, + G4LogicalVolume* pMotherLogical, + const EAxis pAxis, + const G4int nReplicas, + const G4double half_gap, + const G4double offset ); + // Constructor with number of divisions + + G4ReplicatedSlice(const G4String& pName, + G4LogicalVolume* pLogical, + G4LogicalVolume* pMotherLogical, + const EAxis pAxis, + const G4double width, + const G4double half_gap, + const G4double offset ); + // Constructor with width + + G4ReplicatedSlice(const G4String& pName, + G4LogicalVolume* pLogical, + G4VPhysicalVolume* pMotherPhysical, + const EAxis pAxis, + const G4int nReplicas, + const G4double width, + const G4double half_gap, + const G4double offset); + // Constructor in mother physical volume + + G4ReplicatedSlice(const G4String& pName, + G4LogicalVolume* pLogical, + G4VPhysicalVolume* pMotherPhysical, + const EAxis pAxis, + const G4int nReplicas, + const G4double half_gap, + const G4double offset ); + // Constructor with number of divisions + + G4ReplicatedSlice(const G4String& pName, + G4LogicalVolume* pLogical, + G4VPhysicalVolume* pMotherPhysical, + const EAxis pAxis, + const G4double width, + const G4double half_gap, + const G4double offset ); + // Constructor with width + + virtual ~G4ReplicatedSlice(); + + G4ReplicatedSlice(const G4ReplicatedSlice&) = delete; + G4ReplicatedSlice& operator=(const G4ReplicatedSlice&) = delete; + + virtual G4bool IsMany() const; + virtual G4bool IsReplicated() const; + virtual G4int GetMultiplicity() const; + virtual G4VPVParameterisation* GetParameterisation() const; + virtual void GetReplicationData( EAxis& axis, + G4int& nReplicas, + G4double& width, + G4double& offset, + G4bool& consuming ) const; + EAxis GetDivisionAxis() const; + G4bool IsParameterised() const; + + EVolume VolumeType() const final; + // Characterise the type of volume - normal/replicated/parameterised. + + G4bool IsRegularStructure() const; + G4int GetRegularStructureId() const; + // Methods to identify volume that can apply 'regular' navigation. + // Currently divisions do not qualify for this. + + private: + + void CheckAndSetParameters( const EAxis pAxis, + const G4int nDivs, + const G4double width, + const G4double half_gap, + const G4double offset, + DivisionType divType, + G4LogicalVolume* pMotherLogical, + const G4LogicalVolume* pLogical ); + + void SetParameterisation( G4LogicalVolume* motherLogical, + const EAxis pAxis, + const G4int nReplicas, + const G4double width, + const G4double half_gap, + const G4double offset, + DivisionType divType ); + + void ErrorInAxis( EAxis axis, G4VSolid* solid ); + + protected: + + EAxis faxis; // axis of optimisation + EAxis fdivAxis; // axis of division + G4int fnReplicas = 0; + G4double fwidth = 0.0, foffset = 0.0; + G4VDivisionParameterisation* fparam = nullptr; +}; + +#endif