Better plot axis labels and sizes, to preserve style across all files.

This commit is contained in:
Sophie Redford
2016-11-28 18:27:53 +01:00
parent fd545293d3
commit 63dd95f1c5
4 changed files with 53 additions and 34 deletions
+36 -13
View File
@@ -64,6 +64,10 @@ int main(int argc, char* argv[]) {
TH1F* g1histall = new TH1F("g1histall","",100,-4,0);
TH1F* g2histall = new TH1F("g2histall","",100,-0.5,0);
TH1F* g0ferhistall = new TH1F("g0ferhistall","",100,0,0.005);
TH1F* g1ferhistall = new TH1F("g1ferhistall","",100,0,0.05);
TH1F* g2ferhistall = new TH1F("g2ferhistall","",100,0,0.05);
TH1F* g0histcut = new TH1F("g0histcut","",100,20,60);
TH1F* g1histcut = new TH1F("g1histcut","",100,-4,0);
TH1F* g2histcut = new TH1F("g2histcut","",100,-0.5,0);
@@ -117,16 +121,19 @@ int main(int argc, char* argv[]) {
if (FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1) != 0) {
g0fermapall->SetBinContent((i%NC)+1,(i/NC)+1,FL_peaker_map->GetBinContent((i%NC)+1,(i/NC)+1)/FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1));
g0ferhistall->Fill(FL_peaker_map->GetBinContent((i%NC)+1,(i/NC)+1)/FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1));
}
if (FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1) != 0 && DB_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1) != 0) {
g1fermapall->SetBinContent((i%NC)+1,(i/NC)+1, sqrt(pow((FL_peaker_map->GetBinContent((i%NC)+1,(i/NC)+1)/FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1)),2) + pow((DB_ratioer_map->GetBinContent((i%NC)+1,(i/NC)+1)/DB_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1)),2)));
g1ferhistall->Fill(sqrt(pow((FL_peaker_map->GetBinContent((i%NC)+1,(i/NC)+1)/FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1)),2) + pow((DB_ratioer_map->GetBinContent((i%NC)+1,(i/NC)+1)/DB_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1)),2)));
}
if (FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1) != 0 &&
DB_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1) != 0 &&
CS_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1) != 0) {
g2fermapall->SetBinContent((i%NC)+1,(i/NC)+1, sqrt(pow((FL_peaker_map->GetBinContent((i%NC)+1,(i/NC)+1)/FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1)),2) + pow((DB_ratioer_map->GetBinContent((i%NC)+1,(i/NC)+1)/DB_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1)),2) + pow((CS_ratioer_map->GetBinContent((i%NC)+1,(i/NC)+1)/CS_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1)),2)));
g2ferhistall->Fill(sqrt(pow((FL_peaker_map->GetBinContent((i%NC)+1,(i/NC)+1)/FL_peak_map->GetBinContent((i%NC)+1,(i/NC)+1)),2) + pow((DB_ratioer_map->GetBinContent((i%NC)+1,(i/NC)+1)/DB_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1)),2) + pow((CS_ratioer_map->GetBinContent((i%NC)+1,(i/NC)+1)/CS_ratio_map->GetBinContent((i%NC)+1,(i/NC)+1)),2)));
}
}
@@ -220,7 +227,6 @@ int main(int argc, char* argv[]) {
sprintf(savename,"plots/M%s/gain2fer_all_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g0mapcut->GetXaxis()->SetTitle("Column");
g0mapcut->GetYaxis()->SetTitle("Row");
g0mapcut->GetYaxis()->SetTitleOffset(0.7);
@@ -259,6 +265,8 @@ int main(int argc, char* argv[]) {
sprintf(savename,"plots/M%s/maskmap_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
TCanvas* c1 = new TCanvas("c1","");
g0histcut->SetLineColor(kRed);
g1histcut->SetLineColor(kRed);
g2histcut->SetLineColor(kRed);
@@ -267,30 +275,45 @@ int main(int argc, char* argv[]) {
g0histcut->Draw();
g0histall->Draw("same");
sprintf(savename,"plots/M%s/g0hist_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
mapcanvas->SetLogy();
c1->SaveAs((const char *)(savename));
c1->SetLogy();
sprintf(savename,"plots/M%s/g0hist_log_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
mapcanvas->SetLogy(0);
c1->SaveAs((const char *)(savename));
c1->SetLogy(0);
g1histcut->GetXaxis()->SetTitle("Gain G1 [ADU/keV]");
g1histcut->Draw();
g1histall->Draw("same");
sprintf(savename,"plots/M%s/g1hist_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
mapcanvas->SetLogy();
c1->SaveAs((const char *)(savename));
c1->SetLogy();
sprintf(savename,"plots/M%s/g1hist_log_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
mapcanvas->SetLogy(0);
c1->SaveAs((const char *)(savename));
c1->SetLogy(0);
g2histcut->GetXaxis()->SetTitle("Gain G2 [ADU/keV]");
g2histcut->Draw();
g2histall->Draw("same");
sprintf(savename,"plots/M%s/g2hist_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
mapcanvas->SetLogy();
c1->SaveAs((const char *)(savename));
c1->SetLogy();
sprintf(savename,"plots/M%s/g2hist_log_M%s.png", module_str.c_str(), module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
mapcanvas->SetLogy(0);
c1->SaveAs((const char *)(savename));
c1->SetLogy(0);
g0ferhistall->GetXaxis()->SetTitle("Gain G0 frac uncert");
g0ferhistall->Draw();
sprintf(savename,"plots/M%s/g0ferhist_M%s.png", module_str.c_str(), module_str.c_str());
c1->SaveAs((const char *)(savename));
g1ferhistall->GetXaxis()->SetTitle("Gain G1 frac uncert");
g1ferhistall->Draw();
sprintf(savename,"plots/M%s/g1ferhist_M%s.png", module_str.c_str(), module_str.c_str());
c1->SaveAs((const char *)(savename));
g2ferhistall->GetXaxis()->SetTitle("Gain G2 frac uncert");
g2ferhistall->Draw();
sprintf(savename,"plots/M%s/g2ferhist_M%s.png", module_str.c_str(), module_str.c_str());
c1->SaveAs((const char *)(savename));
}