source: JEM-EUSO/esaf_lal/branches/camille/packages/simulation/detector/G4Detector/G4fresnellens/include/FresnelSurface.h @ 184

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

changes from biktem r:3032

File size: 3.3 KB
Line 
1#ifndef FresnelSurface_HH
2#define FresnelSurface_HH
3#include "SSurface.h"
4#include "FresnelOutput_defs.h"
5#include "FixedStack.h"
6#include "ParametricSurface.h"
7#include "CylindricSurface.h"
8
9#include <string.h>
10#include <vector>
11//#define DEBUG
12
13namespace G4FresnelLens{
14class FresnelSurface : public SSurface {
15private:
16    double fFilter;
17
18public:
19    FresnelSurface(const std::vector<SSurface*>& surf, ParametricSurface*, ParametricSurface*);
20    virtual ~FresnelSurface();
21
22    void setSmoothedEdges(double rad);
23    double PointOnSurf(double x);
24    double DistanceToSurf(const G4ThreeVector& p, const G4ThreeVector& v){ AbstractMethod(); return kInfinity; }
25    double DistanceToSurf(const G4ThreeVector& p, const G4ThreeVector& v, FSIntersectedSegment*){ AbstractMethod(); return kInfinity; }
26    double DistanceToSurfSafe(const G4ThreeVector& p){ AbstractMethod(); return kInfinity; }
27    double DistanceToSurfSafeUp(const G4ThreeVector& p) { return fUpLimit->DistanceToSurfSafe(p); }
28    double DistanceToSurfSafeDown(const G4ThreeVector& p) { return fDownLimit->DistanceToSurfSafe(p); }
29    double TestEdgeTolerance(int dir, const G4ThreeVector& p, const G4ThreeVector& v) { AbstractMethod(); return kInfinity; }
30    bool Point(int i, double step, double& rho, double& z) { AbstractMethod(); return false; }
31
32    #ifdef USE_ROOT
33    void draw(const char* rootfile=0, const char* canvasfile=0, double shift=0., const char* prefix="", const char* option="RECREATE");
34    #endif
35
36    double GetZ(double rho);
37    double GetUpperZ(double rho);
38    double GetBottomZ(double rho);
39    double GetEdgeZ() { return fSurfaces.back()->GetZ1(); }
40    double GetMinZ() { return fDownLimit->GetMinZ(); }
41    double GetMaxZ() { return fUpLimit->GetMaxZ(); }
42
43    EInside Inside(double rho, double z, FSIntersectedSegment *intS=0);
44    double FindNearestIntersection(const G4ThreeVector& p1, const G4ThreeVector& v, FSIntersectedSegment* intS=0);
45
46    double* CopyTeeth(int& n);
47    int     GetNTeeth()     { return theToothN-1; }
48    std::vector<SSurface*>& GetTeeth() { return fSurfaces; }
49   
50protected:
51    #ifdef USE_ROOT
52    void FillArray(const char*);
53    #endif
54    void FillArray(int n, double* rho, double* z);
55    void FillArray(const std::vector<SSurface*>& surf);
56    int FindTooth( double rho );
57
58    /// Surfaces
59    ParametricSurface* fUpLimit;
60    ParametricSurface* fDownLimit;
61    CylindricSurface   fCylinder;
62    std::vector<SSurface*>  fSurfaces;
63    std::vector<SSurface*>  fSurfacesIns;
64
65    /// tooth indexes
66    int     theToothN;
67    double* theToothEdges;
68
69    /// points storage
70    double  fZscale;
71
72    /// function parameters and chi-square
73    double  theMaximalDeviation;
74
75    double fDownSafety;
76    double fUpSafety;
77    bool   doBelieveToFit;
78
79    double               theLastPerp, theLastZ;    // last position, for "inside" definition
80    EInside              theLastInside;            // last inside definition
81    FSIntersectedSegment theLastIntSeg;
82};
83
84//__________________________________________________________________________________
85inline double FresnelSurface::GetUpperZ(double rho){
86    return fUpLimit->PointOnSurf(rho);
87}
88
89//__________________________________________________________________________________
90inline double FresnelSurface::GetBottomZ(double rho){
91    return fDownLimit->PointOnSurf(rho);
92}
93
94};
95#endif
Note: See TracBrowser for help on using the repository browser.