source: JEM-EUSO/esaf_cc_at_lal/packages/simulation/detector/G4Detector/G4fresnellens/src/SSurface.cc @ 114

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

actual version of ESAF at CCin2p3

File size: 1.2 KB
Line 
1#include "SSurface.h"
2
3#include <G4GeometryTolerance.hh>
4#include <globals.hh>
5
6using namespace G4FresnelLens;
7
8double SSurface::kTolerance=1.e-9;
9double SSurface::kHalfTolerance=5.e-10;
10
11//______________________________________________________________________________
12SSurface::SSurface(double zpos, double rhomax):
13fR1(0.), fR(rhomax),
14fZpos(zpos),
15fZmin(0.), fZmax(0.) {
16    kTolerance=G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
17    kHalfTolerance=kTolerance*.5;
18}
19
20//__________________________________________________________________________________
21#ifdef USE_ROOT
22#include <TGraph.h>
23#include <TCanvas.h>
24#include <TString.h>
25#include <TFile.h>
26void SSurface::draw(const char* file, const char* canvasfile, double shift, const char* prefix, const char* option){
27    TString file1=file;
28    TFile* f = new TFile(file1, option);
29    TGraph surf;
30
31    double step=0.01, rho, z;
32    int i(0);
33    while( Point(i, step, rho, z) ){
34        surf.SetPoint(surf.GetN(), rho, z+shift);
35        i++;
36    }
37    surf.Write( TString(prefix)+"surf" );
38    f->Close();
39
40    if (canvasfile) {
41        TCanvas c("surface", "surface");
42        surf.Draw("AL");
43        c.Print(canvasfile);
44    }
45}
46#endif
Note: See TracBrowser for help on using the repository browser.