4 gSystem->Load(
"libeicsmear");
7 TFile *file_mc =
new TFile(
"/gpfs/mnt/gpfs04/sphenix/user/nfeege/data/TEST/pythia.ep.27.5x820.1Mevents.RadCor=0.Q2gt1.root");
10 TTree *
tree = (TTree*)file_mc->Get(
"EICTree");
13 TFile *
fout =
new TFile(
"hera_dis_histo.root",
"RECREATE");
15 erhic::EventPythia *
event = NULL;
17 tree->SetBranchAddress(
"event", &
event);
25 const int nbins_x = 10;
26 const int nbins_Q2 = 10;
28 const int hn_dis_ndim = 2;
29 int hn_dis_nbins[] = { nbins_x,
31 double hn_dis_xmin[] = {0., 0. };
32 double hn_dis_xmax[] = {0., 0. };
34 THnSparse* hn_dis =
new THnSparseF(
"hn_dis",
35 "DIS Kinematis; x; Q2;",
41 hn_dis->GetAxis(0)->SetName(
"x");
42 hn_dis->GetAxis(1)->SetName(
"Q2");
46 double width_x = (max_x - min_x) / nbins_x;
47 double bins_x[nbins_x+1];
48 for(
int i =0;
i <= nbins_x;
i++)
50 cout << TMath::Power( 10, min_x +
i*width_x) << endl;
51 bins_x[
i] = TMath::Power( 10, min_x +
i*width_x);
56 double width_Q2 = (max_Q2 - min_Q2) / nbins_Q2;
57 double bins_Q2[nbins_Q2+1];
58 for(
int i =0;
i <= nbins_Q2;
i++)
59 bins_Q2[
i] = TMath::Power( 10, min_Q2 +
i*width_Q2);
61 hn_dis->SetBinEdges(0,bins_x);
62 hn_dis->SetBinEdges(1,bins_Q2);
65 TH2F* hxQ2 = (TH2F*)hn_dis->Projection(1,0);
66 for (
int bin_x = 1; bin_x <= hxQ2->GetNbinsX(); bin_x++ )
69 for (
int bin_y = 1; bin_y <= hxQ2->GetNbinsY(); bin_y++ )
71 cout <<
"x = " << TMath::Power(10, 0.5 * ( ( TMath::Log10( hxQ2->GetXaxis()->GetBinLowEdge(bin_x) ) )
72 + ( TMath::Log10( hxQ2->GetXaxis()->GetBinLowEdge(bin_x) + hxQ2->GetXaxis()->GetBinWidth(bin_x) ) ) ) ) << endl;
74 cout <<
"Q2 = " << TMath::Power(10, 0.5 * ( ( TMath::Log10( hxQ2->GetYaxis()->GetBinLowEdge(bin_y) ) )
75 + ( TMath::Log10( hxQ2->GetYaxis()->GetBinLowEdge(bin_y) + hxQ2->GetYaxis()->GetBinWidth(bin_y) ) ) ) ) << endl;
80 for (
unsigned ievent = 0; ievent < tree->GetEntries(); ievent++ )
82 if ( ievent%1000 == 0 )
83 cout <<
"Processing event " << ievent << endl;
86 tree->GetEntry(ievent);
90 if (
event->ScatteredLepton()->GetE() < Emin )
93 if (
event->ScatteredLepton()->GetTheta() >= ( 177./ 180. * TMath::Pi() ) )
97 float x =
event->GetTrueX();
98 float Q2 =
event->GetTrueQ2();
99 float y =
event->GetTrueY();
104 if ( y >= 0.9 || y <= 0.01 )
108 double fill_hn_dis[] = {
x, Q2};
109 hn_dis->Fill( fill_hn_dis );