source: trunk/source/geometry/solids/test/fred/include/FredTest3.hh @ 1350

Last change on this file since 1350 was 1316, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 4.7 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// FredTest3.hh
28//
29// Definition of fred's 3rd test suite
30//
31
32#ifndef FredTest3_hh
33#define FredTest3_hh
34
35#include <iostream>
36#include "G4VSolid.hh"
37#include "G4ThreeVector.hh"
38
39
40//
41// This is a list of points we keep track of. The definition below
42// is a little sloppy.
43//
44class FredTest3PointList {
45        public:
46        FredTest3PointList( G4int size );
47        ~FredTest3PointList();
48       
49        void AddPoint( G4ThreeVector newPoint );
50        inline G4ThreeVector operator[] (G4int i ) const { return pointList[i]; }
51       
52        inline G4int NumPoints() const { return numPoints; }
53       
54        protected:
55        G4ThreeVector   *pointList;
56        G4int           numPoints;
57        G4int           maxPoints;
58};
59
60
61
62class FredTest3 {
63
64        public:
65        FredTest3();
66        ~FredTest3();
67        void SetDefaults();
68       
69        void RunTest( const G4VSolid *testVolume, std::ostream &logger );
70        void RunDebug( const G4VSolid *testVolume, std::istream &logger );
71
72        G4int DebugError( const G4VSolid *testVolume, std::istream &logger, const G4int errorIndex ) const;
73        G4int DebugInside( const G4VSolid *testVolume, std::istream &logger, const G4int errorIndex ) const;
74        G4int DebugToInP( const G4VSolid *testVolume, std::istream &logger, const G4int errorIndex ) const;
75        G4int DebugToInPV( const G4VSolid *testVolume, std::istream &logger, const G4int errorIndex ) const;
76        G4int DebugToOutP( const G4VSolid *testVolume, std::istream &logger, const G4int errorIndex ) const;
77        G4int DebugToOutPV( const G4VSolid *testVolume, std::istream &logger, const G4int errorIndex ) const;
78
79        inline void SetTarget( const G4ThreeVector &newTarget ) { target = newTarget; }
80        inline G4ThreeVector GetTarget() const { return target; }
81
82        inline void SetWidths( const G4ThreeVector &newWidths ) { widths = newWidths; }
83        inline G4ThreeVector GetWidths() const { return widths; }
84       
85        inline void SetGrids( const G4ThreeVector &newGrids ) { grids = newGrids; }
86        inline G4ThreeVector GetGrids() const { return grids; }
87       
88        inline void SetMaxPoints( const G4int newMaxPoints ) { maxPoints = newMaxPoints; }
89        inline G4int GetMaxPoints() const { return maxPoints; }
90       
91        inline void SetMaxErrors( const G4int newMaxErrors ) { maxErrors = newMaxErrors; }
92        inline G4int GetMaxErrors() const { return maxErrors; }
93
94        protected:
95        G4ThreeVector   GetRandomPoint() const;
96        G4double        GaussianRandom(const G4double cutoff) const;
97       
98        void    TestOutsidePoint( const G4VSolid *testVolume, G4int *nError,
99                                  const FredTest3PointList *inside, const G4ThreeVector point, std::ostream &logger );
100        void    TestInsidePoint(  const G4VSolid *testVolume, G4int *nError,
101                                  const FredTest3PointList *inside, const G4ThreeVector point, std::ostream &logger );
102
103        void    ReportError( G4int *nError, const G4ThreeVector p, 
104                             const G4ThreeVector v, const G4String comment, std::ostream &logger );
105        void    ClearErrors();         
106       
107        G4int   GetLoggedPV( std::istream &logger, const G4int errorIndex,
108                             G4ThreeVector &p, G4ThreeVector &v        ) const;
109       
110        protected:
111        G4ThreeVector   target,
112                        widths,
113                        grids;
114        G4int           maxPoints,
115                        maxErrors;
116                       
117       
118        typedef struct sFredTest3ErrorList {
119                G4String        message;
120                G4int           nUsed;
121                struct sFredTest3ErrorList *next;
122        } FredTest3ErrorList;
123       
124        FredTest3ErrorList *errorList;
125
126};
127
128#endif
Note: See TracBrowser for help on using the repository browser.