Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cone_energies.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file cone_energies.C
1 
8 {
9  gStyle->SetOptStat(0);
10 
11  unsigned col1 = kOrange+7;
12  unsigned col2 = kBlue+2;
13 
14  /* open inout files and merge trees */
15  TChain chain("candidates");
16  chain.Add("data_3pions/p250_e20_0events_file1093_LeptoAna_r05.root");
17  chain.Add("data_3pions/p250_e20_0events_file1096_LeptoAna_r05.root");
18  chain.Add("data_3pions/p250_e20_0events_file1101_LeptoAna_r05.root");
19  chain.Add("data_3pions/p250_e20_0events_file1115_LeptoAna_r05.root");
20  chain.Add("data_3pions/p250_e20_0events_file1122_LeptoAna_r05.root");
21  chain.Add("data_3pions/p250_e20_0events_file1127_LeptoAna_r05.root");
22  chain.Add("data_3pions/p250_e20_0events_file1131_LeptoAna_r05.root");
23  chain.Add("data_3pions/p250_e20_0events_file1164_LeptoAna_r05.root");
24 
25  /* Create temporary canvas */
26  TCanvas* ctemp = new TCanvas();
27 
28  ctemp->cd();
29 
30  TH1F* h_uds = new TH1F( "prof_uds", "", 5, 0, 0.5);
31  h_uds->GetXaxis()->SetNdivisions(505);
32  TH1F* h_tau = new TH1F( "prof_tau", "", 5, 0, 0.5);
33 
34  for ( int r = 1; r <= 5; r++ )
35  {
36  /* particle selection */
37  TCut select_true_uds( Form( "jetshape_econe_r0%d * ( evtgen_is_uds==1 && abs(evtgen_uds_eta)<0.8 )", r ) );
38  TCut select_true_tau( Form( "jetshape_econe_r0%d * ( evtgen_is_tau==1 && evtgen_tau_decay_prong==3 && abs(evtgen_tau_eta)<0.8 )", r ) );
39 
40  chain.Draw( Form("0.9*(%f) >>+ prof_uds", r*0.1), select_true_uds );
41  chain.Draw( Form("0.9*(%f) >>+ prof_tau", r*0.1), select_true_tau );
42  }
43 
44  h_uds->Scale(1./h_uds->Integral());
45  h_uds->GetXaxis()->SetTitle( "#DeltaR" );
46  h_uds->GetYaxis()->SetRangeUser(0, 0.5);
47  h_uds->SetLineColor(col1);
48  h_uds->SetFillColor(col1);
49  h_uds->SetFillStyle(1001);
50 
51  h_tau->Scale(1./h_tau->Integral());
52  h_tau->SetLineColor(col2);
53  h_tau->SetFillColor(col2);
54  h_tau->SetFillStyle(0);
55 
56  /* create Canvas and draw histograms */
57  TCanvas *c1 = new TCanvas();
58 
59  h_uds->DrawClone("");
60  h_tau->DrawClone("sames");
61 
62  gPad->RedrawAxis();
63 
64  c1->Print("plots/cone_energies.eps");
65  c1->Print("plots/cone_energies.png");
66 
67  return 0;
68 }