Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
makePlot_track_eval.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file makePlot_track_eval.C
1 int
3 {
4  gStyle->SetOptStat(1);
5 
6  TCut cut_primary( "gtrackID==1" );
7  TCut cut_eta( "abs( (-1*log( tan( atan2( sqrt(px*px+py*py), pz ) / 2.0 ) )) - (-1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) ) ) ) < 1 ");
8  TCut cut_p( "abs( sqrt(px*px+py*py+pz*pz) - sqrt(gpx*gpx+gpy*gpy+gpz*gpz) ) < 1" );
9 
10  vector< string > suffixes;
11  suffixes.push_back( "muon_10GeV_-0.1Eta" );
12  suffixes.push_back( "muon_10GeV_-0.2Eta" );
13  suffixes.push_back( "muon_10GeV_-0.3Eta" );
14  suffixes.push_back( "muon_10GeV_-0.4Eta" );
15  suffixes.push_back( "muon_10GeV_-0.5Eta" );
16  suffixes.push_back( "muon_10GeV_-0.6Eta" );
17  suffixes.push_back( "muon_10GeV_-0.7Eta" );
18  suffixes.push_back( "muon_10GeV_-0.8Eta" );
19  suffixes.push_back( "muon_10GeV_-0.9Eta" );
20  suffixes.push_back( "muon_10GeV_-1.1Eta" );
21  suffixes.push_back( "muon_10GeV_-1.2Eta" );
22  suffixes.push_back( "muon_10GeV_-1.3Eta" );
23  suffixes.push_back( "muon_10GeV_-1.4Eta" );
24  suffixes.push_back( "muon_10GeV_-1.5Eta" );
25  suffixes.push_back( "muon_10GeV_-1.6Eta" );
26  suffixes.push_back( "muon_10GeV_-1.7Eta" );
27  suffixes.push_back( "muon_10GeV_-1.8Eta" );
28  suffixes.push_back( "muon_10GeV_-1.9Eta" );
29  suffixes.push_back( "muon_10GeV_-1Eta" );
30  suffixes.push_back( "muon_10GeV_-2.1Eta" );
31  suffixes.push_back( "muon_10GeV_-2.2Eta" );
32  suffixes.push_back( "muon_10GeV_-2.3Eta" );
33  suffixes.push_back( "muon_10GeV_-2.4Eta" );
34  suffixes.push_back( "muon_10GeV_-2.5Eta" );
35  suffixes.push_back( "muon_10GeV_-2.6Eta" );
36  suffixes.push_back( "muon_10GeV_-2.7Eta" );
37  suffixes.push_back( "muon_10GeV_-2.8Eta" );
38  suffixes.push_back( "muon_10GeV_-2.9Eta" );
39  suffixes.push_back( "muon_10GeV_-2Eta" );
40  suffixes.push_back( "muon_10GeV_-3Eta" );
41  suffixes.push_back( "muon_10GeV_0.1Eta" );
42  suffixes.push_back( "muon_10GeV_0.2Eta" );
43  suffixes.push_back( "muon_10GeV_0.3Eta" );
44  suffixes.push_back( "muon_10GeV_0.4Eta" );
45  suffixes.push_back( "muon_10GeV_0.5Eta" );
46  suffixes.push_back( "muon_10GeV_0.6Eta" );
47  suffixes.push_back( "muon_10GeV_0.7Eta" );
48  suffixes.push_back( "muon_10GeV_0.8Eta" );
49  suffixes.push_back( "muon_10GeV_0.9Eta" );
50  suffixes.push_back( "muon_10GeV_0Eta" );
51  suffixes.push_back( "muon_10GeV_1.1Eta" );
52  suffixes.push_back( "muon_10GeV_1.2Eta" );
53  suffixes.push_back( "muon_10GeV_1.3Eta" );
54  suffixes.push_back( "muon_10GeV_1.4Eta" );
55  suffixes.push_back( "muon_10GeV_1.5Eta" );
56  suffixes.push_back( "muon_10GeV_1.6Eta" );
57  suffixes.push_back( "muon_10GeV_1.7Eta" );
58  suffixes.push_back( "muon_10GeV_1.8Eta" );
59  suffixes.push_back( "muon_10GeV_1.9Eta" );
60  suffixes.push_back( "muon_10GeV_1Eta" );
61  suffixes.push_back( "muon_10GeV_2.1Eta" );
62  suffixes.push_back( "muon_10GeV_2.2Eta" );
63  suffixes.push_back( "muon_10GeV_2.3Eta" );
64  suffixes.push_back( "muon_10GeV_2.4Eta" );
65  suffixes.push_back( "muon_10GeV_2.5Eta" );
66  suffixes.push_back( "muon_10GeV_2.6Eta" );
67  suffixes.push_back( "muon_10GeV_2.7Eta" );
68  suffixes.push_back( "muon_10GeV_2.8Eta" );
69  suffixes.push_back( "muon_10GeV_2.9Eta" );
70  suffixes.push_back( "muon_10GeV_2Eta" );
71  suffixes.push_back( "muon_10GeV_3Eta" );
72 
73  //suffixes.push_back( "ele_10GeV_m05eta" );
74  //suffixes.push_back( "ele_10GeV_m2eta" );
75  //suffixes.push_back( "ele_10GeV_m3eta" );
76  //suffixes.push_back( "ele_10GeV_p05eta" );
77  //suffixes.push_back( "ele_10GeV_p2eta" );
78 
79 
80 
81  TChain chain("tracks");
82 
83  //TString base("../diskinematics_fun4all/eval_track_fastsim_");
84  TString base("../../data/data_trackeval/eval_track_fastsim_");
85 
86  for ( unsigned i = 0; i < suffixes.size(); i++ )
87  {
88  TString file = base;
89  file.Append( suffixes.at(i) );
90  file.Append(".root");
91 
92  cout << "Adding file: " << file << endl;
93  chain.Add( file );
94  }
95 
96  TCanvas *c1 = new TCanvas();
97  chain.Draw("-1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) ) >> h1(81 , -4.05, 4.05)", cut_primary );
98  h1->GetXaxis()->SetTitle("#eta_{true}");
99  h1->GetYaxis()->SetTitle("# Events");
100  c1->Print("plots/track_eval_c1.eps");
101 
102 
103  TCanvas *c2 = new TCanvas();
104  chain.Draw("sqrt(px*px+py*py+pz*pz) - sqrt(gpx*gpx+gpy*gpy+gpz*gpz) : -1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) )", cut_primary, "");
105  htemp->GetXaxis()->SetTitle("#eta_{true}");
106  htemp->GetYaxis()->SetTitle("p_{reco} - p_{true} (GeV)");
107  c2->Print("plots/track_eval_c2.eps");
108 
109 
110  TCanvas *c3 = new TCanvas();
111  chain.Draw("sqrt(px*px+py*py+pz*pz) - sqrt(gpx*gpx+gpy*gpy+gpz*gpz) : -1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) ) >> h3(81, -4.05, 4.05, 50, -1, 1)", cut_primary && cut_eta && cut_p, "colz");
112  h3->GetXaxis()->SetTitle("#eta_{true}");
113  h3->GetYaxis()->SetTitle("p_{reco} - p_{true} (GeV)");
114  c3->Print("plots/track_eval_c3.eps");
115 
116 
117  TCanvas *c4 = new TCanvas();
118  chain.Draw("(-1*log( tan( atan2( sqrt(px*px+py*py), pz ) / 2.0 ) )) - (-1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) )) : -1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) )", cut_primary && cut_eta, "");
119  htemp->GetXaxis()->SetTitle("#eta_{true}");
120  htemp->GetYaxis()->SetTitle("#eta_{reco} - #eta_{true}");
121  c4->Print("plots/track_eval_c4.eps");
122 
123 
124  TCanvas *c5 = new TCanvas();
125  chain.Draw("-1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) ) >> h5(81 , -4.05, 4.05)", cut_primary && cut_eta && cut_p, "");
126  h5->GetXaxis()->SetTitle("#eta_{true}");
127  h5->GetYaxis()->SetTitle("# Events (|#eta - #eta_{true}| < 1 && |#p - #p_{true}| < 1 GeV)");
128  c5->Print("plots/track_eval_c5.eps");
129 
130 
131  return 1;
132 }