2 const TString
infile =
"../../data/Sample_DISReco_ep.root",
4 const bool save_figures =
true
7 gStyle->SetOptStat(kFALSE);
9 TFile *f_truth =
new TFile(
infile,
"OPEN");
10 TTree* t_truth = (TTree*)f_truth->Get(
"event_truth");
13 TCut electron_cut =
"em_evtgen_pid == 11";
14 TCut Pion_cut =
"abs( em_evtgen_pid ) == 211";
16 TH1F *h_eta =
new TH1F(
"h_eta",
"", 60, -6, 6);
17 TH1F *h_eta_e = (TH1F*)h_eta->Clone();
19 TCanvas *c_eta =
new TCanvas(
"c_eta");
21 t_truth->Draw(
"-1 * log( tan( em_evtgen_theta / 2.0 ) ) >> h_eta", Pion_cut);
22 h_eta->SetLineStyle(2);
23 t_truth->Draw(
"-1 * log( tan( em_evtgen_theta / 2.0 ) ) >> h_eta_e", electron_cut,
"sames");
25 h_eta->GetXaxis()->SetTitle(
"Pseudorapidity #eta");
26 h_eta->GetYaxis()->SetTitle(
"dN/d#eta");
28 TLegend* leg_eta =
new TLegend( 0.25, 0.70, 0.45, 0.90);
29 leg_eta->AddEntry(h_eta,
"Charged Pions",
"L");
30 leg_eta->AddEntry(h_eta_e,
"Electrons",
"L");
35 c_eta->Print(
"plots/truth_EtaDistribution.eps");
36 c_eta->Print(
"plots/truth_EtaDistribution.png");