5 TGraphErrors **
gr_th =
new TGraphErrors*[5];
6 TGraphErrors **
gr_et =
new TGraphErrors*[5];
8 int color[] = {1,6,2,62,8,13};
10 TString
part[] = {
"total",
"beampipe",
"barrel",
"forward",
"backward"};
27 TLegend *
leg =
new TLegend(0.43,0.5,0.62,0.8);
33 TCanvas *
c1 =
new TCanvas(
"c1",
"material scan"); gPad -> SetTopMargin(0.03); gPad ->
SetRightMargin(0.03);
34 gr_th[0]->SetMaximum(0.3);
35 gr_th[0]->Draw(
"ALE3");
39 TCanvas *
c2 =
new TCanvas(
"c2",
"material scan"); gPad -> SetTopMargin(0.03); gPad ->
SetRightMargin(0.03);
40 gr_et[0]->Draw(
"ALE3");
46 TCanvas *
c3 =
new TCanvas(
"c3",
"material scan"); gPad -> SetTopMargin(0.03); gPad ->
SetRightMargin(0.03);
47 gr_et[0]->Draw(
"ALE3");
50 TCanvas *
c4 =
new TCanvas(
"c4",
"material scan"); gPad -> SetTopMargin(0.03); gPad ->
SetRightMargin(0.03);
51 gr_et[0]->Draw(
"ALE3");
52 gr_et[1]->Draw(
"SAMELE3");
55 TCanvas *
c5 =
new TCanvas(
"c5",
"material scan"); gPad -> SetTopMargin(0.03); gPad ->
SetRightMargin(0.03);
56 gr_et[0]->Draw(
"ALE3");
57 gr_et[1]->Draw(
"SAMELE3");
58 gr_et[2]->Draw(
"SAMELE3");
61 TCanvas *
c6 =
new TCanvas(
"c6",
"material scan"); gPad -> SetTopMargin(0.03); gPad ->
SetRightMargin(0.03);
62 gr_et[2]->Draw(
"ALE3");
64 TCanvas *c7 =
new TCanvas(
"c7",
"material scan"); gPad -> SetTopMargin(0.03); gPad ->
SetRightMargin(0.03);
65 gr_et[3]->Draw(
"ALE3");
68 c1 ->
Print(
"results1.pdf(");
69 c3 ->
Print(
"results1.pdf" );
70 c4 ->
Print(
"results1.pdf" );
71 c5 ->
Print(
"results1.pdf" );
72 c2 ->
Print(
"results1.pdf)");
78 FILE *f = fopen(datfile,
"r");
79 if (!f){cout <<
"file " << datfile <<
" cannot be opened" << endl;
return;}
80 float theta;
float phi;
float path;
float x0;
float lamda0;
81 float thetamin = 10000 ;
float thetamax = -10000 ;
float phimin = 10000 ;
float phimax = -10000 ;
82 float x0min = 100000;
float x0max = -100000;
float lamda0min = 100000;
float lamda0max = -100000;
84 float previous_theta = -999.;
85 float previous_x0_max;
86 float previous_x0_min;
88 int loaded_points = 0;
90 while(fscanf(f,
"%f %f %f %f %f",&theta,&phi,&path,&x0,&lamda0) != EOF){
91 if (theta > thetamax) thetamax =
theta;
92 if (theta < thetamin) thetamin =
theta;
93 if (phi > phimax) phimax =
phi;
94 if (phi < phimin) phimin =
phi;
95 if (x0 > x0max) x0max = x0;
96 if (x0 < x0min) x0min = x0;
97 if (lamda0 > lamda0max) lamda0max = lamda0;
98 if (lamda0 < lamda0min) lamda0min = lamda0;
113 if(theta != previous_theta){
120 previous_theta =
theta;
121 previous_x0_max = x0;
122 previous_x0_min = x0;
125 if(x0 > previous_x0_max){
127 previous_x0_max = x0;
129 if(x0 < previous_x0_min){
131 previous_x0_min = x0;
146 x0arr =
new float*[5];
151 for(
int l = 0 ; l <
loaded ; l++){
153 etaarr [l] =
new float[thetavec [l].size()];
156 x0arr_copy[l] =
new float[x0vec_max[l].size()];
157 x0Earr [l] =
new float[x0vec_max[l].size()];
162 for (
int i=0; i<thetavec[l].size(); i++){
163 thetaarr [l][i] = 270. - thetavec[l][i];
164 etaarr [l][i] = -TMath::Log(TMath::Tan(
thetaarr[l][i]/2.*TMath::Pi()/180.));
165 phiarr [l][i] = phivec[l][i];
178 for(
int l = 0 ; l <
loaded ; l++){
185 if(
part[l]==
"beampipe"){
186 gr_th[l] -> SetLineStyle(2);
187 gr_et[l] -> SetLineStyle(2);
193 gP ->
GetXaxis() -> SetRangeUser(xmin,xmax);
194 gP -> SetMarkerSize(0.1);
196 gP -> SetFillColorAlpha(color,.3);
198 gP -> SetMarkerColor(color);
202 if(ymax!=999) gP -> SetMaximum(ymax);