Import Geant4 6.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:41:53 +02:00
parent 4aea781e80
commit 96686e0c8f
6560 changed files with 153347 additions and 238155 deletions
+25
View File
@@ -0,0 +1,25 @@
# $Id: GNUmakefile,v 1.3 2003/11/19 11:51:44 gcosmo Exp $
# ----------------------------------------------------------------------
# GNUmakefile for geometry/divisions library. Gabriele Cosmo, 16/06/03.
# ----------------------------------------------------------------------
name := G4geomdivision
ifndef G4INSTALL
G4INSTALL = ../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += \
-I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/geometry/solids/CSG/include \
-I$(G4BASE)/geometry/solids/specific/include \
-I$(G4BASE)/geometry/management/include
ifdef G4DIVDEBUG
CPPFLAGS += -DG4DIVDEBUG
endif
include $(G4INSTALL)/config/common.gmk
+61
View File
@@ -0,0 +1,61 @@
$Id: History,v 1.10 2003/11/19 18:02:10 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Nov 19th, 2003 G.Cosmo (geomdiv-V05-02-07)
- Moved verbose output between G4DIVDEBUG compilation flag.
- Added testing framework for divisions to be used also as base for user's example.
- General cleanup.
Nov 18th, 2003 P.Arce (geomdiv-V05-02-06)
- Added divisions in X and Y for G4Para.
- Added divisions in Z for G4Polycone and G4Polyhedra.
- Fixed handling of offsets and added more checks.
Nov 4th, 2003 G.Cosmo (geomdiv-V05-02-05)
- Fixes in the logic of resetting parameters in ComputeDimension() for
polycones and polyhedra. Requires tag "geom-specific-V05-02-05".
- Implementation NOT yet complete for division in Z for polycones and
for division in Phi and Z for polyhedra.
Oct 31st, 2003 P.Arce (geomdiv-V05-02-04)
- First implementation for G4Polyhedra.
Oct 31st, 2003 G.Cosmo (geomdiv-V05-02-03a)
- Fixed compilation errors on Windows.
Oct 24th, 2003 G.Cosmo (geomdiv-V05-02-03)
- Completed implementation for Para, Trd. (by P.Arce)
- Corrections for cons and tubs.
- First trial implementation for polyhedra.
- Migrated calls to G4Exception to new scheme.
- Added G4Orb to dummy parameterisations.
Sep 30th, 2003 G.Cosmo (geomdiv-V05-02-02)
- Removed concrete implementation of Setup() method, according to
changes made to base class G4VPhysicalVolume.
- Updated GNUmakefile for unit tests, according to new structure
introduced in "geometry-V05-02-00".
Jul 4th, 2003 G.Cosmo (geomdiv-V05-02-01)
- Removed useless test header...
Jun 16th, 2003 G.Cosmo (geomdiv-V05-02-00)
- Code cleanup and restructured.
- Created.
Original implementation by P.Arce Dubois (University of Cantabria, CMS).
@@ -0,0 +1,162 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PVDivision.hh,v 1.7 2003/11/19 11:51:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class 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
// History:
// 09.05.01 - P.Arce Initial version
// ********************************************************************
#ifndef G4PVDIVISION_HH
#define G4PVDIVISION_HH
#include "geomdefs.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VDivisionParameterisation.hh"
class G4LogicalVolume;
class G4VSolid;
class G4PVDivision : public G4VPhysicalVolume
{
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
public: // without description
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
public: // with description
virtual ~G4PVDivision();
virtual G4bool IsMany() const;
virtual G4int GetCopyNo() const;
virtual void SetCopyNo(G4int CopyNo);
virtual G4bool IsReplicated() const;
virtual G4VPVParameterisation* GetParameterisation() const;
virtual void GetReplicationData( EAxis& axis,
G4int& nReplicas,
G4double& width,
G4double& offset,
G4bool& consuming ) const;
G4bool IsParameterised() const;
private:
void CheckAndSetParameters( const EAxis pAxis,
const G4int nDivs,
const G4double width,
const G4double offset,
DivisionType divType,
const G4LogicalVolume* pMotherLogical );
G4PVDivision(const G4PVDivision&);
const G4PVDivision& operator=(const G4PVDivision&);
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;
G4int fnReplicas;
G4double fwidth,foffset;
G4int fcopyNo;
G4VDivisionParameterisation *fparam;
};
#endif
@@ -0,0 +1,190 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationBox.hh,v 1.3 2003/11/19 11:51:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// classes G4ParameterisationBoxX,
// G4ParameterisationBoxY,
// G4ParameterisationBoxZ
//
// Class description:
//
// These classes represent the parameterised positioning equivalent to
// dividing a G4Box along one of each axis X, Y, Z.
// History:
// 09.05.01 - P.Arce Initial version
// ********************************************************************
#ifndef G4ParameterisationBox_H
#define G4ParameterisationBox_H 1
#include "G4VDivisionParameterisation.hh"
class G4VSolid;
class G4VPhysicalVolume;
class HepTransform3D;
// Dummy declarations to get rid of warnings ...
class G4Cons;
class G4Trd;
class G4Sphere;
class G4Orb;
class G4Torus;
class G4Para;
class G4Hype;
class G4Tubs;
class G4Polycone;
class G4Polyhedra;
class G4ParameterisationBoxX : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationBoxX( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* msolid, DivisionType divType );
virtual ~G4ParameterisationBoxX();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationBoxY( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* msolid, DivisionType divType );
virtual ~G4ParameterisationBoxY();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationBoxZ( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* msolid, DivisionType divType );
virtual ~G4ParameterisationBoxZ();
virtual G4double GetMaxParameter() const;
virtual 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 (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
@@ -0,0 +1,187 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationCons.hh,v 1.4 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// classes G4ParameterisationConsRho,
// G4ParameterisationConsPhi,
// G4ParameterisationConsZ
//
// Class description:
//
// These classes represent the parameterised positioning equivalent to
// dividing a G4Cons along one of each axis Rho, Phi, Z.
// History:
// 09.05.01 - P.Arce Initial version
// ********************************************************************
#ifndef G4ParameterisationCons_H
#define G4ParameterisationCons_H 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 G4Torus;
class G4Para;
class G4Hype;
class G4Tubs;
class G4Polycone;
class G4Polyhedra;
class G4ParameterisationConsRho : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationConsRho( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationConsRho();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationConsPhi( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationConsPhi();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationConsZ( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationConsZ();
virtual G4double GetMaxParameter() const;
virtual 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 (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
@@ -0,0 +1,191 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationPara.hh,v 1.5 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// classes G4ParameterisationParaX,
// G4ParameterisationParaY,
// G4ParameterisationParaZ
//
// Class description:
//
// These classes represent the parameterised positioning equivalent to
// dividing a G4Para along one of each axis X, Y, Z.
// History:
// 09.05.01 - P.Arce First version
// ********************************************************************
#ifndef G4ParameterisationPara_H
#define G4ParameterisationPara_H 1
#include "G4VDivisionParameterisation.hh"
class G4VSolid;
class G4VPhysicalVolume;
// Dummy declarations to get rid of warnings ...
class G4Cons;
class G4Cons;
class G4Sphere;
class G4Orb;
class G4Torus;
class G4Trd;
class G4Hype;
class G4Tubs;
class G4Polycone;
class G4Polyhedra;
class G4ParameterisationParaX : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationParaX( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* msolid, DivisionType divType );
virtual ~G4ParameterisationParaX();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationParaY( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* msolid, DivisionType divType );
virtual ~G4ParameterisationParaY();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationParaZ( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* msolid, DivisionType divType );
virtual ~G4ParameterisationParaZ();
virtual G4double GetMaxParameter() const;
virtual 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 (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
@@ -0,0 +1,204 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationPolycone.hh,v 1.5 2003/11/18 12:15:30 arce Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// classes G4ParameterisationPolyconeRho,
// G4ParameterisationPolyconePhi,
// G4ParameterisationPolyconeZ
//
// Class description:
//
// These classes represent the parameterised positioning equivalent to
// dividing a G4Polycone along one of each axis Rho, Phi, Z.
// History:
// 09.05.01 - P.Arce First version
//---------------------------------------------------------------------
#ifndef G4ParameterisationPolycone_H
#define G4ParameterisationPolycone_H 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 G4Sphere;
class G4Torus;
class G4Para;
class G4Hype;
class G4Tubs;
class G4Polyhedra;
//---------------------------------------------------------------------
// Class G4ParameterisationPolyconeRho
//---------------------------------------------------------------------
class G4ParameterisationPolyconeRho : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationPolyconeRho( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid,
DivisionType divType );
virtual ~G4ParameterisationPolyconeRho();
virtual void CheckParametersValidity();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationPolyconePhi( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid,
DivisionType divType );
virtual ~G4ParameterisationPolyconePhi();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationPolyconeZ( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid,
DivisionType divType );
virtual ~G4ParameterisationPolyconeZ();
virtual void CheckParametersValidity();
virtual G4double GetMaxParameter() const;
virtual 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 (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 {}
};
#endif
@@ -0,0 +1,206 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationPolyhedra.hh,v 1.6 2003/11/18 12:15:30 arce Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// classes G4ParameterisationPolyhedraRho,
// G4ParameterisationPolyhedraPhi,
// G4ParameterisationPolyhedraZ
//
// Class description:
//
// These classes represent the parameterised positioning equivalent to
// dividing a G4Polyhedra along one of each axis Rho, Phi, Z.
// History:
// 09.05.01 - P.Arce First version
//---------------------------------------------------------------------
#ifndef G4ParameterisationPolyhedra_H
#define G4ParameterisationPolyhedra_H 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 G4Torus;
class G4Para;
class G4Hype;
class G4Tubs;
class G4Polycone;
//---------------------------------------------------------------------
// Class G4ParameterisationPolyhedraRho
//---------------------------------------------------------------------
class G4ParameterisationPolyhedraRho : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationPolyhedraRho( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid,
DivisionType divType );
virtual ~G4ParameterisationPolyhedraRho();
virtual void CheckParametersValidity();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationPolyhedraPhi( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid,
DivisionType divType );
virtual ~G4ParameterisationPolyhedraPhi();
virtual void CheckParametersValidity();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationPolyhedraZ( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid,
DivisionType divType );
virtual ~G4ParameterisationPolyhedraZ();
virtual void CheckParametersValidity();
virtual G4double GetMaxParameter() const;
virtual 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 (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 {}
};
#endif
@@ -0,0 +1,194 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationTrd.hh,v 1.5 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// classes G4ParameterisationTrdX
// G4ParameterisationTrdY
// G4ParameterisationTrdZ
//
// Class description:
//
// This class represents the parameterised positioning equivalent to
// dividing a trapezoid along one of each axis X, Y, Z.
// History:
// 09.05.01 P.Arce First version
// ********************************************************************
#ifndef G4ParameterisationTrd_H
#define G4ParameterisationTrd_H 1
#include "G4VDivisionParameterisation.hh"
#include "G4VSolid.hh"
class G4VPhysicalVolume;
// Dummy declarations to get rid of warnings ...
class G4Cons;
class G4Box;
class G4Sphere;
class G4Orb;
class G4Torus;
class G4Para;
class G4Hype;
class G4Tubs;
class G4Polycone;
class G4Polyhedra;
class G4ParameterisationTrdX : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationTrdX( EAxis axis, G4int nCopies,
G4double width, G4double offset,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationTrdX();
virtual void CheckParametersValidity();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4ParameterisationTrdY : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationTrdY( EAxis axis, G4int nCopies,
G4double width, G4double offset,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationTrdY();
virtual void CheckParametersValidity();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4ParameterisationTrdZ : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationTrdZ( EAxis axis, G4int nCopies,
G4double width, G4double offset,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationTrdZ();
virtual G4double GetMaxParameter() const;
virtual 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 (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
@@ -0,0 +1,188 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationTubs.hh,v 1.4 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// classes G4ParameterisationTubsRho
// G4ParameterisationTubsPhi
// G4ParameterisationTubsZ
//
// Class description:
//
// This class represents the parameterised positioning equivalent to
// dividing a G4Tubs along one of each axis Rho, Phi, Z.
// History:
// 09.05.01 P.Arce First version
// ********************************************************************
#ifndef G4ParameterisationTubsRho_H
#define G4ParameterisationTubsRho_H 1
#include "G4VDivisionParameterisation.hh"
class G4VPhysicalVolume;
// Dummy declarations to get rid of warnings ...
class G4Trd;
class G4Trap;
class G4Cons;
class G4Sphere;
class G4Orb;
class G4Torus;
class G4Para;
class G4Hype;
class G4Polycone;
class G4Polyhedra;
class G4ParameterisationTubsRho : public G4VDivisionParameterisation
{
public: // with description
G4ParameterisationTubsRho( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationTubsRho();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationTubsPhi( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationTubsPhi();
virtual G4double GetMaxParameter() const;
virtual 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 (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 G4VDivisionParameterisation
{
public: // with description
G4ParameterisationTubsZ( EAxis axis, G4int nCopies,
G4double offset, G4double step,
G4VSolid* motherSolid, DivisionType divType );
virtual ~G4ParameterisationTubsZ();
virtual G4double GetMaxParameter() const;
virtual 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 (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
@@ -0,0 +1,104 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VDivisionParameterisation.hh,v 1.6 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4VDivisionParameterisation
//
// Class description:
//
// ......
//
// Member data:
//
// History:
// 09.05.01 - P.Arce Initial version
//---------------------------------------------------------------------
#ifndef G4VDivisionParameterisation_H
#define G4VDivisionParameterisation_H 1
#include "G4Types.hh"
#include "geomdefs.hh"
#include "G4VPVParameterisation.hh"
enum DivisionType { DivNDIVandWIDTH, DivNDIV, DivWIDTH };
class G4VPhysicalVolume;
class HepTransform3D;
class G4VSolid;
class G4VDivisionParameterisation : public G4VPVParameterisation
{
public: // with description
G4VDivisionParameterisation( EAxis axis, G4int nDiv, G4double width,
G4double offset, DivisionType divType,
G4VSolid* motherSolid = 0);
virtual ~G4VDivisionParameterisation();
virtual void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const = 0;
inline const G4String& GetType() const;
inline EAxis GetAxis() const;
inline G4int GetNoDiv() const;
inline G4double GetWidth() const;
inline G4double GetOffset() const;
inline G4VSolid* GetMotherSolid() const;
inline void SetType(const G4String& type);
inline G4int VolumeFirstCopyNo() const;
protected: // with description
void ChangeRotMatrix( G4VPhysicalVolume* physVol,
G4double rotZ = 0. ) const;
G4int CalculateNDiv( G4double motherDim, G4double width,
G4double offset ) const;
G4double CalculateWidth( G4double motherDim, G4int nDiv,
G4double offset ) const;
virtual void CheckParametersValidity();
void CheckOffset( G4double maxPar );
void CheckNDivAndWidth( G4double maxPar );
virtual G4double GetMaxParameter() const = 0;
protected:
G4String ftype;
EAxis faxis;
G4int fnDiv;
G4double fwidth;
G4double foffset;
DivisionType fDivisionType;
G4VSolid* fmotherSolid;
static G4int verbose;
G4int theVoluFirstCopyNo;
};
#include "G4VDivisionParameterisation.icc"
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VDivisionParameterisation.icc,v 1.2 2003/11/18 12:15:30 arce Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4VDivisionParameterisation Inline Implementation file
//
// 26.05.03 - G.Cosmo: Created
// ********************************************************************
inline
const G4String& G4VDivisionParameterisation::GetType() const
{
return ftype;
}
inline
EAxis G4VDivisionParameterisation::GetAxis() const
{
return faxis;
}
inline
G4int G4VDivisionParameterisation::GetNoDiv() const
{
return fnDiv;
}
inline
G4double G4VDivisionParameterisation::GetWidth() const
{
return fwidth;
}
inline
G4double G4VDivisionParameterisation::GetOffset() const
{
return foffset;
}
inline
G4VSolid* G4VDivisionParameterisation::GetMotherSolid() const
{
return fmotherSolid;
}
inline
void G4VDivisionParameterisation::SetType( const G4String& type )
{
ftype = type;
}
inline
G4int G4VDivisionParameterisation::VolumeFirstCopyNo() const
{
return theVoluFirstCopyNo;
}
@@ -0,0 +1,452 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PVDivision.cc,v 1.10 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4PVDivision Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
#include "G4PVDivision.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
#include "G4ParameterisationBox.hh"
#include "G4ParameterisationTubs.hh"
#include "G4ParameterisationCons.hh"
#include "G4ParameterisationTrd.hh"
#include "G4ParameterisationPara.hh"
#include "G4ParameterisationPolycone.hh"
#include "G4ParameterisationPolyhedra.hh"
//--------------------------------------------------------------------------
G4PVDivision::G4PVDivision(const G4String& pName,
G4LogicalVolume* pLogical,
G4LogicalVolume* pMotherLogical,
const EAxis pAxis,
const G4int nDivs,
const G4double width,
const G4double offset )
: G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0),
fcopyNo(-1)
{
if (pMotherLogical) pMotherLogical->AddDaughter(this);
SetParameterisation( pMotherLogical, pAxis, nDivs,
width, offset, DivNDIVandWIDTH );
CheckAndSetParameters (pAxis, nDivs, width, offset,
DivNDIVandWIDTH, pMotherLogical );
}
//--------------------------------------------------------------------------
G4PVDivision::G4PVDivision(const G4String& pName,
G4LogicalVolume* pLogical,
G4LogicalVolume* pMotherLogical,
const EAxis pAxis,
const G4int nDivs,
const G4double offset )
: G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0),
fcopyNo(-1)
{
if (pMotherLogical) pMotherLogical->AddDaughter(this);
SetParameterisation( pMotherLogical, pAxis, nDivs, 0., offset, DivNDIV );
CheckAndSetParameters (pAxis, nDivs, 0., offset, DivNDIV, pMotherLogical );
}
//--------------------------------------------------------------------------
G4PVDivision::G4PVDivision(const G4String& pName,
G4LogicalVolume* pLogical,
G4LogicalVolume* pMotherLogical,
const EAxis pAxis,
const G4double width,
const G4double offset )
: G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0),
fcopyNo(-1)
{
if (pMotherLogical) pMotherLogical->AddDaughter(this);
SetParameterisation( pMotherLogical, pAxis, 0, width, offset, DivWIDTH );
CheckAndSetParameters (pAxis, 0, width, offset, DivWIDTH, pMotherLogical );
}
//--------------------------------------------------------------------------
void
G4PVDivision::CheckAndSetParameters( const EAxis pAxis,
const G4int nDivs,
const G4double width,
const G4double offset,
DivisionType divType,
const G4LogicalVolume* pMotherLogical )
{
if( divType == DivWIDTH )
{
fnReplicas = fparam->GetNoDiv();
}
else
{
fnReplicas = nDivs;
}
if (fnReplicas < 1 )
{
G4Exception("G4PVDivision::G4PVDivision()", "IllegalConstruct",
FatalException, "Illegal number of replicas!");
}
if( divType != DivNDIV)
{
fwidth = fparam->GetWidth();
}
else
{
fwidth = width;
}
if( fwidth < 0 )
{
G4Exception("G4PVDivision::G4PVDivision()", "IllegalConstruct",
FatalException, "Width must be positive!");
}
foffset=offset;
//!!!!! axis has to be x/y/z in G4VoxelLimits::GetMinExtent
//
if( pAxis == kRho || pAxis == kRadial3D || pAxis == kPhi )
{
faxis = kZAxis;
}
else
{
faxis = pAxis;
}
// Create rotation matrix: for phi axis it will be changed
// in G4VPVParameterisation::ComputeTransformation, for others
// it will stay the unity
//
G4RotationMatrix *pRMat = new G4RotationMatrix();
SetRotation(pRMat);
switch (faxis)
{
case kPhi:
break;
case kRho:
case kXAxis:
case kYAxis:
case kZAxis:
break;
default:
G4Exception("G4PVDivision::G4PVDivision()", "IllegalConstruct",
FatalException, "Unknown axis of replication.");
break;
}
//----- Check that mother solid is of the same type than
// daughter solid (otherwise, the corresponding
// Parameterisation::ComputeDimension() will not be called)
//
G4cout << " GetMotherLogical " << GetMotherLogical() << G4endl;
G4cout << " GetLogicalVolume " << GetLogicalVolume() << G4endl;
G4String msolType = pMotherLogical->GetSolid()->GetEntityType();
G4String dsolType = GetLogicalVolume()->GetSolid()->GetEntityType();
if( msolType != dsolType )
{
G4cerr << "ERROR - G4PVDivision::CheckAndSetParameters()"
<< G4endl
<< " Incorrect solid type in call to G4PVDivision of volume "
<< GetName() << G4endl
<< " It is: " << msolType
<< ", while it should be: " << dsolType << "." << G4endl;
G4Exception("G4VDivisionParameterisation::CheckAndSetParameters()",
"IllegalConstruct", FatalException,
"Incorrect solid type for division !");
}
}
//--------------------------------------------------------------------------
G4PVDivision::~G4PVDivision()
{
delete GetRotation();
}
//--------------------------------------------------------------------------
G4bool G4PVDivision::IsParameterised() const
{
return true;
}
//--------------------------------------------------------------------------
G4bool G4PVDivision::IsMany() const
{
return false;
}
//--------------------------------------------------------------------------
G4int G4PVDivision::GetCopyNo() const
{
return fcopyNo;
}
//--------------------------------------------------------------------------
void G4PVDivision::SetCopyNo(G4int newCopyNo)
{
fcopyNo= newCopyNo;
}
//--------------------------------------------------------------------------
G4bool G4PVDivision::IsReplicated() const
{
return true;
}
//--------------------------------------------------------------------------
G4VPVParameterisation* G4PVDivision::GetParameterisation() const
{
return fparam;
}
//--------------------------------------------------------------------------
void G4PVDivision::GetReplicationData(EAxis& axis,
G4int& nDivs,
G4double& width,
G4double& offset,
G4bool& consuming ) const
{
axis=faxis;
nDivs=fnReplicas;
width=fwidth;
offset=foffset;
consuming=false;
}
//--------------------------------------------------------------------------
//TODO: this method should check that the child lv is of the correct type,
// else the ComputeDimensions will never be called
void G4PVDivision::SetParameterisation( G4LogicalVolume* motherLogical,
const EAxis axis,
const G4int nDivs,
const G4double width,
const G4double offset,
DivisionType divType )
{
// Check that solid is compatible with mother solid and axis of division
// CheckSolid( solid, motherSolid );
// G4cout << " Axis " << axis << G4endl;
G4VSolid* mSolid = motherLogical->GetSolid();
G4String mSolidType = mSolid->GetEntityType();
// Parameterisation type depend of mother solid type and axis of division
//
if( mSolidType == "G4Box" )
{
switch( axis )
{
case kXAxis:
fparam = new G4ParameterisationBoxX( axis, nDivs, width,
offset, mSolid, divType );
break;
case kYAxis:
fparam = new G4ParameterisationBoxY( axis, nDivs, width,
offset, mSolid, divType );
break;
case kZAxis:
fparam = new G4ParameterisationBoxZ( axis, nDivs, width,
offset, mSolid, divType );
break;
default:
ErrorInAxis( axis, mSolid );
break;
}
}
else if( mSolidType == "G4Tubs" )
{
switch( axis )
{
case kRho:
fparam = new G4ParameterisationTubsRho( axis, nDivs, width,
offset, mSolid, divType );
break;
case kPhi:
fparam = new G4ParameterisationTubsPhi( axis, nDivs, width,
offset, mSolid, divType );
break;
case kZAxis:
fparam = new G4ParameterisationTubsZ( axis, nDivs, width,
offset, mSolid, divType );
break;
default:
ErrorInAxis( axis, mSolid );
break;
}
}
else if( mSolidType == "G4Cons" )
{
switch( axis )
{
case kRho:
fparam = new G4ParameterisationConsRho( axis, nDivs, width,
offset, mSolid, divType );
break;
case kPhi:
fparam = new G4ParameterisationConsPhi( axis, nDivs, width,
offset, mSolid, divType );
break;
case kZAxis:
fparam = new G4ParameterisationConsZ( axis, nDivs, width,
offset, mSolid, divType );
break;
default:
ErrorInAxis( axis, mSolid );
break;
}
}
else if( mSolidType == "G4Trd" )
{
switch( axis )
{
case kXAxis:
fparam = new G4ParameterisationTrdX( axis, nDivs, width,
offset, mSolid, divType );
break;
case kYAxis:
fparam = new G4ParameterisationTrdY( axis, nDivs, width,
offset, mSolid, divType );
break;
case kZAxis:
fparam = new G4ParameterisationTrdZ( axis, nDivs, width,
offset, mSolid, divType );
break;
default:
ErrorInAxis( axis, mSolid );
break;
}
}
else if( mSolidType == "G4Para" )
{
switch( axis )
{
case kXAxis:
fparam = new G4ParameterisationParaX( axis, nDivs, width,
offset, mSolid, divType );
break;
case kYAxis:
fparam = new G4ParameterisationParaY( axis, nDivs, width,
offset, mSolid, divType );
break;
case kZAxis:
fparam = new G4ParameterisationParaZ( axis, nDivs, width,
offset, mSolid, divType );
break;
default:
ErrorInAxis( axis, mSolid );
break;
}
}
// else if( mSolidType == "G4Trap" )
// {
// }
else if( mSolidType == "G4Polycone" )
{
switch( axis )
{
case kRho:
fparam = new G4ParameterisationPolyconeRho( axis, nDivs, width,
offset, mSolid, divType );
break;
case kPhi:
fparam = new G4ParameterisationPolyconePhi( axis, nDivs, width,
offset, mSolid, divType );
break;
case kZAxis:
fparam = new G4ParameterisationPolyconeZ( axis, nDivs, width,
offset, mSolid, divType );
break;
default:
ErrorInAxis( axis, mSolid );
break;
}
}
else if( mSolidType == "G4Polyhedra" )
{
switch( axis )
{
case kRho:
fparam = new G4ParameterisationPolyhedraRho( axis, nDivs, width,
offset, mSolid, divType );
break;
case kPhi:
fparam = new G4ParameterisationPolyhedraPhi( axis, nDivs, width,
offset, mSolid, divType );
break;
case kZAxis:
fparam = new G4ParameterisationPolyhedraZ( axis, nDivs, width,
offset, mSolid, divType );
break;
default:
ErrorInAxis( axis, mSolid );
break;
}
}
else
{
G4cerr << "ERROR - G4PVDivision::SetParameterisation()" << G4endl
<< " Divisions for " << mSolidType
<< " not implemented." << G4endl;
G4Exception("G4PVDivision::SetParameterisation()", "IllegalConstruct",
FatalException, "Solid type not supported.");
}
}
//--------------------------------------------------------------------------
void G4PVDivision::ErrorInAxis( EAxis axis, G4VSolid* solid )
{
G4String error = "Trying to divide solid " + solid->GetName()
+ " of type " + solid->GetEntityType() + " along axis ";
switch( axis )
{
case kXAxis:
error += "X.";
break;
case kYAxis:
error += "Y.";
break;
case kZAxis:
error += "Z.";
break;
case kRho:
error += "Rho.";
break;
case kRadial3D:
error += "Radial3D.";
break;
case kPhi:
error += "Phi.";
break;
default:
break;
}
G4Exception("G4PVDivision::ErrorInAxis()", "IllegalConstruct",
FatalException, error);
}
@@ -0,0 +1,354 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationBox.cc,v 1.5 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4ParameterisationBox Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
#include "G4ParameterisationBox.hh"
#include <iomanip>
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Box.hh"
//--------------------------------------------------------------------------
G4ParameterisationBoxX::
G4ParameterisationBoxX( EAxis axis, G4int nDiv, G4double width,
G4double offset, G4VSolid* msolid,
DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionBoxX" );
if( divType == DivWIDTH )
{
G4Box* mbox = (G4Box*)(msolid);
fnDiv = CalculateNDiv( 2*mbox->GetXHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Box* mbox = (G4Box*)(msolid);
fwidth = CalculateWidth( 2*mbox->GetXHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationBoxX - no divisions "
<< fnDiv << " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationBoxX::~G4ParameterisationBoxX()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationBoxX::GetMaxParameter() const
{
G4Box* msol = (G4Box*)(fmotherSolid);
return 2*msol->GetXHalfLength();
}
//------------------------------------------------------------------------
void
G4ParameterisationBoxX::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol ) const
{
G4Box* msol = (G4Box*)(fmotherSolid );
G4double mdx = msol->GetXHalfLength( );
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posi = -mdx + foffset+(copyNo+0.5)*fwidth;
if( faxis == kXAxis )
{
origin.setX( posi );
}
else
{
G4cerr << "ERROR - G4ParameterisationBoxX::ComputeTransformation()"
<< G4endl
<< " Axis is along " << faxis << " !" << G4endl;
G4Exception("G4ParameterisationBoxX::ComputeTransformation()",
"IllegalConstruct", FatalException,
"Only axes along X are allowed !");
}
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationBoxX: "
<< copyNo << G4endl
<< " Position " << origin << " Axis " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//------------------------------------------------------------------------
void
G4ParameterisationBoxX::
ComputeDimensions( G4Box& box, const G4int,
const G4VPhysicalVolume* ) const
{
G4Box* msol = (G4Box*)(fmotherSolid);
G4double pDx = fwidth/2.;
G4double pDy = msol->GetYHalfLength();
G4double pDz = msol->GetZHalfLength();
box.SetXHalfLength( pDx );
box.SetYHalfLength( pDy );
box.SetZHalfLength( pDz );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationBoxX::ComputeDimensions()" << G4endl
<< " pDx: " << pDz << G4endl;
box.DumpInfo();
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationBoxY::
G4ParameterisationBoxY( EAxis axis, G4int nDiv, G4double width,
G4double offset, G4VSolid* msolid,
DivisionType divType)
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionBoxY" );
if( divType == DivWIDTH )
{
G4Box* mbox = (G4Box*)(msolid);
fnDiv = CalculateNDiv( 2*mbox->GetYHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Box* mbox = (G4Box*)(msolid);
fwidth = CalculateWidth( 2*mbox->GetYHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationBoxY - no divisions " << fnDiv << " = "
<< nDiv << ". Offset " << foffset << " = " << offset
<< ". Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationBoxY::~G4ParameterisationBoxY()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationBoxY::GetMaxParameter() const
{
G4Box* msol = (G4Box*)(fmotherSolid);
return 2*msol->GetYHalfLength();
}
//------------------------------------------------------------------------
void
G4ParameterisationBoxY::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol ) const
{
G4Box* msol = (G4Box*)(fmotherSolid);
G4double mdy = msol->GetYHalfLength();
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posi = -mdy + foffset + (copyNo+0.5)*fwidth;
if( faxis == kYAxis )
{
origin.setY( posi );
}
else
{
G4cerr << "ERROR - G4ParameterisationBoxY::ComputeTransformation()"
<< G4endl
<< " Axis is along " << faxis << " !" << G4endl;
G4Exception("G4ParameterisationBoxY::ComputeTransformation()",
"IllegalConstruct", FatalException,
"Only axes along Y are allowed !");
}
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationBoxY: "
<< copyNo << G4endl
<< " Position " << origin << " Axis " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//------------------------------------------------------------------------
void
G4ParameterisationBoxY::
ComputeDimensions( G4Box& box, const G4int,
const G4VPhysicalVolume* ) const
{
G4Box* msol = (G4Box*)(fmotherSolid);
G4double pDx = msol->GetXHalfLength();
G4double pDy = fwidth/2.;
G4double pDz = msol->GetZHalfLength();
box.SetXHalfLength( pDx );
box.SetYHalfLength( pDy );
box.SetZHalfLength( pDz );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationBoxY::ComputeDimensions()" << G4endl
<< " pDx: " << pDz << G4endl;
box.DumpInfo();
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationBoxZ::
G4ParameterisationBoxZ( EAxis axis, G4int nDiv, G4double width,
G4double offset, G4VSolid* msolid,
DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionBoxZ" );
if( divType == DivWIDTH )
{
G4Box* mbox = (G4Box*)(msolid);
fnDiv = CalculateNDiv( 2*mbox->GetZHalfLength(), width, offset );
}
else if ( divType == DivNDIV )
{
G4Box* mbox = (G4Box*)(msolid);
fwidth = CalculateWidth( 2*mbox->GetZHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationBoxZ - no divisions " << fnDiv << " = "
<< nDiv << ". Offset " << foffset << " = " << offset
<< ". Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationBoxZ::~G4ParameterisationBoxZ()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationBoxZ::GetMaxParameter() const
{
G4Box* msol = (G4Box*)(fmotherSolid);
return 2*msol->GetZHalfLength();
}
//------------------------------------------------------------------------
void
G4ParameterisationBoxZ::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
{
G4Box* msol = (G4Box*)(fmotherSolid );
G4double mdz = msol->GetZHalfLength();
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posi = -mdz + foffset + (copyNo+0.5)*fwidth;
if( faxis == kZAxis )
{
origin.setZ( posi );
}
else
{
G4cerr << "ERROR - G4ParameterisationBoxZ::ComputeTransformation()"
<< G4endl;
G4Exception("G4ParameterisationBoxZ::ComputeTransformation()",
"IllegalConstruct", FatalException,
"Only axes along Z are allowed !");
}
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationBoxZ: "
<< copyNo << G4endl
<< " Position " << origin << " Axis " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//------------------------------------------------------------------------
void
G4ParameterisationBoxZ::
ComputeDimensions( G4Box& box, const G4int,
const G4VPhysicalVolume* ) const
{
G4Box* msol = (G4Box*)(fmotherSolid);
G4double pDx = msol->GetXHalfLength();
G4double pDy = msol->GetYHalfLength();
G4double pDz = fwidth/2.;
box.SetXHalfLength( pDx );
box.SetYHalfLength( pDy );
box.SetZHalfLength( pDz );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationBoxZ::ComputeDimensions()" << G4endl
<< " pDx: " << pDz << G4endl;
box.DumpInfo();
}
#endif
}
@@ -0,0 +1,393 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationCons.cc,v 1.6 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4ParameterisationCons Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
#include "G4ParameterisationCons.hh"
#include <iomanip>
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Cons.hh"
//--------------------------------------------------------------------------
G4ParameterisationConsRho::
G4ParameterisationConsRho( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionConsRho" );
G4Cons* msol = (G4Cons*)(msolid);
if( msol->GetInnerRadiusPlusZ() == 0. )
{
G4cerr << "WARNING - G4ParameterisationConsRho, OuterRadiusMinusZ = 0. "
<< G4endl
<< " Width is calculated as that of OuterRadiusMinusZ !"
<< G4endl;
}
if( divType == DivWIDTH )
{
fnDiv = CalculateNDiv( msol->GetOuterRadiusMinusZ()
- msol->GetInnerRadiusMinusZ(), width, offset );
}
else if( divType == DivNDIV )
{
G4Cons* msol = (G4Cons*)(msolid);
fwidth = CalculateWidth( msol->GetOuterRadiusMinusZ()
- msol->GetInnerRadiusMinusZ(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationConsRho - no divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset
<< " - Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationConsRho::~G4ParameterisationConsRho()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationConsRho::GetMaxParameter() const
{
G4Cons* msol = (G4Cons*)(fmotherSolid);
return msol->GetOuterRadiusMinusZ() - msol->GetInnerRadiusMinusZ();
}
//--------------------------------------------------------------------------
void
G4ParameterisationConsRho::
ComputeTransformation( const G4int, G4VPhysicalVolume *physVol ) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationConsRho " << G4endl
<< " Offset: " << foffset
<< " - Width: " << fwidth << G4endl;
}
#endif
ChangeRotMatrix( physVol );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationConsRho" << G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
void
G4ParameterisationConsRho::
ComputeDimensions( G4Cons& cons, const G4int copyNo,
const G4VPhysicalVolume* ) const
{
G4Cons* msol = (G4Cons*)(fmotherSolid);
G4double pRMin1 = msol->GetInnerRadiusMinusZ() + foffset + fwidth * copyNo;
G4double pRMax1 = msol->GetInnerRadiusMinusZ() + foffset + fwidth * (copyNo+1);
//width at Z Plus
//- G4double fwidthPlus =
// fwidth * ( msol->GetOuterRadiusPlusZ()/ msol->GetInnerRadiusPlusZ())
//- / ( msol->GetOuterRadiusMinusZ() - msol->GetInnerRadiusMinusZ());
G4double fwidthPlus = CalculateWidth( msol->GetOuterRadiusPlusZ()
- msol->GetInnerRadiusPlusZ(), fnDiv, foffset );
G4double pRMin2 = msol->GetInnerRadiusPlusZ()
+ foffset + fwidthPlus * copyNo;
G4double pRMax2 = msol->GetInnerRadiusPlusZ()
+ foffset + fwidthPlus * (copyNo+1);
G4double pDz = msol->GetZHalfLength();
//- already rotated double pSR = foffset + copyNo*fwidth;
G4double pSPhi = msol->GetStartPhiAngle();
G4double pDPhi = msol->GetDeltaPhiAngle();;
cons.SetInnerRadiusMinusZ( pRMin1 );
cons.SetOuterRadiusMinusZ( pRMax1 );
cons.SetInnerRadiusPlusZ( pRMin2 );
cons.SetOuterRadiusPlusZ( pRMax2 );
cons.SetZHalfLength( pDz );
cons.SetStartPhiAngle( pSPhi );
cons.SetDeltaPhiAngle( pDPhi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationConsRho::ComputeDimensions()" << G4endl
<< " pRMin: " << pRMin1 << " - pRMax: " << pRMax1 << G4endl;
if( verbose >= 4 ) cons.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationConsPhi::
G4ParameterisationConsPhi( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionConsPhi" );
if( divType == DivWIDTH )
{
G4Cons* msol = (G4Cons*)(msolid);
fnDiv = CalculateNDiv( msol->GetDeltaPhiAngle(), width, offset );
}
else if( divType == DivNDIV )
{
G4Cons* msol = (G4Cons*)(msolid);
fwidth = CalculateWidth( msol->GetDeltaPhiAngle(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationConsPhi no divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationConsPhi::~G4ParameterisationConsPhi()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationConsPhi::GetMaxParameter() const
{
G4Cons* msol = (G4Cons*)(fmotherSolid);
return msol->GetDeltaPhiAngle();
}
//--------------------------------------------------------------------------
void
G4ParameterisationConsPhi::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix (so that all volumes point to the centre)
G4double posi = foffset + copyNo*fwidth;
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationConsPhi - position: " << posi/deg << G4endl
<< " Origin: " << origin << " copyNo: " << copyNo
<< " - foffset: " << foffset/deg
<< " - fwidth: " << fwidth/deg << G4endl
<< " - Axis: " << faxis << G4endl;
}
#endif
ChangeRotMatrix( physVol, -posi );
}
//--------------------------------------------------------------------------
void
G4ParameterisationConsPhi::
ComputeDimensions( G4Cons& cons, const G4int,
const G4VPhysicalVolume* ) const
{
G4Cons* msol = (G4Cons*)(fmotherSolid);
G4double pRMin1 = msol->GetInnerRadiusMinusZ();
G4double pRMax1 = msol->GetOuterRadiusMinusZ();
G4double pRMin2 = msol->GetInnerRadiusPlusZ();
G4double pRMax2 = msol->GetOuterRadiusPlusZ();
G4double pDz = msol->GetZHalfLength();
//- already rotated double pSPhi = foffset + copyNo*fwidth;
G4double pSPhi = foffset + msol->GetStartPhiAngle();
G4double pDPhi = fwidth;
cons.SetInnerRadiusMinusZ( pRMin1 );
cons.SetOuterRadiusMinusZ( pRMax1 );
cons.SetInnerRadiusPlusZ( pRMin2 );
cons.SetOuterRadiusPlusZ( pRMax2 );
cons.SetZHalfLength( pDz );
cons.SetStartPhiAngle( pSPhi );
cons.SetDeltaPhiAngle( pDPhi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationConsPhi::ComputeDimensions" << G4endl
<< " pSPhi: " << pSPhi << " - pDPhi: " << pDPhi << G4endl;
if( verbose >= 4 ) cons.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationConsZ::
G4ParameterisationConsZ( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionConsZ" );
if( divType == DivWIDTH )
{
G4Cons* msol = (G4Cons*)(msolid);
fnDiv = CalculateNDiv( 2*msol->GetZHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Cons* msol = (G4Cons*)(msolid);
fwidth = CalculateWidth( 2*msol->GetZHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationConsZ: # divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationConsZ::~G4ParameterisationConsZ()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationConsZ::GetMaxParameter() const
{
G4Cons* msol = (G4Cons*)(fmotherSolid);
return 2*msol->GetZHalfLength();
}
//--------------------------------------------------------------------------
void
G4ParameterisationConsZ::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol ) const
{
//----- set translation: along Z axis
G4Cons* motherCons = (G4Cons*)(GetMotherSolid());
G4double posi = - motherCons->GetZHalfLength() + foffset
+ fwidth/2 + copyNo*fwidth;
G4ThreeVector origin(0.,0.,posi);
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationConsZ::ComputeTransformation()" << G4endl
<< " Origin: " << origin << " - copyNo: " << copyNo << G4endl
<< " foffset: " << foffset << " - fwidth: " << fwidth
<< G4endl;
}
#endif
ChangeRotMatrix( physVol );
}
//--------------------------------------------------------------------------
void
G4ParameterisationConsZ::
ComputeDimensions( G4Cons& cons, const G4int copyNo,
const G4VPhysicalVolume* ) const
{
G4Cons* msol = (G4Cons*)(fmotherSolid);
G4double mHalfLength = msol->GetZHalfLength();
G4double aRInner = (msol->GetInnerRadiusPlusZ()
- msol->GetInnerRadiusMinusZ()) / (2*mHalfLength);
G4double bRInner = (msol->GetInnerRadiusPlusZ()
+ msol->GetInnerRadiusMinusZ()) / 2;
G4double aROuter = (msol->GetOuterRadiusPlusZ()
- msol->GetOuterRadiusMinusZ()) / (2*mHalfLength);
G4double bROuter = (msol->GetOuterRadiusPlusZ()
+ msol->GetOuterRadiusMinusZ()) / 2;
G4double xMinusZ = -mHalfLength + foffset + fwidth*copyNo;
G4double xPlusZ = -mHalfLength + foffset + fwidth*(copyNo+1);
cons.SetInnerRadiusMinusZ( aRInner * xMinusZ + bRInner );
cons.SetOuterRadiusMinusZ( aROuter * xMinusZ + bROuter );
cons.SetInnerRadiusPlusZ( aRInner * xPlusZ + bRInner );
cons.SetOuterRadiusPlusZ( aROuter * xPlusZ + bROuter );
G4double pDz = fwidth / 2.;
G4double pSPhi = msol->GetStartPhiAngle();
G4double pDPhi = msol->GetDeltaPhiAngle();
cons.SetZHalfLength( pDz );
cons.SetStartPhiAngle( pSPhi );
cons.SetDeltaPhiAngle( pDPhi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationConsZ::ComputeDimensions()" << G4endl
<< " pDz: " << pDz << G4endl;
if( verbose >= 4 ) cons.DumpInfo();
}
#endif
}
@@ -0,0 +1,345 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationPara.cc,v 1.6 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4ParameterisationPara Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
#include "G4ParameterisationPara.hh"
#include <iomanip>
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Para.hh"
//------------------------------------------------------------------------
G4ParameterisationParaX::
G4ParameterisationParaX( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionParaX" );
if( divType == DivWIDTH )
{
G4Para* mpara = (G4Para*)(msolid);
fnDiv = CalculateNDiv( 2*mpara->GetXHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Para* mpara = (G4Para*)(msolid);
fwidth = CalculateWidth( 2*mpara->GetXHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationParaX - # divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4double G4ParameterisationParaX::GetMaxParameter() const
{
G4Para* msol = (G4Para*)(fmotherSolid);
return 2*msol->GetXHalfLength();
}
//------------------------------------------------------------------------
G4ParameterisationParaX::~G4ParameterisationParaX()
{
}
//------------------------------------------------------------------------
void
G4ParameterisationParaX::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
{
G4Para* msol = (G4Para*)(fmotherSolid );
G4double mdx = msol->GetXHalfLength( );
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posi = -mdx + foffset+(copyNo+0.5)*fwidth;
origin.setX( posi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationParaX "
<< copyNo << G4endl
<< " Position: " << origin << " - Axis: " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//--------------------------------------------------------------------------
void
G4ParameterisationParaX::
ComputeDimensions(G4Para& para, const G4int,
const G4VPhysicalVolume*) const
{
//---- The division along X of a Para will result a Para
G4Para* msol = (G4Para*)(fmotherSolid);
//---- Get
G4double pDx = fwidth/2.;
G4double pDy = msol->GetYHalfLength();
G4double pDz = msol->GetZHalfLength();
G4double pAlpha = atan(msol->GetTanAlpha());
G4double pTheta = msol->GetSymAxis().theta();
G4double pPhi = msol->GetSymAxis().phi();
para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationParaX::ComputeDimensions()"
<< " - Mother PARA " << G4endl;
msol->DumpInfo();
G4cout << " - Parameterised PARA: " << G4endl;
para.DumpInfo();
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationParaY::
G4ParameterisationParaY( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionParaY" );
if( divType == DivWIDTH )
{
G4Para* mpara = (G4Para*)(msolid);
fnDiv = CalculateNDiv( 2*mpara->GetYHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Para* mpara = (G4Para*)(msolid);
fwidth = CalculateWidth( 2*mpara->GetYHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationParaY - # divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationParaY::~G4ParameterisationParaY()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationParaY::GetMaxParameter() const
{
G4Para* msol = (G4Para*)(fmotherSolid);
return 2*msol->GetYHalfLength();
}
//------------------------------------------------------------------------
void
G4ParameterisationParaY::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
{
G4Para* msol = (G4Para*)(fmotherSolid );
G4double mdy = msol->GetYHalfLength( );
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posiY = -mdy + foffset+(copyNo+0.5)*fwidth;
origin.setY( posiY );
G4double posiX = posiY * msol->GetTanAlpha();
origin.setX( posiX );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationParaY "
<< copyNo << G4endl
<< " Position: " << origin << " - Axis: " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//--------------------------------------------------------------------------
void
G4ParameterisationParaY::
ComputeDimensions(G4Para& para, const G4int,
const G4VPhysicalVolume*) const
{
//---- The division along Y of a Para will result a Para
G4Para* msol = (G4Para*)(fmotherSolid);
//---- Get
G4double pDx = msol->GetXHalfLength();
G4double pDy = fwidth/2.;
G4double pDz = msol->GetZHalfLength();
G4double pAlpha = atan(msol->GetTanAlpha());
G4double pTheta = msol->GetSymAxis().theta();
G4double pPhi = msol->GetSymAxis().phi();
para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
#ifdef G4DIVDEBUG
if( verbose >= -1 )
{
G4cout << " G4ParameterisationParaY::ComputeDimensions()"
<< " - Mother PARA " << G4endl;
msol->DumpInfo();
G4cout << " - Parameterised PARA: " << G4endl;
para.DumpInfo();
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationParaZ::
G4ParameterisationParaZ( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionParaZ" );
if( divType == DivWIDTH )
{
G4Para* mpara = (G4Para*)(msolid);
fnDiv = CalculateNDiv( 2*mpara->GetZHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Para* mpara = (G4Para*)(msolid);
fwidth = CalculateWidth( 2*mpara->GetZHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= -1 )
{
G4cout << " G4ParameterisationParaZ - # divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationParaZ::~G4ParameterisationParaZ()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationParaZ::GetMaxParameter() const
{
G4Para* msol = (G4Para*)(fmotherSolid);
return 2*msol->GetZHalfLength();
}
//------------------------------------------------------------------------
void
G4ParameterisationParaZ::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
{
G4Para* msol = (G4Para*)(fmotherSolid );
G4double mdz = msol->GetZHalfLength( );
//----- translation
G4double posi = -mdz + foffset + (copyNo+0.5)*fwidth;
G4ThreeVector symAxis = msol->GetSymAxis();
G4ThreeVector origin( symAxis * posi / symAxis.z() );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationParaZ "
<< copyNo << G4endl
<< " Position: " << origin << " - Axis: " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//--------------------------------------------------------------------------
void
G4ParameterisationParaZ::
ComputeDimensions(G4Para& para, const G4int,
const G4VPhysicalVolume*) const
{
//---- The division along Z of a Para will result a Para
G4Para* msol = (G4Para*)(fmotherSolid);
//---- Get
G4double pDx = msol->GetXHalfLength();
G4double pDy = msol->GetYHalfLength();
G4double pAlpha = atan(msol->GetTanAlpha());
G4double pTheta = msol->GetSymAxis().theta();
G4double pPhi = msol->GetSymAxis().phi();
G4double pDz = fwidth/2.;
para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
#ifdef G4DIVDEBUG
if( verbose >= -1 )
{
G4cout << " G4ParameterisationParaZ::ComputeDimensions()"
<< " - Mother PARA " << G4endl;
msol->DumpInfo();
G4cout << " - Parameterised PARA: " << G4endl;
para.DumpInfo();
}
#endif
}
@@ -0,0 +1,466 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationPolycone.cc,v 1.7 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4ParameterisationPolycone Implementation file
//
// 26.05.03 - P.Arce Initial version
//---------------------------------------------------------------------
#include "G4ParameterisationPolycone.hh"
#include <iomanip>
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
//---------------------------------------------------------------------
G4ParameterisationPolyconeRho::
G4ParameterisationPolyconeRho( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionPolyconeRho" );
G4Polycone* msol = (G4Polycone*)(msolid);
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
if( divType == DivWIDTH )
{
fnDiv = CalculateNDiv( origparamMother->Rmax[0]
- origparamMother->Rmin[0], width, offset );
}
else if( divType == DivNDIV )
{
fwidth = CalculateWidth( origparamMother->Rmax[0]
- origparamMother->Rmin[0], nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= -1 )
{
G4cout << " G4ParameterisationPolyconeRho - # divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//---------------------------------------------------------------------
G4ParameterisationPolyconeRho::~G4ParameterisationPolyconeRho()
{
}
//---------------------------------------------------------------------
void G4ParameterisationPolyconeRho::CheckParametersValidity()
{
G4VDivisionParameterisation::CheckParametersValidity();
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyconeRho::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along R will be done with a width "
<< "different for each solid section." << G4endl
<< " WIDTH will not be used !" << G4endl;
}
if( foffset != 0. )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyconeRho::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along R will be done with a width "
<< "different for each solid section." << G4endl
<< " OFFSET will not be used !" << G4endl;
}
}
//------------------------------------------------------------------------
G4double G4ParameterisationPolyconeRho::GetMaxParameter() const
{
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
G4PolyconeHistorical* original_pars = msol->GetOriginalParameters();
return original_pars->Rmax[0] - original_pars->Rmin[0];
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyconeRho::
ComputeTransformation( const G4int, G4VPhysicalVolume* physVol ) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationPolyconeRho " << G4endl
<< " foffset: " << foffset
<< " - fwidth: " << fwidth << G4endl;
}
#endif
ChangeRotMatrix( physVol );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationPolyconeRho "
<< G4endl
<< " Position: " << origin/mm
<< " - Width: " << fwidth/deg
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyconeRho::
ComputeDimensions( G4Polycone& pcone, const G4int copyNo,
const G4VPhysicalVolume* ) const
{
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
G4PolyconeHistorical origparam( *origparamMother );
G4int nZplanes = origparamMother->Num_z_planes;
G4double width = 0.;
for( G4int ii = 0; ii < nZplanes; ii++ )
{
width = CalculateWidth( origparamMother->Rmax[ii]
- origparamMother->Rmin[ii], fnDiv, foffset );
origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
}
pcone.SetOriginalParameters(&origparam); // copy values & transfer pointers
pcone.Reset(); // reset to new solid parameters
#ifdef G4DIVDEBUG
if( verbose >= -2 )
{
G4cout << "G4ParameterisationPolyconeRho::ComputeDimensions()" << G4endl
<< "-- Parametrised pcone copy-number: " << copyNo << G4endl;
pcone.DumpInfo();
}
#endif
}
//---------------------------------------------------------------------
G4ParameterisationPolyconePhi::
G4ParameterisationPolyconePhi( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionPolyconePhi" );
G4Polycone* msol = (G4Polycone*)(msolid);
G4double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
if( divType == DivWIDTH )
{
fnDiv = CalculateNDiv( deltaPhi, width, offset );
}
else if( divType == DivNDIV )
{
fwidth = CalculateWidth( deltaPhi, nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationPolyconePhi - # divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset/deg << " = " << offset/deg << G4endl
<< " Width " << fwidth/deg << " = " << width/deg << G4endl;
}
#endif
}
//---------------------------------------------------------------------
G4ParameterisationPolyconePhi::~G4ParameterisationPolyconePhi()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationPolyconePhi::GetMaxParameter() const
{
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
return msol->GetEndPhi() - msol->GetStartPhi();
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyconePhi::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix (so that all volumes point to the centre)
G4double posi = foffset + copyNo*fwidth;
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationPolyconePhi - position: " << posi/deg
<< G4endl
<< " copyNo: " << copyNo << " - foffset: " << foffset/deg
<< " - fwidth: " << fwidth/deg << G4endl;
}
#endif
ChangeRotMatrix( physVol, -posi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationPolyconePhi "
<< copyNo << G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyconePhi::
ComputeDimensions( G4Polycone& pcone, const G4int,
const G4VPhysicalVolume* ) const
{
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
G4PolyconeHistorical origparam( *origparamMother );
origparam.Start_angle = origparamMother->Start_angle;
origparam.Opening_angle = fwidth;
pcone.SetOriginalParameters(&origparam); // copy values & transfer pointers
pcone.Reset(); // reset to new solid parameters
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << "G4ParameterisationPolyconePhi::ComputeDimensions():" << G4endl;
pcone.DumpInfo();
}
#endif
}
//---------------------------------------------------------------------
G4ParameterisationPolyconeZ::
G4ParameterisationPolyconeZ( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType)
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionPolyconeZ" );
G4Polycone* msol = (G4Polycone*)(msolid);
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
if( divType == DivWIDTH )
{
fnDiv =
CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
- origparamMother->Z_values[0] , width, offset );
}
else if( divType == DivNDIV )
{
fwidth =
CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
- origparamMother->Z_values[0] , nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationPolyconeZ - # divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//---------------------------------------------------------------------
G4ParameterisationPolyconeZ::~G4ParameterisationPolyconeZ()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationPolyconeZ::GetMaxParameter() const
{
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
return (origparamMother->Z_values[origparamMother->Num_z_planes-1]
-origparamMother->Z_values[0]);
}
//---------------------------------------------------------------------
void G4ParameterisationPolyconeZ::CheckParametersValidity()
{
G4VDivisionParameterisation::CheckParametersValidity();
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyconeZ::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along Z will be done splitting in the "
<< "defined z_planes." << G4endl
<< " WIDTH will not be used !" << G4endl;
}
if( foffset != 0. )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyconeZ::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along Z will be done splitting in the "
<< "defined z_planes." << G4endl
<< " OFFSET will not be used !" << G4endl;
}
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
if( origparamMother->Num_z_planes-1 != fnDiv )
{
G4cerr << "ERROR - "
<< "G4ParameterisationPolyconeZ::CheckParametersValidity()"
<< G4endl
<< " Division along Z will be done splitting in the defined"
<< G4endl
<< " z_planes, i.e, the number of division would be :"
<< " " << origparamMother->Num_z_planes-1
<< " instead of " << fnDiv << " !"
<< G4endl;
G4Exception("G4ParameterisationPolyconeZ::CheckParametersValidity()",
"IllegalConstruct", FatalException,
"Not supported configuration.");
}
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyconeZ::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol) const
{
G4Polycone* msol = (G4Polycone*)(GetMotherSolid());
//----- set translation: along Z axis
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
G4double posi = (origparamMother->Z_values[copyNo]
+ origparamMother->Z_values[copyNo+1])/2;
G4ThreeVector origin(0.,0.,posi);
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationPolyconeZ - position: " << posi << G4endl
<< " copyNo: " << copyNo << " - foffset: " << foffset/deg
<< " - fwidth: " << fwidth/deg << G4endl;
}
#endif
ChangeRotMatrix( physVol );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationPolyconeZ "
<< copyNo << G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyconeZ::
ComputeDimensions( G4Polycone& pcone, const G4int copyNo,
const G4VPhysicalVolume* ) const
{
// only for mother number of planes = 2!!
//
G4Polycone* msol = (G4Polycone*)(fmotherSolid);
G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
G4PolyconeHistorical origparam( *origparamMother );
G4double posi = (origparamMother->Z_values[copyNo]
+ origparamMother->Z_values[copyNo+1])/2;
origparam.Num_z_planes = 2;
origparam.Z_values[0] = origparamMother->Z_values[copyNo] - posi;
origparam.Z_values[1] = origparamMother->Z_values[copyNo+1] - posi;
origparam.Rmin[0] = origparamMother->Rmin[copyNo];
origparam.Rmin[1] = origparamMother->Rmin[copyNo+1];
origparam.Rmax[0] = origparamMother->Rmax[copyNo];
origparam.Rmax[1] = origparamMother->Rmax[copyNo+1];
pcone.SetOriginalParameters(&origparam); // copy values & transfer pointers
pcone.Reset(); // reset to new solid parameters
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << "G4ParameterisationPolyconeZ::ComputeDimensions()" << G4endl
<< "-- Parametrised pcone copy-number: " << copyNo << G4endl;
pcone.DumpInfo();
}
#endif
}
@@ -0,0 +1,516 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationPolyhedra.cc,v 1.6 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4ParameterisationPolyhedra Implementation file
//
// 14.10.03 - P.Arce Initial version
//---------------------------------------------------------------------
#include "G4ParameterisationPolyhedra.hh"
#include <iomanip>
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Polyhedra.hh"
//--------------------------------------------------------------------------
G4ParameterisationPolyhedraRho::
G4ParameterisationPolyhedraRho( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionPolyhedraRho" );
G4Polyhedra* msol = (G4Polyhedra*)(msolid);
G4PolyhedraHistorical* original_pars = msol->GetOriginalParameters();
if( divType == DivWIDTH )
{
fnDiv = CalculateNDiv( original_pars->Rmax[0]
- original_pars->Rmin[0], width, offset );
}
else if( divType == DivNDIV )
{
fwidth = CalculateWidth( original_pars->Rmax[0]
- original_pars->Rmin[0], nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationPolyhedraRho - # divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationPolyhedraRho::~G4ParameterisationPolyhedraRho()
{
}
//---------------------------------------------------------------------
void G4ParameterisationPolyhedraRho::CheckParametersValidity()
{
G4VDivisionParameterisation::CheckParametersValidity();
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyhedraRho::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along R will be done with a width "
<< "different for each solid section." << G4endl
<< " WIDTH will not be used !" << G4endl;
}
if( foffset != 0. )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyhedraRho::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along R will be done with a width "
<< "different for each solid section." << G4endl
<< " OFFSET will not be used !" << G4endl;
}
}
//------------------------------------------------------------------------
G4double G4ParameterisationPolyhedraRho::GetMaxParameter() const
{
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
G4PolyhedraHistorical* original_pars = msol->GetOriginalParameters();
return original_pars->Rmax[0] - original_pars->Rmin[0];
}
//--------------------------------------------------------------------------
void
G4ParameterisationPolyhedraRho::
ComputeTransformation( const G4int, G4VPhysicalVolume* physVol ) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationPolyhedraRho " << G4endl
<< " foffset: " << foffset/deg
<< " - fwidth: " << fwidth/deg << G4endl;
}
#endif
ChangeRotMatrix( physVol );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationPolyhedraRho "
<< G4endl
<< " Position: " << origin
<< " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
void
G4ParameterisationPolyhedraRho::
ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
const G4VPhysicalVolume* ) const
{
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
G4PolyhedraHistorical origparam( *origparamMother );
G4int nZplanes = origparamMother->Num_z_planes;
G4double width = 0.;
for( G4int ii = 0; ii < nZplanes; ii++ )
{
width = CalculateWidth( origparamMother->Rmax[ii]
- origparamMother->Rmin[ii], fnDiv, foffset );
origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
}
phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
phedra.Reset(); // reset to new solid parameters
#ifdef G4DIVDEBUG
if( verbose >= -2 )
{
G4cout << "G4ParameterisationPolyhedraRho::ComputeDimensions()" << G4endl
<< "-- Parametrised phedra copy-number: " << copyNo << G4endl;
phedra.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationPolyhedraPhi::
G4ParameterisationPolyhedraPhi( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionPolyhedraPhi" );
G4Polyhedra* msol = (G4Polyhedra*)(msolid);
G4double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
if( divType == DivWIDTH )
{
fnDiv = CalculateNDiv( deltaPhi, width, offset );
}
else if( divType == DivNDIV )
{
fwidth = CalculateWidth( deltaPhi, nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationPolyhedraPhi - # divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationPolyhedraPhi::~G4ParameterisationPolyhedraPhi()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationPolyhedraPhi::GetMaxParameter() const
{
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
return msol->GetEndPhi() - msol->GetStartPhi();
}
//---------------------------------------------------------------------
void G4ParameterisationPolyhedraPhi::CheckParametersValidity()
{
G4VDivisionParameterisation::CheckParametersValidity();
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyhedraPhi::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along PHI will be done splitting "
<< "in the defined numSide." << G4endl
<< " WIDTH will not be used !" << G4endl;
}
if( foffset != 0. )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyhedraPhi::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along PHI will be done splitting "
<< "in the defined numSide." << G4endl
<< " OFFSET will not be used !" << G4endl;
}
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
if( origparamMother->numSide != fnDiv )
{
G4cerr << "ERROR - "
<< "G4ParameterisationPolyhedraPhi::CheckParametersValidity()"
<< G4endl
<< " Division along PHI will be done splitting in the defined"
<< G4endl
<< " numSide, i.e, the number of division would be :"
<< " " << origparamMother->numSide
<< " instead of " << fnDiv << " !"
<< G4endl;
G4Exception("G4ParameterisationPolyhedraPhi::CheckParametersValidity()",
"IllegalConstruct", FatalException,
"Not supported configuration.");
}
}
//--------------------------------------------------------------------------
void
G4ParameterisationPolyhedraPhi::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix (so that all volumes point to the centre)
G4double posi = copyNo*fwidth;
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationPolyhedraPhi - position: " << posi/deg
<< G4endl
<< " copyNo: " << copyNo
<< " - fwidth: " << fwidth/deg << G4endl;
}
#endif
ChangeRotMatrix( physVol, -posi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationPolyhedraPhi " << copyNo
<< G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
void
G4ParameterisationPolyhedraPhi::
ComputeDimensions( G4Polyhedra& phedra, const G4int,
const G4VPhysicalVolume* ) const
{
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
G4PolyhedraHistorical origparam( *origparamMother );
origparam.numSide = 1;
origparam.Start_angle = origparamMother->Start_angle;
origparam.Opening_angle = fwidth;
phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
phedra.Reset(); // reset to new solid parameters
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << "G4ParameterisationPolyhedraPhi::ComputeDimensions():" << G4endl;
phedra.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationPolyhedraZ::
G4ParameterisationPolyhedraZ( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionPolyhedraZ" );
G4Polyhedra* msol = (G4Polyhedra*)(msolid);
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
if( divType == DivWIDTH )
{
fnDiv =
CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
- origparamMother->Z_values[0] , width, offset );
}
else if( divType == DivNDIV )
{
fwidth =
CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
- origparamMother->Z_values[0] , nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationPolyhedraZ - # divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//---------------------------------------------------------------------
G4ParameterisationPolyhedraZ::~G4ParameterisationPolyhedraZ()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationPolyhedraZ::GetMaxParameter() const
{
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
return (origparamMother->Z_values[origparamMother->Num_z_planes-1]
-origparamMother->Z_values[0]);
}
//---------------------------------------------------------------------
void G4ParameterisationPolyhedraZ::CheckParametersValidity()
{
G4VDivisionParameterisation::CheckParametersValidity();
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along Z will be done splitting "
<< "in the defined z_planes." << G4endl
<< " WIDTH will not be used !" << G4endl;
}
if( foffset != 0. )
{
G4cerr << "WARNING - "
<< "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
<< G4endl
<< " Solid " << msol->GetName() << G4endl
<< " Division along Z will be done splitting "
<< "in the defined z_planes." << G4endl
<< " OFFSET will not be used !" << G4endl;
}
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
if( origparamMother->Num_z_planes-1 != fnDiv )
{
G4cerr << "ERROR - "
<< "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
<< G4endl
<< " Division along Z will be done splitting in the defined"
<< G4endl
<< " z_planes, i.e, the number of division would be :"
<< " " << origparamMother->Num_z_planes-1
<< " instead of " << fnDiv << " !"
<< G4endl;
G4Exception("G4ParameterisationPolyhedraZ::CheckParametersValidity()",
"IllegalConstruct", FatalException,
"Not supported configuration.");
}
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyhedraZ::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol) const
{
G4Polyhedra* msol = (G4Polyhedra*)(GetMotherSolid());
//----- set translation: along Z axis
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
G4double posi = (origparamMother->Z_values[copyNo]
+ origparamMother->Z_values[copyNo+1])/2;
G4ThreeVector origin(0.,0.,posi);
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationPolyhedraZ - position: " << posi << G4endl
<< " copyNo: " << copyNo << " - foffset: " << foffset/deg
<< " - fwidth: " << fwidth/deg << G4endl;
}
#endif
ChangeRotMatrix( physVol );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationPolyhedraZ "
<< copyNo << G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//---------------------------------------------------------------------
void
G4ParameterisationPolyhedraZ::
ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
const G4VPhysicalVolume* ) const
{
// only for mother number of planes = 2!!
//
G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
G4PolyhedraHistorical origparam( *origparamMother );
G4double posi = (origparamMother->Z_values[copyNo]
+ origparamMother->Z_values[copyNo+1])/2;
origparam.Num_z_planes = 2;
origparam.Z_values[0] = origparamMother->Z_values[copyNo] - posi;
origparam.Z_values[1] = origparamMother->Z_values[copyNo+1] - posi;
origparam.Rmin[0] = origparamMother->Rmin[copyNo];
origparam.Rmin[1] = origparamMother->Rmin[copyNo+1];
origparam.Rmax[0] = origparamMother->Rmax[copyNo];
origparam.Rmax[1] = origparamMother->Rmax[copyNo+1];
phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
phedra.Reset(); // reset to new solid parameters
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << "G4ParameterisationPolyhedraZ::ComputeDimensions()" << G4endl
<< "-- Parametrised phedra copy-number: " << copyNo << G4endl;
phedra.DumpInfo();
}
#endif
}
@@ -0,0 +1,416 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationTrd.cc,v 1.8 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4ParameterisationTrd Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
#include "G4ParameterisationTrd.hh"
#include <iomanip>
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Trd.hh"
#include "G4Trap.hh"
//------------------------------------------------------------------------
G4ParameterisationTrdX::
G4ParameterisationTrdX( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionTrdX" );
if( divType == DivWIDTH )
{
G4Trd* mtrd = (G4Trd*)(msolid);
fnDiv = CalculateNDiv( 2*mtrd->GetXHalfLength1(),
width, offset );
}
else if( divType == DivNDIV )
{
G4Trd* mtrd = (G4Trd*)(msolid);
fwidth = CalculateWidth( 2*mtrd->GetXHalfLength1(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= -1 )
{
G4cout << " G4ParameterisationTrdX - ## divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationTrdX::~G4ParameterisationTrdX()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationTrdX::GetMaxParameter() const
{
G4Trd* msol = (G4Trd*)(fmotherSolid);
return 2*msol->GetXHalfLength1();
}
//------------------------------------------------------------------------
void
G4ParameterisationTrdX::
ComputeTransformation( const G4int copyNo,
G4VPhysicalVolume *physVol ) const
{
G4Trd* msol = (G4Trd*)(fmotherSolid );
G4double mdx = msol->GetXHalfLength1();
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posi = -mdx + foffset + (copyNo+0.5)*fwidth;
if( faxis == kXAxis )
{
origin.setX( posi );
}
else
{
G4cerr << "ERROR - G4ParameterisationTrdX::ComputeTransformation()"
<< G4endl
<< " Axis is along " << faxis << " !" << G4endl;
G4Exception("G4ParameterisationTrdX::ComputeTransformation()",
"IllegalConstruct", FatalException,
"Only axes along X are allowed !");
}
#ifdef G4DIVDEBUG
if( verbose >= -2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationTrdX: "
<< copyNo << G4endl
<< " Position: " << origin << " - Axis: " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//--------------------------------------------------------------------------
void
G4ParameterisationTrdX::
ComputeDimensions( G4Trd& trd, const G4int, const G4VPhysicalVolume* ) const
{
G4Trd* msol = (G4Trd*)(fmotherSolid);
G4double pDy1 = msol->GetYHalfLength1();
G4double pDy2 = msol->GetYHalfLength2();
G4double pDz = msol->GetZHalfLength();
G4double pDx = fwidth/2.;
trd.SetAllParameters ( pDx, pDx, pDy1, pDy2, pDz );
#ifdef G4DIVDEBUG
if( verbose >= -2 )
{
G4cout << " G4ParameterisationTrdX::ComputeDimensions():" << G4endl;
trd.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
void G4ParameterisationTrdX::CheckParametersValidity()
{
G4VDivisionParameterisation::CheckParametersValidity();
G4Trd* msol = (G4Trd*)(fmotherSolid);
G4double mpDx1 = msol->GetXHalfLength1();
G4double mpDx2 = msol->GetXHalfLength2();
if( fabs(mpDx1 - mpDx2) > kCarTolerance )
{
G4cerr << "ERROR - G4ParameterisationTrdX::CheckParametersValidity()"
<< G4endl
<< " Making a division of a TRD along axis X," << G4endl
<< " while the X half lengths are not equal," << G4endl
<< " is not (yet) supported. It will result" << G4endl
<< " in non-equal division solids." << G4endl;
G4Exception("G4ParameterisationTrdX::CheckParametersValidity()",
"IllegalConstruct", FatalException,
"Invalid solid specification. NOT supported.");
}
}
//--------------------------------------------------------------------------
G4ParameterisationTrdY::
G4ParameterisationTrdY( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType)
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionTrdY" );
if( divType == DivWIDTH )
{
G4Trd* mtrd = (G4Trd*)(msolid);
fnDiv = CalculateNDiv( 2*mtrd->GetYHalfLength1(),
width, offset );
}
else if( divType == DivNDIV )
{
G4Trd* mtrd = (G4Trd*)(msolid);
fwidth = CalculateWidth( 2*mtrd->GetYHalfLength1(),
nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationTrdY no divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationTrdY::~G4ParameterisationTrdY()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationTrdY::GetMaxParameter() const
{
G4Trd* msol = (G4Trd*)(fmotherSolid);
return 2*msol->GetYHalfLength1();
}
//--------------------------------------------------------------------------
void
G4ParameterisationTrdY::
ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol ) const
{
G4Trd* msol = (G4Trd*)(fmotherSolid );
G4double mdy = msol->GetYHalfLength1();
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posi = -mdy + foffset + (copyNo+0.5)*fwidth;
if( faxis == kYAxis )
{
origin.setY( posi );
}
else
{
G4Exception("G4ParameterisationTrdY::ComputeTransformation()",
"IllegalConstruct", FatalException,
"Only axes along Y are allowed !");
}
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationTrdY " << copyNo
<< " pos " << origin << " rot mat " << " axis " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//--------------------------------------------------------------------------
void
G4ParameterisationTrdY::
ComputeDimensions(G4Trd& trd, const G4int, const G4VPhysicalVolume*) const
{
//---- The division along Y of a Trd will result a Trd, only
//--- if Y at -Z and +Z are equal, else use the G4Trap version
G4Trd* msol = (G4Trd*)(fmotherSolid);
G4double pDx1 = msol->GetXHalfLength1();
G4double pDx2 = msol->GetXHalfLength2();
G4double pDz = msol->GetZHalfLength();
G4double pDy = fwidth/2.;
trd.SetAllParameters ( pDx1, pDx2, pDy, pDy, pDz );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationTrdY::ComputeDimensions():" << G4endl;
trd.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
void G4ParameterisationTrdY::CheckParametersValidity()
{
G4VDivisionParameterisation::CheckParametersValidity();
G4Trd* msol = (G4Trd*)(fmotherSolid);
G4double mpDy1 = msol->GetYHalfLength1();
G4double mpDy2 = msol->GetYHalfLength2();
if( fabs(mpDy1 - mpDy2) > kCarTolerance )
{
G4cerr << "ERROR - G4ParameterisationTrdY::CheckParametersValidity()"
<< G4endl
<< " Making a division of a TRD along axis Y while" << G4endl
<< " the Y half lengths are not equal is not (yet)" << G4endl
<< " supported. It will result in non-equal" << G4endl
<< " division solids." << G4endl;
G4Exception("G4ParameterisationTrdY::CheckParametersValidity()",
"IllegalConstruct", FatalException,
"Invalid solid specification. NOT supported.");
}
}
//--------------------------------------------------------------------------
G4ParameterisationTrdZ::
G4ParameterisationTrdZ( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivTrdZ" );
if( divType == DivWIDTH )
{
G4Trd* mtrd = (G4Trd*)(msolid);
fnDiv = CalculateNDiv( 2*mtrd->GetZHalfLength(),
width, offset );
}
else if( divType == DivNDIV )
{
G4Trd* mtrd = (G4Trd*)(msolid);
fwidth = CalculateWidth( 2*mtrd->GetZHalfLength(),
nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationTrdZ no divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//------------------------------------------------------------------------
G4ParameterisationTrdZ::~G4ParameterisationTrdZ()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationTrdZ::GetMaxParameter() const
{
G4Trd* msol = (G4Trd*)(fmotherSolid);
return 2*msol->GetZHalfLength();
}
//--------------------------------------------------------------------------
void
G4ParameterisationTrdZ::
ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
{
G4Trd* msol = (G4Trd*)(fmotherSolid );
G4double mdz = msol->GetZHalfLength();
//----- translation
G4ThreeVector origin(0.,0.,0.);
G4double posi = -mdz + foffset + (copyNo+0.5)*fwidth;
if( faxis == kZAxis )
{
origin.setZ( posi );
}
else
{
G4Exception("G4ParameterisationTrdZ::ComputeTransformation()",
"IllegalConstruct", FatalException,
"Only axes along Z are allowed !");
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << std::setprecision(8) << " G4ParameterisationTrdZ: "
<< copyNo << G4endl
<< " Position: " << origin << " - Offset: " << foffset
<< " - Width: " << fwidth << " Axis " << faxis << G4endl;
}
#endif
//----- set translation
physVol->SetTranslation( origin );
}
//--------------------------------------------------------------------------
void
G4ParameterisationTrdZ::
ComputeDimensions(G4Trd& trd, const G4int copyNo,
const G4VPhysicalVolume*) const
{
//---- The division along Z of a Trd will result a Trd
G4Trd* msol = (G4Trd*)(fmotherSolid);
G4double pDx1 = msol->GetXHalfLength1();
G4double DDx = (msol->GetXHalfLength2() - msol->GetXHalfLength1() );
G4double pDy1 = msol->GetYHalfLength1();
G4double DDy = (msol->GetYHalfLength2() - msol->GetYHalfLength1() );
G4double pDz = fwidth/2.;
G4double zLength = 2*msol->GetZHalfLength();
trd.SetAllParameters ( pDx1+DDx*(foffset+copyNo*fwidth)/zLength,
pDx1+DDx*(foffset+(copyNo+1)*fwidth)/zLength,
pDy1+DDy*(foffset+copyNo*fwidth)/zLength,
pDy1+DDy*(foffset+(copyNo+1)*fwidth)/zLength, pDz );
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationTrdZ::ComputeDimensions()"
<< " - Mother TRD " << G4endl;
msol->DumpInfo();
G4cout << " - Parameterised TRD: "
<< copyNo << G4endl;
trd.DumpInfo();
}
#endif
}
@@ -0,0 +1,372 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParameterisationTubs.cc,v 1.5 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4ParameterisationTubs Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
#include "G4ParameterisationTubs.hh"
#include <iomanip>
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Tubs.hh"
//--------------------------------------------------------------------------
G4ParameterisationTubsRho::
G4ParameterisationTubsRho( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionTubsRho" );
if( divType == DivWIDTH )
{
G4Tubs* msol = (G4Tubs*)(msolid);
fnDiv = CalculateNDiv( msol->GetOuterRadius() - msol->GetInnerRadius(),
width, offset );
}
else if( divType == DivNDIV )
{
G4Tubs* msol = (G4Tubs*)(msolid);
fwidth = CalculateWidth( msol->GetOuterRadius() - msol->GetInnerRadius(),
nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationTubsRho - no divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl
<< " DivType " << divType << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationTubsRho::~G4ParameterisationTubsRho()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationTubsRho::GetMaxParameter() const
{
G4Tubs* msol = (G4Tubs*)(fmotherSolid);
return msol->GetOuterRadius() - msol->GetInnerRadius();
}
//--------------------------------------------------------------------------
void
G4ParameterisationTubsRho::
ComputeTransformation(const G4int, G4VPhysicalVolume* physVol) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationTubsRho " << G4endl
<< " Offset: " << foffset/deg
<< " - Width: " << fwidth/deg << G4endl;
}
#endif
ChangeRotMatrix( physVol );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationTubsRho " << G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis " << faxis << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
void
G4ParameterisationTubsRho::
ComputeDimensions( G4Tubs& tubs, const G4int copyNo,
const G4VPhysicalVolume* ) const
{
G4Tubs* msol = (G4Tubs*)(fmotherSolid);
G4double pRMin = msol->GetInnerRadius() + foffset + fwidth * copyNo;
G4double pRMax = msol->GetInnerRadius() + foffset + fwidth * (copyNo+1);
G4double pDz = msol->GetZHalfLength();
//- already rotated G4double pSR = foffset + copyNo*fwidth;
G4double pSPhi = msol->GetStartPhiAngle();
G4double pDPhi = msol->GetDeltaPhiAngle();;
tubs.SetInnerRadius( pRMin );
tubs.SetOuterRadius( pRMax );
tubs.SetZHalfLength( pDz );
tubs.SetStartPhiAngle( pSPhi );
tubs.SetDeltaPhiAngle( pDPhi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationTubsRho::ComputeDimensions()" << G4endl
<< " pRMin: " << pRMin << " - pRMax: " << pRMax << G4endl;
tubs.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationTubsPhi::
G4ParameterisationTubsPhi( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionTubsPhi" );
if( divType == DivWIDTH )
{
G4Tubs* msol = (G4Tubs*)(msolid);
fnDiv = CalculateNDiv( msol->GetDeltaPhiAngle(), width, offset );
}
else if( divType == DivNDIV )
{
G4Tubs* msol = (G4Tubs*)(msolid);
fwidth = CalculateWidth( msol->GetDeltaPhiAngle(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationTubsPhi no divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationTubsPhi::~G4ParameterisationTubsPhi()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationTubsPhi::GetMaxParameter() const
{
G4Tubs* msol = (G4Tubs*)(fmotherSolid);
return msol->GetDeltaPhiAngle();
}
//--------------------------------------------------------------------------
void
G4ParameterisationTubsPhi::
ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
{
//----- translation
G4ThreeVector origin(0.,0.,0.);
//----- set translation
physVol->SetTranslation( origin );
//----- calculate rotation matrix (so that all volumes point to the centre)
G4double posi = foffset + copyNo*fwidth;
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationTubsPhi - position: " << posi/deg << G4endl
<< " copyNo: " << copyNo << " - foffset: " << foffset/deg
<< " - fwidth: " << fwidth/deg << G4endl;
}
#endif
ChangeRotMatrix( physVol, -posi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationTubsPhi " << copyNo
<< G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
void
G4ParameterisationTubsPhi::
ComputeDimensions( G4Tubs& tubs, const G4int,
const G4VPhysicalVolume* ) const
{
G4Tubs* msol = (G4Tubs*)(fmotherSolid);
G4double pRMin = msol->GetInnerRadius();
G4double pRMax = msol->GetOuterRadius();
G4double pDz = msol->GetZHalfLength();
//----- already rotated in 'ComputeTransformation'
G4double pSPhi = msol->GetStartPhiAngle();
G4double pDPhi = fwidth;
tubs.SetInnerRadius( pRMin );
tubs.SetOuterRadius( pRMax );
tubs.SetZHalfLength( pDz );
tubs.SetStartPhiAngle( pSPhi );
tubs.SetDeltaPhiAngle( pDPhi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationTubsPhi::ComputeDimensions" << G4endl
<< " pSPhi: " << pSPhi << " - pDPhi: " << pDPhi << G4endl;
tubs.DumpInfo();
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationTubsZ::
G4ParameterisationTubsZ( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
CheckParametersValidity();
SetType( "DivisionTubsZ" );
if( divType == DivWIDTH )
{
G4Tubs* msol = (G4Tubs*)(msolid);
fnDiv = CalculateNDiv( 2*msol->GetZHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Tubs* msol = (G4Tubs*)(msolid);
fwidth = CalculateWidth( 2*msol->GetZHalfLength(), nDiv, offset );
}
#ifdef G4DIVDEBUG
if( verbose >= 1 )
{
G4cout << " G4ParameterisationTubsZ: # divisions " << fnDiv << " = "
<< nDiv << G4endl
<< " Offset " << foffset << " = " << offset << G4endl
<< " Width " << fwidth << " = " << width << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
G4ParameterisationTubsZ::~G4ParameterisationTubsZ()
{
}
//------------------------------------------------------------------------
G4double G4ParameterisationTubsZ::GetMaxParameter() const
{
G4Tubs* msol = (G4Tubs*)(fmotherSolid);
return 2*msol->GetZHalfLength();
}
//--------------------------------------------------------------------------
void
G4ParameterisationTubsZ::
ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
{
//----- set translation: along Z axis
G4Tubs* motherTubs = (G4Tubs*)(fmotherSolid);
G4double posi = - motherTubs->GetZHalfLength() + foffset
+ fwidth/2 + copyNo*fwidth;
G4ThreeVector origin(0.,0.,posi);
physVol->SetTranslation( origin );
//----- calculate rotation matrix: unit
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationTubsZ::ComputeTransformation()" << G4endl
<< " Position: " << posi << " - copyNo: " << copyNo << G4endl
<< " foffset " << foffset/deg << " - fwidth " << fwidth/deg
<< G4endl;
}
#endif
ChangeRotMatrix( physVol );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << std::setprecision(8) << " G4ParameterisationTubsZ " << copyNo
<< G4endl
<< " Position: " << origin << " - Width: " << fwidth
<< " - Axis: " << faxis << G4endl;
}
#endif
}
//--------------------------------------------------------------------------
void
G4ParameterisationTubsZ::
ComputeDimensions( G4Tubs& tubs, const G4int,
const G4VPhysicalVolume* ) const
{
G4Tubs* msol = (G4Tubs*)(fmotherSolid);
G4double pRMin = msol->GetInnerRadius();
G4double pRMax = msol->GetOuterRadius();
// G4double pDz = msol->GetZHalfLength() / GetNoDiv();
G4double pDz = fwidth/2.;
G4double pSPhi = msol->GetStartPhiAngle();
G4double pDPhi = msol->GetDeltaPhiAngle();
tubs.SetInnerRadius( pRMin );
tubs.SetOuterRadius( pRMax );
tubs.SetZHalfLength( pDz );
tubs.SetStartPhiAngle( pSPhi );
tubs.SetDeltaPhiAngle( pDPhi );
#ifdef G4DIVDEBUG
if( verbose >= 2 )
{
G4cout << " G4ParameterisationTubsZ::ComputeDimensions()" << G4endl
<< " pDz: " << pDz << G4endl;
tubs.DumpInfo();
}
#endif
}
@@ -0,0 +1,151 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VDivisionParameterisation.cc,v 1.8 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
// class G4VDivisionParameterisation Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
#include "G4VDivisionParameterisation.hh"
#include "G4VSolid.hh"
#include "G4VPhysicalVolume.hh"
#include "G4RotationMatrix.hh"
G4int G4VDivisionParameterisation::verbose = 5;
//--------------------------------------------------------------------------
G4VDivisionParameterisation::
G4VDivisionParameterisation( EAxis axis, G4int nDiv,
G4double step, G4double offset,
DivisionType divType, G4VSolid* motherSolid )
: faxis(axis), fnDiv( nDiv), fwidth(step),
foffset(offset), fDivisionType(divType), fmotherSolid( motherSolid )
{
#ifdef G4DIVDEBUG
if (verbose >= 1)
{
G4cout << " G4VDivisionParameterisation no divisions " << fnDiv
<< " = " << nDiv << G4endl
<< " offset " << foffset << " = " << offset << G4endl
<< " step " << fwidth << " = " << step << G4endl;
}
#endif
theVoluFirstCopyNo = 1;
}
//--------------------------------------------------------------------------
G4VDivisionParameterisation::~G4VDivisionParameterisation()
{
}
//--------------------------------------------------------------------------
void
G4VDivisionParameterisation::
ChangeRotMatrix( G4VPhysicalVolume *physVol, G4double rotZ ) const
{
G4RotationMatrix* rm = new G4RotationMatrix();
rm->rotateZ( rotZ );
//----- set rotation
//----- delete first old rotation matrix
G4RotationMatrix* rmold = physVol->GetRotation();
delete rmold;
physVol->SetRotation(rm);
}
//--------------------------------------------------------------------------
G4int
G4VDivisionParameterisation::
CalculateNDiv( G4double motherDim, G4double width, G4double offset ) const
{
#ifdef G4DIVDEBUG
G4cout << " G4VDivisionParameterisation::CalculateNDiv: "
<< ( motherDim - offset ) / width
<< " Motherdim: " << motherDim << ", Offset: " << offset
<< ", Width: " << width << G4endl;
#endif
return G4int( ( motherDim - offset ) / width );
}
//--------------------------------------------------------------------------
G4double
G4VDivisionParameterisation::
CalculateWidth( G4double motherDim, G4int nDiv, G4double offset ) const
{
#ifdef G4DIVDEBUG
G4cout << " G4VDivisionParameterisation::CalculateWidth: "
<< ( motherDim - offset ) / nDiv
<< ", Motherdim: " << motherDim << ", Offset: " << offset
<< ", Number of divisions: " << nDiv << G4endl;
#endif
return ( motherDim - offset ) / nDiv;
}
//--------------------------------------------------------------------------
void G4VDivisionParameterisation::CheckParametersValidity()
{
G4double maxPar = GetMaxParameter();
CheckOffset( maxPar );
CheckNDivAndWidth( maxPar );
}
//--------------------------------------------------------------------------
void G4VDivisionParameterisation::CheckOffset( G4double maxPar )
{
if( foffset >= maxPar )
{
G4cerr << "ERROR - G4VDivisionParameterisation::CheckOffset()" << G4endl
<< " Division of solid " << fmotherSolid->GetName()
<< " has too big offset = " << G4endl
<< " " << foffset << " > " << maxPar << " !" << G4endl;
G4Exception("G4VDivisionParameterisation::CheckOffset()",
"IllegalConstruct", FatalException,
"Not supported configuration.");
}
}
//--------------------------------------------------------------------------
void G4VDivisionParameterisation::CheckNDivAndWidth( G4double maxPar )
{
if( (fDivisionType == DivNDIVandWIDTH)
&& (foffset + fwidth*fnDiv - maxPar > kCarTolerance ) )
{
G4cerr << "ERROR - G4VDivisionParameterisation::CheckNDivAndWidth()"
<< G4endl
<< " Division of solid " << fmotherSolid->GetName()
<< " has too big offset + width*nDiv = " << G4endl
<< " " << foffset + fwidth*fnDiv << " > "
<< foffset << ". Width = "
<< G4endl
<< " " << fwidth << ". nDiv = " << fnDiv << " !"
<< G4endl;
G4Exception("G4VDivisionParameterisation::CheckNDivAndWidth()",
"IllegalConstruct", FatalException,
"Not supported configuration.");
}
}