source: JEM-EUSO/esaf_lal/tags/v1_r0/esaf/packages/simulation/detector/G4Detector/G4fresnellens/include/SSurface.h @ 117

Last change on this file since 117 was 117, checked in by moretto, 11 years ago

ESAF version compilable on mac OS

File size: 2.9 KB
Line 
1#ifndef __SSURFACE__
2#define __SSURFACE__
3
4#include "FresnelOutput_defs.h"
5
6//#define DEBUG
7#define FRESNEL_MAXSTEPS 100
8#define USE_ROOT
9
10#include <geomdefs.hh>
11#include <G4ThreeVector.hh>
12class G4PhysicalVolume;
13
14namespace G4FresnelLens{
15class FSIntersectedSegment;
16class SSurface __INHERITSTRING1 {
17public:
18    SSurface(double zpos=0., double rhomax=0.);
19    virtual ~SSurface(){};
20
21    //
22    // Pure virtual methods
23    virtual double PointOnSurf(double x)=0;
24    virtual double DistanceToSurf(const G4ThreeVector& p, const G4ThreeVector& v)=0;
25    virtual double DistanceToSurf(const G4ThreeVector& p, const G4ThreeVector& v,FSIntersectedSegment* is)=0;
26    virtual double DistanceToSurfSafe(const G4ThreeVector& p)=0;
27    virtual double FindNearestIntersection(const G4ThreeVector& p1, const G4ThreeVector& v,  FSIntersectedSegment* intSeg=0)=0;
28    virtual double TestEdgeTolerance(int dir, const G4ThreeVector& p, const G4ThreeVector& v)=0;
29    virtual EInside Inside(double rho, double z, FSIntersectedSegment* intSeg=0)=0;
30    virtual bool Normal(const G4ThreeVector& p, bool up, G4ThreeVector* norm) { AbstractMethod(); return false; }
31    virtual bool Normal(FSIntersectedSegment* ints, const G4ThreeVector& p, double up, G4ThreeVector* norm) { AbstractMethod(); return false; }
32    virtual bool Point(int i, double step, double& rho, double& z)=0;
33
34    //
35    // redefinable virtual methods
36    virtual double DistanceToSurfSafeUp(const G4ThreeVector& p) { return DistanceToSurfSafe(p); }
37    virtual double DistanceToSurfSafeDown(const G4ThreeVector& p) { return DistanceToSurfSafe(p); }
38    virtual double GetUpperZ(double rho)  { return PointOnSurf(rho); }
39    virtual double GetBottomZ(double rho) { return PointOnSurf(rho); }
40    virtual double GetEdgeZ()             { return PointOnSurf(fR); }
41    virtual void print() { printf("abstract surface R=%g, z=%g\n", fR, fZpos); }
42
43    virtual bool operator==(SSurface&) { AbstractMethod(); return false; }
44
45    #ifdef USE_ROOT
46    virtual void draw(const char* rootfile=0, const char* canvasfile=0, double shift=0., const char* prefix="", const char* option="RECREATE");
47    #endif
48
49    // getters
50    double GetR()    { return fR; }
51    double GetR1()   { return fR1; }
52    double GetR2()   { return fR; }
53    double GetZpos() { return fZpos; }
54    double GetZ1()   { return fZ1; }
55    double GetZ2()   { return fZ2; }
56    virtual double GetMinZ() { return fZmin; }
57    virtual double GetMaxZ() { return fZmax; }
58
59    // plug for temporarily unimplemented methods
60    void AbstractMethod() { fprintf(stderr, "Error, calling the unimplemented method"); exit(1); }
61protected:
62    double fR1;
63    double fR;
64    double fZpos;
65    double fZ1;
66    double fZ2;
67    double fZmin;
68    double fZmax;
69
70    static double kTolerance;
71    static double kHalfTolerance;
72
73#ifdef DEBUG
74public:
75    void setDebug(bool d=true) { theDebugSwitch=d; }
76    bool getDebug() { return theDebugSwitch; }
77protected:
78    bool theDebugSwitch;
79#endif
80};
81
82};
83#endif
Note: See TracBrowser for help on using the repository browser.