+
+ if(isFromB) return 5;
+ else return 4;
+}
+
+
+void AliAnalysisTaskSEDplusCorrelations::CreateCorrelationObjs() {
+//
+
+ TString namePlot = "";
+ Int_t nbinsmass=GetNBinsHistos();
+ //These for limits in THnSparse (one per bin, same limits).
+ //Vars: DeltaPhi, InvMass, PtTrack, Displacement, DeltaEta
+ Int_t nBinsPhi[4] = {32,nbinsmass,30,16};
+ Double_t binMinPhi[4] = {-TMath::Pi()/2.+TMath::Pi()/32.,fLowmasslimit,0.,-1.6}; //is the minimum for all the bins
+ Double_t binMaxPhi[4] = {3*TMath::Pi()/2.+TMath::Pi()/32.,fUpmasslimit,30.0,1.6}; //is the maximum for all the bins
+
+ //Vars: DeltaPhi, InvMass, DeltaEta
+ Int_t nBinsMix[3] = {32,nbinsmass,16};
+ Double_t binMinMix[3] = {-TMath::Pi()/2.+TMath::Pi()/32.,fLowmasslimit,-1.6}; //is the minimum for all the bins
+ Double_t binMaxMix[3] = {3*TMath::Pi()/2.+TMath::Pi()/32.,fUpmasslimit,1.6}; //is the maximum for all the bins
+
+ for(Int_t i=0;i<fNPtBins;i++){
+
+ if(!fMixing) {
+ //THnSparse plots: correlations for various invariant mass (MC and data)
+ namePlot="hPhi_Charg_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhi = new THnSparseF(namePlot.Data(), "Azimuthal correlation; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhi->Sumw2();
+ fOutput->Add(hPhi);
+
+ namePlot="hPhi_Kaon_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK = new THnSparseF(namePlot.Data(), "Azimuthal correlation; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK->Sumw2();
+ fOutput->Add(hPhiK);
+
+ namePlot="hPhi_K0_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK0 = new THnSparseF(namePlot.Data(), "Azimuthal correlation; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK0->Sumw2();
+ fOutput->Add(hPhiK0);
+
+ //histos for c/b origin for D+ (MC only)
+ if (fReadMC) {
+
+ //generic origin for tracks
+ namePlot="hPhi_Charg_HFC_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiH_c = new THnSparseF(namePlot.Data(), "Azimuthal correlation - c origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiH_c->Sumw2();
+ fOutput->Add(hPhiH_c);
+
+ namePlot="hPhi_Kaon_HFC_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK_c = new THnSparseF(namePlot.Data(), "Azimuthal correlation - c origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK_c->Sumw2();
+ fOutput->Add(hPhiK_c);
+
+ namePlot="hPhi_K0_HFC_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK0_c = new THnSparseF(namePlot.Data(), "Azimuthal correlation - c origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK0_c->Sumw2();
+ fOutput->Add(hPhiK0_c);
+
+ namePlot="hPhi_Charg_HFB_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiH_b = new THnSparseF(namePlot.Data(), "Azimuthal correlation - b origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiH_b->Sumw2();
+ fOutput->Add(hPhiH_b);
+
+ namePlot="hPhi_Kaon_HFB_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK_b = new THnSparseF(namePlot.Data(), "Azimuthal correlation - b origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK_b->Sumw2();
+ fOutput->Add(hPhiK_b);
+
+ namePlot="hPhi_K0_HFB_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK0_b = new THnSparseF(namePlot.Data(), "Azimuthal correlation - b origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK0_b->Sumw2();
+ fOutput->Add(hPhiK0_b);
+
+ namePlot="hPhi_Charg_NHF_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiH_NHF = new THnSparseF(namePlot.Data(), "Azimuthal correlation - Non HF; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiH_NHF->Sumw2();
+ fOutput->Add(hPhiH_NHF);
+
+ namePlot="hPhi_Kaon_NHF_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK_Non = new THnSparseF(namePlot.Data(), "Azimuthal correlation - Non HF; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK_Non->Sumw2();
+ fOutput->Add(hPhiK_Non);
+
+ namePlot="hPhi_K0_NHF_Bin";
+ namePlot+=i;
+
+ THnSparseF *hPhiK0_Non = new THnSparseF(namePlot.Data(), "Azimuthal correlation - Non HF; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",4,nBinsPhi,binMinPhi,binMaxPhi);
+ hPhiK0_Non->Sumw2();
+ fOutput->Add(hPhiK0_Non);
+ }
+
+ //leading hadron correlations
+ namePlot="hPhi_Lead_Bin";
+ namePlot+=i;
+
+ THnSparseF *hCorrLead = new THnSparseF(namePlot.Data(), "Leading particle correlations; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",3,nBinsMix,binMinMix,binMaxMix);
+ hCorrLead->Sumw2();
+ fOutput->Add(hCorrLead);
+
+ if (fReadMC) {
+ namePlot="hPhi_Lead_From_c_Bin";
+ namePlot+=i;
+
+ THnSparseF *hCorrLead_c = new THnSparseF(namePlot.Data(), "Leading particle correlations - c origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",3,nBinsMix,binMinMix,binMaxMix);
+ hCorrLead_c->Sumw2();
+ fOutput->Add(hCorrLead_c);
+
+ namePlot="hPhi_Lead_From_b_Bin";
+ namePlot+=i;
+
+ THnSparseF *hCorrLead_b = new THnSparseF(namePlot.Data(), "Leading particle correlations - b origin; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",3,nBinsMix,binMinMix,binMaxMix);
+ hCorrLead_b->Sumw2();
+ fOutput->Add(hCorrLead_b);
+
+
+
+ namePlot="hPhi_Lead_From_nhf_Bin";
+ namePlot+=i;
+
+ THnSparseF *hCorrLead_Non = new THnSparseF(namePlot.Data(), "Leading particle correlations - Non HF; #Delta#phi; Inv. Mass (GeV/c^{2}); p_{t} (GeV/c)",3,nBinsMix,binMinMix,binMaxMix);
+ hCorrLead_Non->Sumw2();
+ fOutput->Add(hCorrLead_Non);
+ }
+
+
+
+ //pT distribution histos
+ namePlot = "hist_Pt_Charg_Bin"; namePlot+=i;
+ TH1F *hPtHad = new TH1F(namePlot.Data(), "Charged track pT (in D+ events); p_{T} (GeV/c)",240,0.,20.);
+ hPtHad->SetMinimum(0);
+ fOutput->Add(hPtHad);
+
+ namePlot = "hist_Pt_Kcharg_Bin"; namePlot+=i;
+ TH1F *hPtH = new TH1F(namePlot.Data(), "Hadrons pT (in D+ events); p_{T} (GeV/c)",240,0.,12.);
+ hPtH->SetMinimum(0);
+ fOutput->Add(hPtH);
+
+ namePlot = "hist_Pt_K0_Bin"; namePlot+=i;
+ TH1F *hPtK = new TH1F(namePlot.Data(), "Kaons pT (in D+ events); p_{T} (GeV/c)",240,0.,12.);
+ hPtK->SetMinimum(0);
+ fOutput->Add(hPtK);
+
+