Subversion Repositories f9daq

Compare Revisions

Regard whitespace Rev 71 → Rev 72

/lightguide/trunk/include/guide.h
40,20 → 40,23
CRay() :
r(TVector3(0,0,0)),
n(TVector3(1,0,0)),
p(TVector3(0,1,0)),
color(1)
//p(TVector3(0,1,0)),
p(TVector3(0,0,1)),
color(kBlack)
{};
CRay(TVector3 r0, TVector3 n0) :
r(r0),
n(n0.Unit()),
p(TVector3(0,1,0)),
color(1)
//p(TVector3(0,1,0)),
p(TVector3(0,0,1)),
color(kBlack)
{};
CRay(double x0, double y0, double z0, double l0, double m0, double n0) :
r(TVector3(x0,y0,z0)),
n(TVector3(l0,m0,n0).Unit()),
p(TVector3(0,1,0)),
color(1)
//p(TVector3(0,1,0)),
p(TVector3(0,0,1)),
color(kBlack)
{};
 
void Set(TVector3 r0, TVector3 n0);
88,7 → 91,7
// ^ |
// | |
// | |
// | �
// |
// r0<-----r3
class CPlane4
{
119,9 → 122,28
double angle_r[4]; // koti ob posameznem vogalu
};
//=================================================================================
// ravnina - krog
class CPlaneR
{
 
public:
CPlaneR(TVector3 c, TVector3 n0, double R0)
{center = c; n = n0; _r = R0;};
 
void Set(TVector3 c, TVector3 n0, double R0)
{center = c; n = n0; _r = R0;};
 
int TestIntersection(TVector3 *vec, CRay in);
 
void Draw(int color = 1, int NN = 32);
 
private:
TVector3 n, center;
double _r;
};
//=================================================================================
 
//=================================================================================
// ravna opticna povrsina: refractor, zrcalo ali povrsina s totalnim odbojem
#define SURF_DUMMY 0
#define SURF_REFRA 1
190,7 → 212,7
class DetectorParameters
{
public:
DetectorParameters(double a, double b, double d, double active, double n1, double n2, double n3, TVector3 gap):
DetectorParameters(double a, double b, double d, double active, double n1, double n2, double n3, TVector3 gap, bool coupling):
_a(a),
_b(b),
_d(d),
206,7 → 228,8
_plateOn(1),
_plateWidth(1),
_glassOn(0),
_glassD(0)
_glassD(0),
_coupling(coupling)
{};
DetectorParameters(double a, double b, double d):
_a(a),
224,7 → 247,8
_plateOn(1),
_plateWidth(1),
_glassOn(0),
_glassD(0)
_glassD(0),
_coupling(false)
{};
~DetectorParameters() {};
240,6 → 264,7
void setGuideOn(int guideOn) { _guideOn = guideOn; };
void setPlate(int plateOn, double plateWidth) { _plateOn = plateOn; _plateWidth = plateWidth; };
void setIndices(double n1, double n2, double n3) { _n1 = n1; _n2 = n2; _n3 = n3; };
void setCoupling(bool coupling) { _coupling = coupling; };
 
double getLightYield() { return ( Power(_b,2)/Power(_active,2)); };
double getM() { return (_b/_a); };
259,6 → 284,8
int getPlateOn() { return _plateOn; };
double getOffsetY() { return offsetY; };
double getOffsetZ() { return offsetZ; };
// bad coupling in the case the small amount of grease was applied
bool badCoupling() { return _coupling; };
private:
double _a;
281,6 → 308,7
int _glassOn;
double _glassD;
bool _coupling;
};
 
290,6 → 318,8
Guide(TVector3 center0, DetectorParameters& parameters);
~Guide() {
for (int jk=0; jk<6; jk++) delete s_side[jk];
delete grease;
delete noCoupling;
delete hfate;
delete hnodb_all;
delete hnodb_exit;
300,9 → 330,9
Fate PropagateRay(CRay in, CRay *out, int *n_points, TVector3 *points);
double getD() { return _d; }
double getN1() { return n1; };
double getN2() { return n2; };
double getN3() { return n3; };
double getN1() { return _n1; };
double getN2() { return _n2; };
double getN3() { return _n3; };
TH1F* GetHFate() const {return hfate;};
TH1F* GetHNOdb_all() const {return hnodb_all;};
TH1F* GetHNOdb_exit() const {return hnodb_exit;};
319,12 → 349,15
private:
Fate fate;
double _d; // parameters
double n1, n2, n3; // refractive index: n1 above entry surface, n2 inside, n3 after exit
double _n1, _n2, _n3; // refractive index: n1 above entry surface, n2 inside, n3 after exit
double _r;
double absorption;
double A;
double _absorption;
double _A;
bool _badCoupling;
TRandom rand; // for material absorption
CSurface *s_side[6];
CPlaneR* grease;
CSurface* noCoupling;
TVector3 center, vodnik_edge[8];
TH1F *hfate, *hnodb_all, *hnodb_exit;
333,27 → 366,8
//=================================================================================
 
//=============================================================================================================================== <<<<<<<<
// ravnina - krog
class CPlaneR
{
 
public:
CPlaneR(TVector3 c, TVector3 n0, double R0)
{center = c; n = n0; _r = R0;};
void Set(TVector3 c, TVector3 n0, double R0)
{center = c; n = n0; _r = R0;};
int TestIntersection(TVector3 *vec, CRay in);
void Draw(int color = 1, int NN = 32);
private:
TVector3 n, center;
double _r;
};
//=================================================================================
 
class Plate
{
public:
464,6 → 478,7
 
//double x_gap, y_gap, z_gap;
CPlane4 *active;
CPlaneR* grease;
TH2F *hactive, *hlaser;
 
CPlane4 *detector;