diff --git a/trimsp/src/TrimSPGUI4/PlotFraction.png b/trimsp/src/TrimSPGUI4/PlotFraction.png deleted file mode 100644 index 923a9fb..0000000 Binary files a/trimsp/src/TrimSPGUI4/PlotFraction.png and /dev/null differ diff --git a/trimsp/src/TrimSPGUI4/PlotFraction.png b/trimsp/src/TrimSPGUI4/PlotFraction.png new file mode 120000 index 0000000..4ba06c7 --- /dev/null +++ b/trimsp/src/TrimSPGUI4/PlotFraction.png @@ -0,0 +1 @@ +../TrimSPGUI/PlotFraction.png \ No newline at end of file diff --git a/trimsp/src/TrimSPGUI4/PlotProfiles.png b/trimsp/src/TrimSPGUI4/PlotProfiles.png deleted file mode 100644 index d8f9625..0000000 Binary files a/trimsp/src/TrimSPGUI4/PlotProfiles.png and /dev/null differ diff --git a/trimsp/src/TrimSPGUI4/PlotProfiles.png b/trimsp/src/TrimSPGUI4/PlotProfiles.png new file mode 120000 index 0000000..cdd8a6f --- /dev/null +++ b/trimsp/src/TrimSPGUI4/PlotProfiles.png @@ -0,0 +1 @@ +../TrimSPGUI/PlotProfiles.png \ No newline at end of file diff --git a/trimsp/src/TrimSPGUI4/plotFrc.C b/trimsp/src/TrimSPGUI4/plotFrc.C deleted file mode 100644 index 387a348..0000000 --- a/trimsp/src/TrimSPGUI4/plotFrc.C +++ /dev/null @@ -1,232 +0,0 @@ -// File: plotFrc.C -// Author: Zaher Salman -// Date: 11/01/2012 -// Purpose: ROOT macro to read and plot implantation fractions in layers from trimsp calculation -// Assume following file Format: -// -// $Id$ -// -// Energy SigmaE Alpha SigAlpha ntot imp backsc trans tried negE impL1 impL2 impL3 impL4 impL5 impL6 impL7 range straggeling Eback sigEback Etrans SigEtrans red. E PRC -// 15.00 0.45 0.00 15.00 100000 98362 1638 0 100000 0 98362 0 0 0 0 0 0 0.6664E+03 0.1799E+03 0.4980E+04 0.4250E+04 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 -// plotFrc(file_name) - -void plotFrc(char *FileName) -{ - TObjString *ostr; - TString str,xlab,ylab; - - TString line, label, treeLabel; - TString rootFileName; - TObjArray *token,*labels; - TObjString *strtoken; - Int_t nPars = 0; - Int_t ntokens = 0; - Int_t i = 0; - Int_t nline=0; - Int_t intNorm=0; - Ssiz_t pos; - Double_t x[100],yl1[100],yl2[100],yl3[100],yl4[100],yl5[100],yl6[100],yl7[100],bck[100]; - Int_t Flag[7]=0; - - FILE *fp = fopen(FileName,"r"); - if ( fp == NULL ){ - printf("File %s does not exist!\n", FileName); - return; - } - - while (line.Gets(fp)){ - if ( nline==0 ){ - // First line, get data labels - nline++; - labels = line.Tokenize(" "); - ntokens = labels->GetEntries(); - nPars=ntokens; - ostr = dynamic_cast(labels->At(0)); - xlab = ostr->GetString(); - ylab = ostr->GetString(); - - } else { - token = line.Tokenize(" "); - ntokens = token->GetEntries(); - - strtoken = (TObjString*) token->At(0); - label = strtoken->GetName(); - x[i] = label.Atof(); - - // 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++; - } - - strtoken = (TObjString*) token->At(11); - label = strtoken->GetName(); - yl2[i] = label.Atof(); - if (yl2[i]>0) { - Flag[1]=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++; - } - - //} - - nline++; - i++; - } - } - - - TCanvas *c = new TCanvas("c",str); - c->Show(); - TLegend *legend = new TLegend(0.8, 0.8, 0.95, 0.95); - legend->SetFillColor(TColor::GetColor(255,255,255)); // white - - TMultiGraph *mg = new TMultiGraph(); - - if (Flag[0]==1){ - TGraph *gr1 = new TGraph(i-1,x,yl1); - gr1->GetXaxis()->SetTitle(xlab); - gr1->GetYaxis()->SetTitle("Implanted Fraction"); - // gr1->Draw("APC"); - gr1->SetMarkerStyle(20); - gr1->SetMarkerColor(TColor::kRed); - gr1->SetLineColor(TColor::kRed); - legend->AddEntry(gr1,"Layer 1"); - mg->Add(gr1); - } - - if (Flag[1]==1){ - TGraph *gr2 = new TGraph(i-1,x,yl2); - gr2->SetMarkerStyle(20); - gr2->SetMarkerColor(TColor::kGreen); - gr2->SetLineColor(TColor::kGreen); - // gr2->Draw("PC"); - legend->AddEntry(gr2,"Layer 2"); - mg->Add(gr2); - } - - if (Flag[2]==1){ - TGraph *gr3 = new TGraph(i-1,x,yl3); - gr3->SetMarkerStyle(20); - gr3->SetMarkerColor(TColor::kBlue); - gr3->SetLineColor(TColor::kBlue); - // gr3->Draw("PC"); - legend->AddEntry(gr3,"Layer 3"); - mg->Add(gr3); - } - - if (Flag[3]==1){ - TGraph *gr4 = new TGraph(i-1,x,yl4); - gr4->SetMarkerStyle(20); - gr4->SetMarkerColor(TColor::kMagenta); - gr4->SetLineColor(TColor::kMagenta); - // gr4->Draw("PC"); - legend->AddEntry(gr4,"Layer 4"); - mg->Add(gr4); - } - - if (Flag[4]==1){ - TGraph *gr5 = new TGraph(i-1,x,yl5); - gr5->SetMarkerStyle(20); - gr5->SetMarkerColor(TColor::kOrange); - gr5->SetLineColor(TColor::kOrange); - // gr5->Draw("PC"); - legend->AddEntry(gr5,"Layer 5"); - mg->Add(gr5); - } - - if (Flag[5]==1){ - TGraph *gr6 = new TGraph(i-1,x,yl6); - gr6->SetMarkerStyle(20); - gr6->SetMarkerColor(TColor::kViolet); - gr6->SetLineColor(TColor::kViolet); - // gr6->Draw("PC"); - legend->AddEntry(gr6,"Layer 6"); - mg->Add(gr6); - } - - if (Flag[6]==1){ - TGraph *gr7 = new TGraph(i-1,x,yl7); - gr7->SetMarkerStyle(20); - gr7->SetMarkerColor(TColor::kAzure+7); - gr7->SetLineColor(TColor::kAzure+7); - // gr7->Draw("PC"); - legend->AddEntry(gr7,"Layer 7"); - mg->Add(gr7); - } - - if (Flag[7]==1){ - TGraph *gr8 = new TGraph(i-1,x,bck); - gr8->SetMarkerStyle(20); - gr8->SetMarkerColor(TColor::kAzure+7); - gr8->SetLineColor(TColor::kAzure+7); - // gr8->Draw("PC"); - legend->AddEntry(gr8,"Back Scat."); - mg->Add(gr8); - } - - mg->Draw("APC"); - mg->GetXaxis()->SetTitle("Energy [keV]"); - mg->GetYaxis()->SetTitle("Implanted Particles"); - legend->Draw(); - - // I am not sure what this does, but it waits until canvas is closed - c->WaitPrimitive(" "); - cout << endl << "Canvas Closed" << endl ; - - // Then quit root cleanly - gApplication->Terminate(); -} - diff --git a/trimsp/src/TrimSPGUI4/plotFrc.C b/trimsp/src/TrimSPGUI4/plotFrc.C new file mode 120000 index 0000000..ade6db0 --- /dev/null +++ b/trimsp/src/TrimSPGUI4/plotFrc.C @@ -0,0 +1 @@ +../TrimSPGUI/plotFrc.C \ No newline at end of file diff --git a/trimsp/src/TrimSPGUI4/plotRge.C b/trimsp/src/TrimSPGUI4/plotRge.C deleted file mode 100644 index 224da00..0000000 --- a/trimsp/src/TrimSPGUI4/plotRge.C +++ /dev/null @@ -1,182 +0,0 @@ -// File: plotRge.C -// Author: Zaher Salman, originally by Andreas Suter -// Date: 03/06/2009 -// Purpose: ROOT macro to read and plot Range data from trimsp calculation -// Assume following file Format: -// -// $Id$ -// -// DEPTH PARTICLES -// 15. 260 -// 45. 595 -// 75. 820 -// 105. 1179 -// -// plotRge(names), e.g. -// plotRge("InSne_E2500, InSne_E4000"); -// will read files - -void plotRge(TString &names) -{ - if (names.CompareTo("help", TString::kIgnoreCase) == 0) { - cout << endl << "usage: plotRge() or plotRge(\"help\")"; - cout << endl << " is a list of rge-files"; - cout << endl << endl; - return; - } - - TObjArray *tokens; - TObjString *ostr; - TString str; - char cstr[128]; - - Int_t i, j; - Int_t nStep = 0; - Int_t nStepmax = 0; - Double_t *depth; - Double_t *nStop; - Double_t *depthmax; - Double_t *nStopmax; - Double_t norm; - Double_t intNorm; - Double_t normStop[1000]; - Double_t normStopmax[1000]; - - TString pathname; - int sep; - TString path; - TString name,legtit; - - - - Int_t col; - Int_t color[1000]; - for (i=0; i<1000; i++) - color[i] = -1; - color[0] = TColor::kRed; - color[1] = TColor::kGreen; - color[2] = TColor::kBlue; - color[3] = TColor::kMagenta; - color[4] = TColor::kOrange; - color[5] = TColor::kViolet; - color[6] = TColor::kAzure+7; - color[7] = TColor::kOrange+4; - color[8] = TColor::kBlue-7; - - TGraph *rge[1000]; - - TMultiGraph *mg = new TMultiGraph(); - - TLegend *legend = new TLegend(0.7, 0.7, 0.95, 0.95); - legend->SetFillColor(TColor::GetColor(255,255,255)); // white - - tokens = names.Tokenize(" \t,;"); - - Double_t min = 0, max = 0, xmax = 0, xmin = 0; - Int_t imax; - - // Loop over file names - for (i=0; iGetEntries(); i++) { - ostr = dynamic_cast(tokens->At(i)); - str = ostr->GetString(); - cout << endl << i << ": read " << str.Data(); - - TGraph *fileGraph = new TGraph(str); - if ( fileGraph->IsZombie() ){ - cout << endl; - cout << "File " << str << " does not exist!!!" << endl << endl; - return; - } - - depth = fileGraph->GetX(); - nStop = fileGraph->GetY(); - nStep = fileGraph->GetN(); // Number of points in range - - // calculate step size in nm (convert from AA) - norm = (depth[1] - depth[0])/10; - - // intNorm is the total stopping particles - intNorm = 0.0; - for (j=0; j 0.) { - // devide original profile by (step size * total particles) in % - normStop[j] = 100*nStop[j]/(norm*intNorm); - } else { - normStop[j] = -1.; - } - // rescale depth to nm - depth[j] = depth[j]/10.; - } - - rge[i] = new TGraph(nStep, depth, normStop); - if (color[i] >= 0) { - rge[i]->SetMarkerColor(color[i]); - rge[i]->SetLineColor(color[i]); - } else { - TRandom *rand = new TRandom(i); - col = TColor::GetColor((Int_t)rand->Integer(255),(Int_t)rand->Integer(255),(Int_t)rand->Integer(255)); - rge[i]->SetMarkerColor(col); - rge[i]->SetLineColor(col); - delete rand; - } - rge[i]->SetMarkerStyle(20); - - mg->Add(rge[i]); - - ostr = dynamic_cast(tokens->At(i)); - str = ostr->GetString() + ", "; - sprintf(cstr, "%.1lf", ostr->GetString().Atof() /1000.0); - str += cstr; - - // remove path - sep = str.Last('/'); - path = str(0,sep); - name = str(sep+1,str.Length()-sep-1); - // remove comma etc. - sep = name.Last(','); - name = name(0,sep); - // remove extension etc. - sep = name.Last('.'); - name = name(0,sep); - // remove ????_ etc. - sep = name.Last('_'); - path = name(sep+1); - name = name(sep+2,name.Length()-sep-1); - legtit = ""; - legtit += path; - legtit += "="; - legtit += name; - legtit += " (eV)"; - - cout << endl << legtit << endl ; - rge[i]->SetTitle(str.Data()); - rge[i]->SetFillColor(TColor::kWhite); - legend->AddEntry(rge[i], legtit); - - delete fileGraph; - } - cout << endl; - - mg->Draw("APC"); - mg->GetXaxis()->SetTitle("Depth [nm]"); - mg->GetYaxis()->SetTitle("Normalized Stopping Profile [%/nm]"); - legend->Draw(); - - - delete tokens; - - // I am not sure what this does, but it waits until canvas is closed - c1->WaitPrimitive(" "); - cout << endl << "Canvas Closed" << endl ; - - // Then quit root cleanly - gApplication->Terminate(); - -} - diff --git a/trimsp/src/TrimSPGUI4/plotRge.C b/trimsp/src/TrimSPGUI4/plotRge.C new file mode 120000 index 0000000..772b48e --- /dev/null +++ b/trimsp/src/TrimSPGUI4/plotRge.C @@ -0,0 +1 @@ +../TrimSPGUI/plotRge.C \ No newline at end of file diff --git a/trimsp/src/TrimSPGUI4/readAscii.C b/trimsp/src/TrimSPGUI4/readAscii.C deleted file mode 100644 index 0ce6359..0000000 --- a/trimsp/src/TrimSPGUI4/readAscii.C +++ /dev/null @@ -1,88 +0,0 @@ -// File: readAscii.C -// Author: Thomas Prokscha -// Date: 24/04/2005 -// Purpose: ROOT macro to read ASCII data from file FileName -// Assume sections -// Comment: -// and -// Data: -// label1 label2 ... -// value1 value2 ... -// - -// gROOT->Reset(); - -void readAscii(char *FileName, Int_t Col1, Int_t Col2) -{ - TObjString *ostr; - TString str,xlab,ylab; - - TString line, label, treeLabel; - TString rootFileName; - TObjArray *token; - TObjString *strtoken; - Int_t nPars = 0; - Int_t ntokens = 0; - Int_t i = 0; - Int_t nline=0; - Ssiz_t pos; - Double_t x[100],y[100]; - - FILE *fp = fopen(FileName,"r"); - if ( fp == NULL ){ - printf("File %s does not exist!\n", FileName); - return; - } - - while (line.Gets(fp)){ - if ( nline==0 ){ - // First line, get data labels - nline++; - token = line.Tokenize(" "); - ntokens = token->GetEntries(); - nPars=ntokens; - ostr = dynamic_cast(token->At(Col1)); - xlab = ostr->GetString(); - ostr = dynamic_cast(token->At(Col2)); - ylab = ostr->GetString(); - - } else { - token = line.Tokenize(" "); - ntokens = token->GetEntries(); -// if ( ntokens != nPars) { -// // We have a problems -// printf("The number of columns found is: %d not equal to %d\n",ntokens,nPars); -// } - - strtoken = (TObjString*) token->At(Col1); - label = strtoken->GetName(); - x[i] = label.Atof(); - strtoken = (TObjString*) token->At(Col2); - label = strtoken->GetName(); - y[i] = label.Atof(); - printf("(x,y)[%d]= (%f,%f)\n",i,x[i],y[i]); - - nline++; - i++; - } - } - - TGraph *gr = new TGraph(i-1,x,y); - TCanvas *c = new TCanvas("c",str); - gr->GetXaxis()->SetTitle(xlab); - gr->GetYaxis()->SetTitle(ylab); - gr->Draw("AC*"); - - c->Show(); - - - delete token; - - // I am not sure what this does, but it waits until canvas is closed - c->WaitPrimitive(" "); - cout << endl << "Canvas Closed" << endl ; - - // Then quit root cleanly - gApplication->Terminate(); -} - diff --git a/trimsp/src/TrimSPGUI4/readAscii.C b/trimsp/src/TrimSPGUI4/readAscii.C new file mode 120000 index 0000000..7b2e9ab --- /dev/null +++ b/trimsp/src/TrimSPGUI4/readAscii.C @@ -0,0 +1 @@ +../TrimSPGUI/readAscii.C \ No newline at end of file