Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 53 → Rev 54

/lightguide/trunk/include/guide.h
15,7 → 15,9
 
#define MARGIN 1.0e-6
#define DEGREE 180.0/3.14159265358979312
#define MAX_REFLECTIONS 19
 
 
using namespace TMath;
 
const double c_reflectivity = 0.96;
22,10 → 24,11
const int REFRACTION = 1;
const int REFLECTION = 2;
const int TOTAL = 3;
const int ABSORBED = -2;
const TVector3 CENTER(-2.0, 0.0, 0.0);
const int nch = 50; // number of "channels" used as number of bins in histograms
 
enum Fate {missed=0, hit=1, refracted=-1, ok=2, noreflection=-2, backreflected=-3, rays=3, absorbed=4};
enum Fate {missed=0, hitExit=1, refracted=-1, enter=2, noreflection=-2, backreflected=-3, rays=3, absorbed=4};
 
int dbg = 0;
 
179,8 → 182,8
// <-------- d ------->
//
 
#define VODNIK_MAX_ODB 19
 
 
int RCol(int col, int solid);
 
 
201,7 → 204,9
_glassOn(0),
_glassD(0),
_guideOn(1),
_plateOn(1)
_plateOn(1),
offsetY(2.5),
offsetZ(2.5)
{};
DetectorParameters(double a, double b, double d):
_a(a),
217,7 → 222,9
_glassOn(0),
_glassD(0),
_guideOn(1),
_plateOn(1)
_plateOn(1),
offsetY(2.5),
offsetZ(2.5)
{};
~DetectorParameters() {};
255,6 → 262,8
double getGlassD() { return _glassD; };
int getGuideOn() { return _guideOn; };
int getPlateOn() { return _plateOn; };
double getOffsetY() { return offsetY; };
double getOffsetZ() { return offsetZ; };
private:
double _a;
266,6 → 275,8
double _n3;
TVector3 _gap;
double _plateWidth;
double offsetY;
double offsetZ;
int _fresnel;
int _glassOn;
280,12 → 291,12
public:
Guide(TVector3 center0, DetectorParameters& parameters);
~Guide() {
//delete [] s_side; // problematic -> dangling references, needs solution
delete hfate;
delete hnodb_all;
delete hnodb_exit;
delete hin;
delete hout;
for (int jk=0; jk<6; jk++) delete s_side[jk];
delete hfate;
delete hnodb_all;
delete hnodb_exit;
delete hin;
delete hout;
}
Fate PropagateRay(CRay in, CRay *out, int *n_points, TVector3 *points);
302,7 → 313,7
int GetExitHits() {return (int)hfate->GetBinContent(5);};
int GetEnteranceHits() {return (int)hfate->GetBinContent(6);};
void GetVFate(int *out);
int GetMAXODB() const {return VODNIK_MAX_ODB;};
int GetMAXODB() const {return MAX_REFLECTIONS;};
void Draw(int color = 1, int width = 1);
void DrawSkel(int color = 1, int width = 1);
349,12 → 360,13
{
public:
Plate(DetectorParameters& parameters);
~Plate() { //delete []sides; // the same, needs solution
~Plate() {
for (int jk=0; jk<6; jk++) delete sides[jk]; // the same, needs solution
};
void draw(int color, int width);
void drawSkel(int color, int width);
int propagateRay(CRay, CRay*, int*, TVector3*);
Fate propagateRay(CRay, CRay*, int*, TVector3*);
private:
TVector3 plate_edge[8];
478,6 → 490,9
int _plateOn;
TH2F *histoPlate;
double offsetY;
double offsetZ;
};