From 030c6ee0d779d936b58a36d719cfa893cc0505d3 Mon Sep 17 00:00:00 2001 From: "Blair D. Seidlitz" Date: Fri, 8 Dec 2023 10:13:02 -0500 Subject: [PATCH] random update --- .../macros/figMaker/figmaker.C | 105 +++++++++++++++++- .../macros/slideMaker/comb.tex | 4 +- Calo_Validation_Package/src/CaloAna.cc | 26 +++++ Calo_Validation_Package/src/CaloAna.h | 5 + 4 files changed, 137 insertions(+), 3 deletions(-) diff --git a/Calo_Validation_Package/macros/figMaker/figmaker.C b/Calo_Validation_Package/macros/figMaker/figmaker.C index f57e7a502..c8a60249a 100644 --- a/Calo_Validation_Package/macros/figMaker/figmaker.C +++ b/Calo_Validation_Package/macros/figMaker/figmaker.C @@ -34,6 +34,8 @@ void figmaker(){ SetsPhenixStyle(); + int totalEvents = 0; + std::ifstream infile("../condor/runList.txt"); if (!infile) { std::cerr << "Error: Unable to open the file\n"; return 1;} std::vector runList; @@ -42,7 +44,7 @@ void figmaker(){ int Nruns= runList.size(); - for (int ir=0; irGet("hzdcSouthcalib"); TH2F* h_etaphi_clus = (TH2F*) fin->Get("h_etaphi_clus" ); TH1F* hvtx_z_raw = (TH1F*) fin->Get("hvtx_z_raw"); + TProfile2D* h_cemc_etaphi_time = (TProfile2D*) fin->Get("h_cemc_etaphi_time"); + TProfile2D* h_ihcal_etaphi_time = (TProfile2D*) fin->Get("h_ihcal_etaphi_time"); + TProfile2D* h_ohcal_etaphi_time = (TProfile2D*) fin->Get("h_ohcal_etaphi_time"); + + TH2F* h_cemc_e_chi2 = (TH2F*) fin->Get("h_cemc_e_chi2"); + TH2F* h_ohcal_e_chi2 = (TH2F*) fin->Get("h_ohcal_e_chi2"); + TH2F* h_ihcal_e_chi2 = (TH2F*) fin->Get("h_ihcal_e_chi2"); TCanvas* c1 = new TCanvas("c1", "c1", 400, 400); h_emcal_mbd_correlation ->Draw("COLZ"); @@ -276,6 +285,8 @@ void figmaker(){ c15->SaveAs(Form("../plots/etaphi_clus_%d.pdf",run)); + totalEvents += hvtx_z_raw->GetEntries(); + int events = hvtx_z_raw->GetEntries(); TCanvas* c16 = new TCanvas("c16", "c16", 400, 400); hvtx_z_raw ->Draw("COLZ"); @@ -283,6 +294,7 @@ void figmaker(){ hvtx_z_raw ->SetYTitle("Events"); myText(0.22, 0.9, 1, "#it{#bf{sPHENIX}} Internal"); myText(0.22, 0.85, 1, Form("run %d", run)); + myText(0.22, 0.80, 1, Form("events %d", events)); c16->SaveAs(Form("../plots/vtx_z_%d.pdf",run)); @@ -312,12 +324,103 @@ void figmaker(){ c17->SaveAs(Form("../plots/zdc_e_northSouth_1n_%d.pdf",run)); + TCanvas* c18 = new TCanvas("c18", "c18", 400, 400); + h_cemc_etaphi_time->Draw("COLZ"); + h_cemc_etaphi_time->SetXTitle("#it{#eta}_{i} EMCal"); + h_cemc_etaphi_time->SetYTitle("#it{#phi}_{i} EMCal"); + h_cemc_etaphi_time->GetXaxis()->SetNdivisions(505); + + myText(0.22, 0.9, 1, "#it{#bf{sPHENIX}} Internal"); + myText(0.22, 0.85, 1, Form("run %d", run)); + myText(0.22, 0.80, 1, "mean hit peak time EMCal"); + gPad->SetRightMargin(0.15); + + c18->SaveAs(Form("../plots/cemc_etaphi_time%d.pdf",run)); + + TCanvas* c19 = new TCanvas("c19", "c19", 400, 400); + h_ohcal_etaphi_time->Draw("COLZ"); + h_ohcal_etaphi_time->SetXTitle("#it{#eta}_{i} oHcal"); + h_ohcal_etaphi_time->SetYTitle("#it{#phi}_{i} oHcal"); + h_ohcal_etaphi_time->GetXaxis()->SetNdivisions(505); + + myText(0.22, 0.9, 1, "#it{#bf{sPHENIX}} Internal"); + myText(0.22, 0.85, 1, Form("run %d", run)); + myText(0.22, 0.80, 1, "mean hit peak time Outter HCal"); + gPad->SetRightMargin(0.15); + + c19->SaveAs(Form("../plots/ohcal_etaphi_time%d.pdf",run)); + + + TCanvas* c20 = new TCanvas("c20", "c20", 400, 400); + h_ihcal_etaphi_time->Draw("COLZ"); + h_ihcal_etaphi_time->SetXTitle("#it{#eta}_{i} iHcal"); + h_ihcal_etaphi_time->SetYTitle("#it{#phi}_{i} iHcal"); + h_ihcal_etaphi_time->GetXaxis()->SetNdivisions(505); + + myText(0.22, 0.9, 1, "#it{#bf{sPHENIX}} Internal"); + myText(0.22, 0.85, 1, Form("run %d", run)); + myText(0.22, 0.80, 1, "mean hit peak time Inner HCal"); + gPad->SetRightMargin(0.15); + + c20->SaveAs(Form("../plots/ihcal_etaphi_time%d.pdf",run)); + + TCanvas* c21 = new TCanvas("c21", "c21", 400, 400); + h_ihcal_e_chi2->Draw("COLZ"); + h_ihcal_e_chi2->SetXTitle("#i{E} [GeV] iHcal"); + h_ihcal_e_chi2->SetYTitle("chi2 iHcal"); + h_ihcal_e_chi2->GetXaxis()->SetNdivisions(505); + h_ihcal_e_chi2->GetXaxis()->SetRangeUser(-1,2); + gPad->SetLogy(); + gPad->SetLogz(); + + myText(0.52, 0.9, 1, "#it{#bf{sPHENIX}} Internal"); + myText(0.52, 0.85, 1, Form("run %d", run)); + myText(0.52, 0.80, 1, "Inner HCal"); + gPad->SetRightMargin(0.15); + + c21->SaveAs(Form("../plots/ihcal_e_chi2%d.pdf",run)); + + TCanvas* c22 = new TCanvas("c22", "c22", 400, 400); + h_ohcal_e_chi2->Draw("COLZ"); + h_ohcal_e_chi2->SetXTitle("#i{E} [GeV] oHcal"); + h_ohcal_e_chi2->SetYTitle("chi2 oHcal"); + h_ohcal_e_chi2->GetXaxis()->SetNdivisions(505); + h_ohcal_e_chi2->GetXaxis()->SetRangeUser(-1,7); + gPad->SetLogy(); + gPad->SetLogz(); + + myText(0.52, 0.9, 1, "#it{#bf{sPHENIX}} Internal"); + myText(0.52, 0.85, 1, Form("run %d", run)); + myText(0.52, 0.80, 1, "Outer HCal"); + gPad->SetRightMargin(0.15); + + c22->SaveAs(Form("../plots/ohcal_e_chi2%d.pdf",run)); + + + TCanvas* c23 = new TCanvas("c23", "c23", 400, 400); + h_cemc_e_chi2->Draw("COLZ"); + h_cemc_e_chi2->SetXTitle("#i{E} [GeV] EMCal "); + h_cemc_e_chi2->SetYTitle("chi2 oHcal"); + h_cemc_e_chi2->GetXaxis()->SetNdivisions(505); + h_cemc_e_chi2->GetXaxis()->SetRangeUser(-1,15); + gPad->SetLogy(); + gPad->SetLogz(); + + myText(0.52, 0.9, 1, "#it{#bf{sPHENIX}} Internal"); + myText(0.52, 0.85, 1, Form("run %d", run)); + myText(0.52, 0.80, 1, "EMCal"); + gPad->SetRightMargin(0.15); + + c22->SaveAs(Form("../plots/cemc_e_chi2%d.pdf",run)); + } for (int ir=0; irgetTowerEtaBin(towerkey); int iphi = towers->getTowerPhiBin(towerkey); int _time = tower->get_time(); + h_cemc_e_chi2->Fill( offlineenergy,tower->get_chi2()); float _timef = tower->get_time_float(); hemcaltime_cut->Fill(_time); bool isGood = ! (tower->get_isBadChi2()); @@ -264,6 +271,7 @@ int CaloAna::process_towers(PHCompositeNode* topNode) int _time = tower->get_time(); float _timef = tower->get_time_float(); hihcaltime_cut->Fill(_time); + h_ihcal_e_chi2->Fill( offlineenergy,tower->get_chi2()); bool isGood = !(tower->get_isBadChi2()); if (_time > (max_ihcal_t - _range) && _time < (max_ihcal_t + _range)) { @@ -302,6 +310,7 @@ int CaloAna::process_towers(PHCompositeNode* topNode) float _timef = tower->get_time_float(); hihcaltime_cut->Fill(_time); hohcaltime_cut->Fill(_time); + h_ohcal_e_chi2->Fill( offlineenergy,tower->get_chi2()); bool isGood = !(tower->get_isBadChi2()); if (_time > (max_ohcal_t - _range) && _time < (max_ohcal_t + _range)) @@ -585,3 +594,20 @@ int CaloAna::Getpeaktime(TH1* h) return tcut; } + + + +TH2F* LogYHist2D(const char* name, const char* title, int xbins_in, double_t xmin, double_t xmax, int ybins_in, double_t ymin, double_t ymax) { + Double_t logymin = TMath::Log10(ymin); + Double_t logymax = TMath::Log10(ymax); + Double_t binwidth = (logymax - logymin) / ybins_in; + Double_t ybins[ybins_in + 1]; + + for (Int_t i = 0; i <= ybins_in + 1; i++) + ybins[i] = TMath::Power(10, logymin + i * binwidth); + + TH2F* h = new TH2F(name, title, xbins_in, xmin, xmax, ybins_in, ybins); + + return h; +} + diff --git a/Calo_Validation_Package/src/CaloAna.h b/Calo_Validation_Package/src/CaloAna.h index c24947b25..515ea7887 100644 --- a/Calo_Validation_Package/src/CaloAna.h +++ b/Calo_Validation_Package/src/CaloAna.h @@ -37,6 +37,7 @@ class CaloAna : public SubsysReco int process_towers(PHCompositeNode *); int process_clusters(PHCompositeNode *); + void Detector(const std::string &name) { detector = name; } void set_timing_cut_width(const int &t) { _range = t;} void set_vertex_cut(const float &v) { _vz = v;} @@ -68,6 +69,10 @@ class CaloAna : public SubsysReco TProfile2D* h_hcalin_etaphi_time = nullptr; TProfile2D* h_hcalout_etaphi_time = nullptr; + TH2F* h_cemc_e_chi2 = nullptr; + TH2F* h_ohcal_e_chi2 = nullptr; + TH2F* h_ihcal_e_chi2 = nullptr; + TProfile2D* h_cemc_etaphi_badChi2 = nullptr; TProfile2D* h_hcalin_etaphi_badChi2 = nullptr; TProfile2D* h_hcalout_etaphi_badChi2 = nullptr;