-
Notifications
You must be signed in to change notification settings - Fork 2
/
PRFTypes
114 lines (114 loc) · 3.77 KB
/
PRFTypes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
-----------------------------------------------------------------
//Just the plain center X PRF
-----------------------------------------------------------------
vector<double> y0;
vector<double> x0;
for (int i = 10; i > -11; --i)
{
y0.push_back(maxima[abs(i)][2]/maxima[abs(i)][maxima[abs(i)].size()-1]);
x0.push_back(i);
}
TCanvas * c1 = new TCanvas();
TGraph *PRFx = new TGraph(y0.size(),&x0[0],&y0[0]);
PRFx->Draw("AC*");
PRFx->SetTitle("PRF as a function of X-motion");
-----------------------------------------------------------------
//To Get X and Y PRFs
-----------------------------------------------------------------
vector<double> y0;
vector<double> x0;
vector<double> y1;
vector<double> x1;
for (int i = 10; i > -11; --i)
{
y0.push_back(maxima[abs(i)][2]/maxima[abs(i)][maxima[abs(i)].size()-1]);
x0.push_back(i);
}
for (int i = 3; i > -4; --i)
{
y1.push_back(maxima[abs(11*i)][2]/maxima[abs(11*i)][maxima[abs(11*i)].size()-1]);
x1.push_back(i);
}
TCanvas * c1 = new TCanvas();
c1->Divide(2,1);
TGraph *PRFy = new TGraph(y1.size(),&x1[0],&y1[0]);
TGraph *PRFx = new TGraph(y0.size(),&x0[0],&y0[0]);
c1->cd(1);
PRFx->Draw("AC*");
PRFx->SetTitle("PRF as a function of X-motion");
c1->cd(2);
PRFy->Draw("AC*");
PRFy->SetTitle("PRF as a function of Y-motion");
-----------------------------------------------------------------
//To get X PRFs for pads 2,3,4.
-----------------------------------------------------------------
vector<double> x0;
vector<double> Pad2;
vector<double> Pad3;
vector<double> Pad4;
for (int i = -10; i < 11; ++i)
{
x0.push_back(i);
Pad3.push_back((maxima[abs(i)][2])/(maxima[abs(i)][maxima[abs(i)].size()-1]));
if(i<=0)
{
Pad2.push_back((maxima[abs(i)][3])/(maxima[abs(i)][maxima[abs(i)].size()-1]));
Pad4.push_back((maxima[abs(i)][1])/(maxima[abs(i)][maxima[abs(i)].size()-1]));
}
else
{
Pad2.push_back((maxima[abs(i)][1])/(maxima[abs(i)][maxima[abs(i)].size()-1]));
Pad4.push_back((maxima[abs(i)][3])/(maxima[abs(i)][maxima[abs(i)].size()-1]));
}
}
TCanvas * c1 = new TCanvas();
TMultiGraph * AllPads = new TMultiGraph();
TGraph *Pad2g = new TGraph(Pad2.size(),&x0[0],&Pad2[0]);
Pad2g->SetLineColor(2);
Pad2g->SetLineWidth(2);
TGraph *Pad3g = new TGraph(Pad3.size(),&x0[0],&Pad3[0]);
Pad3g->SetLineColor(1);
Pad3g->SetLineWidth(2);
TGraph *Pad4g = new TGraph(Pad4.size(),&x0[0],&Pad4[0]);
Pad4g->SetLineColor(4);
Pad4g->SetLineWidth(2);
AllPads->Add(Pad2g,"C*");
AllPads->Add(Pad3g,"C*");
AllPads->Add(Pad4g,"C*");
AllPads->Draw("a");
AllPads->SetTitle("PRF for Pads 2, 3, and 4");
-----------------------------------------------------------------
//To get the 4 X PRF's, for different y values.
-----------------------------------------------------------------
vector<double> x0;
vector<double> y0;
vector<double> y1;
vector<double> y2;
vector<double> y3;
for (int i = 10; i > -11; --i)
{
y0.push_back(maxima[abs(i)][2]/maxima[abs(i)][maxima[abs(i)].size()-1]);
y1.push_back(maxima[abs(i)+11][2]/maxima[abs(i)+11][maxima[abs(i)+11].size()-1]);
y2.push_back(maxima[abs(i)+22][2]/maxima[abs(i)+22][maxima[abs(i)+22].size()-1]);
y3.push_back(maxima[abs(i)+33][2]/maxima[abs(i)+33][maxima[abs(i)+33].size()-1]);
x0.push_back(i);
}
TCanvas * c1 = new TCanvas();
c1->Divide(2,2);
TGraph *PRF0 = new TGraph(y0.size(),&x0[0],&y0[0]);
TGraph *PRF1 = new TGraph(y1.size(),&x0[0],&y1[0]);
TGraph *PRF2 = new TGraph(y2.size(),&x0[0],&y2[0]);
TGraph *PRF3 = new TGraph(y3.size(),&x0[0],&y3[0]);
c1->cd(1);
PRF0->Draw("AC*");
PRF0->SetTitle("PRF as a function of X-motion at y=0");
c1->cd(2);
PRF1->Draw("AC*");
PRF1->SetTitle("PRF as a function of X-motion at y=1");
c1->cd(3);
PRF2->Draw("AC*");
PRF2->SetTitle("PRF as a function of X-motion at y=2");
c1->cd(4);
PRF3->Draw("AC*");
PRF3->SetTitle("PRF as a function of X-motion at y=3");
-----------------------------------------------------------------