Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compare_observables.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file compare_observables.C
1 #include "tau_commons.h"
2 
9 {
10  gStyle->SetOptStat(0);
11 
12  unsigned col1 = kOrange+7;
13  unsigned col2 = kBlue+2;
14 
15 
16  string type = "DIScharged";
17  string seed[7] = {"1","2","3","6","7","8","9","10"};
18  string R_max = "5";
19  /* open inout files and merge trees */
20  TChain chain("event");
21 
22  for (int g = 0; g<seed->size();g++){
23  if(g==4 || g==5) continue;
24  string file = "/gpfs/mnt/gpfs02/phenix/scratch/spjeffas/data/LeptoAna_p250_e20_100events_"+seed[g]+"seed_"+type+"_tau_r0"+R_max+".root";
25  chain.Add(file.c_str());
26  }
27 
28 
29  /* particle selection */
30  //TCut select_prong("tracks_count_r02 == 3 && tracks_chargesum_r02 == -1");
31  //TCut select_prong("tracks_count_r04 == 3");
32  TCut select_prong("1");
33 
34  /* Create temporary canvas */
35  TCanvas* ctemp = new TCanvas();
36 
37  vector< TString > observables;
38  vector< TString > observables_name;
39 
40  vector< float > plots_ymax;
41  vector< float > plots_xmin;
42  vector< float > plots_xmax;
43 
44  /* R_max */
45  observables.push_back( "tracks_rmax_r04" );
46  observables_name.push_back( "R_{track}^{max}" );
47  plots_ymax.push_back(0.06);
48  plots_xmin.push_back(0);
49  plots_xmax.push_back(0.5);
50 
51  /* Number of tracks */
52  observables.push_back( "tracks_count_r04" );
53  observables_name.push_back( "N_{tracks}" );
54  plots_ymax.push_back(0.9);
55  plots_xmin.push_back(0);
56  plots_xmax.push_back(10);
57 
58  /* Charge sum from tracks */
59  observables.push_back( "tracks_chargesum_r04" );
60  observables_name.push_back( "#Sigma q_{tracks}" );
61  plots_ymax.push_back(0.9);
62  plots_xmin.push_back(-5);
63  plots_xmax.push_back(5);
64 
65  /* Jet radius */
66  observables.push_back( "jetshape_radius" );
67  observables_name.push_back( "R_{jet}" );
68  plots_ymax.push_back(0.08);
69  plots_xmin.push_back(0);
70  plots_xmax.push_back(0.5);
71 
72  /* Jetshape */
73  observables.push_back( "jetshape_econe_r01 / jetshape_econe_r05" );
74  observables_name.push_back( "E_{cone}^{R<0.1} / E_{cone}^{R<0.5}" );
75  plots_ymax.push_back(0.08);
76  plots_xmin.push_back(0);
77  plots_xmax.push_back(1);
78 
79  /* Jetshape */
80  observables.push_back( "jetshape_econe_r02 / jetshape_econe_r05" );
81  observables_name.push_back( "E_{cone}^{R<0.2} / E_{cone}^{R<0.5}" );
82  plots_ymax.push_back(0.08);
83  plots_xmin.push_back(0);
84  plots_xmax.push_back(1);
85 
86  /* Jet eta */
87  observables.push_back( "jet_eta" );
88  observables_name.push_back( "#eta_{jet}" );
89  plots_ymax.push_back(0.1);
90  plots_xmin.push_back(-2);
91  plots_xmax.push_back(2);
92 
93  /* Jet mass */
94  observables.push_back( "jet_minv" );
95  observables_name.push_back( "Mass_{jet}" );
96  plots_ymax.push_back(0.1);
97  plots_xmin.push_back(0);
98  plots_xmax.push_back(10);
99 
100  /* Jet energy */
101  observables.push_back( "jet_etotal" );
102  observables_name.push_back( "E_{jet}" );
103  plots_ymax.push_back(0.08);
104  plots_xmin.push_back(0);
105  plots_xmax.push_back(70);
106 
107  /* Plot distributions */
108  TString name_uds_base("h_uds_");
109  TString name_tau_base("h_tau_");
110  /*
111  for ( unsigned i = 0; i < observables.size(); i++ )
112  {
113  cout << "Plotting " << observables.at(i) << endl;
114 
115  ctemp->cd();
116 
117  TString name_uds_i = name_uds_base;
118  name_uds_i.Append(i);
119 
120  TString name_tau_i = name_tau_base;
121  name_tau_i.Append(i);
122 
123  TH1F* h_uds = new TH1F( name_uds_i, "", 100, plots_xmin.at(i), plots_xmax.at(i));
124  TH1F* h_tau = new TH1F( name_tau_i, "", 100, plots_xmin.at(i), plots_xmax.at(i));
125 
126  chain.Draw( observables.at(i) + " >> " + name_uds_i, tau_commons::select_true_uds && tau_commons::select_accept_jet, "");
127  h_uds->Scale(1./h_uds->Integral());
128  h_uds->GetXaxis()->SetTitle( observables_name.at(i) );
129  h_uds->GetYaxis()->SetRangeUser(0, plots_ymax.at(i) );
130  h_uds->SetLineColor(col1);
131  h_uds->SetFillColor(col1);
132  h_uds->SetFillStyle(1001);
133 
134  chain.Draw( observables.at(i) + " >> " + name_tau_i, tau_commons::select_true_tau && tau_commons::select_accept_jet, "");
135  h_tau->Scale(1./h_tau->Integral());
136  h_tau->SetLineColor(col2);
137  h_tau->SetFillColor(col2);
138  h_tau->SetFillStyle(0);
139 
140  // create Canvas and draw histograms
141  TCanvas *c1 = new TCanvas();
142 
143  h_uds->DrawClone("");
144  h_tau->DrawClone("sames");
145 
146  TLegend *legend = new TLegend(0.3,0.7,0.48,0.9);
147  legend->AddEntry(h_uds,"quark jet","l");
148  legend->AddEntry(h_tau,"#tau jet","l");
149  legend->Draw();
150 
151  gPad->RedrawAxis();
152 
153  //c1->Print( Form( "plots/compare_observables_%d.eps", i ) );
154  //c1->Print( Form( "plots/compare_observables_%d.png", i ) );
155  }
156 */
157  return 0;
158 }