Skip to content

Commit

Permalink
random update
Browse files Browse the repository at this point in the history
  • Loading branch information
Blair D. Seidlitz committed Dec 8, 2023
1 parent e89570e commit 030c6ee
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 3 deletions.
105 changes: 104 additions & 1 deletion Calo_Validation_Package/macros/figMaker/figmaker.C
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> runList;
Expand All @@ -42,7 +44,7 @@ void figmaker(){

int Nruns= runList.size();

for (int ir=0; ir<Nruns; ir++){
for (int ir=0; ir<2; ir++){

int run = runList[ir];

Expand All @@ -61,6 +63,13 @@ void figmaker(){
TH1F* hzdcSouthcalib = (TH1F*) fin->Get("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");
Expand Down Expand Up @@ -276,13 +285,16 @@ 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");
hvtx_z_raw ->SetXTitle("MBD Vertex #it{z} [cm]");
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));

Expand Down Expand Up @@ -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; ir<Nruns; ir++){
cout << runList[ir] << ",";
}
cout << endl;
cout << "total events=" << totalEvents <<endl;
cout << endl;

}

Expand Down
4 changes: 2 additions & 2 deletions Calo_Validation_Package/macros/slideMaker/comb.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
\makeatother

\begin{frame}{Reconstruction Validation}

total events=34562205 with MBD vertex

\end{frame}

\newcommand{\p}{../plots/}

\foreach \n in {20859,20864,20867,20868,20869,20876,20877,20878,20880,20883,20885,20888,21199,21200,21560,21561,21562,21564,21565,21567,21568,21578,21579,21580,21581,21584,21587,21589,21594,21598,21599,21608,21609,21615,21616,21626,21627,21733,21739,21740,21744,21745,21747,21748,21750,21751,21754,21769,21770,21772,21774,21776,21778,21780,21782,21783,21785,21787,21788,21792,21793,21795,21796,21798,21923,21928,21933,21936,21939,21950,22026,22027,22033,22034,22037,22046,22055,22911,22946,22948,23020,23049,23050,23051,23052,23053,23055,23058,23059,23060,23536,23537,23539,23543,23547,23550,23552,23557,23558,23561,23562,23563,23566,23568,23572,23574,23575,23582,23590,23592,23594,23604,23605,23617,23618,23619,23671,23672,23676,23681,23682,23687,23690,23693,23694,23695,23696,23697,23699,23702,23714,23718,23721,23722,23723,23724,23725,23726,23727,23728,23735,23737,23738,23739,23740,23743,23745,23746,23761,24316,21813,21891,21979,22949,22951,22982,21518,21520,21889,21889}{
\foreach \n in {20859,20864,20867,20868,20869,20876,20877,20878,20880,20883,20885,20888,21199,21200,21518,21520,21560,21561,21562,21564,21565,21567,21568,21578,21579,21580,21581,21584,21587,21589,21594,21598,21599,21608,21609,21615,21616,21626,21627,21663,21665,21674,21678,21679,21681,21682,21683,21703,21704,21705,21707,21709,21719,21733,21739,21740,21744,21745,21747,21748,21750,21751,21754,21769,21770,21772,21774,21776,21778,21780,21782,21783,21785,21787,21788,21792,21793,21795,21796,21798,21813,21889,21891,22026,22027,22033,22034,22037,22046,22946,22948,22949,22950,22951,22979,22982,23020,23049,23050,23051,23052,23053,23055,23058,23059,23060,23536,23537,23539,23543,23547,23550,23552,23557,23558,23561,23562,23563,23566,23568,23572,23574,23575,23582,23590,23592,23594,23604,23605,23617,23618,23619,23671,23672,23676,23681,23682,23687,23690,23693,23694,23695,23696,23697,23699,23702,23714,23718,23721,23722,23723,23724,23725,23726,23727,23728,23735,23737,23738,23739,23740,23743,23745,23746,23761,24316}{

\begin{frame}{run \n \, correlations}

Expand Down
26 changes: 26 additions & 0 deletions Calo_Validation_Package/src/CaloAna.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#include <sstream>
#include <string>

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);

using namespace std;

CaloAna::CaloAna(const std::string& name, const std::string& filename)
Expand Down Expand Up @@ -90,6 +92,10 @@ int CaloAna::Init(PHCompositeNode*)
h_hcalin_etaphi_wQA = new TH2F("h_ihcal_etaphi_wQA", ";eta;phi", 24, 0, 24, 64, 0, 64);
h_hcalout_etaphi_wQA = new TH2F("h_ohcal_etaphi_wQA", ";eta;phi", 24, 0, 24, 64, 0, 64);

h_cemc_e_chi2 = LogYHist2D("h_cemc_e_chi2", "", 500,-2,30, 1000, 0.5, 5e6);
h_ihcal_e_chi2 = LogYHist2D("h_ihcal_e_chi2", "", 500,-2,30, 1000, 0.5, 5e6);
h_ohcal_e_chi2 = LogYHist2D("h_ohcal_e_chi2", "", 500,-2,30, 1000, 0.5, 5e6);

h_cemc_etaphi_time = new TProfile2D("h_cemc_etaphi_time", ";eta;phi", 96, 0, 96, 256, 0, 256,-10,10);
h_hcalin_etaphi_time = new TProfile2D("h_ihcal_etaphi_time", ";eta;phi", 24, 0, 24, 64, 0, 64 ,-10,10);
h_hcalout_etaphi_time = new TProfile2D("h_ohcal_etaphi_time", ";eta;phi", 24, 0, 24, 64, 0, 64 ,-10,10);
Expand Down Expand Up @@ -219,6 +225,7 @@ int CaloAna::process_towers(PHCompositeNode* topNode)
int ieta = towers->getTowerEtaBin(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());
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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;
}

5 changes: 5 additions & 0 deletions Calo_Validation_Package/src/CaloAna.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 030c6ee

Please sign in to comment.