The chemical formula from the GUI will be added to the _Seq_Results.dat file header and used by the root macro when plotting the fractions.

This commit is contained in:
salman 2015-09-03 10:13:40 +02:00
parent 6815c7f089
commit 38d55a3ebe
3 changed files with 42 additions and 15 deletions

View File

@ -617,11 +617,28 @@ sub StartSequenceOne
$Progress=90; $Progress=90;
this->{ui}->progress->setValue($Progress); this->{ui}->progress->setValue($Progress);
this->{ui}->progress->update(); this->{ui}->progress->update();
sleep(10); # sleep(10);
} }
# An easy way to keep track of chemical formula is to replace impL_i by the corresponding chemical formula of layer i
open (INF,q{<}, "fort.33" );
my @lines = <INF>;
close(INF);
my $all_lines = join("",@lines);
for (my $i=1;$i<=$All{"numLayer"};$i++){
my $LComp = "L".$i."Comp";
my $chem_formula = $All{"$LComp"};
my $place_holder = "impL".$i;
$all_lines =~ s/$place_holder/$chem_formula/g;
}
my $seq_file = $All{"fileNamePrefix"}."_Seq_Results.dat";
open (SEQF,q{>}, "$seq_file" );
print SEQF $all_lines;
close(SEQF);
# Move the fort.33 file into the subdirectory and change its name # Move the fort.33 file into the subdirectory and change its name
$cmd="rm -f eingabe1.inp; mv -f fort.33 ".$All{"fileNamePrefix"}."_Seq_Results.dat"; $cmd="rm -f eingabe1.inp; rm -f fort.33";
system($cmd); system($cmd);
$Progress=100; $Progress=100;
this->{ui}->progress->setValue($Progress); this->{ui}->progress->setValue($Progress);

View File

@ -1531,4 +1531,4 @@ sub retranslate_ui {
retranslateUi( $trimSPGUI4 ); retranslateUi( $trimSPGUI4 );
} }
1; 1;

View File

@ -13,7 +13,7 @@
void plotFrc(char *FileName) void plotFrc(char *FileName)
{ {
TObjString *ostr; TObjString *ostr;
TString str,xlab,ylab; TString str,xlab;
TString line, label, treeLabel; TString line, label, treeLabel;
TString rootFileName; TString rootFileName;
@ -43,8 +43,6 @@ void plotFrc(char *FileName)
nPars=ntokens; nPars=ntokens;
ostr = dynamic_cast<TObjString*>(labels->At(0)); ostr = dynamic_cast<TObjString*>(labels->At(0));
xlab = ostr->GetString(); xlab = ostr->GetString();
ylab = ostr->GetString();
} else { } else {
token = line.Tokenize(" "); token = line.Tokenize(" ");
ntokens = token->GetEntries(); ntokens = token->GetEntries();
@ -148,14 +146,14 @@ void plotFrc(char *FileName)
if (Flag[0]==1){ if (Flag[0]==1){
TGraph *gr1 = new TGraph(i,x,yl1); TGraph *gr1 = new TGraph(i,x,yl1);
gr1->GetXaxis()->SetTitle(xlab);
gr1->GetYaxis()->SetTitle("Implanted Fraction");
// gr1->Draw("APC"); // gr1->Draw("APC");
gr1->SetMarkerStyle(20); gr1->SetMarkerStyle(20);
gr1->SetMarkerColor(TColor::kRed); gr1->SetMarkerColor(TColor::kRed);
gr1->SetLineColor(TColor::kRed); gr1->SetLineColor(TColor::kRed);
// Preferably get the chemical formula from header // Preferably get the chemical formula from header
legend->AddEntry(gr1,"Layer 1"); ostr = dynamic_cast<TObjString*>(labels->At(10));
xlab = ostr->GetString();
legend->AddEntry(gr1,xlab);
mg->Add(gr1); mg->Add(gr1);
} }
@ -166,7 +164,9 @@ void plotFrc(char *FileName)
gr2->SetLineColor(TColor::kGreen); gr2->SetLineColor(TColor::kGreen);
// gr2->Draw("PC"); // gr2->Draw("PC");
// Preferably get the chemical formula from header // Preferably get the chemical formula from header
legend->AddEntry(gr2,"Layer 2"); ostr = dynamic_cast<TObjString*>(labels->At(11));
xlab = ostr->GetString();
legend->AddEntry(gr2,xlab);
mg->Add(gr2); mg->Add(gr2);
} }
@ -177,7 +177,9 @@ void plotFrc(char *FileName)
gr3->SetLineColor(TColor::kBlue); gr3->SetLineColor(TColor::kBlue);
// gr3->Draw("PC"); // gr3->Draw("PC");
// Preferably get the chemical formula from header // Preferably get the chemical formula from header
legend->AddEntry(gr3,"Layer 3"); ostr = dynamic_cast<TObjString*>(labels->At(12));
xlab = ostr->GetString();
legend->AddEntry(gr3,xlab);
mg->Add(gr3); mg->Add(gr3);
} }
@ -188,7 +190,9 @@ void plotFrc(char *FileName)
gr4->SetLineColor(TColor::kMagenta); gr4->SetLineColor(TColor::kMagenta);
// gr4->Draw("PC"); // gr4->Draw("PC");
// Preferably get the chemical formula from header // Preferably get the chemical formula from header
legend->AddEntry(gr4,"Layer 4"); ostr = dynamic_cast<TObjString*>(labels->At(13));
xlab = ostr->GetString();
legend->AddEntry(gr4,xlab);
mg->Add(gr4); mg->Add(gr4);
} }
@ -199,7 +203,9 @@ void plotFrc(char *FileName)
gr5->SetLineColor(TColor::kOrange); gr5->SetLineColor(TColor::kOrange);
// gr5->Draw("PC"); // gr5->Draw("PC");
// Preferably get the chemical formula from header // Preferably get the chemical formula from header
legend->AddEntry(gr5,"Layer 5"); ostr = dynamic_cast<TObjString*>(labels->At(14));
xlab = ostr->GetString();
legend->AddEntry(gr5,xlab);
mg->Add(gr5); mg->Add(gr5);
} }
@ -210,7 +216,9 @@ void plotFrc(char *FileName)
gr6->SetLineColor(TColor::kViolet); gr6->SetLineColor(TColor::kViolet);
// gr6->Draw("PC"); // gr6->Draw("PC");
// Preferably get the chemical formula from header // Preferably get the chemical formula from header
legend->AddEntry(gr6,"Layer 6"); ostr = dynamic_cast<TObjString*>(labels->At(15));
xlab = ostr->GetString();
legend->AddEntry(gr6,xlab);
mg->Add(gr6); mg->Add(gr6);
} }
@ -221,7 +229,9 @@ void plotFrc(char *FileName)
gr7->SetLineColor(TColor::kAzure+7); gr7->SetLineColor(TColor::kAzure+7);
// gr7->Draw("PC"); // gr7->Draw("PC");
// Preferably get the chemical formula from header // Preferably get the chemical formula from header
legend->AddEntry(gr7,"Layer 7"); ostr = dynamic_cast<TObjString*>(labels->At(16));
xlab = ostr->GetString();
legend->AddEntry(gr7,xlab);
mg->Add(gr7); mg->Add(gr7);
} }