File indexing completed on 2025-08-05 08:12:06
0001 #include <vector>
0002 int eicsmear_dvmp_plot2()
0003 {
0004
0005
0006
0007
0008
0009
0010
0011
0012 TFile *input = new TFile("/sphenix/user/gregtom3/data/Fall2018/JPsi_reco_studies/theEvents.root","READ");
0013
0014
0015 TTree *t = (TTree*)input->Get("Tree");
0016 TH1F *h1_p_1 = new TH1F("h1_p_1","h1_p_1",100,-4,4);
0017 TH1F *h1_p_2 = new TH1F("h1_p_2","h1_p_2",100,0,50);
0018 TH1F *h1_p_3 = new TH1F("h1_p_3","h1_p_3",100,0,50);
0019 TH1F *h1_p_4 = new TH1F("h1_p_4","h1_p_4",100,0,50);
0020 TH2F* h2_p = new TH2F("h2_p","h2_p",200,-6,6,200,0,2);
0021
0022 BinLogY(h2_p);
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 t->Draw("2*18*se_p_reco*(1-cos(3.14159265-2*atan(exp(-se_eta_reco)))):jpsi_eta_reco>>h2_p","sp_p_truth>274","colz");
0034 h2_p->SetTitle("x vs. Q2 (18x275 Sartre DVMP Reco)");
0035 h2_p->GetXaxis()->SetTitle("Reco x");
0036 h2_p->GetYaxis()->SetTitle("Reco Q2");
0037
0038 }
0039
0040 void BinLogY(TH2F*h)
0041 {
0042
0043 TAxis *axis = h->GetYaxis();
0044 int bins = axis->GetNbins();
0045
0046 Axis_t from = axis->GetXmin();
0047 Axis_t to = axis->GetXmax();
0048 Axis_t width = (to - from) / bins;
0049 Axis_t *new_bins = new Axis_t[bins + 1];
0050
0051 for (int i = 0; i <= bins; i++) {
0052 new_bins[i] = TMath::Power(10, from + i * width);
0053 }
0054 axis->Set(bins, new_bins);
0055 delete new_bins;
0056 }
0057
0058 void BinLogX(TH2F*h)
0059 {
0060
0061 TAxis *axis = h->GetXaxis();
0062 int bins = axis->GetNbins();
0063
0064 Axis_t from = axis->GetXmin();
0065 Axis_t to = axis->GetXmax();
0066 Axis_t width = (to - from) / bins;
0067 Axis_t *new_bins = new Axis_t[bins + 1];
0068
0069 for (int i = 0; i <= bins; i++) {
0070 new_bins[i] = TMath::Power(10, from + i * width);
0071 }
0072 axis->Set(bins, new_bins);
0073 delete new_bins;
0074 }