3 const TString
infile =
"data/pythia.ep.100.test.root"
6 gStyle->SetOptStat(kFALSE);
8 TFile *f_pyth =
new TFile(
infile,
"OPEN");
9 TTree* T_pyth = (TTree*)f_pyth->Get(
"tree");
12 TCut electron_cut =
"p.fKF == 11";
13 TCut Pion_cut =
"abs(p.fKF) == 211 || p.fKF == 111";
15 TH1F *h_eta =
new TH1F(
"h_eta",
"", 60, -6, 6);
16 TH1F *h_eta_e = (TH1F*)h_eta->Clone();
17 TCanvas *c_eta =
new TCanvas(
"c_eta");
19 tree->Draw(
"TMath::ASinH(p.fPz/sqrt(((p.fPx)**2 + (p.fPy)**2)))>>h_eta", Pion_cut);
20 h_eta->SetLineStyle(2);
21 tree->Draw(
"TMath::ASinH(p.fPz/sqrt(((p.fPx)**2 + (p.fPy)**2)))>>h_eta_e", electron_cut &&
"p.fParent == 0",
"same");
23 h_eta->GetXaxis()->SetTitle(
"Pseudorapidity #eta");
24 h_eta->GetYaxis()->SetTitle(
"dN/d#eta");
26 TLegend* leg_eta =
new TLegend( 0.25, 0.70, 0.45, 0.90);
27 leg_eta->AddEntry(h_eta,
"Pions",
"L");
28 leg_eta->AddEntry(h_eta_e,
"Electrons",
"L");
31 c_eta->Print(
"EtaDistributions.eps");
32 c_eta->Print(
"EtaDistributions.png");