Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
calo_towers.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file calo_towers.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_tower("ntp_tower");
10  chain_tower.Add("data_3pions/p250_e20_0events_file1093_LeptoAna_r05.root");
11  chain_tower.Add("data_3pions/p250_e20_0events_file1096_LeptoAna_r05.root");
12  chain_tower.Add("data_3pions/p250_e20_0events_file1101_LeptoAna_r05.root");
13  chain_tower.Add("data_3pions/p250_e20_0events_file1115_LeptoAna_r05.root");
14  chain_tower.Add("data_3pions/p250_e20_0events_file1122_LeptoAna_r05.root");
15  chain_tower.Add("data_3pions/p250_e20_0events_file1127_LeptoAna_r05.root");
16  chain_tower.Add("data_3pions/p250_e20_0events_file1131_LeptoAna_r05.root");
17  chain_tower.Add("data_3pions/p250_e20_0events_file1164_LeptoAna_r05.root");
18 
19  TCut select_tower_tau("tower_e * (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_tower_uds("tower_e * (is_tau==0 && abs(jet_eta) < 1.0 && jet_etotal>5)");
22 
23  /* EMCal segmentation eta-phi: 0.025 x 0.025, cover 1.1 in eta, 96 x 256 towers
24  * HCAL segmentation eta-phi: 0.1 x 0.1 */
25  int nbins = 10;
26  float maxmin = 0.5;
27 
28  TH2F* h2_calo_tau = new TH2F("h2_calo_tau", ";#Delta#phi;#Delta#eta;E/#SigmaE", nbins, -maxmin, maxmin, nbins, -maxmin, maxmin );
29  h2_calo_tau->SetLineColor( col2 );
30  h2_calo_tau->GetXaxis()->SetNdivisions(505);
31  h2_calo_tau->GetYaxis()->SetNdivisions(505);
32  h2_calo_tau->GetZaxis()->SetNdivisions(505);
33  h2_calo_tau->GetZaxis()->SetTitleOffset(1.35);
34  chain_tower.Draw("( tower_eta - jet_eta ) : ( tower_phi - jet_phi ) >> h2_calo_tau",select_tower_tau);
35  h2_calo_tau->Scale( 1. / h2_calo_tau->Integral() );
36  //h2_calo_tau->GetZaxis()->SetRangeUser(0,0.04);
37 
38  TH2F* h2_calo_uds = new TH2F("h2_calo_uds", ";#Delta#phi;#Delta#eta;E/#SigmaE", nbins, -maxmin, maxmin, nbins, -maxmin, maxmin );
39  h2_calo_uds->SetLineColor( col1 );
40  h2_calo_uds->GetXaxis()->SetNdivisions(505);
41  h2_calo_uds->GetYaxis()->SetNdivisions(505);
42  h2_calo_uds->GetZaxis()->SetNdivisions(505);
43  h2_calo_uds->GetZaxis()->SetTitleOffset(1.35);
44  chain_tower.Draw("( tower_eta - jet_eta ) : ( tower_phi - jet_phi ) >> h2_calo_uds",select_tower_uds);
45  h2_calo_uds->Scale( 1. / h2_calo_uds->Integral() );
46  //h2_calo_uds->GetZaxis()->SetRangeUser(0,0.04);
47 
48  /* plot histograms */
49  TCanvas *c1 = new TCanvas();
50  //c1->SetRightMargin(1.5);
51  h2_calo_tau->Draw("lego");
52  c1->Print("plots/calo_towers_2d_tau.eps");
53  c1->Print("plots/calo_towers_2d_tau.png");
54 
55  TCanvas *c2 = new TCanvas();
56  //c2->SetRightMargin(1.5);
57  h2_calo_uds->Draw("lego");
58  c2->Print("plots/calo_towers_2d_uds.eps");
59  c2->Print("plots/calo_towers_2d_uds.png");
60 
61  //TCanvas *c3 = new TCanvas();
62  //chain_tower.Draw("sqrt( ( tower_eta - jet_eta ) * ( tower_eta - jet_eta ) + ( tower_phi - jet_phi ) * ( tower_phi - jet_phi ) ) >> htest_uds", select_tower_uds);
63 }