Additional plots and better ranges.

This commit is contained in:
redford_s
2017-11-14 17:00:47 +01:00
parent c7a870fd58
commit 07350c406b

View File

@ -6,6 +6,7 @@
#include "TFile.h" #include "TFile.h"
#include "TH2F.h" #include "TH2F.h"
#include "TCanvas.h" #include "TCanvas.h"
#include "TF1.h"
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
jungfrauStyle(); jungfrauStyle();
@ -41,18 +42,26 @@ int main(int argc, char* argv[]) {
TH2F* g0overg1er_map_DB = (TH2F*)saved_file->Get("g0overg1ermap"); TH2F* g0overg1er_map_DB = (TH2F*)saved_file->Get("g0overg1ermap");
// difference and pull // difference and pull
TH1F* diff_g0overg1_hist = new TH1F("diff_g0overg1_hist","",100,-20,20); TH1F* diff_g0overg1_hist = new TH1F("diff_g0overg1_hist","",100,-10,10);
TH1F* diff_g0overg1_e = new TH1F("diff_g0overg1_e","",100,-10,10);
TH1F* diff_g0overg1_d = new TH1F("diff_g0overg1_d","",100,-10,10);
TH1F* diff_g0overg1_ntd = new TH1F("diff_g0overg1_ntd","",100,-10,10);
TH1F* diff_g0overg1_q = new TH1F("diff_g0overg1_q","",100,-10,10);
TH1F* diff_g0overg1_ie = new TH1F("diff_g0overg1_ie","",100,-10,10);
TH1F* diff_g0overg1_b = new TH1F("diff_g0overg1_b","",100,-10,10);
TH2F* diff_g0overg1_map = new TH2F("diff_g0overg1_map","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5); TH2F* diff_g0overg1_map = new TH2F("diff_g0overg1_map","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
TH1F* pull_hist = new TH1F("pull_hist","",100,-20,20); TH1F* pull_hist = new TH1F("pull_hist","",100,-20,20);
// scatter plots // scatter plots
TH2F* scat = new TH2F("scat","",100,-50,0,100,-40,-10); TH2F* scat = new TH2F("scat","",100,-35,-25,100,-35,-25);
TH2F* scat_e = new TH2F("scat_e","",100,-50,0,100,-40,-10); TH2F* scat_e = new TH2F("scat_e","",100,-35,-25,100,-35,-25);
TH2F* scat_d = new TH2F("scat_d","",100,-50,0,100,-40,-10); TH2F* scat_d = new TH2F("scat_d","",100,-35,-25,100,-35,-25);
TH2F* scat_ntd = new TH2F("scat_ntd","",100,-50,0,100,-40,-10); TH2F* scat_ntd = new TH2F("scat_ntd","",100,-35,-25,100,-35,-25);
TH2F* scat_q = new TH2F("scat_q","",100,-50,0,100,-40,-10); TH2F* scat_q = new TH2F("scat_q","",100,-35,-25,100,-35,-25);
TH2F* scat_ie = new TH2F("scat_ie","",100,-50,0,100,-40,-10); TH2F* scat_ie = new TH2F("scat_ie","",100,-35,-25,100,-35,-25);
TH2F* scat_b = new TH2F("scat_b","",100,-50,0,100,-40,-10); TH2F* scat_b = new TH2F("scat_b","",100,-35,-25,100,-35,-25);
TH2F* diff_DBer = new TH2F("diff_DBer","",100,-5,5,100,0.2,1);
double this_BP = 0; double this_BP = 0;
double this_DB = 0; double this_DB = 0;
@ -67,24 +76,32 @@ int main(int argc, char* argv[]) {
diff_g0overg1_map->SetBinContent((i%NC)+1,(i/NC)+1,this_DB - this_BP); diff_g0overg1_map->SetBinContent((i%NC)+1,(i/NC)+1,this_DB - this_BP);
pull_hist->Fill((this_DB - this_BP) / g0overg1er_map_DB->GetBinContent((i%NC)+1,(i/NC)+1)); pull_hist->Fill((this_DB - this_BP) / g0overg1er_map_DB->GetBinContent((i%NC)+1,(i/NC)+1));
diff_DBer->Fill(this_DB - this_BP, g0overg1er_map_DB->GetBinContent((i%NC)+1,(i/NC)+1), 1);
scat->Fill(this_DB, this_BP, 1); scat->Fill(this_DB, this_BP, 1);
if (isEdge(i)) { if (isEdge(i)) {
scat_e->Fill(this_DB, this_BP, 1); scat_e->Fill(this_DB, this_BP, 1);
diff_g0overg1_e->Fill(this_DB - this_BP);
} }
if (isDouble(i)) { if (isDouble(i)) {
scat_d->Fill(this_DB, this_BP, 1); scat_d->Fill(this_DB, this_BP, 1);
diff_g0overg1_d->Fill(this_DB - this_BP);
} }
if (isNextToDouble(i)) { if (isNextToDouble(i)) {
scat_ntd->Fill(this_DB, this_BP, 1); scat_ntd->Fill(this_DB, this_BP, 1);
diff_g0overg1_ntd->Fill(this_DB - this_BP);
} }
if (isQuad(i)) { if (isQuad(i)) {
scat_q->Fill(this_DB, this_BP, 1); scat_q->Fill(this_DB, this_BP, 1);
diff_g0overg1_q->Fill(this_DB - this_BP);
} }
if (isInnerEdge(i)) { if (isInnerEdge(i)) {
scat_ie->Fill(this_DB, this_BP, 1); scat_ie->Fill(this_DB, this_BP, 1);
diff_g0overg1_ie->Fill(this_DB - this_BP);
} }
if (isBulk(i)) { if (isBulk(i)) {
scat_b->Fill(this_DB, this_BP, 1); scat_b->Fill(this_DB, this_BP, 1);
diff_g0overg1_b->Fill(this_DB - this_BP);
} }
} }
@ -92,21 +109,22 @@ int main(int argc, char* argv[]) {
c1->cd(); c1->cd();
diff_g0overg1_hist->GetXaxis()->SetTitle("(G0 / G1)_{DB} - (G0 / G1)_{BP}"); diff_g0overg1_hist->GetXaxis()->SetTitle("(G0 / G1)_{DB} - (G0 / G1)_{BP}");
diff_g0overg1_hist->Draw();
sprintf(savename,"plots/M%s/BP_DB_Comp/diff_g0overg1_hist.png", module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy(); c1->SetLogy();
diff_g0overg1_hist->Draw(); diff_g0overg1_hist->Draw();
sprintf(savename,"plots/M%s/BP_DB_Comp/diff_g0overg1_hist_log.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/diff_g0overg1_hist_log.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
c1->SetLogy(0); c1->SetLogy(0);
diff_g0overg1_hist->Fit("gaus");
diff_g0overg1_hist->Draw();
sprintf(savename,"plots/M%s/BP_DB_Comp/diff_g0overg1_hist.png", module_str.c_str());
c1->SaveAs((const char *)(savename));
mapcanvas->cd(); mapcanvas->cd();
diff_g0overg1_map->GetXaxis()->SetTitle("Column"); diff_g0overg1_map->GetXaxis()->SetTitle("Column");
diff_g0overg1_map->GetYaxis()->SetTitle("Row"); diff_g0overg1_map->GetYaxis()->SetTitle("Row");
diff_g0overg1_map->GetYaxis()->SetTitleOffset(0.7); diff_g0overg1_map->GetYaxis()->SetTitleOffset(0.7);
diff_g0overg1_map->Draw("colz"); diff_g0overg1_map->Draw("colz");
diff_g0overg1_map->GetZaxis()->SetRangeUser(-20,20); diff_g0overg1_map->GetZaxis()->SetRangeUser(-5,5);
sprintf(savename,"plots/M%s/BP_DB_Comp/diff_g0overg1_map.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/diff_g0overg1_map.png", module_str.c_str());
mapcanvas->SaveAs((const char *)(savename)); mapcanvas->SaveAs((const char *)(savename));
@ -117,63 +135,95 @@ int main(int argc, char* argv[]) {
sprintf(savename,"plots/M%s/BP_DB_Comp/pull_hist.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/pull_hist.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
diff_g0overg1_e->SetLineColor(kBlue);
diff_g0overg1_ie->SetLineColor(kCyan);
diff_g0overg1_d->SetLineColor(kGreen+2);
diff_g0overg1_ntd->SetLineColor(kRed);
diff_g0overg1_q->SetLineColor(kOrange);
diff_g0overg1_e->Scale(1./diff_g0overg1_e->GetEntries());
diff_g0overg1_ie->Scale(1./diff_g0overg1_ie->GetEntries());
diff_g0overg1_d->Scale(1./diff_g0overg1_d->GetEntries());
diff_g0overg1_ntd->Scale(1./diff_g0overg1_ntd->GetEntries());
diff_g0overg1_q->Scale(1./diff_g0overg1_q->GetEntries());
diff_g0overg1_b->Scale(1./diff_g0overg1_b->GetEntries());
diff_g0overg1_d->GetXaxis()->SetTitle("(G0 / G1)_{DB} - (G0 / G1)_{BP}");
diff_g0overg1_d->Draw();
diff_g0overg1_e->Draw("same");
diff_g0overg1_ie->Draw("same");
diff_g0overg1_b->Draw("same");
diff_g0overg1_ntd->Draw("same");
//diff_g0overg1_q->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/diff_g0overg1_hist_byType.png", module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetRightMargin(0.2); c1->SetRightMargin(0.2);
// all TF1 *diag = new TF1("diag","[0]*x",-35,-25);
diag->SetParameter(0,1);
scat->GetXaxis()->SetTitle("(G0 / G1)_{DB}"); scat->GetXaxis()->SetTitle("(G0 / G1)_{DB}");
scat->GetYaxis()->SetTitle("(G0 / G1)_{BP}"); scat->GetYaxis()->SetTitle("(G0 / G1)_{BP}");
scat->GetYaxis()->SetTitleOffset(1.3); scat->GetYaxis()->SetTitleOffset(1.3);
scat->Draw("colz"); scat->Draw("colz");
diag->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/scat.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/scat.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
// edge pixels
scat_e->GetXaxis()->SetTitle("(G0 / G1)_{DB}"); scat_e->GetXaxis()->SetTitle("(G0 / G1)_{DB}");
scat_e->GetYaxis()->SetTitle("(G0 / G1)_{BP}"); scat_e->GetYaxis()->SetTitle("(G0 / G1)_{BP}");
scat_e->GetYaxis()->SetTitleOffset(1.3); scat_e->GetYaxis()->SetTitleOffset(1.3);
scat_e->Draw("colz"); scat_e->Draw("colz");
diag->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/scat_e.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/scat_e.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
// double pixels
scat_d->GetXaxis()->SetTitle("(G0 / G1)_{DB}"); scat_d->GetXaxis()->SetTitle("(G0 / G1)_{DB}");
scat_d->GetYaxis()->SetTitle("(G0 / G1)_{BP}"); scat_d->GetYaxis()->SetTitle("(G0 / G1)_{BP}");
scat_d->GetYaxis()->SetTitleOffset(1.3); scat_d->GetYaxis()->SetTitleOffset(1.3);
scat_d->Draw("colz"); scat_d->Draw("colz");
diag->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/scat_d.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/scat_d.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
// next to double pixels
scat_ntd->GetXaxis()->SetTitle("(G0 / G1)_{DB}"); scat_ntd->GetXaxis()->SetTitle("(G0 / G1)_{DB}");
scat_ntd->GetYaxis()->SetTitle("(G0 / G1)_{BP}"); scat_ntd->GetYaxis()->SetTitle("(G0 / G1)_{BP}");
scat_ntd->GetYaxis()->SetTitleOffset(1.3); scat_ntd->GetYaxis()->SetTitleOffset(1.3);
scat_ntd->Draw("colz"); scat_ntd->Draw("colz");
diag->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/scat_ntd.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/scat_ntd.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
// quad pixels
scat_q->GetXaxis()->SetTitle("(G0 / G1)_{DB}"); scat_q->GetXaxis()->SetTitle("(G0 / G1)_{DB}");
scat_q->GetYaxis()->SetTitle("(G0 / G1)_{BP}"); scat_q->GetYaxis()->SetTitle("(G0 / G1)_{BP}");
scat_q->GetYaxis()->SetTitleOffset(1.3); scat_q->GetYaxis()->SetTitleOffset(1.3);
scat_q->Draw("colz"); scat_q->Draw("colz");
diag->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/scat_q.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/scat_q.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
// inner edge pixels
scat_ie->GetXaxis()->SetTitle("(G0 / G1)_{DB}"); scat_ie->GetXaxis()->SetTitle("(G0 / G1)_{DB}");
scat_ie->GetYaxis()->SetTitle("(G0 / G1)_{BP}"); scat_ie->GetYaxis()->SetTitle("(G0 / G1)_{BP}");
scat_ie->GetYaxis()->SetTitleOffset(1.3); scat_ie->GetYaxis()->SetTitleOffset(1.3);
scat_ie->Draw("colz"); scat_ie->Draw("colz");
diag->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/scat_ie.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/scat_ie.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
// bulk pixels
scat_b->GetXaxis()->SetTitle("(G0 / G1)_{DB}"); scat_b->GetXaxis()->SetTitle("(G0 / G1)_{DB}");
scat_b->GetYaxis()->SetTitle("(G0 / G1)_{BP}"); scat_b->GetYaxis()->SetTitle("(G0 / G1)_{BP}");
scat_b->GetYaxis()->SetTitleOffset(1.3); scat_b->GetYaxis()->SetTitleOffset(1.3);
scat_b->Draw("colz"); scat_b->Draw("colz");
diag->Draw("same");
sprintf(savename,"plots/M%s/BP_DB_Comp/scat_b.png", module_str.c_str()); sprintf(savename,"plots/M%s/BP_DB_Comp/scat_b.png", module_str.c_str());
c1->SaveAs((const char *)(savename)); c1->SaveAs((const char *)(savename));
diff_DBer->GetXaxis()->SetTitle("(G0 / G1)_{DB} - (G0 / G1)_{BP}");
diff_DBer->GetYaxis()->SetTitle("#sigma_{(G0 / G1)_{DB}}");
diff_DBer->GetYaxis()->SetTitleOffset(1.3);
diff_DBer->Draw("colz");
sprintf(savename,"plots/M%s/BP_DB_Comp/diff_DBer.png", module_str.c_str());
c1->SaveAs((const char *)(savename));
} }