File indexing completed on 2025-08-06 08:12:51
0001 int
0002 makePlot_track_eval()
0003 {
0004 gStyle->SetOptStat(1);
0005
0006 TCut cut_primary( "gtrackID==1" );
0007 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 ");
0008 TCut cut_p( "abs( sqrt(px*px+py*py+pz*pz) - sqrt(gpx*gpx+gpy*gpy+gpz*gpz) ) < 1" );
0009
0010 vector< string > suffixes;
0011 suffixes.push_back( "muon_10GeV_-0.1Eta" );
0012 suffixes.push_back( "muon_10GeV_-0.2Eta" );
0013 suffixes.push_back( "muon_10GeV_-0.3Eta" );
0014 suffixes.push_back( "muon_10GeV_-0.4Eta" );
0015 suffixes.push_back( "muon_10GeV_-0.5Eta" );
0016 suffixes.push_back( "muon_10GeV_-0.6Eta" );
0017 suffixes.push_back( "muon_10GeV_-0.7Eta" );
0018 suffixes.push_back( "muon_10GeV_-0.8Eta" );
0019 suffixes.push_back( "muon_10GeV_-0.9Eta" );
0020 suffixes.push_back( "muon_10GeV_-1.1Eta" );
0021 suffixes.push_back( "muon_10GeV_-1.2Eta" );
0022 suffixes.push_back( "muon_10GeV_-1.3Eta" );
0023 suffixes.push_back( "muon_10GeV_-1.4Eta" );
0024 suffixes.push_back( "muon_10GeV_-1.5Eta" );
0025 suffixes.push_back( "muon_10GeV_-1.6Eta" );
0026 suffixes.push_back( "muon_10GeV_-1.7Eta" );
0027 suffixes.push_back( "muon_10GeV_-1.8Eta" );
0028 suffixes.push_back( "muon_10GeV_-1.9Eta" );
0029 suffixes.push_back( "muon_10GeV_-1Eta" );
0030 suffixes.push_back( "muon_10GeV_-2.1Eta" );
0031 suffixes.push_back( "muon_10GeV_-2.2Eta" );
0032 suffixes.push_back( "muon_10GeV_-2.3Eta" );
0033 suffixes.push_back( "muon_10GeV_-2.4Eta" );
0034 suffixes.push_back( "muon_10GeV_-2.5Eta" );
0035 suffixes.push_back( "muon_10GeV_-2.6Eta" );
0036 suffixes.push_back( "muon_10GeV_-2.7Eta" );
0037 suffixes.push_back( "muon_10GeV_-2.8Eta" );
0038 suffixes.push_back( "muon_10GeV_-2.9Eta" );
0039 suffixes.push_back( "muon_10GeV_-2Eta" );
0040 suffixes.push_back( "muon_10GeV_-3Eta" );
0041 suffixes.push_back( "muon_10GeV_0.1Eta" );
0042 suffixes.push_back( "muon_10GeV_0.2Eta" );
0043 suffixes.push_back( "muon_10GeV_0.3Eta" );
0044 suffixes.push_back( "muon_10GeV_0.4Eta" );
0045 suffixes.push_back( "muon_10GeV_0.5Eta" );
0046 suffixes.push_back( "muon_10GeV_0.6Eta" );
0047 suffixes.push_back( "muon_10GeV_0.7Eta" );
0048 suffixes.push_back( "muon_10GeV_0.8Eta" );
0049 suffixes.push_back( "muon_10GeV_0.9Eta" );
0050 suffixes.push_back( "muon_10GeV_0Eta" );
0051 suffixes.push_back( "muon_10GeV_1.1Eta" );
0052 suffixes.push_back( "muon_10GeV_1.2Eta" );
0053 suffixes.push_back( "muon_10GeV_1.3Eta" );
0054 suffixes.push_back( "muon_10GeV_1.4Eta" );
0055 suffixes.push_back( "muon_10GeV_1.5Eta" );
0056 suffixes.push_back( "muon_10GeV_1.6Eta" );
0057 suffixes.push_back( "muon_10GeV_1.7Eta" );
0058 suffixes.push_back( "muon_10GeV_1.8Eta" );
0059 suffixes.push_back( "muon_10GeV_1.9Eta" );
0060 suffixes.push_back( "muon_10GeV_1Eta" );
0061 suffixes.push_back( "muon_10GeV_2.1Eta" );
0062 suffixes.push_back( "muon_10GeV_2.2Eta" );
0063 suffixes.push_back( "muon_10GeV_2.3Eta" );
0064 suffixes.push_back( "muon_10GeV_2.4Eta" );
0065 suffixes.push_back( "muon_10GeV_2.5Eta" );
0066 suffixes.push_back( "muon_10GeV_2.6Eta" );
0067 suffixes.push_back( "muon_10GeV_2.7Eta" );
0068 suffixes.push_back( "muon_10GeV_2.8Eta" );
0069 suffixes.push_back( "muon_10GeV_2.9Eta" );
0070 suffixes.push_back( "muon_10GeV_2Eta" );
0071 suffixes.push_back( "muon_10GeV_3Eta" );
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 TChain chain("tracks");
0082
0083
0084 TString base("../../data/data_trackeval/eval_track_fastsim_");
0085
0086 for ( unsigned i = 0; i < suffixes.size(); i++ )
0087 {
0088 TString file = base;
0089 file.Append( suffixes.at(i) );
0090 file.Append(".root");
0091
0092 cout << "Adding file: " << file << endl;
0093 chain.Add( file );
0094 }
0095
0096 TCanvas *c1 = new TCanvas();
0097 chain.Draw("-1*log( tan( atan2( sqrt(gpx*gpx+gpy*gpy), gpz ) / 2.0 ) ) >> h1(81 , -4.05, 4.05)", cut_primary );
0098 h1->GetXaxis()->SetTitle("#eta_{true}");
0099 h1->GetYaxis()->SetTitle("# Events");
0100 c1->Print("plots/track_eval_c1.eps");
0101
0102
0103 TCanvas *c2 = new TCanvas();
0104 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, "");
0105 htemp->GetXaxis()->SetTitle("#eta_{true}");
0106 htemp->GetYaxis()->SetTitle("p_{reco} - p_{true} (GeV)");
0107 c2->Print("plots/track_eval_c2.eps");
0108
0109
0110 TCanvas *c3 = new TCanvas();
0111 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");
0112 h3->GetXaxis()->SetTitle("#eta_{true}");
0113 h3->GetYaxis()->SetTitle("p_{reco} - p_{true} (GeV)");
0114 c3->Print("plots/track_eval_c3.eps");
0115
0116
0117 TCanvas *c4 = new TCanvas();
0118 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, "");
0119 htemp->GetXaxis()->SetTitle("#eta_{true}");
0120 htemp->GetYaxis()->SetTitle("#eta_{reco} - #eta_{true}");
0121 c4->Print("plots/track_eval_c4.eps");
0122
0123
0124 TCanvas *c5 = new TCanvas();
0125 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, "");
0126 h5->GetXaxis()->SetTitle("#eta_{true}");
0127 h5->GetYaxis()->SetTitle("# Events (|#eta - #eta_{true}| < 1 && |#p - #p_{true}| < 1 GeV)");
0128 c5->Print("plots/track_eval_c5.eps");
0129
0130
0131 return 1;
0132 }