More work towards plotting implantation profiles.
This commit is contained in:
parent
68a38ee357
commit
17b4ebbc2f
2788
trimsp/TrimSPGUI/TrimSP.pl
Normal file
2788
trimsp/TrimSPGUI/TrimSP.pl
Normal file
File diff suppressed because it is too large
Load Diff
@ -8,29 +8,13 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>722</width>
|
||||
<height>601</height>
|
||||
<width>719</width>
|
||||
<height>610</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>TrimSP GUI</string>
|
||||
</property>
|
||||
<widget class="QProgressBar">
|
||||
<property name="name">
|
||||
<cstring>Progress</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>525</y>
|
||||
<width>715</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>WinPanel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTabWidget">
|
||||
<property name="name">
|
||||
<cstring>tabs</cstring>
|
||||
@ -38,7 +22,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<y>5</y>
|
||||
<width>715</width>
|
||||
<height>525</height>
|
||||
</rect>
|
||||
@ -2095,6 +2079,22 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QProgressBar">
|
||||
<property name="name">
|
||||
<cstring>Progress</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>530</y>
|
||||
<width>715</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>WinPanel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<menubar>
|
||||
<property name="name">
|
||||
@ -2107,8 +2107,8 @@
|
||||
</item>
|
||||
<item text="&Plot" name="Plot">
|
||||
<separator/>
|
||||
<action name="editFindAction"/>
|
||||
<action name="plotPlot_FractionsAction"/>
|
||||
<action name="plotProfilesAction"/>
|
||||
<action name="plotFractionsAction"/>
|
||||
</item>
|
||||
<item text="&Help" name="helpMenu">
|
||||
<action name="helpContentsAction"/>
|
||||
@ -2305,7 +2305,7 @@
|
||||
</action>
|
||||
<action>
|
||||
<property name="name">
|
||||
<cstring>editFindAction</cstring>
|
||||
<cstring>plotProfilesAction</cstring>
|
||||
</property>
|
||||
<property name="iconSet">
|
||||
<iconset>image11</iconset>
|
||||
@ -2364,7 +2364,10 @@
|
||||
</action>
|
||||
<action>
|
||||
<property name="name">
|
||||
<cstring>plotPlot_FractionsAction</cstring>
|
||||
<cstring>plotFractionsAction</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="iconSet">
|
||||
<iconset>image12</iconset>
|
||||
@ -2535,6 +2538,12 @@
|
||||
<receiver>TrimSPGUI</receiver>
|
||||
<slot>StartSequenceOne()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>plotProfilesAction</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>TrimSPGUI</receiver>
|
||||
<slot>PlotProfiles()</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<includes>
|
||||
<include location="local" impldecl="in implementation">TrimSPGUI.ui.h</include>
|
||||
@ -2549,6 +2558,8 @@
|
||||
<slot>StartSequenceOne()</slot>
|
||||
<slot>DirectoryBrowse()</slot>
|
||||
<slot>ConfirmQuit()</slot>
|
||||
<slot>PlotProfiles()</slot>
|
||||
<slot>PlotFraction()</slot>
|
||||
</slots>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
||||
|
@ -608,3 +608,26 @@ void TrimSPGUI::ConfirmQuit()
|
||||
# print STDOUT $ENV{'TRIMBIN'}."\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TrimSPGUI::PlotProfiles()
|
||||
{
|
||||
my $files_ref=Qt::FileDialog::getOpenFileNames(
|
||||
"RGE Files (*.rge)",
|
||||
"./",
|
||||
this,
|
||||
"Select RGE files dialog",
|
||||
"Choose RGE file to plot");
|
||||
my @files = @$files_ref;
|
||||
my $filenames=join(",",@files);
|
||||
print "Selected file: $filenames\n";
|
||||
|
||||
# Now that we have the file list send it to root macro for plotting.
|
||||
|
||||
}
|
||||
|
||||
|
||||
void TrimSPGUI::PlotFraction()
|
||||
{
|
||||
|
||||
}
|
||||
|
148
trimsp/TrimSPGUI/plotRge.C
Normal file
148
trimsp/TrimSPGUI/plotRge.C
Normal file
@ -0,0 +1,148 @@
|
||||
// File: plotRge.C
|
||||
// Author: Andreas Suter
|
||||
// Date: 03/06/2009
|
||||
// Purpose: ROOT macro to read and plot Range data from trimsp calculation
|
||||
// Assume following file Format:
|
||||
// Very simple at the moment...
|
||||
//
|
||||
// $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(<names>) or plotRge(\"help\")";
|
||||
cout << endl << " <names> 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;
|
||||
Double_t *depth;
|
||||
Double_t *nStop;
|
||||
Double_t norm;
|
||||
Double_t intNorm;
|
||||
Double_t normStop[1000];
|
||||
|
||||
TGraph *rge[1000];
|
||||
|
||||
tokens = names.Tokenize(" \t,;");
|
||||
|
||||
Double_t min = 0, max = 0;
|
||||
|
||||
for (i=0; i<tokens->GetEntries(); i++) {
|
||||
ostr = dynamic_cast<TObjString*>(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();
|
||||
|
||||
// calculate stops/nm
|
||||
norm = depth[1] - depth[0];
|
||||
|
||||
intNorm = 0.0;
|
||||
for (j=0; j<nStep; j++) {
|
||||
intNorm += nStop[j];
|
||||
}
|
||||
|
||||
for (j=0; j<nStep; j++) {
|
||||
if (norm > 0.) {
|
||||
normStop[j] = nStop[j]/norm*10.0/intNorm;
|
||||
} else {
|
||||
normStop[j] = -1.;
|
||||
}
|
||||
depth[j] = depth[j]/10.; // scale depth to nm
|
||||
|
||||
if (normStop[j] > max)
|
||||
max = normStop[j];
|
||||
if (normStop[j] < min)
|
||||
min = normStop[j];
|
||||
}
|
||||
|
||||
rge[i] = new TGraph(nStep, depth, normStop);
|
||||
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||
str = ostr->GetString() + ", ";
|
||||
sprintf(cstr, "%.1lf", ostr->GetString().Atof() /1000.0);
|
||||
str += cstr;
|
||||
str += " (keV)";
|
||||
rge[i]->SetTitle(str.Data());
|
||||
rge[i]->SetFillColor(TColor::kWhite);
|
||||
|
||||
delete fileGraph;
|
||||
}
|
||||
cout << endl;
|
||||
|
||||
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;
|
||||
|
||||
Int_t last = tokens->GetEntries()-1;
|
||||
rge[last]->SetMarkerStyle(20);
|
||||
rge[last]->GetXaxis()->SetTitle("depth (nm)");
|
||||
rge[last]->GetYaxis()->SetTitle("normalized stopping distribution (nm^{-1})");
|
||||
|
||||
TCanvas *c1 = new TCanvas("c1", "rge plot");
|
||||
c1->Show();
|
||||
|
||||
rge[last]->Draw("apl");
|
||||
rge[last]->GetYaxis()->SetRangeUser(min, 1.05*max);
|
||||
|
||||
Int_t col;
|
||||
for (i=0; i<last; i++) {
|
||||
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);
|
||||
rge[i]->Draw("plsame");
|
||||
}
|
||||
|
||||
TLegend *legend = new TLegend(0.7, 0.7, 0.95, 0.95);
|
||||
legend->SetFillColor(TColor::GetColor(255,255,255)); // white
|
||||
for (i=0; i<tokens->GetEntries(); i++) {
|
||||
legend->AddEntry(rge[i]);
|
||||
}
|
||||
legend->Draw();
|
||||
|
||||
delete tokens;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user