1 | #ifndef MARS_MDCA
|
---|
2 | #define MARS_MDCA
|
---|
3 |
|
---|
4 | /////////////////////////////////////////////////////////////////////////////
|
---|
5 | // //
|
---|
6 | // MDCA.cc //
|
---|
7 | // Container to store the DCA stuff //
|
---|
8 | // //
|
---|
9 | // Author(s): S.C. Commichau, L.S. Stark, 7/2003 //
|
---|
10 | // //
|
---|
11 | // //
|
---|
12 | /////////////////////////////////////////////////////////////////////////////
|
---|
13 |
|
---|
14 | #include <TArrayF.h>
|
---|
15 | #include <TEllipse.h>
|
---|
16 | #include <TLine.h>
|
---|
17 | #include <TCanvas.h>
|
---|
18 | #include <TROOT.h>
|
---|
19 | #include <TStyle.h>
|
---|
20 | #include <TMath.h>
|
---|
21 | #include <math.h>
|
---|
22 | #include <TPad.h>
|
---|
23 | #include <TRandom.h>
|
---|
24 | #include <TRandom2.h>
|
---|
25 | #include <fstream>
|
---|
26 | #include <iostream>
|
---|
27 |
|
---|
28 | #include "MLog.h"
|
---|
29 | #include "MLogManip.h"
|
---|
30 | #include "MGeomCam.h"
|
---|
31 | #include "MGeomPix.h"
|
---|
32 | #include "MCerPhotPix.h"
|
---|
33 | #include "MCerPhotEvt.h"
|
---|
34 | #include "MHillas.h"
|
---|
35 |
|
---|
36 | // Add offsets to the Width and Length to draw nice lines
|
---|
37 | #define OffsetW 20.0
|
---|
38 | #define OffsetL 440.0
|
---|
39 |
|
---|
40 | #define kmm2Deg 0.00317460317
|
---|
41 | #define TwoPi 6.28318530717958623
|
---|
42 |
|
---|
43 | class TArrayF;
|
---|
44 | class TEllipse;
|
---|
45 | class MGeoCam;
|
---|
46 | class MCerPhotEvt;
|
---|
47 | class MHillas;
|
---|
48 |
|
---|
49 | class MDCA : public MParContainer
|
---|
50 | {
|
---|
51 | private:
|
---|
52 |
|
---|
53 | Float_t fLength; // [mm] major axis of ellipse
|
---|
54 | Float_t fWidth; // [mm] minor axis of ellipse
|
---|
55 | Float_t fDelta0; // [rad] angle of major axis with x-axis (-Pi/2 .. Pi/2)
|
---|
56 | Float_t fDelta1; // [rad] my angle of major axis with x-axis (0 .. 2*Pi)
|
---|
57 | Float_t fMeanX; // [mm] x-coordinate of center of ellipse
|
---|
58 | Float_t fMeanY; // [mm] y-coordinate of center of ellipse
|
---|
59 | Float_t fX1W; // [mm] x-coordinate of 1st point of Lline
|
---|
60 | Float_t fY1W; // [mm] y-coordinate of 1st point of Lline
|
---|
61 | Float_t fX2W; // [mm] x-coordinate of 2nd point of Lline
|
---|
62 | Float_t fY2W; // [mm] y-coordinate of 2nd point of Lline
|
---|
63 | Float_t fX1L; // [mm] x-coordinate of 1st point of Wline
|
---|
64 | Float_t fY1L; // [mm] y-coordinate of 1st point of Wline
|
---|
65 | Float_t fX2L; // [mm] x-coordinate of 2nd point of Wline
|
---|
66 | Float_t fY2L; // [mm] y-coordinate of 2nd point of Wline
|
---|
67 | Double_t fDCA; // [mm] Distance of Cloasest Approach
|
---|
68 | Float_t fXDCA; // [mm] x-coordinate of 2nd point of the DCA-line
|
---|
69 | Float_t fYDCA; // [mm] y-coordinate of 2nd point of the DCA-line
|
---|
70 | Float_t fXRef; // [mm] x-coordinate of reference point
|
---|
71 | Float_t fYRef; // [mm] y-coordinate of reference point
|
---|
72 | Float_t fmu;
|
---|
73 | Float_t flambda;
|
---|
74 | Float_t fr1, fr2; // [mm] Coordinates of the orientation vector of the shower axis
|
---|
75 | Float_t fd1, fd2; // [mm] Coordinates of the DCA vector
|
---|
76 | Float_t gx, gy;
|
---|
77 |
|
---|
78 | TEllipse *fEllipse; // Graphical object to draw the ellipse, ROOT!
|
---|
79 | TEllipse *fRefCircle; // To draw reference point
|
---|
80 |
|
---|
81 | TLine *fLineL; // Shower axis
|
---|
82 | TLine *fLineW; // Line perpendicular to the shower axis
|
---|
83 | TLine *fLineX; // x-axis of the coordinate system
|
---|
84 | TLine *fLineY; // y-axis of the coordinate system
|
---|
85 | TLine *fLineDCA; // DCA line
|
---|
86 | TLine *fLineMean; // Line to COG of the shower
|
---|
87 |
|
---|
88 | public:
|
---|
89 | MDCA(const char *name=NULL, const char *title=NULL);
|
---|
90 |
|
---|
91 | ~MDCA();
|
---|
92 |
|
---|
93 | void Reset();
|
---|
94 |
|
---|
95 | Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix, const MHillas &hil);
|
---|
96 |
|
---|
97 | void Print(Option_t *opt=NULL) const;
|
---|
98 |
|
---|
99 | void Paint(Option_t *opt=NULL);
|
---|
100 |
|
---|
101 | void Clear(Option_t *opt=NULL);
|
---|
102 |
|
---|
103 | void SetRefPoint(const Float_t fXRef0, const Float_t fYRef0);
|
---|
104 |
|
---|
105 | Float_t GetDCA() const { return fDCA; }
|
---|
106 |
|
---|
107 | Float_t GetDelta() const { return fDelta1; }
|
---|
108 |
|
---|
109 | ClassDef(MDCA, 1)
|
---|
110 |
|
---|
111 | };
|
---|
112 |
|
---|
113 | #endif
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 |
|
---|
118 |
|
---|