Fixed bug MUSR-252: Not plotting last pont from a scan

This commit is contained in:
salman 2013-04-04 11:48:45 +00:00
parent 4c2674c9f7
commit 9fbfe0f151

View File

@ -49,6 +49,8 @@ void plotFrc(char *FileName)
token = line.Tokenize(" "); token = line.Tokenize(" ");
ntokens = token->GetEntries(); ntokens = token->GetEntries();
// This is the energy
// Plots for other scanned parameters need to be treated differently
strtoken = (TObjString*) token->At(0); strtoken = (TObjString*) token->At(0);
label = strtoken->GetName(); label = strtoken->GetName();
x[i] = label.Atof(); x[i] = label.Atof();
@ -56,6 +58,8 @@ void plotFrc(char *FileName)
// Plot all layers for now. Maybe stop when sum is zero in the future // Plot all layers for now. Maybe stop when sum is zero in the future
// Layers start from column # 10 up to 16. // Layers start from column # 10 up to 16.
// for (col=10;col<17;col++) { // for (col=10;col<17;col++) {
// This is the backscattered part
strtoken = (TObjString*) token->At(6); strtoken = (TObjString*) token->At(6);
label = strtoken->GetName(); label = strtoken->GetName();
bck[i] = label.Atof(); bck[i] = label.Atof();
@ -64,6 +68,7 @@ void plotFrc(char *FileName)
intNorm = intNorm++; intNorm = intNorm++;
} }
// This is Layer1
strtoken = (TObjString*) token->At(10); strtoken = (TObjString*) token->At(10);
label = strtoken->GetName(); label = strtoken->GetName();
yl1[i] = label.Atof(); yl1[i] = label.Atof();
@ -72,6 +77,7 @@ void plotFrc(char *FileName)
intNorm = intNorm++; intNorm = intNorm++;
} }
// This is Layer2
strtoken = (TObjString*) token->At(11); strtoken = (TObjString*) token->At(11);
label = strtoken->GetName(); label = strtoken->GetName();
yl2[i] = label.Atof(); yl2[i] = label.Atof();
@ -80,6 +86,7 @@ void plotFrc(char *FileName)
intNorm = intNorm++; intNorm = intNorm++;
} }
// This is Layer3
strtoken = (TObjString*) token->At(12); strtoken = (TObjString*) token->At(12);
label = strtoken->GetName(); label = strtoken->GetName();
yl3[i] = label.Atof(); yl3[i] = label.Atof();
@ -88,6 +95,7 @@ void plotFrc(char *FileName)
intNorm = intNorm++; intNorm = intNorm++;
} }
// This is Layer4
strtoken = (TObjString*) token->At(13); strtoken = (TObjString*) token->At(13);
label = strtoken->GetName(); label = strtoken->GetName();
yl4[i] = label.Atof(); yl4[i] = label.Atof();
@ -96,6 +104,7 @@ void plotFrc(char *FileName)
intNorm = intNorm++; intNorm = intNorm++;
} }
// This is Layer5
strtoken = (TObjString*) token->At(14); strtoken = (TObjString*) token->At(14);
label = strtoken->GetName(); label = strtoken->GetName();
yl5[i] = label.Atof(); yl5[i] = label.Atof();
@ -104,6 +113,7 @@ void plotFrc(char *FileName)
intNorm = intNorm++; intNorm = intNorm++;
} }
// This is Layer6
strtoken = (TObjString*) token->At(15); strtoken = (TObjString*) token->At(15);
label = strtoken->GetName(); label = strtoken->GetName();
yl6[i] = label.Atof(); yl6[i] = label.Atof();
@ -112,6 +122,7 @@ void plotFrc(char *FileName)
intNorm = intNorm++; intNorm = intNorm++;
} }
// This is Layer7
strtoken = (TObjString*) token->At(16); strtoken = (TObjString*) token->At(16);
label = strtoken->GetName(); label = strtoken->GetName();
yl7[i] = label.Atof(); yl7[i] = label.Atof();
@ -136,7 +147,7 @@ void plotFrc(char *FileName)
TMultiGraph *mg = new TMultiGraph(); TMultiGraph *mg = new TMultiGraph();
if (Flag[0]==1){ if (Flag[0]==1){
TGraph *gr1 = new TGraph(i-1,x,yl1); TGraph *gr1 = new TGraph(i,x,yl1);
gr1->GetXaxis()->SetTitle(xlab); gr1->GetXaxis()->SetTitle(xlab);
gr1->GetYaxis()->SetTitle("Implanted Fraction"); gr1->GetYaxis()->SetTitle("Implanted Fraction");
// gr1->Draw("APC"); // gr1->Draw("APC");
@ -148,7 +159,7 @@ void plotFrc(char *FileName)
} }
if (Flag[1]==1){ if (Flag[1]==1){
TGraph *gr2 = new TGraph(i-1,x,yl2); TGraph *gr2 = new TGraph(i,x,yl2);
gr2->SetMarkerStyle(20); gr2->SetMarkerStyle(20);
gr2->SetMarkerColor(TColor::kGreen); gr2->SetMarkerColor(TColor::kGreen);
gr2->SetLineColor(TColor::kGreen); gr2->SetLineColor(TColor::kGreen);
@ -158,7 +169,7 @@ void plotFrc(char *FileName)
} }
if (Flag[2]==1){ if (Flag[2]==1){
TGraph *gr3 = new TGraph(i-1,x,yl3); TGraph *gr3 = new TGraph(i,x,yl3);
gr3->SetMarkerStyle(20); gr3->SetMarkerStyle(20);
gr3->SetMarkerColor(TColor::kBlue); gr3->SetMarkerColor(TColor::kBlue);
gr3->SetLineColor(TColor::kBlue); gr3->SetLineColor(TColor::kBlue);
@ -168,7 +179,7 @@ void plotFrc(char *FileName)
} }
if (Flag[3]==1){ if (Flag[3]==1){
TGraph *gr4 = new TGraph(i-1,x,yl4); TGraph *gr4 = new TGraph(i,x,yl4);
gr4->SetMarkerStyle(20); gr4->SetMarkerStyle(20);
gr4->SetMarkerColor(TColor::kMagenta); gr4->SetMarkerColor(TColor::kMagenta);
gr4->SetLineColor(TColor::kMagenta); gr4->SetLineColor(TColor::kMagenta);
@ -178,7 +189,7 @@ void plotFrc(char *FileName)
} }
if (Flag[4]==1){ if (Flag[4]==1){
TGraph *gr5 = new TGraph(i-1,x,yl5); TGraph *gr5 = new TGraph(i,x,yl5);
gr5->SetMarkerStyle(20); gr5->SetMarkerStyle(20);
gr5->SetMarkerColor(TColor::kOrange); gr5->SetMarkerColor(TColor::kOrange);
gr5->SetLineColor(TColor::kOrange); gr5->SetLineColor(TColor::kOrange);
@ -188,7 +199,7 @@ void plotFrc(char *FileName)
} }
if (Flag[5]==1){ if (Flag[5]==1){
TGraph *gr6 = new TGraph(i-1,x,yl6); TGraph *gr6 = new TGraph(i,x,yl6);
gr6->SetMarkerStyle(20); gr6->SetMarkerStyle(20);
gr6->SetMarkerColor(TColor::kViolet); gr6->SetMarkerColor(TColor::kViolet);
gr6->SetLineColor(TColor::kViolet); gr6->SetLineColor(TColor::kViolet);
@ -198,7 +209,7 @@ void plotFrc(char *FileName)
} }
if (Flag[6]==1){ if (Flag[6]==1){
TGraph *gr7 = new TGraph(i-1,x,yl7); TGraph *gr7 = new TGraph(i,x,yl7);
gr7->SetMarkerStyle(20); gr7->SetMarkerStyle(20);
gr7->SetMarkerColor(TColor::kAzure+7); gr7->SetMarkerColor(TColor::kAzure+7);
gr7->SetLineColor(TColor::kAzure+7); gr7->SetLineColor(TColor::kAzure+7);
@ -208,7 +219,7 @@ void plotFrc(char *FileName)
} }
if (Flag[7]==1){ if (Flag[7]==1){
TGraph *gr8 = new TGraph(i-1,x,bck); TGraph *gr8 = new TGraph(i,x,bck);
gr8->SetMarkerStyle(20); gr8->SetMarkerStyle(20);
gr8->SetMarkerColor(TColor::kAzure+7); gr8->SetMarkerColor(TColor::kAzure+7);
gr8->SetLineColor(TColor::kAzure+7); gr8->SetLineColor(TColor::kAzure+7);