From 9fbfe0f15117daa673cc9531369ce9e17ceb2576 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Thu, 4 Apr 2013 11:48:45 +0000 Subject: [PATCH] Fixed bug MUSR-252: Not plotting last pont from a scan --- trimsp/src/TrimSPGUI/plotFrc.C | 147 ++++++++++++++++++--------------- 1 file changed, 79 insertions(+), 68 deletions(-) diff --git a/trimsp/src/TrimSPGUI/plotFrc.C b/trimsp/src/TrimSPGUI/plotFrc.C index 387a348..d935b90 100644 --- a/trimsp/src/TrimSPGUI/plotFrc.C +++ b/trimsp/src/TrimSPGUI/plotFrc.C @@ -49,6 +49,8 @@ void plotFrc(char *FileName) token = line.Tokenize(" "); ntokens = token->GetEntries(); + // This is the energy + // Plots for other scanned parameters need to be treated differently strtoken = (TObjString*) token->At(0); label = strtoken->GetName(); x[i] = label.Atof(); @@ -56,69 +58,78 @@ void plotFrc(char *FileName) // Plot all layers for now. Maybe stop when sum is zero in the future // Layers start from column # 10 up to 16. // for (col=10;col<17;col++) { - strtoken = (TObjString*) token->At(6); - label = strtoken->GetName(); - bck[i] = label.Atof(); - if (bck[i]>0) { - Flag[7]=1; - intNorm = intNorm++; - } - strtoken = (TObjString*) token->At(10); - label = strtoken->GetName(); - yl1[i] = label.Atof(); - if (yl1[i]>0) { - Flag[0]=1; - intNorm = intNorm++; - } + // This is the backscattered part + strtoken = (TObjString*) token->At(6); + label = strtoken->GetName(); + bck[i] = label.Atof(); + if (bck[i]>0) { + Flag[7]=1; + intNorm = intNorm++; + } - strtoken = (TObjString*) token->At(11); - label = strtoken->GetName(); - yl2[i] = label.Atof(); - if (yl2[i]>0) { - Flag[1]=1; - intNorm = intNorm++; - } + // This is Layer1 + strtoken = (TObjString*) token->At(10); + label = strtoken->GetName(); + yl1[i] = label.Atof(); + if (yl1[i]>0) { + Flag[0]=1; + intNorm = intNorm++; + } + + // This is Layer2 + strtoken = (TObjString*) token->At(11); + label = strtoken->GetName(); + yl2[i] = label.Atof(); + if (yl2[i]>0) { + Flag[1]=1; + intNorm = intNorm++; + } + + // This is Layer3 + strtoken = (TObjString*) token->At(12); + label = strtoken->GetName(); + yl3[i] = label.Atof(); + if (yl3[i]>0) { + Flag[2]=1; + intNorm = intNorm++; + } + + // This is Layer4 + strtoken = (TObjString*) token->At(13); + label = strtoken->GetName(); + yl4[i] = label.Atof(); + if (yl4[i]>0) { + Flag[3]=1; + intNorm = intNorm++; + } + + // This is Layer5 + strtoken = (TObjString*) token->At(14); + label = strtoken->GetName(); + yl5[i] = label.Atof(); + if (yl5[i]>0) { + Flag[4]=1; + intNorm = intNorm++; + } + + // This is Layer6 + strtoken = (TObjString*) token->At(15); + label = strtoken->GetName(); + yl6[i] = label.Atof(); + if (yl6[i]>0) { + Flag[5]=1; + intNorm = intNorm++; + } - strtoken = (TObjString*) token->At(12); - label = strtoken->GetName(); - yl3[i] = label.Atof(); - if (yl3[i]>0) { - Flag[2]=1; - intNorm = intNorm++; - } - - strtoken = (TObjString*) token->At(13); - label = strtoken->GetName(); - yl4[i] = label.Atof(); - if (yl4[i]>0) { - Flag[3]=1; - intNorm = intNorm++; - } - - strtoken = (TObjString*) token->At(14); - label = strtoken->GetName(); - yl5[i] = label.Atof(); - if (yl5[i]>0) { - Flag[4]=1; - intNorm = intNorm++; - } - - strtoken = (TObjString*) token->At(15); - label = strtoken->GetName(); - yl6[i] = label.Atof(); - if (yl6[i]>0) { - Flag[5]=1; - intNorm = intNorm++; - } - - strtoken = (TObjString*) token->At(16); - label = strtoken->GetName(); - yl7[i] = label.Atof(); - if (yl7[i]>0) { - Flag[6]=1; - intNorm = intNorm++; - } + // This is Layer7 + strtoken = (TObjString*) token->At(16); + label = strtoken->GetName(); + yl7[i] = label.Atof(); + if (yl7[i]>0) { + Flag[6]=1; + intNorm = intNorm++; + } //} @@ -136,7 +147,7 @@ void plotFrc(char *FileName) TMultiGraph *mg = new TMultiGraph(); if (Flag[0]==1){ - TGraph *gr1 = new TGraph(i-1,x,yl1); + TGraph *gr1 = new TGraph(i,x,yl1); gr1->GetXaxis()->SetTitle(xlab); gr1->GetYaxis()->SetTitle("Implanted Fraction"); // gr1->Draw("APC"); @@ -148,7 +159,7 @@ void plotFrc(char *FileName) } if (Flag[1]==1){ - TGraph *gr2 = new TGraph(i-1,x,yl2); + TGraph *gr2 = new TGraph(i,x,yl2); gr2->SetMarkerStyle(20); gr2->SetMarkerColor(TColor::kGreen); gr2->SetLineColor(TColor::kGreen); @@ -158,7 +169,7 @@ void plotFrc(char *FileName) } if (Flag[2]==1){ - TGraph *gr3 = new TGraph(i-1,x,yl3); + TGraph *gr3 = new TGraph(i,x,yl3); gr3->SetMarkerStyle(20); gr3->SetMarkerColor(TColor::kBlue); gr3->SetLineColor(TColor::kBlue); @@ -168,7 +179,7 @@ void plotFrc(char *FileName) } if (Flag[3]==1){ - TGraph *gr4 = new TGraph(i-1,x,yl4); + TGraph *gr4 = new TGraph(i,x,yl4); gr4->SetMarkerStyle(20); gr4->SetMarkerColor(TColor::kMagenta); gr4->SetLineColor(TColor::kMagenta); @@ -178,7 +189,7 @@ void plotFrc(char *FileName) } if (Flag[4]==1){ - TGraph *gr5 = new TGraph(i-1,x,yl5); + TGraph *gr5 = new TGraph(i,x,yl5); gr5->SetMarkerStyle(20); gr5->SetMarkerColor(TColor::kOrange); gr5->SetLineColor(TColor::kOrange); @@ -188,7 +199,7 @@ void plotFrc(char *FileName) } if (Flag[5]==1){ - TGraph *gr6 = new TGraph(i-1,x,yl6); + TGraph *gr6 = new TGraph(i,x,yl6); gr6->SetMarkerStyle(20); gr6->SetMarkerColor(TColor::kViolet); gr6->SetLineColor(TColor::kViolet); @@ -198,7 +209,7 @@ void plotFrc(char *FileName) } if (Flag[6]==1){ - TGraph *gr7 = new TGraph(i-1,x,yl7); + TGraph *gr7 = new TGraph(i,x,yl7); gr7->SetMarkerStyle(20); gr7->SetMarkerColor(TColor::kAzure+7); gr7->SetLineColor(TColor::kAzure+7); @@ -208,7 +219,7 @@ void plotFrc(char *FileName) } if (Flag[7]==1){ - TGraph *gr8 = new TGraph(i-1,x,bck); + TGraph *gr8 = new TGraph(i,x,bck); gr8->SetMarkerStyle(20); gr8->SetMarkerColor(TColor::kAzure+7); gr8->SetLineColor(TColor::kAzure+7);