// own include
#include "include/RTUtil.h"
#include "include/guide.h"
// general include
#include "TROOT.h"
#include "TSystem.h"
#include "TStyle.h"
#include "TCanvas.h"
#include "TMath.h"
#include "TView3D.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TBenchmark.h"
#include "TPolyMarker.h"
#include "TGraph.h"
#include "TF1.h"
//=================================================================================
TCanvas *c3dview;
TCanvas *cacc;
int show_3d = 0, show_data = 0;
int draw_width = 2;
// calls default constructor CVodnik.cpp
//void SetCenter(double x = -2.0, double y = 0.0, double z = 0.0)
//{center.SetXYZ(x,y,z); detector = new CDetector(center);}
//void SetLGType(int in = 1, int side = 1, int out = 0)
//{detector->SetLGType(in, side, out);}
//void SetLG(double SiPM0 = 3.0, double M0 = 1.666, double d0 = 3.0, double n10 = 1.0, double n20 = 1.48, double n30 = 1.48, double R0 = 0.96)
//{detector->SetLG(SiPM0, M0, d0, n10, n20, n30, R0);}
//void SetR(double R0) {detector->SetR(R0);}
/*
void SetGlass(int glass_on0 = 0, double glass_d0 = 0.3)
{detector->SetGlass(glass_on0, glass_d0);}
void SetGap(double x_gap0 = 0.3, double y_gap0 = 0.0, double z_gap0 = 0.0)
{detector->SetGap(x_gap0 , y_gap0, z_gap0);}
void SetRCol(int in = 2, int lg = 8, int out = 4, int gla = 6)
{detector->SetRCol(in, lg, out, gla);};
void SetDCol(int LG0 = 1, int glass0 = 2, int active0 = 3)
{detector->SetDCol(LG0, glass0, active0);};
void SetDWidth(int w = 1) {draw_width = w;}
void SetFresnel(int b = 1) {detector->SetFresnel(b);}
void SetAbsorb(int b = 0, double A0 = 1e4) {detector->SetAbsorption(b, A0);}
void SetGuideOn(int b = 0) {detector->SetGuideOn(b);}
void SetTypeU() {SetGlass(1, 0.3);SetGap(0.7);}
void SetTypeC() {SetGlass(0, 0.3);SetGap(1.03);}
*/
//-----------------------------------------------------------------------------
void Init(double);
//-----------------------------------------------------------------------------
void DrawData(CDetector*, DetectorParameters&, double, double, int);
//-----------------------------------------------------------------------------
void DrawAcc(int, double*, double*, char*,
double, double, double, double);
//-----------------------------------------------------------------------------
void PrintGlassStat(CDetector*);
//-----------------------------------------------------------------------------
void PrintGuideHead();
//-----------------------------------------------------------------------------
void PrintGuideStat(CDetector*, double);
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// en zarek
double Single(CDetector*, DetectorParameters&, TVector3, double, double);
//-----------------------------------------------------------------------------
// zarki, razporejeni v mrezi
double Grid(CDetector*, DetectorParameters&, int, double);
//-----------------------------------------------------------------------------
// zarki z nakljucnim polozajem vpada (na vstopni pov. vodnika)
// vsi pod kotom (theta, phi)
double RandYZ(CDetector*, DetectorParameters&, int, double, double, int);
//-----------------------------------------------------------------------------
// zarki, izotropno porazdeljeni znotraj kota theta
// = nakljucni vstopni polozaj in kot
double RandIso(CDetector*, DetectorParameters&, int, double, int, int);