Changeset 1228 for trunk/source/geometry


Ignore:
Timestamp:
Jan 8, 2010, 11:56:51 AM (16 years ago)
Author:
garnier
Message:

update geant4.9.3 tag

Location:
trunk/source/geometry
Files:
549 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/geometry/biasing/include/G4GeometryCell.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCell.hh,v 1.6 2006/06/29 18:15:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4GeometryCellComp.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellComp.hh,v 1.2 2006/06/29 18:15:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4GeometryCellImportance.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellImportance.hh,v 1.4 2006/06/29 18:15:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4GeometryCellStep.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellStep.hh,v 1.2 2006/06/29 18:15:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4GeometryCellStepStream.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellStepStream.hh,v 1.3 2006/06/29 18:15:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4GeometryCellWeight.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellWeight.hh,v 1.3 2006/06/29 18:16:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4IStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4IStore.hh,v 1.10 2006/06/29 18:16:04 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4ImportanceAlgorithm.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ImportanceAlgorithm.hh,v 1.7 2006/06/29 18:16:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4Nsplit_Weight.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Nsplit_Weight.hh,v 1.11 2006/06/29 18:16:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VCellScorer.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VCellScorer.hh,v 1.7 2006/06/29 18:16:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VCellScorerStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VCellScorerStore.hh,v 1.7 2006/06/29 18:16:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VGCellFinder.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VGCellFinder.hh,v 1.2 2006/06/29 18:16:34 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VIStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VIStore.hh,v 1.9 2006/06/29 18:16:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VImportanceAlgorithm.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VImportanceAlgorithm.hh,v 1.8 2006/06/29 18:16:40 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VImportanceSplitExaminer.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VImportanceSplitExaminer.hh,v 1.5 2006/06/29 18:16:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VWeightWindowAlgorithm.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VWeightWindowAlgorithm.hh,v 1.8 2006/06/29 18:16:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4VWeightWindowStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VWeightWindowStore.hh,v 1.3 2006/06/29 18:16:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4WeightWindowAlgorithm.hh

    r1058 r1228  
    2626//
    2727// $Id: G4WeightWindowAlgorithm.hh,v 1.7 2006/06/29 18:16:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/include/G4WeightWindowStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4WeightWindowStore.hh,v 1.3 2006/06/29 18:17:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4GeometryCell.cc

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCell.cc,v 1.6 2006/06/29 18:17:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4GeometryCellComp.cc

    r1058 r1228  
    2525//
    2626// $Id: G4GeometryCellComp.cc,v 1.4 2006/06/29 18:17:10 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4GeometryCellImportance.cc

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellImportance.cc,v 1.5 2006/06/29 18:17:12 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4GeometryCellStep.cc

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellStep.cc,v 1.2 2006/06/29 18:17:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4GeometryCellStepStream.cc

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryCellStepStream.cc,v 1.3 2006/06/29 18:17:16 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4IStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4IStore.cc,v 1.14 2006/06/29 18:17:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4ImportanceAlgorithm.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ImportanceAlgorithm.cc,v 1.14 2006/06/29 18:17:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4Nsplit_Weight.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Nsplit_Weight.cc,v 1.10 2006/06/29 18:17:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VCellScorer.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VCellScorer.cc,v 1.6 2006/06/29 18:17:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VCellScorerStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VCellScorerStore.cc,v 1.4 2006/06/29 18:17:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VGCellFinder.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VGCellFinder.cc,v 1.2 2006/06/29 18:17:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VIStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VIStore.cc,v 1.2 2006/06/29 18:17:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VImportanceAlgorithm.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VImportanceAlgorithm.cc,v 1.2 2006/06/29 18:17:43 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VImportanceSplitExaminer.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VImportanceSplitExaminer.cc,v 1.2 2006/06/29 18:17:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VWeightWindowAlgorithm.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VWeightWindowAlgorithm.cc,v 1.2 2006/06/29 18:17:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4VWeightWindowStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VWeightWindowStore.cc,v 1.3 2006/06/29 18:17:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4WeightWindowAlgorithm.cc

    r1058 r1228  
    2626//
    2727// $Id: G4WeightWindowAlgorithm.cc,v 1.11 2007/11/09 15:43:07 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/biasing/src/G4WeightWindowStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4WeightWindowStore.cc,v 1.5 2006/06/29 18:18:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/divisions/History

    r1010 r1228  
    1 $Id: History,v 1.30 2008/12/04 16:01:32 gcosmo Exp $
     1$Id: History,v 1.31 2009/05/20 08:55:23 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     20May, 20th, 2009         I.Hrivnacova (geomdiv-V09-02-00)
     21- Allow for generic divisions along Z for polyhedras and polycones; now
     22  divisions can happen along z-axis with width and offset, which fulfil the
     23  condition that division does not span over more than one segment.
     24- Fixed initialization of division in Phi for polyhedras to not take into
     25  account user defined width.
     26- Fixed initialization of arrays in unit test: changed polycone definition
     27  so that division does not give exception and added polyhedra, which was
     28  not present.
    1929
    2030December, 3rd, 2008     P.Arce  (geomdiv-V09-01-02)
  • trunk/source/geometry/divisions/include/G4PVDivision.hh

    r1010 r1228  
    2626//
    2727// $Id: G4PVDivision.hh,v 1.14 2008/12/03 16:41:45 arce Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4PVDivision
  • trunk/source/geometry/divisions/include/G4PVDivisionFactory.hh

    r1010 r1228  
    2626//
    2727// $Id: G4PVDivisionFactory.hh,v 1.2 2006/06/29 18:18:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/divisions/include/G4ParameterisationBox.hh

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationBox.hh,v 1.6 2006/06/29 18:18:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// classes G4ParameterisationBoxX,
  • trunk/source/geometry/divisions/include/G4ParameterisationCons.hh

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationCons.hh,v 1.6 2006/06/29 18:18:13 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// classes G4ParameterisationConsRho,
  • trunk/source/geometry/divisions/include/G4ParameterisationPara.hh

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationPara.hh,v 1.7 2006/06/29 18:18:15 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// classes G4ParameterisationParaX,
  • trunk/source/geometry/divisions/include/G4ParameterisationPolycone.hh

    r1010 r1228  
    2525//
    2626//
    27 // $Id: G4ParameterisationPolycone.hh,v 1.7 2006/06/29 18:18:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParameterisationPolycone.hh,v 1.8 2009/05/14 14:19:32 ivana Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// classes G4ParameterisationPolyconeRho,
     
    192192                            const G4VPhysicalVolume* physVol ) const;
    193193
    194   private:  // Dummy declarations to get rid of warnings ...
     194  private: 
     195    G4double GetR(G4double z, G4double z1, G4double r1, G4double z2, G4double r2) const;
     196    G4double GetRmin(G4double z, G4int nsegment) const;
     197    G4double GetRmax(G4double z, G4int nsegment) const;
     198
     199    G4int fNSegment;
     200    G4PolyconeHistorical* fOrigParamMother;
     201
     202    // Dummy declarations to get rid of warnings ...
    195203
    196204    void ComputeDimensions (G4Trd&,const G4int,
  • trunk/source/geometry/divisions/include/G4ParameterisationPolyhedra.hh

    r1010 r1228  
    2525//
    2626//
    27 // $Id: G4ParameterisationPolyhedra.hh,v 1.8 2006/06/29 18:18:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParameterisationPolyhedra.hh,v 1.9 2009/05/14 14:19:32 ivana Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// classes G4ParameterisationPolyhedraRho,
     
    200200                            const G4VPhysicalVolume* physVol ) const;
    201201
    202   private:  // Dummy declarations to get rid of warnings ...
    203 
     202  private:
     203    G4double GetR(G4double z, G4double z1, G4double r1, G4double z2, G4double r2) const;
     204    G4double GetRmin(G4double z, G4int nsegment) const;
     205    G4double GetRmax(G4double z, G4int nsegment) const;
     206
     207    G4int fNSegment;
     208    G4PolyhedraHistorical* fOrigParamMother;
     209
     210    // Dummy declarations to get rid of warnings ...
    204211    void ComputeDimensions (G4Trd&,const G4int,
    205212                            const G4VPhysicalVolume*) const {}
  • trunk/source/geometry/divisions/include/G4ParameterisationTrd.hh

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationTrd.hh,v 1.8 2008/12/03 16:48:48 arce Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// classes G4ParameterisationTrdX
  • trunk/source/geometry/divisions/include/G4ParameterisationTubs.hh

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationTubs.hh,v 1.6 2006/06/29 18:18:24 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// classes G4ParameterisationTubsRho
  • trunk/source/geometry/divisions/include/G4VDivisionParameterisation.hh

    r1010 r1228  
    2626//
    2727// $Id: G4VDivisionParameterisation.hh,v 1.11 2007/05/11 13:26:26 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VDivisionParameterisation
  • trunk/source/geometry/divisions/include/G4VDivisionParameterisation.icc

    r1010 r1228  
    2626//
    2727// $Id: G4VDivisionParameterisation.icc,v 1.4 2006/06/29 18:18:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VDivisionParameterisation Inline Implementation file
  • trunk/source/geometry/divisions/src/G4PVDivision.cc

    r1010 r1228  
    2626//
    2727// $Id: G4PVDivision.cc,v 1.22 2008/12/03 16:41:45 arce Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4PVDivision Implementation file
  • trunk/source/geometry/divisions/src/G4PVDivisionFactory.cc

    r1010 r1228  
    2626//
    2727// $Id: G4PVDivisionFactory.cc,v 1.2 2006/06/29 18:18:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4PVDivisionFactory Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationBox.cc

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationBox.cc,v 1.10 2006/06/29 18:18:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4ParameterisationBox Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationCons.cc

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationCons.cc,v 1.9 2006/06/29 18:18:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4ParameterisationCons Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationPara.cc

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationPara.cc,v 1.11 2006/06/29 18:18:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4ParameterisationPara Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationPolycone.cc

    r1010 r1228  
    2525//
    2626//
    27 // $Id: G4ParameterisationPolycone.cc,v 1.15 2006/06/29 18:18:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParameterisationPolycone.cc,v 1.17 2009/05/18 19:30:29 ivana Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4ParameterisationPolycone Implementation file
     
    355355                             G4double width, G4double offset,
    356356                             G4VSolid* msolid, DivisionType divType)
    357   : G4VParameterisationPolycone( axis, nDiv, width, offset, msolid, divType )
     357  : G4VParameterisationPolycone( axis, nDiv, width, offset, msolid, divType ),
     358    fNSegment(0),
     359    fOrigParamMother(((G4Polycone*)fmotherSolid)->GetOriginalParameters())
    358360{
    359361
     
    361363  SetType( "DivisionPolyconeZ" );
    362364
    363   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
    364   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
    365  
    366365  if( divType == DivWIDTH )
    367366  {
    368367    fnDiv =
    369       CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
    370                      - origparamMother->Z_values[0] , width, offset );
     368      CalculateNDiv( fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
     369                     - fOrigParamMother->Z_values[0] , width, offset );
    371370  }
    372371  else if( divType == DivNDIV )
    373372  {
    374373    fwidth =
    375       CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
    376                      - origparamMother->Z_values[0] , nDiv, offset );
     374      CalculateNDiv( fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
     375                     - fOrigParamMother->Z_values[0] , nDiv, offset );
    377376  }
    378377 
     
    394393
    395394//------------------------------------------------------------------------
     395G4double G4ParameterisationPolyconeZ::GetR(G4double z,
     396                                           G4double z1, G4double r1, 
     397                                           G4double z2, G4double r2) const
     398{
     399  // Linear parameterisation:
     400  // r = az + b
     401  // a = (r1 - r2)/(z1-z2)
     402  // b = r1 - a*z1
     403
     404  return (r1-r2)/(z1-z2)*z + ( r1 - (r1-r2)/(z1-z2)*z1 ) ;
     405
     406                                           
     407//------------------------------------------------------------------------
     408G4double G4ParameterisationPolyconeZ::GetRmin(G4double z, G4int nseg) const
     409{
     410// Get Rmin in the given z position for the given polycone segment
     411
     412  return GetR(z,
     413              fOrigParamMother->Z_values[nseg],
     414              fOrigParamMother->Rmin[nseg],
     415              fOrigParamMother->Z_values[nseg+1],
     416              fOrigParamMother->Rmin[nseg+1]);
     417
     418                                           
     419//------------------------------------------------------------------------
     420G4double G4ParameterisationPolyconeZ::GetRmax(G4double z, G4int nseg) const
     421{
     422// Get Rmax in the given z position for the given polycone segment
     423
     424  return GetR(z,
     425              fOrigParamMother->Z_values[nseg],
     426              fOrigParamMother->Rmax[nseg],
     427              fOrigParamMother->Z_values[nseg+1],
     428              fOrigParamMother->Rmax[nseg+1]);
     429
     430                                           
     431//------------------------------------------------------------------------
    396432G4double G4ParameterisationPolyconeZ::GetMaxParameter() const
    397433{
    398   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
    399   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
    400   return std::abs (origparamMother->Z_values[origparamMother->Num_z_planes-1]
    401              -origparamMother->Z_values[0]);
     434  return std::abs (fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
     435             -fOrigParamMother->Z_values[0]);
    402436}
    403437
     
    406440{
    407441  G4VDivisionParameterisation::CheckParametersValidity();
    408 
    409   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
    410 
    411   if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
    412   {
    413     G4cerr << "WARNING - "
    414            << "G4ParameterisationPolyconeZ::CheckParametersValidity()"
    415            << G4endl
    416            << "          Solid " << msol->GetName() << G4endl
    417            << "          Division along Z will be done splitting in the "
    418            << "defined z_planes." << G4endl
    419            << "          WIDTH will not be used !" << G4endl;
    420   }
    421 
    422   if( foffset != 0. )
    423   {
    424     G4cerr << "WARNING - "
    425            << "G4ParameterisationPolyconeZ::CheckParametersValidity()"
    426            << G4endl
    427            << "          Solid " << msol->GetName() << G4endl
    428            << "          Division along Z will be done splitting in the "
    429            << "defined z_planes." << G4endl
    430            << "          OFFSET will not be used !" << G4endl;
    431   }
    432 
    433   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
    434 
    435   if( origparamMother->Num_z_planes-1 != fnDiv )
    436   {
    437     G4cerr << "ERROR - "
    438            << "G4ParameterisationPolyconeZ::CheckParametersValidity()"
    439            << G4endl
    440            << "        Division along Z will be done splitting in the defined"
    441            << G4endl
    442            << "        z_planes, i.e, the number of division would be :"
    443            << "        " << origparamMother->Num_z_planes-1
    444            << " instead of " << fnDiv << " !"
    445            << G4endl;
    446     G4Exception("G4ParameterisationPolyconeZ::CheckParametersValidity()",
     442 
     443  // Division will be following the mother polycone segments
     444  if( fDivisionType == DivNDIV ) {
     445    if( fnDiv > fOrigParamMother->Num_z_planes-1 ) {
     446      G4cerr << "ERROR - "
     447             << "G4ParameterisationPolyconeZ::CheckParametersValidity()"
     448             << G4endl
     449             << "        Division along Z will be done splitting in the defined"
     450             << G4endl
     451             << "        z_planes, i.e, the number of division would be :"
     452             << "        " << fOrigParamMother->Num_z_planes-1
     453             << " instead of " << fnDiv << " !"
     454             << G4endl;
     455      G4Exception("G4ParameterisationPolyconeZ::CheckParametersValidity()",
    447456                "IllegalConstruct", FatalException,
    448457                "Not supported configuration.");
    449   }
     458    }
     459  } 
     460     
     461  // Division will be done within one polycone segment
     462  // with applying given width and offset
     463  if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH ) {
     464    // Check if divided region does not span over more
     465    // than one z segment
     466 
     467    G4int isegstart = -1;  // number of the segment containing start position
     468    G4int isegend = -1;    // number of the segment containing end position
     469
     470    if ( ! fReflectedSolid ) {
     471      // The start/end position of the divided region
     472      G4double zstart
     473        = fOrigParamMother->Z_values[0] + foffset;
     474      G4double zend
     475        = fOrigParamMother->Z_values[0] + foffset + fnDiv* fwidth;
     476   
     477      G4int counter = 0;
     478      while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 ) {
     479        // first segment
     480        if ( zstart >= fOrigParamMother->Z_values[counter]  &&
     481             zstart  < fOrigParamMother->Z_values[counter+1] ) {
     482           isegstart = counter;
     483        }     
     484        // last segment
     485        if ( zend  > fOrigParamMother->Z_values[counter] &&
     486             zend <= fOrigParamMother->Z_values[counter+1] ) {
     487          isegend = counter;
     488        }   
     489        ++counter;   
     490      }
     491    }
     492    else  {
     493      // The start/end position of the divided region
     494      G4double zstart
     495        = fOrigParamMother->Z_values[0] - foffset;
     496      G4double zend
     497        = fOrigParamMother->Z_values[0] - ( foffset + fnDiv* fwidth);
     498   
     499      G4int counter = 0;
     500      while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 ) {
     501        // first segment
     502        if ( zstart <= fOrigParamMother->Z_values[counter]  &&
     503             zstart  > fOrigParamMother->Z_values[counter+1] ) {
     504           isegstart = counter;
     505        }     
     506        // last segment
     507        if ( zend  < fOrigParamMother->Z_values[counter] &&
     508             zend >= fOrigParamMother->Z_values[counter+1] ) {
     509           isegend = counter;
     510        }   
     511        ++counter;   
     512      }
     513    }
     514     
     515 
     516    if ( isegstart != isegend ) {
     517      G4cerr << "WARNING - "
     518             << "G4ParameterisationPolyconeZ::CheckParametersValidity()"
     519             << G4endl
     520             << "          Division with user defined width." << G4endl
     521             << "          Solid " << fmotherSolid->GetName() << G4endl
     522             << "          Divided region is not between two z planes."
     523             << G4endl;
     524 
     525      G4Exception("G4ParameterisationPolyconeZ::CheckParametersValidity()",
     526                  "IllegalConstruct", FatalException,
     527                  "Not supported configuration.");
     528    }
     529 
     530    fNSegment = isegstart;
     531  } 
    450532}
    451533
     
    455537ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol) const
    456538{
    457   G4Polycone* msol = (G4Polycone*)(GetMotherSolid());
    458 
    459   //----- set translation: along Z axis
    460   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
    461   G4double posi = (origparamMother->Z_values[copyNo]
    462                    + origparamMother->Z_values[copyNo+1])/2;
    463   G4ThreeVector origin(0.,0.,posi);
    464   physVol->SetTranslation( origin );
     539  if ( fDivisionType == DivNDIV ) {
     540    // The position of the centre of copyNo-th mother polycone segment
     541    G4double posi
     542      = ( fOrigParamMother->Z_values[copyNo]
     543        + fOrigParamMother->Z_values[copyNo+1])/2;
     544    physVol->SetTranslation( G4ThreeVector(0, 0, posi) );
     545  }
     546 
     547  if ( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH ) {
     548    // The position of the centre of copyNo-th division
     549    G4double posi = fOrigParamMother->Z_values[0];
     550     
     551    if ( ! fReflectedSolid ) 
     552      posi += foffset + (2*copyNo + 1) * fwidth/2.;
     553    else
     554      posi -= foffset + (2*copyNo + 1) * fwidth/2.;
     555   
     556    physVol->SetTranslation( G4ThreeVector(0, 0, posi) );
     557  }   
    465558
    466559  //----- calculate rotation matrix: unit
     
    494587                   const G4VPhysicalVolume* ) const
    495588{
    496   // only for mother number of planes = 2!!
    497   //
    498   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
    499 
    500   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
    501   G4PolyconeHistorical origparam( *origparamMother );
    502 
    503   G4double posi = (origparamMother->Z_values[copyNo]
    504                    + origparamMother->Z_values[copyNo+1])/2;
    505 
    506   origparam.Num_z_planes = 2;
    507   origparam.Z_values[0] = origparamMother->Z_values[copyNo] - posi;
    508   origparam.Z_values[1] = origparamMother->Z_values[copyNo+1] - posi;
    509   origparam.Rmin[0] = origparamMother->Rmin[copyNo];
    510   origparam.Rmin[1] = origparamMother->Rmin[copyNo+1];
    511   origparam.Rmax[0] = origparamMother->Rmax[copyNo];
    512   origparam.Rmax[1] = origparamMother->Rmax[copyNo+1];
     589
     590  // Define division solid
     591  G4PolyconeHistorical origparam;
     592  G4int nz = 2;
     593  origparam.Num_z_planes = nz;
     594  origparam.Start_angle = fOrigParamMother->Start_angle;
     595  origparam.Opening_angle = fOrigParamMother->Opening_angle;
     596
     597  // Define division solid z sections
     598  origparam.Z_values = new G4double[nz];
     599  origparam.Rmin = new G4double[nz];
     600  origparam.Rmax = new G4double[nz];
     601
     602  if ( fDivisionType == DivNDIV ) {
     603    // The position of the centre of copyNo-th mother polycone segment
     604    G4double posi = (fOrigParamMother->Z_values[copyNo]
     605                   + fOrigParamMother->Z_values[copyNo+1])/2;
     606
     607    origparam.Z_values[0] = fOrigParamMother->Z_values[copyNo] - posi;
     608    origparam.Z_values[1] = fOrigParamMother->Z_values[copyNo+1] - posi;
     609    origparam.Rmin[0] = fOrigParamMother->Rmin[copyNo];
     610    origparam.Rmin[1] = fOrigParamMother->Rmin[copyNo+1];
     611    origparam.Rmax[0] = fOrigParamMother->Rmax[copyNo];
     612    origparam.Rmax[1] = fOrigParamMother->Rmax[copyNo+1];
     613  }
     614 
     615  if ( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH ) {
     616    if ( ! fReflectedSolid ) {
     617      origparam.Z_values[0] = - fwidth/2.;
     618      origparam.Z_values[1] = fwidth/2.;
     619
     620      // The position of the centre of copyNo-th division
     621      G4double posi
     622        = fOrigParamMother->Z_values[0] + foffset + (2*copyNo + 1) * fwidth/2.;
     623   
     624      // The first and last z sides z values
     625      G4double zstart = posi - fwidth/2.;
     626      G4double zend = posi + fwidth/2.;
     627      origparam.Rmin[0] = GetRmin(zstart, fNSegment);
     628      origparam.Rmax[0] = GetRmax(zstart, fNSegment); 
     629      origparam.Rmin[1] = GetRmin(zend, fNSegment);
     630      origparam.Rmax[1] = GetRmax(zend, fNSegment); 
     631    }
     632    else {
     633      origparam.Z_values[0] = fwidth/2.;
     634      origparam.Z_values[1] = - fwidth/2.;
     635
     636      // The position of the centre of copyNo-th division
     637      G4double posi
     638        = fOrigParamMother->Z_values[0] - ( foffset + (2*copyNo + 1) * fwidth/2.);
     639   
     640      // The first and last z sides z values
     641      G4double zstart = posi + fwidth/2.;
     642      G4double zend = posi - fwidth/2.;
     643      origparam.Rmin[0] = GetRmin(zstart, fNSegment);
     644      origparam.Rmax[0] = GetRmax(zstart, fNSegment); 
     645      origparam.Rmin[1] = GetRmin(zend, fNSegment);
     646      origparam.Rmax[1] = GetRmax(zend, fNSegment); 
     647    }
     648
     649    // It can happen due to rounding errors
     650    if ( origparam.Rmin[0]    < 0.0 ) origparam.Rmin[0] = 0.0;
     651    if ( origparam.Rmin[nz-1] < 0.0 ) origparam.Rmin[1] = 0.0;
     652  } 
    513653
    514654  pcone.SetOriginalParameters(&origparam);  // copy values & transfer pointers
  • trunk/source/geometry/divisions/src/G4ParameterisationPolyhedra.cc

    r1010 r1228  
    2525//
    2626//
    27 // $Id: G4ParameterisationPolyhedra.cc,v 1.16 2007/05/18 07:27:23 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParameterisationPolyhedra.cc,v 1.19 2009/05/20 08:35:52 ivana Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4ParameterisationPolyhedra Implementation file
     
    288288  if( divType == DivWIDTH )
    289289  {
    290     fnDiv = CalculateNDiv( deltaPhi, width, offset );
    291   }
    292   else if( divType == DivNDIV )
    293   {
    294     fwidth = CalculateWidth( deltaPhi, nDiv, offset );
    295   }
     290    fnDiv = msol->GetNumSide();
     291  }
     292
     293  fwidth = CalculateWidth( deltaPhi, fnDiv, 0.0 );
    296294
    297295#ifdef G4DIVDEBUG
     
    348346  G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
    349347
    350   if( origparamMother->numSide != fnDiv )
     348  if( origparamMother->numSide != fnDiv &&  fDivisionType != DivWIDTH)
    351349  {
    352350    G4cerr << "ERROR - "
     
    433431                             G4double width, G4double offset,
    434432                             G4VSolid* msolid, DivisionType divType )
    435   :  G4VParameterisationPolyhedra( axis, nDiv, width, offset, msolid, divType )
     433  :  G4VParameterisationPolyhedra( axis, nDiv, width, offset, msolid, divType ),
     434     fNSegment(0),
     435     fOrigParamMother(((G4Polyhedra*)fmotherSolid)->GetOriginalParameters())
    436436{
    437437  CheckParametersValidity();
    438438  SetType( "DivisionPolyhedraZ" );
    439439
    440   G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
    441   G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
    442  
    443440  if( divType == DivWIDTH )
    444441    {
    445442    fnDiv =
    446       CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
    447                      - origparamMother->Z_values[0] , width, offset );
     443      CalculateNDiv( fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
     444                     - fOrigParamMother->Z_values[0] , width, offset );
    448445  }
    449446  else if( divType == DivNDIV )
    450447    {
    451448    fwidth =
    452       CalculateNDiv( origparamMother->Z_values[origparamMother->Num_z_planes-1]
    453                      - origparamMother->Z_values[0] , nDiv, offset );
     449      CalculateNDiv( fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
     450                     - fOrigParamMother->Z_values[0] , nDiv, offset );
    454451  }
    455452 
     
    471468
    472469//------------------------------------------------------------------------
     470G4double G4ParameterisationPolyhedraZ::GetR(G4double z,
     471                                           G4double z1, G4double r1, 
     472                                           G4double z2, G4double r2) const
     473{
     474  // Linear parameterisation:
     475  // r = az + b
     476  // a = (r1 - r2)/(z1-z2)
     477  // b = r1 - a*z1
     478
     479  return (r1-r2)/(z1-z2)*z + ( r1 - (r1-r2)/(z1-z2)*z1 ) ;
     480
     481                                           
     482//------------------------------------------------------------------------
     483G4double G4ParameterisationPolyhedraZ::GetRmin(G4double z, G4int nseg) const
     484{
     485// Get Rmin in the given z position for the given polyhedra segment
     486
     487  return GetR(z,
     488              fOrigParamMother->Z_values[nseg],
     489              fOrigParamMother->Rmin[nseg],
     490              fOrigParamMother->Z_values[nseg+1],
     491              fOrigParamMother->Rmin[nseg+1]);
     492
     493                                           
     494//------------------------------------------------------------------------
     495G4double G4ParameterisationPolyhedraZ::GetRmax(G4double z, G4int nseg) const
     496{
     497// Get Rmax in the given z position for the given polyhedra segment
     498
     499  return GetR(z,
     500              fOrigParamMother->Z_values[nseg],
     501              fOrigParamMother->Rmax[nseg],
     502              fOrigParamMother->Z_values[nseg+1],
     503              fOrigParamMother->Rmax[nseg+1]);
     504
     505                                           
     506//------------------------------------------------------------------------
    473507G4double G4ParameterisationPolyhedraZ::GetMaxParameter() const
    474508{
    475   G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
    476   G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
    477   return std::abs (origparamMother->Z_values[origparamMother->Num_z_planes-1]
    478              -origparamMother->Z_values[0]);
     509  return std::abs (fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
     510             -fOrigParamMother->Z_values[0]);
    479511}
    480512
     
    484516  G4VDivisionParameterisation::CheckParametersValidity();
    485517
    486   G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
    487 
    488   if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
    489   {
    490     G4cerr << "WARNING - "
    491            << "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
    492            << G4endl
    493            << "          Solid " << msol->GetName() << G4endl
    494            << "          Division along Z will be done splitting "
    495            << "in the defined z_planes." << G4endl
    496            << "          WIDTH will not be used !" << G4endl;
    497   }
    498 
    499   if( foffset != 0. )
    500   {
    501     G4cerr << "WARNING - "
    502            << "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
    503            << G4endl
    504            << "          Solid " << msol->GetName() << G4endl
    505            << "          Division along Z will be done splitting "
    506            << "in the defined z_planes." << G4endl
    507            << "          OFFSET will not be used !" << G4endl;
    508   }
    509 
    510   G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
    511 
    512   if( origparamMother->Num_z_planes-1 != fnDiv )
    513   {
    514     G4cerr << "ERROR - "
    515            << "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
    516            << G4endl
    517            << "        Division along Z will be done splitting in the defined"
    518            << G4endl
    519            << "        z_planes, i.e, the number of division would be :"
    520            << "        " << origparamMother->Num_z_planes-1
    521            << " instead of " << fnDiv << " !"
    522            << G4endl;
    523     G4Exception("G4ParameterisationPolyhedraZ::CheckParametersValidity()",
    524                 "IllegalConstruct", FatalException,
    525                 "Not supported configuration.");
    526   }
     518  // Division will be following the mother polyhedra segments
     519  if( fDivisionType == DivNDIV ) {
     520    if( fOrigParamMother->Num_z_planes-1 != fnDiv ) {
     521      G4cerr << "ERROR - "
     522             << "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
     523             << G4endl
     524             << "        Division along Z will be done splitting in the defined"
     525             << G4endl
     526             << "        z_planes, i.e, the number of division would be :"
     527             << "        " << fOrigParamMother->Num_z_planes-1
     528             << " instead of " << fnDiv << " !"
     529             << G4endl;
     530      G4Exception("G4ParameterisationPolyhedraZ::CheckParametersValidity()",
     531                  "IllegalConstruct", FatalException,
     532                  "Not supported configuration.");
     533    }
     534  } 
     535
     536  // Division will be done within one polyhedra segment
     537  // with applying given width and offset
     538  if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH ) {
     539    // Check if divided region does not span over more
     540    // than one z segment
     541
     542    G4int isegstart = -1;  // number of the segment containing start position
     543    G4int isegend = -1;    // number of the segment containing end position
     544
     545    if ( ! fReflectedSolid ) {
     546      // The start/end position of the divided region
     547      G4double zstart
     548        = fOrigParamMother->Z_values[0] + foffset;
     549      G4double zend
     550        = fOrigParamMother->Z_values[0] + foffset + fnDiv* fwidth;
     551   
     552      G4int counter = 0;
     553      while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 ) {
     554        // first segment
     555        if ( zstart >= fOrigParamMother->Z_values[counter]  &&
     556             zstart  < fOrigParamMother->Z_values[counter+1] ) {
     557           isegstart = counter;
     558        }     
     559        // last segment
     560        if ( zend  > fOrigParamMother->Z_values[counter] &&
     561             zend <= fOrigParamMother->Z_values[counter+1] ) {
     562           isegend = counter;
     563        }   
     564        ++counter;   
     565      }
     566    }
     567    else  {
     568      // The start/end position of the divided region
     569      G4double zstart
     570        = fOrigParamMother->Z_values[0] - foffset;
     571      G4double zend
     572        = fOrigParamMother->Z_values[0] - ( foffset + fnDiv* fwidth);
     573   
     574      G4int counter = 0;
     575      while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 ) {
     576        // first segment
     577        if ( zstart <= fOrigParamMother->Z_values[counter]  &&
     578             zstart  > fOrigParamMother->Z_values[counter+1] ) {
     579           isegstart = counter;
     580        }     
     581        // last segment
     582        if ( zend  < fOrigParamMother->Z_values[counter] &&
     583             zend >= fOrigParamMother->Z_values[counter+1] ) {
     584           isegend = counter;
     585        }   
     586        ++counter;   
     587      }
     588    }
     589 
     590    if ( isegstart != isegend ) {
     591      G4cerr << "WARNING - "
     592             << "G4ParameterisationPolyhedraZ::CheckParametersValidity()"
     593             << G4endl
     594             << "          Division with user defined width." << G4endl
     595             << "          Solid " << fmotherSolid->GetName() << G4endl
     596             << "          Divided region is not between two z planes."
     597             << G4endl;
     598 
     599      G4Exception("G4ParameterisationPolyhedraZ::CheckParametersValidity()",
     600                  "IllegalConstruct", FatalException,
     601                  "Not supported configuration.");
     602    }
     603 
     604    fNSegment = isegstart;
     605  } 
    527606}
    528607
     
    532611ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol) const
    533612{
    534   G4Polyhedra* msol = (G4Polyhedra*)(GetMotherSolid());
    535 
    536   //----- set translation: along Z axis
    537   G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
    538   G4double posi = (origparamMother->Z_values[copyNo]
    539                    + origparamMother->Z_values[copyNo+1])/2;
    540   G4ThreeVector origin(0.,0.,posi);
    541   physVol->SetTranslation( origin );
     613  if ( fDivisionType == DivNDIV ) {
     614    // The position of the centre of copyNo-th mother polycone segment
     615    G4double posi = ( fOrigParamMother->Z_values[copyNo]
     616                    + fOrigParamMother->Z_values[copyNo+1])/2;
     617    physVol->SetTranslation( G4ThreeVector(0, 0, posi) );
     618  }
     619 
     620  if ( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH ) {
     621    // The position of the centre of copyNo-th division
     622
     623    G4double posi = fOrigParamMother->Z_values[0];
     624   
     625    if ( ! fReflectedSolid )
     626      posi += foffset + (2*copyNo + 1) * fwidth/2.;
     627    else
     628      posi -= foffset + (2*copyNo + 1) * fwidth/2.;
     629   
     630    physVol->SetTranslation( G4ThreeVector(0, 0, posi) );
     631  }   
    542632
    543633  //----- calculate rotation matrix: unit
     
    571661                   const G4VPhysicalVolume* ) const
    572662{
    573   // only for mother number of planes = 2!!
    574   //
    575   G4Polyhedra* msol = (G4Polyhedra*)(fmotherSolid);
    576 
    577   G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
    578   G4PolyhedraHistorical origparam( *origparamMother );
    579 
    580   G4double posi = (origparamMother->Z_values[copyNo]
    581                    + origparamMother->Z_values[copyNo+1])/2;
    582 
    583   origparam.Num_z_planes = 2;
    584   origparam.Z_values[0] = origparamMother->Z_values[copyNo] - posi;
    585   origparam.Z_values[1] = origparamMother->Z_values[copyNo+1] - posi;
    586   origparam.Rmin[0] = origparamMother->Rmin[copyNo];
    587   origparam.Rmin[1] = origparamMother->Rmin[copyNo+1];
    588   origparam.Rmax[0] = origparamMother->Rmax[copyNo];
    589   origparam.Rmax[1] = origparamMother->Rmax[copyNo+1];
     663  // Define division solid
     664  G4PolyhedraHistorical origparam;
     665  G4int nz = 2;
     666  origparam.Num_z_planes = nz;
     667  origparam.numSide = fOrigParamMother->numSide;
     668  origparam.Start_angle = fOrigParamMother->Start_angle;
     669  origparam.Opening_angle = fOrigParamMother->Opening_angle;
     670
     671  // Define division solid z sections
     672  origparam.Z_values = new G4double[nz];
     673  origparam.Rmin = new G4double[nz];
     674  origparam.Rmax = new G4double[nz];
     675  origparam.Z_values[0] = - fwidth/2.;
     676  origparam.Z_values[1] = fwidth/2.;
     677
     678  if ( fDivisionType == DivNDIV ) {
     679    // The position of the centre of copyNo-th mother polycone segment
     680    G4double posi = ( fOrigParamMother->Z_values[copyNo]
     681                    + fOrigParamMother->Z_values[copyNo+1])/2;
     682
     683    origparam.Z_values[0] = fOrigParamMother->Z_values[copyNo] - posi;
     684    origparam.Z_values[1] = fOrigParamMother->Z_values[copyNo+1] - posi;
     685    origparam.Rmin[0] = fOrigParamMother->Rmin[copyNo];
     686    origparam.Rmin[1] = fOrigParamMother->Rmin[copyNo+1];
     687    origparam.Rmax[0] = fOrigParamMother->Rmax[copyNo];
     688    origparam.Rmax[1] = fOrigParamMother->Rmax[copyNo+1];
     689  } 
     690
     691  if ( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH ) {
     692    if ( ! fReflectedSolid ) {
     693      origparam.Z_values[0] = - fwidth/2.;
     694      origparam.Z_values[1] = fwidth/2.;
     695
     696      // The position of the centre of copyNo-th division
     697      G4double posi
     698        = fOrigParamMother->Z_values[0] + foffset + (2*copyNo + 1) * fwidth/2.;
     699   
     700      // The first and last z sides z values
     701      G4double zstart = posi - fwidth/2.;
     702      G4double zend = posi + fwidth/2.;
     703      origparam.Rmin[0] = GetRmin(zstart, fNSegment);
     704      origparam.Rmax[0] = GetRmax(zstart, fNSegment); 
     705      origparam.Rmin[1] = GetRmin(zend, fNSegment);
     706      origparam.Rmax[1] = GetRmax(zend, fNSegment);
     707    }
     708    else {   
     709      origparam.Z_values[0] = fwidth/2.;
     710      origparam.Z_values[1] = - fwidth/2.;
     711
     712      // The position of the centre of copyNo-th division
     713      G4double posi
     714        = fOrigParamMother->Z_values[0] - ( foffset + (2*copyNo + 1) * fwidth/2.);
     715   
     716      // The first and last z sides z values
     717      G4double zstart = posi + fwidth/2.;
     718      G4double zend = posi - fwidth/2.;
     719      origparam.Rmin[0] = GetRmin(zstart, fNSegment);
     720      origparam.Rmax[0] = GetRmax(zstart, fNSegment); 
     721      origparam.Rmin[1] = GetRmin(zend, fNSegment);
     722      origparam.Rmax[1] = GetRmax(zend, fNSegment);
     723    }
     724
     725    // It can happen due to rounding errors
     726    if ( origparam.Rmin[0]    < 0.0 ) origparam.Rmin[0] = 0.0;
     727    if ( origparam.Rmin[nz-1] < 0.0 ) origparam.Rmin[1] = 0.0;
     728  } 
    590729
    591730  phedra.SetOriginalParameters(&origparam);  // copy values & transfer pointers
  • trunk/source/geometry/divisions/src/G4ParameterisationTrd.cc

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationTrd.cc,v 1.16 2008/12/18 12:57:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4ParameterisationTrd Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationTubs.cc

    r1010 r1228  
    2626//
    2727// $Id: G4ParameterisationTubs.cc,v 1.8 2006/06/29 18:18:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4ParameterisationTubs Implementation file
  • trunk/source/geometry/divisions/src/G4VDivisionParameterisation.cc

    r1010 r1228  
    2626//
    2727// $Id: G4VDivisionParameterisation.cc,v 1.14 2008/12/03 16:41:15 arce Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VDivisionParameterisation Implementation file
  • trunk/source/geometry/magneticfield/include/G4CashKarpRKF45.hh

    r921 r1228  
    2626//
    2727// $Id: G4CashKarpRKF45.hh,v 1.11 2008/01/11 15:23:54 japost Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ChordFinder.hh

    r921 r1228  
    2626//
    2727// $Id: G4ChordFinder.hh,v 1.21 2008/10/29 14:17:42 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ChordFinder.icc

    r921 r1228  
    2626//
    2727// $Id: G4ChordFinder.icc,v 1.14 2008/10/29 14:34:35 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// G4ChordFinder inline implementations
  • trunk/source/geometry/magneticfield/include/G4ChordFinderSaf.hh

    r921 r1228  
    2525//
    2626// $Id: G4ChordFinderSaf.hh,v 1.4 2008/09/12 16:12:18 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929//
  • trunk/source/geometry/magneticfield/include/G4ClassicalRK4.hh

    r921 r1228  
    2626//
    2727// $Id: G4ClassicalRK4.hh,v 1.10 2006/06/29 18:21:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ConstRK4.hh

    r1059 r1228  
    2626//
    2727// $Id: G4ConstRK4.hh,v 1.2 2008/10/29 14:17:42 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4DELPHIMagField.hh

    r921 r1228  
    2626//
    2727// $Id: G4DELPHIMagField.hh,v 1.4 2006/06/29 18:21:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ElectricField.hh

    r921 r1228  
    2626//
    2727// $Id: G4ElectricField.hh,v 1.2 2006/06/29 18:21:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ElectroMagneticField.hh

    r921 r1228  
    2626//
    2727// $Id: G4ElectroMagneticField.hh,v 1.11 2006/06/29 18:22:01 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4EqEMFieldWithSpin.hh

    r921 r1228  
    2626//
    2727// $Id: G4EqEMFieldWithSpin.hh,v 1.3 2008/11/14 13:37:09 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4EqMagElectricField.hh

    r921 r1228  
    2626//
    2727// $Id: G4EqMagElectricField.hh,v 1.9 2006/06/29 18:22:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4EquationOfMotion.hh

    r921 r1228  
    2626//
    2727// $Id: G4EquationOfMotion.hh,v 1.10 2006/06/29 18:22:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4EquationOfMotion.icc

    r921 r1228  
    2626//
    2727// $Id: G4EquationOfMotion.icc,v 1.9 2006/06/29 18:22:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ErrorMag_UsualEqRhs.hh

    r921 r1228  
    2626//
    2727// $Id: G4ErrorMag_UsualEqRhs.hh,v 1.1 2007/05/16 12:54:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ExactHelixStepper.hh

    r921 r1228  
    2525//
    2626// $Id: G4ExactHelixStepper.hh,v 1.5 2007/05/18 12:50:31 tnikitin Exp $
    27 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929//
  • trunk/source/geometry/magneticfield/include/G4ExplicitEuler.hh

    r921 r1228  
    2626//
    2727// $Id: G4ExplicitEuler.hh,v 1.9 2006/06/29 18:22:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4Field.hh

    r921 r1228  
    2626//
    2727// $Id: G4Field.hh,v 1.10 2006/06/29 18:22:13 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4FieldManager.hh

    r921 r1228  
    2626//
    2727// $Id: G4FieldManager.hh,v 1.16 2006/06/29 18:22:15 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// 
  • trunk/source/geometry/magneticfield/include/G4FieldManager.icc

    r921 r1228  
    2626//
    2727// $Id: G4FieldManager.icc,v 1.12 2006/06/29 18:22:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4FieldManagerStore.hh

    r921 r1228  
    2626//
    2727// $Id: G4FieldManagerStore.hh,v 1.3 2008/01/17 09:39:08 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4FieldManagerStore
  • trunk/source/geometry/magneticfield/include/G4FieldTrack.hh

    r921 r1228  
    2626//
    2727// $Id: G4FieldTrack.hh,v 1.21 2006/11/13 18:24:35 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4FieldTrack.icc

    r921 r1228  
    2626//
    2727// $Id: G4FieldTrack.icc,v 1.21 2006/11/13 18:24:35 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// -------------------------------------------------------------------
  • trunk/source/geometry/magneticfield/include/G4HarmonicPolMagField.hh

    r921 r1228  
    2626//
    2727// $Id: G4HarmonicPolMagField.hh,v 1.4 2006/06/29 18:22:24 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4HarmonicPolMagField
  • trunk/source/geometry/magneticfield/include/G4HelixExplicitEuler.hh

    r921 r1228  
    2626//
    2727// $Id: G4HelixExplicitEuler.hh,v 1.9 2007/08/21 08:52:00 tnikitin Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4HelixHeum.hh

    r921 r1228  
    2626//
    2727// $Id: G4HelixHeum.hh,v 1.8 2006/06/29 18:22:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4HelixImplicitEuler.hh

    r921 r1228  
    2626//
    2727// $Id: G4HelixImplicitEuler.hh,v 1.8 2006/06/29 18:22:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4HelixSimpleRunge.hh

    r921 r1228  
    2626//
    2727// $Id: G4HelixSimpleRunge.hh,v 1.7 2006/06/29 18:22:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4ImplicitEuler.hh

    r921 r1228  
    2626//
    2727// $Id: G4ImplicitEuler.hh,v 1.8 2006/06/29 18:22:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4LineCurrentMagField.hh

    r921 r1228  
    2626//
    2727// $Id: G4LineCurrentMagField.hh,v 1.4 2006/06/29 18:22:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4LineSection.hh

    r921 r1228  
    2626//
    2727// $Id: G4LineSection.hh,v 1.9 2006/06/29 18:22:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4MagErrorStepper.hh

    r921 r1228  
    2626//
    2727// $Id: G4MagErrorStepper.hh,v 1.11 2006/06/29 18:22:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4MagErrorStepper.icc

    r921 r1228  
    2626//
    2727// $Id: G4MagErrorStepper.icc,v 1.13 2006/06/29 18:22:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/magneticfield/include/G4MagHelicalStepper.hh

    r921 r1228  
    2727//
    2828// $Id: G4MagHelicalStepper.hh,v 1.15 2007/08/21 08:48:28 tnikitin Exp $
    29 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131//
  • trunk/source/geometry/magneticfield/include/G4MagHelicalStepper.icc

    r921 r1228  
    2626//
    2727// $Id: G4MagHelicalStepper.icc,v 1.13 2007/05/18 15:45:15 tnikitin Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Linear Step in regions of no field
  • trunk/source/geometry/magneticfield/include/G4MagIntegratorDriver.hh

    r921 r1228  
    2626//
    2727// $Id: G4MagIntegratorDriver.hh,v 1.20 2007/05/10 10:10:05 japost Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4MagIntegratorDriver.icc

    r921 r1228  
    2626//
    2727// $Id: G4MagIntegratorDriver.icc,v 1.13 2007/05/10 10:10:48 japost Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/magneticfield/include/G4MagIntegratorStepper.hh

    r921 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MagIntegratorStepper.hh,v 1.12 2006/09/20 09:31:01 japost Exp $
    27 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     26// $Id: G4MagIntegratorStepper.hh,v 1.14 2009/11/05 18:31:15 japost Exp $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929//
     
    7575       // over the segment last integrated.
    7676
     77     virtual void ComputeRightHandSide( const G4double y[], G4double dydx[] );
     78       // Must compute the RightHandSide as in the method below
     79       // Optionally can cache the input y[] and the dydx[] values computed.
     80
    7781     inline void NormaliseTangentVector( G4double vec[6] );
    7882       // Simple utility function to (re)normalise 'unit velocity' vector.
     83
     84     inline void NormalisePolarizationVector( G4double vec[12] );
     85       // Simple utility function to (re)normalise 'unit spin' vector.
    7986
    8087     inline void RightHandSide( const double y[], double dydx[] );   
    8188       // Utility method to supply the standard Evaluation of the
    8289       // Right Hand side of the associated equation.
     90
    8391
    8492     inline G4int  GetNumberOfVariables() const;
  • trunk/source/geometry/magneticfield/include/G4MagIntegratorStepper.icc

    r921 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MagIntegratorStepper.icc,v 1.10 2006/09/20 09:31:46 japost Exp $
    27 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     26// $Id: G4MagIntegratorStepper.icc,v 1.12 2009/03/25 15:29:02 gcosmo Exp $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929
     
    3737 G4MagIntegratorStepper::SetEquationOfMotion(G4EquationOfMotion* newEquation)
    3838{
    39   if( newEquation != 0 ) {
     39  if( newEquation != 0 )
     40  {
    4041    fEquation_Rhs= newEquation;
    4142  }
     
    5556}
    5657
    57 // inline
    58 // void G4MagIntegratorStepper::SetNumberOfVariables(G4int newNo)
    59 // {
    60 //   fNumberOfVariables = newNo;
    61 // }
    62 
    6358inline
    6459void G4MagIntegratorStepper::RightHandSide( const  double y[], double dydx[] )   
     
    7065void G4MagIntegratorStepper::NormaliseTangentVector( G4double vec[6] )
    7166{
    72    double drds2 = vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5];
     67  G4double drds2 = vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5];
    7368
    74    if( std::fabs(drds2 - 1.0) > 1.e-14 ){
    75       double normx = 1.0 / std::sqrt(drds2);
    76       for(int i=0;i<3;i++)
    77          vec[i+3] *= normx;   
    78    }
     69  if( std::fabs(drds2 - 1.0) > 1.e-14 )
     70  {
     71    G4double normx = 1.0 / std::sqrt(drds2);
     72    for(G4int i=3;i<6;i++) { vec[i] *= normx; }
     73  }
    7974}
     75
     76inline
     77void G4MagIntegratorStepper::NormalisePolarizationVector( G4double vec[12] )
     78{
     79  G4double drds2 = vec[9]*vec[9]+vec[10]*vec[10]+vec[11]*vec[11];
     80
     81  if( drds2 > 0. )
     82  {
     83    if( std::fabs(drds2 - 1.0) > 1.e-14 )
     84    {
     85      G4double normx = 1.0 / std::sqrt(drds2);
     86      for(G4int i=9;i<12;i++)  { vec[i] *= normx; }
     87    }
     88  }
     89}
  • trunk/source/geometry/magneticfield/include/G4Mag_EqRhs.hh

    r921 r1228  
    2626//
    2727// $Id: G4Mag_EqRhs.hh,v 1.9 2006/06/29 18:23:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4Mag_SpinEqRhs.hh

    r921 r1228  
    2626//
    2727// $Id: G4Mag_SpinEqRhs.hh,v 1.11 2006/06/29 18:23:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4Mag_UsualEqRhs.hh

    r921 r1228  
    2626//
    2727// $Id: G4Mag_UsualEqRhs.hh,v 1.7 2006/06/29 18:23:12 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4MagneticField.hh

    r921 r1228  
    2626//
    2727// $Id: G4MagneticField.hh,v 1.14 2006/06/29 18:23:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4QuadrupoleMagField.hh

    r921 r1228  
    2626//
    2727// $Id: G4QuadrupoleMagField.hh,v 1.4 2006/06/29 18:23:16 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4RKG3_Stepper.hh

    r921 r1228  
    2727//
    2828// $Id: G4RKG3_Stepper.hh,v 1.13 2007/05/18 12:44:02 tnikitin Exp $
    29 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131//
  • trunk/source/geometry/magneticfield/include/G4SimpleHeum.hh

    r921 r1228  
    2626//
    2727// $Id: G4SimpleHeum.hh,v 1.8 2006/06/29 18:23:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4SimpleRunge.hh

    r921 r1228  
    2626//
    2727// $Id: G4SimpleRunge.hh,v 1.8 2006/06/29 18:23:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4UniformElectricField.hh

    r921 r1228  
    2626//
    2727// $Id: G4UniformElectricField.hh,v 1.9 2006/06/29 18:23:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/magneticfield/include/G4UniformMagField.hh

    r921 r1228  
    2626//
    2727// $Id: G4UniformMagField.hh,v 1.9 2006/06/29 18:23:27 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/History

    r921 r1228  
    1 $Id: History,v 1.131 2008/09/23 13:10:55 gcosmo Exp $
     1$Id: History,v 1.138 2009/11/27 16:34:53 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     20November 27, 2009  G.Cosmo                 geommng-V09-02-05
     21- G4Region: added pointer to field-manager and associated accessor/modifier.
     22
     23November 6, 2009  G.Cosmo                  geommng-V09-02-04
     24- G4VTouchable: moved inline vitual methods, constructor and destructor to
     25  source, to avoid problem of memory alignment in allocation of derived objects.
     26
     27October 30, 2009  G.Cosmo                  geommng-V09-02-03
     28- Clear possible excess capacity in node vectors in G4SmartVoxelHeader
     29  BuildNodes() method. May reduce excess memory allocated in optimisation
     30  in large detector setups, with slight time increase in initialisation for
     31  geometry voxelisation.
     32
     33September 24, 2009  G.Cosmo                geommng-V09-02-02
     34- Fixed implementation of G4LogicalVolume::TotalVolumeEntities() to become
     35  invariant to call sequence.
     36
     37May 25, 2009  G.Cosmo                      geommng-V09-02-01
     38- Fixed initialisation of min/max extent in method BuildReplicaVoxels() in
     39  G4SmartVoxelHeader.
     40
     41April 16, 2009  G.Cosmo                    geommng-V09-02-00
     42- Adopt 'const' references for strings as arguments/return-values in
     43  G4LogicalSurface. Some minor cleanup...
    1944
    2045September 23, 2008  G. Cosmo               geommng-V09-01-08
  • trunk/source/geometry/management/include/G4AffineTransform.hh

    r1058 r1228  
    2626//
    2727// $Id: G4AffineTransform.hh,v 1.6 2006/06/29 18:30:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4AffineTransform.icc

    r1058 r1228  
    2626//
    2727// $Id: G4AffineTransform.icc,v 1.8 2006/06/29 18:30:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4BlockingList.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BlockingList.hh,v 1.4 2006/06/29 18:30:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4BlockingList
  • trunk/source/geometry/management/include/G4BlockingList.icc

    r1058 r1228  
    2626//
    2727// $Id: G4BlockingList.icc,v 1.3 2006/06/29 18:30:43 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4ErrorCylSurfaceTarget.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorCylSurfaceTarget.hh,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4ErrorPlaneSurfaceTarget.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorPlaneSurfaceTarget.hh,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4ErrorSurfaceTarget.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorSurfaceTarget.hh,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4ErrorTanPlaneTarget.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorTanPlaneTarget.hh,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4ErrorTarget.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorTarget.hh,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4GeometryManager.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryManager.hh,v 1.12 2007/05/11 13:30:12 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4GeometryManager
  • trunk/source/geometry/management/include/G4IdentityTrajectoryFilter.hh

    r1058 r1228  
    2626//
    2727// $Id: G4IdentityTrajectoryFilter.hh,v 1.3 2006/06/29 18:30:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4LogicalSurface.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4LogicalSurface.hh,v 1.10 2006/06/29 18:30:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4LogicalSurface.hh,v 1.11 2009/04/21 15:18:15 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
     
    8686   void     SetSurfaceProperty(G4SurfaceProperty* ptrSurfaceProperty);
    8787
    88    G4String GetName() const;
     88   const G4String& GetName() const;
    8989   void     SetName(const G4String& name);
    9090
    9191   G4TransitionRadiationSurface*  GetTransitionRadiationSurface() const;
    92    void SetTransitionRadiationSurface(G4TransitionRadiationSurface* transRadSurf);
     92   void SetTransitionRadiationSurface(G4TransitionRadiationSurface* tRadSurf);
     93
     94 public:  // without description
     95
     96   virtual ~G4LogicalSurface();
     97
     98   G4int operator==(const G4LogicalSurface &right) const;
     99   G4int operator!=(const G4LogicalSurface &right) const;
    93100
    94101 protected:
    95102
    96         // There should be no instances of this class
     103   // There should be no instances of this class
    97104
    98    G4LogicalSurface(const G4String&         name,
    99                     G4SurfaceProperty* surfaceProperty);
    100         // Is the name more meaningful for the properties or the logical
    101         // surface ? 
    102 
    103  public:
    104    virtual ~G4LogicalSurface();
    105 
    106  public:
    107    G4int operator==(const G4LogicalSurface &right) const;
    108    G4int operator!=(const G4LogicalSurface &right) const;
     105   G4LogicalSurface(const G4String& name, G4SurfaceProperty* surfaceProperty);
     106     // Is the name more meaningful for the properties or the logical surface ?
    109107
    110108 private:
     
    117115   G4String theName;              // Surface name
    118116
    119    G4SurfaceProperty*              theSurfaceProperty;
     117   G4SurfaceProperty*             theSurfaceProperty;
    120118   G4TransitionRadiationSurface*  theTransRadSurface;
    121119};
  • trunk/source/geometry/management/include/G4LogicalSurface.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4LogicalSurface.icc,v 1.9 2006/06/29 18:30:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4LogicalSurface.icc,v 1.10 2009/04/21 15:18:15 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
     
    5151}
    5252
    53 inline G4String
     53inline const G4String&
    5454G4LogicalSurface::GetName() const
    5555{
     
    110110inline G4LogicalSurface::G4LogicalSurface(const G4String&         name,
    111111                                         G4SurfaceProperty* surfaceProperty)
    112                 : theName(name),
    113                   theSurfaceProperty(surfaceProperty)
     112  : theName(name), theSurfaceProperty(surfaceProperty)
    114113{
    115114}
  • trunk/source/geometry/management/include/G4LogicalVolume.hh

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalVolume.hh,v 1.27 2008/07/10 09:40:08 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4LogicalVolume.icc

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalVolume.icc,v 1.25 2008/07/10 09:40:08 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4LogicalVolumeStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalVolumeStore.hh,v 1.13 2007/04/10 10:13:50 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4LogicalVolumeStore
  • trunk/source/geometry/management/include/G4PhysicalVolumeStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PhysicalVolumeStore.hh,v 1.16 2008/07/10 09:41:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4PhysicalVolume
  • trunk/source/geometry/management/include/G4ReflectedSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ReflectedSolid.hh,v 1.5 2006/06/29 18:31:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4Region.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Region.hh,v 1.20 2008/07/10 09:46:01 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Region.hh,v 1.21 2009/11/27 16:34:37 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4Region
     
    4848class G4MaterialCutsCouple;
    4949class G4UserLimits;
     50class G4FieldManager;
    5051class G4FastSimulationManager;
    5152class G4VPhysicalVolume;
     
    144145      // if it exists. Otherwise set to null.
    145146
     147    inline void SetFieldManager(G4FieldManager* fm);
     148    inline G4FieldManager* GetFieldManager() const;
     149      // Set and Get methods for G4FieldManager.
     150      // The region with assigned field-manager sets the field to the
     151      // geometrical area associated with it; priority is anyhow given
     152      // to local fields eventually set to logical volumes.
     153
    146154    inline G4VPhysicalVolume* GetWorldPhysical() const;
    147155      // Get method for the world physical volume which this region
     
    199207    G4VUserRegionInformation* fUserInfo;
    200208    G4UserLimits* fUserLimits;
     209    G4FieldManager* fFieldManager;
    201210
    202211    G4FastSimulationManager* fFastSimulationManager;
  • trunk/source/geometry/management/include/G4Region.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Region.icc,v 1.15 2007/04/28 01:48:29 asaim Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Region.icc,v 1.16 2009/11/27 16:34:37 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    247247{
    248248  return fFastSimulationManager;
     249}
     250
     251// ********************************************************************
     252// GetFieldManager
     253// ********************************************************************
     254//
     255inline
     256G4FieldManager* G4Region::GetFieldManager() const
     257{
     258  return fFieldManager;
     259}
     260
     261// ********************************************************************
     262// SetFieldManager
     263// ********************************************************************
     264//
     265inline
     266void G4Region::SetFieldManager(G4FieldManager* fm)
     267{
     268  fFieldManager = fm;
    249269}
    250270
  • trunk/source/geometry/management/include/G4RegionStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4RegionStore.hh,v 1.10 2006/11/30 10:39:28 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4RegionStore
  • trunk/source/geometry/management/include/G4SmartVoxelHeader.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelHeader.hh,v 1.10 2006/06/29 18:32:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4SmartVoxelHeader
  • trunk/source/geometry/management/include/G4SmartVoxelHeader.icc

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelHeader.icc,v 1.6 2006/06/29 18:32:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4SmartVoxelNode.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelNode.hh,v 1.12 2008/01/24 15:47:23 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4SmartVoxelNode
  • trunk/source/geometry/management/include/G4SmartVoxelNode.icc

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelNode.icc,v 1.7 2008/01/24 15:47:23 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4SmartVoxelProxy.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelProxy.hh,v 1.8 2006/06/29 18:32:17 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4SmartVoxelProxy
  • trunk/source/geometry/management/include/G4SmartVoxelProxy.icc

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelProxy.icc,v 1.4 2006/06/29 18:32:19 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4SmartVoxelStat.hh

    r1058 r1228  
    2525//
    2626// $Id: G4SmartVoxelStat.hh,v 1.4 2006/06/29 18:32:21 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// --------------------------------------------------------------------
  • trunk/source/geometry/management/include/G4SolidStore.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SolidStore.hh,v 1.13 2007/04/10 10:13:50 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4SolidStore
  • trunk/source/geometry/management/include/G4TouchableHandle.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TouchableHandle.hh,v 1.6 2006/06/29 18:32:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Class G4TouchableHandle
  • trunk/source/geometry/management/include/G4VCurvedTrajectoryFilter.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VCurvedTrajectoryFilter.hh,v 1.3 2006/06/29 18:32:27 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VNestedParameterisation.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VNestedParameterisation.hh,v 1.6 2006/06/29 18:32:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VNestedParameterisation
  • trunk/source/geometry/management/include/G4VPVDivisionFactory.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VPVDivisionFactory.hh,v 1.2 2006/06/29 18:32:31 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VPVParameterisation.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VPVParameterisation.hh,v 1.13 2007/07/16 08:40:13 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VPVParamterisation
  • trunk/source/geometry/management/include/G4VPhysicalVolume.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VPhysicalVolume.hh,v 1.17 2007/04/11 08:00:12 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VPhysicalVolume.icc

    r1058 r1228  
    2626//
    2727// $Id: G4VPhysicalVolume.icc,v 1.10 2006/06/29 18:32:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VSolid.hh,v 1.29 2008/09/10 13:18:42 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VSolid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4VSolid.icc,v 1.9 2007/05/11 13:30:12 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VStoreNotifier.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VStoreNotifier.hh,v 1.3 2006/06/29 18:33:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VStoreNotifier
  • trunk/source/geometry/management/include/G4VTouchable.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VTouchable.hh,v 1.9 2006/06/29 18:33:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VTouchable.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4VTouchable.icc,v 1.9 2006/06/29 18:33:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4VTouchable.icc,v 1.10 2009/11/06 10:36:00 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    3434
    3535inline
    36 G4VTouchable::G4VTouchable()
    37 {
    38 }
    39 
    40 inline
    41 G4VTouchable::~G4VTouchable()
    42 {
    43 }
    44 
    45 inline
    46 G4VPhysicalVolume* G4VTouchable::GetVolume(G4int) const
    47 {
    48   G4Exception("G4VTouchable::GetVolume()", "NotApplicable",
    49               FatalException, "Undefined call to base class.");
    50   return 0;
    51 }
    52 
    53 inline
    54 G4VSolid* G4VTouchable::GetSolid(G4int) const
    55 {
    56   G4Exception("G4VTouchable::GetSolid()", "NotApplicable",
    57               FatalException, "Undefined call to base class.");
    58   return 0;
    59 }
    60 
    61 inline
    62 G4int G4VTouchable::GetReplicaNumber(G4int) const
    63 {
    64   G4Exception("G4VTouchable::GetReplicaNumber()", "NotApplicable",
    65               FatalException, "Undefined call to base class.");
    66   return 0;
    67 }
    68 
    69 inline
    7036G4int G4VTouchable::GetCopyNumber(G4int depth) const
    7137{
    7238  return GetReplicaNumber(depth);
    7339}
    74 
    75 inline
    76 G4int G4VTouchable::MoveUpHistory(G4int)
    77 {
    78   G4Exception("G4VTouchable::MoveUpHistory()", "NotApplicable",
    79               FatalException, "Undefined call to base class.");
    80   return 0;
    81 }
    82 
    83 inline
    84 void G4VTouchable::UpdateYourself(G4VPhysicalVolume*,
    85                                   const G4NavigationHistory* )
    86 {
    87   G4Exception("G4VTouchable::UpdateYourself()", "NotApplicable",
    88               FatalException, "Undefined call to base class.");
    89 }
    90 
    91 inline
    92 G4int G4VTouchable::GetHistoryDepth() const
    93 {
    94   G4Exception("G4VTouchable::GetHistoryDepth()", "NotApplicable",
    95               FatalException, "Undefined call to base class.");
    96   return  0;
    97 }
    98 
    99 inline
    100 const G4NavigationHistory* G4VTouchable::GetHistory() const
    101 {
    102   G4Exception("G4VTouchable::GetHistory()", "NotApplicable",
    103               FatalException, "Undefined call to base class.");
    104   return 0;
    105 }
  • trunk/source/geometry/management/include/G4VUserRegionInformation.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VUserRegionInformation.hh,v 1.4 2006/06/29 18:33:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/G4VVolumeMaterialScanner.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VVolumeMaterialScanner.hh,v 1.4 2006/06/29 18:33:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VVolumeMaterialScanner
  • trunk/source/geometry/management/include/G4VoxelLimits.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VoxelLimits.hh,v 1.9 2006/06/29 18:33:13 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VoxelLimits
  • trunk/source/geometry/management/include/G4VoxelLimits.icc

    r1058 r1228  
    2626//
    2727// $Id: G4VoxelLimits.icc,v 1.4 2006/06/29 18:33:15 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/meshdefs.hh

    r1058 r1228  
    2626//
    2727// $Id: meshdefs.hh,v 1.7 2006/06/29 18:33:17 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/include/voxeldefs.hh

    r1058 r1228  
    2626//
    2727// $Id: voxeldefs.hh,v 1.7 2006/06/29 18:33:19 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4BlockingList.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BlockingList.cc,v 1.3 2006/06/29 18:33:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4ErrorCylSurfaceTarget.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorCylSurfaceTarget.cc,v 1.4 2007/06/20 12:50:48 arce Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4ErrorPlaneSurfaceTarget.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorPlaneSurfaceTarget.cc,v 1.2 2007/06/19 11:28:39 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4ErrorSurfaceTarget.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorSurfaceTarget.cc,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4ErrorTanPlaneTarget.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorTanPlaneTarget.cc,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4ErrorTarget.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ErrorTarget.cc,v 1.1 2007/05/16 12:50:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4GeometryManager.cc

    r1058 r1228  
    2626//
    2727// $Id: G4GeometryManager.cc,v 1.22 2008/05/16 13:46:48 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4GeometryManager
  • trunk/source/geometry/management/src/G4IdentityTrajectoryFilter.cc

    r1058 r1228  
    2626//
    2727// $Id: G4IdentityTrajectoryFilter.cc,v 1.4 2006/10/02 10:09:24 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ------------------------------------------------------------------------
  • trunk/source/geometry/management/src/G4LogicalVolume.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4LogicalVolume.cc,v 1.33 2008/07/10 09:40:09 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4LogicalVolume.cc,v 1.34 2009/09/24 13:22:57 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    162162G4int G4LogicalVolume::TotalVolumeEntities() const
    163163{
    164   static G4int vols = 0;
    165 
    166   vols++;
     164  G4int vols = 1;
    167165  for (G4PhysicalVolumeList::const_iterator itDau = fDaughters.begin();
    168166       itDau != fDaughters.end(); itDau++)
    169167  {
    170168    G4VPhysicalVolume* physDaughter = (*itDau);
    171     for (G4int i=0; i<physDaughter->GetMultiplicity(); i++)
    172     {
    173       physDaughter->GetLogicalVolume()->TotalVolumeEntities();
    174     }
     169    vols += physDaughter->GetMultiplicity()
     170           *physDaughter->GetLogicalVolume()->TotalVolumeEntities();
    175171  }
    176172  return vols;
  • trunk/source/geometry/management/src/G4LogicalVolumeStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalVolumeStore.cc,v 1.19 2008/07/10 09:40:09 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// G4LogicalVolumeStore
  • trunk/source/geometry/management/src/G4PhysicalVolumeStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4PhysicalVolumeStore.cc,v 1.20 2008/07/10 09:41:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// G4PhysicalVolumeStore
  • trunk/source/geometry/management/src/G4ReflectedSolid.cc

    r1058 r1228  
    2727// $Id: G4ReflectedSolid.cc,v 1.11 2006/11/08 09:56:33 gcosmo Exp $
    2828//
    29 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131// Implementation for G4ReflectedSolid class for boolean
  • trunk/source/geometry/management/src/G4Region.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Region.cc,v 1.26 2008/07/15 10:27:36 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Region.cc,v 1.27 2009/11/27 16:34:37 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    4848G4Region::G4Region(const G4String& pName)
    4949  : fName(pName), fRegionMod(true), fCut(0), fUserInfo(0), fUserLimits(0),
    50     fFastSimulationManager(0), fWorldPhys(0), fRegionalSteppingAction(0)
     50    fFieldManager(0), fFastSimulationManager(0), fWorldPhys(0),
     51    fRegionalSteppingAction(0)
    5152{
    5253  G4RegionStore* rStore = G4RegionStore::GetInstance();
     
    7273G4Region::G4Region( __void__& )
    7374  : fName(""), fRegionMod(true), fCut(0), fUserInfo(0), fUserLimits(0),
    74     fFastSimulationManager(0), fWorldPhys(0), fRegionalSteppingAction(0)
     75    fFieldManager(0), fFastSimulationManager(0), fWorldPhys(0),
     76    fRegionalSteppingAction(0)
    7577{
    7678  // Register to store
  • trunk/source/geometry/management/src/G4RegionStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4RegionStore.cc,v 1.14 2008/07/10 09:46:01 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// G4RegionStore
  • trunk/source/geometry/management/src/G4SmartVoxelHeader.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4SmartVoxelHeader.cc,v 1.31 2008/01/24 15:46:47 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4SmartVoxelHeader.cc,v 1.34 2009/10/30 14:05:47 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    366366        // Sanity check on extent
    367367        //
    368         G4double min, max;
     368        G4double emin = kInfinity, emax = -kInfinity;
    369369        G4VoxelLimits limits;
    370370        G4AffineTransform origin;
    371         pVolume->GetSolid()->CalculateExtent(axis, limits, origin, min, max);
    372         if ( (std::fabs((min-fminExtent)/fminExtent) +
    373               std::fabs((max-fmaxExtent)/fmaxExtent)) > 0.05)
     371        pVolume->GetSolid()->CalculateExtent(axis, limits, origin, emin, emax);
     372        if ( (std::fabs((emin-fminExtent)/fminExtent) +
     373              std::fabs((emax-fmaxExtent)/fmaxExtent)) > 0.05)
    374374        {
    375375          G4cerr << "ERROR - G4SmartVoxelHeader::BuildReplicaVoxels()"
     
    10381038  for (nNode=0; nNode<noNodes; nNode++)
    10391039  {
     1040    // Get rid of possible excess capacity in the internal node vector
     1041    //
     1042    ((*nodeList)[nNode])->Shrink();
    10401043    G4SmartVoxelProxy* pProxyNode = new G4SmartVoxelProxy((*nodeList)[nNode]);
    10411044    if (!pProxyNode)
  • trunk/source/geometry/management/src/G4SmartVoxelNode.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelNode.cc,v 1.6 2006/06/29 18:33:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Class G4SmartVoxelNode
  • trunk/source/geometry/management/src/G4SmartVoxelProxy.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelProxy.cc,v 1.3 2006/06/29 18:33:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Class G4SmartVoxelProxy
  • trunk/source/geometry/management/src/G4SmartVoxelStat.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SmartVoxelStat.cc,v 1.3 2006/06/29 18:33:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/management/src/G4SolidStore.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SolidStore.cc,v 1.17 2007/04/10 10:13:50 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// G4SolidStore
  • trunk/source/geometry/management/src/G4VCurvedTrajectoryFilter.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VCurvedTrajectoryFilter.cc,v 1.3 2006/06/29 18:33:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929// --------------------------------------------------------------------
    3030
  • trunk/source/geometry/management/src/G4VNestedParameterisation.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VNestedParameterisation.cc,v 1.6 2006/06/29 18:33:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VNestedParameterisation implementation
  • trunk/source/geometry/management/src/G4VPVDivisionFactory.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VPVDivisionFactory.cc,v 1.2 2006/06/29 18:34:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VPVDivisionFactory Implementation file
  • trunk/source/geometry/management/src/G4VPVParameterisation.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VPVParameterisation.cc,v 1.8 2007/07/16 08:40:13 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Default implementations for Parameterisations that do not
  • trunk/source/geometry/management/src/G4VPhysicalVolume.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VPhysicalVolume.cc,v 1.14 2007/04/11 08:00:12 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/management/src/G4VSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VSolid.cc,v 1.39 2008/09/23 13:07:41 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VSolid
  • trunk/source/geometry/management/src/G4VoxelLimits.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VoxelLimits.cc,v 1.11 2006/06/29 18:34:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4VoxelLimits
  • trunk/source/geometry/navigation/History

    r1058 r1228  
    1 $Id: History,v 1.132 2009/05/20 08:27:26 gcosmo Exp $
     1$Id: History,v 1.138 2009/12/11 05:48:53 japost Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19Dec 11th, 2009 - J.Apostolakis (geomnav-V09-02-11)
     20------------------------------
     21- G4PropagatorInField
     22  * Implementation field by Region
     23      - with extra checking of logical volume
     24
     25Nov 30th, 2009 - J.Apostolakis (geomnav-V09-02-10)
     26------------------------------
     27- G4VIntersectionLocator
     28  * Fix problem in ReEstimateEndPoint() behaviour for very small steps.
     29
     30  * Corrected constructor to ensure that it initialises all data members.
     31  * Labelled the methods (in header) to make noticable those that
     32      must changed at every step.
     33      ( attributes: ChordFinder,  EpsilonStep,  Navigator )
     34
     35Nov 23rd, 2009 - J.Apostolakis
     36------------------------------
     37- Fixed G4PropagatorInField.cc:
     38   * Revise condition for flagging ZeroStep to avoid fake triggering.
     39     Small proposed steps (from Physics) could trigger the previous
     40     simple condition for Tiny/Zero Problem steps.
     41   [ This was first commited on branch geomnav-V09-02-08_branch
     42       and tagged geomnav-V09-02-80  ]
     43
     44Nov 12th, 2009 - J.Apostolakis (geomnav-V09-02-09)
     45------------------------------
     46- G4PropagatorInField: cleanup of minor methods:
     47   Added new method RefreshIntersectionLocator to update the state of
     48       Use this method to synchronise with IntersectionLocator.
     49   Deleted long obsolete methods: SetAccuraciesWithDeltaOneStep
     50           SetDeltaIntersection,  SetDeltaOneStep
     51   Revised implementation to avoid using the older methods
     52           GetDeltaIntersection   GetDeltaOneStep
     53
     54Nov 12th, 2009 - J.Apostolakis (geomnav-V09-02-08)
     55------------------------------
     56- Refined G4PropagatorInField.cc:
     57   * Changed parameters for treating consecutive tiny/zero steps:
     58     - the value of default decrease factor to 0.25 (from 0.1),
     59     - the value is not used when the step size falls below a certain threshold.s
     60       This threshold is changed. It is expressed as a multiple of fZeroStepThreshold
     61       instead of kCarTolerance.  The reasons are:
     62         * the threshold were meant to refer to the  ZeroStepThreshold (it was kCarTolerance)
     63         * the values were now much larger than this ZeroStepThreshold.
     64     - The value given to the decrease factor after the first such thresholds is changed to 0.35
     65       instead of 0.25, 0.5. 
     66   * Improved printing of Diagnostic message.
     67
     68Nov  3rd, 2009 - J.Apostolakis (geomnav-V09-02-07)
     69------------------------------
     70- Refined G4PropagatorInField.cc:
     71   * Added new member fZeroStepThreshold, to enable tuning of threshold for Tiny/Zero steps.
     72   * Changed default value from 0.5 * kCarTolerance
     73                          to max (100,000 * kCarTolerance, 0.1 * micron )
     74   * This is first revision to address problem seen at boundary of volumes (Reports of Atlas) .
     75
     76June 2nd, 2009 - J.Apostolakis (geomnav-V09-02-06)
     77------------------------------
     78- Fix in G4PropagatorInField::SetNavigator
     79   * Forward new Navigator to IntersectionLocator.
    1980
    2081May 20th, 2009 - P.Arce (geomnav-V09-02-05)
  • trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.hh

    r921 r1228  
    2626//
    2727// $Id: G4AuxiliaryNavServices.hh,v 1.4 2007/05/22 07:48:08 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4AuxiliaryNavServices.icc

    r921 r1228  
    2626//
    2727// $Id: G4AuxiliaryNavServices.icc,v 1.4 2007/05/22 07:48:08 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4BrentLocator.hh

    r985 r1228  
    2626//
    2727// $Id: G4BrentLocator.hh,v 1.2 2008/10/29 14:31:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Class G4BrentLocator
  • trunk/source/geometry/navigation/include/G4DrawVoxels.hh

    r1058 r1228  
    2626//
    2727// $Id: G4DrawVoxels.hh,v 1.3 2006/06/29 18:35:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4ErrorPropagationNavigator.hh

    r921 r1228  
    2626//
    2727// $Id: G4ErrorPropagationNavigator.hh,v 1.2 2008/10/24 14:00:03 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4GeomTestErrorList.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestErrorList.hh,v 1.3 2006/06/29 18:35:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestLogger.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestLogger.hh,v 1.3 2006/06/29 18:35:40 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestOverlapList.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestOverlapList.hh,v 1.3 2006/06/29 18:35:43 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestOvershootList.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestOvershootList.hh,v 1.3 2006/06/29 18:35:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestPoint.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestPoint.hh,v 1.3 2006/06/29 18:35:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestSegment.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestSegment.hh,v 1.4 2007/05/11 13:43:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestStreamLogger.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestStreamLogger.hh,v 1.3 2006/06/29 18:35:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestVolPoint.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestVolPoint.hh,v 1.3 2006/06/29 18:35:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeomTestVolume.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestVolume.hh,v 1.3 2006/06/29 18:35:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4GeometryMessenger.hh

    r921 r1228  
    2626//
    2727// $Id: G4GeometryMessenger.hh,v 1.4 2006/06/29 18:35:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4MultiLevelLocator.hh

    r985 r1228  
    2626//
    2727// $Id: G4MultiLevelLocator.hh,v 1.2 2008/10/29 14:31:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4MultiNavigator.hh

    r921 r1228  
    2626//
    2727// $Id: G4MultiNavigator.hh,v 1.5 2008/10/24 14:00:03 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4Navigator.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Navigator.hh,v 1.28 2009/01/27 09:32:14 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// $Id: G4Navigator.hh,v 1.29 2009/11/30 11:59:52 japost Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    237237    // Verify if the step has exited the mother volume.
    238238
    239   inline void  CheckMode(G4bool mode);
     239  inline void   CheckMode(G4bool mode);
    240240    // Run navigation in "check-mode", therefore using additional
    241241    // verifications and more strict correctness conditions.
    242242    // Is effective only with G4VERBOSE set.
     243  inline G4bool IsCheckModeActive() { return fCheck; }
    243244
    244245  void PrintState() const;
  • trunk/source/geometry/navigation/include/G4Navigator.icc

    r921 r1228  
    2626//
    2727// $Id: G4Navigator.icc,v 1.15 2007/10/18 14:18:36 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4NormalNavigation.hh

    r921 r1228  
    2626//
    2727// $Id: G4NormalNavigation.hh,v 1.4 2006/06/29 18:36:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4NormalNavigation.icc

    r921 r1228  
    2626//
    2727// $Id: G4NormalNavigation.icc,v 1.4 2006/06/29 18:36:08 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4ParameterisedNavigation.hh

    r921 r1228  
    2626//
    2727// $Id: G4ParameterisedNavigation.hh,v 1.6 2007/11/09 16:06:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4ParameterisedNavigation.icc

    r921 r1228  
    2626//
    2727// $Id: G4ParameterisedNavigation.icc,v 1.7 2007/11/09 16:06:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4PathFinder.hh

    r921 r1228  
    2525//
    2626// $Id: G4PathFinder.hh,v 1.34 2007/11/02 12:28:31 japost Exp $
    27 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// class G4PathFinder
  • trunk/source/geometry/navigation/include/G4PhantomParameterisation.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PhantomParameterisation.hh,v 1.5 2009/05/19 18:27:03 arce Exp $
    28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4PhantomParameterisation.icc

    r921 r1228  
    2626//
    2727// $Id: G4PhantomParameterisation.icc,v 1.1 2007/10/17 19:13:58 arce Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//--------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4PropagatorInField.hh

    r921 r1228  
    2525//
    2626//
    27 // $Id: G4PropagatorInField.hh,v 1.17 2008/11/13 14:28:56 tnikitin Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     27// $Id: G4PropagatorInField.hh,v 1.19 2009/11/13 17:34:26 japost Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    163163   inline G4VIntersectionLocator* GetIntersectionLocator();
    164164   inline void SetIntersectionLocator(G4VIntersectionLocator *pLocator );
     165     // Change or get the object which calculates the exact
     166     //  intersection point with the next boundary
    165167 
    166168 public:  // without description
     
    168170   inline G4double  GetDeltaIntersection() const;
    169171   inline G4double  GetDeltaOneStep() const;
    170    inline void    SetAccuraciesWithDeltaOneStep( G4double deltaOneStep ); 
    171    inline void    SetDeltaIntersection( G4double deltaIntersection );
    172    inline void    SetDeltaOneStep( G4double deltaOneStep ); 
    173      // The above 5 methods are obsolete and will not work, as they have been
    174      // replaced by the same methods in G4FieldManager since Geant4 4.0 ...
    175172
    176173   inline G4FieldManager*  GetCurrentFieldManager();
     
    182179                                       G4int noAbandon );
    183180   inline G4int GetThresholdNoZeroSteps( G4int i );
     181
     182   inline G4double  GetZeroStepThreshold();
     183   inline void      SetZeroStepThreshold( G4double newLength );
     184
     185   void RefreshIntersectionLocator();
     186     // Update the Locator with parameters from this class
     187     //    and from current field manager
    184188
    185189 protected:  // with description
     
    243247   G4double  kCarTolerance;
    244248     // Geometrical tolerance defining surface thickness
     249   G4double  fZeroStepThreshold;
     250     // Threshold for counting of tiny or 'zero' steps
    245251
    246252   G4VIntersectionLocator *fIntersectionLocator;
  • trunk/source/geometry/navigation/include/G4PropagatorInField.icc

    r921 r1228  
    2525//
    2626//
    27 // $Id: G4PropagatorInField.icc,v 1.13 2008/10/29 14:31:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     27// $Id: G4PropagatorInField.icc,v 1.16 2009/11/13 17:34:26 japost Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    110110}
    111111
     112// #if 0
    112113inline
    113114G4double G4PropagatorInField::GetDeltaIntersection() const
     
    121122  return fCurrentFieldMgr->GetDeltaOneStep();
    122123}
    123 
    124 inline
    125 void
    126 G4PropagatorInField::SetAccuraciesWithDeltaOneStep( G4double valDeltaOneStep )
    127 {
    128   fDetectorFieldMgr->SetAccuraciesWithDeltaOneStep(valDeltaOneStep);
    129 }
    130 
    131 inline
    132 void G4PropagatorInField::SetDeltaOneStep( G4double valDeltaOneStep )
    133 {
    134   fDetectorFieldMgr->SetDeltaOneStep(valDeltaOneStep);
    135 }
    136 
    137 inline
    138 void G4PropagatorInField::SetDeltaIntersection( G4double valDeltaIntersection )
    139 {
    140   fDetectorFieldMgr->SetDeltaIntersection(valDeltaIntersection);
    141 }
     124// #endif
    142125
    143126inline
     
    236219}
    237220
     221inline G4double  G4PropagatorInField::GetZeroStepThreshold(){ return fZeroStepThreshold; }
     222inline void      G4PropagatorInField::SetZeroStepThreshold( G4double newLength )
     223{
     224  fZeroStepThreshold= newLength;
     225}
     226
    238227inline
    239228void G4PropagatorInField::SetDetectorFieldManager(G4FieldManager* newDetectorFieldManager)
     
    259248SetNavigatorForPropagating( G4Navigator *SimpleOrMultiNavigator )
    260249{
    261   if(SimpleOrMultiNavigator)  { fNavigator= SimpleOrMultiNavigator; }
     250  if(SimpleOrMultiNavigator)  {
     251     fNavigator= SimpleOrMultiNavigator;
     252     if( fIntersectionLocator ) {
     253         fIntersectionLocator->SetNavigatorFor( SimpleOrMultiNavigator );
     254     }
     255  }
    262256}
    263257
     
    295289                          LinearStepLength,IntersectionPoint);
    296290}
     291
  • trunk/source/geometry/navigation/include/G4RegularNavigation.hh

    r921 r1228  
    2626//
    2727// $Id: G4RegularNavigation.hh,v 1.2 2007/10/18 14:18:36 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4RegularNavigationHelper.hh

    r985 r1228  
    2626//
    2727// $Id: G4RegularNavigationHelper.hh,v 1.1 2009/01/27 09:31:29 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/include/G4ReplicaNavigation.hh

    r921 r1228  
    2626//
    2727// $Id: G4ReplicaNavigation.hh,v 1.6 2007/05/18 07:31:09 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4ReplicaNavigation.icc

    r921 r1228  
    2626//
    2727// $Id: G4ReplicaNavigation.icc,v 1.5 2006/06/29 18:36:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4SafetyHelper.hh

    r921 r1228  
    2626//
    2727// $Id: G4SafetyHelper.hh,v 1.7 2007/05/02 15:32:13 japost Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4SimpleLocator.hh

    r985 r1228  
    2626//
    2727// $Id: G4SimpleLocator.hh,v 1.2 2008/10/29 14:31:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4TransportationManager.hh

    r921 r1228  
    2626//
    2727// $Id: G4TransportationManager.hh,v 1.12 2007/04/20 15:28:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4TransportationManager
  • trunk/source/geometry/navigation/include/G4TransportationManager.icc

    r921 r1228  
    2626//
    2727// $Id: G4TransportationManager.icc,v 1.10 2007/04/20 15:28:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929// ------------------------------------------------------------
    3030//  GEANT 4  inlined function members implementation
  • trunk/source/geometry/navigation/include/G4VIntersectionLocator.hh

    r985 r1228  
    2525//
    2626//
    27 // $Id: G4VIntersectionLocator.hh,v 1.4 2008/11/14 18:26:35 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     27// $Id: G4VIntersectionLocator.hh,v 1.6 2009/11/30 11:39:15 japost Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    9595       // whether an intersection occurred. NOTE: changes the Safety!
    9696
     97     inline void    SetEpsilonStepFor( G4double EpsilonStep );
     98     inline void    SetDeltaIntersectionFor( G4double deltaIntersection );
     99     inline void    SetNavigatorFor( G4Navigator *fNavigator );
     100     inline void    SetChordFinderFor(G4ChordFinder *fCFinder );
     101       // These parameters must be set at each step, in case they were changed
     102
     103       // Note: This simple approach ensures that all scenarios are considered.
     104       //   [ Future refinement may identify which are invariant during a
     105       //      track, run or event ]
     106
     107    inline void     SetVerboseFor(G4int fVerbose);
     108    inline G4int    GetVerboseFor();
     109       // Controling verbosity enables checking of the locating of intersections
     110
    97111  public:  // without description
     112    // Additional inline Set/Get methods for parameters, dependent objects
    98113
    99     // inline Set/Get methods used for IntersctionLocator
     114    inline G4double       GetDeltaIntersectionFor();
     115    inline G4double       GetEpsilonStepFor();
     116    inline G4Navigator*   GetNavigatorFor();
     117    inline G4ChordFinder* GetChordFinderFor();
    100118
    101     inline G4double  GetDeltaIntersectionFor();
    102     inline G4double  GetEpsilonStepFor();
    103     inline G4Navigator*  GetNavigatorFor();
    104     inline G4ChordFinder*  GetChordFinderFor();
    105     inline G4int  GetVerboseFor();
     119    inline void   SetSafetyParametersFor(G4bool UseSafety );
    106120
    107     inline void SetEpsilonStepFor( G4double EpsilonStep );
    108     inline void SetDeltaIntersectionFor( G4double deltaIntersection );
    109     inline void SetNavigatorFor( G4Navigator *fNavigator );
    110     inline void SetChordFinderFor(G4ChordFinder *fCFinder );
    111     inline void SetSafetyParametersFor(G4bool UseSafety );
    112     inline void SetVerboseFor(G4int fVerbose);
    113 
    114     inline void AddAdjustementOfFoundIntersection(G4bool UseCorrection);
     121    inline void   AddAdjustementOfFoundIntersection(G4bool UseCorrection);
    115122    inline G4bool GetAdjustementOfFoundIntersection();
     123      // Methods to be made Obsolete - replaced by methods below
     124    inline void   AdjustIntersections(G4bool UseCorrection);
     125    inline G4bool AreIntersectionsAdjusted(){ return fUseNormalCorrection; } 
     126      // Change adjustment flag  ( New Interface )
    116127
    117128  protected:  // with description
     
    144155  protected:
    145156
    146     G4double kCarTolerance;
    147     G4int    fVerboseLevel;
    148       // For verbose purposes
    149     G4bool   fUseNormalCorrection;
     157    G4double kCarTolerance;         // Constant
    150158
     159    G4int    fVerboseLevel;          // For debugging
     160    G4bool   fUseNormalCorrection;   // Configuration parameter
     161
     162    G4Navigator   *fiNavigator;
     163      // Parameters set by G4PropagatorInField  ( when ? )
     164
     165    G4ChordFinder *fiChordFinder;
    151166    G4double       fiEpsilonStep;
    152167    G4double       fiDeltaIntersection;
    153     G4Navigator   *fiNavigator;
    154     G4ChordFinder *fiChordFinder;
    155168    G4bool         fiUseSafety;
    156       // For passing the parameters from G4PropagatorInField
     169      // Parameters set at each physical step by calling method - G4PropagatorInField
    157170
    158171    G4Navigator *fHelpingNavigator;
  • trunk/source/geometry/navigation/include/G4VIntersectionLocator.icc

    r985 r1228  
    2626//
    2727// $Id: G4VIntersectionLocator.icc,v 1.3 2008/11/14 18:26:35 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4VoxelNavigation.hh

    r921 r1228  
    2626//
    2727// $Id: G4VoxelNavigation.hh,v 1.5 2007/05/11 13:43:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/include/G4VoxelNavigation.icc

    r921 r1228  
    2626//
    2727// $Id: G4VoxelNavigation.icc,v 1.4 2006/06/29 18:36:30 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/src/G4AuxiliaryNavServices.cc

    r921 r1228  
    2525//
    2626// $Id: G4AuxiliaryNavServices.cc,v 1.3 2006/06/29 18:36:32 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4BrentLocator.cc

    r1058 r1228  
    2525//
    2626// $Id: G4BrentLocator.cc,v 1.8 2009/05/15 12:55:48 tnikitin Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// Class G4BrentLocator implementation
  • trunk/source/geometry/navigation/src/G4DrawVoxels.cc

    r1058 r1228  
    2626//
    2727// $Id: G4DrawVoxels.cc,v 1.4 2006/06/29 18:36:34 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/src/G4ErrorPropagationNavigator.cc

    r921 r1228  
    2626//
    2727// $Id: G4ErrorPropagationNavigator.cc,v 1.2 2008/10/24 14:00:03 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/src/G4GeomTestErrorList.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestErrorList.cc,v 1.3 2006/06/29 18:36:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeomTestOverlapList.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestOverlapList.cc,v 1.3 2006/06/29 18:36:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeomTestOvershootList.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestOvershootList.cc,v 1.3 2006/06/29 18:36:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeomTestPoint.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestPoint.cc,v 1.3 2006/06/29 18:36:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeomTestSegment.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestSegment.cc,v 1.11 2007/11/16 09:39:14 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeomTestStreamLogger.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestStreamLogger.cc,v 1.3 2006/06/29 18:36:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeomTestVolPoint.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestVolPoint.cc,v 1.3 2006/06/29 18:36:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeomTestVolume.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeomTestVolume.cc,v 1.6 2007/11/16 09:39:14 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4GeometryMessenger.cc

    r921 r1228  
    2626//
    2727// $Id: G4GeometryMessenger.cc,v 1.5 2006/06/29 18:36:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/navigation/src/G4MultiLevelLocator.cc

    r1058 r1228  
    2525//
    2626// $Id: G4MultiLevelLocator.cc,v 1.5 2008/12/11 10:01:02 tnikitin Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// Class G4MultiLevelLocator implementation
  • trunk/source/geometry/navigation/src/G4NormalNavigation.cc

    r921 r1228  
    2626//
    2727// $Id: G4NormalNavigation.cc,v 1.9 2007/05/11 13:43:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/src/G4ParameterisedNavigation.cc

    r921 r1228  
    2626//
    2727// $Id: G4ParameterisedNavigation.cc,v 1.12 2007/11/09 16:06:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/src/G4PropagatorInField.cc

    r1058 r1228  
    3636// 17.03.97 John Apostolakis,   renaming new set functions being added
    3737//
     38// $Id: G4PropagatorInField.cc,v 1.50 2009/12/10 08:41:54 japost Exp $
     39// GEANT4 tag $ Name:  $
    3840// ---------------------------------------------------------------------------
    3941
     
    6971    fUseSafetyForOptimisation(true),   // (false) is less sensitive to incorrect safety
    7072    fSetFieldMgr(false),
     73    fZeroStepThreshold( 0.0 ),
    7174    fpTrajectoryFilter( 0 )
    7275{
     
    8386  fPreviousSafety= 0.0;
    8487  kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
     88  fZeroStepThreshold= std::max( 1.0e5 * kCarTolerance, 1.0e-1 * micrometer ) ;
     89#ifdef G4DEBUG_FIELD
     90  G4cout << " PiF: Zero Step Threshold set to " << fZeroStepThreshold / millimeter
     91         << " mm." << G4endl;
     92  G4cout << " PiF:   Value of kCarTolerance = " << kCarTolerance / millimeter
     93         << " mm. " << G4endl;
     94#endif
    8595
    8696  // Definding Intersection Locator and his parameters
     
    92102    fAllocatedLocator=false;
    93103  }
     104  RefreshIntersectionLocator();  //  Copy all relevant parameters
     105}
     106
     107G4PropagatorInField::~G4PropagatorInField()
     108{
     109  if(fAllocatedLocator)delete  fIntersectionLocator;
     110}
     111
     112// Update the IntersectionLocator with current parameters
     113void
     114G4PropagatorInField::RefreshIntersectionLocator()
     115{
    94116  fIntersectionLocator->SetEpsilonStepFor(fEpsilonStep);
    95   fIntersectionLocator->SetDeltaIntersectionFor(GetDeltaIntersection());
     117  fIntersectionLocator->SetDeltaIntersectionFor(fCurrentFieldMgr->GetDeltaIntersection());
    96118  fIntersectionLocator->SetChordFinderFor(GetChordFinder());
    97119  fIntersectionLocator->SetSafetyParametersFor( fUseSafetyForOptimisation);
    98120}
    99 
    100 G4PropagatorInField::~G4PropagatorInField()
    101 {
    102   if(fAllocatedLocator)delete  fIntersectionLocator;
    103 }
    104 
    105121///////////////////////////////////////////////////////////////////////////
    106122//
     
    114130                G4VPhysicalVolume* pPhysVol)
    115131{
    116  
     132  const G4String MethodName("G4PropagatorInField::ComputeStep");
     133   
    117134  // If CurrentProposedStepLength is too small for finding Chords
    118135  // then return with no action (for now - TODO: some action)
     
    152169  GetChordFinder()->SetChargeMomentumMass(fCharge, fInitialMomentumModulus, fMass);
    153170
    154  // Values for Intersection Locator has to be updated on each call
    155  // because the CurrentFieldManager changes
    156     fIntersectionLocator->SetChordFinderFor(GetChordFinder());
    157     fIntersectionLocator->SetSafetyParametersFor( fUseSafetyForOptimisation);
    158     fIntersectionLocator->SetEpsilonStepFor(fEpsilonStep);
    159     fIntersectionLocator->SetDeltaIntersectionFor(GetDeltaIntersection());
     171 // Values for Intersection Locator has to be updated on each call for the
     172 // case that CurrentFieldManager has changed from the one of previous step
     173  RefreshIntersectionLocator();
    160174
    161175  G4FieldTrack  CurrentState(pFieldTrack);
     
    177191                                           fLargestAcceptableStep );
    178192  }
    179   epsilon = GetDeltaOneStep() / CurrentProposedStepLength;
     193  epsilon = fCurrentFieldMgr->GetDeltaOneStep() / CurrentProposedStepLength;
    180194  // G4double raw_epsilon= epsilon;
    181195  G4double epsilonMin= fCurrentFieldMgr->GetMinimumEpsilonStep();
     
    200214    G4double decreaseFactor = 0.9; // Unused default
    201215    if(   (fNoZeroStep < fSevereActionThreshold_NoZeroSteps)
    202        && (stepTrial > 1000.0*kCarTolerance) )
     216       && (stepTrial > 100.0*fZeroStepThreshold) )
    203217    {
    204       // Ensure quicker convergence
     218      // Attempt quick convergence
    205219      //
    206       decreaseFactor= 0.1;
     220      decreaseFactor= 0.25;
    207221    }
    208222    else
     
    212226      // Careful decreases to cope with tolerance are required.
    213227      //
    214       if( stepTrial > 1000.0*kCarTolerance )
    215         decreaseFactor = 0.25;     // Try slow decreases
    216       else if( stepTrial > 100.0*kCarTolerance )
    217         decreaseFactor= 0.5;       // Try slower decreases
    218       else if( stepTrial > 10.0*kCarTolerance )
     228      if( stepTrial > 100.0*fZeroStepThreshold )
     229        decreaseFactor = 0.35;     // Try decreasing slower
     230      else if( stepTrial > 100.0*fZeroStepThreshold )
     231        decreaseFactor= 0.5;       // Try yet slower decreases
     232      else if( stepTrial > 10.0*fZeroStepThreshold )
    219233        decreaseFactor= 0.75;      // Try even slower decreases
    220234      else
     
    224238
    225239#ifdef G4DEBUG_FIELD
     240     G4cout << MethodName << ": "
     241            << " Decreasing step -  "
     242            << " decreaseFactor= " << std::setw(8) << decreaseFactor
     243            << " stepTrial = "     << std::setw(18) << stepTrial << " "
     244            << " fZeroStepThreshold = " << fZeroStepThreshold << G4endl;
    226245     PrintStepLengthDiagnostic(CurrentProposedStepLength, decreaseFactor,
    227246                               stepTrial, pFieldTrack);
    228247#endif
    229      if( stepTrial == 0.0 )
     248     if( stepTrial == 0.0 )  //  Change to make it < 0.1 * kCarTolerance ??
    230249     {
    231250       G4cout << " G4PropagatorInField::ComputeStep "
     
    403422  // and only take corrective action when they occur.
    404423  //
    405   if( TruePathLength < 0.5*kCarTolerance )
     424  if( ( (TruePathLength < fZeroStepThreshold)
     425        && ( TruePathLength+kCarTolerance < CurrentProposedStepLength  )
     426        )
     427      || ( TruePathLength < 0.5*kCarTolerance )
     428    )
     429  {
    406430    fNoZeroStep++;
    407   else
     431  }
     432  else{
    408433    fNoZeroStep = 0;
     434  }
    409435
    410436  if( fNoZeroStep > fAbandonThreshold_NoZeroSteps ) {
     
    552578                    const G4FieldTrack& )
    553579{
     580#if 0
    554581  G4cout << " PiF: NoZeroStep= " << fNoZeroStep
    555582         << " CurrentProposedStepLength= " << CurrentProposedStepLength
    556583         << " Full_curvelen_last=" << fFull_CurveLen_of_LastAttempt
    557584         << " last proposed step-length= " << fLast_ProposedStepLength
    558          << " decreate factor = " << decreaseFactor
     585         << " decrease factor = " << decreaseFactor
    559586         << " step trial = " << stepTrial
    560587         << G4endl;
     588#endif
     589  int  iprec= G4cout.precision(8);
     590  G4cout << " " << std::setw(12) << " PiF: NoZeroStep "
     591         << " " << std::setw(20) << " CurrentProposed len "
     592         << " " << std::setw(18) << " Full_curvelen_last"
     593         << " " << std::setw(18) << " last proposed len "
     594         << " " << std::setw(18) << " decrease factor   "
     595         << " " << std::setw(15) << " step trial  "
     596         << G4endl;
     597
     598  G4cout << " " << std::setw(10) << fNoZeroStep << "  "
     599         << " " << std::setw(20) << CurrentProposedStepLength
     600         << " " << std::setw(18) << fFull_CurveLen_of_LastAttempt
     601         << " " << std::setw(18) << fLast_ProposedStepLength
     602         << " " << std::setw(18) << decreaseFactor
     603         << " " << std::setw(15) << stepTrial
     604         << G4endl;
     605  G4cout.precision( iprec );
     606
    561607}
    562608
     
    617663  if( pCurrentPhysicalVolume)
    618664  {
    619      G4FieldManager *newFieldMgr = 0;
    620      newFieldMgr= pCurrentPhysicalVolume->GetLogicalVolume()->GetFieldManager();
    621      if ( newFieldMgr )
    622         currentFieldMgr = newFieldMgr;
     665     G4FieldManager *pRegionFieldMgr= 0, *localFieldMgr = 0;
     666     G4LogicalVolume* pLogicalVol= pCurrentPhysicalVolume->GetLogicalVolume();
     667
     668     if( pLogicalVol ) {
     669        // Value for Region, if any, Overrides
     670        G4Region*  pRegion= pLogicalVol->GetRegion();
     671        if( pRegion ) {
     672           pRegionFieldMgr= pRegion->GetFieldManager();
     673           if( pRegionFieldMgr )
     674             currentFieldMgr= pRegionFieldMgr;
     675        }
     676
     677        // 'Local' Value from logical volume, if any, Overrides
     678        localFieldMgr= pLogicalVol->GetFieldManager();
     679        if ( localFieldMgr )
     680           currentFieldMgr = localFieldMgr;
     681     }
    623682  }
    624683  fCurrentFieldMgr= currentFieldMgr;
  • trunk/source/geometry/navigation/src/G4ReplicaNavigation.cc

    r921 r1228  
    2626//
    2727// $Id: G4ReplicaNavigation.cc,v 1.19 2008/04/28 15:39:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/src/G4SimpleLocator.cc

    r1058 r1228  
    2525//
    2626// $Id: G4SimpleLocator.cc,v 1.5 2008/12/11 10:27:58 tnikitin Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// Class G4SimpleLocator implementation
  • trunk/source/geometry/navigation/src/G4TransportationManager.cc

    r921 r1228  
    2626//
    2727// $Id: G4TransportationManager.cc,v 1.15 2007/04/12 11:51:48 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/navigation/src/G4VIntersectionLocator.cc

    r1058 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VIntersectionLocator.cc,v 1.5 2009/05/15 12:58:23 tnikitin Exp $
    27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     26// $Id: G4VIntersectionLocator.cc,v 1.7 2009/11/27 15:21:59 japost Exp $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// Class G4VIntersectionLocator implementation
     
    4343// Constructor
    4444//
    45 G4VIntersectionLocator:: G4VIntersectionLocator(G4Navigator *theNavigator)
     45G4VIntersectionLocator:: G4VIntersectionLocator(G4Navigator *theNavigator):
     46  fUseNormalCorrection(false),
     47  fiNavigator( theNavigator ),
     48  fiChordFinder( 0 ),            // Not set - overridden at each step
     49  fiEpsilonStep( -1.0 ),         // Out of range - overridden at each step
     50  fiDeltaIntersection( -1.0 ),   // Out of range - overridden at each step
     51  fiUseSafety(false)             // Default - overridden at each step
    4652{
    4753  kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
    48   fiNavigator = theNavigator;
    4954  fVerboseLevel = 0;
    50   fUseNormalCorrection = false;
    5155  fHelpingNavigator = new G4Navigator();
    5256}     
     
    191195     if (std::abs(advanceLength)<kCarTolerance)
    192196     {
    193        advanceLength=(EstimatedEndStateB.GetPosition()
    194                      -newEndPoint.GetPosition()).mag();
     197       goodAdvance=true;
    195198     }
     199     else{
    196200     goodAdvance=
    197201       integrDriver->AccurateAdvance(newEndPoint, advanceLength,
    198202                                     GetEpsilonStepFor());
     203     }
    199204  }
    200205  while( !goodAdvance && (++itrial < no_trials) );
  • trunk/source/geometry/navigation/src/G4VoxelNavigation.cc

    r921 r1228  
    2626//
    2727// $Id: G4VoxelNavigation.cc,v 1.9 2008/11/14 18:26:35 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-cand-01 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/BREPS/include/G4Assembly.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Assembly.hh,v 1.10 2006/06/29 18:37:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Assembly.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Assembly.icc,v 1.4 2006/06/29 18:37:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Axis2Placement3D.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Axis2Placement3D.hh,v 1.5 2006/06/29 18:37:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Axis2Placement3D.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Axis2Placement3D.icc,v 1.9 2006/06/29 18:37:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolid.hh,v 1.17 2006/10/19 15:35:36 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolid.icc,v 1.9 2006/10/20 14:23:19 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidBox.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidBox.hh,v 1.10 2008/01/22 16:03:13 tnikitin Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidCone.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidCone.hh,v 1.11 2006/06/29 18:37:51 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidCylinder.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidCylinder.hh,v 1.10 2006/06/29 18:37:53 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidOpenPCone.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidOpenPCone.hh,v 1.9 2006/06/29 18:37:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidPCone.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidPCone.hh,v 1.14 2006/06/29 18:37:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidPolyhedra.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidPolyhedra.hh,v 1.14 2006/06/29 18:37:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidSphere.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidSphere.hh,v 1.11 2006/06/29 18:38:01 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BREPSolidTorus.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidTorus.hh,v 1.10 2006/06/29 18:38:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineCurve.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineCurve.hh,v 1.13 2006/06/29 18:38:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineCurve.icc

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineCurve.icc,v 1.7 2006/06/29 18:38:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineCurveWithKnots.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineCurveWithKnots.hh,v 1.5 2006/06/29 18:38:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineSurface.hh,v 1.11 2006/06/29 18:38:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineSurface.icc,v 1.6 2006/06/29 18:38:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BSplineSurfaceWithKnots.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineSurfaceWithKnots.hh,v 1.4 2006/06/29 18:38:17 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BezierSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BezierSurface.hh,v 1.7 2006/06/29 18:38:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BezierSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4BezierSurface.icc,v 1.4 2006/06/29 18:38:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BoundingBox3D.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BoundingBox3D.hh,v 1.7 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4BoundingBox3D.icc

    r1058 r1228  
    2626//
    2727// $Id: G4BoundingBox3D.icc,v 1.4 2006/06/29 18:38:27 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CircularCurve.hh

    r1058 r1228  
    2626//
    2727// $Id: G4CircularCurve.hh,v 1.9 2006/06/29 18:38:30 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CircularCurve.icc

    r1058 r1228  
    2626//
    2727// $Id: G4CircularCurve.icc,v 1.6 2006/06/29 18:38:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CompositeCurve.hh

    r1058 r1228  
    2626//
    2727// $Id: G4CompositeCurve.hh,v 1.8 2006/06/29 18:38:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CompositeCurve.icc

    r1058 r1228  
    2626//
    2727// $Id: G4CompositeCurve.icc,v 1.5 2006/06/29 18:38:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Conic.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Conic.hh,v 1.7 2006/06/29 18:38:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Conic.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Conic.icc,v 1.4 2006/06/29 18:38:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ConicalSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ConicalSurface.hh,v 1.10 2006/06/29 18:38:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ConicalSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4ConicalSurface.icc,v 1.4 2006/06/29 18:38:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ControlPoints.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ControlPoints.hh,v 1.7 2006/06/29 18:38:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ControlPoints.icc

    r1058 r1228  
    2626//
    2727// $Id: G4ControlPoints.icc,v 1.3 2006/06/29 18:38:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ConvexHull.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ConvexHull.hh,v 1.7 2006/06/29 18:38:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Curve.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Curve.hh,v 1.11 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Curve.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Curve.icc,v 1.7 2006/06/29 18:38:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurvePoint.hh

    r1058 r1228  
    2626//
    2727// $Id: G4CurvePoint.hh,v 1.6 2006/06/29 18:39:00 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurvePoint.icc

    r1058 r1228  
    2626//
    2727// $Id: G4CurvePoint.icc,v 1.4 2006/06/29 18:39:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurveRayIntersection.hh

    r1058 r1228  
    2626//
    2727// $Id: G4CurveRayIntersection.hh,v 1.6 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurveRayIntersection.icc

    r1058 r1228  
    2626//
    2727// $Id: G4CurveRayIntersection.icc,v 1.4 2006/06/29 18:39:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CurveVector.hh

    r1058 r1228  
    2626//
    2727// $Id: G4CurveVector.hh,v 1.7 2006/06/29 18:39:10 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CylindricalSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4CylindricalSurface.hh,v 1.10 2006/06/29 18:39:12 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4CylindricalSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4CylindricalSurface.icc,v 1.4 2006/06/29 18:39:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ellipse.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Ellipse.hh,v 1.10 2006/06/29 18:39:16 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ellipse.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Ellipse.icc,v 1.8 2006/06/29 18:39:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FConicalSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4FConicalSurface.hh,v 1.13 2006/06/29 18:39:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FConicalSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4FConicalSurface.icc,v 1.4 2006/06/29 18:39:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FCylindricalSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4FCylindricalSurface.hh,v 1.13 2006/06/29 18:39:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FCylindricalSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4FCylindricalSurface.icc,v 1.4 2006/06/29 18:39:27 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FPlane.hh

    r1058 r1228  
    2626//
    2727// $Id: G4FPlane.hh,v 1.13 2006/06/29 18:39:30 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4FPlane.icc

    r1058 r1228  
    2626//
    2727// $Id: G4FPlane.icc,v 1.6 2006/06/29 18:39:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Globals.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Globals.hh,v 1.5 2006/06/29 18:39:34 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Author: A.Breakstone
  • trunk/source/geometry/solids/BREPS/include/G4Hyperbola.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Hyperbola.hh,v 1.10 2006/06/29 18:39:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Hyperbola.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Hyperbola.icc,v 1.9 2006/06/29 18:39:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4KnotVector.hh

    r1058 r1228  
    2626//
    2727// $Id: G4KnotVector.hh,v 1.10 2007/05/11 13:49:31 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4KnotVector.icc

    r1058 r1228  
    2626//
    2727// $Id: G4KnotVector.icc,v 1.5 2006/06/29 18:39:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Line.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Line.hh,v 1.9 2006/06/29 18:39:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Line.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Line.icc,v 1.10 2008/03/13 14:18:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4OsloMatrix.hh

    r1058 r1228  
    2626//
    2727// $Id: G4OsloMatrix.hh,v 1.6 2006/06/29 18:39:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4OsloMatrix.icc

    r1058 r1228  
    2626//
    2727// $Id: G4OsloMatrix.icc,v 1.4 2006/06/29 18:39:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Parabola.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Parabola.hh,v 1.10 2006/06/29 18:39:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Parabola.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Parabola.icc,v 1.8 2006/06/29 18:39:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PlacedSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PlacedSolid.hh,v 1.10 2006/06/29 18:39:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PlacedSolid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4PlacedSolid.icc,v 1.8 2006/06/29 18:40:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PlacementVector.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PlacementVector.hh,v 1.7 2006/06/29 18:40:04 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Plane.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Plane.hh,v 1.6 2006/06/29 18:40:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Point3DVector.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Point3DVector.hh,v 1.8 2006/06/29 18:40:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PointRat.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PointRat.hh,v 1.10 2006/06/29 18:40:12 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4PointRat.icc

    r1058 r1228  
    2626//
    2727// $Id: G4PointRat.icc,v 1.4 2006/06/29 18:40:15 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ProjectedSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ProjectedSurface.hh,v 1.7 2006/06/29 18:40:17 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ProjectedSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4ProjectedSurface.icc,v 1.5 2006/06/29 18:40:19 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ray.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Ray.hh,v 1.9 2006/06/29 18:40:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Ray.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Ray.icc,v 1.7 2006/06/29 18:40:24 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4RectangularTrimmedSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4RectangularTrimmedSurface.hh,v 1.8 2006/06/29 18:40:27 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4STEPEntity.hh

    r1058 r1228  
    2626//
    2727// $Id: G4STEPEntity.hh,v 1.7 2006/06/29 18:40:30 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Sort.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Sort.hh,v 1.5 2006/06/29 18:40:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SphericalSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SphericalSurface.hh,v 1.10 2006/06/29 18:40:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SphericalSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4SphericalSurface.icc,v 1.4 2006/06/29 18:40:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Surface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Surface.hh,v 1.10 2007/05/11 13:49:32 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4Surface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Surface.icc,v 1.5 2006/06/29 18:40:43 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceBoundary.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceBoundary.hh,v 1.8 2006/06/29 18:40:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceBoundary.icc

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceBoundary.icc,v 1.5 2006/06/29 18:40:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceList.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceList.hh,v 1.6 2006/06/29 18:40:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceOfLinearExtrusion.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceOfLinearExtrusion.hh,v 1.5 2006/06/29 18:40:53 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4SurfaceOfRevolution.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceOfRevolution.hh,v 1.5 2006/06/29 18:40:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ThreeMat.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ThreeMat.hh,v 1.10 2006/06/29 18:40:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ToroidalSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ToroidalSurface.hh,v 1.7 2006/06/29 18:41:01 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4ToroidalSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4ToroidalSurface.icc,v 1.4 2006/06/29 18:41:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/include/G4UVHit.hh

    r1058 r1228  
    2626//
    2727// $Id: G4UVHit.hh,v 1.7 2006/06/29 18:41:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Assembly.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Assembly.cc,v 1.6 2006/06/29 18:41:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Axis2Placement3D.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Axis2Placement3D.cc,v 1.9 2006/06/29 18:41:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolid.cc,v 1.37 2008/03/13 14:18:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidBox.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidBox.cc,v 1.11 2008/01/22 16:03:52 tnikitin Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidCone.cc

    r1058 r1228  
    2525//
    2626// $Id: G4BREPSolidCone.cc,v 1.15 2006/06/29 18:41:16 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidCylinder.cc

    r1058 r1228  
    2525//
    2626// $Id: G4BREPSolidCylinder.cc,v 1.11 2006/06/29 18:41:18 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidOpenPCone.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidOpenPCone.cc,v 1.11 2006/06/29 18:41:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidPCone.cc

    r1058 r1228  
    2525//
    2626// $Id: G4BREPSolidPCone.cc,v 1.38 2006/06/29 18:41:24 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidPolyhedra.cc

    r1058 r1228  
    2525//
    2626// $Id: G4BREPSolidPolyhedra.cc,v 1.35 2008/01/22 16:04:58 tnikitin Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidSphere.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidSphere.cc,v 1.11 2006/06/29 18:41:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BREPSolidTorus.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BREPSolidTorus.cc,v 1.9 2006/06/29 18:41:34 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineCurve.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineCurve.cc,v 1.12 2006/06/29 18:41:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineCurveWithKnots.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineCurveWithKnots.cc,v 1.5 2006/06/29 18:41:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineSurface.cc,v 1.15 2008/03/13 14:18:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BSplineSurfaceWithKnots.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BSplineSurfaceWithKnots.cc,v 1.4 2006/06/29 18:41:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BezierSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BezierSurface.cc,v 1.10 2008/03/13 14:18:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4BoundingBox3D.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BoundingBox3D.cc,v 1.12 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CircularCurve.cc

    r1058 r1228  
    2626//
    2727// $Id: G4CircularCurve.cc,v 1.10 2006/06/29 18:41:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CompositeCurve.cc

    r1058 r1228  
    2626//
    2727// $Id: G4CompositeCurve.cc,v 1.13 2006/06/29 18:41:54 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Conic.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Conic.cc,v 1.8 2006/06/29 18:41:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ConicalSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ConicalSurface.cc,v 1.11 2006/06/29 18:41:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ControlPoints.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ControlPoints.cc,v 1.8 2006/06/29 18:42:00 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Curve.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Curve.cc,v 1.9 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CurvePoint.cc

    r1058 r1228  
    2626//
    2727// $Id: G4CurvePoint.cc,v 1.5 2006/06/29 18:42:04 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CurveRayIntersection.cc

    r1058 r1228  
    2626//
    2727// $Id: G4CurveRayIntersection.cc,v 1.8 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4CylindricalSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4CylindricalSurface.cc,v 1.8 2006/06/29 18:42:08 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Ellipse.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Ellipse.cc,v 1.12 2007/05/18 07:33:31 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4FConicalSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4FConicalSurface.cc,v 1.19 2006/06/29 18:42:12 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4FCylindricalSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4FCylindricalSurface.cc,v 1.16 2006/06/29 18:42:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4FPlane.cc

    r1058 r1228  
    2626//
    2727// $Id: G4FPlane.cc,v 1.16 2006/06/29 18:42:16 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Hyperbola.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Hyperbola.cc,v 1.12 2007/05/18 07:33:31 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4KnotVector.cc

    r1058 r1228  
    2626//
    2727// $Id: G4KnotVector.cc,v 1.11 2008/03/13 14:18:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Line.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Line.cc,v 1.10 2006/06/29 18:42:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4OsloMatrix.cc

    r1058 r1228  
    2626//
    2727// $Id: G4OsloMatrix.cc,v 1.6 2006/06/29 18:42:24 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Parabola.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Parabola.cc,v 1.9 2007/05/18 07:33:31 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4PlacedSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4PlacedSolid.cc,v 1.6 2007/05/11 13:49:32 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4PointRat.cc

    r1058 r1228  
    2626//
    2727// $Id: G4PointRat.cc,v 1.6 2006/06/29 18:42:30 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ProjectedSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ProjectedSurface.cc,v 1.12 2008/03/13 14:18:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Ray.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Ray.cc,v 1.12 2008/07/08 10:00:58 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4RectangularTrimmedSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4RectangularTrimmedSurface.cc,v 1.7 2006/06/29 18:42:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Sort.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Sort.cc,v 1.5 2006/06/29 18:42:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SphericalSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SphericalSurface.cc,v 1.10 2006/06/29 18:42:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4Surface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Surface.cc,v 1.17 2007/07/16 08:06:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceBoundary.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceBoundary.cc,v 1.14 2006/06/29 18:42:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceList.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceList.cc,v 1.8 2008/03/13 14:18:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceOfLinearExtrusion.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SurfaceOfLinearExtrusion.cc,v 1.4 2006/06/29 18:42:51 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4SurfaceOfRevolution.cc

    r1058 r1228  
    2929//
    3030// $Id: G4SurfaceOfRevolution.cc,v 1.4 2006/06/29 18:42:53 gunter Exp $
    31 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     31// GEANT4 tag $Name: geant4-09-03 $
    3232//
    3333// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ThreeMat.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ThreeMat.cc,v 1.8 2006/06/29 18:42:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/BREPS/src/G4ToroidalSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ToroidalSurface.cc,v 1.10 2006/06/29 18:42:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// ----------------------------------------------------------------------
  • trunk/source/geometry/solids/Boolean/include/G4BooleanSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4BooleanSolid.hh,v 1.15 2006/10/19 15:34:49 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4BooleanSolid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4BooleanSolid.icc,v 1.4 2006/10/20 14:20:54 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/Boolean/include/G4DisplacedSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4DisplacedSolid.hh,v 1.19 2006/06/29 18:43:31 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4IntersectionSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4IntersectionSolid.hh,v 1.9 2006/06/29 18:43:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4SubtractionSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SubtractionSolid.hh,v 1.9 2006/06/29 18:43:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/include/G4UnionSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4UnionSolid.hh,v 1.10 2006/06/29 18:43:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/Boolean/src/G4BooleanSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4BooleanSolid.cc,v 1.21 2006/10/19 15:34:49 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Implementation for the abstract base class for solids created by boolean
  • trunk/source/geometry/solids/Boolean/src/G4DisplacedSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4DisplacedSolid.cc,v 1.27 2006/06/29 18:43:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Implementation for G4DisplacedSolid class for boolean
  • trunk/source/geometry/solids/Boolean/src/G4IntersectionSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4IntersectionSolid.cc,v 1.30 2006/11/08 09:37:41 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Implementation of methods for the class G4IntersectionSolid
  • trunk/source/geometry/solids/Boolean/src/G4SubtractionSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SubtractionSolid.cc,v 1.31 2007/10/23 14:42:31 grichine Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Implementation of methods for the class G4IntersectionSolid
  • trunk/source/geometry/solids/Boolean/src/G4UnionSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4UnionSolid.cc,v 1.35 2007/10/23 14:42:31 grichine Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Implementation of methods for the class G4IntersectionSolid
  • trunk/source/geometry/solids/CSG/History

    r921 r1228  
    1 $Id: History,v 1.109 2008/11/21 09:50:20 gcosmo Exp $
     1$Id: History,v 1.119 2009/11/30 10:20:53 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     20Nov 30, 2009  V.Grichine                 geom-csg-V09-02-08
     21- G4Orb: moved debug warning in DistanceToIn(p,v) within G4CSGDEBUG flag.
     22
     23Nov 26, 2009  T.Nikitina                 geom-csg-V09-02-07
     24- G4Torus: fix in SolveNumericJT() in order to take in account the difference
     25  in the value of theta for different intervals, [0:pi] or [-pi:0], and for
     26  SPhi in [0:twopi] or [-twopi:0]. Addresses problem report #1086.
     27
     28Nov 12, 2009  T.Nikitina                 geom-csg-V09-02-06
     29- G4Cons: fix to DistanceToIn(p,v), added a check on the direction in case
     30  of point on surface. Fixes a problem of stuck tracks observed in CMS, due
     31  to wrong reply from the solid for points on the inner radius surface base
     32  with direction along the imaginary extension of the cone.
     33- Added test case to internal test testG4Cons2.
     34
     35Aug 07, 2009  T.Nikitina                 geom-csg-V09-02-05
     36- G4Sphere: fix for the calculation of the normal in DistanceToOut()
     37  to avoid cases of division by zero in specific configurations.
     38  Addresses problem report #977.
     39
     40Jun 30, 2009  T.Nikitina                 geom-csg-V09-02-04
     41- Introduced to DistanceToIn(p,v) splitting of the distance for point very far
     42  from intersection area and big difference between solid dimensions and
     43  distance to it; resolves issue observed on 64 bits problem. Affected solids:
     44  G4Tubs, G4Cons, G4Sphere, G4Orb. Addresses problem report #1022.
     45- Fixed rare cases of NaN on G4Sphere.
     46
     47Jun 09, 2009  G.Cosmo                    geom-csg-V09-02-03
     48- Fixed case of non-initialised start-Phi value in G4Tubs and G4Cons,
     49  problem introduced following modifications in tag "geom-csg-V09-02-00".
     50
     51May 14, 2009  T.Nikitina                 geom-csg-V09-02-02
     52- G4Sphere: initialise flags for full sphere in constructor.
     53
     54May 14, 2009  T.Nikitina                 geom-csg-V09-02-01
     55- G4Sphere: correction di DistanceToOut(p,v, ...) for phi sections for
     56  rays passing though zero.
     57- More minor refiniments to G4Sphere following review.
     58
     59May 08, 2009  G.Cosmo                    geom-csg-V09-02-00
     60- G4Sphere: implemented speed improvements and corrections from joint
     61  code review of G4Sphere class. Cached computation for half-tolerances
     62  and use of Boolean flag for identifying if full-sphere, shell or section.
     63  Implemented caching of trigonometric values, now directly computed inside
     64  modifiers for Phi and Theta angles as required for parametrised cases.
     65  Rationalised usage of relative radial tolerances.
     66- G4Tubs, G4Cons: rationalised usage of modifiers for Phi angles and
     67  simplified constructors.
     68- Added new test case for relatively big spheres in unit tests testG4Orb
     69  and testG4Sphere, based on problem report #1046.
    1970
    2071Nov 21, 2008  G.Cosmo                    geom-csg-V09-01-08
  • trunk/source/geometry/solids/CSG/include/G4Box.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Box.hh,v 1.17 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Box.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Box.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4CSGSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4CSGSolid.hh,v 1.12 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// 
  • trunk/source/geometry/solids/CSG/include/G4Cons.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Cons.hh,v 1.21 2008/11/06 11:04:00 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Cons.hh,v 1.22 2009/03/31 09:56:24 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    8080                 G4double pDz,
    8181                 G4double pSPhi, G4double pDPhi);
    82          
    83     virtual ~G4Cons() ;
     82      //
     83      // Constructs a cone with the given name and dimensions
     84
     85   ~G4Cons() ;
     86      //
     87      // Destructor
    8488
    8589    // Accessors
    8690
    87     inline G4double    GetInnerRadiusMinusZ() const;
    88     inline G4double    GetOuterRadiusMinusZ() const;
    89     inline G4double    GetInnerRadiusPlusZ()  const;
    90     inline G4double    GetOuterRadiusPlusZ()  const;
    91  
    92     inline G4double    GetZHalfLength()       const;
    93  
    94     inline G4double    GetStartPhiAngle () const;
    95     inline G4double    GetDeltaPhiAngle () const;
     91    inline G4double GetInnerRadiusMinusZ() const;
     92    inline G4double GetOuterRadiusMinusZ() const;
     93    inline G4double GetInnerRadiusPlusZ()  const;
     94    inline G4double GetOuterRadiusPlusZ()  const;
     95    inline G4double GetZHalfLength()       const;
     96    inline G4double GetStartPhiAngle()     const;
     97    inline G4double GetDeltaPhiAngle()     const;
    9698 
    9799    // Modifiers
    98100
    99     inline void    SetInnerRadiusMinusZ( G4double Rmin1 );
    100     inline void    SetOuterRadiusMinusZ( G4double Rmax1 );
    101     inline void    SetInnerRadiusPlusZ ( G4double Rmin2 );
    102     inline void    SetOuterRadiusPlusZ ( G4double Rmax2 );
    103          
    104     inline void    SetZHalfLength      ( G4double newDz );
    105     inline void    SetStartPhiAngle    ( G4double newSPhi);
    106     inline void    SetDeltaPhiAngle    ( G4double newDPhi);
     101    inline void SetInnerRadiusMinusZ (G4double Rmin1 );
     102    inline void SetOuterRadiusMinusZ (G4double Rmax1 );
     103    inline void SetInnerRadiusPlusZ  (G4double Rmin2 );
     104    inline void SetOuterRadiusPlusZ  (G4double Rmax2 );
     105    inline void SetZHalfLength       (G4double newDz );
     106    inline void SetStartPhiAngle     (G4double newSPhi, G4bool trig=true);
     107    inline void SetDeltaPhiAngle     (G4double newDPhi);
    107108
    108109    // Other methods for solid
    109110
    110     inline G4double    GetCubicVolume();
    111     inline G4double    GetSurfaceArea();
    112 
    113     void ComputeDimensions(G4VPVParameterisation* p,
    114                            const G4int n,
    115                            const G4VPhysicalVolume* pRep);
    116 
    117     G4bool CalculateExtent(const EAxis pAxis,
    118                            const G4VoxelLimits& pVoxelLimit,
    119                            const G4AffineTransform& pTransform,
    120                                  G4double& pmin, G4double& pmax) const;         
    121 
    122     EInside Inside(const G4ThreeVector& p) const;
    123 
    124     G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const;
     111    inline G4double GetCubicVolume();
     112    inline G4double GetSurfaceArea();
     113
     114    void ComputeDimensions(       G4VPVParameterisation* p,
     115                            const G4int n,
     116                            const G4VPhysicalVolume* pRep );
     117
     118    G4bool CalculateExtent( const EAxis pAxis,
     119                            const G4VoxelLimits& pVoxelLimit,
     120                            const G4AffineTransform& pTransform,
     121                                  G4double& pmin, G4double& pmax ) const;         
     122
     123    EInside Inside( const G4ThreeVector& p ) const;
     124
     125    G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
    125126
    126127    G4double DistanceToIn (const G4ThreeVector& p,
     
    134135    G4double DistanceToOut(const G4ThreeVector& p) const;
    135136
    136     G4GeometryType  GetEntityType() const;
     137    G4GeometryType GetEntityType() const;
    137138       
    138139    G4ThreeVector GetPointOnSurface() const;
     
    160161    inline G4double    GetRmin2() const;
    161162    inline G4double    GetRmax2() const;
    162  
    163163    inline G4double    GetDz()    const;
    164  
    165164    inline G4double    GetSPhi() const;
    166165    inline G4double    GetDPhi() const;
    167166
    168   protected:
     167  private:
    169168 
    170169    G4ThreeVectorList*
    171170    CreateRotatedVertices(const G4AffineTransform& pTransform) const;
    172171 
    173     G4double fRmin1, fRmin2, fRmax1, fRmax2, fDz, fSPhi, fDPhi;
    174     G4bool fPhiFullCone;
     172    inline void Initialize();
     173      //
     174      // Reset relevant values to zero
     175
     176    inline void CheckSPhiAngle(G4double sPhi);
     177    inline void CheckDPhiAngle(G4double dPhi);
     178    inline void CheckPhiAngles(G4double sPhi, G4double dPhi);
     179      //
     180      // Reset relevant flags and angle values
     181
     182    inline void InitializeTrigonometry();
     183      //
     184      // Recompute relevant trigonometric values and cache them
     185
     186    G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
     187      //
     188      // Algorithm for SurfaceNormal() following the original
     189      // specification for points not on the surface
     190
     191  private:
    175192
    176193    // Used by distanceToOut
    177  
     194    //
    178195    enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
    179196 
    180197    // used by normal
    181  
     198    //
    182199    enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
    183200
    184   private:
    185 
    186     inline void Initialise();
    187       // Reset relevant values to zero
    188 
    189     inline void InitializeTrigonometry();
    190       //
    191       // Recompute relevant trigonometric values and cache them
    192 
    193     G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
    194       //
    195       // Algorithm for SurfaceNormal() following the original
    196       // specification for points not on the surface
    197 
    198   private:
    199 
    200201    G4double kRadTolerance, kAngTolerance;
    201202      //
    202203      // Radial and angular tolerances
     204
     205    G4double fRmin1, fRmin2, fRmax1, fRmax2, fDz, fSPhi, fDPhi;
     206      //
     207      // Radial and angular dimensions
    203208
    204209    G4double sinCPhi, cosCPhi, cosHDPhiOT, cosHDPhiIT,
     
    206211      //
    207212      // Cached trigonometric values
     213
     214    G4bool fPhiFullCone;
     215      //
     216      // Flag for identification of section or full cone
    208217};
    209218
  • trunk/source/geometry/solids/CSG/include/G4Cons.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Cons.icc,v 1.8 2008/11/06 10:55:40 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Cons.icc,v 1.11 2009/06/09 16:08:23 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
     
    3737
    3838inline
    39 void G4Cons::Initialise()
    40 {
    41   fCubicVolume= 0.;
    42   fSurfaceArea= 0.;
     39G4double G4Cons::GetInnerRadiusMinusZ() const
     40{
     41  return fRmin1 ;
     42}
     43
     44inline
     45G4double G4Cons::GetOuterRadiusMinusZ() const
     46{
     47  return fRmax1 ;
     48}
     49
     50inline
     51G4double G4Cons::GetInnerRadiusPlusZ() const
     52{
     53  return fRmin2 ;
     54}
     55
     56inline
     57G4double G4Cons::GetOuterRadiusPlusZ() const
     58{
     59  return fRmax2 ;
     60}
     61
     62inline
     63G4double G4Cons::GetZHalfLength() const
     64{
     65  return fDz ;
     66}
     67
     68inline 
     69G4double G4Cons::GetStartPhiAngle() const
     70{
     71  return fSPhi ;
     72}
     73
     74inline
     75G4double G4Cons::GetDeltaPhiAngle() const
     76{
     77  return fDPhi;
     78}
     79
     80inline
     81void G4Cons::Initialize()
     82{
     83  fCubicVolume = 0.;
     84  fSurfaceArea = 0.;
    4385  fpPolyhedron = 0;
    4486}
     
    61103}
    62104
    63 inline
    64 G4double G4Cons::GetInnerRadiusMinusZ() const
    65 {
    66   return fRmin1 ;
    67 }
    68 
    69 inline
    70 G4double G4Cons::GetOuterRadiusMinusZ() const
    71 {
    72   return fRmax1 ;
    73 }
    74 
    75 inline
    76 G4double G4Cons::GetInnerRadiusPlusZ() const
    77 {
    78   return fRmin2 ;
    79 }
    80 
    81 inline
    82 G4double G4Cons::GetOuterRadiusPlusZ() const
    83 {
    84   return fRmax2 ;
    85 }
    86 
    87 inline
    88 G4double G4Cons::GetZHalfLength() const
    89 {
    90   return fDz ;
    91 }
    92 
    93 inline 
    94 G4double G4Cons::GetStartPhiAngle() const
    95 {
    96   return fSPhi ;
    97 }
    98 
    99 inline
    100 G4double G4Cons::GetDeltaPhiAngle() const
    101 {
    102   return fDPhi;
     105inline void G4Cons::CheckSPhiAngle(G4double sPhi)
     106{
     107  // Ensure fSphi in 0-2PI or -2PI-0 range if shape crosses 0
     108
     109  if ( sPhi < 0 )
     110  {
     111    fSPhi = twopi - std::fmod(std::fabs(sPhi),twopi);
     112  }
     113  else
     114  {
     115    fSPhi = std::fmod(sPhi,twopi) ;
     116  }
     117  if ( fSPhi+fDPhi > twopi )
     118  {
     119    fSPhi -= twopi ;
     120  }
     121}
     122
     123inline void G4Cons::CheckDPhiAngle(G4double dPhi)
     124{
     125  fPhiFullCone = true;
     126  if ( dPhi >= twopi-kAngTolerance*0.5 )
     127  {
     128    fDPhi=twopi;
     129    fSPhi=0;
     130  }
     131  else
     132  {
     133    fPhiFullCone = false;
     134    if ( dPhi > 0 )
     135    {
     136      fDPhi = dPhi;
     137    }
     138    else
     139    {
     140      G4cerr << "ERROR - G4Cons()::CheckDPhiAngle()" << G4endl
     141             << "        Negative or zero delta-Phi (" << dPhi << ") in solid: "
     142             << GetName() << G4endl;
     143      G4Exception("G4Cons::CheckDPhiAngle()", "InvalidSetup",
     144                  FatalException, "Invalid dphi.");
     145    }
     146  }
     147}
     148
     149inline void G4Cons::CheckPhiAngles(G4double sPhi, G4double dPhi)
     150{
     151  CheckDPhiAngle(dPhi);
     152  if ( (fDPhi<twopi) && (sPhi) ) { CheckSPhiAngle(sPhi); }
     153  InitializeTrigonometry();
    103154}
    104155
     
    107158{
    108159  fRmin1= Rmin1 ;
    109   Initialise();
     160  Initialize();
    110161}
    111162
     
    114165{
    115166  fRmax1= Rmax1 ;
    116   Initialise();
     167  Initialize();
    117168}
    118169
     
    121172{
    122173  fRmin2= Rmin2 ;
    123   Initialise();
     174  Initialize();
    124175}
    125176
     
    128179{
    129180  fRmax2= Rmax2 ;
    130   Initialise();
     181  Initialize();
    131182}
    132183
     
    135186{
    136187  fDz= newDz ;
    137   Initialise();
    138 }
    139 
    140 inline
    141 void G4Cons::SetStartPhiAngle ( G4double newSPhi )
    142 {
    143   fSPhi= newSPhi;
    144   Initialise();
    145   InitializeTrigonometry();
     188  Initialize();
     189}
     190
     191inline
     192void G4Cons::SetStartPhiAngle ( G4double newSPhi, G4bool compute )
     193{
     194  // Flag 'compute' can be used to explicitely avoid recomputation of
     195  // trigonometry in case SetDeltaPhiAngle() is invoked afterwards
     196
     197  CheckSPhiAngle(newSPhi);
     198  fPhiFullCone = false;
     199  if (compute)  { InitializeTrigonometry(); }
     200  Initialize();
    146201}
    147202
    148203void G4Cons::SetDeltaPhiAngle ( G4double newDPhi )
    149204{
    150   if ( newDPhi >= twopi-kAngTolerance*0.5 )
    151   {
    152     fPhiFullCone = true;
    153   }
    154   else if ( newDPhi > 0 )
    155   {
    156     fPhiFullCone = false;
    157   }
    158   else
    159   {
    160      G4cerr << "ERROR - G4Cons()::SetDeltaPhiAngle() : " << GetName() << G4endl
    161             << "        Negative delta-Phi ! - " << newDPhi << G4endl;
    162      G4Exception("G4Cons::SetDeltaPhiAngle()", "InvalidSetup",
    163                   FatalException, "Invalid dphi.");
    164   }
    165   fDPhi=  newDPhi;
    166   Initialise();
    167   InitializeTrigonometry();
     205  CheckPhiAngles(fSPhi, newDPhi);
     206  Initialize();
    168207}
    169208
  • trunk/source/geometry/solids/CSG/include/G4Orb.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Orb.hh,v 1.11 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Orb.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Orb.icc,v 1.5 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Para.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Para.hh,v 1.18 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Para.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Para.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Sphere.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Sphere.hh,v 1.21 2008/11/21 09:50:05 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Sphere.hh,v 1.24 2009/03/31 07:51:49 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    3636// Class description:
    3737//
    38 //   A G4Sphere is, in the general case, section of a spherical shell,
     38//   A G4Sphere is, in the general case, a section of a spherical shell,
    3939//   between specified phi and theta angles
    4040//
     
    8383                   G4double pSPhi, G4double pDPhi,
    8484                   G4double pSTheta, G4double pDTheta);
     85      //
     86      // Constructs a sphere or sphere shell section
     87      // with the given name and dimensions
    8588       
    86     virtual ~G4Sphere() ;
    87    
     89   ~G4Sphere();
     90      //
     91      // Destructor
     92
    8893    // Accessors
    8994       
     
    99104    inline void SetInnerRadius    (G4double newRMin);
    100105    inline void SetOuterRadius    (G4double newRmax);
    101     inline void SetStartPhiAngle  (G4double newSphi);
     106    inline void SetStartPhiAngle  (G4double newSphi, G4bool trig=true);
    102107    inline void SetDeltaPhiAngle  (G4double newDphi);
    103108    inline void SetStartThetaAngle(G4double newSTheta);
     
    107112
    108113    inline G4double GetCubicVolume();
    109     inline G4double GetSurfaceArea();
     114    G4double GetSurfaceArea();
    110115
    111116    void ComputeDimensions(      G4VPVParameterisation* p,
     
    142147
    143148    // Visualisation functions
     149
    144150    G4VisExtent   GetExtent          () const;   
    145151    void          DescribeYourselfTo(G4VGraphicsScene& scene) const;
     
    150156   
    151157    G4Sphere(__void__&);
     158      //
    152159      // Fake default constructor for usage restricted to direct object
    153160      // persistency for clients requiring preallocation of memory for
     
    165172    inline void SetInsideRadius(G4double newRmin);
    166173
    167   protected:
     174  private:
    168175 
    169176    G4ThreeVectorList*
    170177    CreateRotatedVertices(const G4AffineTransform& pTransform,
    171178                                G4int& noPolygonVertices) const;
    172  
     179      //
     180      // Creates the List of transformed vertices in the format required
     181      // for G4VSolid:: ClipCrossSection and ClipBetweenSections
     182
     183    inline void Initialize();
     184      //
     185      // Reset relevant values to zero
     186
     187    inline void CheckThetaAngles(G4double sTheta, G4double dTheta);
     188    inline void CheckSPhiAngle(G4double sPhi);
     189    inline void CheckDPhiAngle(G4double dPhi);
     190    inline void CheckPhiAngles(G4double sPhi, G4double dPhi);
     191      //
     192      // Reset relevant flags and angle values
     193
     194    inline void InitializePhiTrigonometry();
     195    inline void InitializeThetaTrigonometry();
     196      //
     197      // Recompute relevant trigonometric values and cache them
     198
     199    G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p) const;
     200      //
     201      // Algorithm for SurfaceNormal() following the original
     202      // specification for points not on the surface
     203
     204  private:
     205
    173206    // Used by distanceToOut
    174  
     207    //
    175208    enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kSTheta,kETheta};
    176209 
    177210    // used by normal
    178  
     211    //
    179212    enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNSTheta,kNETheta};
    180213
    181   private:
    182 
    183     G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p) const;
    184       // Algorithm for SurfaceNormal() following the original
    185       // specification for points not on the surface
    186 
    187   private:
    188 
    189     G4double kAngTolerance, kRadTolerance;
    190 
    191     G4double fRmin,fRmax,
    192              fSPhi,fDPhi,
    193              fSTheta,fDTheta;
    194     G4double fEpsilon;
     214    G4double fEpsilon, fRminTolerance, fRmaxTolerance, kAngTolerance;
     215      //
     216      // Radial and angular tolerances
     217
     218    G4double fRmin, fRmax, fSPhi, fDPhi, fSTheta, fDTheta;
     219      //
     220      // Radial and angular dimensions
     221
     222    G4double sinCPhi, cosCPhi, cosHDPhiOT, cosHDPhiIT,
     223             sinSPhi, cosSPhi, sinEPhi, cosEPhi, hDPhi, cPhi, ePhi;
     224      //
     225      // Cached trigonometric values for Phi angle
     226
     227    G4double sinSTheta, cosSTheta, sinETheta, cosETheta,
     228             tanSTheta, tanSTheta2, tanETheta, tanETheta2, eTheta;
     229      //
     230      // Cached trigonometric values for Theta angle
     231
     232    G4bool fFullPhiSphere, fFullThetaSphere, fFullSphere;
     233      //
     234      // Flags for identification of section, shell or full sphere
    195235};
    196236
  • trunk/source/geometry/solids/CSG/include/G4Sphere.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Sphere.icc,v 1.8 2008/11/21 09:50:05 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Sphere.icc,v 1.11 2009/05/13 11:23:00 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
     
    7777}
    7878
     79inline
     80void G4Sphere::Initialize()
     81{
     82  fCubicVolume = 0.;
     83  fSurfaceArea = 0.;
     84  fpPolyhedron = 0;
     85}
     86
     87inline
     88void G4Sphere::InitializePhiTrigonometry()
     89{
     90  hDPhi = 0.5*fDPhi;                       // half delta phi
     91  cPhi  = fSPhi + hDPhi;
     92  ePhi  = fSPhi + fDPhi;
     93
     94  sinCPhi    = std::sin(cPhi);
     95  cosCPhi    = std::cos(cPhi);
     96  cosHDPhiIT = std::cos(hDPhi - 0.5*kAngTolerance); // inner/outer tol half dphi
     97  cosHDPhiOT = std::cos(hDPhi + 0.5*kAngTolerance);
     98  sinSPhi = std::sin(fSPhi);
     99  cosSPhi = std::cos(fSPhi);
     100  sinEPhi = std::sin(ePhi);
     101  cosEPhi = std::cos(ePhi);
     102}
     103
     104inline
     105void G4Sphere::InitializeThetaTrigonometry()
     106{
     107  eTheta  = fSTheta + fDTheta;
     108
     109  sinSTheta = std::sin(fSTheta);
     110  cosSTheta = std::cos(fSTheta);
     111  sinETheta = std::sin(eTheta);
     112  cosETheta = std::cos(eTheta);
     113
     114  tanSTheta  = std::tan(fSTheta);
     115  tanSTheta2 = tanSTheta*tanSTheta;
     116  tanETheta  = std::tan(eTheta);
     117  tanETheta2 = tanETheta*tanETheta;
     118}
     119
     120inline
     121void G4Sphere::CheckThetaAngles(G4double sTheta, G4double dTheta)
     122{
     123  if ( (sTheta<0) || (sTheta>pi) )
     124  {
     125    G4cerr << "ERROR - G4Sphere()::CheckThetaAngles()" << G4endl
     126           << "        Invalid starting Theta angle for solid: " << GetName()
     127           << G4endl;
     128    G4Exception("G4Sphere::CheckThetaAngles()", "InvalidSetup",
     129                FatalException, "sTheta outside 0-PI range.");
     130  }
     131  else
     132  {
     133    fSTheta=sTheta;
     134  }
     135  if ( dTheta+sTheta >= pi )
     136  {
     137    fDTheta=pi-sTheta;
     138  }
     139  else if ( dTheta > 0 )
     140  {
     141    fDTheta=dTheta;
     142  }
     143  else
     144  {
     145    G4cerr << "ERROR - G4Sphere()::CheckThetaAngles(): " << G4endl
     146           << "        Negative delta-Theta (" << dTheta << "), for solid: "
     147           << GetName() << G4endl;
     148    G4Exception("G4Sphere::CheckThetaAngles()", "InvalidSetup",
     149                FatalException, "Invalid dTheta.");
     150  }
     151  if ( fDTheta-fSTheta < pi ) { fFullThetaSphere = false; }
     152  else                        { fFullThetaSphere = true ; }
     153  fFullSphere = fFullPhiSphere && fFullThetaSphere;
     154
     155  InitializeThetaTrigonometry();
     156}
     157
     158inline
     159void G4Sphere::CheckSPhiAngle(G4double sPhi)
     160{
     161  // Ensure fSphi in 0-2PI or -2PI-0 range if shape crosses 0
     162
     163  if ( sPhi < 0 )
     164  {
     165    fSPhi = twopi - std::fmod(std::fabs(sPhi),twopi);
     166  }
     167  else
     168  {
     169    fSPhi = std::fmod(sPhi,twopi) ;
     170  }
     171  if ( fSPhi+fDPhi > twopi )
     172  {
     173    fSPhi -= twopi ;
     174  }
     175}
     176
     177inline
     178void G4Sphere::CheckDPhiAngle(G4double dPhi)
     179{
     180  fFullPhiSphere = true;
     181  if ( dPhi >= twopi-kAngTolerance*0.5 )
     182  {
     183    fDPhi=twopi;
     184    fSPhi=0;
     185  }
     186  else
     187  {
     188    fFullPhiSphere = false;
     189    if ( dPhi > 0 )
     190    {
     191      fDPhi = dPhi;
     192    }
     193    else
     194    {
     195      G4cerr << "ERROR - G4Sphere()::CheckDPhiAngle(): " << GetName() << G4endl
     196             << "        Negative delta-Phi ! - "
     197             << dPhi << G4endl;
     198      G4Exception("G4Sphere::CheckDPhiAngle()", "InvalidSetup",
     199                  FatalException, "Invalid dphi.");
     200    }
     201  }
     202}
     203
     204inline
     205void G4Sphere::CheckPhiAngles(G4double sPhi, G4double dPhi)
     206{
     207  CheckDPhiAngle(dPhi);
     208  if (!fFullPhiSphere && sPhi) { CheckSPhiAngle(sPhi); }
     209  fFullSphere = fFullPhiSphere && fFullThetaSphere;
     210
     211  InitializePhiTrigonometry();
     212}
     213
    79214inline
    80215void G4Sphere::SetInsideRadius(G4double newRmin)
    81216{
    82217  fRmin= newRmin;
    83   fCubicVolume= 0.;
    84   fSurfaceArea= 0.;
    85   fpPolyhedron = 0;
     218  Initialize();
    86219}
    87220
     
    90223{
    91224  fRmin= newRmin;
    92   fCubicVolume= 0.;
    93   fSurfaceArea= 0.;
    94   fpPolyhedron = 0;
     225  Initialize();
    95226}
    96227
     
    99230{
    100231  fRmax= newRmax;
    101   fCubicVolume= 0.;
    102   fSurfaceArea= 0.;
    103   fpPolyhedron = 0;
    104 }
    105 
    106 inline
    107 void G4Sphere::SetStartPhiAngle(G4double newSphi)
    108 {
    109   fSPhi= newSphi;
    110   fCubicVolume= 0.;
    111   fSurfaceArea= 0.;
    112   fpPolyhedron = 0;
    113 }
    114 
    115 inline
    116 void G4Sphere::SetDeltaPhiAngle(G4double newDphi)
    117 {
    118   fDPhi= newDphi;
    119   fCubicVolume= 0.;
    120   fSurfaceArea= 0.;
    121   fpPolyhedron = 0;
     232  Initialize();
     233}
     234
     235inline
     236void G4Sphere::SetStartPhiAngle(G4double newSPhi, G4bool compute)
     237{
     238  // Flag 'compute' can be used to explicitely avoid recomputation of
     239  // trigonometry in case SetDeltaPhiAngle() is invoked afterwards
     240
     241  CheckSPhiAngle(newSPhi);
     242  fFullPhiSphere = false;
     243  if (compute)  { InitializePhiTrigonometry(); }
     244  Initialize();
     245}
     246
     247inline
     248void G4Sphere::SetDeltaPhiAngle(G4double newDPhi)
     249{
     250  CheckPhiAngles(fSPhi, newDPhi);
     251  Initialize();
    122252}
    123253
     
    125255void G4Sphere::SetStartThetaAngle(G4double newSTheta)
    126256{
    127   fSTheta=newSTheta;
    128   fCubicVolume= 0.;
    129   fSurfaceArea= 0.;
    130   fpPolyhedron = 0;
     257  CheckThetaAngles(newSTheta, fDTheta);
     258  Initialize();
    131259}
    132260
     
    134262void G4Sphere::SetDeltaThetaAngle(G4double newDTheta)
    135263{
    136   fDTheta=newDTheta;
    137   fCubicVolume= 0.;
    138   fSurfaceArea= 0.;
    139   fpPolyhedron = 0;
     264  CheckThetaAngles(fSTheta, newDTheta);
     265  Initialize();
    140266}
    141267
     
    182308{
    183309  if(fCubicVolume != 0.) {;}
    184   else   fCubicVolume = fDPhi*(std::cos(fSTheta)-std::cos(fSTheta+fDTheta))*
    185                               (fRmax*fRmax*fRmax-fRmin*fRmin*fRmin)/3.;
     310  else { fCubicVolume = fDPhi*(std::cos(fSTheta)-std::cos(fSTheta+fDTheta))*
     311                              (fRmax*fRmax*fRmax-fRmin*fRmin*fRmin)/3.; }
    186312  return fCubicVolume;
    187313}
    188 
    189 
    190 inline
    191 G4double G4Sphere::GetSurfaceArea()
    192 {
    193   if(fSurfaceArea != 0.) {;}
    194   else
    195   {   
    196     G4double Rsq=fRmax*fRmax;
    197     G4double rsq=fRmin*fRmin;
    198          
    199     fSurfaceArea = fDPhi*(rsq+Rsq)*(std::cos(fSTheta)
    200                  - std::cos(fSTheta+fDTheta));
    201     if(fDPhi < twopi)
    202     {
    203       fSurfaceArea = fSurfaceArea + fDTheta*(Rsq-rsq);
    204     }
    205     if(fSTheta >0)
    206     {
    207       G4double acos1=std::acos( std::pow(std::sin(fSTheta),2)
    208                                *std::cos(fDPhi)
    209                                +std::pow(std::cos(fSTheta),2));
    210       if(fDPhi>pi)
    211       {
    212         fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*(twopi-acos1);
    213       }
    214       else
    215       {
    216         fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*acos1;
    217       }
    218     }
    219     if(fDTheta+fSTheta < pi)
    220     {
    221       G4double acos2=std::acos( std::pow(std::sin(fSTheta+fDTheta),2)
    222                                *std::cos(fDPhi)
    223                                +std::pow(std::cos(fSTheta+fDTheta),2));
    224       if(fDPhi>pi)
    225       {
    226         fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*(twopi-acos2);
    227       }
    228       else
    229       {
    230         fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*acos2;
    231       }
    232     }
    233   }
    234   return fSurfaceArea;
    235 }
  • trunk/source/geometry/solids/CSG/include/G4Torus.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Torus.hh,v 1.27 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Torus.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Torus.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Trap.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Trap.hh,v 1.17 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Trap.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Trap.icc,v 1.8 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Trd.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Trd.hh,v 1.16 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/include/G4Trd.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Trd.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/include/G4Tubs.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Tubs.hh,v 1.21 2008/11/06 10:55:40 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Tubs.hh,v 1.22 2009/03/26 16:25:44 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    8686      // Constructs a tubs with the given name and dimensions
    8787
    88     virtual ~G4Tubs();
     88   ~G4Tubs();
    8989      //
    9090      // Destructor
     
    103103    inline void SetOuterRadius   (G4double newRMax);
    104104    inline void SetZHalfLength   (G4double newDz);
    105     inline void SetStartPhiAngle (G4double newSPhi);
     105    inline void SetStartPhiAngle (G4double newSPhi, G4bool trig=true);
    106106    inline void SetDeltaPhiAngle (G4double newDPhi);
    107107   
     
    159159    inline G4double GetDPhi() const;
    160160
    161   protected:
     161  private:
    162162
    163163    G4ThreeVectorList*
     
    167167      // for G4VSolid:: ClipCrossSection and ClipBetweenSections
    168168
    169     G4double fRMin, fRMax, fDz, fSPhi, fDPhi;
    170     G4bool fPhiFullTube;
    171    
    172       // Used by distanceToOut
    173 
    174     enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
    175 
    176       // Used by normal
    177 
    178     enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
    179 
    180   private:
    181 
    182169    inline void Initialize();
    183170      //
    184171      // Reset relevant values to zero
     172
     173    inline void CheckSPhiAngle(G4double sPhi);
     174    inline void CheckDPhiAngle(G4double dPhi);
     175    inline void CheckPhiAngles(G4double sPhi, G4double dPhi);
     176      //
     177      // Reset relevant flags and angle values
    185178
    186179    inline void InitializeTrigonometry();
     
    195188  private:
    196189
     190    // Used by distanceToOut
     191    //
     192    enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
     193
     194    // Used by normal
     195    //
     196    enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
     197
    197198    G4double kRadTolerance, kAngTolerance;
    198199      //
    199200      // Radial and angular tolerances
    200201
     202    G4double fRMin, fRMax, fDz, fSPhi, fDPhi;
     203      //
     204      // Radial and angular dimensions
     205   
    201206    G4double sinCPhi, cosCPhi, cosHDPhiOT, cosHDPhiIT,
    202207             sinSPhi, cosSPhi, sinEPhi, cosEPhi;
    203208      //
    204209      // Cached trigonometric values
     210
     211    G4bool fPhiFullTube;
     212      //
     213      // Flag for identification of section or full tube
    205214};
    206215
  • trunk/source/geometry/solids/CSG/include/G4Tubs.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Tubs.icc,v 1.11 2008/11/06 10:55:40 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Tubs.icc,v 1.14 2009/06/09 16:08:23 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
     
    9191}
    9292
     93inline void G4Tubs::CheckSPhiAngle(G4double sPhi)
     94{
     95  // Ensure fSphi in 0-2PI or -2PI-0 range if shape crosses 0
     96
     97  if ( sPhi < 0 )
     98  {
     99    fSPhi = twopi - std::fmod(std::fabs(sPhi),twopi);
     100  }
     101  else
     102  {
     103    fSPhi = std::fmod(sPhi,twopi) ;
     104  }
     105  if ( fSPhi+fDPhi > twopi )
     106  {
     107    fSPhi -= twopi ;
     108  }
     109}
     110
     111inline void G4Tubs::CheckDPhiAngle(G4double dPhi)
     112{
     113  fPhiFullTube = true;
     114  if ( dPhi >= twopi-kAngTolerance*0.5 )
     115  {
     116    fDPhi=twopi;
     117    fSPhi=0;
     118  }
     119  else
     120  {
     121    fPhiFullTube = false;
     122    if ( dPhi > 0 )
     123    {
     124      fDPhi = dPhi;
     125    }
     126    else
     127    {
     128      G4cerr << "ERROR - G4Tubs()::CheckDPhiAngle()" << G4endl
     129             << "        Negative or zero delta-Phi (" << dPhi << ") in solid: "
     130             << GetName() << G4endl;
     131      G4Exception("G4Tubs::CheckDPhiAngle()", "InvalidSetup",
     132                  FatalException, "Invalid dphi.");
     133    }
     134  }
     135}
     136
     137inline void G4Tubs::CheckPhiAngles(G4double sPhi, G4double dPhi)
     138{
     139  CheckDPhiAngle(dPhi);
     140  if ( (fDPhi<twopi) && (sPhi) ) { CheckSPhiAngle(sPhi); }
     141  InitializeTrigonometry();
     142}
     143
    93144inline
    94145void G4Tubs::SetInnerRadius (G4double newRMin)
     
    113164
    114165inline
    115 void G4Tubs::SetStartPhiAngle (G4double newSPhi)
    116 {
    117   fSPhi= newSPhi;
    118   Initialize();
    119   InitializeTrigonometry();
     166void G4Tubs::SetStartPhiAngle (G4double newSPhi, G4bool compute)
     167{
     168  // Flag 'compute' can be used to explicitely avoid recomputation of
     169  // trigonometry in case SetDeltaPhiAngle() is invoked afterwards
     170
     171  CheckSPhiAngle(newSPhi);
     172  fPhiFullTube = false;
     173  if (compute)  { InitializeTrigonometry(); }
     174  Initialize();
    120175}
    121176
     
    123178void G4Tubs::SetDeltaPhiAngle (G4double newDPhi)
    124179{
    125   if ( newDPhi >= twopi-kAngTolerance*0.5 )
    126   {
    127     fPhiFullTube = true;
    128   }
    129   else if ( newDPhi > 0 )
    130   {
    131     fPhiFullTube = false;
    132   }
    133   else
    134   {
    135      G4cerr << "ERROR - G4Tubs()::SetDeltaPhiAngle() : " << GetName() << G4endl
    136             << "        Negative delta-Phi ! - " << newDPhi << G4endl;
    137      G4Exception("G4Tubs::SetDeltaPhiAngle()", "InvalidSetup",
    138                   FatalException, "Invalid dphi.");
    139   }
    140   fDPhi= newDPhi;
    141   Initialize();
    142   InitializeTrigonometry();
     180  CheckPhiAngles(fSPhi, newDPhi);
     181  Initialize();
    143182}
    144183
  • trunk/source/geometry/solids/CSG/src/G4Box.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Box.cc,v 1.44 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/src/G4CSGSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4CSGSolid.cc,v 1.13 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/CSG/src/G4Cons.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Cons.cc,v 1.60 2008/11/06 15:26:53 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Cons.cc,v 1.67 2009/11/12 11:53:11 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    3535// History:
    3636//
     37// 12.10.09 T.Nikitina: Added to DistanceToIn(p,v) check on the direction in
     38//                      case of point on surface
    3739// 03.05.05 V.Grichine: SurfaceNormal(p) according to J. Apostolakis proposal
    3840// 13.09.96 V.Grichine: Review and final modifications
     
    7981                      G4double pDz,
    8082                      G4double pSPhi, G4double pDPhi)
    81   : G4CSGSolid(pName)
     83  : G4CSGSolid(pName), fSPhi(0), fDPhi(0)
    8284{
    83   // Check z-len
    84 
    8585  kRadTolerance = G4GeometryTolerance::GetInstance()->GetRadialTolerance();
    8686  kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance();
    8787
     88  // Check z-len
     89  //
    8890  if ( pDz > 0 )
    8991  {
     
    100102
    101103  // Check radii
    102 
     104  //
    103105  if ( (pRmin1<pRmax1) && (pRmin2<pRmax2) && (pRmin1>=0) && (pRmin2>=0) )
    104106  {
     
    121123  }
    122124
    123   fPhiFullCone = true;
    124   if ( pDPhi >= twopi-kAngTolerance*0.5 ) // Check angles
    125   {
    126     fDPhi=twopi;
    127     fSPhi=0;
    128   }
    129   else
    130   {
    131     fPhiFullCone = false;
    132     if ( pDPhi > 0 )
    133     {
    134       fDPhi = pDPhi;
    135     }
    136     else
    137     {
    138       G4cerr << "ERROR - G4Cons()::G4Cons(): " << GetName() << G4endl
    139              << "        Negative delta-Phi ! - "
    140              << pDPhi << G4endl;
    141       G4Exception("G4Cons::G4Cons()", "InvalidSetup",
    142                   FatalException, "Invalid dphi.");
    143     }
    144 
    145     // Ensure fSphi in 0-2PI or -2PI-0 range if shape crosses 0
    146 
    147     if ( pSPhi < 0 )
    148     {
    149       fSPhi = twopi - std::fmod(std::fabs(pSPhi),twopi);
    150     }
    151     else
    152     {
    153       fSPhi = std::fmod(pSPhi,twopi) ;
    154     }
    155     if ( fSPhi+fDPhi > twopi )
    156     {
    157       fSPhi -= twopi ;
    158     }
    159   }
    160   InitializeTrigonometry();
     125  // Check angles
     126  //
     127  CheckPhiAngles(pSPhi, pDPhi);
    161128}
    162129
     
    705672{
    706673  G4double snxt = kInfinity ;      // snxt = default return value
    707 
     674  const G4double dRmax = 100*std::min(fRmax1,fRmax2);
    708675  static const G4double halfCarTolerance=kCarTolerance*0.5;
    709676  static const G4double halfRadTolerance=kRadTolerance*0.5;
     
    717684  G4double tolODz,tolIDz ;
    718685
    719   G4double Dist,s,xi,yi,zi,ri=0.,rhoi2,cosPsi ; // Intersection point variables
     686  G4double Dist,s,xi,yi,zi,ri=0.,risec,rhoi2,cosPsi ; // Intersection point vars
    720687
    721688  G4double t1,t2,t3,b,c,d ;    // Quadratic solver variables
    722689  G4double nt1,nt2,nt3 ;
    723690  G4double Comp ;
     691
     692  G4ThreeVector Normal;
    724693
    725694  // Cone Precalcs
     
    887856        if ( s > 0 )  // If 'forwards'. Check z intersection
    888857        {
     858          if ( s>dRmax ) // Avoid rounding errors due to precision issues on
     859          {              // 64 bits systems. Split long distances and recompute
     860            G4double fTerm = s-std::fmod(s,dRmax);
     861            s = fTerm + DistanceToIn(p+fTerm*v,v);
     862          }
    889863          zi = p.z() + s*v.z() ;
    890864
     
    917891      {
    918892        // Inside cones, delta r -ve, inside z extent
    919 
     893        // Point is on the Surface => check Direction using  Normal.dot(v)
     894
     895        xi     = p.x() ;
     896        yi     = p.y()  ;
     897        risec  = std::sqrt(xi*xi + yi*yi)*secRMax ;
     898        Normal = G4ThreeVector(xi/risec,yi/risec,-tanRMax/secRMax) ;
    920899        if ( !fPhiFullCone )
    921900        {
    922901          cosPsi = (p.x()*cosCPhi + p.y()*sinCPhi)/std::sqrt(t3) ;
    923 
    924           if (cosPsi >= cosHDPhiIT)  { return 0.0; }
    925         }
    926         else  { return 0.0; }
     902          if ( cosPsi >= cosHDPhiIT )
     903          {
     904            if ( Normal.dot(v) <= 0 )  { return 0.0; }
     905          }
     906        }
     907        else
     908        {             
     909          if ( Normal.dot(v) <= 0 )  { return 0.0; }
     910        }
    927911      }
    928912    }
     
    972956
    973957  if (rMinAv)
    974   {
     958  { 
    975959    nt1 = t1 - (tanRMin*v.z())*(tanRMin*v.z()) ;
    976960    nt2 = t2 - tanRMin*v.z()*rin ;
     
    993977          if ( s >= 0 )   // > 0
    994978          {
     979            if ( s>dRmax ) // Avoid rounding errors due to precision issues on
     980            {              // 64 bits systems. Split long distance and recompute
     981              G4double fTerm = s-std::fmod(s,dRmax);
     982              s = fTerm + DistanceToIn(p+fTerm*v,v);
     983            }
    995984            zi = p.z() + s*v.z() ;
    996985
     
    1004993                cosPsi = (xi*cosCPhi + yi*sinCPhi)/ri ;
    1005994
    1006                 if (cosPsi >= cosHDPhiIT)  { snxt = s; }
     995                if (cosPsi >= cosHDPhiIT)
     996                {
     997                  if ( s > halfRadTolerance )  { snxt=s; }
     998                  else
     999                  {
     1000                    // Calculate a normal vector in order to check Direction
     1001
     1002                    risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
     1003                    Normal = G4ThreeVector(-xi/risec,-yi/risec,tanRMin/secRMin);
     1004                    if ( Normal.dot(v) <= 0 )  { snxt = s; }
     1005                  }
     1006                }
    10071007              }
    1008               else  { return s; }
     1008              else
     1009              {
     1010                if ( s > halfRadTolerance )  { return s; }
     1011                else
     1012                {
     1013                  // Calculate a normal vector in order to check Direction
     1014
     1015                  xi     = p.x() + s*v.x() ;
     1016                  yi     = p.y() + s*v.y() ;
     1017                  risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
     1018                  Normal = G4ThreeVector(-xi/risec,-yi/risec,tanRMin/secRMin) ;
     1019                  if ( Normal.dot(v) <= 0 )  { return s; }
     1020                }
     1021              }
    10091022            }
    10101023          }
     
    10321045            if ( (s >= 0) && (std::fabs(zi) <= tolODz) )  // s > 0
    10331046            {
     1047              if ( s>dRmax ) // Avoid rounding errors due to precision issues
     1048              {              // seen on 64 bits systems. Split and recompute
     1049                G4double fTerm = s-std::fmod(s,dRmax);
     1050                s = fTerm + DistanceToIn(p+fTerm*v,v);
     1051              }
    10341052              if ( !fPhiFullCone )
    10351053              {
     
    10381056                cosPsi = (xi*cosCPhi + yi*sinCPhi)/ri ;
    10391057
    1040                 if (cosPsi >= cosHDPhiOT)  { snxt = s; }
     1058                if (cosPsi >= cosHDPhiOT)
     1059                {
     1060                  if ( s > halfRadTolerance )  { snxt=s; }
     1061                  else
     1062                  {
     1063                    // Calculate a normal vector in order to check Direction
     1064
     1065                    risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
     1066                    Normal = G4ThreeVector(-xi/risec,-yi/risec,tanRMin/secRMin);
     1067                    if ( Normal.dot(v) <= 0 )  { snxt = s; }
     1068                  }
     1069                }
    10411070              }
    1042               else  { return s; }
     1071              else
     1072              {
     1073                if( s > halfRadTolerance )  { return s; }
     1074                else
     1075                {
     1076                  // Calculate a normal vector in order to check Direction
     1077
     1078                  xi     = p.x() + s*v.x() ;
     1079                  yi     = p.y() + s*v.y() ;
     1080                  risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
     1081                  Normal = G4ThreeVector(-xi/risec,-yi/risec,tanRMin/secRMin) ;
     1082                  if ( Normal.dot(v) <= 0 )  { return s; }
     1083                }
     1084              }
    10431085            }
    10441086          }
     
    10511093            if ( (s >= 0) && (ri > 0) && (std::fabs(zi) <= tolODz) ) // s>0
    10521094            {
     1095              if ( s>dRmax ) // Avoid rounding errors due to precision issues
     1096              {              // seen on 64 bits systems. Split and recompute
     1097                G4double fTerm = s-std::fmod(s,dRmax);
     1098                s = fTerm + DistanceToIn(p+fTerm*v,v);
     1099              }
    10531100              if ( !fPhiFullCone )
    10541101              {
     
    10571104                cosPsi = (xi*cosCPhi + yi*sinCPhi)/ri ;
    10581105
    1059                 if (cosPsi >= cosHDPhiIT)  { snxt = s; }
     1106                if (cosPsi >= cosHDPhiIT)
     1107                {
     1108                  if ( s > halfRadTolerance )  { snxt=s; }
     1109                  else
     1110                  {
     1111                    // Calculate a normal vector in order to check Direction
     1112
     1113                    risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
     1114                    Normal = G4ThreeVector(-xi/risec,-yi/risec,tanRMin/secRMin);
     1115                    if ( Normal.dot(v) <= 0 )  { snxt = s; }
     1116                  }
     1117                }
    10601118              }
    1061               else  { return s; }
     1119              else
     1120              {
     1121                if ( s > halfRadTolerance )  { return s; }
     1122                else
     1123                {
     1124                  // Calculate a normal vector in order to check Direction
     1125
     1126                  xi     = p.x() + s*v.x() ;
     1127                  yi     = p.y() + s*v.y() ;
     1128                  risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
     1129                  Normal = G4ThreeVector(-xi/risec,-yi/risec,tanRMin/secRMin) ;
     1130                  if ( Normal.dot(v) <= 0 )  { return s; }
     1131                }
     1132              }
    10621133            }
    10631134          }
     
    10991170              zi = p.z() + s*v.z() ;
    11001171              ri = rMinAv + zi*tanRMin ;
    1101 
     1172             
    11021173              if ( ri > 0 )   // 2nd root
    11031174              {
     
    11071178                if ( (s >= 0) && (std::fabs(zi) <= tolODz) )  // s>0
    11081179                {
     1180                  if ( s>dRmax ) // Avoid rounding errors due to precision issue
     1181                  {              // seen on 64 bits systems. Split and recompute
     1182                    G4double fTerm = s-std::fmod(s,dRmax);
     1183                    s = fTerm + DistanceToIn(p+fTerm*v,v);
     1184                  }
    11091185                  if ( !fPhiFullCone )
    11101186                  {
     
    11361212            if ( (s >= 0) && (std::fabs(zi) <= tolODz) )  // s>0
    11371213            {
     1214              if ( s>dRmax ) // Avoid rounding errors due to precision issues
     1215              {              // seen on 64 bits systems. Split and recompute
     1216                G4double fTerm = s-std::fmod(s,dRmax);
     1217                s = fTerm + DistanceToIn(p+fTerm*v,v);
     1218              }
    11381219              if ( !fPhiFullCone )
    11391220              {
     
    13351416  // Vars for intersection within tolerance
    13361417
    1337   ESide    sidetol ;
     1418  ESide    sidetol = kNull ;
    13381419  G4double slentol = kInfinity ;
    13391420
     
    16691750            xi     = p.x() + slentol*v.x() ;
    16701751            yi     = p.y() + slentol*v.y() ;
    1671             risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
    1672             Normal = G4ThreeVector(xi/risec,yi/risec,-tanRMin/secRMin) ;
    1673            
     1752            if( sidetol==kRMax )
     1753            {
     1754              risec  = std::sqrt(xi*xi + yi*yi)*secRMax ;
     1755              Normal = G4ThreeVector(xi/risec,yi/risec,-tanRMax/secRMax) ;
     1756            }
     1757            else
     1758            {
     1759              risec  = std::sqrt(xi*xi + yi*yi)*secRMin ;
     1760              Normal = G4ThreeVector(-xi/risec,-yi/risec,tanRMin/secRMin) ;
     1761            }
    16741762            if( Normal.dot(v) > 0 )
    16751763            {
  • trunk/source/geometry/solids/CSG/src/G4Orb.cc

    r1058 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Orb.cc,v 1.24 2007/05/18 07:38:01 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4Orb.cc,v 1.30 2009/11/30 10:20:38 gcosmo Exp $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// class G4Orb
     
    298298  rad2 = p.x()*p.x()+p.y()*p.y()+p.z()*p.z() ;
    299299
     300  G4double rad = std::sqrt(rad2);
     301
    300302  // G4double rad = std::sqrt(rad2);
    301303  // Check radial surface
     
    304306  tolRMax = fRmax - fRmaxTolerance*0.5 ;
    305307   
    306   if ( rad2 <= tolRMax*tolRMax )  in = kInside ;
     308  if ( rad <= tolRMax )  { in = kInside ; }
    307309  else
    308310  {
    309311    tolRMax = fRmax + fRmaxTolerance*0.5 ;       
    310     if ( rad2 <= tolRMax*tolRMax ) in = kSurface ;
    311     else                           in = kOutside ;
     312    if ( rad <= tolRMax )  { in = kSurface ; }
     313    else                   { in = kOutside ; }
    312314  }
    313315  return in;
     
    360362  G4double c, d2, s = kInfinity ;
    361363
     364  const G4double dRmax = 100.*fRmax;
     365
    362366  // General Precalcs
    363367
     
    384388  // => s=-pDotV3d+-std::sqrt(pDotV3d^2-(rad2-R^2))
    385389
    386   c = rad2 - fRmax*fRmax ;
     390
     391  G4double rad = std::sqrt(rad2);
     392  c = (rad - fRmax)*(rad + fRmax);
    387393
    388394  if ( c > fRmaxTolerance*fRmax )
     
    396402    {
    397403      s = -pDotV3d - std::sqrt(d2) ;
    398 
    399       if (s >= 0 ) return snxt = s;
    400            
     404      if ( s >= 0 )
     405      {
     406        if ( s>dRmax ) // Avoid rounding errors due to precision issues seen on
     407        {              // 64 bits systems. Split long distances and recompute
     408          G4double fTerm = s-std::fmod(s,dRmax);
     409          s = fTerm + DistanceToIn(p+fTerm*v,v);
     410        }
     411        return snxt = s;
     412      }
    401413    }
    402414    else    // No intersection with G4Orb
     
    410422    {
    411423      d2 = pDotV3d*pDotV3d - c ;             
    412       //  if ( pDotV3d >= 0 ) return snxt = kInfinity;
    413       if ( d2 < fRmaxTolerance*fRmax || pDotV3d >= 0 ) return snxt = kInfinity;
    414       else                return snxt = 0.;
    415     }
     424      if ( (d2 < fRmaxTolerance*fRmax) || (pDotV3d >= 0) )
     425      {
     426        return snxt = kInfinity;
     427      }
     428      else
     429      {
     430        return snxt = 0.;
     431      }
     432    }
     433#ifdef G4CSGDEBUG
    416434    else // inside ???
    417435    {
     
    419437                  JustWarning, "Point p is inside !?");
    420438    }
     439#endif
    421440  }
    422441  return snxt;
     
    431450G4double G4Orb::DistanceToIn( const G4ThreeVector& p ) const
    432451{
    433   G4double safe=0.0, rad  = std::sqrt(p.x()*p.x()+p.y()*p.y()+p.z()*p.z());
    434                  safe = rad - fRmax;
    435   if( safe < 0 ) safe = 0. ;
     452  G4double safe = 0.0,
     453           rad  = std::sqrt(p.x()*p.x()+p.y()*p.y()+p.z()*p.z());
     454  safe = rad - fRmax;
     455  if( safe < 0 ) { safe = 0.; }
    436456  return safe;
    437457}
     
    475495 
    476496  const G4double  Rmax_plus = fRmax + fRmaxTolerance*0.5;
    477 
    478   if( rad2 <= Rmax_plus*Rmax_plus )
    479   {
    480     c = rad2-fRmax*fRmax ;
    481 
    482     if ( c < fRmaxTolerance*fRmax)
     497  G4double rad = std::sqrt(rad2);
     498
     499  if ( rad <= Rmax_plus )
     500  {
     501    c = (rad - fRmax)*(rad + fRmax);
     502
     503    if ( c < fRmaxTolerance*fRmax )
    483504    {
    484505      // Within tolerant Outer radius
  • trunk/source/geometry/solids/CSG/src/G4Para.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Para.cc,v 1.39 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4Para
  • trunk/source/geometry/solids/CSG/src/G4Sphere.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Sphere.cc,v 1.68 2008/07/07 09:35:16 grichine Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Sphere.cc,v 1.84 2009/08/07 15:56:23 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4Sphere
     
    3434// History:
    3535//
     36// 14.09.09 T.Nikitina: fix for phi section in DistanceToOut(p,v,..),as for G4Tubs,G4Cons
     37// 26.03.09 G.Cosmo   : optimisations and uniform use of local radial tolerance
    3638// 12.06.08 V.Grichine: fix for theta intersections in DistanceToOut(p,v,...)
    3739// 22.07.05 O.Link    : Added check for intersection with double cone
     
    4143// 02.06.04 V.Grichine: bug fixed in DistanceToIn(p,v), on Rmax,Rmin go inside
    4244// 30.10.03 J.Apostolakis: new algorithm in Inside for SPhi-sections
    43 // 29.10.03 J.Apostolakis: fix in Inside for SPhi-0.5*kAngTol < phi < SPhi, SPhi<0
     45// 29.10.03 J.Apostolakis: fix in Inside for SPhi-0.5*kAngTol < phi<SPhi, SPhi<0
    4446// 19.06.02 V.Grichine: bug fixed in Inside(p), && -> && fDTheta - kAngTolerance
    4547// 30.01.02 V.Grichine: bug fixed in Inside(p), && -> || at l.451
     
    5355// --------------------------------------------------------------------
    5456
    55 #include <assert.h>
    56 
    5757#include "G4Sphere.hh"
    5858
     
    9292                          G4double pSPhi, G4double pDPhi,
    9393                          G4double pSTheta, G4double pDTheta )
    94   : G4CSGSolid(pName)
     94  : G4CSGSolid(pName), fFullPhiSphere(true), fFullThetaSphere(true)
    9595{
    96   fEpsilon = 1.0e-14;
    97 
    98   kRadTolerance = G4GeometryTolerance::GetInstance()->GetRadialTolerance();
     96  fEpsilon = 2.0e-11;  // relative radial tolerance constant
     97
    9998  kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance();
    10099
    101   // Check radii
    102 
    103   if (pRmin<pRmax&&pRmin>=0)
     100  // Check radii and set radial tolerances
     101
     102  G4double kRadTolerance = G4GeometryTolerance::GetInstance()
     103                         ->GetRadialTolerance();
     104  if ( (pRmin < pRmax) && (pRmax >= 10*kRadTolerance) && (pRmin >= 0) )
    104105  {
    105106    fRmin=pRmin; fRmax=pRmax;
     107    fRminTolerance = (pRmin) ? std::max( kRadTolerance, fEpsilon*fRmin ) : 0;
     108    fRmaxTolerance = std::max( kRadTolerance, fEpsilon*fRmax );
    106109  }
    107110  else
     
    116119  // Check angles
    117120
    118   if (pDPhi>=twopi)
    119   {
    120     fDPhi=twopi;
    121   }
    122   else if (pDPhi>0)
    123   {
    124     fDPhi=pDPhi;
    125   }
    126   else
    127   {
    128     G4cerr << "ERROR - G4Sphere()::G4Sphere(): " << GetName() << G4endl
    129            << "        Negative Z delta-Phi ! - "
    130            << pDPhi << G4endl;
    131     G4Exception("G4Sphere::G4Sphere()", "InvalidSetup", FatalException,
    132                 "Invalid DPhi.");
    133   }
    134 
    135   // Convert fSPhi to 0-2PI
    136 
    137   if (pSPhi<0)
    138   {
    139     fSPhi=twopi-std::fmod(std::fabs(pSPhi),twopi);
    140   }
    141   else
    142   {
    143     fSPhi=std::fmod(pSPhi,twopi);
    144   }
    145 
    146   // Sphere is placed such that fSPhi+fDPhi>twopi !
    147   // fSPhi could be < 0 !!?
    148   //
    149   if (fSPhi+fDPhi>twopi) fSPhi-=twopi;
    150 
    151   // Check theta angles
    152 
    153   if (pSTheta<0 || pSTheta>pi)
    154   {
    155     G4cerr << "ERROR - G4Sphere()::G4Sphere(): " << GetName() << G4endl;
    156     G4Exception("G4Sphere::G4Sphere()", "InvalidSetup", FatalException,
    157                 "stheta outside 0-PI range.");
    158   }
    159   else
    160   {
    161     fSTheta=pSTheta;
    162   }
    163 
    164   if (pDTheta+pSTheta>=pi)
    165   {
    166     fDTheta=pi-pSTheta;
    167   }
    168   else if (pDTheta>0)
    169   {
    170     fDTheta=pDTheta;
    171   }
    172   else
    173   {
    174     G4cerr << "ERROR - G4Sphere()::G4Sphere(): " << GetName() << G4endl
    175            << "        Negative delta-Theta ! - "
    176            << pDTheta << G4endl;
    177     G4Exception("G4Sphere::G4Sphere()", "InvalidSetup", FatalException,
    178                 "Invalid pDTheta.");
    179   }
     121  CheckPhiAngles(pSPhi, pDPhi);
     122  CheckThetaAngles(pSTheta, pDTheta);
    180123}
    181124
     
    219162                                        G4double& pMin, G4double& pMax ) const
    220163{
    221   if ( fDPhi==twopi && fDTheta==pi)  // !pTransform.IsRotated() &&
     164  if ( fFullSphere )
    222165  {
    223166    // Special case handling for solid spheres-shells
     
    310253        yoff1=yoffset-yMin;
    311254        yoff2=yMax-yoffset;
    312         if (yoff1>=0&&yoff2>=0)
     255        if ((yoff1>=0) && (yoff2>=0))
    313256        {
    314257          // Y limits cross max/min x => no change
     
    334277        xoff1=xoffset-xMin;
    335278        xoff2=xMax-xoffset;
    336         if (xoff1>=0&&xoff2>=0)
     279        if ((xoff1>=0) && (xoff2>=0))
    337280        {
    338281          // X limits cross max/min y => no change
     
    416359    }
    417360     
    418     if (pMin!=kInfinity || pMax!=-kInfinity)
     361    if ((pMin!=kInfinity) || (pMax!=-kInfinity))
    419362    {
    420363      existsAfterClip=true;
     
    453396// Return whether point inside/outside/on surface
    454397// Split into radius, phi, theta checks
    455 // Each check modifies `in', or returns as approprate
     398// Each check modifies 'in', or returns as approprate
    456399
    457400EInside G4Sphere::Inside( const G4ThreeVector& p ) const
     
    459402  G4double rho,rho2,rad2,tolRMin,tolRMax;
    460403  G4double pPhi,pTheta;
    461   EInside in=kOutside;
     404  EInside in = kOutside;
     405  static const G4double halfAngTolerance = kAngTolerance*0.5;
     406  const G4double halfRmaxTolerance = fRmaxTolerance*0.5;
     407  const G4double halfRminTolerance = fRminTolerance*0.5;
     408  const G4double Rmax_minus = fRmax - halfRmaxTolerance;
     409  const G4double Rmin_plus  = (fRmin > 0) ? fRmin+halfRminTolerance : 0;
    462410
    463411  rho2 = p.x()*p.x() + p.y()*p.y() ;
    464412  rad2 = rho2 + p.z()*p.z() ;
    465413
    466   //  if(rad2 >= 1.369e+19) DBG();
    467   //  G4double rad = std::sqrt(rad2);
    468   // Check radial surfaces
    469   // sets `in'
    470 
    471   if ( fRmin ) tolRMin = fRmin + kRadTolerance*0.5;
    472   else         tolRMin = 0 ;
    473  
    474   tolRMax = fRmax - kRadTolerance*0.5 ;
    475   //  const G4double  fractionTolerance = 1.0e-12;
    476   const G4double  flexRadMaxTolerance = // kRadTolerance;
    477     std::max(kRadTolerance, fEpsilon * fRmax);
    478 
    479   const G4double  Rmax_minus = fRmax - flexRadMaxTolerance*0.5;
    480   const G4double  flexRadMinTolerance = std::max(kRadTolerance,
    481                      fEpsilon * fRmin);
    482   const G4double  Rmin_plus = (fRmin > 0) ? fRmin + flexRadMinTolerance*0.5 : 0 ;
     414  // Check radial surfaces. Sets 'in'
     415
     416  tolRMin = Rmin_plus;
     417  tolRMax = Rmax_minus;
     418
     419  if ( (rad2 <= Rmax_minus*Rmax_minus) && (rad2 >= Rmin_plus*Rmin_plus) )
     420  {
     421    in = kInside;
     422  }
     423  else
     424  {
     425    tolRMax = fRmax + halfRmaxTolerance;                  // outside case
     426    tolRMin = std::max(fRmin-halfRminTolerance, 0.);      // outside case
     427    if ( (rad2 <= tolRMax*tolRMax) && (rad2 >= tolRMin*tolRMin) )
     428    {
     429      in = kSurface;
     430    }
     431    else
     432    {
     433      return in = kOutside;
     434    }
     435  }
     436
     437  // Phi boundaries   : Do not check if it has no phi boundary!
     438
     439  if ( !fFullPhiSphere && rho2 )  // [fDPhi < twopi] and [p.x or p.y]
     440  {
     441    pPhi = std::atan2(p.y(),p.x()) ;
     442
     443    if      ( pPhi < fSPhi - halfAngTolerance  ) { pPhi += twopi; }
     444    else if ( pPhi > ePhi + halfAngTolerance )   { pPhi -= twopi; }
    483445   
    484 if(rad2 <= Rmax_minus*Rmax_minus && rad2 >= Rmin_plus*Rmin_plus) in = kInside ;
    485 
    486 // if ( rad2 <= tolRMax*tolRMax && rad2 >= tolRMin*tolRMin )  in = kInside ;
    487   // if ( rad <= tolRMax && rad >= tolRMin )  in = kInside ;
    488   else
    489   {
    490     tolRMax = fRmax + kRadTolerance*0.5 ;
    491     tolRMin = fRmin - kRadTolerance*0.5 ;
    492 
    493     if ( tolRMin < 0.0 ) tolRMin = 0.0 ;
    494    
    495      if ( rad2 <= tolRMax*tolRMax && rad2 >= tolRMin*tolRMin )  in = kSurface ;
    496     //  if ( rad <= tolRMax && rad >= tolRMin )  in = kSurface ;
    497     else                                                return in = kOutside ;
    498   }
    499 
    500   // Phi boundaries   : Do not check if it has no phi boundary!
    501   // (in != kOutside). It is new J.Apostolakis proposal of 30.10.03
    502 
    503   if ( ( fDPhi < twopi - kAngTolerance ) &&
    504        ( (p.x() != 0.0 ) || (p.y() != 0.0) ) )
    505   {
    506     pPhi = std::atan2(p.y(),p.x()) ;
    507 
    508     if      ( pPhi < fSPhi - kAngTolerance*0.5  )         pPhi += twopi ;
    509     else if ( pPhi > fSPhi + fDPhi + kAngTolerance*0.5 )  pPhi -= twopi;
    510    
    511     if ((pPhi < fSPhi - kAngTolerance*0.5) || 
    512         (pPhi > fSPhi + fDPhi + kAngTolerance*0.5) )  return in = kOutside ;
     446    if ( (pPhi < fSPhi - halfAngTolerance)
     447      || (pPhi > ePhi + halfAngTolerance) )      { return in = kOutside; }
    513448   
    514449    else if (in == kInside)  // else it's kSurface anyway already
    515450    {
    516       if ( (pPhi < fSPhi + kAngTolerance*0.5) ||
    517            (pPhi > fSPhi + fDPhi - kAngTolerance*0.5) )      in = kSurface ;       
     451      if ( (pPhi < fSPhi + halfAngTolerance)
     452        || (pPhi > ePhi - halfAngTolerance) )    { in = kSurface; }     
    518453    }
    519454  }
    520455
    521456  // Theta bondaries
    522   // (in!=kOutside)
    523457 
    524   if ( (rho2 || p.z()) && fDTheta < pi - kAngTolerance*0.5 )
     458  if ( (rho2 || p.z()) && (!fFullThetaSphere) )
    525459  {
    526460    rho    = std::sqrt(rho2);
     
    529463    if ( in == kInside )
    530464    {
    531       if ( (pTheta < fSTheta + kAngTolerance*0.5)
    532         || (pTheta > fSTheta + fDTheta - kAngTolerance*0.5) )
    533       {
    534         if ( (pTheta >= fSTheta - kAngTolerance*0.5)
    535           && (pTheta <= fSTheta + fDTheta + kAngTolerance*0.5) )
    536         {
    537           in = kSurface ;
     465      if ( (pTheta < fSTheta + halfAngTolerance)
     466        || (pTheta > eTheta - halfAngTolerance) )
     467      {
     468        if ( (pTheta >= fSTheta - halfAngTolerance)
     469          && (pTheta <= eTheta + halfAngTolerance) )
     470        {
     471          in = kSurface;
    538472        }
    539473        else
    540474        {
    541           in = kOutside ;
     475          in = kOutside;
    542476        }
    543477      }
     
    545479    else
    546480    {
    547       if ( (pTheta < fSTheta - kAngTolerance*0.5)
    548         || (pTheta > fSTheta + fDTheta + kAngTolerance*0.5) )
    549       {
    550         in = kOutside ;
     481      if ( (pTheta < fSTheta - halfAngTolerance)
     482        || (pTheta > eTheta + halfAngTolerance) )
     483      {
     484        in = kOutside;
    551485      }
    552486    }
     
    568502  G4double distSPhi = kInfinity, distEPhi = kInfinity;
    569503  G4double distSTheta = kInfinity, distETheta = kInfinity;
    570   G4double delta = 0.5*kCarTolerance, dAngle = 0.5*kAngTolerance;
    571504  G4ThreeVector nR, nPs, nPe, nTs, nTe, nZ(0.,0.,1.);
    572505  G4ThreeVector norm, sumnorm(0.,0.,0.);
     506
     507  static const G4double halfCarTolerance = 0.5*kCarTolerance;
     508  static const G4double halfAngTolerance = 0.5*kAngTolerance;
    573509
    574510  rho2 = p.x()*p.x()+p.y()*p.y();
     
    579515  if (fRmin)  distRMin = std::fabs(rad-fRmin);
    580516   
    581   if ( rho && (fDPhi < twopi || fDTheta < pi) )
     517  if ( rho && !fFullSphere )
    582518  {
    583519    pPhi = std::atan2(p.y(),p.x());
    584520
    585     if(pPhi  < fSPhi-dAngle)           pPhi     += twopi;
    586     else if(pPhi > fSPhi+fDPhi+dAngle) pPhi     -= twopi;
    587   }
    588   if ( fDPhi < twopi ) // && rho ) // old limitation against (0,0,z)
     521    if (pPhi < fSPhi-halfAngTolerance)     { pPhi += twopi; }
     522    else if (pPhi > ePhi+halfAngTolerance) { pPhi -= twopi; }
     523  }
     524  if ( !fFullPhiSphere )
    589525  {
    590526    if ( rho )
    591527    {
    592       distSPhi = std::fabs( pPhi - fSPhi );
    593       distEPhi = std::fabs(pPhi-fSPhi-fDPhi);
     528      distSPhi = std::fabs( pPhi-fSPhi );
     529      distEPhi = std::fabs( pPhi-ePhi );
    594530    }
    595531    else if( !fRmin )
     
    598534      distEPhi = 0.;
    599535    }
    600     nPs = G4ThreeVector(std::sin(fSPhi),-std::cos(fSPhi),0);
    601     nPe = G4ThreeVector(-std::sin(fSPhi+fDPhi),std::cos(fSPhi+fDPhi),0);
     536    nPs = G4ThreeVector(sinSPhi,-cosSPhi,0);
     537    nPe = G4ThreeVector(-sinEPhi,cosEPhi,0);
    602538  }       
    603   if ( fDTheta < pi ) // && rad ) // old limitation against (0,0,0)
     539  if ( !fFullThetaSphere )
    604540  {
    605541    if ( rho )
     
    607543      pTheta     = std::atan2(rho,p.z());
    608544      distSTheta = std::fabs(pTheta-fSTheta);
    609       distETheta = std::fabs(pTheta-fSTheta-fDTheta);
     545      distETheta = std::fabs(pTheta-eTheta);
    610546 
    611       nTs = G4ThreeVector(-std::cos(fSTheta)*p.x()/rho, //  *std::cos(pPhi),
    612                           -std::cos(fSTheta)*p.y()/rho, //  *std::sin(pPhi),
    613                            std::sin(fSTheta)                   );
    614 
    615       nTe = G4ThreeVector( std::cos(fSTheta+fDTheta)*p.x()/rho, // *std::cos(pPhi),
    616                            std::cos(fSTheta+fDTheta)*p.y()/rho, // *std::sin(pPhi),
    617                           -std::sin(fSTheta+fDTheta)                  );   
     547      nTs = G4ThreeVector(-cosSTheta*p.x()/rho,
     548                          -cosSTheta*p.y()/rho,
     549                           sinSTheta          );
     550
     551      nTe = G4ThreeVector( cosETheta*p.x()/rho,
     552                           cosETheta*p.y()/rho,
     553                          -sinETheta          );   
    618554    }
    619555    else if( !fRmin )
     
    622558      {             
    623559        distSTheta = 0.;
    624         nTs = G4ThreeVector(0.,0.,-1.);
    625       }
    626       if ( fSTheta + fDTheta < pi ) // distETheta = 0.;
     560        nTs = G4ThreeVector(0.,0.,-1.);
     561      }
     562      if ( eTheta < pi )
    627563      {             
    628564        distETheta = 0.;
    629         nTe = G4ThreeVector(0.,0.,1.);
     565        nTe = G4ThreeVector(0.,0.,1.);
    630566      }
    631567    }   
    632568  }
    633   if( rad )  nR = G4ThreeVector(p.x()/rad,p.y()/rad,p.z()/rad);
    634 
    635   if( distRMax <= delta )
     569  if( rad )  { nR = G4ThreeVector(p.x()/rad,p.y()/rad,p.z()/rad); }
     570
     571  if( distRMax <= halfCarTolerance )
    636572  {
    637573    noSurfaces ++;
    638574    sumnorm += nR;
    639575  }
    640   if( fRmin && distRMin <= delta )
     576  if( fRmin && (distRMin <= halfCarTolerance) )
    641577  {
    642578    noSurfaces ++;
    643579    sumnorm -= nR;
    644580  }
    645   if( fDPhi < twopi )   
    646   {
    647     if (distSPhi <= dAngle)
     581  if( !fFullPhiSphere )   
     582  {
     583    if (distSPhi <= halfAngTolerance)
    648584    {
    649585      noSurfaces ++;
    650586      sumnorm += nPs;
    651587    }
    652     if (distEPhi <= dAngle)
     588    if (distEPhi <= halfAngTolerance)
    653589    {
    654590      noSurfaces ++;
     
    656592    }
    657593  }
    658   if ( fDTheta < pi )
    659   {
    660     if (distSTheta <= dAngle && fSTheta > 0.)
     594  if ( !fFullThetaSphere )
     595  {
     596    if ((distSTheta <= halfAngTolerance) && (fSTheta > 0.))
    661597    {
    662598      noSurfaces ++;
    663       if( rad <= delta && fDPhi >= twopi) sumnorm += nZ;
    664       else                                sumnorm += nTs;
    665     }
    666     if (distETheta <= dAngle && fSTheta+fDTheta < pi)
     599      if ((rad <= halfCarTolerance) && fFullPhiSphere)  { sumnorm += nZ;  }
     600      else                                              { sumnorm += nTs; }
     601    }
     602    if ((distETheta <= halfAngTolerance) && (eTheta < pi))
    667603    {
    668604      noSurfaces ++;
    669       if( rad <= delta && fDPhi >= twopi) sumnorm -= nZ;
    670       else                                sumnorm += nTe;
    671       if(sumnorm.z() == 0.)               sumnorm += nZ;
     605      if ((rad <= halfCarTolerance) && fFullPhiSphere)  { sumnorm -= nZ;  }
     606      else                                              { sumnorm += nTe; }
     607      if(sumnorm.z() == 0.)  { sumnorm += nZ; }
    672608    }
    673609  }
     
    680616     norm = ApproxSurfaceNormal(p);
    681617  }
    682   else if ( noSurfaces == 1 ) norm = sumnorm;
    683   else                        norm = sumnorm.unit();
     618  else if ( noSurfaces == 1 )  { norm = sumnorm; }
     619  else                         { norm = sumnorm.unit(); }
    684620  return norm;
    685621}
     
    735671   
    736672  pPhi = std::atan2(p.y(),p.x());
    737   if (pPhi<0) pPhi += twopi;
    738 
    739   if (fDPhi<twopi&&rho)
     673  if (pPhi<0) { pPhi += twopi; }
     674
     675  if (!fFullPhiSphere && rho)
    740676  {
    741677    if (fSPhi<0)
     
    774710  //
    775711
    776   if (fDTheta<pi&&rad)
     712  if (!fFullThetaSphere && rad)
    777713  {
    778714    pTheta=std::atan2(rho,p.z());
     
    809745      break;
    810746    case kNSPhi:
    811       norm=G4ThreeVector(std::sin(fSPhi),-std::cos(fSPhi),0);
     747      norm=G4ThreeVector(sinSPhi,-cosSPhi,0);
    812748      break;
    813749    case kNEPhi:
    814       norm=G4ThreeVector(-std::sin(fSPhi+fDPhi),std::cos(fSPhi+fDPhi),0);
     750      norm=G4ThreeVector(-sinEPhi,cosEPhi,0);
    815751      break;
    816752    case kNSTheta:
    817       norm=G4ThreeVector(-std::cos(fSTheta)*std::cos(pPhi),
    818                          -std::cos(fSTheta)*std::sin(pPhi),
    819                           std::sin(fSTheta)            );
    820       //  G4cout<<G4endl<<" case kNSTheta:"<<G4endl;
    821       //  G4cout<<"pPhi = "<<pPhi<<G4endl;
    822       //  G4cout<<"rad  = "<<rad<<G4endl;
    823       //  G4cout<<"pho  = "<<rho<<G4endl;
    824       //  G4cout<<"p:    "<<p.x()<<"; "<<p.y()<<"; "<<p.z()<<G4endl;
    825       //  G4cout<<"norm: "<<norm.x()<<"; "<<norm.y()<<"; "<<norm.z()<<G4endl;
     753      norm=G4ThreeVector(-cosSTheta*std::cos(pPhi),
     754                         -cosSTheta*std::sin(pPhi),
     755                          sinSTheta            );
    826756      break;
    827757    case kNETheta:
    828       norm=G4ThreeVector( std::cos(fSTheta+fDTheta)*std::cos(pPhi),
    829                           std::cos(fSTheta+fDTheta)*std::sin(pPhi),
    830                          -std::sin(fSTheta+fDTheta)              );
    831 
    832       //  G4cout<<G4endl<<" case kNETheta:"<<G4endl;
    833       //  G4cout<<"pPhi = "<<pPhi<<G4endl;
    834       //  G4cout<<"rad  = "<<rad<<G4endl;
    835       //  G4cout<<"pho  = "<<rho<<G4endl;
    836       //  G4cout<<"p:    "<<p.x()<<"; "<<p.y()<<"; "<<p.z()<<G4endl;
    837       //  G4cout<<"norm: "<<norm.x()<<"; "<<norm.y()<<"; "<<norm.z()<<G4endl;
     758      norm=G4ThreeVector( cosETheta*std::cos(pPhi),
     759                          cosETheta*std::sin(pPhi),
     760                         -sinETheta              );
    838761      break;
    839762    default:
    840763      DumpInfo();
    841       G4Exception("G4Sphere::ApproxSurfaceNormal()", "Notification", JustWarning,
     764      G4Exception("G4Sphere::ApproxSurfaceNormal()","Notification",JustWarning,
    842765                  "Undefined side for valid surface normal to solid.");
    843766      break;   
    844   } // end case
     767  }
    845768
    846769  return norm;
     
    880803{
    881804  G4double snxt = kInfinity ;      // snxt = default return value
    882 
    883805  G4double rho2, rad2, pDotV2d, pDotV3d, pTheta ;
    884 
    885   G4double tolIRMin2, tolORMin2, tolORMax2, tolIRMax2 ;
    886806  G4double tolSTheta=0., tolETheta=0. ;
     807  const G4double dRmax = 100.*fRmax;
     808
     809  static const G4double halfCarTolerance = kCarTolerance*0.5;
     810  static const G4double halfAngTolerance = kAngTolerance*0.5;
     811  const G4double halfRmaxTolerance = fRmaxTolerance*0.5;
     812  const G4double halfRminTolerance = fRminTolerance*0.5;
     813  const G4double tolORMin2 = (fRmin>halfRminTolerance)
     814               ? (fRmin-halfRminTolerance)*(fRmin-halfRminTolerance) : 0;
     815  const G4double tolIRMin2 =
     816               (fRmin+halfRminTolerance)*(fRmin+halfRminTolerance);
     817  const G4double tolORMax2 =
     818               (fRmax+halfRmaxTolerance)*(fRmax+halfRmaxTolerance);
     819  const G4double tolIRMax2 =
     820               (fRmax-halfRmaxTolerance)*(fRmax-halfRmaxTolerance);
    887821
    888822  // Intersection point
    889 
     823  //
    890824  G4double xi, yi, zi, rhoi, rhoi2, radi2, iTheta ;
    891825
    892826  // Phi intersection
    893 
    894   G4double sinSPhi, cosSPhi, ePhi, sinEPhi, cosEPhi , Comp ;
    895 
    896   // Phi flag and precalcs
    897 
    898   G4bool segPhi ;       
    899   G4double hDPhi, hDPhiOT, hDPhiIT, cPhi, sinCPhi=0., cosCPhi=0. ;
    900   G4double cosHDPhiOT=0., cosHDPhiIT=0. ;
     827  //
     828  G4double Comp ;
     829
     830  // Phi precalcs
     831  //
    901832  G4double Dist, cosPsi ;
    902833
    903   G4bool segTheta ;                             // Theta flag and precals
    904   G4double tanSTheta, tanETheta ;
    905   G4double tanSTheta2, tanETheta2 ;
     834  // Theta precalcs
     835  //
    906836  G4double dist2STheta, dist2ETheta ;
    907837  G4double t1, t2, b, c, d2, d, s = kInfinity ;
    908838
    909839  // General Precalcs
    910 
     840  //
    911841  rho2 = p.x()*p.x() + p.y()*p.y() ;
    912842  rad2 = rho2 + p.z()*p.z() ;
     
    916846  pDotV3d = pDotV2d + p.z()*v.z() ;
    917847
    918   // Radial Precalcs
    919 
    920   if (fRmin > kRadTolerance*0.5)
    921   {
    922     tolORMin2=(fRmin-kRadTolerance*0.5)*(fRmin-kRadTolerance*0.5);
    923   }
    924   else
    925   {
    926     tolORMin2 = 0 ;
    927   }
    928   tolIRMin2 = (fRmin+kRadTolerance*0.5)*(fRmin+kRadTolerance*0.5) ;
    929   tolORMax2 = (fRmax+kRadTolerance*0.5)*(fRmax+kRadTolerance*0.5) ;
    930   tolIRMax2 = (fRmax-kRadTolerance*0.5)*(fRmax-kRadTolerance*0.5) ;
    931 
    932   // Set phi divided flag and precalcs
    933 
    934   if (fDPhi < twopi)
    935   {
    936     segPhi = true ;
    937     hDPhi = 0.5*fDPhi ;    // half delta phi
    938     cPhi = fSPhi + hDPhi ;
    939 
    940     hDPhiOT = hDPhi+0.5*kAngTolerance; // Outer Tolerant half delta phi
    941     hDPhiIT = hDPhi-0.5*kAngTolerance;
    942 
    943     sinCPhi    = std::sin(cPhi) ;
    944     cosCPhi    = std::cos(cPhi) ;
    945     cosHDPhiOT = std::cos(hDPhiOT) ;
    946     cosHDPhiIT = std::cos(hDPhiIT) ;
    947   }
    948   else
    949   {
    950     segPhi = false ;
    951   }
    952 
    953848  // Theta precalcs
    954    
    955   if (fDTheta < pi )
    956   {
    957     segTheta  = true ;
    958     tolSTheta = fSTheta - kAngTolerance*0.5 ;
    959     tolETheta = fSTheta + fDTheta + kAngTolerance*0.5 ;
    960   }
    961   else
    962   {
    963     segTheta = false ;
     849  //
     850  if (!fFullThetaSphere)
     851  {
     852    tolSTheta = fSTheta - halfAngTolerance ;
     853    tolETheta = eTheta + halfAngTolerance ;
    964854  }
    965855
     
    979869
    980870  c = rad2 - fRmax*fRmax ;
    981   const G4double  flexRadMaxTolerance = // kRadTolerance;
    982     std::max(kRadTolerance, fEpsilon * fRmax);
    983 
    984   //  if (c > kRadTolerance*fRmax)
    985   if (c > flexRadMaxTolerance*fRmax)
    986   {
    987     // If outside toleranct boundary of outer G4Sphere
    988     // [should be std::sqrt(rad2)-fRmax > kRadTolerance*0.5]
     871
     872  if (c > fRmaxTolerance*fRmax)
     873  {
     874    // If outside tolerant boundary of outer G4Sphere
     875    // [should be std::sqrt(rad2)-fRmax > halfRmaxTolerance]
    989876
    990877    d2 = pDotV3d*pDotV3d - c ;
     
    996883      if (s >= 0 )
    997884      {
     885        if ( s>dRmax ) // Avoid rounding errors due to precision issues seen on
     886        {              // 64 bits systems. Split long distances and recompute
     887          G4double fTerm = s-std::fmod(s,dRmax);
     888          s = fTerm + DistanceToIn(p+fTerm*v,v);
     889        }
    998890        xi   = p.x() + s*v.x() ;
    999891        yi   = p.y() + s*v.y() ;
    1000892        rhoi = std::sqrt(xi*xi + yi*yi) ;
    1001893
    1002         if (segPhi && rhoi)    // Check phi intersection
     894        if (!fFullPhiSphere && rhoi)    // Check phi intersection
    1003895        {
    1004896          cosPsi = (xi*cosCPhi + yi*sinCPhi)/rhoi ;
     
    1006898          if (cosPsi >= cosHDPhiOT)
    1007899          {
    1008             if (segTheta)   // Check theta intersection
     900            if (!fFullThetaSphere)   // Check theta intersection
    1009901            {
    1010902              zi = p.z() + s*v.z() ;
     
    1027919        else
    1028920        {
    1029           if (segTheta)    // Check theta intersection
     921          if (!fFullThetaSphere)    // Check theta intersection
    1030922          {
    1031923            zi = p.z() + s*v.z() ;
     
    1059951    d2 = pDotV3d*pDotV3d - c ;
    1060952
    1061     // if (rad2 > tolIRMin2 && pDotV3d < 0 )
    1062 
    1063     if (rad2 > tolIRMax2 && ( d2 >= flexRadMaxTolerance*fRmax && pDotV3d < 0 ) )
    1064     {
    1065       if (segPhi)
     953    if ( (rad2 > tolIRMax2)
     954      && ( (d2 >= fRmaxTolerance*fRmax) && (pDotV3d < 0) ) )
     955    {
     956      if (!fFullPhiSphere)
    1066957      {
    1067958        // Use inner phi tolerant boundary -> if on tolerant
     
    1074965          // inside radii, delta r -ve, inside phi
    1075966
    1076           if (segTheta)
     967          if ( !fFullThetaSphere )
    1077968          {
    1078969            if ( (pTheta >= tolSTheta + kAngTolerance)
     
    1090981      else
    1091982      {
    1092         if ( segTheta )
     983        if ( !fFullThetaSphere )
    1093984        {
    1094985          if ( (pTheta >= tolSTheta + kAngTolerance)
     
    11091000  // - Always farthest root, because would have passed through outer
    11101001  //   surface first.
    1111   // - Tolerant check for if travelling through solid
     1002  // - Tolerant check if travelling through solid
    11121003
    11131004  if (fRmin)
     
    11191010    // Check for immediate entry/already inside and travelling outwards
    11201011
    1121     // if (c >- kRadTolerance*0.5 && pDotV3d >= 0 && rad2 < tolIRMin2 )
    1122 
    1123     if ( c > -kRadTolerance*0.5 && rad2 < tolIRMin2 &&
    1124          ( d2 < fRmin*kCarTolerance || pDotV3d >= 0 ) )
    1125     {
    1126       if (segPhi)
     1012    if ( (c > -halfRminTolerance) && (rad2 < tolIRMin2)
     1013      && ( (d2 < fRmin*kCarTolerance) || (pDotV3d >= 0) ) )
     1014    {
     1015      if ( !fFullPhiSphere )
    11271016      {
    11281017        // Use inner phi tolerant boundary -> if on tolerant
     
    11341023          // inside radii, delta r -ve, inside phi
    11351024          //
    1136           if (segTheta)
     1025          if ( !fFullThetaSphere )
    11371026          {
    11381027            if ( (pTheta >= tolSTheta + kAngTolerance)
     
    11501039      else
    11511040      {
    1152         if (segTheta)
     1041        if ( !fFullThetaSphere )
    11531042        {
    11541043          if ( (pTheta >= tolSTheta + kAngTolerance)
     
    11661055    else   // Not special tolerant case
    11671056    {
    1168       //  d2 = pDotV3d*pDotV3d - c ;
    1169 
    11701057      if (d2 >= 0)
    11711058      {
    11721059        s = -pDotV3d + std::sqrt(d2) ;
    1173         if ( s >= kRadTolerance*0.5 )  // It was >= 0 ??
     1060        if ( s >= halfRminTolerance )  // It was >= 0 ??
    11741061        {
    11751062          xi   = p.x() + s*v.x() ;
     
    11771064          rhoi = std::sqrt(xi*xi+yi*yi) ;
    11781065
    1179           if ( segPhi && rhoi )   // Check phi intersection
     1066          if ( !fFullPhiSphere && rhoi )   // Check phi intersection
    11801067          {
    11811068            cosPsi = (xi*cosCPhi + yi*sinCPhi)/rhoi ;
     
    11831070            if (cosPsi >= cosHDPhiOT)
    11841071            {
    1185               if (segTheta)  // Check theta intersection
     1072              if ( !fFullThetaSphere )  // Check theta intersection
    11861073              {
    11871074                zi = p.z() + s*v.z() ;
     
    12041091          else
    12051092          {
    1206             if (segTheta)   // Check theta intersection
     1093            if ( !fFullThetaSphere )   // Check theta intersection
    12071094            {
    12081095              zi = p.z() + s*v.z() ;
     
    12141101              if ( (iTheta >= tolSTheta) && (iTheta <= tolETheta) )
    12151102              {
    1216                 snxt = s ;
     1103                snxt = s;
    12171104              }
    12181105            }
    12191106            else
    12201107            {
    1221               snxt=s;
     1108              snxt = s;
    12221109            }
    12231110          }
     
    12361123  //         -> Should use some form of loop Construct
    12371124  //
    1238   if ( segPhi )
    1239   {
    1240     // First phi surface (`S'tarting phi)
    1241 
    1242     sinSPhi = std::sin(fSPhi) ;
    1243     cosSPhi = std::cos(fSPhi) ;
    1244 
     1125  if ( !fFullPhiSphere )
     1126  {
     1127    // First phi surface ('S'tarting phi)
    12451128    // Comp = Component in outwards normal dirn
    12461129    //
    1247     Comp    = v.x()*sinSPhi - v.y()*cosSPhi ;
     1130    Comp = v.x()*sinSPhi - v.y()*cosSPhi ;
    12481131                   
    12491132    if ( Comp < 0 )
     
    12511134      Dist = p.y()*cosSPhi - p.x()*sinSPhi ;
    12521135
    1253       if (Dist < kCarTolerance*0.5)
     1136      if (Dist < halfCarTolerance)
    12541137      {
    12551138        s = Dist/Comp ;
     
    12821165            // (=>intersect at origin =>fRmax=0)
    12831166            //
    1284             if ( segTheta )
     1167            if ( !fFullThetaSphere )
    12851168            {
    12861169              iTheta = std::atan2(std::sqrt(rhoi2),zi) ;
     
    13051188    }
    13061189
    1307     // Second phi surface (`E'nding phi)
    1308 
    1309     ePhi    = fSPhi + fDPhi ;
    1310     sinEPhi = std::sin(ePhi)     ;
    1311     cosEPhi = std::cos(ePhi)     ;
    1312 
    1313     // Compnent in outwards normal dirn
    1314 
    1315     Comp    = -( v.x()*sinEPhi-v.y()*cosEPhi ) ;
     1190    // Second phi surface ('E'nding phi)
     1191    // Component in outwards normal dirn
     1192
     1193    Comp = -( v.x()*sinEPhi-v.y()*cosEPhi ) ;
    13161194       
    13171195    if (Comp < 0)
    13181196    {
    13191197      Dist = -(p.y()*cosEPhi-p.x()*sinEPhi) ;
    1320       if ( Dist < kCarTolerance*0.5 )
     1198      if ( Dist < halfCarTolerance )
    13211199      {
    13221200        s = Dist/Comp ;
     
    13401218            rhoi2 = rho2  ;
    13411219            radi2 = rad2  ;
    1342           } if ( (radi2 <= tolORMax2)
     1220          }
     1221          if ( (radi2 <= tolORMax2)
    13431222            && (radi2 >= tolORMin2)
    13441223            && ((yi*cosCPhi-xi*sinCPhi) >= 0) )
     
    13481227            // (=>intersect at origin =>fRmax=0)
    13491228            //
    1350             if ( segTheta )
     1229            if ( !fFullThetaSphere )
    13511230            {
    13521231              iTheta = std::atan2(std::sqrt(rhoi2),zi) ;
     
    13741253  // Theta segment intersection
    13751254
    1376   if ( segTheta )
     1255  if ( !fFullThetaSphere )
    13771256  {
    13781257
     
    13961275    // => s^2(1-vz^2(1+tan^2(t))+2s(pdotv2d-pzvztan^2(t))+(rho2-pz^2tan^2(t))=0
    13971276
    1398     tanSTheta  = std::tan(fSTheta)         ;
    1399     tanSTheta2 = tanSTheta*tanSTheta  ;
    1400     tanETheta  = std::tan(fSTheta+fDTheta) ;
    1401     tanETheta2 = tanETheta*tanETheta  ;
    1402      
    14031277    if (fSTheta)
    14041278    {
     
    14091283      dist2STheta = kInfinity ;
    14101284    }
    1411     if ( fSTheta + fDTheta < pi )
     1285    if ( eTheta < pi )
    14121286    {
    14131287      dist2ETheta=rho2-p.z()*p.z()*tanETheta2;
    14141288    }
    1415       else
     1289    else
    14161290    {
    14171291      dist2ETheta=kInfinity;
    14181292    }     
    1419     if ( pTheta < tolSTheta) // dist2STheta<-kRadTolerance*0.5 && dist2ETheta>0)
     1293    if ( pTheta < tolSTheta )
    14201294    {
    14211295      // Inside (theta<stheta-tol) s theta cone
     
    14241298      t1 = 1 - v.z()*v.z()*(1 + tanSTheta2) ;
    14251299      t2 = pDotV2d - p.z()*v.z()*tanSTheta2 ;
    1426        
    1427       b  = t2/t1 ;
    1428       c  = dist2STheta/t1 ;
    1429       d2 = b*b - c ;
    1430 
    1431       if ( d2 >= 0 )
    1432       {
    1433         d = std::sqrt(d2) ;
    1434         s = -b - d ;    // First root
    1435         zi    = p.z() + s*v.z();
    1436 
    1437         if ( s < 0 || zi*(fSTheta - halfpi) > 0 )
    1438         {
    1439           s = -b+d;    // Second root
    1440         }
    1441         if (s >= 0 && s < snxt)
    1442         {
    1443           xi    = p.x() + s*v.x();
    1444           yi    = p.y() + s*v.y();
     1300      if (t1)
     1301      {   
     1302        b  = t2/t1 ;
     1303        c  = dist2STheta/t1 ;
     1304        d2 = b*b - c ;
     1305
     1306        if ( d2 >= 0 )
     1307        {
     1308          d = std::sqrt(d2) ;
     1309          s = -b - d ;    // First root
    14451310          zi    = p.z() + s*v.z();
    1446           rhoi2 = xi*xi + yi*yi;
    1447           radi2 = rhoi2 + zi*zi;
    1448           if ( (radi2 <= tolORMax2)
    1449             && (radi2 >= tolORMin2)
    1450             && (zi*(fSTheta - halfpi) <= 0) )
    1451           {
    1452             if ( segPhi && rhoi2 )  // Check phi intersection
    1453             {
    1454               cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
    1455               if (cosPsi >= cosHDPhiOT)
     1311
     1312          if ( (s < 0) || (zi*(fSTheta - halfpi) > 0) )
     1313          {
     1314            s = -b+d;    // Second root
     1315          }
     1316          if ((s >= 0) && (s < snxt))
     1317          {
     1318            xi    = p.x() + s*v.x();
     1319            yi    = p.y() + s*v.y();
     1320            zi    = p.z() + s*v.z();
     1321            rhoi2 = xi*xi + yi*yi;
     1322            radi2 = rhoi2 + zi*zi;
     1323            if ( (radi2 <= tolORMax2)
     1324              && (radi2 >= tolORMin2)
     1325              && (zi*(fSTheta - halfpi) <= 0) )
     1326            {
     1327              if ( !fFullPhiSphere && rhoi2 )  // Check phi intersection
     1328              {
     1329                cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     1330                if (cosPsi >= cosHDPhiOT)
     1331                {
     1332                  snxt = s ;
     1333                }
     1334              }
     1335              else
    14561336              {
    14571337                snxt = s ;
    14581338              }
    1459             }
    1460             else
    1461             {
    1462               snxt = s ;
    14631339            }
    14641340          }
     
    14691345      // Second >= 0 root should be considered
    14701346       
    1471       if ( fSTheta + fDTheta < pi )
     1347      if ( eTheta < pi )
    14721348      {
    14731349        t1 = 1 - v.z()*v.z()*(1 + tanETheta2) ;
    14741350        t2 = pDotV2d - p.z()*v.z()*tanETheta2 ;
    1475        
     1351        if (t1)
     1352        {
     1353          b  = t2/t1 ;
     1354          c  = dist2ETheta/t1 ;
     1355          d2 = b*b - c ;
     1356
     1357          if (d2 >= 0)
     1358          {
     1359            d = std::sqrt(d2) ;
     1360            s = -b + d ;    // Second root
     1361
     1362            if ( (s >= 0) && (s < snxt) )
     1363            {
     1364              xi    = p.x() + s*v.x() ;
     1365              yi    = p.y() + s*v.y() ;
     1366              zi    = p.z() + s*v.z() ;
     1367              rhoi2 = xi*xi + yi*yi   ;
     1368              radi2 = rhoi2 + zi*zi   ;
     1369
     1370              if ( (radi2 <= tolORMax2)
     1371                && (radi2 >= tolORMin2)
     1372                && (zi*(eTheta - halfpi) <= 0) )
     1373              {
     1374                if (!fFullPhiSphere && rhoi2)   // Check phi intersection
     1375                {
     1376                  cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     1377                  if (cosPsi >= cosHDPhiOT)
     1378                  {
     1379                    snxt = s ;
     1380                  }
     1381                }
     1382                else
     1383                {
     1384                  snxt = s ;
     1385                }
     1386              }
     1387            }
     1388          }
     1389        }
     1390      }
     1391    } 
     1392    else if ( pTheta > tolETheta )
     1393    {
     1394      // dist2ETheta<-kRadTolerance*0.5 && dist2STheta>0)
     1395      // Inside (theta > etheta+tol) e-theta cone
     1396      // First root of etheta cone, second if first root 'imaginary'
     1397
     1398      t1 = 1 - v.z()*v.z()*(1 + tanETheta2) ;
     1399      t2 = pDotV2d - p.z()*v.z()*tanETheta2 ;
     1400      if (t1)
     1401      { 
    14761402        b  = t2/t1 ;
    14771403        c  = dist2ETheta/t1 ;
     
    14811407        {
    14821408          d = std::sqrt(d2) ;
    1483           s = -b + d ;    // Second root
    1484 
    1485           if (s >= 0 && s < snxt)
     1409          s = -b - d ;    // First root
     1410          zi    = p.z() + s*v.z();
     1411
     1412          if ( (s < 0) || (zi*(eTheta - halfpi) > 0) )
     1413          {
     1414            s = -b + d ;           // second root
     1415          }
     1416          if ( (s >= 0) && (s < snxt) )
    14861417          {
    14871418            xi    = p.x() + s*v.x() ;
     
    14921423
    14931424            if ( (radi2 <= tolORMax2)
    1494               && (radi2 >= tolORMin2)
    1495               && (zi*(fSTheta + fDTheta - halfpi) <= 0) )
    1496             {
    1497               if (segPhi && rhoi2)   // Check phi intersection
     1425              && (radi2 >= tolORMin2) 
     1426              && (zi*(eTheta - halfpi) <= 0) )
     1427            {
     1428              if (!fFullPhiSphere && rhoi2)  // Check phi intersection
    14981429              {
    14991430                cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     
    15111442        }
    15121443      }
    1513     } 
    1514     else if ( pTheta > tolETheta )
    1515     {
    1516       // dist2ETheta<-kRadTolerance*0.5 && dist2STheta>0)
    1517       // Inside (theta > etheta+tol) e-theta cone
    1518       // First root of etheta cone, second if first root `imaginary'
    1519 
    1520       t1 = 1 - v.z()*v.z()*(1 + tanETheta2) ;
    1521       t2 = pDotV2d - p.z()*v.z()*tanETheta2 ;
    1522        
    1523       b  = t2/t1 ;
    1524       c  = dist2ETheta/t1 ;
    1525       d2 = b*b - c ;
    1526 
    1527       if (d2 >= 0)
    1528       {
    1529         d = std::sqrt(d2) ;
    1530         s = -b - d ;    // First root
    1531         zi    = p.z() + s*v.z();
    1532 
    1533         if (s < 0 || zi*(fSTheta + fDTheta - halfpi) > 0)
    1534         {
    1535           s = -b + d ;           // second root
    1536         }
    1537         if (s >= 0 && s < snxt)
    1538         {
    1539           xi    = p.x() + s*v.x() ;
    1540           yi    = p.y() + s*v.y() ;
    1541           zi    = p.z() + s*v.z() ;
    1542           rhoi2 = xi*xi + yi*yi   ;
    1543           radi2 = rhoi2 + zi*zi   ;
    1544 
    1545           if ( (radi2 <= tolORMax2)
    1546             && (radi2 >= tolORMin2)
    1547             && (zi*(fSTheta + fDTheta - halfpi) <= 0) )
    1548           {
    1549             if (segPhi && rhoi2)  // Check phi intersection
    1550             {
    1551               cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
    1552               if (cosPsi >= cosHDPhiOT)
    1553               {
    1554                 snxt = s ;
    1555               }
    1556             }
    1557             else
    1558             {
    1559               snxt = s ;
    1560             }
    1561           }
    1562         }
    1563       }
    15641444
    15651445      // Possible intersection with STheta cone.
     
    15701450        t1 = 1 - v.z()*v.z()*(1 + tanSTheta2) ;
    15711451        t2 = pDotV2d - p.z()*v.z()*tanSTheta2 ;
    1572 
     1452        if (t1)
     1453        {
     1454          b  = t2/t1 ;
     1455          c  = dist2STheta/t1 ;
     1456          d2 = b*b - c ;
     1457
     1458          if (d2 >= 0)
     1459          {
     1460            d = std::sqrt(d2) ;
     1461            s = -b + d ;    // Second root
     1462
     1463            if ( (s >= 0) && (s < snxt) )
     1464            {
     1465              xi    = p.x() + s*v.x() ;
     1466              yi    = p.y() + s*v.y() ;
     1467              zi    = p.z() + s*v.z() ;
     1468              rhoi2 = xi*xi + yi*yi   ;
     1469              radi2 = rhoi2 + zi*zi   ;
     1470
     1471              if ( (radi2 <= tolORMax2)
     1472                && (radi2 >= tolORMin2)
     1473                && (zi*(fSTheta - halfpi) <= 0) )
     1474              {
     1475                if (!fFullPhiSphere && rhoi2)   // Check phi intersection
     1476                {
     1477                  cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     1478                  if (cosPsi >= cosHDPhiOT)
     1479                  {
     1480                    snxt = s ;
     1481                  }
     1482                }
     1483                else
     1484                {
     1485                  snxt = s ;
     1486                }
     1487              }
     1488            }
     1489          }
     1490        }
     1491      } 
     1492    }     
     1493    else if ( (pTheta < tolSTheta + kAngTolerance)
     1494           && (fSTheta > halfAngTolerance) )
     1495    {
     1496      // In tolerance of stheta
     1497      // If entering through solid [r,phi] => 0 to in
     1498      // else try 2nd root
     1499
     1500      t2 = pDotV2d - p.z()*v.z()*tanSTheta2 ;
     1501      if ( (t2>=0 && tolIRMin2<rad2 && rad2<tolIRMax2 && fSTheta<halfpi)
     1502        || (t2<0  && tolIRMin2<rad2 && rad2<tolIRMax2 && fSTheta>halfpi)
     1503        || (v.z()<0 && tolIRMin2<rad2 && rad2<tolIRMax2 && fSTheta==halfpi) )
     1504      {
     1505        if (!fFullPhiSphere && rho2)  // Check phi intersection
     1506        {
     1507          cosPsi = (p.x()*cosCPhi + p.y()*sinCPhi)/std::sqrt(rho2) ;
     1508          if (cosPsi >= cosHDPhiIT)
     1509          {
     1510            return 0 ;
     1511          }
     1512        }
     1513        else
     1514        {
     1515          return 0 ;
     1516        }
     1517      }
     1518
     1519      // Not entering immediately/travelling through
     1520
     1521      t1 = 1 - v.z()*v.z()*(1 + tanSTheta2) ;
     1522      if (t1)
     1523      {
    15731524        b  = t2/t1 ;
    15741525        c  = dist2STheta/t1 ;
     
    15781529        {
    15791530          d = std::sqrt(d2) ;
    1580           s = -b + d ;    // Second root
    1581 
    1582           if ( (s >= 0) && (s < snxt) )
    1583           {
     1531          s = -b + d ;
     1532          if ( (s >= halfCarTolerance) && (s < snxt) && (fSTheta < halfpi) )
     1533          {  // ^^^^^^^^^^^^^^^^^^^^^  shouldn't it be >=0 instead ?
    15841534            xi    = p.x() + s*v.x() ;
    15851535            yi    = p.y() + s*v.y() ;
     
    15921542              && (zi*(fSTheta - halfpi) <= 0) )
    15931543            {
    1594               if (segPhi && rhoi2)   // Check phi intersection
     1544              if ( !fFullPhiSphere && rhoi2 )    // Check phi intersection
     1545              {
     1546                cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     1547                if ( cosPsi >= cosHDPhiOT )
     1548                {
     1549                  snxt = s ;
     1550                }
     1551              }
     1552              else
     1553              {
     1554                snxt = s ;
     1555              }
     1556            }
     1557          }
     1558        }
     1559      }
     1560    }   
     1561    else if ((pTheta > tolETheta-kAngTolerance) && (eTheta < pi-kAngTolerance))
     1562    {
     1563
     1564      // In tolerance of etheta
     1565      // If entering through solid [r,phi] => 0 to in
     1566      // else try 2nd root
     1567
     1568      t2 = pDotV2d - p.z()*v.z()*tanETheta2 ;
     1569
     1570      if (   ((t2<0) && (eTheta < halfpi)
     1571          && (tolIRMin2 < rad2) && (rad2 < tolIRMax2))
     1572        ||   ((t2>=0) && (eTheta > halfpi)
     1573          && (tolIRMin2 < rad2) && (rad2 < tolIRMax2))
     1574        ||   ((v.z()>0) && (eTheta == halfpi)
     1575          && (tolIRMin2 < rad2) && (rad2 < tolIRMax2))  )
     1576      {
     1577        if (!fFullPhiSphere && rho2)   // Check phi intersection
     1578        {
     1579          cosPsi = (p.x()*cosCPhi + p.y()*sinCPhi)/std::sqrt(rho2) ;
     1580          if (cosPsi >= cosHDPhiIT)
     1581          {
     1582            return 0 ;
     1583          }
     1584        }
     1585        else
     1586        {
     1587          return 0 ;
     1588        }
     1589      }
     1590
     1591      // Not entering immediately/travelling through
     1592
     1593      t1 = 1 - v.z()*v.z()*(1 + tanETheta2) ;
     1594      if (t1)
     1595      {
     1596        b  = t2/t1 ;
     1597        c  = dist2ETheta/t1 ;
     1598        d2 = b*b - c ;
     1599
     1600        if (d2 >= 0)
     1601        {
     1602          d = std::sqrt(d2) ;
     1603          s = -b + d ;
     1604       
     1605          if ( (s >= halfCarTolerance)
     1606            && (s < snxt) && (eTheta > halfpi) )
     1607          {
     1608            xi    = p.x() + s*v.x() ;
     1609            yi    = p.y() + s*v.y() ;
     1610            zi    = p.z() + s*v.z() ;
     1611            rhoi2 = xi*xi + yi*yi   ;
     1612            radi2 = rhoi2 + zi*zi   ;
     1613
     1614            if ( (radi2 <= tolORMax2)
     1615              && (radi2 >= tolORMin2)
     1616              && (zi*(eTheta - halfpi) <= 0) )
     1617            {
     1618              if (!fFullPhiSphere && rhoi2)   // Check phi intersection
    15951619              {
    15961620                cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     
    16061630            }
    16071631          }
    1608         }
    1609       } 
    1610     }     
    1611     else if ( (pTheta <tolSTheta + kAngTolerance)
    1612            && (fSTheta > kAngTolerance) )
    1613     {
    1614       // In tolerance of stheta
    1615       // If entering through solid [r,phi] => 0 to in
    1616       // else try 2nd root
    1617 
    1618       t2 = pDotV2d - p.z()*v.z()*tanSTheta2 ;
    1619       if ( (t2>=0 && tolIRMin2<rad2 && rad2<tolIRMax2 && fSTheta<pi*.5)
    1620         || (t2<0  && tolIRMin2<rad2 && rad2<tolIRMax2 && fSTheta>pi*.5)
    1621         || (v.z()<0 && tolIRMin2<rad2 && rad2<tolIRMax2 && fSTheta==pi*.5) )
    1622       {
    1623         if (segPhi && rho2)  // Check phi intersection
    1624         {
    1625           cosPsi = (p.x()*cosCPhi + p.y()*sinCPhi)/std::sqrt(rho2) ;
    1626           if (cosPsi >= cosHDPhiIT)
    1627           {
    1628             return 0 ;
    1629           }
    1630         }
    1631         else
    1632         {
    1633           return 0 ;
    1634         }
    1635       }
    1636 
    1637       // Not entering immediately/travelling through
    1638 
    1639       t1 = 1 - v.z()*v.z()*(1 + tanSTheta2) ;
    1640       b  = t2/t1 ;
    1641       c  = dist2STheta/t1 ;
    1642       d2 = b*b - c ;
    1643 
    1644       if (d2 >= 0)
    1645       {
    1646         d = std::sqrt(d2) ;
    1647         s = -b + d ;
    1648         if ( (s >= kCarTolerance*0.5) && (s < snxt) && (fSTheta < pi*0.5) )
    1649         {
    1650           xi    = p.x() + s*v.x() ;
    1651           yi    = p.y() + s*v.y() ;
    1652           zi    = p.z() + s*v.z() ;
    1653           rhoi2 = xi*xi + yi*yi   ;
    1654           radi2 = rhoi2 + zi*zi   ;
    1655 
    1656           if ( (radi2 <= tolORMax2)
    1657             && (radi2 >= tolORMin2)
    1658             && (zi*(fSTheta - halfpi) <= 0) )
    1659           {
    1660             if ( segPhi && rhoi2 )    // Check phi intersection
    1661             {
    1662               cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
    1663               if ( cosPsi >= cosHDPhiOT )
    1664               {
    1665                 snxt = s ;
    1666               }
    1667             }
    1668             else
    1669             {
    1670               snxt = s ;
    1671             }
    1672           }
    1673         }
    1674       }
    1675     }   
    1676     else if ( (pTheta > tolETheta - kAngTolerance)
    1677            && ((fSTheta + fDTheta) < pi-kAngTolerance) )   
    1678     {
    1679 
    1680       // In tolerance of etheta
    1681       // If entering through solid [r,phi] => 0 to in
    1682       // else try 2nd root
    1683 
    1684       t2 = pDotV2d - p.z()*v.z()*tanETheta2 ;
    1685 
    1686       if (
    1687     (t2<0    && (fSTheta+fDTheta) <pi*0.5 && tolIRMin2<rad2 && rad2<tolIRMax2)
    1688  || (t2>=0   && (fSTheta+fDTheta) >pi*0.5 && tolIRMin2<rad2 && rad2<tolIRMax2)
    1689  || (v.z()>0 && (fSTheta+fDTheta)==pi*0.5 && tolIRMin2<rad2 && rad2<tolIRMax2)
    1690          )
    1691       {
    1692         if (segPhi && rho2)   // Check phi intersection
    1693         {
    1694           cosPsi = (p.x()*cosCPhi + p.y()*sinCPhi)/std::sqrt(rho2) ;
    1695           if (cosPsi >= cosHDPhiIT)
    1696           {
    1697             return 0 ;
    1698           }
    1699         }
    1700         else
    1701         {
    1702           return 0 ;
    1703         }
    1704       }
    1705 
    1706       // Not entering immediately/travelling through
    1707 
    1708       t1 = 1 - v.z()*v.z()*(1 + tanETheta2) ;
    1709       b  = t2/t1 ;
    1710       c  = dist2ETheta/t1 ;
    1711       d2 = b*b - c ;
    1712 
    1713       if (d2 >= 0)
    1714       {
    1715         d = std::sqrt(d2) ;
    1716         s = -b + d ;
    1717        
    1718         if ( (s >= kCarTolerance*0.5)
    1719           && (s < snxt) && ((fSTheta + fDTheta) > pi*0.5) )
    1720         {
    1721           xi    = p.x() + s*v.x() ;
    1722           yi    = p.y() + s*v.y() ;
    1723           zi    = p.z() + s*v.z() ;
    1724           rhoi2 = xi*xi + yi*yi   ;
    1725           radi2 = rhoi2 + zi*zi   ;
    1726 
    1727           if ( (radi2 <= tolORMax2)
    1728             && (radi2 >= tolORMin2)
    1729             && (zi*(fSTheta + fDTheta - halfpi) <= 0) )
    1730           {
    1731             if (segPhi && rhoi2)   // Check phi intersection
    1732             {
    1733               cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
    1734               if (cosPsi>=cosHDPhiOT)
    1735               {
    1736                 snxt = s ;
    1737               }
    1738             }
    1739             else
    1740             {
    1741               snxt = s ;
    1742             }
    1743           }
    1744         }
    1745       }   
     1632        }
     1633      }   
    17461634    } 
    17471635    else
     
    17521640      t1 = 1 - v.z()*v.z()*(1 + tanSTheta2) ;
    17531641      t2 = pDotV2d - p.z()*v.z()*tanSTheta2 ;
    1754 
    1755       b  = t2/t1;
    1756       c  = dist2STheta/t1 ;
    1757       d2 = b*b - c ;
    1758 
    1759       if (d2 >= 0)
    1760       {
    1761         d = std::sqrt(d2) ;
    1762         s = -b + d ;    // second root
    1763 
    1764         if (s >= 0 && s < snxt)
    1765         {
    1766           xi    = p.x() + s*v.x() ;
    1767           yi    = p.y() + s*v.y() ;
    1768           zi    = p.z() + s*v.z() ;
    1769           rhoi2 = xi*xi + yi*yi   ;
    1770           radi2 = rhoi2 + zi*zi   ;
    1771 
    1772           if ( (radi2 <= tolORMax2)
    1773             && (radi2 >= tolORMin2)
    1774             && (zi*(fSTheta - halfpi) <= 0) )
    1775           {
    1776             if (segPhi && rhoi2)   // Check phi intersection
    1777             {
    1778               cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
    1779               if (cosPsi >= cosHDPhiOT)
     1642      if (t1)
     1643      {
     1644        b  = t2/t1;
     1645        c  = dist2STheta/t1 ;
     1646        d2 = b*b - c ;
     1647
     1648        if (d2 >= 0)
     1649        {
     1650          d = std::sqrt(d2) ;
     1651          s = -b + d ;    // second root
     1652
     1653          if ((s >= 0) && (s < snxt))
     1654          {
     1655            xi    = p.x() + s*v.x() ;
     1656            yi    = p.y() + s*v.y() ;
     1657            zi    = p.z() + s*v.z() ;
     1658            rhoi2 = xi*xi + yi*yi   ;
     1659            radi2 = rhoi2 + zi*zi   ;
     1660
     1661            if ( (radi2 <= tolORMax2)
     1662              && (radi2 >= tolORMin2)
     1663              && (zi*(fSTheta - halfpi) <= 0) )
     1664            {
     1665              if (!fFullPhiSphere && rhoi2)   // Check phi intersection
     1666              {
     1667                cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     1668                if (cosPsi >= cosHDPhiOT)
     1669                {
     1670                  snxt = s ;
     1671                }
     1672              }
     1673              else
    17801674              {
    17811675                snxt = s ;
    17821676              }
    1783             }
    1784             else
    1785             {
    1786               snxt = s ;
    17871677            }
    17881678          }
     
    17911681      t1 = 1 - v.z()*v.z()*(1 + tanETheta2) ;
    17921682      t2 = pDotV2d - p.z()*v.z()*tanETheta2 ;
    1793        
    1794       b  = t2/t1 ;
    1795       c  = dist2ETheta/t1 ;
    1796       d2 = b*b - c ;
    1797 
    1798       if (d2 >= 0)
    1799       {
    1800         d = std::sqrt(d2) ;
    1801         s = -b + d;    // second root
    1802 
    1803         if (s >= 0 && s < snxt)
    1804         {
    1805           xi    = p.x() + s*v.x() ;
    1806           yi    = p.y() + s*v.y() ;
    1807           zi    = p.z() + s*v.z() ;
    1808           rhoi2 = xi*xi + yi*yi   ;
    1809           radi2 = rhoi2 + zi*zi   ;
    1810 
    1811           if ( (radi2 <= tolORMax2)
    1812             && (radi2 >= tolORMin2)
    1813             && (zi*(fSTheta + fDTheta - halfpi) <= 0) )
    1814           {
    1815             if (segPhi && rhoi2)   // Check phi intersection
    1816             {
    1817               cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
    1818               if ( cosPsi >= cosHDPhiOT )
    1819               {
    1820                 snxt=s;
    1821               }
    1822             }
    1823             else
    1824             {
    1825               snxt = s ;
     1683      if (t1)
     1684      {   
     1685        b  = t2/t1 ;
     1686        c  = dist2ETheta/t1 ;
     1687        d2 = b*b - c ;
     1688
     1689        if (d2 >= 0)
     1690        {
     1691          d = std::sqrt(d2) ;
     1692          s = -b + d;    // second root
     1693
     1694          if ((s >= 0) && (s < snxt))
     1695          {
     1696            xi    = p.x() + s*v.x() ;
     1697            yi    = p.y() + s*v.y() ;
     1698            zi    = p.z() + s*v.z() ;
     1699            rhoi2 = xi*xi + yi*yi   ;
     1700            radi2 = rhoi2 + zi*zi   ;
     1701
     1702            if ( (radi2 <= tolORMax2)
     1703              && (radi2 >= tolORMin2)
     1704              && (zi*(eTheta - halfpi) <= 0) )
     1705            {
     1706              if (!fFullPhiSphere && rhoi2)   // Check phi intersection
     1707              {
     1708                cosPsi = (xi*cosCPhi + yi*sinCPhi)/std::sqrt(rhoi2) ;
     1709                if ( cosPsi >= cosHDPhiOT )
     1710                {
     1711                  snxt=s;
     1712                }
     1713              }
     1714              else
     1715              {
     1716                snxt = s ;
     1717              }
    18261718            }
    18271719          }
     
    18441736{
    18451737  G4double safe=0.0,safeRMin,safeRMax,safePhi,safeTheta;
    1846   G4double rho2,rad,rho;
    1847   G4double phiC,cosPhiC,sinPhiC,cosPsi,ePhi;
     1738  G4double rho2,rds,rho;
     1739  G4double cosPsi;
    18481740  G4double pTheta,dTheta1,dTheta2;
    18491741  rho2=p.x()*p.x()+p.y()*p.y();
    1850   rad=std::sqrt(rho2+p.z()*p.z());
     1742  rds=std::sqrt(rho2+p.z()*p.z());
    18511743  rho=std::sqrt(rho2);
    18521744
     
    18561748  if (fRmin)
    18571749  {
    1858     safeRMin=fRmin-rad;
    1859     safeRMax=rad-fRmax;
     1750    safeRMin=fRmin-rds;
     1751    safeRMax=rds-fRmax;
    18601752    if (safeRMin>safeRMax)
    18611753    {
     
    18691761  else
    18701762  {
    1871     safe=rad-fRmax;
     1763    safe=rds-fRmax;
    18721764  }
    18731765
     
    18751767  // Distance to phi extent
    18761768  //
    1877   if (fDPhi<twopi&&rho)
    1878   {
    1879     phiC=fSPhi+fDPhi*0.5;
    1880     cosPhiC=std::cos(phiC);
    1881     sinPhiC=std::sin(phiC);
    1882 
     1769  if (!fFullPhiSphere && rho)
     1770  {
    18831771    // Psi=angle from central phi to point
    18841772    //
    1885     cosPsi=(p.x()*cosPhiC+p.y()*sinPhiC)/rho;
    1886     if (cosPsi<std::cos(fDPhi*0.5))
     1773    cosPsi=(p.x()*cosCPhi+p.y()*sinCPhi)/rho;
     1774    if (cosPsi<std::cos(hDPhi))
    18871775    {
    18881776      // Point lies outside phi range
    18891777      //
    1890       if ((p.y()*cosPhiC-p.x()*sinPhiC)<=0)
    1891       {
    1892         safePhi=std::fabs(p.x()*std::sin(fSPhi)-p.y()*std::cos(fSPhi));
     1778      if ((p.y()*cosCPhi-p.x()*sinCPhi)<=0)
     1779      {
     1780        safePhi=std::fabs(p.x()*sinSPhi-p.y()*cosSPhi);
    18931781      }
    18941782      else
    18951783      {
    1896         ePhi=fSPhi+fDPhi;
    1897         safePhi=std::fabs(p.x()*std::sin(ePhi)-p.y()*std::cos(ePhi));
    1898       }
    1899       if (safePhi>safe) safe=safePhi;
     1784        safePhi=std::fabs(p.x()*sinEPhi-p.y()*cosEPhi);
     1785      }
     1786      if (safePhi>safe)  { safe=safePhi; }
    19001787    }
    19011788  }
     
    19031790  // Distance to Theta extent
    19041791  //   
    1905   if ((rad!=0.0) && (fDTheta<pi))
    1906   {
    1907     pTheta=std::acos(p.z()/rad);
    1908     if (pTheta<0) pTheta+=pi;
     1792  if ((rds!=0.0) && (!fFullThetaSphere))
     1793  {
     1794    pTheta=std::acos(p.z()/rds);
     1795    if (pTheta<0)  { pTheta+=pi; }
    19091796    dTheta1=fSTheta-pTheta;
    1910     dTheta2=pTheta-(fSTheta+fDTheta);
     1797    dTheta2=pTheta-eTheta;
    19111798    if (dTheta1>dTheta2)
    19121799    {
    19131800      if (dTheta1>=0)             // WHY ???????????
    19141801      {
    1915         safeTheta=rad*std::sin(dTheta1);
     1802        safeTheta=rds*std::sin(dTheta1);
    19161803        if (safe<=safeTheta)
    19171804        {
     
    19241811      if (dTheta2>=0)
    19251812      {
    1926         safeTheta=rad*std::sin(dTheta2);
     1813        safeTheta=rds*std::sin(dTheta2);
    19271814        if (safe<=safeTheta)
    19281815        {
     
    19331820  }
    19341821
    1935   if (safe<0) safe=0;
     1822  if (safe<0)  { safe=0; }
    19361823  return safe;
    19371824}
     
    19391826/////////////////////////////////////////////////////////////////////
    19401827//
    1941 // Calculate distance to surface of shape from `inside', allowing for tolerance
     1828// Calculate distance to surface of shape from 'inside', allowing for tolerance
    19421829// - Only Calc rmax intersection if no valid rmin intersection
    19431830
     
    19521839  ESide side=kNull,sidephi=kNull,sidetheta=kNull; 
    19531840
     1841  static const G4double halfCarTolerance = kCarTolerance*0.5;
     1842  static const G4double halfAngTolerance = kAngTolerance*0.5;
     1843  const G4double halfRmaxTolerance = fRmaxTolerance*0.5;
     1844  const G4double halfRminTolerance = fRminTolerance*0.5;
     1845  const G4double Rmax_plus  = fRmax + halfRmaxTolerance;
     1846  const G4double Rmin_minus = (fRmin) ? fRmin-halfRminTolerance : 0;
    19541847  G4double t1,t2;
    19551848  G4double b,c,d;
     
    19571850  // Variables for phi intersection:
    19581851
    1959   G4double sinSPhi,cosSPhi,ePhi,sinEPhi,cosEPhi;
    1960   G4double cPhi,sinCPhi,cosCPhi;
    19611852  G4double pDistS,compS,pDistE,compE,sphi2,vphi;
    19621853   
     
    19661857  G4double xi,yi,zi;      // Intersection point
    19671858
    1968   // G4double Comp; // Phi intersection
    1969 
    1970   G4bool segPhi;        // Phi flag and precalcs
    1971   G4double hDPhi,hDPhiOT,hDPhiIT;
    1972   G4double cosHDPhiOT,cosHDPhiIT;
    1973 
    1974   G4bool segTheta;                             // Theta flag and precals
    1975   G4double tanSTheta=0.,tanETheta=0., rhoSecTheta;
    1976   G4double tanSTheta2=0.,tanETheta2=0.;
     1859  // Theta precals
     1860  //
     1861  G4double rhoSecTheta;
    19771862  G4double dist2STheta, dist2ETheta, distTheta;
    19781863  G4double d2,s;
    19791864
    19801865  // General Precalcs
    1981 
     1866  //
    19821867  rho2 = p.x()*p.x()+p.y()*p.y();
    19831868  rad2 = rho2+p.z()*p.z();
    1984   //  G4double rad=std::sqrt(rad2);
    19851869
    19861870  pTheta = std::atan2(std::sqrt(rho2),p.z());
     
    19891873  pDotV3d = pDotV2d+p.z()*v.z();
    19901874
    1991   // Set phi divided flag and precalcs
    1992 
    1993   if( fDPhi < twopi )
    1994   {
    1995     segPhi=true;
    1996     hDPhi=0.5*fDPhi;    // half delta phi
    1997     cPhi=fSPhi+hDPhi;;
    1998     hDPhiOT=hDPhi+0.5*kAngTolerance; // Outer Tolerant half delta phi
    1999     hDPhiIT=hDPhi-0.5*kAngTolerance;
    2000     sinCPhi=std::sin(cPhi);
    2001     cosCPhi=std::cos(cPhi);
    2002     cosHDPhiOT=std::cos(hDPhiOT);
    2003     cosHDPhiIT=std::cos(hDPhiIT);
    2004   }
    2005   else
    2006   {
    2007     segPhi=false;
    2008   }
    2009 
    20101875  // Theta precalcs
    20111876   
    2012   if ( fDTheta < pi )
    2013   {
    2014     segTheta  = true;
    2015     tolSTheta = fSTheta - kAngTolerance*0.5;
    2016     tolETheta = fSTheta + fDTheta + kAngTolerance*0.5;
    2017   }
    2018   else segTheta = false;
    2019 
     1877  if ( !fFullThetaSphere )
     1878  {
     1879    tolSTheta = fSTheta - halfAngTolerance;
     1880    tolETheta = eTheta + halfAngTolerance;
     1881  }
    20201882   
    20211883  // Radial Intersections from G4Sphere::DistanceToIn
     
    20341896  //
    20351897  // => s=-pDotV3d+-std::sqrt(pDotV3d^2-(rad2-R^2))
    2036   //
    2037   // const G4double  fractionTolerance = 1.0e-12;
    2038 
    2039   const G4double  flexRadMaxTolerance =            // kRadTolerance;
    2040     std::max(kRadTolerance, fEpsilon * fRmax);
    2041 
    2042   const G4double  Rmax_plus = fRmax + flexRadMaxTolerance*0.5;
    2043 
    2044   const G4double  flexRadMinTolerance = std::max(kRadTolerance,
    2045                      fEpsilon * fRmin);
    2046 
    2047   const G4double  Rmin_minus= (fRmin > 0) ? fRmin-flexRadMinTolerance*0.5 : 0 ;
    2048 
    2049   if(rad2 <= Rmax_plus*Rmax_plus && rad2 >= Rmin_minus*Rmin_minus)
    2050     //  if(rad <= Rmax_plus && rad >= Rmin_minus)
     1898
     1899  if( (rad2 <= Rmax_plus*Rmax_plus) && (rad2 >= Rmin_minus*Rmin_minus) )
    20511900  {
    20521901    c = rad2 - fRmax*fRmax;
    20531902
    2054     if (c < flexRadMaxTolerance*fRmax)
     1903    if (c < fRmaxTolerance*fRmax)
    20551904    {
    20561905      // Within tolerant Outer radius
     
    20651914      d2 = pDotV3d*pDotV3d - c;
    20661915
    2067       if( (c >- flexRadMaxTolerance*fRmax)       // on tolerant surface
    2068        && ((pDotV3d >=0) || (d2 < 0)) )          // leaving outside from Rmax
    2069                                                  // not re-entering
     1916      if( (c >- fRmaxTolerance*fRmax)       // on tolerant surface
     1917       && ((pDotV3d >=0) || (d2 < 0)) )     // leaving outside from Rmax
     1918                                            // not re-entering
    20701919      {
    20711920        if(calcNorm)
     
    20921941      d2 = pDotV3d*pDotV3d - c;
    20931942
    2094       if ( c >- flexRadMinTolerance*fRmin ) // 2.0 * (0.5*kRadTolerance) * fRmin
    2095       {
    2096         if( c < flexRadMinTolerance*fRmin &&
    2097             d2 >= flexRadMinTolerance*fRmin && pDotV3d < 0 ) // leaving from Rmin
    2098         {
    2099           if(calcNorm)  *validNorm = false ;   // Rmin surface is concave         
    2100                        return snxt = 0 ;
     1943      if (c >- fRminTolerance*fRmin) // 2.0 * (0.5*kRadTolerance) * fRmin
     1944      {
     1945        if ( (c < fRminTolerance*fRmin)              // leaving from Rmin
     1946          && (d2 >= fRminTolerance*fRmin) && (pDotV3d < 0) )
     1947        {
     1948          if(calcNorm)  { *validNorm = false; }  // Rmin surface is concave         
     1949          return snxt = 0 ;
    21011950        }
    21021951        else
     
    21191968  // Theta segment intersection
    21201969
    2121   if (segTheta)
     1970  if ( !fFullThetaSphere )
    21221971  {
    21231972    // Intersection with theta surfaces
     
    21431992    //
    21441993 
    2145     /* ////////////////////////////////////////////////////////
    2146 
    2147     tanSTheta=std::tan(fSTheta);
    2148     tanSTheta2=tanSTheta*tanSTheta;
    2149     tanETheta=std::tan(fSTheta+fDTheta);
    2150     tanETheta2=tanETheta*tanETheta;
    2151      
    2152     if (fSTheta)
    2153     {
    2154       dist2STheta=rho2-p.z()*p.z()*tanSTheta2;
    2155     }
    2156     else
    2157     {
    2158       dist2STheta = kInfinity;
    2159     }
    2160     if (fSTheta + fDTheta < pi)
    2161     {
    2162       dist2ETheta = rho2-p.z()*p.z()*tanETheta2;
    2163     }
    2164     else
    2165     {
    2166       dist2ETheta = kInfinity ;
    2167     }
    2168     if (pTheta > tolSTheta && pTheta < tolETheta)   // Inside theta 
    2169     {
    2170       // In tolerance of STheta and possible leaving out to small thetas N-
    2171 
    2172       if(pTheta < tolSTheta + kAngTolerance  && fSTheta > kAngTolerance) 
    2173       {
    2174         t2=pDotV2d-p.z()*v.z()*tanSTheta2 ; // =(VdotN+)*rhoSecSTheta
    2175 
    2176         if( fSTheta < pi*0.5 && t2 < 0)
    2177         {
    2178           if(calcNorm) *validNorm = false ;
    2179           return snxt = 0 ;
    2180         }
    2181         else if(fSTheta > pi*0.5 && t2 >= 0)
    2182         {
    2183           if(calcNorm)
    2184           {
    2185             rhoSecTheta = std::sqrt(rho2*(1+tanSTheta2)) ;
    2186             *validNorm = true ;
    2187             *n = G4ThreeVector(-p.x()/rhoSecTheta,   // N-
    2188                                -p.y()/rhoSecTheta,
    2189                                tanSTheta/std::sqrt(1+tanSTheta2) ) ;
    2190           }
    2191           return snxt = 0 ;
    2192         }
    2193         else if( fSTheta == pi*0.5 && v.z() > 0)
    2194         {
    2195           if(calcNorm)
    2196           {
    2197             *validNorm = true ;
    2198             *n = G4ThreeVector(0,0,1) ;
    2199           }
    2200           return snxt = 0 ;
    2201         }
    2202       }
    2203 
    2204       // In tolerance of ETheta and possible leaving out to larger thetas N+
    2205 
    2206       if ( (pTheta  > tolETheta - kAngTolerance)
    2207         && (( fSTheta + fDTheta) < pi - kAngTolerance) ) 
    2208       {
    2209         t2=pDotV2d-p.z()*v.z()*tanETheta2 ;
    2210         if((fSTheta+fDTheta)>pi*0.5 && t2<0)
    2211         {
    2212           if(calcNorm) *validNorm = false ;
    2213           return snxt = 0 ;
    2214         }
    2215         else if( (fSTheta+fDTheta) < pi*0.5 && t2 >= 0 )
    2216         {
    2217           if(calcNorm)
    2218           {
    2219             rhoSecTheta = std::sqrt(rho2*(1+tanETheta2)) ;
    2220             *validNorm = true ;
    2221             *n = G4ThreeVector( p.x()/rhoSecTheta,  // N+
    2222                                 p.y()/rhoSecTheta,
    2223                                 -tanETheta/std::sqrt(1+tanETheta2)  ) ;
    2224           }
    2225           return snxt = 0 ;
    2226         }
    2227         else if( ( fSTheta+fDTheta) == pi*0.5 && v.z() < 0 )
    2228         {
    2229           if(calcNorm)
    2230           {
    2231             *validNorm = true ;
    2232             *n = G4ThreeVector(0,0,-1) ;
    2233           }
    2234           return snxt = 0 ;
    2235         }
    2236       }
    2237       if( fSTheta > 0 )
    2238       {       
    2239         // First root of fSTheta cone, second if first root -ve
    2240 
    2241         t1 = 1-v.z()*v.z()*(1+tanSTheta2);
    2242         t2 = pDotV2d-p.z()*v.z()*tanSTheta2;
    2243        
    2244         b  = t2/t1;
    2245         c  = dist2STheta/t1;
    2246         d2 = b*b - c ;
    2247 
    2248         if ( d2 >= 0 )
    2249         {
    2250           d = std::sqrt(d2) ;
    2251           s = -b - d ;    // First root
    2252 
    2253           if ( s < 0 )
    2254           {
    2255             s = -b + d ;    // Second root
    2256           }
    2257           if (s > flexRadMaxTolerance*0.5 )   // && s<sr)
    2258           {
    2259             // check against double cone solution
    2260             zi=p.z()+s*v.z();
    2261             if (fSTheta<pi*0.5 && zi<0)
    2262             {
    2263               s = kInfinity ;  // wrong cone
    2264             }
    2265             if (fSTheta>pi*0.5 && zi>0)
    2266             {
    2267               s = kInfinity ;  // wrong cone
    2268             }
    2269             stheta = s ;
    2270             sidetheta = kSTheta ;
    2271           }
    2272         }
    2273       }
    2274 
    2275       // Possible intersection with ETheta cone 
    2276      
    2277       if (fSTheta + fDTheta < pi)
    2278       {
    2279         t1 = 1-v.z()*v.z()*(1+tanETheta2);
    2280         t2 = pDotV2d-p.z()*v.z()*tanETheta2;       
    2281         b  = t2/t1;
    2282         c  = dist2ETheta/t1;
    2283         d2 = b*b-c ;
    2284 
    2285         if ( d2 >= 0 )
    2286         {
    2287           d = std::sqrt(d2);
    2288           s = -b - d ;          // First root
    2289 
    2290           if ( s < 0 )
    2291           {
    2292             s=-b+d;    // Second root
    2293           }
    2294           if (s > flexRadMaxTolerance*0.5 && s < stheta )
    2295           {
    2296             // check against double cone solution
    2297             zi=p.z()+s*v.z();
    2298             if (fSTheta+fDTheta<pi*0.5 && zi<0)
    2299             {
    2300               s = kInfinity ;  // wrong cone
    2301             }
    2302             if (fSTheta+fDTheta>pi*0.5 && zi>0)
    2303             {
    2304               s = kInfinity ;  // wrong cone
    2305             }
    2306           }
    2307           if (s < stheta)
    2308           {
    2309             stheta = s ;
    2310             sidetheta = kETheta ;
    2311           }
    2312         }
    2313       }
    2314     } 
    2315     */  ////////////////////////////////////////////////////////////
    2316 
    23171994    if(fSTheta) // intersection with first cons
    23181995    {
    2319 
    2320       tanSTheta = std::tan(fSTheta);
    2321 
    23221996      if( std::fabs(tanSTheta) > 5./kAngTolerance ) // kons is plane z=0
    23231997      {
    23241998        if( v.z() > 0. )
    23251999        {
    2326           if ( std::fabs( p.z() ) <= flexRadMaxTolerance*0.5 )
     2000          if ( std::fabs( p.z() ) <= halfRmaxTolerance )
    23272001          {
    23282002            if(calcNorm)
     
    23332007            return snxt = 0 ;
    23342008          } 
    2335           // s = -p.z()/v.z();
    23362009          stheta    = -p.z()/v.z();
    23372010          sidetheta = kSTheta;
     
    23402013      else // kons is not plane
    23412014      {
    2342         tanSTheta2  = tanSTheta*tanSTheta;
    23432015        t1          = 1-v.z()*v.z()*(1+tanSTheta2);
    23442016        t2          = pDotV2d-p.z()*v.z()*tanSTheta2;  // ~vDotN if p on cons
    2345         dist2STheta = rho2-p.z()*p.z()*tanSTheta2;      // t3
    2346 
    2347         // distTheta = std::sqrt(std::fabs(dist2STheta/(1+tanSTheta2)));
     2017        dist2STheta = rho2-p.z()*p.z()*tanSTheta2;     // t3
     2018
    23482019        distTheta = std::sqrt(rho2)-p.z()*tanSTheta;
    23492020
    2350         if( std::fabs(t1) < 0.5*kAngTolerance ) // 1st order equation, v parallel to kons
    2351         {
     2021        if( std::fabs(t1) < halfAngTolerance ) // 1st order equation,
     2022        {                                      // v parallel to kons
    23522023          if( v.z() > 0. )
    23532024          {
    2354             if(std::fabs(distTheta) < flexRadMaxTolerance*0.5) // p on surface
    2355             {
    2356               if( fSTheta < halfpi && p.z() > 0. )
    2357               {
    2358                 if( calcNorm ) *validNorm = false;
    2359                               return snxt = 0.;
    2360               }
    2361               else if( fSTheta > halfpi && p.z() <= 0)
     2025            if(std::fabs(distTheta) < halfRmaxTolerance) // p on surface
     2026            {
     2027              if( (fSTheta < halfpi) && (p.z() > 0.) )
     2028              {
     2029                if( calcNorm )  { *validNorm = false; }
     2030                return snxt = 0.;
     2031              }
     2032              else if( (fSTheta > halfpi) && (p.z() <= 0) )
    23622033              {
    23632034                if( calcNorm )
     
    23772048              }
    23782049            }
    2379             // s = -0.5*dist2STheta/t2;
    2380 
    23812050            stheta    = -0.5*dist2STheta/t2;
    23822051            sidetheta = kSTheta;
    23832052          } 
    2384         }
    2385         else   // 2nd order equation, 1st root of fSTheta cone, 2nd if 1st root -ve
    2386         {
    2387           if( std::fabs(distTheta) < flexRadMaxTolerance*0.5) // && t2 >= 0.) surface
    2388           {
    2389             if( fSTheta > halfpi && t2 >= 0. ) // leave
     2053        }      // 2nd order equation, 1st root of fSTheta cone,
     2054        else   // 2nd if 1st root -ve
     2055        {
     2056          if( std::fabs(distTheta) < halfRmaxTolerance )
     2057          {
     2058            if( (fSTheta > halfpi) && (t2 >= 0.) ) // leave
    23902059            {
    23912060              if( calcNorm )
     
    23942063                if (rho2)
    23952064                {
    2396                     rhoSecTheta = std::sqrt(rho2*(1+tanSTheta2));
     2065                  rhoSecTheta = std::sqrt(rho2*(1+tanSTheta2));
    23972066                   
    2398                     *n = G4ThreeVector( p.x()/rhoSecTheta,   
    2399                                         p.y()/rhoSecTheta,
    2400                                         std::sin(fSTheta)  );
     2067                  *n = G4ThreeVector( p.x()/rhoSecTheta,   
     2068                                      p.y()/rhoSecTheta,
     2069                                      std::sin(fSTheta)  );
    24012070                }
    2402                 else *n = G4ThreeVector(0.,0.,1.);
    2403               }                           
     2071                else  { *n = G4ThreeVector(0.,0.,1.); }
     2072              }
    24042073              return snxt = 0.;
    24052074            }
    2406             else if( fSTheta < halfpi  && t2 < 0. && p.z() >=0. ) // leave
    2407             {
    2408                 if( calcNorm )   *validNorm = false;                                                 
    2409                 return snxt = 0.;
     2075            else if( (fSTheta < halfpi) && (t2 < 0.) && (p.z() >=0.) ) // leave
     2076            {
     2077              if( calcNorm )  { *validNorm = false; }
     2078              return snxt = 0.;
    24102079            }                               
    24112080          }
     
    24222091              s = -b - d;         // First root
    24232092
    2424               if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 < 0.) ||
    2425                               s < 0.  ||
    2426                   ( s > 0. && p.z() + s*v.z() > 0.)                   )
     2093              if ( ((std::fabs(s) < halfRmaxTolerance) && (t2 < 0.))
     2094               ||  (s < 0.)  || ( (s > 0.) && (p.z() + s*v.z() > 0.) )     )
    24272095              {
    24282096                s = -b + d ; // 2nd root
    24292097              }
    2430               if( s >  flexRadMaxTolerance*0.5 && p.z() + s*v.z() <= 0.
     2098              if( (s > halfRmaxTolerance) && (p.z() + s*v.z() <= 0.)
    24312099              {
    24322100                stheta    = s;
     
    24382106              s = -b - d;         // First root
    24392107
    2440               if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 >= 0.) ||
    2441                               s < 0.                                   ||
    2442                   ( s > 0. && p.z() + s*v.z() < 0.)                      )
     2108              if ( ( (std::fabs(s) < halfRmaxTolerance) && (t2 >= 0.) )
     2109                || (s < 0.) || ( (s > 0.) && (p.z() + s*v.z() < 0.) )   )
    24432110              {
    24442111                s = -b + d ; // 2nd root
    24452112              }
    2446               if( s >  flexRadMaxTolerance*0.5 && p.z() + s*v.z() >= 0.
     2113              if( (s > halfRmaxTolerance) && (p.z() + s*v.z() >= 0.)
    24472114              {
    24482115                stheta    = s;
     
    24542121      }
    24552122    }
    2456     if (fSTheta + fDTheta < pi) // intersection with second cons
    2457     {
    2458 
    2459       tanETheta = std::tan(fSTheta+fDTheta);
    2460 
     2123    if (eTheta < pi) // intersection with second cons
     2124    {
    24612125      if( std::fabs(tanETheta) > 5./kAngTolerance ) // kons is plane z=0
    24622126      {
    24632127        if( v.z() < 0. )
    24642128        {
    2465           if ( std::fabs( p.z() ) <= flexRadMaxTolerance*0.5 )
     2129          if ( std::fabs( p.z() ) <= halfRmaxTolerance )
    24662130          {
    24672131            if(calcNorm)
     
    24742138          s = -p.z()/v.z();
    24752139
    2476           if( s < stheta)
     2140          if( s < stheta )
    24772141          {
    24782142            stheta    = s;
     
    24832147      else // kons is not plane
    24842148      {
    2485         tanETheta2  = tanETheta*tanETheta;
    24862149        t1          = 1-v.z()*v.z()*(1+tanETheta2);
    24872150        t2          = pDotV2d-p.z()*v.z()*tanETheta2;  // ~vDotN if p on cons
    2488         dist2ETheta = rho2-p.z()*p.z()*tanETheta2;      // t3
    2489 
    2490         // distTheta = std::sqrt(std::fabs(dist2ETheta/(1+tanETheta2)));
     2151        dist2ETheta = rho2-p.z()*p.z()*tanETheta2;     // t3
     2152
    24912153        distTheta = std::sqrt(rho2)-p.z()*tanETheta;
    24922154
    2493         if( std::fabs(t1) < 0.5*kAngTolerance ) // 1st order equation, v parallel to kons
    2494         {
     2155        if( std::fabs(t1) < halfAngTolerance ) // 1st order equation,
     2156        {                                      // v parallel to kons
    24952157          if( v.z() < 0. )
    24962158          {
    2497             if(std::fabs(distTheta) < flexRadMaxTolerance*0.5) // p on surface
    2498             {
    2499               if( fSTheta+fDTheta > halfpi && p.z() < 0. )
    2500               {
    2501                 if( calcNorm ) *validNorm = false;
    2502                               return snxt = 0.;
    2503               }
    2504               else if( fSTheta+fDTheta < halfpi && p.z() >= 0)
     2159            if(std::fabs(distTheta) < halfRmaxTolerance) // p on surface
     2160            {
     2161              if( (eTheta > halfpi) && (p.z() < 0.) )
     2162              {
     2163                if( calcNorm )  { *validNorm = false; }
     2164                return snxt = 0.;
     2165              }
     2166              else if ( (eTheta < halfpi) && (p.z() >= 0) )
    25052167              {
    25062168                if( calcNorm )
     
    25102172                  {
    25112173                    rhoSecTheta = std::sqrt(rho2*(1+tanETheta2));
    2512                    
    25132174                    *n = G4ThreeVector( p.x()/rhoSecTheta,   
    25142175                                        p.y()/rhoSecTheta,
    2515                                         -std::sin(fSTheta+fDTheta)  );
     2176                                        -sinETheta  );
    25162177                  }
    2517                   else *n = G4ThreeVector(0.,0.,-1.);
     2178                  else  { *n = G4ThreeVector(0.,0.,-1.); }
    25182179                }
    25192180                return snxt = 0.;               
     
    25222183            s = -0.5*dist2ETheta/t2;
    25232184
    2524             if( s < stheta)
     2185            if( s < stheta )
    25252186            {
    25262187              stheta    = s;
     
    25282189            }
    25292190          } 
    2530         }
    2531         else   // 2nd order equation, 1st root of fSTheta cone, 2nd if 1st root -ve
    2532         {
    2533           if( std::fabs(distTheta) < flexRadMaxTolerance*0.5) // && t2 >= 0.) surface
    2534           {
    2535             if( fSTheta+fDTheta < halfpi && t2 >= 0. ) // leave
     2191        }      // 2nd order equation, 1st root of fSTheta cone
     2192        else   // 2nd if 1st root -ve
     2193        {
     2194          if ( std::fabs(distTheta) < halfRmaxTolerance )
     2195          {
     2196            if( (eTheta < halfpi) && (t2 >= 0.) ) // leave
    25362197            {
    25372198              if( calcNorm )
     
    25412202                {
    25422203                    rhoSecTheta = std::sqrt(rho2*(1+tanETheta2));
    2543                    
    25442204                    *n = G4ThreeVector( p.x()/rhoSecTheta,   
    25452205                                        p.y()/rhoSecTheta,
    2546                                         -std::sin(fSTheta+fDTheta)  );
     2206                                        -sinETheta  );
    25472207                }
    25482208                else *n = G4ThreeVector(0.,0.,-1.);
     
    25502210              return snxt = 0.;
    25512211            }
    2552             else if( fSTheta+fDTheta > halfpi  && t2 < 0. && p.z() <=0. ) // leave
    2553             {
    2554                 if( calcNorm )   *validNorm = false;                                                 
    2555                 return snxt = 0.;
     2212            else if ( (eTheta > halfpi)
     2213                   && (t2 < 0.) && (p.z() <=0.) ) // leave
     2214            {
     2215              if( calcNorm )  { *validNorm = false; }
     2216              return snxt = 0.;
    25562217            }                               
    25572218          }
     
    25642225            d = std::sqrt(d2);
    25652226
    2566             if( fSTheta+fDTheta < halfpi )
     2227            if( eTheta < halfpi )
    25672228            {
    25682229              s = -b - d;         // First root
    25692230
    2570               if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 < 0.) ||
    2571                               s < 0. )
     2231              if( ((std::fabs(s) < halfRmaxTolerance) && (t2 < 0.))
     2232               || (s < 0.) )
    25722233              {
    25732234                s = -b + d ; // 2nd root
    25742235              }
    2575               if( s >  flexRadMaxTolerance*0.5
     2236              if( s > halfRmaxTolerance
    25762237              {
    25772238                if( s < stheta )
     
    25862247              s = -b - d;         // First root
    25872248
    2588               if( (std::fabs(s) < flexRadMaxTolerance*0.5 && t2 >= 0.) ||
    2589                               s < 0.                                   ||
    2590                   ( s > 0. && p.z() + s*v.z() > 0.)                      )
     2249              if ( ((std::fabs(s) < halfRmaxTolerance) && (t2 >= 0.))
     2250                || (s < 0.) || ( (s > 0.) && (p.z() + s*v.z() > 0.) ) )
    25912251              {
    25922252                s = -b + d ; // 2nd root
    25932253              }
    2594               if( s >  flexRadMaxTolerance*0.5 && p.z() + s*v.z() <= 0.
     2254              if( (s > halfRmaxTolerance) && (p.z() + s*v.z() <= 0.)
    25952255              {
    25962256                if( s < stheta )
     
    26102270  // Phi Intersection
    26112271   
    2612   if ( fDPhi < twopi)
    2613   {
    2614     sinSPhi=std::sin(fSPhi);
    2615     cosSPhi=std::cos(fSPhi);
    2616     ePhi=fSPhi+fDPhi;
    2617     sinEPhi=std::sin(ePhi);
    2618     cosEPhi=std::cos(ePhi);
    2619     cPhi=fSPhi+fDPhi*0.5;
    2620     sinCPhi=std::sin(cPhi);
    2621     cosCPhi=std::cos(cPhi);
    2622 
    2623     if ( p.x()||p.y() ) // Check if on z axis (rho not needed later)
     2272  if ( !fFullPhiSphere )
     2273  {
     2274    if ( p.x() || p.y() ) // Check if on z axis (rho not needed later)
    26242275    {
    26252276      // pDist -ve when inside
     
    26342285      sidephi = kNull ;
    26352286
    2636       if ( pDistS <= 0 && pDistE <= 0 )
     2287      if ( (pDistS <= 0) && (pDistE <= 0) )
    26372288      {
    26382289        // Inside both phi *full* planes
     
    26442295          yi   = p.y()+sphi*v.y() ;
    26452296
    2646           // Check intersecting with correct half-plane
    2647           // (if not -> no intersect)
    2648 
    2649           if ( ( yi*cosCPhi - xi*sinCPhi ) >= 0 )
     2297          // Check intersection with correct half-plane (if not -> no intersect)
     2298          //
     2299          if( (std::abs(xi)<=kCarTolerance) && (std::abs(yi)<=kCarTolerance) )
     2300          {
     2301            vphi = std::atan2(v.y(),v.x());
     2302            sidephi = kSPhi;
     2303            if ( ( (fSPhi-halfAngTolerance) <= vphi)
     2304              && ( (ePhi+halfAngTolerance)  >= vphi) )
     2305            {
     2306              sphi = kInfinity;
     2307            }
     2308          }
     2309          else if ( ( yi*cosCPhi - xi*sinCPhi ) >= 0 )
    26502310          {
    26512311            sphi=kInfinity;
     
    26542314          {
    26552315            sidephi = kSPhi ;
    2656             if ( pDistS > -0.5*kCarTolerance) sphi =0 ; // Leave by sphi
    2657           }
    2658         }
    2659         else sphi = kInfinity ;
     2316            if ( pDistS > -halfCarTolerance)  { sphi = 0; } // Leave by sphi
     2317          }
     2318        }
     2319        else  { sphi = kInfinity; }
    26602320
    26612321        if ( compE < 0 )
     
    26672327            yi = p.y()+sphi2*v.y() ;
    26682328
    2669             // Check intersecting with correct half-plane
    2670  
    2671             if ((yi*cosCPhi-xi*sinCPhi)>=0) // Leaving via ending phi
     2329            // Check intersection with correct half-plane
     2330            //
     2331            if ((std::abs(xi)<=kCarTolerance) && (std::abs(yi)<=kCarTolerance))
     2332            {
     2333              // Leaving via ending phi
     2334              //
     2335              vphi = std::atan2(v.y(),v.x()) ;
     2336               
     2337              if( !((fSPhi-halfAngTolerance <= vphi)
     2338                  &&(fSPhi+fDPhi+halfAngTolerance >= vphi)) )
     2339              {
     2340                sidephi = kEPhi;
     2341                if ( pDistE <= -halfCarTolerance )  { sphi = sphi2; }
     2342                else                                { sphi = 0.0;   }
     2343              }
     2344            }
     2345            else if ((yi*cosCPhi-xi*sinCPhi)>=0) // Leaving via ending phi
    26722346            {
    26732347              sidephi = kEPhi ;
    2674               if ( pDistE <= -0.5*kCarTolerance )
     2348              if ( pDistE <= -halfCarTolerance )
    26752349              {
    26762350                sphi=sphi2;
     
    26842358        }       
    26852359      }
    2686       else if ( pDistS >= 0 && pDistE >= 0 ) // Outside both *full* phi planes
     2360      else if ((pDistS >= 0) && (pDistE >= 0)) // Outside both *full* phi planes
    26872361      {
    26882362        if ( pDistS <= pDistE )
     
    26962370        if ( fDPhi > pi )
    26972371        {
    2698           if ( compS < 0 && compE < 0 ) sphi = 0 ;
    2699           else                          sphi = kInfinity ;
     2372          if ( (compS < 0) && (compE < 0) )  { sphi = 0; }
     2373          else                               { sphi = kInfinity; }
    27002374        }
    27012375        else
     
    27042378          // will remain inside
    27052379
    2706           if ( compS >= 0 && compE >= 0 )
    2707           {
    2708             sphi=kInfinity;
    2709           }
    2710           else
    2711           {
    2712             sphi=0;
    2713           }
     2380          if ( (compS >= 0) && (compE >= 0) ) { sphi = kInfinity; }
     2381          else                                { sphi = 0; }
    27142382        }   
    27152383      }
    2716       else if ( pDistS > 0 && pDistE < 0 )
     2384      else if ( (pDistS > 0) && (pDistE < 0) )
    27172385      {
    27182386        // Outside full starting plane, inside full ending plane
     
    27292397            // (if not -> not leaving phi extent)
    27302398            //
    2731             if ( ( yi*cosCPhi - xi*sinCPhi ) <= 0 )
     2399            if( (std::abs(xi)<=kCarTolerance)&&(std::abs(yi)<=kCarTolerance) )
     2400            {
     2401              vphi = std::atan2(v.y(),v.x());
     2402              sidephi = kSPhi;
     2403              if ( ( (fSPhi-halfAngTolerance) <= vphi)
     2404                && ( (ePhi+halfAngTolerance)  >= vphi) )
     2405              {
     2406                sphi = kInfinity;
     2407              }
     2408            }
     2409            else if ( ( yi*cosCPhi - xi*sinCPhi ) <= 0 )
    27322410            {
    27332411              sphi = kInfinity ;
     
    27362414            {
    27372415              sidephi = kEPhi ;
    2738               if ( pDistE > -0.5*kCarTolerance ) sphi = 0. ;
     2416              if ( pDistE > -halfCarTolerance )  { sphi = 0.; }
    27392417            }
    27402418          }
     
    27572435              // (if not -> remain in extent)
    27582436              //
    2759               if ( ( yi*cosCPhi - xi*sinCPhi) <= 0 )
     2437              if( (std::abs(xi)<=kCarTolerance)&&(std::abs(yi)<=kCarTolerance) )
     2438              {
     2439                vphi = std::atan2(v.y(),v.x());
     2440                sidephi = kSPhi;
     2441                if ( ( (fSPhi-halfAngTolerance) <= vphi)
     2442                  && ( (ePhi+halfAngTolerance)  >= vphi) )
     2443                {
     2444                  sphi = kInfinity;
     2445                }
     2446              }
     2447              else if ( ( yi*cosCPhi - xi*sinCPhi) <= 0 )
    27602448              {
    27612449                sphi=kInfinity;
     
    27872475            xi=p.x()+sphi*v.x();
    27882476            yi=p.y()+sphi*v.y();
    2789 
     2477           
    27902478            // Check intersection in correct half-plane
    27912479            // (if not -> not leaving phi extent)
    27922480            //
    2793             if ( ( yi*cosCPhi - xi*sinCPhi ) >= 0 )
     2481            if( (std::abs(xi)<=kCarTolerance)&&(std::abs(yi)<=kCarTolerance) )
     2482            {
     2483              vphi = std::atan2(v.y(),v.x()) ;
     2484              sidephi = kSPhi;
     2485              if ( ( (fSPhi-halfAngTolerance) <= vphi)
     2486                && ( (ePhi+halfAngTolerance)  >= vphi) )
     2487              {
     2488              sphi = kInfinity;
     2489              }
     2490            }
     2491            else if ( ( yi*cosCPhi - xi*sinCPhi ) >= 0 )
    27942492            {
    27952493              sphi = kInfinity ;
    27962494            }
    2797            else  // Leaving via Starting phi
    2798            {
     2495            else  // Leaving via Starting phi
     2496            {
    27992497              sidephi = kSPhi ;
    2800              if ( pDistS > -0.5*kCarTolerance ) sphi = 0 ;
     2498              if ( pDistS > -halfCarTolerance )  { sphi = 0; }
    28012499            }
    28022500          }
     
    28152513              xi   = p.x()+sphi*v.x() ;
    28162514              yi   = p.y()+sphi*v.y() ;
    2817 
     2515             
    28182516              // Check intersection in correct half-plane
    28192517              // (if not -> remain in extent)
    28202518              //
    2821               if ( ( yi*cosCPhi - xi*sinCPhi ) >= 0 )
     2519              if((std::abs(xi)<=kCarTolerance) && (std::abs(yi)<=kCarTolerance))
     2520              {
     2521                vphi = std::atan2(v.y(),v.x()) ;
     2522                sidephi = kSPhi;
     2523                if ( ( (fSPhi-halfAngTolerance) <= vphi)
     2524                  && ( (ePhi+halfAngTolerance)  >= vphi) )
     2525                {
     2526                  sphi = kInfinity;
     2527                }
     2528              }
     2529              else if ( ( yi*cosCPhi - xi*sinCPhi ) >= 0 )
    28222530              {
    28232531                sphi = kInfinity ;
     
    28492557      {
    28502558        vphi = std::atan2(v.y(),v.x()) ;
    2851         if ( fSPhi < vphi && vphi < fSPhi + fDPhi )
    2852         {
    2853           sphi=kInfinity;
     2559        if ((fSPhi-halfAngTolerance < vphi) && (vphi < ePhi+halfAngTolerance))
     2560        {
     2561          sphi = kInfinity;
    28542562        }
    28552563        else
     
    28592567        }
    28602568      }
    2861       else  // travel along z - no phi intersaction
     2569      else  // travel along z - no phi intersection
    28622570      {
    28632571        sphi = kInfinity ;
     
    28952603        if ( fDPhi <= pi )     // Normal to Phi-
    28962604        {
    2897           *n=G4ThreeVector(std::sin(fSPhi),-std::cos(fSPhi),0);
     2605          *n=G4ThreeVector(sinSPhi,-cosSPhi,0);
    28982606          *validNorm=true;
    28992607        }
    2900         else *validNorm=false;
     2608        else  { *validNorm=false; }
    29012609        break ;
    29022610
     
    29042612        if ( fDPhi <= pi )      // Normal to Phi+
    29052613        {
    2906           *n=G4ThreeVector(-std::sin(fSPhi+fDPhi),std::cos(fSPhi+fDPhi),0);
     2614          *n=G4ThreeVector(-sinEPhi,cosEPhi,0);
    29072615          *validNorm=true;
    29082616        }
    2909         else *validNorm=false;
     2617        else  { *validNorm=false; }
    29102618        break;
    29112619
     
    29202628          xi = p.x() + snxt*v.x();
    29212629          yi = p.y() + snxt*v.y();
    2922           rhoSecTheta = std::sqrt((xi*xi+yi*yi)*(1+tanSTheta2));
    2923           *n = G4ThreeVector( xi/rhoSecTheta,   // N-
    2924                               yi/rhoSecTheta,
    2925                               -tanSTheta/std::sqrt(1+tanSTheta2));
     2630          rho2=xi*xi+yi*yi;
     2631          if (rho2)
     2632          {
     2633            rhoSecTheta = std::sqrt(rho2*(1+tanSTheta2));
     2634            *n = G4ThreeVector( xi/rhoSecTheta, yi/rhoSecTheta,
     2635                               -tanSTheta/std::sqrt(1+tanSTheta2));
     2636          }
     2637          else
     2638          {
     2639            *n = G4ThreeVector(0.,0.,1.);
     2640          }
    29262641          *validNorm=true;
    29272642        }
    2928         else *validNorm=false;  // Concave STheta cone
     2643        else  { *validNorm=false; }  // Concave STheta cone
    29292644        break;
    29302645
    29312646      case kETheta:
    2932         if( ( fSTheta + fDTheta ) == halfpi )
     2647        if( eTheta == halfpi )
    29332648        {
    29342649          *n         = G4ThreeVector(0.,0.,-1.);
    29352650          *validNorm = true;
    29362651        }
    2937         else if ( ( fSTheta + fDTheta ) < halfpi)
     2652        else if ( eTheta < halfpi )
    29382653        {
    29392654          xi=p.x()+snxt*v.x();
    29402655          yi=p.y()+snxt*v.y();
    2941           rhoSecTheta = std::sqrt((xi*xi+yi*yi)*(1+tanETheta2));
    2942           *n = G4ThreeVector( xi/rhoSecTheta,   // N+
    2943                               yi/rhoSecTheta,
    2944                               -tanETheta/std::sqrt(1+tanETheta2) );
     2656          rho2=xi*xi+yi*yi;
     2657          if (rho2)
     2658          {
     2659            rhoSecTheta = std::sqrt(rho2*(1+tanETheta2));
     2660            *n = G4ThreeVector( xi/rhoSecTheta, yi/rhoSecTheta,
     2661                               -tanETheta/std::sqrt(1+tanETheta2) );
     2662          }
     2663          else
     2664          {
     2665            *n = G4ThreeVector(0.,0.,-1.);
     2666          }
    29452667          *validNorm=true;
    29462668        }
    2947         else *validNorm=false;   // Concave ETheta cone
     2669        else  { *validNorm=false; }   // Concave ETheta cone
    29482670        break;
    29492671
     
    29952717/////////////////////////////////////////////////////////////////////////
    29962718//
    2997 // Calcluate distance (<=actual) to closest surface of shape from inside
     2719// Calculate distance (<=actual) to closest surface of shape from inside
    29982720
    29992721G4double G4Sphere::DistanceToOut( const G4ThreeVector& p ) const
    30002722{
    30012723  G4double safe=0.0,safeRMin,safeRMax,safePhi,safeTheta;
    3002   G4double rho2,rad,rho;
    3003   G4double phiC,cosPhiC,sinPhiC,ePhi;
     2724  G4double rho2,rds,rho;
    30042725  G4double pTheta,dTheta1,dTheta2;
    30052726  rho2=p.x()*p.x()+p.y()*p.y();
    3006   rad=std::sqrt(rho2+p.z()*p.z());
     2727  rds=std::sqrt(rho2+p.z()*p.z());
    30072728  rho=std::sqrt(rho2);
    30082729
     
    30272748  if (fRmin)
    30282749  {
    3029     safeRMin=rad-fRmin;
    3030     safeRMax=fRmax-rad;
     2750    safeRMin=rds-fRmin;
     2751    safeRMax=fRmax-rds;
    30312752    if (safeRMin<safeRMax)
    30322753    {
     
    30402761  else
    30412762  {
    3042     safe=fRmax-rad;
     2763    safe=fRmax-rds;
    30432764  }
    30442765
     
    30462767  // Distance to phi extent
    30472768  //
    3048   if (fDPhi<twopi && rho)
    3049   {
    3050     phiC=fSPhi+fDPhi*0.5;
    3051     cosPhiC=std::cos(phiC);
    3052     sinPhiC=std::sin(phiC);
    3053     if ((p.y()*cosPhiC-p.x()*sinPhiC)<=0)
    3054     {
    3055       safePhi=-(p.x()*std::sin(fSPhi)-p.y()*std::cos(fSPhi));
     2769  if (!fFullPhiSphere && rho)
     2770  {
     2771    if ((p.y()*cosCPhi-p.x()*sinCPhi)<=0)
     2772    {
     2773      safePhi=-(p.x()*sinSPhi-p.y()*cosSPhi);
    30562774    }
    30572775    else
    30582776    {
    3059       ePhi=fSPhi+fDPhi;
    3060       safePhi=(p.x()*std::sin(ePhi)-p.y()*std::cos(ePhi));
    3061     }
    3062     if (safePhi<safe) safe=safePhi;
     2777      safePhi=(p.x()*sinEPhi-p.y()*cosEPhi);
     2778    }
     2779    if (safePhi<safe)  { safe=safePhi; }
    30632780  }
    30642781
     
    30662783  // Distance to Theta extent
    30672784  //   
    3068   if (rad)
    3069   {
    3070     pTheta=std::acos(p.z()/rad);
    3071     if (pTheta<0) pTheta+=pi;
     2785  if (rds)
     2786  {
     2787    pTheta=std::acos(p.z()/rds);
     2788    if (pTheta<0)  { pTheta+=pi; }
    30722789    dTheta1=pTheta-fSTheta;
    3073     dTheta2=(fSTheta+fDTheta)-pTheta;
    3074     if (dTheta1<dTheta2)
    3075     {
    3076       safeTheta=rad*std::sin(dTheta1);
    3077       if (safe>safeTheta)
    3078       {
    3079         safe=safeTheta;
    3080       }
    3081     }
    3082     else
    3083     {
    3084       safeTheta=rad*std::sin(dTheta2);
    3085       if (safe>safeTheta)
    3086       {
    3087         safe=safeTheta;
    3088       }
    3089     }
    3090   }
    3091 
    3092   if (safe<0) safe=0;
    3093     return safe;
     2790    dTheta2=eTheta-pTheta;
     2791    if (dTheta1<dTheta2)  { safeTheta=rds*std::sin(dTheta1); }
     2792    else                  { safeTheta=rds*std::sin(dTheta2); }
     2793    if (safe>safeTheta)   { safe=safeTheta; }
     2794  }
     2795
     2796  if (safe<0)  { safe=0; }
     2797  return safe;
    30942798}
    30952799
     
    31192823  // Phi cross sections
    31202824   
    3121   noPhiCrossSections=G4int (fDPhi/kMeshAngleDefault)+1;
     2825  noPhiCrossSections = G4int(fDPhi/kMeshAngleDefault)+1;
    31222826   
    31232827  if (noPhiCrossSections<kMinMeshSections)
     
    31342838  // on the x axis. Will give better extent calculations when not rotated.
    31352839   
    3136   if (fDPhi==pi*2.0 && fSPhi==0)
     2840  if (fFullPhiSphere)
    31372841  {
    31382842    sAnglePhi = -meshAnglePhi*0.5;
     
    31602864  // on the z axis. Will give better extent calculations when not rotated.
    31612865   
    3162   if (fDTheta==pi && fSTheta==0)
     2866  if (fFullThetaSphere)
    31632867  {
    31642868    startTheta = -meshTheta*0.5;
     
    32232927  }
    32242928
    3225   delete[] cosCrossTheta;
    3226   delete[] sinCrossTheta;
     2929  delete [] cosCrossTheta;
     2930  delete [] sinCrossTheta;
    32272931
    32282932  return vertices;
     
    32692973  G4double height1, height2, slant1, slant2, costheta, sintheta,theta,rRand;
    32702974
    3271   height1 = (fRmax-fRmin)*std::cos(fSTheta);
    3272   height2 = (fRmax-fRmin)*std::cos(fSTheta+fDTheta);
    3273   slant1  = std::sqrt(sqr((fRmax - fRmin)*std::sin(fSTheta))
    3274                       + height1*height1);
    3275   slant2  = std::sqrt(sqr((fRmax - fRmin)*std::sin(fSTheta+fDTheta))
    3276                       + height2*height2);
     2975  height1 = (fRmax-fRmin)*cosSTheta;
     2976  height2 = (fRmax-fRmin)*cosETheta;
     2977  slant1  = std::sqrt(sqr((fRmax - fRmin)*sinSTheta) + height1*height1);
     2978  slant2  = std::sqrt(sqr((fRmax - fRmin)*sinETheta) + height2*height2);
    32772979  rRand   = RandFlat::shoot(fRmin,fRmax);
    32782980 
    3279   aOne = fRmax*fRmax*fDPhi*(std::cos(fSTheta)-std::cos(fSTheta+fDTheta));
    3280   aTwo = fRmin*fRmin*fDPhi*(std::cos(fSTheta)-std::cos(fSTheta+fDTheta));
    3281   aThr = fDPhi*((fRmax + fRmin)*std::sin(fSTheta))*slant1;
    3282   aFou = fDPhi*((fRmax + fRmin)*std::sin(fSTheta+fDTheta))*slant2;
     2981  aOne = fRmax*fRmax*fDPhi*(cosSTheta-cosETheta);
     2982  aTwo = fRmin*fRmin*fDPhi*(cosSTheta-cosETheta);
     2983  aThr = fDPhi*((fRmax + fRmin)*sinSTheta)*slant1;
     2984  aFou = fDPhi*((fRmax + fRmin)*sinETheta)*slant2;
    32832985  aFiv = 0.5*fDTheta*(fRmax*fRmax-fRmin*fRmin);
    32842986 
    3285   phi = RandFlat::shoot(fSPhi, fSPhi + fDPhi);
     2987  phi = RandFlat::shoot(fSPhi, ePhi);
    32862988  cosphi = std::cos(phi);
    32872989  sinphi = std::sin(phi);
    3288   theta = RandFlat::shoot(fSTheta,fSTheta+fDTheta);
     2990  theta = RandFlat::shoot(fSTheta,eTheta);
    32892991  costheta = std::cos(theta);
    32902992  sintheta = std::sqrt(1.-sqr(costheta));
    32912993
    3292   if( ((fSPhi==0) && (fDPhi==2.*pi)) || (fDPhi==2.*pi) ) {aFiv = 0;}
    3293   if(fSTheta == 0)  {aThr=0;}
    3294   if(fDTheta + fSTheta == pi) {aFou = 0;}
    3295   if(fSTheta == 0.5*pi) {aThr = pi*(fRmax*fRmax-fRmin*fRmin);}
    3296   if(fSTheta + fDTheta == 0.5*pi) { aFou = pi*(fRmax*fRmax-fRmin*fRmin);}
     2994  if(fFullPhiSphere) { aFiv = 0; }
     2995  if(fSTheta == 0)   { aThr=0; }
     2996  if(eTheta == pi) { aFou = 0; }
     2997  if(fSTheta == halfpi) { aThr = pi*(fRmax*fRmax-fRmin*fRmin); }
     2998  if(eTheta == halfpi)  { aFou = pi*(fRmax*fRmax-fRmin*fRmin); }
    32972999
    32983000  chose = RandFlat::shoot(0.,aOne+aTwo+aThr+aFou+2.*aFiv);
     
    33093011  else if( (chose>=aOne+aTwo) && (chose<aOne+aTwo+aThr) )
    33103012  {
    3311     if (fSTheta != 0.5*pi)
    3312     {
    3313       zRand = RandFlat::shoot(fRmin*std::cos(fSTheta),fRmax*std::cos(fSTheta));
    3314       return G4ThreeVector(std::tan(fSTheta)*zRand*cosphi,
    3315                            std::tan(fSTheta)*zRand*sinphi,zRand);
     3013    if (fSTheta != halfpi)
     3014    {
     3015      zRand = RandFlat::shoot(fRmin*cosSTheta,fRmax*cosSTheta);
     3016      return G4ThreeVector(tanSTheta*zRand*cosphi,
     3017                           tanSTheta*zRand*sinphi,zRand);
    33163018    }
    33173019    else
     
    33223024  else if( (chose>=aOne+aTwo+aThr) && (chose<aOne+aTwo+aThr+aFou) )
    33233025  {
    3324     if(fSTheta + fDTheta != 0.5*pi)
    3325     {
    3326       zRand = RandFlat::shoot(fRmin*std::cos(fSTheta+fDTheta),
    3327                               fRmax*std::cos(fSTheta+fDTheta));
    3328       return G4ThreeVector  (std::tan(fSTheta+fDTheta)*zRand*cosphi,
    3329                              std::tan(fSTheta+fDTheta)*zRand*sinphi,zRand);
     3026    if(eTheta != halfpi)
     3027    {
     3028      zRand = RandFlat::shoot(fRmin*cosETheta, fRmax*cosETheta);
     3029      return G4ThreeVector  (tanETheta*zRand*cosphi,
     3030                             tanETheta*zRand*sinphi,zRand);
    33303031    }
    33313032    else
     
    33363037  else if( (chose>=aOne+aTwo+aThr+aFou) && (chose<aOne+aTwo+aThr+aFou+aFiv) )
    33373038  {
    3338     return G4ThreeVector(rRand*sintheta*std::cos(fSPhi),
    3339                          rRand*sintheta*std::sin(fSPhi),rRand*costheta);
     3039    return G4ThreeVector(rRand*sintheta*cosSPhi,
     3040                         rRand*sintheta*sinSPhi,rRand*costheta);
    33403041  }
    33413042  else
    33423043  {
    3343     return G4ThreeVector(rRand*sintheta*std::cos(fSPhi+fDPhi),
    3344                          rRand*sintheta*std::sin(fSPhi+fDPhi),rRand*costheta);
    3345   }
     3044    return G4ThreeVector(rRand*sintheta*cosEPhi,
     3045                         rRand*sintheta*sinEPhi,rRand*costheta);
     3046  }
     3047}
     3048
     3049////////////////////////////////////////////////////////////////////////////////
     3050//
     3051// GetSurfaceArea
     3052
     3053G4double G4Sphere::GetSurfaceArea()
     3054{
     3055  if(fSurfaceArea != 0.) {;}
     3056  else
     3057  {   
     3058    G4double Rsq=fRmax*fRmax;
     3059    G4double rsq=fRmin*fRmin;
     3060         
     3061    fSurfaceArea = fDPhi*(rsq+Rsq)*(cosSTheta - cosETheta);
     3062    if(!fFullPhiSphere)
     3063    {
     3064      fSurfaceArea = fSurfaceArea + fDTheta*(Rsq-rsq);
     3065    }
     3066    if(fSTheta >0)
     3067    {
     3068      G4double acos1=std::acos( std::pow(sinSTheta,2) * std::cos(fDPhi)
     3069                              + std::pow(cosSTheta,2));
     3070      if(fDPhi>pi)
     3071      {
     3072        fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*(twopi-acos1);
     3073      }
     3074      else
     3075      {
     3076        fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*acos1;
     3077      }
     3078    }
     3079    if(eTheta < pi)
     3080    {
     3081      G4double acos2=std::acos( std::pow(sinETheta,2) * std::cos(fDPhi)
     3082                              + std::pow(cosETheta,2));
     3083      if(fDPhi>pi)
     3084      {
     3085        fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*(twopi-acos2);
     3086      }
     3087      else
     3088      {
     3089        fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*acos2;
     3090      }
     3091    }
     3092  }
     3093  return fSurfaceArea;
    33463094}
    33473095
  • trunk/source/geometry/solids/CSG/src/G4Torus.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Torus.cc,v 1.63 2007/10/02 09:34:17 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Torus.cc,v 1.65 2009/11/26 10:31:06 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    284284
    285285    G4double theta = std::atan2(ptmp.y(),ptmp.x());
    286 
    287     if (theta < 0)  { theta += twopi; }
    288286   
     287    if ( fSPhi >= 0 )
     288    {
     289      if ( theta < - kAngTolerance*0.5 )  { theta += twopi; }
     290      if ( (std::abs(theta) < kAngTolerance*0.5)
     291        && (std::abs(fSPhi + fDPhi - twopi) < kAngTolerance*0.5) )
     292      {
     293        theta += twopi ; // 0 <= theta < 2pi
     294      }
     295    }
     296    if ((fSPhi <= -pi )&&(theta>kAngTolerance*0.5)) { theta = theta-twopi; }
     297       
    289298    // We have to verify if this root is inside the region between
    290299    // fSPhi and fSPhi + fDPhi
  • trunk/source/geometry/solids/CSG/src/G4Trap.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Trap.cc,v 1.45 2008/04/23 09:49:57 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4Trap
  • trunk/source/geometry/solids/CSG/src/G4Trd.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Trd.cc,v 1.34 2006/10/19 15:33:38 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/CSG/src/G4Tubs.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4Tubs.cc,v 1.74 2008/11/06 15:26:53 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Tubs.cc,v 1.79 2009/06/30 10:10:11 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    9090                      G4double pDz,
    9191                      G4double pSPhi, G4double pDPhi )
    92   : G4CSGSolid(pName)
     92  : G4CSGSolid(pName), fSPhi(0), fDPhi(0)
    9393{
    9494
     
    102102  else
    103103  {
    104     G4cerr << "ERROR - G4Tubs()::G4Tubs(): " << GetName() << G4endl
    105            << "        Negative Z half-length ! - "
    106            << pDz << G4endl;
     104    G4cerr << "ERROR - G4Tubs()::G4Tubs()" << G4endl
     105           << "        Negative Z half-length (" << pDz << ") in solid: "
     106           << GetName() << G4endl;
    107107    G4Exception("G4Tubs::G4Tubs()", "InvalidSetup", FatalException,
    108108                "Invalid Z half-length");
     
    115115  else
    116116  {
    117     G4cerr << "ERROR - G4Tubs()::G4Tubs(): " << GetName() << G4endl
    118            << "        Invalid values for radii !" << G4endl
     117    G4cerr << "ERROR - G4Tubs()::G4Tubs()" << G4endl
     118           << "        Invalid values for radii in solid " << GetName()
     119           << G4endl
    119120           << "        pRMin = " << pRMin << ", pRMax = " << pRMax << G4endl;
    120121    G4Exception("G4Tubs::G4Tubs()", "InvalidSetup", FatalException,
     
    122123  }
    123124
    124   fPhiFullTube = true;
    125   if ( pDPhi >= twopi-kAngTolerance*0.5 ) // Check angles
    126   {
    127     fDPhi=twopi;
    128     fSPhi=0;
    129   }
    130   else
    131   {
    132     fPhiFullTube = false;
    133     if ( pDPhi > 0 )
    134     {
    135       fDPhi = pDPhi;
    136     }
    137     else
    138     {
    139       G4cerr << "ERROR - G4Tubs()::G4Tubs(): " << GetName() << G4endl
    140              << "        Negative delta-Phi ! - "
    141              << pDPhi << G4endl;
    142       G4Exception("G4Tubs::G4Tubs()", "InvalidSetup",
    143                   FatalException, "Invalid dphi.");
    144     }
    145 
    146     // Ensure fSphi in 0-2PI or -2PI-0 range if shape crosses 0
    147 
    148     if ( pSPhi < 0 )
    149     {
    150       fSPhi = twopi - std::fmod(std::fabs(pSPhi),twopi);
    151     }
    152     else
    153     {
    154       fSPhi = std::fmod(pSPhi,twopi) ;
    155     }
    156     if ( fSPhi+fDPhi > twopi )
    157     {
    158       fSPhi -= twopi ;
    159     }
    160   }
    161   InitializeTrigonometry();
     125  // Check angles
     126
     127  CheckPhiAngles(pSPhi, pDPhi);
    162128}
    163129
     
    203169{
    204170
    205   if ( !pTransform.IsRotated() && fDPhi == twopi && fRMin == 0 )
     171  if ( (!pTransform.IsRotated()) && (fDPhi == twopi) && (fRMin == 0) )
    206172  {
    207173    // Special case handling for unrotated solid tubes
     
    210176    // and compute exact x and y limit for x/y case
    211177     
    212     G4double xoffset, xMin, xMax ;
    213     G4double yoffset, yMin, yMax ;
    214     G4double zoffset, zMin, zMax ;
    215 
    216     G4double diff1, diff2, maxDiff, newMin, newMax ;
    217     G4double xoff1, xoff2, yoff1, yoff2, delta ;
    218 
    219     xoffset = pTransform.NetTranslation().x() ;
    220     xMin = xoffset - fRMax ;
    221     xMax = xoffset + fRMax ;
     178    G4double xoffset, xMin, xMax;
     179    G4double yoffset, yMin, yMax;
     180    G4double zoffset, zMin, zMax;
     181
     182    G4double diff1, diff2, maxDiff, newMin, newMax;
     183    G4double xoff1, xoff2, yoff1, yoff2, delta;
     184
     185    xoffset = pTransform.NetTranslation().x();
     186    xMin = xoffset - fRMax;
     187    xMax = xoffset + fRMax;
    222188
    223189    if (pVoxelLimit.IsXLimited())
     
    230196      else
    231197      {
    232         if ( xMin < pVoxelLimit.GetMinXExtent() )
    233         {
    234           xMin = pVoxelLimit.GetMinXExtent() ;
    235         }
    236         if (xMax > pVoxelLimit.GetMaxXExtent() )
    237         {
    238           xMax = pVoxelLimit.GetMaxXExtent() ;
    239         }
    240       }
    241     }
    242     yoffset = pTransform.NetTranslation().y() ;
    243     yMin    = yoffset - fRMax ;
    244     yMax    = yoffset + fRMax ;
     198        if (xMin < pVoxelLimit.GetMinXExtent())
     199        {
     200          xMin = pVoxelLimit.GetMinXExtent();
     201        }
     202        if (xMax > pVoxelLimit.GetMaxXExtent())
     203        {
     204          xMax = pVoxelLimit.GetMaxXExtent();
     205        }
     206      }
     207    }
     208    yoffset = pTransform.NetTranslation().y();
     209    yMin    = yoffset - fRMax;
     210    yMax    = yoffset + fRMax;
    245211
    246212    if ( pVoxelLimit.IsYLimited() )
     
    249215        || (yMax < pVoxelLimit.GetMinYExtent()) )
    250216      {
    251         return false ;
     217        return false;
    252218      }
    253219      else
    254220      {
    255         if ( yMin < pVoxelLimit.GetMinYExtent() )
    256         {
    257           yMin = pVoxelLimit.GetMinYExtent() ;
    258         }
    259         if ( yMax > pVoxelLimit.GetMaxYExtent() )
     221        if (yMin < pVoxelLimit.GetMinYExtent())
     222        {
     223          yMin = pVoxelLimit.GetMinYExtent();
     224        }
     225        if (yMax > pVoxelLimit.GetMaxYExtent())
    260226        {
    261227          yMax=pVoxelLimit.GetMaxYExtent();
     
    263229      }
    264230    }
    265     zoffset = pTransform.NetTranslation().z() ;
    266     zMin    = zoffset - fDz ;
    267     zMax    = zoffset + fDz ;
     231    zoffset = pTransform.NetTranslation().z();
     232    zMin    = zoffset - fDz;
     233    zMax    = zoffset + fDz;
    268234
    269235    if ( pVoxelLimit.IsZLimited() )
     
    272238        || (zMax < pVoxelLimit.GetMinZExtent()) )
    273239      {
    274         return false ;
     240        return false;
    275241      }
    276242      else
    277243      {
    278         if ( zMin < pVoxelLimit.GetMinZExtent() )
    279         {
    280           zMin = pVoxelLimit.GetMinZExtent() ;
    281         }
    282         if ( zMax > pVoxelLimit.GetMaxZExtent() )
     244        if (zMin < pVoxelLimit.GetMinZExtent())
     245        {
     246          zMin = pVoxelLimit.GetMinZExtent();
     247        }
     248        if (zMax > pVoxelLimit.GetMaxZExtent())
    283249        {
    284250          zMax = pVoxelLimit.GetMaxZExtent();
     
    290256      case kXAxis :
    291257      {
    292         yoff1 = yoffset - yMin ;
    293         yoff2 = yMax    - yoffset ;
     258        yoff1 = yoffset - yMin;
     259        yoff2 = yMax    - yoffset;
    294260
    295261        if ( (yoff1 >= 0) && (yoff2 >= 0) ) // Y limits cross max/min x
    296262        {                                   // => no change
    297           pMin = xMin ;
    298           pMax = xMax ;
     263          pMin = xMin;
     264          pMax = xMax;
    299265        }
    300266        else
     
    317283      case kYAxis :
    318284      {
    319         xoff1 = xoffset - xMin ;
    320         xoff2 = xMax - xoffset ;
     285        xoff1 = xoffset - xMin;
     286        xoff2 = xMax - xoffset;
    321287
    322288        if ( (xoff1 >= 0) && (xoff2 >= 0) ) // X limits cross max/min y
    323289        {                                   // => no change
    324           pMin = yMin ;
    325           pMax = yMax ;
     290          pMin = yMin;
     291          pMax = yMax;
    326292        }
    327293        else
     
    334300          delta   = fRMax*fRMax - xoff2*xoff2;
    335301          diff2   = (delta>0.) ? std::sqrt(delta) : 0.;
    336           maxDiff = (diff1 > diff2) ? diff1 : diff2 ;
    337           newMin  = yoffset - maxDiff ;
    338           newMax  = yoffset + maxDiff ;
    339           pMin    = (newMin < yMin) ? yMin : newMin ;
    340           pMax     =(newMax > yMax) ? yMax : newMax ;
    341         }
    342         break ;
     302          maxDiff = (diff1 > diff2) ? diff1 : diff2;
     303          newMin  = yoffset - maxDiff;
     304          newMax  = yoffset + maxDiff;
     305          pMin    = (newMin < yMin) ? yMin : newMin;
     306          pMax    = (newMax > yMax) ? yMax : newMax;
     307        }
     308        break;
    343309      }
    344310      case kZAxis:
    345311      {
    346         pMin = zMin ;
    347         pMax = zMax ;
    348         break ;
     312        pMin = zMin;
     313        pMax = zMax;
     314        break;
    349315      }
    350316      default:
    351317        break;
    352318    }
    353     pMin -= kCarTolerance ;
    354     pMax += kCarTolerance ;
    355     return true;   
     319    pMin -= kCarTolerance;
     320    pMax += kCarTolerance;
     321    return true;
    356322  }
    357323  else // Calculate rotated vertex coordinates
    358324  {
    359     G4int i, noEntries, noBetweenSections4 ;
    360     G4bool existsAfterClip = false ;
    361     G4ThreeVectorList* vertices = CreateRotatedVertices(pTransform) ;
     325    G4int i, noEntries, noBetweenSections4;
     326    G4bool existsAfterClip = false;
     327    G4ThreeVectorList* vertices = CreateRotatedVertices(pTransform);
     328
     329    pMin =  kInfinity;
     330    pMax = -kInfinity;
     331
     332    noEntries = vertices->size();
     333    noBetweenSections4 = noEntries - 4;
    362334   
    363     pMin = +kInfinity ;
    364     pMax = -kInfinity ;
    365 
    366     noEntries = vertices->size() ;
    367     noBetweenSections4 = noEntries - 4 ;
    368    
    369     for (i = 0 ; i < noEntries ; i += 4 )
    370     {
    371       ClipCrossSection(vertices, i, pVoxelLimit, pAxis, pMin, pMax) ;
    372     }
    373     for (i = 0 ; i < noBetweenSections4 ; i += 4 )
    374     {
    375       ClipBetweenSections(vertices, i, pVoxelLimit, pAxis, pMin, pMax) ;
    376     }
    377     if ((pMin != kInfinity) || (pMax != -kInfinity) )
    378     {
    379       existsAfterClip = true ;
    380       pMin -= kCarTolerance ; // Add 2*tolerance to avoid precision troubles
    381       pMax += kCarTolerance ;
     335    for ( i = 0 ; i < noEntries ; i += 4 )
     336    {
     337      ClipCrossSection(vertices, i, pVoxelLimit, pAxis, pMin, pMax);
     338    }
     339    for ( i = 0 ; i < noBetweenSections4 ; i += 4 )
     340    {
     341      ClipBetweenSections(vertices, i, pVoxelLimit, pAxis, pMin, pMax);
     342    }
     343    if ( (pMin != kInfinity) || (pMax != -kInfinity) )
     344    {
     345      existsAfterClip = true;
     346      pMin -= kCarTolerance; // Add 2*tolerance to avoid precision troubles
     347      pMax += kCarTolerance;
    382348    }
    383349    else
     
    391357             (pVoxelLimit.GetMinXExtent()+pVoxelLimit.GetMaxXExtent())*0.5,
    392358             (pVoxelLimit.GetMinYExtent()+pVoxelLimit.GetMaxYExtent())*0.5,
    393              (pVoxelLimit.GetMinZExtent()+pVoxelLimit.GetMaxZExtent())*0.5 ) ;
     359             (pVoxelLimit.GetMinZExtent()+pVoxelLimit.GetMaxZExtent())*0.5 );
    394360       
    395361      if ( Inside(pTransform.Inverse().TransformPoint(clipCentre)) != kOutside )
    396362      {
    397         existsAfterClip = true ;
    398         pMin            = pVoxelLimit.GetMinExtent(pAxis) ;
    399         pMax            = pVoxelLimit.GetMaxExtent(pAxis) ;
     363        existsAfterClip = true;
     364        pMin            = pVoxelLimit.GetMinExtent(pAxis);
     365        pMax            = pVoxelLimit.GetMaxExtent(pAxis);
    400366      }
    401367    }
     
    808774  G4double tolORMin2, tolIRMax2 ;  // 'generous' radii squared
    809775  G4double tolORMax2, tolIRMin2, tolODz, tolIDz ;
     776  const G4double dRmax = 100.*fRMax;
    810777
    811778  static const G4double halfCarTolerance = 0.5*kCarTolerance;
     
    908875        if (s >= 0)  // If 'forwards'
    909876        {
     877          if ( s>dRmax ) // Avoid rounding errors due to precision issues on
     878          {              // 64 bits systems. Split long distances and recompute
     879            G4double fTerm = s-std::fmod(s,dRmax);
     880            s = fTerm + DistanceToIn(p+fTerm*v,v);
     881          }
    910882          // Check z intersection
    911883          //
     
    1022994          //
    1023995          if(s < 0.0)  { s = 0.0; }
     996          if ( s>dRmax ) // Avoid rounding errors due to precision issues seen
     997          {              // 64 bits systems. Split long distances and recompute
     998            G4double fTerm = s-std::fmod(s,dRmax);
     999            s = fTerm + DistanceToIn(p+fTerm*v,v);
     1000          }
    10241001          zi = p.z() + s*v.z() ;
    10251002          if (std::fabs(zi) <= tolODz)
  • trunk/source/geometry/solids/specific/History

    r921 r1228  
    1 $Id: History,v 1.150 2008/11/21 09:26:53 gcosmo Exp $
     1$Id: History,v 1.160 2009/11/11 12:25:46 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2011-Nov-2009  G.Cosmo (geom-specific-V09-02-08)
     21- Avoid fake (and redundant) assignment of value to 3-vector in
     22  G4PolyconeSide and G4TwistTubsSide.
     23
     2424-Sep-2009  T.Nikitina (geom-specific-V09-02-07)
     25- G4Ellipsoid: refined fix in DistanceToIn(p,v) for points located on the
     26  curved surface, and correct treatment of geometrical tolerance.
     27
     2809-Sep-2009  G.Cosmo (geom-specific-V09-02-06)
     29- G4Ellipsoid: fixed usage of half-tolerances (radial and Cartesian) in
     30  DistanceToIn(p,v), based on incorrect assumptions introduced in tag
     31  "geom-specific-V09-02-04", responsible for zero steps on configurations
     32  with cut in Z. Addresses problem report #1076.
     33
     3404-Aug-2009  T.Nikitina (geom-specific-V09-02-05)
     35- G4Ellipsoid:
     36  o Fixes in Inside(p) and in DistanceToIn(p,v) for points
     37    located on the curved surface within tolerance. Final fix for issue
     38    reported in problem report #1050 and concerning warnings reported by
     39    grid_test.
     40  o Adopt pre-computed half-tolerance values for optimisation.
     41
     4223-Jul-2009  T.Nikitina (geom-specific-V09-02-04)
     43- G4Ellipsoid: fix to DistanceToIn(p,v) in the calculation of the roots of
     44  the quadratic equation and in DistanceToOut(p,v) in the calculation of the
     45  normal on cut surfaces. Final fix for problem report #1022 and #1050.
     46- G4PolyconeSide: added protection in method Normal(), addressing problem
     47  report #1073.
     48
     4930-Jun-2009  T.Nikitina (geom-specific-V09-02-03)
     50- G4Ellipsoid: introduced to DistanceToIn(p,v) splitting of the distance for
     51  point very far from intersection area and big difference between solid
     52  dimensions and distance to it; resolves issue observed on 64 bits problem.
     53  Also addressing problem report #1022.
     54
     5508-May-2009, G.Cosmo (geom-specific-V09-02-02)
     56- Corrected typo in base implementation of G4VCSGfaceted::GetSurfaceArea(),
     57  which was erroneously returning cubic volume estimation.
     58  Addresses problem report #1062.
     59
     6027-Apr-2009, G.Cosmo (geom-specific-V09-02-01)
     61- Relaxed error condition in G4TessellatedSolid::Inside(p) to warning, for
     62  excess of max trials and anomalous conditions in distance calculation.
     63  Added more printout information when error condition is detected.
     64
     6527-Feb-2009, T.Nikitina (geom-specific-V09-02-00)
     66- Fix in G4Paraboloid::DistanceToOut(p,v,..) for the computation of normal
     67  to surface; added missing normalisation to unit, following remark in the
     68  Geometry Forum Hypernews posting #953.
    1969
    207021-Nov-2008, G.Cosmo (geom-specific-V09-01-19)
  • trunk/source/geometry/solids/specific/include/G4ClippablePolygon.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ClippablePolygon.hh,v 1.11 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4ClippablePolygon.icc

    r1058 r1228  
    2626//
    2727// $Id: G4ClippablePolygon.icc,v 1.4 2006/06/29 18:46:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4Ellipsoid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Ellipsoid.hh,v 1.12 2007/05/18 07:39:56 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Ellipsoid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Ellipsoid.icc,v 1.7 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4EllipticalCone.hh

    r1058 r1228  
    2626//
    2727// $Id: G4EllipticalCone.hh,v 1.12 2008/11/21 09:26:22 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4EllipticalCone.icc

    r1058 r1228  
    2626//
    2727// $Id: G4EllipticalCone.icc,v 1.7 2008/11/21 09:26:22 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4EllipticalTube.hh

    r1058 r1228  
    2626//
    2727// $Id: G4EllipticalTube.hh,v 1.18 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4EllipticalTube.icc

    r1058 r1228  
    2626//
    2727// $Id: G4EllipticalTube.icc,v 1.4 2006/06/29 18:46:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4EnclosingCylinder.hh

    r1058 r1228  
    2626//
    2727// $Id: G4EnclosingCylinder.hh,v 1.8 2006/06/29 18:46:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4ExtrudedSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ExtrudedSolid.hh,v 1.7 2008/02/27 12:32:48 ivana Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4ExtrudedSolid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4ExtrudedSolid.icc,v 1.2 2007/02/19 10:17:45 ivana Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4Hype.hh

    r1058 r1228  
    2727// $Id: G4Hype.hh,v 1.15 2006/10/20 13:45:20 gcosmo Exp $
    2828// $Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
    29 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131//
  • trunk/source/geometry/solids/specific/include/G4Hype.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Hype.icc,v 1.7 2006/06/29 18:47:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4IntersectingCone.hh

    r1058 r1228  
    2626//
    2727// $Id: G4IntersectingCone.hh,v 1.11 2008/04/28 08:59:47 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Paraboloid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Paraboloid.hh,v 1.4 2008/01/22 17:42:09 tnikitin Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Paraboloid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Paraboloid.icc,v 1.4 2007/08/21 12:58:36 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4PolyPhiFace.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PolyPhiFace.hh,v 1.12 2008/05/15 11:41:58 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4PolyPhiFace.icc

    r1058 r1228  
    2626//
    2727// $Id: G4PolyPhiFace.icc,v 1.6 2006/06/29 18:47:10 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Polycone.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Polycone.hh,v 1.22 2008/05/15 13:45:15 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Polycone.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Polycone.icc,v 1.10 2006/06/29 18:47:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4PolyconeSide.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PolyconeSide.hh,v 1.12 2008/05/15 11:41:58 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Polyhedra.hh

    r1058 r1228  
    2626//
    2727// $Id: G4Polyhedra.hh,v 1.20 2008/05/15 13:45:15 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4Polyhedra.icc

    r1058 r1228  
    2626//
    2727// $Id: G4Polyhedra.icc,v 1.11 2007/01/22 12:58:53 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/include/G4PolyhedraSide.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PolyhedraSide.hh,v 1.11 2008/05/15 11:41:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4QuadrangularFacet.hh

    r1058 r1228  
    2626//
    2727// $Id: G4QuadrangularFacet.hh,v 1.6 2008/12/18 12:57:24 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4ReduciblePolygon.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ReduciblePolygon.hh,v 1.9 2006/06/29 18:47:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4SolidExtentList.hh

    r1058 r1228  
    2626//
    2727// $Id: G4SolidExtentList.hh,v 1.7 2006/06/29 18:47:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TessellatedGeometryAlgorithms.hh

    r1058 r1228  
    2626//
    2727// $Id:
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4TessellatedGeometryAlgorithms.icc

    r1058 r1228  
    2626//
    2727// $Id:
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4TessellatedSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TessellatedSolid.hh,v 1.10 2007/12/10 16:30:13 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4Tet.hh

    r1058 r1228  
    3030//
    3131// $Id: G4Tet.hh,v 1.9 2006/11/13 08:58:03 gcosmo Exp $
    32 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     32// GEANT4 tag $Name: geant4-09-03 $
    3333//
    3434//
  • trunk/source/geometry/solids/specific/include/G4TriangularFacet.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TriangularFacet.hh,v 1.8 2007/12/10 16:30:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4TwistTrapFlatSide.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTrapFlatSide.hh,v 1.5 2006/06/29 18:47:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistTubsFlatSide.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTubsFlatSide.hh,v 1.5 2006/06/29 18:47:53 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistTubsHypeSide.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTubsHypeSide.hh,v 1.5 2006/06/29 18:47:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistTubsSide.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTubsSide.hh,v 1.5 2006/06/29 18:47:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedBox.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedBox.hh,v 1.10 2006/06/29 18:48:00 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedTrap.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedTrap.hh,v 1.10 2006/06/29 18:48:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedTrd.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedTrd.hh,v 1.6 2006/06/29 18:48:04 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4TwistedTubs.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedTubs.hh,v 1.14 2007/05/23 09:32:35 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VCSGface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VCSGface.hh,v 1.9 2008/05/15 11:41:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VCSGfaceted.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VCSGfaceted.hh,v 1.17 2008/05/15 13:45:15 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VFacet.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VFacet.hh,v 1.7 2008/12/18 12:57:30 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4VFacet.icc

    r1058 r1228  
    2626//
    2727// $Id: G4VFacet.icc,v 1.6 2008/12/18 12:57:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/include/G4VTwistSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VTwistSurface.hh,v 1.6 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VTwistSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4VTwistSurface.icc,v 1.3 2006/06/29 18:48:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/include/G4VTwistedFaceted.hh

    r1058 r1228  
    2626//
    2727// $Id: G4VTwistedFaceted.hh,v 1.10 2006/10/20 13:45:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/solids/specific/src/G4ClippablePolygon.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ClippablePolygon.cc,v 1.12 2007/05/11 13:54:28 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4Ellipsoid.cc

    r1058 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Ellipsoid.cc,v 1.14 2007/05/18 07:39:56 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4Ellipsoid.cc,v 1.24 2009/09/24 15:51:02 gcosmo Exp $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// class G4Ellipsoid
     
    385385  EInside in;
    386386
     387  static const G4double halfRadTolerance=kRadTolerance*0.5;
     388
    387389  // check this side of z cut first, because that's fast
    388390  //
    389   if (p.z() < zBottomCut-kRadTolerance/2.0)
    390     { return in=kOutside; }
    391   if (p.z() > zTopCut+kRadTolerance/2.0)
    392     { return in=kOutside; }
    393 
    394   rad2oo= sqr(p.x()/(xSemiAxis+kRadTolerance/2.))
    395         + sqr(p.y()/(ySemiAxis+kRadTolerance/2.))
    396         + sqr(p.z()/(zSemiAxis+kRadTolerance/2.));
    397 
    398   if (rad2oo > 1.0)
    399     { return in=kOutside; }
     391  if (p.z() < zBottomCut-halfRadTolerance) { return in=kOutside; }
     392  if (p.z() > zTopCut+halfRadTolerance)    { return in=kOutside; }
     393
     394  rad2oo= sqr(p.x()/(xSemiAxis+halfRadTolerance))
     395        + sqr(p.y()/(ySemiAxis+halfRadTolerance))
     396        + sqr(p.z()/(zSemiAxis+halfRadTolerance));
     397
     398  if (rad2oo > 1.0)  { return in=kOutside; }
    400399   
    401   rad2oi= sqr(p.x()*(1.0+kRadTolerance/2./xSemiAxis)/xSemiAxis)
    402       + sqr(p.y()*(1.0+kRadTolerance/2./ySemiAxis)/ySemiAxis)
    403       + sqr(p.z()*(1.0+kRadTolerance/2./zSemiAxis)/zSemiAxis);
     400  rad2oi= sqr(p.x()*(1.0+halfRadTolerance/xSemiAxis)/xSemiAxis)
     401      + sqr(p.y()*(1.0+halfRadTolerance/ySemiAxis)/ySemiAxis)
     402      + sqr(p.z()*(1.0+halfRadTolerance/zSemiAxis)/zSemiAxis);
    404403
    405404  // Check radial surfaces
     
    408407  if (rad2oi < 1.0)
    409408  {
    410     in = ( (p.z() < zBottomCut+kRadTolerance/2.0)
    411         || (p.z() > zTopCut-kRadTolerance/2.0) ) ? kSurface : kInside;
     409    in = ( (p.z() < zBottomCut+halfRadTolerance)
     410        || (p.z() > zTopCut-halfRadTolerance) ) ? kSurface : kInside;
     411    if ( rad2oi > 1.0-halfRadTolerance )  { in=kSurface; }
    412412  }
    413413  else
     
    415415    in = kSurface;
    416416  }
    417 
    418417  return in;
     418
    419419}
    420420
     
    460460                                    const G4ThreeVector& v  ) const
    461461{
    462   G4double distMin;
    463  
     462  static const G4double halfCarTolerance=kCarTolerance*0.5;
     463  static const G4double halfRadTolerance=kRadTolerance*0.5;
     464
     465  G4double distMin = std::min(xSemiAxis,ySemiAxis);
     466  const G4double dRmax = 100.*std::min(distMin,zSemiAxis);
    464467  distMin= kInfinity;
    465468
    466469  // check to see if Z plane is relevant
    467   if (p.z() < zBottomCut) {
    468     if (v.z() <= 0.0)
    469       return distMin;
     470  if (p.z() <= zBottomCut+halfCarTolerance)
     471  {
     472    if (v.z() <= 0.0) { return distMin; }
    470473    G4double distZ = (zBottomCut - p.z()) / v.z();
    471     if (distZ > kRadTolerance/2.0 && Inside(p+distZ*v) != kOutside )
    472       {
    473         // early exit since can't intercept curved surface if we reach here
    474         return distMin= distZ;
    475       }
    476   }
    477   if (p.z() > zTopCut) {
    478     if (v.z() >= 0.0)
    479       return distMin;
     474
     475    if ( (distZ > -halfRadTolerance) && (Inside(p+distZ*v) != kOutside) )
     476    {
     477      // early exit since can't intercept curved surface if we reach here
     478      if ( std::abs(distZ) < halfRadTolerance ) { distZ=0.; }
     479      return distMin= distZ;
     480    }
     481  }
     482  if (p.z() >= zTopCut-halfCarTolerance)
     483  {
     484    if (v.z() >= 0.0) { return distMin;}
    480485    G4double distZ = (zTopCut - p.z()) / v.z();
    481     if (distZ > kRadTolerance/2.0 && Inside(p+distZ*v) != kOutside )
    482       {
    483         // early exit since can't intercept curved surface if we reach here
    484         return distMin= distZ;
    485       }
     486    if ( (distZ > -halfRadTolerance) && (Inside(p+distZ*v) != kOutside) )
     487    {
     488      // early exit since can't intercept curved surface if we reach here
     489      if ( std::abs(distZ) < halfRadTolerance ) { distZ=0.; }
     490      return distMin= distZ;
     491    }
    486492  }
    487493  // if fZCut1 <= p.z() <= fZCut2, then must hit curved surface
     
    492498  A= sqr(v.x()/xSemiAxis) + sqr(v.y()/ySemiAxis) + sqr(v.z()/zSemiAxis);
    493499  C= sqr(p.x()/xSemiAxis) + sqr(p.y()/ySemiAxis) + sqr(p.z()/zSemiAxis) - 1.0;
    494   B= 2.0 * ( p.x()*v.x()/(xSemiAxis*xSemiAxis) + p.y()*v.y()/(ySemiAxis*ySemiAxis)
    495              + p.z()*v.z()/(zSemiAxis*zSemiAxis) );
     500  B= 2.0 * ( p.x()*v.x()/(xSemiAxis*xSemiAxis)
     501           + p.y()*v.y()/(ySemiAxis*ySemiAxis)
     502           + p.z()*v.z()/(zSemiAxis*zSemiAxis) );
    496503
    497504  C= B*B - 4.0*A*C;
    498505  if (C > 0.0)
    499     {
    500       G4double distR= (-B - std::sqrt(C) ) / (2.0*A);
    501       G4double intZ= p.z()+distR*v.z();
    502       if (distR > kRadTolerance/2.0
    503           && intZ >= zBottomCut-kRadTolerance/2.0
    504           && intZ <= zTopCut+kRadTolerance/2.0)
    505         {
    506           distMin = distR;
    507         }
    508       else
    509         {
    510           distR= (-B + std::sqrt(C) ) / (2.0*A);
    511           intZ= p.z()+distR*v.z();
    512           if (distR > kRadTolerance/2.0
    513               && intZ >= zBottomCut-kRadTolerance/2.0
    514               && intZ <= zTopCut+kRadTolerance/2.0)
    515             {
    516               distMin = distR;
    517             }
    518         }
    519     }
    520 
     506  {   
     507    G4double distR= (-B - std::sqrt(C)) / (2.0*A);
     508    G4double intZ = p.z()+distR*v.z();
     509    if ( (distR > halfRadTolerance)
     510      && (intZ >= zBottomCut-halfRadTolerance)
     511      && (intZ <= zTopCut+halfRadTolerance) )
     512    {
     513      distMin = distR;
     514    }
     515    else if( (distR >- halfRadTolerance)
     516            && (intZ >= zBottomCut-halfRadTolerance)
     517            && (intZ <= zTopCut+halfRadTolerance) )
     518    {
     519      // p is on the curved surface, DistanceToIn returns 0 or kInfinity:
     520      // DistanceToIn returns 0, if second root is positive (means going inside)
     521      // If second root is negative, DistanceToIn returns kInfinity (outside)
     522      //
     523      distR = (-B + std::sqrt(C) ) / (2.0*A);
     524      if(distR>0.) { distMin=0.; }
     525    }
     526    else
     527    {
     528      distR= (-B + std::sqrt(C)) / (2.0*A);
     529      intZ = p.z()+distR*v.z();
     530      if ( (distR > halfRadTolerance)
     531        && (intZ >= zBottomCut-halfRadTolerance)
     532        && (intZ <= zTopCut+halfRadTolerance) )
     533      {
     534        G4ThreeVector norm=SurfaceNormal(p);
     535        if (norm.dot(v)<0.) { distMin = distR; }
     536      }
     537    }
     538    if ( (distMin!=kInfinity) && (distMin>dRmax) )
     539    {                    // Avoid rounding errors due to precision issues on
     540                         // 64 bits systems. Split long distances and recompute
     541      G4double fTerm = distMin-std::fmod(distMin,dRmax);
     542      distMin = fTerm + DistanceToIn(p+fTerm*v,v);
     543    }
     544  }
     545 
     546  if (std::abs(distMin)<halfRadTolerance) { distMin=0.; }
    521547  return distMin;
    522548}
     
    651677      {
    652678        case kPlaneSurf:
    653           *n= G4ThreeVector(0.,0.,(v.z() > 1.0 ? 1. : -1.));
     679          *n= G4ThreeVector(0.,0.,(v.z() > 0.0 ? 1. : -1.));
    654680          break;
    655681        case kCurvedSurf:
     
    683709    }
    684710  }
     711   
    685712  return distMin;
    686713}
     
    905932  max1  = xSemiAxis > ySemiAxis ? xSemiAxis : ySemiAxis;
    906933  max1  = max1 > zSemiAxis ? max1 : zSemiAxis;
    907   if(max1 == xSemiAxis){max2 = ySemiAxis; max3 = zSemiAxis;}
    908   else if(max1 == ySemiAxis){max2 = xSemiAxis; max3 = zSemiAxis;}
    909   else {max2 = xSemiAxis; max3 = ySemiAxis; }
    910 
    911   phi   = RandFlat::shoot(0.,2.*pi);
     934  if (max1 == xSemiAxis)      { max2 = ySemiAxis; max3 = zSemiAxis; }
     935  else if (max1 == ySemiAxis) { max2 = xSemiAxis; max3 = zSemiAxis; }
     936  else                        { max2 = xSemiAxis; max3 = ySemiAxis; }
     937
     938  phi   = RandFlat::shoot(0.,twopi);
    912939  theta = RandFlat::shoot(0.,pi);
    913940 
  • trunk/source/geometry/solids/specific/src/G4EllipticalCone.cc

    r1058 r1228  
    2525//
    2626// $Id: G4EllipticalCone.cc,v 1.16 2008/04/25 08:45:26 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// Implementation of G4EllipticalCone class
  • trunk/source/geometry/solids/specific/src/G4EllipticalTube.cc

    r1058 r1228  
    2626//
    2727// $Id: G4EllipticalTube.cc,v 1.27 2006/10/20 13:45:21 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4EnclosingCylinder.cc

    r1058 r1228  
    2626//
    2727// $Id: G4EnclosingCylinder.cc,v 1.10 2007/05/11 13:54:29 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4ExtrudedSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ExtrudedSolid.cc,v 1.18 2008/10/30 11:47:45 ivana Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4Hype.cc

    r1058 r1228  
    2727// $Id: G4Hype.cc,v 1.27 2008/04/14 08:49:28 gcosmo Exp $
    2828// $Original: G4Hype.cc,v 1.0 1998/06/09 16:57:50 safai Exp $
    29 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131//
  • trunk/source/geometry/solids/specific/src/G4IntersectingCone.cc

    r1058 r1228  
    2626//
    2727// $Id: G4IntersectingCone.cc,v 1.12 2008/04/28 08:59:47 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4Paraboloid.cc

    r1058 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Paraboloid.cc,v 1.8 2008/07/17 07:33:00 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4Paraboloid.cc,v 1.9 2009/02/27 15:10:46 tnikitin Exp $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// class G4Paraboloid
     
    866866      *n = G4ThreeVector(p.x() + intersection * v.x(), p.y()
    867867         + intersection * v.y(), - k1 / 2);
     868      *n = n->unit();
    868869    }
    869870    return intersection;
  • trunk/source/geometry/solids/specific/src/G4PolyPhiFace.cc

    r1058 r1228  
    2626//
    2727// $Id: G4PolyPhiFace.cc,v 1.15 2008/05/15 11:41:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4Polycone.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Polycone.cc,v 1.43 2008/05/15 13:45:15 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4PolyconeSide.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4PolyconeSide.cc,v 1.19 2008/05/15 11:41:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4PolyconeSide.cc,v 1.22 2009/11/11 12:23:37 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    462462  if (p == G4ThreeVector(0.,0.,0.))  { return p; }
    463463
    464   G4ThreeVector dFrom;
    465   G4double dOut2;
     464  G4double dFrom, dOut2;
    466465 
    467466  dFrom = DistanceAway( p, false, dOut2 );
     
    470469 
    471470  G4double rad = p.perp();
    472   return G4ThreeVector( rNorm*p.x()/rad, rNorm*p.y()/rad, zNorm );
     471  if (rad!=0.) { return G4ThreeVector(rNorm*p.x()/rad,rNorm*p.y()/rad,zNorm); }
     472  return G4ThreeVector( 0.,0., zNorm ).unit();
    473473}
    474474
  • trunk/source/geometry/solids/specific/src/G4Polyhedra.cc

    r1058 r1228  
    2626//
    2727// $Id: G4Polyhedra.cc,v 1.42 2008/05/15 13:45:15 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4PolyhedraSide.cc

    r1058 r1228  
    2626//
    2727// $Id: G4PolyhedraSide.cc,v 1.15 2008/05/15 11:41:59 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4QuadrangularFacet.cc

    r1058 r1228  
    2727//
    2828// $Id: G4QuadrangularFacet.cc,v 1.7 2008/12/18 12:57:34 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4ReduciblePolygon.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ReduciblePolygon.cc,v 1.11 2006/06/29 18:48:53 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4SolidExtentList.cc

    r1058 r1228  
    2626//
    2727// $Id: G4SolidExtentList.cc,v 1.5 2007/05/11 13:54:29 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TessellatedGeometryAlgorithms.cc

    r1058 r1228  
    2727//
    2828// $Id: G4TessellatedGeometryAlgorithms.cc,v 1.6 2008/12/18 12:57:36 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4TessellatedSolid.cc

    r1058 r1228  
    2525// ********************************************************************
    2626//
    27 // $Id: G4TessellatedSolid.cc,v 1.18 2008/03/13 11:58:28 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4TessellatedSolid.cc,v 1.19 2009/04/27 08:06:27 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    520520    } while (nearParallel && m!=maxTries);
    521521
     522#ifdef G4VERBOSE
    522523    if (m == maxTries)
    523524    {
     
    528529// something wrong with geometry.
    529530//
     531      G4cout.precision(16) ;
     532      G4cout << G4endl ;
     533      G4cout << "Solid name       = " << GetName()  << G4endl;
     534      G4cout << "Geometry Type    = " << geometryType  << G4endl;
     535      G4cout << "Number of facets = " << facets.size() << G4endl;
     536      G4cout << "Position:"  << G4endl << G4endl ;
     537      G4cout << "p.x() = "   << p.x()/mm << " mm" << G4endl ;
     538      G4cout << "p.y() = "   << p.y()/mm << " mm" << G4endl ;
     539      G4cout << "p.z() = "   << p.z()/mm << " mm" << G4endl << G4endl ;
    530540      G4Exception("G4TessellatedSolid::Inside()",
    531                 "UnknownInsideOutside", FatalException,
     541                "UnknownInsideOutside-MaxTries", JustWarning,
    532542                "Cannot determine whether point is inside or outside volume!");
    533543    }
     544#endif
    534545//
    535546//
     
    550561      locationprime = kInside;
    551562
    552     if (i == 0) location = locationprime;
     563    if (i == 0)  { location = locationprime; }
     564#ifdef G4VERBOSE
    553565    else if (locationprime != location)
    554566    {
     
    558570// geometry is not constructed correctly.
    559571//
     572      G4cout.precision(16) ;
     573      G4cout << G4endl ;
     574      G4cout << "Solid name       = " << GetName()  << G4endl;
     575      G4cout << "Geometry Type    = " << geometryType  << G4endl;
     576      G4cout << "Number of facets = " << facets.size() << G4endl;
     577      G4cout << "Position:"  << G4endl << G4endl ;
     578      G4cout << "p.x() = "   << p.x()/mm << " mm" << G4endl ;
     579      G4cout << "p.y() = "   << p.y()/mm << " mm" << G4endl ;
     580      G4cout << "p.z() = "   << p.z()/mm << " mm" << G4endl << G4endl ;
    560581      G4Exception("G4TessellatedSolid::Inside()",
    561                 "UnknownInsideOutside", FatalException,
     582                "UnknownInsideOutside", JustWarning,
    562583                "Cannot determine whether point is inside or outside volume!");
    563584    }
     585#endif
    564586  }
    565587
  • trunk/source/geometry/solids/specific/src/G4Tet.cc

    r1058 r1228  
    2929//
    3030// $Id: G4Tet.cc,v 1.11 2006/11/13 08:58:03 gcosmo Exp $
    31 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     31// GEANT4 tag $Name: geant4-09-03 $
    3232//
    3333// class G4Tet
  • trunk/source/geometry/solids/specific/src/G4TriangularFacet.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TriangularFacet.cc,v 1.12 2008/11/13 08:25:07 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4TwistBoxSide.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistBoxSide.cc,v 1.6 2007/05/23 09:31:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTrapAlphaSide.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTrapAlphaSide.cc,v 1.8 2007/05/23 13:26:06 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTrapFlatSide.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTrapFlatSide.cc,v 1.6 2007/05/23 09:31:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTrapParallelSide.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTrapParallelSide.cc,v
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTubsFlatSide.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTubsFlatSide.cc,v 1.7 2007/05/23 09:31:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTubsHypeSide.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistTubsHypeSide.cc,v 1.6 2007/05/18 07:39:56 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistTubsSide.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4TwistTubsSide.cc,v 1.5 2006/06/29 18:49:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4TwistTubsSide.cc,v 1.6 2009/11/11 12:23:37 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    411411           G4int l;
    412412           G4double      lastdeltaY = deltaY;
    413            G4ThreeVector last = deltaY;
    414413           for (l=0; l<maxcount; l++) {
    415414             G4ThreeVector surfacenormal = GetNormal(xxonsurface);
  • trunk/source/geometry/solids/specific/src/G4TwistedBox.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedBox.cc,v 1.12 2006/06/29 18:49:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistedTrap.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedTrap.cc,v 1.14 2006/06/29 18:49:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistedTrd.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedTrd.cc,v 1.7 2006/06/29 18:49:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4TwistedTubs.cc

    r1058 r1228  
    2626//
    2727// $Id: G4TwistedTubs.cc,v 1.24 2007/05/18 07:39:56 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4VCSGfaceted.cc

    r1058 r1228  
    3030// and all its terms.
    3131//
    32 // $Id: G4VCSGfaceted.cc,v 1.25 2008/05/22 10:22:52 gcosmo Exp $
    33 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     32// $Id: G4VCSGfaceted.cc,v 1.26 2009/05/08 14:29:56 gcosmo Exp $
     33// GEANT4 tag $Name: geant4-09-03 $
    3434//
    3535//
     
    550550{
    551551  if(fSurfaceArea != 0.) {;}
    552   else   { fSurfaceArea = EstimateCubicVolume(fStatistics,fAreaAccuracy); }
     552  else   { fSurfaceArea = EstimateSurfaceArea(fStatistics,fAreaAccuracy); }
    553553  return fSurfaceArea;
    554554}
  • trunk/source/geometry/solids/specific/src/G4VFacet.cc

    r1058 r1228  
    2727//
    2828// $Id: G4VFacet.cc,v 1.8 2008/12/18 12:57:38 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     29// GEANT4 tag $Name: geant4-09-03 $
    3030//
    3131// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • trunk/source/geometry/solids/specific/src/G4VTwistSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4VTwistSurface.cc,v 1.9 2007/05/31 13:52:48 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/solids/specific/src/G4VTwistedFaceted.cc

    r1058 r1228  
    2525//
    2626// $Id: G4VTwistedFaceted.cc,v 1.18 2007/05/25 09:42:34 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929//
  • trunk/source/geometry/volumes/History

    r921 r1228  
    1 $Id: History,v 1.155 2008/11/13 09:35:03 gcosmo Exp $
     1$Id: History,v 1.163 2009/11/06 11:35:03 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     20Nov 6th, 2009       G.Cosmo - geomvol-V09-02-04
     21- Moved inline constructors to source for G4TouchableHistory, to avoid problems
     22  of memory alignment in allocation.
     23
     24Nov 3rd, 2009       G.Cosmo - geomvol-V09-02-03
     25- Use G4Allocator for dynamic allocation of G4TouchableHistory objects.
     26  Should reduce the number of direct calls to malloc and memory fragmentation.
     27  Measured an average improvement of 3-5% in CPU speed, and same memory
     28  footprint.
     29
     30Sep 22nd, 2009      G.Cosmo - geomvol-V09-02-02
     31- Added missing implementation for composing G4AssemblyVolume constructor.
     32
     33Sep 21st, 2009      G.Cosmo - geomvol-V09-02-01
     34- Fix in G4PVParameterised::CheckOverlaps() to not modify daughter volume
     35  transformation matrix for application to points in the daughter's frame.
     36  Adopt Inverse() instead of Invert() in call to G4AffineTransform.
     37  Addresses problem report #1078.
     38
     39Aug 3rd, 2009       G.Cosmo - geomvol-V09-02-00
     40- Get rid of unnecessary call to Reset() in G4NavigationHistory destructor.
     41- Some code formatting...
    1942
    2043Nov 13th, 2008      G.Cosmo - geomvol-V09-01-03
  • trunk/source/geometry/volumes/include/G4AssemblyTriplet.hh

    r1058 r1228  
    2626//
    2727// $Id: G4AssemblyTriplet.hh,v 1.3 2007/11/16 16:20:25 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4AssemblyTriplet.icc

    r1058 r1228  
    2626//
    2727// $Id: G4AssemblyTriplet.icc,v 1.2 2006/06/29 18:56:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4AssemblyVolume.hh

    r1058 r1228  
    2626//
    2727// $Id: G4AssemblyVolume.hh,v 1.7 2006/06/29 18:56:51 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4AssemblyVolume.icc

    r1058 r1228  
    2626//
    2727// $Id: G4AssemblyVolume.icc,v 1.3 2006/06/29 18:56:53 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4GRSSolid.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GRSSolid.hh,v 1.8 2006/06/29 18:56:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4GRSSolid.icc

    r1058 r1228  
    2626//
    2727// $Id: G4GRSSolid.icc,v 1.9 2006/06/29 18:56:57 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4GRSSolidHandle.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GRSSolidHandle.hh,v 1.6 2006/06/29 18:56:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Class G4GRSSolidHandle
  • trunk/source/geometry/volumes/include/G4GRSVolume.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GRSVolume.hh,v 1.8 2006/06/29 18:57:01 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4GRSVolume.icc

    r1058 r1228  
    2626//
    2727// $Id: G4GRSVolume.icc,v 1.10 2006/06/29 18:57:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4GRSVolumeHandle.hh

    r1058 r1228  
    2626//
    2727// $Id: G4GRSVolumeHandle.hh,v 1.6 2006/06/29 18:57:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Class G4GRSVolumeHandle
  • trunk/source/geometry/volumes/include/G4LogicalBorderSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalBorderSurface.hh,v 1.17 2008/08/19 15:31:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4LogicalBorderSurface
  • trunk/source/geometry/volumes/include/G4LogicalBorderSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalBorderSurface.icc,v 1.9 2006/06/29 18:57:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4LogicalSkinSurface.hh

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalSkinSurface.hh,v 1.17 2008/08/19 15:31:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4LogicalSkinSurface
  • trunk/source/geometry/volumes/include/G4LogicalSkinSurface.icc

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalSkinSurface.icc,v 1.9 2006/06/29 18:57:16 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4NavigationHistory.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4NavigationHistory.hh,v 1.13 2006/06/29 18:57:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4NavigationHistory.hh,v 1.14 2009/11/03 09:15:51 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4NavigationHistory
     
    4747#include "geomdefs.hh"
    4848
     49//#include "G4Allocator.hh"
    4950#include "G4AffineTransform.hh"
    5051#include "G4VPhysicalVolume.hh"
     
    141142 private:
    142143
    143   std::vector<G4NavigationLevel>  fNavHistory;
     144  std::vector<G4NavigationLevel> fNavHistory;
     145  //std::vector<G4NavigationLevel, G4Allocator<G4NavigationLevel> > fNavHistory;
    144146
    145147  G4int fStackDepth;
  • trunk/source/geometry/volumes/include/G4NavigationHistory.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4NavigationHistory.icc,v 1.12 2006/06/29 18:57:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4NavigationHistory.icc,v 1.14 2009/08/04 08:27:20 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    3737G4NavigationHistory::operator=(const G4NavigationHistory &h)
    3838{
    39   if (&h == this) return *this;
     39  if (&h == this)  { return *this; }
    4040
    4141  // fNavHistory=h.fNavHistory;   // This works, but is very slow.
  • trunk/source/geometry/volumes/include/G4NavigationLevel.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4NavigationLevel.hh,v 1.16 2006/06/29 18:57:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4NavigationLevel.hh,v 1.18 2009/08/04 08:27:20 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4NavigationLevel
  • trunk/source/geometry/volumes/include/G4NavigationLevel.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4NavigationLevel.icc,v 1.20 2006/06/29 18:57:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4NavigationLevel.icc,v 1.22 2009/08/04 08:27:20 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// 30.09.97 J.Apostolakis Initial version.
  • trunk/source/geometry/volumes/include/G4NavigationLevelRep.hh

    r1058 r1228  
    2626//
    2727// $Id: G4NavigationLevelRep.hh,v 1.9 2006/06/29 18:57:27 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// class G4NavigationLevelRep
  • trunk/source/geometry/volumes/include/G4NavigationLevelRep.icc

    r1058 r1228  
    2626//
    2727// $Id: G4NavigationLevelRep.icc,v 1.14 2006/06/29 18:57:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//  1 October 1997 J.Apostolakis Initial version.
  • trunk/source/geometry/volumes/include/G4PVParameterised.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PVParameterised.hh,v 1.8 2007/04/11 07:56:38 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4PVPlacement.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PVPlacement.hh,v 1.8 2007/04/11 07:56:38 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4PVReplica.hh

    r1058 r1228  
    2626//
    2727// $Id: G4PVReplica.hh,v 1.5 2006/06/29 18:57:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4ReflectionFactory.hh

    r1058 r1228  
    2626//
    2727// $Id: G4ReflectionFactory.hh,v 1.4 2008/11/13 09:33:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/include/G4TouchableHistory.hh

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4TouchableHistory.hh,v 1.8 2006/06/29 18:57:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4TouchableHistory.hh,v 1.11 2009/11/06 11:10:35 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    3434//
    3535// Object representing a touchable detector element, and its history in the
    36 // geomtrical hierarchy, including its net resultant local->global transform.
     36// geometrical hierarchy, including its net resultant local->global transform.
    3737
    3838// History:
     
    4545
    4646#include "G4NavigationHistory.hh"
     47#include "G4Allocator.hh"
    4748#include "G4LogicalVolume.hh"
    4849#include "G4ThreeVector.hh"
     
    6061    // It is for initialisation only. 
    6162
    62   virtual ~G4TouchableHistory();
     63 ~G4TouchableHistory();
    6364
    6465  inline G4VPhysicalVolume* GetVolume( G4int depth=0 ) const;
     
    7273    // Access methods for touchables with history
    7374
    74   virtual void  UpdateYourself( G4VPhysicalVolume*   pPhysVol,
    75                           const G4NavigationHistory* history=0 );
     75  void  UpdateYourself( G4VPhysicalVolume*   pPhysVol,
     76                        const G4NavigationHistory* history=0 );
    7677    // Update methods for touchables with history
    7778
     
    8182    // Should this method be "deprecated" ?
    8283    // it is used now in G4Navigator::LocateGlobalPointAndSetup
     84
     85  inline void *operator new(size_t);
     86  inline void operator delete(void *aTH);
     87    // Override "new" and "delete" to use "G4Allocator".
    8388
    8489 private:
  • trunk/source/geometry/volumes/include/G4TouchableHistory.icc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4TouchableHistory.icc,v 1.10 2006/12/07 14:26:28 japost Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4TouchableHistory.icc,v 1.13 2009/11/06 11:10:35 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    3232// ----------------------------------------------------------------------
    3333
    34 inline
    35 G4TouchableHistory::G4TouchableHistory()
    36   : frot(G4RotationMatrix()),
    37     ftlate(G4ThreeVector(0.,0.,0.)),
    38     fhistory()
    39 {
    40    G4VPhysicalVolume* pPhysVol=0;
    41    fhistory.SetFirstEntry(pPhysVol);
    42 }
    43 
    44 inline
    45 G4TouchableHistory::G4TouchableHistory( const G4NavigationHistory &history )
    46   : fhistory(history)
    47 {
    48   G4AffineTransform tf(fhistory.GetTopTransform().Inverse());
    49   ftlate = tf.NetTranslation();
    50   frot = tf.NetRotation();
    51 }
     34#if defined G4GEOM_ALLOC_EXPORT
     35  extern G4DLLEXPORT G4Allocator<G4TouchableHistory> aTouchableHistoryAllocator;
     36#else
     37  extern G4DLLIMPORT G4Allocator<G4TouchableHistory> aTouchableHistoryAllocator;
     38#endif
    5239
    5340inline
     
    10390G4int G4TouchableHistory::MoveUpHistory( G4int num_levels )
    10491{
    105   G4NavigationHistory* nHistory= &fhistory;
    106   G4int maxLevelsMove = nHistory->GetDepth();
     92  G4int maxLevelsMove = fhistory.GetDepth();
    10793  G4int minLevelsMove = 0;              // Cannot redescend today!
    10894                                        // Soon it will be possible
     
    117103    num_levels = minLevelsMove;
    118104  }
    119   nHistory->BackLevel( num_levels );
     105  fhistory.BackLevel( num_levels );
    120106
    121107  return num_levels;
     
    127113  return &fhistory;
    128114}
     115
     116// There is no provision in case this class is subclassed.
     117// If it is subclassed, this will fail and may not give errors!
     118//
     119inline
     120void* G4TouchableHistory::operator new(size_t)
     121{
     122  return (void *) aTouchableHistoryAllocator.MallocSingle();
     123}
     124
     125inline
     126void G4TouchableHistory::operator delete(void *aTH)
     127{
     128  aTouchableHistoryAllocator.FreeSingle((G4TouchableHistory *) aTH);
     129}
     130
  • trunk/source/geometry/volumes/include/G4TouchableHistoryHandle.hh

    r1058 r1228  
    2626//
    2727// $Id: G4TouchableHistoryHandle.hh,v 1.6 2006/06/29 18:57:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// Class G4TouchableHistoryHandle
  • trunk/source/geometry/volumes/src/G4AssemblyVolume.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4AssemblyVolume.cc,v 1.11 2008/02/03 09:12:50 ivana Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4AssemblyVolume.cc,v 1.12 2009/09/22 13:58:48 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    4848//
    4949G4AssemblyVolume::G4AssemblyVolume()
    50 : fAssemblyID( 0 )
     50  : fAssemblyID( 0 )
    5151{
    5252  InstanceCountPlus();
    5353  SetAssemblyID( GetInstanceCount() );
    5454  SetImprintsCount( 0 );
     55}
     56
     57// Composing constructor
     58//
     59G4AssemblyVolume::G4AssemblyVolume( G4LogicalVolume* volume,
     60                                    G4ThreeVector& translation,
     61                                    G4RotationMatrix* rotation )
     62  : fAssemblyID( 0 )
     63{
     64  InstanceCountPlus();
     65  SetAssemblyID( GetInstanceCount() );
     66  SetImprintsCount( 0 );
     67  AddPlacedVolume(volume, translation, rotation);
    5568}
    5669
  • trunk/source/geometry/volumes/src/G4GRSSolid.cc

    r1058 r1228  
    2626//
    2727// $Id: G4GRSSolid.cc,v 1.8 2006/06/29 18:57:53 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/src/G4GRSVolume.cc

    r1058 r1228  
    2626//
    2727// $Id: G4GRSVolume.cc,v 1.8 2006/06/29 18:57:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/src/G4LogicalBorderSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalBorderSurface.cc,v 1.17 2008/08/19 15:31:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/volumes/src/G4LogicalSkinSurface.cc

    r1058 r1228  
    2626//
    2727// $Id: G4LogicalSkinSurface.cc,v 1.16 2008/08/19 15:31:52 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// --------------------------------------------------------------------
  • trunk/source/geometry/volumes/src/G4NavigationHistory.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4NavigationHistory.cc,v 1.10 2006/06/29 18:58:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4NavigationHistory.cc,v 1.11 2009/08/03 16:27:37 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    5151G4NavigationHistory::~G4NavigationHistory()
    5252{
    53   Reset();  // To delete all but one current entries!
    5453}
    5554
  • trunk/source/geometry/volumes/src/G4NavigationLevel.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4NavigationLevel.cc,v 1.4 2006/06/29 18:58:04 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4NavigationLevel.cc,v 1.5 2009/08/03 16:13:19 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030// 30.09.97 J.Apostolakis Initial version.
     
    7070G4NavigationLevel::~G4NavigationLevel()
    7171{
    72   if( fLevelRep->RemoveAReference() )
    73     delete fLevelRep;
     72  if( fLevelRep->RemoveAReference() )  { delete fLevelRep; }
    7473}
    7574
     
    7978  {
    8079    right.fLevelRep->AddAReference();
    81     if( fLevelRep->RemoveAReference() )
    82       delete fLevelRep;
     80    if( fLevelRep->RemoveAReference() )  { delete fLevelRep; }
    8381    fLevelRep = right.fLevelRep;
    8482  }
  • trunk/source/geometry/volumes/src/G4NavigationLevelRep.cc

    r1058 r1228  
    2626//
    2727// $Id: G4NavigationLevelRep.cc,v 1.2 2006/06/29 18:58:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//  1 October 1997 J.Apostolakis Initial version.
  • trunk/source/geometry/volumes/src/G4PVParameterised.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4PVParameterised.cc,v 1.10 2007/04/11 07:56:38 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4PVParameterised.cc,v 1.11 2009/09/21 10:27:05 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    226226        // Transform each point according to daughter's frame
    227227        //
    228         G4ThreeVector md = Td.Invert().TransformPoint(*pos);
     228        G4ThreeVector md = Td.Inverse().TransformPoint(*pos);
    229229
    230230        if (solidB->Inside(md)==kInside)
  • trunk/source/geometry/volumes/src/G4PVPlacement.cc

    r1058 r1228  
    2626//
    2727// $Id: G4PVPlacement.cc,v 1.16 2007/04/11 07:56:38 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/src/G4PVReplica.cc

    r1058 r1228  
    2626//
    2727// $Id: G4PVReplica.cc,v 1.7 2006/06/29 18:58:14 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/src/G4ReflectionFactory.cc

    r1058 r1228  
    2626//
    2727// $Id: G4ReflectionFactory.cc,v 1.9 2008/11/13 09:33:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
  • trunk/source/geometry/volumes/src/G4TouchableHistory.cc

    r1058 r1228  
    2525//
    2626//
    27 // $Id: G4TouchableHistory.cc,v 1.12 2006/06/29 18:58:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4TouchableHistory.cc,v 1.15 2009/11/06 11:10:35 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03 $
    2929//
    3030//
     
    3434
    3535#include "G4TouchableHistory.hh"
     36
     37G4Allocator<G4TouchableHistory> aTouchableHistoryAllocator;
     38
     39G4TouchableHistory::G4TouchableHistory()
     40  : frot(G4RotationMatrix()),
     41    ftlate(G4ThreeVector(0.,0.,0.)),
     42    fhistory()
     43{
     44   G4VPhysicalVolume* pPhysVol=0;
     45   fhistory.SetFirstEntry(pPhysVol);
     46}
     47
     48G4TouchableHistory::G4TouchableHistory( const G4NavigationHistory &history )
     49  : fhistory(history)
     50{
     51  G4AffineTransform tf(fhistory.GetTopTransform().Inverse());
     52  ftlate = tf.NetTranslation();
     53  frot = tf.NetRotation();
     54}
    3655
    3756G4TouchableHistory::~G4TouchableHistory()
Note: See TracChangeset for help on using the changeset viewer.