From 2d4284862d9923f81d455f0924a9ebac089868a1 Mon Sep 17 00:00:00 2001 From: jgrosseo Date: Wed, 31 Jul 2013 14:09:45 +0000 Subject: [PATCH] extract hists for pp case --- .../macros/dphicorrelations/correct.C | 83 +++++++++++++++---- 1 file changed, 67 insertions(+), 16 deletions(-) diff --git a/PWGCF/Correlations/macros/dphicorrelations/correct.C b/PWGCF/Correlations/macros/dphicorrelations/correct.C index dec77e24f6c..69b0256383a 100644 --- a/PWGCF/Correlations/macros/dphicorrelations/correct.C +++ b/PWGCF/Correlations/macros/dphicorrelations/correct.C @@ -2282,6 +2282,20 @@ void Merge2(const char* file1, const char* file2) m.Merge(); } +void Merge3(const char* file1, const char* file2, const char* file3) +{ + loadlibs(); + TFileMerger m(1); + + m.AddFile(file1); + m.AddFile(file2); + m.AddFile(file3); + + m.SetFastMethod(); + m.OutputFile("merged.root"); + m.Merge(); +} + void MergeList2(const char* listFile, const char* dir, Bool_t onlyPrintEvents = kFALSE, const char* targetDir = "PWG4_LeadingTrackUE") { loadlibs(); @@ -7000,7 +7014,7 @@ void DrawNtrDist(const char* fileName1, const char* fileName2, const char* fileN ptDist1->Draw(); } -void GetSumOfRatios(void* hVoid, void* hMixedVoid, TH1** hist, Int_t step, Int_t centralityBegin, Int_t centralityEnd, Float_t ptBegin, Float_t ptEnd, Bool_t normalizePerTrigger = kTRUE) +void GetSumOfRatios(void* hVoid, void* hMixedVoid, TH1** hist, Int_t step, Int_t centralityBegin, Int_t centralityEnd, Float_t ptBegin, Float_t ptEnd, Bool_t normalizePerTrigger = kTRUE, Bool_t useCentralityBinsDirectly = kFALSE) { Printf("GetSumOfRatios | step %d | %d-%d%% | %.1f - %.1f GeV/c | %.1f - %.1f GeV/c", step, centralityBegin, centralityEnd, gpTMin, gpTMax, ptBegin, ptEnd); @@ -7010,11 +7024,16 @@ void GetSumOfRatios(void* hVoid, void* hMixedVoid, TH1** hist, Int_t step, Int_t Int_t centralityBeginBin = 0; Int_t centralityEndBin = -1; - if (centralityEnd >= centralityBegin) + if (!useCentralityBinsDirectly && centralityEnd >= centralityBegin) { centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin); centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd); } + else if (useCentralityBinsDirectly) + { + centralityBeginBin = centralityBegin; + centralityEndBin = centralityEnd; + } *hist = h->GetUEHist(2)->GetSumOfRatios2(hMixed->GetUEHist(2), step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, normalizePerTrigger); @@ -7025,7 +7044,9 @@ void GetSumOfRatios(void* hVoid, void* hMixedVoid, TH1** hist, Int_t step, Int_t str2.Form("%.2f < p_{T,assoc} < %.2f", gpTMin - 0.01, gpTMax + 0.01); TString newTitle; - newTitle.Form("%s - %s - %d-%d%%", str.Data(), str2.Data(), centralityBegin, centralityEnd); + newTitle.Form("%s - %s - %d-%d", str.Data(), str2.Data(), centralityBegin, centralityEnd); + if (!useCentralityBinsDirectly) + newTitle += "%"; if ((*hist)) (*hist)->SetTitle(newTitle); } @@ -7675,8 +7696,8 @@ void PlotDeltaPhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix = else if (1) { //pA, fine - maxLeadingPt = 7+2; - maxAssocPt = 8+2; + maxLeadingPt = 6; + maxAssocPt = 7; Float_t leadingPtArr[] = { 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 0.5, 4.0, 20.0 }; Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 0.5, 4.0, 12.0 }; } @@ -7840,7 +7861,7 @@ void PlotDeltaPhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix = for (Int_t i=0; iDraw("SURF1"); return; } - else if (1) + else if (0) { // pA, fine binning Int_t step = 8; @@ -7911,8 +7932,8 @@ void PlotDeltaPhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix = GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); - GetSumOfRatios(h, hMixed, &hist7, step, 70, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); - GetSumOfRatios(h, hMixed, &hist8, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); +// GetSumOfRatios(h, hMixed, &hist7, step, 70, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); +// GetSumOfRatios(h, hMixed, &hist8, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); if (h2) GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); @@ -7920,6 +7941,16 @@ void PlotDeltaPhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix = if (h3) GetSumOfRatios(h3, hMixed3, &hist6, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE); } + else if (1) + { + // pp + Int_t step = 8; + + GetSumOfRatios(h, hMixed, &hist1, step, 4, 4, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE); + GetSumOfRatios(h, hMixed, &hist2, step, 3, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE); + GetSumOfRatios(h, hMixed, &hist4, step, 2, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE); + GetSumOfRatios(h, hMixed, &hist5, step, 1, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE); + } else if (0) { // pA, course binning @@ -8170,7 +8201,7 @@ void ExtractMiniJetHistograms(const char* fileNamePbPb, Bool_t useMixed = kTRUE, file->Close(); } - TH1* events = h->GetCentralityDistribution(); + TH1* events = h->GetEventCount()->ProjectionY("events", h->GetEventCount()->GetXaxis()->FindBin(step), h->GetEventCount()->GetXaxis()->FindBin(step)); file = TFile::Open(outputFile, "UPDATE"); events->Write("events"); file->Close(); @@ -8805,8 +8836,8 @@ void RemoveWing(const char* fileName, const char* outputFile) file2 = TFile::Open(outputFile, "RECREATE"); file2->Close(); - Int_t maxLeadingPt = 6; - Int_t maxAssocPt = 7; + Int_t maxLeadingPt = 10; + Int_t maxAssocPt = 11; Int_t nHists = 6; for (Int_t histId = 0; histId < nHists; histId++) @@ -8847,7 +8878,7 @@ void RemoveWing(const char* fileName, const char* outputFile) void RemoveWingAllSpecies() { const char* suffix[] = { "Hadrons", "Pions", "Kaons", "Protons" }; - TString baseName = "dphi_corr_130513b_"; + TString baseName = "dphi_corr_LHC13bc_20130604_"; for (Int_t i=0; i<4; i++) RemoveWing(baseName + suffix[i] + ".root", baseName + suffix[i] + "_wingremoved.root"); @@ -12054,11 +12085,11 @@ void PlotQA(const char* fileName, const char* tag = "") Int_t mergeCount = h->GetMergeCount(); h->SetPtRange(1.01, 3.99); - dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 2.01, 14.99, 1, 8); + dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 1.01, 14.99, 1, 8); if (dphi_corr->GetEntries() == 0) - dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, 2.01, 14.99, 1, 8); + dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, 1.01, 14.99, 1, 8); if (dphi_corr->GetEntries() == 0) - dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, 2.01, 14.99, 1, 8); + dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, 1.01, 14.99, 1, 8); AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE, tag); if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetNbins() == 0) @@ -12096,6 +12127,26 @@ void PlotQA(const char* fileName, const char* tag = "") title.Form("QA_%d_%s", runNumber, tmp.Data()); c->SetTitle(title); + + gpTMin = 1.0; + gpTMax = 1.99; + h->SetPtRange(gpTMin, gpTMax); + hMixed->SetPtRange(gpTMin, gpTMax); + + TH2* hist1 = 0; + + c->cd(3); + GetDistAndFlow(h, 0, &hist1, 0, 6, 0, 20, 1.01, 4.99, 1); + hist1->DrawCopy("SURF1"); + + c->cd(6); + GetDistAndFlow(hMixed, 0, &hist1, 0, 6, 0, 20, 1.01, 4.99, 1); + hist1->DrawCopy("SURF1"); + + c->cd(9); + GetSumOfRatios(h, hMixed, &hist1, 6, 0, 20, 1.01, 4.99, kTRUE); + if (hist1) + hist1->DrawCopy("SURF1"); c->SaveAs(Form("qa/%s", c->GetTitle())); } -- 2.43.0