Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tracks.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file tracks.C
2 {
3  gStyle->SetOptStat(0);
4 
5  unsigned col1 = kOrange+7;
6  unsigned col2 = kBlue+2;
7 
8  /* open inout files and merge trees */
9  TChain chain_track("ntp_track");
10  chain_track.Add("data_3pions/p250_e20_0events_file1093_LeptoAna_r05.root");
11  chain_track.Add("data_3pions/p250_e20_0events_file1096_LeptoAna_r05.root");
12  chain_track.Add("data_3pions/p250_e20_0events_file1101_LeptoAna_r05.root");
13  chain_track.Add("data_3pions/p250_e20_0events_file1115_LeptoAna_r05.root");
14  chain_track.Add("data_3pions/p250_e20_0events_file1122_LeptoAna_r05.root");
15  chain_track.Add("data_3pions/p250_e20_0events_file1127_LeptoAna_r05.root");
16  chain_track.Add("data_3pions/p250_e20_0events_file1131_LeptoAna_r05.root");
17  chain_track.Add("data_3pions/p250_e20_0events_file1164_LeptoAna_r05.root");
18 
19  TCut select_tracks_tau("1 * (is_tau==1 && abs(jet_eta) < 1.0 && jet_etotal>5 && sqrt( (tau_eta-jet_eta)*(tau_eta-jet_eta) + (tau_phi-jet_phi)*(tau_phi-jet_phi) ) < 0.1)");
20 
21  TCut select_tracks_uds("1 * (is_tau==0 && abs(jet_eta) < 1.0 && jet_etotal>5)");
22 
23  TH2F* h2_tracks_tau = new TH2F("h2_tracks_tau", ";#Delta#phi;#Delta#eta;N/#SigmaN", 40, -0.2, 0.2, 40, -0.2, 0.2 );
24  h2_tracks_tau->SetLineColor( col2 );
25  h2_tracks_tau->GetXaxis()->SetNdivisions(505);
26  h2_tracks_tau->GetYaxis()->SetNdivisions(505);
27  h2_tracks_tau->GetZaxis()->SetNdivisions(505);
28  h2_tracks_tau->GetZaxis()->SetTitleOffset(1.35);
29  chain_track.Draw("( track_eta - jet_eta ) : ( track_phi - jet_phi ) >> h2_tracks_tau",select_tracks_tau);
30  h2_tracks_tau->Scale( 1. / h2_tracks_tau->Integral() );
31 
32  TH2F* h2_tracks_uds = new TH2F("h2_tracks_uds", ";#Delta#phi;#Delta#eta;N/#SigmaN", 40, -0.2, 0.2, 40, -0.2, 0.2 );
33  h2_tracks_uds->SetLineColor( col1 );
34  h2_tracks_uds->GetXaxis()->SetNdivisions(505);
35  h2_tracks_uds->GetYaxis()->SetNdivisions(505);
36  h2_tracks_uds->GetZaxis()->SetNdivisions(505);
37  h2_tracks_uds->GetZaxis()->SetTitleOffset(1.35);
38  chain_track.Draw("( track_eta - jet_eta ) : ( track_phi - jet_phi ) >> h2_tracks_uds",select_tracks_uds);
39  h2_tracks_uds->Scale( 1. / h2_tracks_uds->Integral() );
40 
41  /* plot histograms */
42  TCanvas *c1 = new TCanvas();
43  h2_tracks_tau->Draw("lego");
44  c1->Print("plots/tracks_2d_tau.eps");
45  c1->Print("plots/tracks_2d_tau.png");
46 
47  TCanvas *c2 = new TCanvas();
48  h2_tracks_uds->Draw("lego");
49  c2->Print("plots/tracks_2d_uds.eps");
50  c2->Print("plots/tracks_2d_uds.png");
51 }