3 #include <TLorentzVector.h>
9 const double E_MASS = 0.000510998950;
18 static TF1 *f_dppfit =
new TF1(
"f_dppfit",
"[0]*x + [1]/x + [2]",0.3,50.0);
19 f_dppfit->SetParameter(0,0.0010557);
20 f_dppfit->SetParameter(1,0.00262218);
21 f_dppfit->SetParameter(2,0.0090893);
24 double dpp = f_dppfit->Eval( p );
36 double sigma_p1 =
get_dpp( p1 ) * p1;
39 double dp1 =
rand3->Gaus( 0, sigma_p1 );
42 double dpp1 = 1.0 + dp1/p1;
43 double px1 = v1.Px()*dpp1;
44 double py1 = v1.Py()*dpp1;
45 double pz1 = v1.Pz()*dpp1;
48 double E1 = sqrt(
E_MASS*
E_MASS + px1*px1 + py1*py1 + pz1*pz1 );
49 v1.SetPxPyPzE( px1, py1, pz1, E1 );
52 double sigma_p2 =
get_dpp( p2 ) * p2;
53 double dp2 =
rand3->Gaus( 0, sigma_p2 );
54 double dpp2 = 1.0 + dp2/p2;
56 double px2 = v2.Px()*dpp2;
57 double py2 = v2.Py()*dpp2;
58 double pz2 = v2.Pz()*dpp2;
59 double E2 = sqrt(
E_MASS*
E_MASS + px2*px2 + py2*py2 + pz2*pz2 );
60 v2.SetPxPyPzE( px2, py2, pz2, E2 );
64 TLorentzVector
sum = v1 +
v2;
71 gStyle->SetOptStat(0);
72 rand3 =
new TRandom3(0);
74 const double integ_lumi = 4.5e9;
77 TString xsection_txt = gSystem->GetFromPipe(
"tail -1 output.txt | awk '{print $9}'");
78 TString xsection_units_txt = gSystem->GetFromPipe(
"tail -1 output.txt | awk '{print $10}'");
79 Double_t xsection = xsection_txt.Atof();
80 if ( xsection_units_txt ==
"mb." )
84 else if ( xsection_units_txt ==
"microbarn." )
88 cout <<
"xsection (b) and integ lumi (1/b) = " << xsection <<
"\t" << integ_lumi << endl;
93 in.open(
"slight.out");
99 cout <<
"File found\n";
104 cout <<
"Error opening file";
109 const Int_t kMaxTrack = 1000;
147 TFile *savefile =
new TFile(
"upc_starlight.root",
"RECREATE");
150 TTree *
tree =
new TTree(
"t",
"Analyze.tree");
151 tree->Branch(
"px",&pxt,
"px/F");
152 tree->Branch(
"py",&pyt,
"py/F");
153 tree->Branch(
"pz",&pzt,
"pz/F");
154 tree->Branch(
"p",&ptott,
"p/F");
155 tree->Branch(
"pt",&ptt,
"pt/F");
156 tree->Branch(
"y",&rapt,
"y/F");
157 tree->Branch(
"eta",&etat,
"eta/F");
158 tree->Branch(
"m", &InvMass,
"m/F");
159 tree->Branch(
"p1", &p1,
"p1/F");
160 tree->Branch(
"pt1", &pt1,
"pt1/F");
161 tree->Branch(
"eta1", &eta1,
"eta1/F");
162 tree->Branch(
"p2", &p2,
"p2/F");
163 tree->Branch(
"pt2", &pt2,
"pt2/F");
164 tree->Branch(
"eta2", &eta2,
"eta2/F");
170 const double MAX_RAP = 4;
171 TH1F *h_rapt =
new TH1F(
"h_rapt",
"Rapidity J/#Psi#rightarrow e^{+}e^{-}", 200, -MAX_RAP, MAX_RAP);
172 TH1F *h_rapt_sphenix =
new TH1F(
"h_rapt_sphenix",
"Rapidity J/#Psi#rightarrow e^{+}e^{-} in sPHENIX Acceptance", 200, -MAX_RAP, MAX_RAP);
173 TH1F *h_rap1 =
new TH1F(
"h_rap1",
"Rapidity Track 1", 200, -MAX_RAP, MAX_RAP);
174 TH1F *h_rap2 =
new TH1F(
"h_rap2",
"Rapidity Track 2", 200, -MAX_RAP, MAX_RAP);
176 const double MAX_INVMASS =6;
177 TH1F *h_InvMass =
new TH1F(
"h_InvMass",
"Invariant Mass", 200, 0, 6.0);
178 TH1F *h_InvMass_smeared =
new TH1F(
"h_InvMass_smeared",
"Invariant Mass", 200, 0, 6.0);
179 TH1F *h_InvMass_sphenix =
new TH1F(
"h_InvMass_sphenix",
"Invariant Mass of J/#Psi in sPHENIX Acceptance",200, 0, 6.0);
180 TH1F *h_InvMass_smeared_sphenix =
new TH1F(
"h_InvMass_smeared_sphenix",
"Invariant Mass of J/#Psi in sPHENIX Acceptance",200, 0, 6.0);
182 TH1F *h_pt1 =
new TH1F(
"h_pt1",
"Transverse Momentum track 1", 200, 0, 2.);
183 TH1F *h_pt2 =
new TH1F(
"h_pt2",
"Transverse Momentum track 2", 200, 0, 2.);
184 TH1F *h_pt =
new TH1F(
"h_pt",
"Transverse Momentum of J/Psi",200, 0, 2.0);
185 TH1F *h_pt_sphenix =
new TH1F(
"h_pt_sphenix",
"Transverse Momentum of UPC in sPHENIX Acceptance", 300, 0.0, 2.0);
186 TH1F *h_pz =
new TH1F(
"h_pz",
"Z-Axis Momentum of J/Psi", 100,-2,6);
188 const double MAX_ETA = 6;
189 TH1F *h_eta1 =
new TH1F(
"h_eta1",
"PseudoRapidity Track 1", 200, -MAX_ETA, MAX_ETA);
190 TH1F *h_eta2 =
new TH1F(
"h_eta2",
"PseudoRapidity Track 2", 200, -MAX_ETA, MAX_ETA);
196 int nv, nproc, nparent, ndaughter;
197 cout << label <<
"\t" << ndaughter << endl;
198 const int MAXDAUGHTERS = 10;
199 int gpid[MAXDAUGHTERS], pdgpid[MAXDAUGHTERS];
200 Float_t mom[MAXDAUGHTERS][3];
201 int nevtrk, stopvtrk, junk[9];
223 Double_t
mass = vp.M();
225 Double_t
pt = vp.Pt();
233 in >> label >> nev >> ntr >> stopv;
234 if ( in.eof() )
break;
237 in >> label >> v0[0] >> v0[1] >> v0[2] >> v0[3] >> nv >> nproc >> nparent >> ndaughter;
240 in >> label >>gpid[0] >> mom[0][0] >> mom[0][1] >> mom[0][2]
241 >> nevtrk >> ntr >> stopvtrk >> pdgpid[0];
243 in >> label >>gpid[1] >> mom[1][0] >> mom[1][1] >> mom[1][2]
244 >> nevtrk >> ntr >> stopvtrk >> pdgpid[1];
256 pt1 = TMath::Sqrt( px1*px1 + py1*py1 );
257 p1 = TMath::Sqrt( px1*px1 + py1*py1 + pz1*pz1 );
263 pt2 = TMath::Sqrt( px2*px2 + py2*py2 );
264 p2 = TMath::Sqrt( px2*px2 + py2*py2 + pz2*pz2 );
274 ptt = TMath::Sqrt(pxt*pxt + pyt*pyt);
276 Double_t
p = TMath::Sqrt(pxt*pxt + pyt*pyt + pzt*pzt);
284 E1 = TMath::Sqrt((me1 *me1) + (px1*px1) + (py1*py1) +(pz1*pz1));
285 E2 = TMath::Sqrt((me2 *me2) + (px2*px2) + (py2*py2) +(pz2*pz2));
291 v1.SetPxPyPzE(px1, py1, pz1, E1);
292 v2.SetPxPyPzE(px2, py2, pz2, E2);
295 InvMass =TMath::Sqrt((E * E)- (pxt * pxt) -(pyt * pyt) -(pzt*pzt));
296 Double_t
m = TMath::Sqrt(pxt*pxt + pyt*pyt + pzt*pzt);
301 h_InvMass->Fill( InvMass );
302 h_InvMass_smeared->Fill( InvMass_smeared );
308 rapt = 0.5 * log((E + pzt)/(E - pzt));
312 rap1 = 0.5 * log((E1 + pz1)/(E1 - pz1));
313 rap2 = 0.5 * log((E2 + pz2)/(E2 - pz2));
314 h_rap1->Fill( rap1 );
315 h_rap2->Fill( rap2 );
316 h_rapt->Fill( rapt );
319 double theta1 = atan2( pt1, pz1 );
320 eta1 = -log( tan( 0.5*theta1 ) );
322 double theta2 = atan2( pt2, pz2 );
323 eta2 = -log( tan( 0.5*theta2 ) );
325 h_eta1->Fill( eta1 );
326 h_eta2->Fill( eta2 );
328 double thetat = atan2( ptt, pzt );
329 etat = -log( tan(0.5*thetat ) );
332 if ( fabs(eta1) < 1.1 && fabs(eta2) < 1.1 && pt1>0.3 && pt2>0.3 )
334 h_rapt_sphenix->Fill( rapt );
335 h_InvMass_sphenix->Fill(InvMass);
336 h_InvMass_smeared_sphenix->Fill(InvMass_smeared);
337 h_pt_sphenix->Fill( ptt );
345 cout <<
"Processed " << nevents << endl;
348 Double_t scale = xsection*integ_lumi/
nevents;
349 cout <<
"Scale factor is " << endl;
351 h_rapt_sphenix->Sumw2();
353 h_pt_sphenix->Sumw2();
355 h_InvMass_sphenix->Sumw2();
356 h_InvMass_smeared->Sumw2();
357 h_InvMass_smeared_sphenix->Sumw2();
358 h_rapt->Scale( scale );
359 h_rapt_sphenix->Scale( scale );
360 h_pt->Scale( scale );
361 h_pt_sphenix->Scale( scale );
362 h_InvMass->Scale( scale );
363 h_InvMass_sphenix->Scale( scale );
364 h_InvMass_smeared->Scale( scale );
365 h_InvMass_smeared_sphenix->Scale( scale );
367 cout <<
"Scale factor = " << scale << endl;
368 cout <<
"Total events = " << h_rapt->Integral() << endl;
369 cout <<
"Total events in sPHENIX acceptance = " << h_rapt_sphenix->Integral() << endl;
370 cout <<
"Acceptance Factor = " << h_rapt_sphenix->Integral()/h_rapt->Integral() << endl;
373 TCanvas *
a =
new TCanvas(
"a",
"Total Parent Momentum of JPsi",550,425);
374 h_pt->SetLineColor(kBlue);
375 h_pt->SetXTitle(
"p_{T} (GeV/c)");
376 h_pt->SetYTitle(
"Counts");
378 a->SaveAs(
"PTofParent.png");
380 TCanvas *
b =
new TCanvas(
"b",
"Invariant Mass of JPsi",550,425);
381 h_InvMass_smeared->SetLineColor(kBlack);
382 h_InvMass_smeared->SetXTitle(
"mass (GeV/c^{2})");
383 h_InvMass_smeared->SetYTitle(
"Counts");
384 h_InvMass_smeared->Draw(
"ehist");
385 h_InvMass_smeared_sphenix->SetLineColor(kBlue);
386 h_InvMass_smeared_sphenix->SetMarkerColor(kBlue);
387 h_InvMass_smeared_sphenix->SetXTitle(
"Mass (GeV/c^{2})");
388 h_InvMass_smeared_sphenix->Draw(
"ehistsame");
389 b->SaveAs(
"MassofUPCJPsi.png");
391 TCanvas *
c =
new TCanvas(
"c",
"Rapidity of E1 and E2",550,425);
392 h_rap1->SetLineColor(kGreen);
393 h_rap1->SetTitle(
"Rapidity e^{+},e^{-}");
394 h_rap1->SetXTitle(
"Rapidity y");
395 h_rap1->SetYTitle(
"Counts");
397 h_rap2->SetLineColor(kRed);
398 h_rap2->SetXTitle(
"Rapidity y");
399 h_rap2->SetYTitle(
"Counts");
400 h_rap2->Draw(
"same");
401 c->SaveAs(
"RapofE1E2.png");
403 TCanvas *d =
new TCanvas(
"d",
"Rapidity of UPC J/Psi",550,425);
404 h_rapt->SetLineColor(kBlack);
405 h_rapt->SetXTitle(
"Rapidity y");
406 h_rapt->SetYTitle(
"Counts");
407 h_rapt->Draw(
"ehist");
408 h_rapt_sphenix->SetLineColor(kBlue);
409 h_rapt_sphenix->SetMarkerColor(kBlue);
410 h_rapt_sphenix->SetXTitle(
"Rapidity y");
411 h_rapt_sphenix->Draw(
"ehistsame");
412 d->SaveAs(
"RapofUPCJPsi.png");
414 TCanvas *
e =
new TCanvas(
"e",
"PZ",550,425);
415 h_pz->SetLineColor(kBlue);
416 h_pz->SetXTitle(
"p_{Z} GeV/c");
417 h_pz->SetYTitle(
"Counts");