3 int triggersample = 30;
5 TFile*
infile = TFile::Open(Form(
"jet_pythia_%igev/trees/0.root",triggersample));
10 float csMB = 4.197*pow(10,9)*pow(10,-12);
11 float cs10GeV = 3.210*pow(10,6)*pow(10,-12);
12 float cs30GeV = 2.178*pow(10,3)*pow(10,-12);
13 float weight10GeV = cs10GeV/csMB;
14 float weight30GeV = cs30GeV/csMB;
15 float weight = weight30GeV;
23 TTree*
tree = (TTree*)infile->Get(
"tree");
29 std::vector<float> *trk_pt = {0};
30 std::vector<float> *trk_phi = {0};
31 std::vector<float> *trk_eta = {0};
32 std::vector<float> *trk_quality = {0};
33 std::vector<float> *trk_nhits = {0};
35 std::vector<float> *tp_pt = {0};
36 std::vector<float> *tp_phi = {0};
37 std::vector<float> *tp_eta = {0};
38 std::vector<int> *tp_pid = {0};
40 std::vector<float> *jet_pt = {0};
41 std::vector<float> *jet_phi = {0};
42 std::vector<float> *jet_eta = {0};
44 std::vector<float> *tjet_pt = {0};
45 std::vector<float> *tjet_phi = {0};
46 std::vector<float> *tjet_eta = {0};
50 tree->SetBranchAddress(
"trk_pt",&trk_pt);
51 tree->SetBranchAddress(
"trk_phi",&trk_phi);
52 tree->SetBranchAddress(
"trk_eta",&trk_eta);
53 tree->SetBranchAddress(
"trk_quality",&trk_quality);
54 tree->SetBranchAddress(
"nmvtx_hits",&trk_nhits);
56 tree->SetBranchAddress(
"tjet_pt",&tjet_pt);
57 tree->SetBranchAddress(
"tjet_phi",&tjet_phi);
58 tree->SetBranchAddress(
"tjet_eta",&tjet_eta);
60 tree->SetBranchAddress(
"tjet_pt",&jet_pt);
61 tree->SetBranchAddress(
"tjet_phi",&jet_phi);
62 tree->SetBranchAddress(
"tjet_eta",&jet_eta);
64 tree->SetBranchAddress(
"tp_pt",&tp_pt);
65 tree->SetBranchAddress(
"tp_phi",&tp_phi);
66 tree->SetBranchAddress(
"tp_eta",&tp_eta);
67 tree->SetBranchAddress(
"tp_pid",&tp_pid);
69 tree->SetBranchAddress(
"zvtx",&zvtx);
75 TH1D* h_deltar =
new TH1D (
"h_deltar",
";delta R;",1000,0,0.4);
77 TH2D* h_ptpart_pttrack =
new TH2D(
"h_ptpart_pttrack",
";pt_particle;pt_track/pt_particle",100,0,100,1000,0,2);
78 h_ptpart_pttrack->Sumw2();
84 int nentries = tree->GetEntries();
85 for (
int q = 0; q < nentries ;q++)
88 if (abs(zvtx) > 10){
continue;}
90 int n_particles = tp_pt->size();
94 float trkphi = trk_phi->at(
j);
95 float trketa = trk_eta->at(
j);
100 if (trk_nhits->at(
j) < 4){
continue;}
101 if (trk_quality->at(
j) > 6){
continue;}
104 for (
int k = 0;
k < n_particles;
k++)
106 float deltaphi = abs(trkphi - tp_phi->at(
k));
107 if (deltaphi > pi) {deltaphi = 2*pi-deltaphi;}
108 float deltaeta = abs(trketa-tp_eta->at(
k));
109 float deltar = TMath::Sqrt(deltaphi*deltaphi + deltaeta*deltaeta);
113 partpt = tp_pt->at(
k);
116 h_deltar->Fill(drmax,weight);
119 h_ptpart_pttrack->Fill(partpt,trk_pt->at(
j)/partpt,weight);
125 TCanvas*c1 =
new TCanvas(
"c1",
"",700,500);
126 h_ptpart_pttrack->Draw(
"COLZ");
129 TCanvas*
c2 =
new TCanvas(
"c2",
"",700,500);