source: trunk/MagicSoft/Cosy/mag.C@ 6690

Last change on this file since 6690 was 4730, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 5.5 KB
Line 
1void mag()
2{
3 TGraph g;
4
5 // # --- 09.08.2004 --- 01:31:36.679
6 g.SetPoint(g.GetN(), 1.3, 1.495);
7 g.SetPoint(g.GetN(), 2.4, 2.343);
8 g.SetPoint(g.GetN(), 0.8, 1.316);
9 g.SetPoint(g.GetN(), 0.9, 2.079);
10 g.SetPoint(g.GetN(), 2.0, 2.065);
11
12 // # --- 09.08.2004 --- 02:40:08.798
13 g.SetPoint(g.GetN(), 0.0, 1.054);
14 g.SetPoint(g.GetN(), 2.9, 2.246);
15 g.SetPoint(g.GetN(), 1.2, 1.614);
16 g.SetPoint(g.GetN(), 2.4, 2.21);
17 g.SetPoint(g.GetN(), 3.0, 2.923);
18 g.SetPoint(g.GetN(), 2.9, 2.013);
19 g.SetPoint(g.GetN(), 3.0, 2.212);
20 g.SetPoint(g.GetN(), 3.2, 2.835);
21 g.SetPoint(g.GetN(), 3.8, 3.069);
22 g.SetPoint(g.GetN(), 2.9, 2.433);
23 g.SetPoint(g.GetN(), 1.9, 1.996);
24 g.SetPoint(g.GetN(), 2.4, 2.377);
25 g.SetPoint(g.GetN(), 2.3, 2.201);
26 g.SetPoint(g.GetN(), 2.9, 2.608);
27 g.SetPoint(g.GetN(), 3.2, 3.336);
28
29 // # --- 10.08.2004 --- 02:08:14.139
30 g.SetPoint(g.GetN(), 3.6, 3.267);
31 g.SetPoint(g.GetN(), 3.7, 3.445);
32 g.SetPoint(g.GetN(), 3.2, 2.918);
33 g.SetPoint(g.GetN(), 2.1, 2.179);
34 g.SetPoint(g.GetN(), 3.4, 2.633);
35 g.SetPoint(g.GetN(), 2.0, 2.098);
36 g.SetPoint(g.GetN(), 1.8, 2.105);
37 g.SetPoint(g.GetN(), 2.9, 2.765);
38 g.SetPoint(g.GetN(), 2.5, 2.380);
39 g.SetPoint(g.GetN(), 1.2, 1.598);
40 g.SetPoint(g.GetN(), 2.7, 2.849);
41 g.SetPoint(g.GetN(), 3.8, 3.398);
42 g.SetPoint(g.GetN(), 3.8, 3.374);
43 g.SetPoint(g.GetN(), 3.6, 3.388);
44 g.SetPoint(g.GetN(), 0.2, 1.274);
45 g.SetPoint(g.GetN(), 1.7, 2.055);
46
47 // # --- 11.08.2004 --- 02:44:17.277
48 g.SetPoint(g.GetN(), 1.8, 2.104);
49 g.SetPoint(g.GetN(), 1.3, 1.716);
50 g.SetPoint(g.GetN(), 0.8, 1.432);
51 g.SetPoint(g.GetN(), 1.2, 1.614);
52 g.SetPoint(g.GetN(), 2.9, 2.856);
53 g.SetPoint(g.GetN(), 0.0, 1.001);
54 g.SetPoint(g.GetN(), 2.4, 2.175);
55 g.SetPoint(g.GetN(), 3.0, 2.353);
56 g.SetPoint(g.GetN(), 3.7, 3.34 );
57 g.SetPoint(g.GetN(), 2.5, 2.132);
58 g.SetPoint(g.GetN(), 2.3, 2.322);
59 g.SetPoint(g.GetN(), 2.0, 1.963);
60 g.SetPoint(g.GetN(), 2.8, 2.568);
61 g.SetPoint(g.GetN(), 2.4, 2.502);
62 g.SetPoint(g.GetN(), 2.2, 2.126);
63
64 // # --- 12.08.2004 --- 03:24:01.355
65 g.SetPoint(g.GetN(), 3.2, 2.774);
66 g.SetPoint(g.GetN(), 0.8, 1.046);
67 g.SetPoint(g.GetN(), 3.8, 3.629);
68 g.SetPoint(g.GetN(), 2.4, 2.450);
69 g.SetPoint(g.GetN(), 1.3, 1.722);
70 g.SetPoint(g.GetN(), 3.1, 2.573);
71 g.SetPoint(g.GetN(), 2.1, 2.038);
72 g.SetPoint(g.GetN(), 1.8, 1.980);
73 g.SetPoint(g.GetN(), 0.5, 0.840);
74
75 // # --- 13.08.2004 --- 04:25:55.888
76 g.SetPoint(g.GetN(), 2.0, 1.944);
77 g.SetPoint(g.GetN(), 2.1, 2.042);
78 g.SetPoint(g.GetN(), 2.2, 2.140);
79 g.SetPoint(g.GetN(), 3.9, 3.688);
80 g.SetPoint(g.GetN(), 2.4, 2.362);
81 g.SetPoint(g.GetN(), 2.1, 1.780);
82
83 // # --- 19.08.2004 --- 21:14:23.126
84 g.SetPoint(g.GetN(), 0.8, 1.463);
85 g.SetPoint(g.GetN(), 3.9, 3.203);
86
87 // # --- 20.08.2004 --- 21:31:24.155
88 g.SetPoint(g.GetN(), 3.2, 3.091);
89 g.SetPoint(g.GetN(), 2.1, 2.353);
90
91 // # --- 21.08.2004 --- 21:18:42.724
92 g.SetPoint(g.GetN(), 2.8, 2.530);
93 g.SetPoint(g.GetN(), 2.8, 2.597);
94 //g.SetPoint(g.GetN(), #Alphecca 2.2, 2.285
95 //g.SetPoint(g.GetN(), #Altair 0.8
96
97 // # --- 22.08.2004 --- 21:58:59.897
98 g.SetPoint(g.GetN(), 2.9, 2.936);
99 g.SetPoint(g.GetN(), 1.9, 2.125);
100 g.SetPoint(g.GetN(), 1.8, 2.172);
101 g.SetPoint(g.GetN(), 2.7, 2.588);
102 g.SetPoint(g.GetN(), 2.2, 2.637);
103
104 // # --- 23.08.2004 22:15:40.706 ---
105 g.SetPoint(g.GetN(), 2.5, 2.033);
106 g.SetPoint(g.GetN(), 2.9, 2.489);
107 g.SetPoint(g.GetN(), 1.3, 1.443);
108 g.SetPoint(g.GetN(), 3.2, 2.643);
109 g.SetPoint(g.GetN(), 3.7, 3.113);
110 //g.SetPoint(g.GetN(), Albireo 3.1
111 //g.SetPoint(g.GetN(), Sulaphat 3.2
112 //g.SetPoint(g.GetN(), Sheliak 3.5
113 //-93.57582 82.10894 48.49921 73.15975 19.51194 27.95972 -0.003290516 0.03672756 53240.963825 221.9 2.378
114 //-72.12555 72.35696 70.26017 63.40571 18.9825 32.68944 -0.003799751 -0.0223611 53240.972626 229.6 2.65
115
116 // # --- 24.08.2004 --- 22:40:07.311
117 g.SetPoint(g.GetN(), 2.8, 2.439);
118 g.SetPoint(g.GetN(), 0.0, 0.863);
119 g.SetPoint(g.GetN(), 0.8, 1.225);
120 g.SetPoint(g.GetN(), 3.0, 2.870);
121 g.SetPoint(g.GetN(), 3.9, 3.576);
122 //# Sadalsud 2.9 ???
123 //# Sadalmelik war am Rand des schwarzen inneren Quadrats! Weiss nicht, was da los
124 //# war. Den TPoint haben wir nicht genommen.
125 //163.2053 54.45169 305.6785 45.37262 21.52583 -5.571111 -0.001574924 -0.03125814 53241.993201 228.4 2.478
126
127
128 g.Fit("pol1");
129
130 TF1 *f = g.GetFunction("pol1");
131 Double_t t = f->GetParameter(0);
132 Double_t m = f->GetParameter(1);
133
134 cout << "y = " << m << " * x + " << t << endl;
135
136 TH1F dx("dx", "", 20, -2, 2);
137 TH1F dy("dy", "", 20, -2, 2);
138 //dx.SetLineColor(kRed);
139 dy.SetLineColor(kBlue);
140 dx.SetXTitle("dM");
141 dx.SetYTitle("Counts");
142 for (int i=0; i<g.GetN(); i++)
143 {
144 Double_t x = g.GetX()[i];
145 Double_t y = g.GetY()[i];
146 Double_t vy = m*x + t;
147 Double_t vx = (y-t)/m;
148 dx.Fill(x-vx);
149 dy.Fill(y-vy);
150 }
151
152 dx.SetMaximum(TMath::Max(dx.GetMaximum(), dy.GetMaximum())*1.05);
153 dy.SetMaximum(dx.GetMaximum());
154
155
156 TCanvas *c=new TCanvas;
157 c->Divide(1,2);
158 c->cd(1);
159 gPad->SetBorderMode(0);
160 gStyle->SetOptFit();
161 TGraph *g0 = (TGraph*)g.DrawClone("A*");
162 g0->GetHistogram()->SetXTitle("M");
163 g0->GetHistogram()->SetYTitle("M_{est}");
164 c->cd(2);
165 gPad->SetBorderMode(0);
166 gStyle->SetOptFit();
167 dx.Fit("gaus");
168 dx.DrawCopy();
169 dy.DrawCopy("same");
170}
Note: See TracBrowser for help on using the repository browser.