19 #include "TTreeHelper.h"
26 static Int_t iCanvas = 1 ;
30 const Char_t* inputFileName =
"~/Embed/P08id_testXXXXXX_Phi_PiPlus_histo_040709.root",
35 const TString PathSave =
"/Embed/";
39 gROOT->LoadMacro(
"StRoot/macros/embedding/Utility.C");
45 Char_t *Prod =
"P08id";
46 Char_t *Particle =
"Phi";
47 Char_t *Daughter =
"Pion";
48 Char_t *Date=
"031509";
51 sprintf(text1,
"P08id Phi");
64 if (
id == 8) { tag =
"Piplus"; tagTex =
"#pi^{+}"; Char_t * Daughter =
"Piplus" ;mass2 = 0.019;}
65 if (
id == 9) { tag =
"Piminus"; tagTex =
"#pi^{-}"; Char_t * Daughter =
"Piminus"; mass2 = 0.019;}
66 if (
id == 11) { tag =
"Kplus"; tagTex =
"K^{+}"; Char_t * Daughter =
"Kplus"; mass2 = 0.245;}
67 if (
id == 12) { tag =
"Kminus"; tagTex =
"K^{-}"; Char_t * Daughter =
"Kminus";mass2 = 0.245;}
68 if (
id == 14) { tag =
"Proton"; tagTex =
"p"; Char_t * Daughter =
"Proton";mass2 = 0.880;}
69 if (
id == 15) { tag =
"Pbar"; tagTex =
"#bar{p}"; Char_t * Daughter =
"Pbar"; mass2 = 0.880;}
70 if (
id == 50) { tag =
"Phi"; tagTex =
"#phi"; mass2 = 1.020;}
71 if (
id == 2) { tag =
"Eplus"; tagTex =
"e^{+}"; mass2 = 0.511;}
72 if (
id == 1) { tag =
"Dmeson"; tagTex =
"D"; mass2 = 1.864;}
80 TFile* file = TFile::Open(inputFileName);
81 if(!file || !file->IsOpen()){
82 cout <<
"can't open " << inputFileName << endl;
86 TH3D *hDca1 = (TH3D*) file-> Get(
"hDca");
87 TH3D *hNfit1 = (TH3D*) file-> Get(
"hNfit");
90 TH2D *hPtM_E1 = (TH2D*) file-> Get(
"hPtM_E");
91 TH2F *dedx1 = (TH2F*) file-> Get(
"dedx");
93 TH3D *hDcaG1 = (TH3D*) file-> Get(
"hDcaG");
94 TH3D *hNfitG1 = (TH3D*) file-> Get(
"hNfitG");
96 TH2F *dedxG1 = (TH2F*) file-> Get(
"dedxG");
97 TH1D *PhiG1 = (TH1D*) file-> Get(
"PhiG");
99 TH2D *vxy1 = (TH2D*) file-> Get(
"vxy");
101 TH1D *vz1 = (TH1D*) file-> Get(
"vz");
102 TH1D *dvx1 = (TH1D*) file-> Get(
"dvx");
103 TH1D *dvy1 = (TH1D*) file-> Get(
"dvy");
104 TH1D *dvz1 = (TH1D*) file-> Get(
"dvz");
106 TH1D *PhiMc1 = (TH1D*) file-> Get(
"PhiMc");
107 TH1D *EtaMc1 = (TH1D*) file-> Get(
"EtaMc");
108 TH1D *YMc1 = (TH1D*) file-> Get(
"YMc");
109 TH1D *PtMc1 = (TH1D*) file-> Get(
"PtMc");
110 TH3D *PtYPhiMc1= (TH3D*) file-> Get(
"PtYPhiMc");
112 TH1D *PhiM1 = (TH1D*) file-> Get(
"PhiM");
113 TH1D *EtaM1 = (TH1D*) file-> Get(
"EtaM");
114 TH1D *YM1 = (TH1D*) file-> Get(
"YM");
115 TH1D *PtM1 = (TH1D*) file-> Get(
"PtM");
116 TH3D *PtYPhiM1 = (TH3D*) file-> Get(
"PtYPhiM");
118 TH2D *PtM_eff1 = (TH2D*) file->Get(
"PtM_E");
122 TH2D *dedx1R = (TH2D*) file-> Get(
"dedxR");
126 TH3D *hDcaM = (TH3D*) file-> Get(
"hPtEtaDcaM");
127 TH3D *hDcaG = (TH3D*) file-> Get(
"hPtEtaDcaG");
128 TH3D *hDcaR = (TH3D*) file-> Get(
"hPtEtaDcaR");
130 TH3D *hNfitM = (TH3D*) file-> Get(
"hPtEtaNfitM");
131 TH3D *hNfitR = (TH3D*) file-> Get(
"hPtEtaNfitR");
132 TH3D *hNfitG = (TH3D*) file-> Get(
"hPtEtaNfitG");
136 const int nch2 = 1000;
141 const Double_t eta[nEtaBin+1]= {0.2,0.5,0.8,1.0};
144 const Double_t pt[nPtBin+1] = {0.5,0.6,0.8,1.0};
516 TCanvas *cde=
new TCanvas(
"cde",
"DCA_Eta",900, 900);
518 cde->Divide(nPtBin,nEtaBin);
524 TH1D *hpt = (TH1D*)hDcaM->Project3D(
"X");
527 for (Int_t ipt=0; ipt <nPtBin ; ipt++)
529 Int_t bin_pt1 = hpt->FindBin(pt[ipt]);
530 Int_t bin_pt2 = hpt->FindBin(pt[ipt+1]);
533 TString nameM =
"hDcaM";
534 TString nameR =
"hDcaR";
535 TString nameG =
"hDcaG";
537 TH1D *hEtaM = (TH1D*)hDcaM->Project3D(
"Y");
538 TH1D *hEtaR = (TH1D*)hDcaR->Project3D(
"Y");
539 TH1D *hEtaG = (TH1D*)hDcaG->Project3D(
"Y");
542 for(
int ieta=0; ieta<nEtaBin ; ieta++)
544 cde->cd(3*ipt+ieta+1);
550 Int_t bin_eta1 = hEtaM->FindBin(eta[ieta]);
551 Int_t bin_eta2 = hEtaM->FindBin(eta[ieta+1]);
553 TH1D *hDcaMNew= (TH1D*)hDcaM->ProjectionZ(nameM+ieta,bin_pt1, bin_pt2, bin_eta1, bin_eta2);
560 for(
int kkk=1;kkk<hDcaMNew->GetNbinsX();kkk++)
562 SumMC += hDcaMNew->GetBinContent(kkk);
565 hDcaMNew->Scale(1./SumMC);
566 hDcaMNew->SetLineColor(2);
567 hDcaMNew->SetXTitle(
"Dca (cm)");
569 sprintf(title,
" %.2f GeV < pT < %.2f GeV - %.2f GeV/c < Eta < %.2f GeV/c", pt[ipt],pt[ipt+1], eta[ieta],eta[ieta+1]);
570 hDcaMNew->SetTitle(title);
574 Int_t bin_eta1R = hEtaR->FindBin(eta[ieta]);
575 Int_t bin_eta2R = hEtaR->FindBin(eta[ieta+1]);
577 TH1D *hDcaRNew= (TH1D*)hDcaR->ProjectionZ(nameR+ieta,bin_pt1, bin_pt2, bin_eta1R, bin_eta2R);
581 for(
int kkk=1;kkk<hDcaRNew->GetNbinsX();kkk++)
583 SumR += hDcaRNew->GetBinContent(kkk);
587 hDcaRNew->Scale(1./SumR);
592 Int_t bin_eta1G = hEtaG->FindBin(eta[ieta]);
593 Int_t bin_eta2G = hEtaG->FindBin(eta[ieta+1]);
595 TH1D *hDcaGNew = (TH1D*)hDcaG->ProjectionZ(nameG+ieta, bin_pt1, bin_pt2, bin_eta1G, bin_eta2G);
600 for(
int kkk=1; kkk<hDcaGNew->GetNbinsX();kkk++)
602 SumG += hDcaGNew->GetBinContent(kkk);
607 hDcaGNew->Scale(1./SumG);
608 hDcaGNew->SetLineColor(4);
611 hDcaRNew->Draw(
"esame");
615 t.SetTextSize(0.045);
616 t.DrawLatex(0.4, 0.9, text1);
618 t.SetTextSize(0.045);
620 t.DrawLatex(0.4, 0.8,
"Matched Global "+tagTex);
622 t.SetTextSize(0.045);
624 t.DrawLatex(0.4, 0.75,
"MuDst");
626 t.SetTextSize(0.045);
628 t.DrawLatex(0.4, 0.70,
"Ghost Tracks");
645 TCanvas *cn=
new TCanvas(
"cn",
"NFIT",1000, 800);
646 cn->Divide(nPtBin,nEtaBin);
652 TH1D *hpt = (TH1D*)hNfitM->Project3D(
"X");
654 for (Int_t ipt=0; ipt <nPtBin ; ipt++)
657 Int_t bin_pt1 = hpt->FindBin(pt[ipt]);
658 Int_t bin_pt2 = hpt->FindBin(pt[ipt+1]);
660 TString nameM =
"hNfitM";
661 TString nameR =
"hNfitR";
662 TString nameG =
"hNfitG";
664 TH1D *hEtaM = (TH1D*)hNfitM->Project3D(
"Y");
665 TH1D *hEtaR = (TH1D*)hNfitR->Project3D(
"Y");
666 TH1D *hEtaG = (TH1D*)hNfitG->Project3D(
"Y");
669 for(
int ieta=0; ieta<nEtaBin ; ieta++)
672 cn->cd(3*ipt+ieta+1);
678 Int_t bin_eta1 = hEtaM->FindBin(eta[ieta]);
679 Int_t bin_eta2 = hEtaM->FindBin(eta[ieta+1]);
682 TH1D *hNfitMNew= (TH1D*)hNfitM->ProjectionZ(nameM+ieta,bin_pt1, bin_pt2, bin_eta1, bin_eta2);
685 for(
int kkk=1;kkk<hNfitMNew->GetNbinsX();kkk++)SumM += hNfitMNew->GetBinContent(kkk);
688 hNfitMNew->Scale(1./SumM);
689 hNfitMNew ->SetLineColor(2);
692 hNfitMNew->SetXTitle(
"Nfit");
694 sprintf(title,
" %.2f GeV < pT < %.2f GeV - %.2f GeV/c < Eta < %.2f GeV/c", pt[ipt],pt[ipt+1], eta[ieta],eta[ieta+1]);
695 hNfitMNew->SetTitle(title);
699 Int_t bin_eta1R = hEtaR->FindBin(eta[ieta]);
700 Int_t bin_eta2R = hEtaR->FindBin(eta[ieta+1]);
702 TH1D *hNfitRNew= (TH1D*)hNfitR->ProjectionZ(nameR+ieta,bin_pt1, bin_pt2, bin_eta1R, bin_eta2R);
705 SumR = hNfitRNew->GetSum();
707 for(
int kkk=1;kkk<hNfitR->GetNbinsX();kkk++)SumR += hNfitR->GetBinContent(kkk);
709 hNfitRNew->Scale(1./SumR);
710 hNfitRNew->Draw(
"esame");
715 Int_t bin_eta1G = hEtaG->FindBin(eta[ieta]);
716 Int_t bin_eta2G = hEtaG->FindBin(eta[ieta+1]);
719 TH1D *hNfitGNew = (TH1D*)hNfitG->ProjectionZ(nameG+ieta,bin_pt1, bin_pt2, bin_eta1, bin_eta2);
722 SumG = hNfitRNew->GetSum();
723 for(
int kkk=1;kkk<hNfitGNew->GetNbinsX();kkk++)SumG += hNfitGNew->GetBinContent(kkk);
726 hNfitGNew->Scale(1./SumG);
727 hNfitGNew ->SetLineColor(4);
730 t.SetTextSize(0.045);
731 t.DrawLatex(0.4, 0.9, text1);
733 t.SetTextSize(0.045);
735 t.DrawLatex(0.4, 0.8,
"Matched Global "+tagTex);
737 t.SetTextSize(0.045);
739 t.DrawLatex(0.4, 0.75,
"MuDst");
747 sprintf(gif,
"~/embedding/%s/%s/Nfit_eta_pt_%s_%s_%s_%s.gif",Prod, Particle, Prod, Particle,Daughter, Date);