13 #include <TInterpreter.h> 19 #include <TProfile2D.h> 20 #include <TParameter.h> 26 #include "AliAnalysisManager.h" 27 #include "AliAODHandler.h" 28 #include "AliAODInputHandler.h" 31 #include "AliAODEvent.h" 33 #include "AliVVZERO.h" 34 #include "AliAODVertex.h" 35 #include "AliCentrality.h" 36 #include "AliESDEvent.h" 37 #include "AliVTrack.h" 38 #include "AliESDtrack.h" 39 #include "AliAODTrack.h" 40 #include "AliAnalysisFilter.h" 106 DefineOutput(1, TList::Class());
107 DefineOutput(2, TList::Class());
148 if (&o ==
this)
return *
this;
183 for (
Int_t i=1; i<spec.Length(); i++) {
184 if (spec[i] ==
'-' || spec[i] ==
':') {
186 if (cnt > 0 && c < tmp[cnt-1]) {
187 Warning(
"ExtractBins",
188 "Invalid edge @ %d: %f (< %f)", cnt, c, tmp[cnt-1]);
198 if (start+1 != spec.Length()) {
199 Double_t c = GetEdge(spec, start, spec.Length());
203 edges.Set(cnt, tmp.GetArray());
212 if (!bins || bins[0] ==
'\0')
return;
215 if (spec.EqualTo(
"none", TString::kIgnoreCase))
219 if (spec.EqualTo(
"default", TString::kIgnoreCase) ||
220 spec.EqualTo(
"pbpb", TString::kIgnoreCase)) {
222 Double_t tmp[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100 };
225 else if (spec.EqualTo(
"ppb", TString::kIgnoreCase) ||
226 spec.EqualTo(
"pbp", TString::kIgnoreCase)) {
228 Double_t tmp[] = { 0, 5, 10, 20, 40, 60, 80, 100 };
232 ExtractBins(spec, edges);
234 TAxis* centAxis =
new TAxis(edges.GetSize()-1, edges.GetArray());
247 AliFatal(
"Cannot do analysis on more than one forward detector!");
248 else if (!(flags & kFMD) && !(flags & kVZERO))
249 AliFatal(
"You need to add a forward detector!");
305 fHistEventSel->GetXaxis()->SetBinLabel(
kNoEvent,
"No AOD event");
306 fHistEventSel->GetXaxis()->SetBinLabel(
kNoForward,
"No forward det");
307 fHistEventSel->GetXaxis()->SetBinLabel(
kNoCentral,
"No central det");
308 fHistEventSel->GetXaxis()->SetBinLabel(
kNoTrigger,
"Not triggered");
309 fHistEventSel->GetXaxis()->SetBinLabel(
kNoCent,
"No centrality");
310 fHistEventSel->GetXaxis()->SetBinLabel(
kInvCent,
"Centrality outside range");
311 fHistEventSel->GetXaxis()->SetBinLabel(
kNoVtx,
"No vertex");
312 fHistEventSel->GetXaxis()->SetBinLabel(
kInvVtx,
"Vtx outside range");
313 fHistEventSel->GetXaxis()->SetBinLabel(
kOK,
"OK!");
318 dList->SetName(
"Diagnostics");
321 dList->Add(fHistEventSel);
326 200, -4., 6., 20, 0., TMath::TwoPi());
328 Double_t bins[12] = { -6, -3.7, -3.2, -2.7, -2.2, -1.7,
329 2.8, 3.4, 3.9, 4.5, 5.1, 6 };
331 11, -6, 6, 8, 0, TMath::TwoPi());
334 Double_t bins2[20] = { -6, -3.7, -3.2, -2.7, -2.2,
335 -2.0, -1.5, -1.0, -0.5 , 0., 0.5, 1.0, 1.5, 2.0,
336 2.8, 3.4, 3.9, 4.5, 5.1, 6 };
344 while ((bin = static_cast<VertexBin*>(nextForward()))) {
348 while ((bin = static_cast<VertexBin*>(nextCentral()))) {
435 Double_t totForward = forwarddNdedp.Integral(1, forwarddNdedp.GetNbinsX(), 1, forwarddNdedp.GetNbinsY());
436 Double_t totSPD = spddNdedp.Integral(1, spddNdedp.GetNbinsX(), 1, spddNdedp.GetNbinsY());
462 while ((bin = static_cast<VertexBin*>(list.At(vtx+(nVtxBins*i))))) {
497 while ((bin = static_cast<VertexBin*>(list.At(vtx+(nVtxBins*i))))) {
532 while ((bin = static_cast<VertexBin*>(list.At(vtx+(nVtxBins*i))))) {
556 if (&hcent == &hfwd)
return hcent;
563 Bool_t fwdCov = (hfwd.GetBinContent(e, 0) != 0);
564 Bool_t centCov = (hcent.GetBinContent(e, 0) != 0);
565 if (!fwdCov && !centCov)
continue;
572 cont += hfwd.GetBinContent(e, p);
576 cont += hcent.GetBinContent(e, p);
579 if (cont == 0 || n == 0)
continue;
588 for (
Int_t eV = 1; eV <= hfwd.GetNbinsX(); eV++) {
589 Double_t eta = hfwd.GetXaxis()->GetBinLowEdge(eV)+0.1;
590 if (hfwd.GetBinContent(eV, 0) == 0)
continue;
595 for (
Int_t p = 1; p <= hfwd.GetNbinsY(); p++) {
596 Double_t phi = hfwd.GetYaxis()->GetBinCenter(p);
597 Double_t cont = hfwd.GetBinContent(eV, p);
602 Int_t eSs = hcent.GetXaxis()->FindBin(-1.99);
603 Int_t eSe = hcent.GetXaxis()->FindBin(1.99);
604 for (
Int_t eS = eSs; eS <= eSe; eS++) {
605 Double_t eta = hcent.GetXaxis()->GetBinCenter(eS);
606 if (hcent.GetBinContent(eS, 0) == 0)
continue;
611 for (
Int_t p = 1; p <= hcent.GetNbinsY(); p++) {
612 Double_t phi = hcent.GetYaxis()->GetBinCenter(p);
613 Double_t cont = hcent.GetBinContent(eS, p);
651 AliError(
"Could not retrieve TList fSumList");
679 while ((o = next())) {
681 if (name.Contains(
"dNdeta")) {
682 dNdeta =
dynamic_cast<TH2D*
>(o);
683 name.ReplaceAll(
"dNdeta",
"cent");
684 name.ReplaceAll(
"Ref",
"");
685 name.ReplaceAll(
"Diff",
"");
687 if (!dNdeta || !cent)
continue;
688 for (
Int_t cBin = 1; cBin <= dNdeta->GetNbinsY(); cBin++) {
690 if (nEvents == 0)
continue;
691 for (
Int_t eBin = 1; eBin <= dNdeta->GetNbinsX(); eBin++) {
692 dNdeta->SetBinContent(eBin, cBin, dNdeta->GetBinContent(eBin, cBin)/
nEvents);
693 dNdeta->SetBinError(eBin, cBin, dNdeta->GetBinError(eBin, cBin)/
nEvents);
704 TIter nextNua(nuaList);
707 while ((o = nextNua())) {
708 if (!(h = dynamic_cast<TH2D*>(o)))
continue;
709 Double_t evts = h->GetBinContent(0, 0);
710 if (evts != 0) h->Scale(1./evts);
746 while ((bin = static_cast<VertexBin*>(next()))) {
765 TIter nextHist(list);
766 while ((helper = dynamic_cast<TObject*>(nextHist()))) {
767 if (!(hist2D = dynamic_cast<TH2D*>(helper)))
continue;
768 for (
Int_t cBin = 1; cBin <= hist2D->GetNbinsY(); cBin++) {
769 Int_t cMin =
Int_t(hist2D->GetYaxis()->GetBinLowEdge(cBin));
770 Int_t cMax =
Int_t(hist2D->GetYaxis()->GetBinUpEdge(cBin));
771 TString name = Form(
"cent_%d-%d", cMin, cMax);
772 centList = (
TList*)list->FindObject(name.Data());
774 centList =
new TList();
775 centList->SetName(name.Data());
778 hist1D = hist2D->ProjectionX(Form(
"%s_%s", hist2D->GetName(), name.Data()),
780 hist1D->SetTitle(hist1D->GetName());
781 centList->Add(hist1D);
835 else return (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))
836 ->IsEventSelected() & AliVEvent::kMB);
864 AliCentrality* aodCent =
fAOD->GetCentrality();
894 if (fVtx < fVtxAxis->GetXmin() ||
fVtx >=
fVtxAxis->GetXmax()) {
905 AliAODVertex* aodVtx =
fAOD->GetPrimaryVertex();
907 fVtx = aodVtx->GetZ();
908 if (fVtx < fVtxAxis->GetXmin() ||
fVtx >=
fVtxAxis->GetXmax()) {
928 AliVVZERO* vzero = 0;
933 case 1: vzero = (AliVVZERO*)
fAOD->GetVZEROData();
939 vzero = (AliVVZERO*)esd->GetVZEROData();
942 default: AliFatal(
"Neither ESD or AOD input. This should never happen");
960 Double_t eq[64] = { 1.43536, 1.45727, 1.44993, 1.30051, 1.17425, 1.2335, 1.22247, 1.14362,
961 1.14647, 1.25208, 1.17681, 1.21642, 1.16604, 1.05532, 1.03212, 1.1032,
962 1.22941, 1.36986, 1.14652, 1.20056, 0.927086, 1.10809, 1.03343, 1.29472,
963 1.21204, 1.29217, 1.2003, 2.10382, 1.28513, 1.40558, 1.25784, 1.21848,
964 0.475162, 0.50421, 0.503617, 0.512471, 0.515276, 0.39831, 0.415199, 0.444664,
965 0.521922, 0.785915, 0.703658, 0.832479, 0.77461, 0.73129, 0.778697, 0.710265,
966 0.89686, 0.967688, 0.974225, 0.873445, 0.811096, 0.828493, 0.889609, 0.586056,
967 1.15877, 0.954656, 0.914557, 0.979028, 1.04907, 0.748518, 0.928043, 0.98175 };
969 for (
Int_t i = 0; i < 64; i++) {
972 bin = (ring < 5 ? 11-ring : ring-3);
976 Float_t amp = vzero->GetMultiplicity(i);
978 Double_t phi = TMath::Pi()/8.+TMath::TwoPi()*i/8.;
979 while (phi > TMath::TwoPi()) phi -= TMath::TwoPi();
1049 fDebug = AliAnalysisManager::GetAnalysisManager()->GetDebugLevel();
1050 if (
fDebug > 0) Printf(
"AliForwardFlowTaskQC::VertexBin()\tDebugMode: %d",
fDebug);
1079 if (&o ==
this)
return *
this;
1117 outputlist->Add(list);
1122 Int_t nEtaBins = 24;
1128 else if ((
fFlags & kVZERO)) nEtaBins = 11;
1130 Double_t vzeroBins[12] = { -6, -3.7, -3.2, -2.7, -2.2, -1.7,
1131 2.8, 3.4, 3.9, 4.5, 5.1, 6 };
1132 Double_t vzeroBins2[20] = { -6, -3.7, -3.2, -2.7, -2.2,
1133 -2.0, -1.5, -1.0, -0.5 , 0., 0.5, 1.0, 1.5, 2.0,
1134 2.8, 3.4, 3.9, 4.5, 5.1, 6 };
1136 Int_t nRefBins = nEtaBins;
1140 }
else if ((
fFlags & kEtaGap )) {
1142 }
else if ((
fFlags & k3Cor)) {
1150 nHBins, 0.5, nHBins+0.5);
1157 nEtaBins, -6., 6., nHBins, 0.5, nHBins+0.5);
1160 fCumuDiff->GetXaxis()->Set(nEtaBins, vzeroBins2);
1161 else fCumuDiff->GetXaxis()->Set(nEtaBins, vzeroBins);
1167 Int_t cBins = centAxis->GetNbins();
1177 cBins, 0., 100., nC2Bins, 0.5, nC2Bins+0.5);
1178 if ((
fFlags & kVZERO) && (
fFlags & k3Cor)) cumuHist->GetXaxis()->Set(nEtaBins, vzeroBins2);
1179 cumuHist->GetYaxis()->Set(cBins, centAxis->GetXbins()->GetArray());
1184 nEtaBins, -6., 6., cBins, 0., 100., nC4Bins, 0.5, nC4Bins+0.5);
1187 cumuHist->GetXaxis()->Set(nEtaBins, vzeroBins2);
1188 else cumuHist->GetXaxis()->Set(nEtaBins, vzeroBins);
1190 cumuHist->GetYaxis()->Set(cBins, centAxis->GetXbins()->GetArray());
1198 cBins, 0., 100., nHBins, 0.5, nHBins+0.5);
1200 fCumuNUARef->GetYaxis()->Set(cBins, centAxis->GetXbins()->GetArray());
1207 nEtaBins, -6., 6., cBins, 0., 100., nHBins, 0.5, nHBins+0.5);
1211 else fCumuNUADiff->GetXaxis()->Set(nEtaBins, vzeroBins);
1213 fCumuNUADiff->GetYaxis()->Set(cBins, centAxis->GetXbins()->GetArray());
1219 TList* dList = (
TList*)outputlist->FindObject(
"Diagnostics");
1220 if (!dList) AliFatal(
"No diagnostics list found");
1225 Form(
"%s reference flow acceptance map for %d cm < v_{z} < %d cm",
fType.Data(),
fVzMin,
fVzMax),
1226 nEtaBins, -6., 6., nPhiBins, 0, TMath::TwoPi());
1235 Form(
"%s differential flow acceptance map for %d cm < v_{z} < %d cm",
fType.Data(),
fVzMin,
fVzMax),
1236 nEtaBins, -6., 6., nPhiBins, 0, TMath::TwoPi());
1245 Form(
"Maximum #sigma from mean N_{ch} pr. bin - %s, %d < v_{z} < %d",
1247 20, 0., 100., 500, 0., ((
fFlags &
kMC) ? 15. : 5.));
1263 if (!
fCumuRef) AliFatal(
"You have not called AddOutput() - Terminating!");
1275 for (
Int_t etaBin = 1; etaBin <= dNdetadphi.GetNbinsX(); etaBin++) {
1276 Double_t eta = dNdetadphi.GetXaxis()->GetBinCenter(etaBin);
1282 for (
Int_t phiBin = 0; phiBin <= dNdetadphi.GetNbinsY(); phiBin++) {
1285 if (dNdetadphi.GetBinContent(etaBin, 0) == 0)
break;
1288 TMath::Abs(eta) <
fEtaGap)
break;
1290 if ((
fFlags & kEtaGap) && (mode &
kFillRef) && TMath::Abs(eta) > TMath::Abs(limit))
break;
1292 if (!(
fFlags &
kSPD) && TMath::Abs(eta) < 1.75)
break;
1293 if ((
fFlags & kSPD) && TMath::Abs(eta) > 2.00)
break;
1295 if (limit > 1e3) limit = dNdetadphi.GetXaxis()->GetBinLowEdge(etaBin);
1298 Double_t phi = dNdetadphi.GetYaxis()->GetBinCenter(phiBin);
1299 Double_t weight = dNdetadphi.GetBinContent(etaBin, phiBin);
1302 avgSqr += weight*weight;
1305 if (weight == 0)
continue;
1306 if (weight > max) max = weight;
1319 Double_t cosnPhi = weight*TMath::Cos(n*phi);
1320 Double_t sinnPhi = weight*TMath::Sin(n*phi);
1322 if ((mode & kFillRef) && !((
fFlags & kTracks) && (
fFlags & kMC) && TMath::Abs(eta) > 0.75)) {
1323 fCumuRef->Fill(eta, cosBin, cosnPhi);
1324 fCumuRef->Fill(eta, sinBin, sinnPhi);
1327 if ((mode & kFillDiff)) {
1337 Double_t stdev = (nInAvg > 1 ? TMath::Sqrt(nInAvg/(nInAvg-1))*TMath::Sqrt(avgSqr - runAvg*runAvg) : 0);
1338 Double_t nSigma = (stdev == 0 ? 0 : (max-runAvg)/stdev);
1344 if (nBadBins > 3) useEvent = kFALSE;
1361 if (!
fCumuRef) AliFatal(
"You have not called AddOutput() - Terminating!");
1362 if (!trList && !esd) {
1363 AliError(
"FillTracks: No AOD track list or ESD event - something might be wrong!");
1376 if (trList) nTr = trList->GetEntries();
1377 if (esd) nTr = esd->GetNumberOfTracks();
1378 if (nTr == 0)
return kFALSE;
1382 for (
Int_t i = 0; i < nTr; i++) {
1383 tr = (trList ? (AliVTrack*)trList->At(i) : (AliVTrack*)esd->GetTrack(i));
1386 AliESDtrack* esdTr = (AliESDtrack*)tr;
1387 if (!trFilter->IsSelected(esdTr))
continue;
1390 Double_t pTMin = 0, pTMax = 0, etaMin = 0, etaMax = 0, minNCl = 0;
1392 if ((
fFlags &
kTPC) ==
kTPC) pTMin = 0.2, pTMax = 5., etaMin = -0.8, etaMax = 0.8, minNCl = 70, bit = 128;
1393 if ((
fFlags &
kHybrid) ==
kHybrid) pTMin = 0.2, pTMax = 5., etaMin = -0.8, etaMax = 0.8, minNCl = 70, bit = 272;
1395 AliAODTrack* aodTr = (AliAODTrack*)tr;
1396 if (aodTr->GetID() > -1)
continue;
1397 if (!aodTr->TestFilterBit(bit) || aodTr->Pt() > pTMax || aodTr->Pt() < pTMin ||
1398 aodTr->Eta() > etaMax || aodTr->Eta() < etaMin || aodTr->GetTPCNcls() < minNCl)
continue;
1419 Double_t cosnPhi = weight*TMath::Cos(n*phi);
1420 Double_t sinnPhi = weight*TMath::Sin(n*phi);
1422 if ((mode & kFillRef)) {
1423 fCumuRef->Fill(eta, cosBin, cosnPhi);
1424 fCumuRef->Fill(eta, sinBin, sinnPhi);
1427 if ((mode & kFillDiff)) {
1444 if (!
fCumuRef) AliFatal(
"You have not called AddOutput() - Terminating!");
1447 for (
Int_t etaBin = 1; etaBin <=
fCumuRef->GetNbinsX(); etaBin++) {
1449 if (
fCumuRef->GetBinContent(etaBin, 0) <= 3)
continue;
1451 for (
Int_t qBin = 0; qBin <=
fCumuRef->GetNbinsY(); qBin++) {
1455 for (
Int_t etaBin = 1; etaBin <=
fCumuDiff->GetNbinsX(); etaBin++) {
1458 if (
fCumuRef->GetBinContent(refetaBin, 0) <= 3)
continue;
1459 if (
fCumuDiff->GetBinContent(etaBin, 0) == 0)
continue;
1472 Int_t prevRefEtaBin = 0;
1475 Double_t dQnReA = 0, dQnImA = 0, multA = 0;
1476 Double_t dQnReB = 0, dQnImB = 0, multB = 0;
1478 Double_t two = 0, w2 = 0, four = 0, w4 = 0;
1479 Double_t cosPhi1Phi2 = 0, cosPhi1Phi2Phi3m = 0;
1480 Double_t sinPhi1Phi2 = 0, sinPhi1Phi2Phi3m = 0;
1481 for (
Int_t etaBin = 1; etaBin <=
fCumuDiff->GetNbinsX(); etaBin++) {
1486 if ((
fFlags & kEtaGap)) refEta = -eta;
1488 if (refEtaBinA != prevRefEtaBin) {
1490 multA =
fCumuRef->GetBinContent(refEtaBinA, 0);
1496 multB =
fCumuRef->GetBinContent(refEtaBinB, 0);
1500 if (multA <= 3 || multB <= 3)
continue;
1504 w2 = multA * (multA - 1.);
1505 two = dQnReA*dQnReA + dQnImA*dQnImA - multA;
1508 two = dQnReA*dQnReB + dQnImA*dQnImB;
1510 cumuRef->Fill(eta, cent,
kW2Two, two);
1511 cumuRef->Fill(eta, cent,
kW2, w2);
1516 w4 = multA * (multA - 1.) * (multA - 2.) * (multA - 3.);
1518 four = 2.*multA*(multA-3.) + TMath::Power((TMath::Power(dQnReA,2.)+TMath::Power(dQnImA,2.)),2.)
1519 -4.*(multA-2.)*(TMath::Power(dQnReA,2.) + TMath::Power(dQnImA,2.))
1520 -2.*(TMath::Power(dQnReA,2.)*dQ2nReA+2.*dQnReA*dQnImA*dQ2nImA-TMath::Power(dQnImA,2.)*dQ2nReA)
1521 +(TMath::Power(dQ2nReA,2.)+TMath::Power(dQ2nImA,2.));
1523 cumuRef->Fill(eta, cent,
kW4Four, four);
1524 cumuRef->Fill(eta, cent,
kW4, w4);
1527 cosPhi1Phi2 = dQnReA*dQnReA - dQnImA*dQnImA - dQ2nReA;
1528 sinPhi1Phi2 = 2.*dQnReA*dQnImA - dQ2nImA;
1530 cosPhi1Phi2Phi3m = dQnReA*(TMath::Power(dQnReA,2)+TMath::Power(dQnImA,2))
1531 -dQnReA*dQ2nReA-dQnImA*dQ2nImA-2.*(multA-1)*dQnReA;
1533 sinPhi1Phi2Phi3m = -dQnImA*(TMath::Power(dQnReA,2)+TMath::Power(dQnImA,2))
1534 +dQnReA*dQ2nImA-dQnImA*dQ2nReA+2.*(multA-1)*dQnImA;
1540 cumuRef->Fill(eta, cent,
k3pWeight, multA*(multA-1.)*(multA-2.));
1542 prevRefEtaBin = refEtaBinA;
1550 if (mp == 0)
continue;
1568 Double_t twoPrime = pnRe*dQnReB + pnIm*dQnImB - mq;
1570 cumuDiff->Fill(eta, cent,
kW2Two, twoPrime);
1571 cumuDiff->Fill(eta, cent,
kW2, w2p);
1573 if ((
fFlags & kEtaGap))
continue;
1576 Double_t w4p = (mp * multA - 3.*mq)*(multA - 1.)*(multA - 2.);
1578 Double_t fourPrime = (TMath::Power(dQnReA,2.)+TMath::Power(dQnImA,2.))*(pnRe*dQnReA+pnIm*dQnImA)
1579 - q2nRe*(TMath::Power(dQnReA,2.)-TMath::Power(dQnImA,2.))
1580 - 2.*q2nIm*dQnReA*dQnImA
1581 - pnRe*(dQnReA*dQ2nReA+dQnImA*dQ2nImA)
1582 + pnIm*(dQnImA*dQ2nReA-dQnReA*dQ2nImA)
1583 - 2.*multA*(pnRe*dQnReA+pnIm*dQnImA)
1584 - 2.*(TMath::Power(dQnReA,2.)+TMath::Power(dQnImA,2.))*mq
1585 + 6.*(qnRe*dQnReA+qnIm*dQnImA)
1586 + 1.*(q2nRe*dQ2nReA+q2nIm*dQ2nImA)
1587 + 2.*(pnRe*dQnReA+pnIm*dQnImA)
1591 cumuDiff->Fill(eta, cent,
kW4Four, fourPrime);
1592 cumuDiff->Fill(eta, cent,
kW4, w4p);
1595 Double_t cosPsi1Phi2 = pnRe*dQnReA - pnIm*dQnImA - q2nRe;
1596 Double_t sinPsi1Phi2 = pnRe*dQnImA + pnIm*dQnReA - q2nIm;
1598 Double_t cosPsi1Phi2Phi3p = pnRe*(TMath::Power(dQnImA,2.)+TMath::Power(dQnReA,2.)-multA)
1599 - 1.*(q2nRe*dQnReA+q2nIm*dQnImA)
1600 - mq*dQnReA+2.*qnRe;
1602 Double_t sinPsi1Phi2Phi3p = pnIm*(TMath::Power(dQnImA,2.)+TMath::Power(dQnReA,2.)-multA)
1603 - 1.*(q2nIm*dQnReA-q2nRe*dQnImA)
1604 - mq*dQnImA+2.*qnIm;
1606 Double_t cosPsi1Phi2Phi3m = pnRe*(TMath::Power(dQnReA,2.)-TMath::Power(dQnImA,2.))+2.*pnIm*dQnReA*dQnImA
1607 - 1.*(pnRe*dQ2nReA+pnIm*dQ2nImA)
1608 - 2.*mq*dQnReA+2.*qnRe;
1610 Double_t sinPsi1Phi2Phi3m = pnIm*(TMath::Power(dQnReA,2.)-TMath::Power(dQnImA,2.))-2.*pnRe*dQnReA*dQnImA
1611 - 1.*(pnIm*dQ2nReA-pnRe*dQ2nImA)
1612 + 2.*mq*dQnImA-2.*qnIm;
1618 cumuDiff->Fill(eta, cent,
k3pWeight, (mp*multA-2.*mq)*(multA-1.));
1623 cumuRef->Fill(-7., cent, -0.5, 1.);
1644 aLow = 14; aHigh = 15;
1645 bLow = 20; bHigh = 22;
1648 aLow = 16; aHigh = 16;
1649 bLow = 21; bHigh = 22;
1652 aLow = 6; aHigh = 7;
1653 bLow = 21; bHigh = 22;
1656 aLow = 6; aHigh = 7;
1657 bLow = 12; bHigh = 12;
1660 aLow = 6; aHigh = 8;
1661 bLow = 13; bHigh = 14;
1664 AliFatal(Form(
"No limits for this eta region! (%d)", bin));
1670 aLow = 6; aHigh = 13;
1671 bLow = 17; bHigh = 18;
1674 aLow = 6; aHigh = 9;
1675 bLow = 17; bHigh = 18;
1678 aLow = 2; aHigh = 3;
1679 bLow = 17; bHigh = 18;
1682 aLow = 2; aHigh = 3;
1683 bLow = 6; bHigh = 9;
1686 aLow = 2; aHigh = 3;
1687 bLow = 6; bHigh = 13;
1690 AliFatal(Form(
"No limits for this eta region! (%d)", bin));
1695 AliFatal(Form(
"Limits outside vtx range! (%d) - aHigh = %d, bHigh = %d, Nbins = %d",
1707 if (!
fCumuRef) AliFatal(
"You have not called AddOutput() - Terminating!");
1710 for (
Int_t etaBin = 1; etaBin <=
fCumuRef->GetNbinsX(); etaBin++) {
1712 if (
fCumuRef->GetBinContent(etaBin, 0) == 0)
continue;
1713 for (
Int_t qBin = 0; qBin <=
fCumuRef->GetNbinsY(); qBin++) {
1717 for (
Int_t etaBin = 1; etaBin <=
fCumuDiff->GetNbinsX(); etaBin++) {
1719 if (
fCumuDiff->GetBinContent(etaBin, 0) == 0)
continue;
1735 Int_t aLow = 0, aHigh = 0, bLow = 0, bHigh = 0;
1736 Double_t dQnReA = 0, dQnImA = 0, multA = 0;
1737 Double_t dQnReB = 0, dQnImB = 0, multB = 0;
1739 for (
Int_t etaBin = 1; etaBin <=
fCumuDiff->GetNbinsX(); etaBin++) {
1742 GetLimits(prevLim, aLow, aHigh, bLow, bHigh);
1744 multA = 0; dQnReA = 0; dQnImA = 0;
1745 multB = 0; dQnReB = 0; dQnImB = 0;
1747 for (
Int_t a = aLow; a <= aHigh; a++) {
1748 multA +=
fCumuRef->GetBinContent(a, 0);
1752 for (
Int_t b = bLow; b <= bHigh; b++) {
1753 multB +=
fCumuRef->GetBinContent(b, 0);
1760 two = dQnReA*dQnReB + dQnImA*dQnImB;
1762 cumuRef->Fill(eta, cent,
kW2Two, two);
1763 cumuRef->Fill(eta, cent,
kW2, w2);
1769 if (mp == 0)
continue;
1774 Double_t twoPrimeA = pnRe*dQnReA + pnIm*dQnImA;
1775 cumuDiff->Fill(eta, cent,
kW2Two, twoPrimeA);
1776 cumuDiff->Fill(eta, cent,
kW2, w2pA);
1779 Double_t twoPrimeB = pnRe*dQnReB + pnIm*dQnImB;
1780 cumuDiff->Fill(eta, cent,
kW4Four, twoPrimeB);
1781 cumuDiff->Fill(eta, cent,
kW4, w2pB);
1784 cumuRef->Fill(-7., cent, -0.5, 1.);
1815 TH2I* quality = (TH2I*)outlist->FindObject(Form(
"hQCQuality%s%s",
fType.Data(),
GetQCType(
fFlags)));
1818 outlist->Add(quality);
1836 outlist->Add(dNdetaRef);
1845 dNdetaDiff->Sumw2();
1846 outlist->Add(dNdetaDiff);
1851 TList* vtxList = (
TList*)outlist->FindObject(
"vtxList");
1853 vtxList =
new TList();
1854 vtxList->SetName(
"vtxList");
1855 outlist->Add(vtxList);
1884 if ((
fFlags & kNUAcorr)) {
1919 if ((
fFlags & kNUAcorr)) {
1934 TList* nualist = (
TList*)outlist->FindObject(
"NUATerms");
1936 nualist =
new TList();
1937 nualist->SetName(
"NUATerms");
1938 outlist->Add(nualist);
1948 nualist->Add(nuaRef);
1956 nuaRef->Fill(0., -1., 1.);
1963 nualist->Add(nuaDiff);
1970 nuaDiff->Fill(0., -1., 1.);
1976 TH1D* chist,
TH2D* dNdetaRef)
const 1995 if (mult == 0)
continue;
2001 dNdetaRef->Fill(eta, cent, mult);
2008 TH2D* cumu2NUAold = 0;
2024 for (
Int_t cBin = 1; cBin <= cumuRef->GetNbinsY(); cBin++) {
2025 Double_t cent = cumuRef->GetYaxis()->GetBinCenter(cBin);
2026 if (n == 2) chist->Fill(cent, cumuRef->GetBinContent(0, cBin, 0));
2027 if (
fDebug > 0) AliInfo(Form(
"%s - v_%d: centrality %3.1f:..",
fType.Data(), n, cent));
2028 for (
Int_t etaBin = 1; etaBin <= cumuRef->GetNbinsX(); etaBin++) {
2029 Double_t eta = cumuRef->GetXaxis()->GetBinCenter(etaBin);
2035 Double_t w2Two = cumuRef->GetBinContent(refEtaBinA, cBin,
kW2Two);
2036 Double_t w2 = cumuRef->GetBinContent(refEtaBinA, cBin,
kW2);
2037 if (w2 == 0)
continue;
2048 if (qc2 >= 0) cumu2->Fill(eta, cent, TMath::Sqrt(qc2));
2050 if ((
fFlags & kNUAcorr)) {
2055 qc2 -= cosP1nPhiA*cosP1nPhiB + sinP1nPhiA*sinP1nPhiB;
2057 Double_t den = 1+(cos2nPhiA*cos2nPhiB + sin2nPhiA*sin2nPhiB);
2058 if (den != 0) qc2 /= den;
2063 AliInfo(Form(
"%s: QC_%d{2} = %1.3f for eta = %1.2f and centrality %3.1f - skipping",
2064 fType.Data(), n, qc2, eta, cent));
2065 quality->Fill((n-2)*qualityFactor+2,
Int_t(cent));
2069 if (!TMath::IsNaN(vnTwo)) {
2070 quality->Fill((n-2)*qualityFactor+1,
Int_t(cent));
2071 if ((
fFlags & kNUAcorr)) cumu2NUAold->Fill(eta, cent, vnTwo);
2074 if (!(
fFlags & kStdQC))
continue;
2077 Double_t w4 = cumuRef->GetBinContent(refEtaBinA, cBin,
kW4);
2079 if (w4 == 0 || multm1m2 == 0)
continue;
2085 cosP1nPhi1P1nPhi2 /= w2;
2086 sinP1nPhi1P1nPhi2 /= w2;
2087 cosP1nPhi1M1nPhi2M1nPhi3 /= multm1m2;
2088 sinP1nPhi1M1nPhi2M1nPhi3 /= multm1m2;
2090 Double_t qc4 = four-2.*TMath::Power(two,2.);
2091 if (qc4 < 0) cumu4->Fill(eta, cent, TMath::Power(-qc4, 0.25));
2093 if ((
fFlags & kNUAcorr)) {
2094 qc4 += - 4.*cosP1nPhiA*cosP1nPhi1M1nPhi2M1nPhi3
2095 + 4.*sinP1nPhiA*sinP1nPhi1M1nPhi2M1nPhi3-TMath::Power(cosP1nPhi1P1nPhi2,2.)-TMath::Power(sinP1nPhi1P1nPhi2,2.)
2096 + 4.*cosP1nPhi1P1nPhi2*(TMath::Power(cosP1nPhiA,2.)-TMath::Power(sinP1nPhiA,2.))
2097 + 8.*sinP1nPhi1P1nPhi2*sinP1nPhiA*cosP1nPhiA
2098 + 8.*two*(TMath::Power(cosP1nPhiA,2.)+TMath::Power(sinP1nPhiA,2.))
2099 - 6.*TMath::Power((TMath::Power(cosP1nPhiA,2.)+TMath::Power(sinP1nPhiA,2.)),2.);
2103 AliInfo(Form(
"%s: QC_%d{4} = %1.3f for eta = %1.2f and centrality %3.1f - skipping",
2104 fType.Data(), n, qc2, eta, cent));
2105 quality->Fill((n-2)*qualityFactor+6,
Int_t(cent));
2108 Double_t vnFour = TMath::Power(-qc4, 0.25);
2109 if (!TMath::IsNaN(vnFour*multm1m2)) {
2110 quality->Fill((n-2)*qualityFactor+5,
Int_t(cent));
2111 if ((
fFlags & kNUAcorr)) cumu4NUA->Fill(eta, cent, vnFour);
2121 TH2I* quality,
TH2D* dNdetaDiff)
const 2138 if (mult == 0)
continue;
2143 dNdetaDiff->Fill(eta, cent, mult);
2151 TH2D* cumu2NUAold = 0;
2162 cumu4 = (
TH2D*)cumu4h.
Get(
'd',n);
2167 for (
Int_t cBin = 1; cBin <= cumuDiff->GetNbinsY(); cBin++) {
2168 Double_t cent = cumuDiff->GetYaxis()->GetBinCenter(cBin);
2169 if (
fDebug > 0) AliInfo(Form(
"%s - v_%d: centrality %3.1f:..",
fType.Data(), n, cent));
2170 for (
Int_t etaBin = 1; etaBin <= cumuDiff->GetNbinsX(); etaBin++) {
2171 Double_t eta = cumuDiff->GetXaxis()->GetBinCenter(etaBin);
2178 Double_t w2 = cumuRef->GetBinContent(refEtaBinA, cBin,
kW2);
2179 if (w2 == 0)
continue;
2190 Double_t w2pTwoPrime = cumuDiff->GetBinContent(etaBin, cBin,
kW2Two);
2191 Double_t w2p = cumuDiff->GetBinContent(etaBin, cBin,
kW2);
2192 if (w2p == 0)
continue;
2197 Double_t twoPrime = w2pTwoPrime / w2p;
2200 cumu2->Fill(eta, cent, qc2Prime);
2201 if ((
fFlags & kNUAcorr)) {
2203 qc2Prime -= cosP1nPsi*cosP1nPhiB + sinP1nPsi*sinP1nPhiB;
2205 qc2Prime /= (1.+(cos2nPsi*cos2nPhiB + sin2nPsi*sin2nPhiB));
2207 if (!TMath::IsNaN(qc2Prime)) {
2208 quality->Fill((n-2)*qualityFactor+3,
Int_t(cent));
2209 if ((
fFlags & kNUAcorr)) cumu2NUAold->Fill(eta, cent, qc2Prime);
2212 quality->Fill((n-2)*qualityFactor+4,
Int_t(cent));
2214 AliInfo(Form(
"%s: QC'_%d{2} = %1.3f for eta = %1.2f and centrality %3.1f",
2215 fType.Data(), n, qc2Prime, eta, cent));
2217 if (!(
fFlags & kStdQC))
continue;
2224 cosP1nPhi1P1nPhi2 /= w2;
2225 sinP1nPhi1P1nPhi2 /= w2;
2226 cosP1nPhi1M1nPhi2M1nPhi3 /= multm1m2;
2227 sinP1nPhi1M1nPhi2M1nPhi3 /= multm1m2;
2230 Double_t w4pFourPrime = cumuDiff->GetBinContent(etaBin, cBin,
kW4Four);
2231 Double_t w4p = cumuDiff->GetBinContent(etaBin, cBin,
kW4);
2233 if (w4p == 0 || mpqMult == 0)
continue;
2241 cosP1nPsi1P1nPhi2 /= w2p;
2242 sinP1nPsi1P1nPhi2 /= w2p;
2243 cosP1nPsi1M1nPhi2M1nPhi3 /= mpqMult;
2244 sinP1nPsi1M1nPhi2M1nPhi3 /= mpqMult;
2245 cosP1nPsi1P1nPhi2M1nPhi3 /= mpqMult;
2246 sinP1nPsi1P1nPhi2M1nPhi3 /= mpqMult;
2248 Double_t fourPrime = w4pFourPrime / w4p;
2249 Double_t qc4Prime = fourPrime-2.*twoPrime*two;
2250 if (cumu4) cumu4->Fill(eta, cent, qc4Prime);
2252 if ((
fFlags & kNUAcorr)) {
2253 qc4Prime += - cosP1nPsi*cosP1nPhi1M1nPhi2M1nPhi3
2254 + sinP1nPsi*sinP1nPhi1M1nPhi2M1nPhi3
2255 - cosP1nPhiA*cosP1nPsi1M1nPhi2M1nPhi3
2256 + sinP1nPhiA*sinP1nPsi1M1nPhi2M1nPhi3
2257 - 2.*cosP1nPhiA*cosP1nPsi1P1nPhi2M1nPhi3
2258 - 2.*sinP1nPhiA*sinP1nPsi1P1nPhi2M1nPhi3
2259 - cosP1nPsi1P1nPhi2*cosP1nPhi1P1nPhi2
2260 - sinP1nPsi1P1nPhi2*sinP1nPhi1P1nPhi2
2261 + 2.*cosP1nPhi1P1nPhi2*(cosP1nPsi*cosP1nPhiA-sinP1nPsi*sinP1nPhiA)
2262 + 2.*sinP1nPhi1P1nPhi2*(cosP1nPsi*sinP1nPhiA+sinP1nPsi*cosP1nPhiA)
2263 + 4.*two*(cosP1nPsi*cosP1nPhiA+sinP1nPsi*sinP1nPhiA)
2264 + 2.*cosP1nPsi1P1nPhi2*(TMath::Power(cosP1nPhiA,2.)-TMath::Power(sinP1nPhiA,2.))
2265 + 4.*sinP1nPsi1P1nPhi2*cosP1nPhiA*sinP1nPhiA
2266 + 4.*twoPrime*(TMath::Power(cosP1nPhiA,2.)+TMath::Power(sinP1nPhiA,2.))
2267 - 6.*(TMath::Power(cosP1nPhiA,2.)-TMath::Power(sinP1nPhiA,2.))
2268 * (cosP1nPsi*cosP1nPhiA-sinP1nPsi*sinP1nPhiA)
2269 - 12.*cosP1nPhiA*sinP1nPhiA
2270 * (sinP1nPsi*cosP1nPhiA+cosP1nPsi*sinP1nPhiA);
2273 if (!TMath::IsNaN(qc4Prime*mpqMult)) {
2274 quality->Fill((n-2)*qualityFactor+7,
Int_t(cent));
2275 if (cumu4NUA) cumu4NUA->Fill(eta, cent, qc4Prime);
2278 quality->Fill((n-2)*qualityFactor+8,
Int_t(cent));
2280 AliInfo(Form(
"%s: v_%d{4} = %1.3f for eta = %1.2f and centrality %3.1f",
2281 fType.Data(), n, qc4Prime, eta, cent));
2293 TH2D* dNdetaDiff)
const 2309 TH2D* cumu2rNUAold = 0;
2311 TH2D* cumu2aNUAold = 0;
2313 TH2D* cumu2bNUAold = 0;
2326 for (
Int_t cBin = 1; cBin <= cumuRef->GetNbinsY(); cBin++) {
2327 Double_t cent = cumuRef->GetYaxis()->GetBinCenter(cBin);
2328 if (n == 2) chist->Fill(cent, cumuRef->GetBinContent(0, cBin, 0));
2329 if (
fDebug > 0) AliInfo(Form(
"%s - v_%d: centrality %3.1f:..",
fType.Data(), n, cent));
2332 Int_t aLow = 0, aHigh = 0, bLow = 0, bHigh = 0;
2344 for (
Int_t etaBin = 1; etaBin <= cumuDiff->GetNbinsX(); etaBin++) {
2345 Double_t eta = cumuDiff->GetXaxis()->GetBinCenter(etaBin);
2348 Double_t w2 = cumuRef->GetBinContent(etaBin, cBin,
kW2);
2349 if (w2 == 0)
continue;
2353 GetLimits(prevLim, aLow, aHigh, bLow, bHigh);
2355 cosP1nPhiA = 0; sinP1nPhiA = 0; cos2nPhiA = 0; sin2nPhiA = 0; multA = 0;
2356 cosP1nPhiB = 0; sinP1nPhiB = 0; cos2nPhiB = 0; sin2nPhiB = 0; multB = 0;
2357 for (
Int_t a = aLow; a <= aHigh; a++) {
2364 for (
Int_t b = bLow; b <= bHigh; b++) {
2371 if (multA == 0 || multB == 0) {
2372 AliWarning(Form(
"Empty NUA values for 3Cor! (%s)", cumuRef->GetName()));
2375 cosP1nPhiA /= multA;
2376 sinP1nPhiA /= multA;
2379 cosP1nPhiB /= multB;
2380 sinP1nPhiB /= multB;
2384 dNdetaRef->Fill(eta, cent, multA+multB);
2389 if (qc2 >= 0) cumu2r->Fill(eta, cent, TMath::Sqrt(qc2));
2391 if ((
fFlags & kNUAcorr)) {
2393 qc2 -= cosP1nPhiA*cosP1nPhiB + sinP1nPhiA*sinP1nPhiB;
2395 qc2 /= (1+(cos2nPhiA*cos2nPhiB + sin2nPhiA*sin2nPhiB));
2399 AliInfo(Form(
"%s: QC_%d{2} = %1.3f for eta = %1.2f and centrality %3.1f - skipping",
2400 fType.Data(), n, qc2, eta, cent));
2401 quality->Fill((n-2)*4+2,
Int_t(cent));
2405 if (!TMath::IsNaN(vnTwo)) {
2406 quality->Fill((n-2)*4+1,
Int_t(cent));
2407 if ((
fFlags & kNUAcorr)) cumu2rNUAold->Fill(eta, cent, vnTwo);
2411 Double_t w2pTwoPrimeA = cumuDiff->GetBinContent(etaBin, cBin,
kW2Two);
2412 Double_t w2pA = cumuDiff->GetBinContent(etaBin, cBin,
kW2);
2413 Double_t w2pTwoPrimeB = cumuDiff->GetBinContent(etaBin, cBin,
kW4Four);
2414 Double_t w2pB = cumuDiff->GetBinContent(etaBin, cBin,
kW4);
2415 if (w2pA == 0 || w2pB == 0)
continue;
2421 if (mult == 0)
continue;
2426 Double_t twoPrimeA = w2pTwoPrimeA / w2pA;
2427 Double_t twoPrimeB = w2pTwoPrimeB / w2pB;
2428 dNdetaDiff->Fill(eta, cent, mult);
2432 if (qc2PrimeA*qc2PrimeB >= 0) {
2433 cumu2a->Fill(eta, cent, qc2PrimeA);
2434 cumu2b->Fill(eta, cent, qc2PrimeB);
2436 if ((
fFlags & kNUAcorr)) {
2438 qc2PrimeA -= cosP1nPsi*cosP1nPhiA + sinP1nPsi*sinP1nPhiA;
2439 qc2PrimeB -= cosP1nPsi*cosP1nPhiB + sinP1nPsi*sinP1nPhiB;
2441 if (cos2nPsi*cos2nPhiA + sin2nPsi*sin2nPhiA != -1.) qc2PrimeA /= (1.+(cos2nPsi*cos2nPhiA + sin2nPsi*sin2nPhiA));
2442 if (cos2nPsi*cos2nPhiB + sin2nPsi*sin2nPhiB != -1.) qc2PrimeB /= (1.+(cos2nPsi*cos2nPhiB + sin2nPsi*sin2nPhiB));
2444 if (!TMath::IsNaN(qc2PrimeA) && !TMath::IsNaN(qc2PrimeB) && qc2 != 0) {
2445 if (qc2PrimeA*qc2PrimeB >= 0) {
2446 quality->Fill((n-2)*4+3,
Int_t(cent));
2447 if ((
fFlags & kNUAcorr)) cumu2aNUAold->Fill(eta, cent, qc2PrimeA);
2448 if ((
fFlags & kNUAcorr)) cumu2bNUAold->Fill(eta, cent, qc2PrimeB);
2452 quality->Fill((n-2)*4+4,
Int_t(cent));
2454 AliInfo(Form(
"%s: QC'a_%d{2} = %1.3f, QC'b_%d{2} = %1.3f for eta = %1.2f and centrality %3.1f",
2455 fType.Data(), n, qc2PrimeA, n, qc2PrimeB, eta, cent));
2490 if (type ==
'r' || type ==
'R') vQC2(n) *= vQC2(n);
2491 for (
Int_t m = 0; m < fMaxMoment-1; m++) {
2499 if (det != 0 ) vQC2 = mNUA*vQC2;
2500 else AliWarning(Form(
"Determinant == 0 - cent: %d-%d, eta: %f, type: '%c', data: %s, vtx: %d-%d%s",
2507 for (
Int_t n = 0; n < fMaxMoment-1; n++) {
2509 if (type ==
'r' || type ==
'R')
2510 vnTwo = (vQC2(n) > 0. ? TMath::Sqrt(vQC2(n)) : 0.);
2544 if (n == m)
return 1.;
2548 Double_t cosnMmPhi1 = 0, cosnMmPhi2 = 0, sinnMmPhi1 = 0, sinnMmPhi2 = 0;
2549 Double_t cosnPmPhi1 = 0, cosnPmPhi2 = 0, sinnPmPhi1 = 0, sinnPmPhi2 = 0;
2550 Double_t cos2nPhi1 = 0, cos2nPhi2 = 0, sin2nPhi1 = 0, sin2nPhi2 = 0;
2553 if (type ==
'r' || type ==
'R') {
2558 Int_t aLow = 0, aHigh = 0, bLow = 0, bHigh = 0;
2559 GetLimits(i-1, aLow, aHigh, bLow, bHigh);
2561 for (
Int_t a = aLow; a <= aHigh; a++) {
2570 for (
Int_t b = bLow; b <= bHigh; b++) {
2579 if (multA == 0 || multB == 0) {
2580 if (
fDebug > 0) AliWarning(
"multA or multB == 0 in matrix elements, aborting NUA");
2583 cosnMmPhi1 /= multA;
2584 sinnMmPhi1 /= multA;
2585 cosnPmPhi1 /= multA;
2586 sinnPmPhi1 /= multA;
2589 cosnMmPhi2 /= multB;
2590 sinnMmPhi2 /= multB;
2591 cosnPmPhi2 /= multB;
2592 sinnPmPhi2 /= multB;
2611 else if (type ==
'd' || type ==
'D') {
2626 else if (type ==
'a' || type ==
'A' || type ==
'b' || type ==
'B') {
2640 Int_t aLow = 0, aHigh = 0, bLow = 0, bHigh = 0;
2641 GetLimits(i-1, aLow, aHigh, bLow, bHigh);
2642 Int_t lLow = ((type ==
'a' || type ==
'A') ? aLow : bLow);
2643 Int_t lHigh = ((type ==
'a' || type ==
'A') ? aHigh : bHigh);
2644 for (
Int_t l = lLow; l <= lHigh; l++) {
2653 if (mult1 == 0 || mult2 == 0) {
2654 if (
fDebug > 0) AliWarning(
"mult1 or mult2 == 0 in matrix elements, aborting NUA");
2657 cosnMmPhi1 /= mult1;
2658 sinnMmPhi1 /= mult1;
2659 cosnPmPhi1 /= mult1;
2660 sinnPmPhi1 /= mult1;
2663 cosnMmPhi2 /= mult2;
2664 sinnMmPhi2 /= mult2;
2665 cosnPmPhi2 /= mult2;
2666 sinnPmPhi2 /= mult2;
2672 Double_t e = cosnMmPhi1*cosnMmPhi2 + sinnMmPhi1*sinnMmPhi2 + cosnPmPhi1*cosnPmPhi2 + sinnPmPhi1*sinnPmPhi2;
2673 Double_t den = 1 + cos2nPhi1*cos2nPhi2 + sin2nPhi1*sin2nPhi2;
2674 if (den != 0) e /= den;
2691 TProfile2D* avgProf = 0;
2695 for (
UInt_t nua = 0; nua <= nNUA; nua++) {
2697 for (
Int_t t = 0; t < nT; t++) {
2700 case 0: ct =
'r';
break;
2701 case 1: ct = ((
fFlags &
k3Cor) ?
'a' :
'd');
break;
2702 case 2: ct =
'b';
break;
2703 default: ct =
'\0';
break;
2705 vtxHist =
static_cast<TH2D*
>(cumu.
Get(ct,n,nua));
2707 AliWarning(
"VertexBin::AddVertexBins: vtxHist not found!");
2710 name = vtxHist->GetName();
2712 Ssiz_t l = name.Last(
'x')-3;
2714 avgProf = (TProfile2D*)list->FindObject(name.Data());
2717 avgProf =
new TProfile2D(name.Data(), name.Data(),
2718 vtxHist->GetNbinsX(), vtxHist->GetXaxis()->GetXmin(), vtxHist->GetXaxis()->GetXmax(),
2719 vtxHist->GetNbinsY(), vtxHist->GetYaxis()->GetXmin(), vtxHist->GetYaxis()->GetXmax());
2720 if (vtxHist->GetXaxis()->IsVariableBinSize())
2721 avgProf->GetXaxis()->Set(vtxHist->GetNbinsX(), vtxHist->GetXaxis()->GetXbins()->GetArray());
2722 if (vtxHist->GetYaxis()->IsVariableBinSize())
2723 avgProf->GetYaxis()->Set(vtxHist->GetNbinsY(), vtxHist->GetYaxis()->GetXbins()->GetArray());
2727 for (
Int_t e = 1; e <= vtxHist->GetNbinsX(); e++) {
2728 Double_t eta = vtxHist->GetXaxis()->GetBinCenter(e);
2729 for (
Int_t c = 1;
c <= vtxHist->GetNbinsY();
c++) {
2730 Double_t cent = vtxHist->GetYaxis()->GetBinCenter(
c);
2731 Double_t cont = vtxHist->GetBinContent(e,
c);
2732 if (cont == 0)
continue;
2733 avgProf->Fill(eta, cent, cont);
2787 if (a->GetNbins() !=
GetBinNumberSin()) AliFatal(
"SetupNUALabels: Wrong number of bins on axis");
2790 while (i <= a->GetNbins()) {
2791 a->SetBinLabel(i++, Form(
"<<cos(%d#varphi)>>", j));
2792 a->SetBinLabel(i++, Form(
"<<sin(%d#varphi)>>", j++));
2813 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC_{%d}{2} > 0", i));
2814 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC_{%d}{2} <= 0", i));
2815 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC'_{%d}{2} > 0", i));
2816 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC'_{%d}{2} <= 0", i));
2818 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC_{%d}{4} < 0", i));
2819 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC_{%d}{4} >= 0", i));
2820 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC'_{%d}{4} < 0", i));
2821 quality->GetXaxis()->SetBinLabel(j++, Form(
"QC'_{%d}{4} >= 0", i));
2841 Bool_t ref = ((ctype[0] ==
'R') || (ctype[0] ==
'r'));
2851 TH2D* h =
new TH2D(Form(
"%sQC%d_v%d_%s_%sCorr%s_vtx_%d_%d",
2852 fType.Data(), qc, n, ctype, ntype.Data(),
2854 Form(
"%sQC%d_v%d_%s_%sCorr%s_vtx_%d_%d",
2855 fType.Data(), qc, n, ctype, ntype.Data(),
2857 xAxis->GetNbins(), xAxis->GetXmin(), xAxis->GetXmax(),
2858 yAxis->GetNbins(), yAxis->GetXmin(), yAxis->GetXmax());
2859 if (xAxis->IsVariableBinSize()) h->GetXaxis()->Set(xAxis->GetNbins(), xAxis->GetXbins()->GetArray());
2860 h->GetYaxis()->Set(yAxis->GetNbins(), yAxis->GetXbins()->GetArray());
2870 Printf(
"=======================================================");
2871 Printf(
"%s::Print", this->IsA()->GetName());
2872 Printf(
"Forward detector: :\t%s", ((
fFlowFlags &
kFMD) ?
"FMD" :
"VZERO"));
2873 Printf(
"Number of bins in vertex axis :\t%d",
fVtxAxis->GetNbins());
2874 Printf(
"Range of vertex axis :\t[%3.1f,%3.1f]",
2876 Printf(
"Number of bins in centrality axis :\t%d",
fCentAxis->GetNbins());
2877 printf(
"Centrality binning :\t");
2880 if (cBin ==
fCentAxis->GetNbins()) printf(
"\n");
2881 else if (cBin % 4 == 0) printf(
"\n\t\t\t\t\t");
2883 printf(
"Doing flow analysis for :\t");
2886 TString type =
"Standard QC{2} and QC{4} calculations.";
2889 if ((
fFlowFlags &
kTPC) == kTPC) type.ReplaceAll(
".",
" with TPC tracks for reference.");
2890 if ((
fFlowFlags &
kHybrid) == kHybrid) type.ReplaceAll(
".",
" with hybrid tracks for reference.");
2891 Printf(
"QC calculation type :\t%s", type.Data());
2892 Printf(
"Symmetrize ref. flow wrt. eta = 0 :\t%s", ((
fFlowFlags &
kSymEta) ?
"true" :
"false"));
2893 Printf(
"Apply NUA correction terms :\t%s", ((
fFlowFlags &
kNUAcorr) ?
"true" :
"false"));
2894 Printf(
"Satellite vertex flag :\t%s", ((
fFlowFlags &
kSatVtx) ?
"true" :
"false"));
2895 Printf(
"FMD sigma cut: :\t%f",
fFMDCut);
2896 Printf(
"SPD sigma cut: :\t%f",
fSPDCut);
2898 Printf(
"Eta gap: :\t%f",
fEtaGap);
2899 Printf(
"=======================================================");
2917 if ((flags &
kStdQC)) type =
"StdQC";
2918 else if ((flags &
kEtaGap)) type =
"EtaGap";
2919 else if ((flags &
k3Cor)) type =
"3Cor";
2920 else type =
"UNKNOWN";
2921 if (prependUS) type.Prepend(
"_");
2922 if ((flags &
kTPC) == kTPC) type.Append(
"TPCTr");
2923 if ((flags &
kHybrid) == kHybrid) type.Append(
"HybTr");
2939 if (n < 0) AliFatal(Form(
"CumuHistos out of range: (%c,%d)", t, n));
2943 if (t ==
'r' || t ==
'R') pos = n;
2944 else if (t ==
'd' || t ==
'D') pos = n;
2945 else if (t ==
'a' || t ==
'A') pos = 2*n;
2946 else if (t ==
'b' || t ==
'B') pos = 2*n+1;
2947 else AliFatal(Form(
"CumuHistos wrong type: %c", t));
2949 if (t ==
'r' || t ==
'R') {
2950 if (pos < fRefHists->GetEntries()) {
2951 h = (
TH1*)fRefHists->At(pos);
2953 }
else if (pos < fDiffHists->GetEntries()) {
2954 h = (
TH1*)fDiffHists->At(pos);
2956 if (!h) AliFatal(Form(
"No hist found in list %c at pos %d", t, pos));
2971 ref.ReplaceAll(
"Cumu",
"CumuRef");
2972 fRefHists = (
TList*)l->FindObject(ref.Data());
2974 fRefHists =
new TList();
2975 fRefHists->SetName(ref.Data());
2979 if (fRefHists->GetEntries() != (
fMaxMoment-1.)*(fNUA+1))
2980 AliError(
"CumuHistos::ConnectList Wrong number of hists in ref list," 2981 "you are doing something wrong!");
2984 diff.ReplaceAll(
"Cumu",
"CumuDiff");
2985 fDiffHists = (
TList*)l->FindObject(diff.Data());
2987 fDiffHists =
new TList();
2988 fDiffHists->SetName(diff.Data());
2992 if ((fDiffHists->GetEntries() != (
fMaxMoment-1.)*(fNUA+1)) &&
2993 (fDiffHists->GetEntries() != 2*(
fMaxMoment-1.)*(fNUA+1)))
2994 AliError(Form(
"CumuHistos::ConnectList Wrong number of hists in diff list," 2995 "you are doing something wrong! (%s)",name.Data()));
3009 if (name.Contains(
"Ref")) {
3010 if (fRefHists) fRefHists->Add(h);
3011 else AliFatal(
"CumuHistos::Add() - fRefHists does not exist");
3013 if (fRefHists->GetEntries() > (fNUA+1)*(
fMaxMoment-1.))
3014 AliError(
"CumuHistos::Add wrong number of hists in ref list, " 3015 "you are doing something wrong!");
3017 else if (name.Contains(
"Diff")) {
3018 if (fDiffHists) fDiffHists->Add(h);
3019 else AliFatal(
"CumuHistos::Add() - fDiffHists does not exist");
3021 if (fDiffHists->GetEntries() > 2*(fNUA+1)*(
fMaxMoment-1.))
3022 AliError(
"CumuHistos::Add wrong number of hists in diff list, " 3023 "you are doing something wrong!");
virtual void UserExec(Option_t *option)
Bool_t HasCentrality() const
Double_t CalculateNUAMatrixElement(Int_t n, Int_t m, Char_t type, Int_t binA, Int_t cBin) const
void Calculate3CorFlow(CumuHistos &cumu2h, TH2I *quality, TH1D *chist, TH2D *dNdetaRef, TH2D *dNdetaDiff) const
AliVVZERO * GetVZERO() const
void AddOutput(TList *list, TAxis *centAxis)
void EndVtxBinList(const TList &list) const
void CumulantsAccumulate3Cor(Double_t cent)
void CalculateDifferentialFlow(CumuHistos &cumu2h, CumuHistos &cumu4h, TH2I *quality, TH2D *dNdetaDiff) const
Bool_t FillTracks(VertexBin *bin, UShort_t mode) const
void AddVertexBins(CumuHistos &cumu, TList *list, UInt_t nNUA) const
virtual Bool_t GetVertex(const AliAODForwardMult *aodfm)
TH1 * Get(Char_t t, Int_t n, UInt_t nua=0) const
virtual void InitVertexBins()
static AliAODEvent * GetAODEvent(AliAnalysisTaskSE *task)
virtual void Terminate(Option_t *option)
void FillVtxBinList3Cor(const TList &list, TH2D &hcent, TH2D &hfwd, Int_t vtx, UShort_t flags=0x0)
void SetupNUALabels(TAxis *a) const
Int_t GetBinNumberCos(Int_t n=0) const
static Bool_t IsTriggerBits(UInt_t bits, UInt_t trg)
void ConnectList(TString name, TList *l)
Various utilities used in PWGLF/FORWARD.
void CalculateReferenceFlow(CumuHistos &cumu2h, CumuHistos &cumu4h, TH2I *quality, TH1D *chist, TH2D *dNdetaRef) const
void CumulantsTerminate(TList *inlist, TList *outlist)
Bool_t FillTracks(TObjArray *trList, AliESDEvent *esd, AliAnalysisFilter *trFilter, UShort_t mode)
VertexBin & operator=(const VertexBin &v)
void FillVtxBinList(const TList &list, TH2D &h1, Int_t vtx, UShort_t flags=0x0) const
void CumulantsAccumulate(Double_t cent)
AliAnalysisFilter * fTrackCuts
void PrintFlowSetup() const
void GetLimits(Int_t bin, Int_t &aLow, Int_t &aHigh, Int_t &bLow, Int_t &bHigh) const
TH2D & CombineHists(TH2D &hcent, TH2D &hfwd)
Double_t nEvents
plot quality messages
Int_t GetPos(Int_t n, UInt_t nua) const
virtual Bool_t GetCentrality(const AliAODForwardMult *aodfm)
AliForwardFlowTaskQC & operator=(const AliForwardFlowTaskQC &)
virtual Bool_t CheckEvent(const AliAODForwardMult *aodfm)
virtual Bool_t CheckTrigger(const AliAODForwardMult *aodfm) const
const TH2D & GetHistogram() const
TH2D * MakeOutputHist(Int_t qc, Int_t n, const Char_t *ctype, UInt_t nua) const
static UShort_t CheckForAOD()
void SetFlowFlags(UShort_t flags)
void MakeCentralityHists(TList *list) const
Bool_t FillHists(TH2D &dNdetadphi, Double_t cent, UShort_t mode)
TH2I * MakeQualityHist(const Char_t *name) const
Float_t GetCentrality() const
void SolveCoupledFlowEquations(CumuHistos &cumu, Char_t type) const
virtual void UserCreateOutputObjects()
static const Char_t * GetQCType(UShort_t flags, Bool_t prependUS=kTRUE)
void SetCentralityAxis(TAxis *axis)
void FillVZEROHist(AliVVZERO *vzero)
const TH2D & GetHistogram() const
void FillVtxBinListEtaGap(const TList &list, TH2D &href, TH2D &hdiff, Int_t vtx, UShort_t flags=0x0) const
Int_t GetBinNumberSin(Int_t n=0) const