From 0fd325b0d6f523d910c510c1e2cb72e216a10b53 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Fri, 17 May 2013 14:16:35 +0000 Subject: [PATCH] Replaced duplicate files with symbolik links. --- trimsp/src/TrimSPGUI4/PlotFraction.png | Bin 836 -> 29 bytes trimsp/src/TrimSPGUI4/PlotProfiles.png | Bin 841 -> 29 bytes trimsp/src/TrimSPGUI4/plotFrc.C | 233 +------------------------ trimsp/src/TrimSPGUI4/plotRge.C | 183 +------------------ trimsp/src/TrimSPGUI4/readAscii.C | 89 +--------- 5 files changed, 3 insertions(+), 502 deletions(-) mode change 100644 => 120000 trimsp/src/TrimSPGUI4/PlotFraction.png mode change 100644 => 120000 trimsp/src/TrimSPGUI4/PlotProfiles.png mode change 100644 => 120000 trimsp/src/TrimSPGUI4/plotFrc.C mode change 100644 => 120000 trimsp/src/TrimSPGUI4/plotRge.C mode change 100644 => 120000 trimsp/src/TrimSPGUI4/readAscii.C diff --git a/trimsp/src/TrimSPGUI4/PlotFraction.png b/trimsp/src/TrimSPGUI4/PlotFraction.png deleted file mode 100644 index 923a9fbd23a7ad4ba3a58988f4761b96bf490552..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 836 zcmV-K1H1f*P)^m zwvA<392VjLT3TAj%F1GTdiu~DJ2rNllXHV}=blkfVUd#)gT-JF-o1maE?8WIQ>Vb~ zhV=BUdin#m+pU!q$?cYUdK4W#e2@wXq!%wFzh4T4q{&HXbu~=YxjBf01gNWn(o%3b zAvgB`JFTsSxjATT1j{l8*4NE*98^`o_&B_NZRCT4 z=DVR`f5%{gt*L?g_hD&iAE&LYWLc1sp4nj{4 zl$GuLe{2lizJ)7SB6kdM<_r`Tnhb_vc^Rs!!Ry^BPfmuZDQIqnp&@X&pu0PK{bpA0 z29HN-Z{H@oc~koQSjPkN)-PcwV!`Tgc?+tS!r45{8g(yJz(KKRaE&q?OycGqia`bX-@N-&4= z0a(2SU%$e~j~u&ol_yW&_H9Gny>R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<;c}d$y%t`3uhd#@O2s7a(gHCle2s* zC|Gy=B`1Hz?T%gDl$`+QbKv+r7?%;{DS=pf`i62hH+P!B!IUr-!nnL}m!9wqBc1LT T2DBCk00000NkvXXu0mjfGN5_( 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