12 #include <AliAnalysisTaskSE.h> 18 #include <AliVVertex.h> 19 #include <AliVertex.h> 20 #include <AliAnalysisManager.h> 21 #include <AliVEventHandler.h> 22 #include <AliInputEventHandler.h> 23 #include <AliMultSelection.h> 24 #include <AliCentrality.h> 26 #include <TClonesArray.h> 30 #include <TGraphErrors.h> 35 class AliMultSelection;
147 const char* weights=0,
148 const char* sumFile=0,
149 const char* resFile=0);
459 const TAxis& etaAxis,
460 const TAxis& ipzAxis,
461 const TAxis& deltaAxis)
539 Histos(
const char* name=
"", Color_t
color=kBlack, Style_t style=1,
540 UChar_t mask=0, UChar_t veto=0)
642 const TAxis& etaAxis,
643 const TAxis& ipzAxis,
644 const TAxis& deltaAxis);
701 Bool_t ProjectEtaDeltaPdgPart(Container* result,
707 Bool_t ProjectEtaDeltaPdg(Container* result,
711 Bool_t ProjectEtaPdgIPz(Container* result,
808 Histos* MakeHistos(
const char* name,
824 const TAxis& etaAxis,
825 const TAxis& ipzAxis,
826 const TAxis& deltaAxis);
898 Bool_t EstimateBackground(Container* result,
976 const TAxis& deltaAxis);
1003 const AliVVertex*& ip,
1004 TClonesArray*& tracklets);
1034 const AliVVertex*
FindRealIP(AliVEvent* event,
1046 const AliVVertex*
CheckIP(
const AliVVertex* ip,
1059 const AliVVertex*
FindIP(AliVEvent* event,
1167 const AliVVertex* ip,
1168 TClonesArray* tracklets);
1478 Info(
"SetWeightCalc",
"Use=%d",
mode);
1479 if (fWeights) fWeights->SetCalc(
mode);}
1486 Info(
"SetWeightMask",
"mask=0x%x", mask);
1487 if (fWeights) fWeights->SetMask(mask); }
1494 Info(
"SetWeightVeto",
"veto=0x%x", veto);
1495 if (fWeights) fWeights->SetVeto(veto); }
1632 DefineOutput(1, Container::Class());
1633 DefineOutput(2, Container::Class());
1677 if (&o ==
this)
return *
this;
1714 if (&o ==
this)
return *
this;
1720 const char* resFile)
1724 AliError(
"No analysis manager to connect to.");
1734 if (sumFile && sumFile[0] !=
'\0') sumOut = sumFile;
1735 if (resFile && resFile[0] !=
'\0') resOut = resFile;
1736 else if (sumFile && sumFile[0] !=
'\0') resOut = sumFile;
1739 if (sumOut.IsNull() || sumOut.EqualTo(
"default", TString::kIgnoreCase))
1740 sumOut = AliAnalysisManager::GetCommonFileName();
1742 if (resOut.IsNull() || resOut.EqualTo(
"default", TString::kIgnoreCase))
1743 resOut = AliAnalysisManager::GetCommonFileName();
1746 mgr->ConnectInput(
this, 0, mgr->GetCommonInputContainer());
1749 if (!sumOut.EqualTo(
"none", TString::kIgnoreCase)) {
1750 TString sumName(Form(
"%sSums", GetName()));
1751 AliAnalysisDataContainer* sumCon =
1752 mgr->CreateContainer(sumName, TList::Class(),
1753 AliAnalysisManager::kOutputContainer, sumOut);
1754 mgr->ConnectOutput(
this, 1, sumCon);
1758 if (!resOut.EqualTo(
"none", TString::kIgnoreCase)) {
1759 TString resName(Form(
"%sResults", GetName()));
1760 AliAnalysisDataContainer* resCon =
1761 mgr->CreateContainer(resName, TList::Class(),
1762 AliAnalysisManager::kParamContainer, resOut);
1763 mgr->ConnectOutput(
this, 2, resCon);
1771 if (shiftedDPhiCut < 0) shiftedDPhiCut = TMath::Sqrt(
fDeltaCut)*0.06;
1775 Printf(
"%s: %s", ClassName(), GetName());
1776 Printf(
" %22s: 0x%08x",
"Off-line trigger mask", fOfflineTriggerMask);
1777 Printf(
" %22s: %f",
"Delta phi shift",
fDPhiShift);
1778 Printf(
" %22s: %f",
"Shifted Delta phi cut", shiftedDPhiCut);
1779 Printf(
" %22s: %f",
"Delta cut",
fDeltaCut);
1780 Printf(
" %22s: %f",
"max Delta",
fMaxDelta);
1781 Printf(
" %22s: %f",
"tail Delta",
fTailDelta);
1782 Printf(
" %22s: %f",
"tail maximum", tailMax);
1783 Printf(
" %22s: %f%%",
"Absolute least c",
fAbsMinCent);
1786 Printf(
" %22s: %d",
"Min(Ntracklet)",
fMinEta1);
1795 Printf(
"--- Centrality bins");
1798 while ((bin = static_cast<CentBin*>(next()))) {
1806 if (!fWeights)
return;
1807 fWeights->Print(option);
1813 Printf(
" Centrality bin: %s", fName.Data());
1814 Printf(
" Low cut: %5.1f", fLow);
1815 Printf(
" High cut: %5.1f", fHigh);
1818 Printf(
" --- Histogram sets");
1821 while ((h = static_cast<Histos*>(next()))) {
1832 while ((h = static_cast<Histos*>(next()))) {
1837 void Bits2String(UChar_t m,
char out[7])
1852 char cMask[7]; Bits2String(fMask, cMask);
1853 char cVeto[7]; Bits2String(fVeto, cVeto);
1854 Printf(
" Histograms: %s", fName.Data());
1855 Printf(
" Mask: 0x%02x (%s)", fMask, cMask);
1856 Printf(
" Veto: 0x%02x (%s)", fVeto, cVeto);
1857 Printf(
" Delta: %s", fEtaDeltaIPz ?
"yes" :
"no");
1858 Printf(
" Delta per PDG: %s", fEtaDeltaPdg ?
"yes" :
"no");
1867 AliWarning(
"Failed to initialize on worker");
1876 if (DebugLevel() > 1) Printf(
"Initialising on worker");
1881 fContainer->SetName(Form(
"%sSums", GetName()));
1884 Bool_t save = TH1::GetDefaultSumw2();
1885 TH1::SetDefaultSumw2();
1890 TAxis trackletAxis(1000, 0, 10000);
1891 FixAxis(trackletAxis,
"#it{N}_{tracklets}");
1893 kGreen+2, 20, trackletAxis);
1895 kRed+2, 20, trackletAxis);
1902 kGreen+2, 20, trackletAxis);
1904 kRed+2, 20, trackletAxis);
1910 TAxis generatedAxis(1000, 0, 15000);
1911 FixAxis(generatedAxis,
"#it{N}_{generated,|#eta|<2}");
1913 kGreen+2, 24, generatedAxis);
1915 kRed+2, 24, generatedAxis);
1922 "Mean number of tracklets per centrality",
1934 TAxis clAxis(150, 0, 15000);
1935 FixAxis(clAxis,
"#it{N}_{cluster}");
1942 TH1::SetDefaultSumw2(save);
1950 params->SetName(
"parameters");
1953 params->Add(
new DP(
"DPhiShift",
fDPhiShift,
'f'));
1955 params->Add(
new DP(
"DeltaCut",
fDeltaCut,
'f'));
1956 params->Add(
new DP(
"MaxDelta",
fMaxDelta,
'f'));
1957 params->Add(
new DP(
"TailDelta",
fTailDelta,
'f'));
1958 params->Add(
new DP(
"TailMax",
fTailMax,
'f'));
1959 params->Add(
new DP(
"AbsMinCent",
fAbsMinCent,
'f'));
1962 AliWarning(
"Failed to initialize centrality bins");
1976 AliFatal(
"No weights set!");
1979 fWeights->SetDebug(fDebug);
1981 TAxis wAxis(100,0,10);
1986 kCyan+2, 24, wAxis, wAxis);
1996 const TAxis& deltaAxis)
2005 AliWarningF(
"Failed to initialize bin %s", ret->
GetName());
2017 if (DebugLevel() > 1)
2018 Printf(
"Initialising on centrality bins on %s",
2019 existing ?
"master" :
"worker");
2027 "#Delta=[(#Delta#phi-#delta#phi)/#sigma_{#phi}]^{2}+" 2028 "[#Delta#thetasin^{-2}(#theta)/#sigma_{#theta}]^{2}");
2031 if (!
InitCentBin(0,0,0,existing,deltaAxis))
return false;
2038 if (!
InitCentBin(i, c1, c2, existing, deltaAxis))
return false;
2040 if (!
InitCentBin(nCentBins+1, 0, 100, existing, deltaAxis))
return false;
2068 fSubs->SetOwner(
true);
2118 return new Histos(name, color, style, mask, veto);
2123 const TAxis& etaAxis,
2124 const TAxis& ipzAxis,
2125 const TAxis& deltaAxis)
2128 Printf(
"Initializing centrality bin %s",
fName.Data());
2129 if (!
Sub::WorkerInit(parent, etaAxis, ipzAxis, deltaAxis))
return false;
2132 FixAxis(centAxis,
"Centrality [%]");
2135 kMagenta+2,20,centAxis);
2142 while ((h = static_cast<Histos*>(next()))) {
2151 const TAxis& etaAxis,
2152 const TAxis& ipzAxis,
2153 const TAxis& deltaAxis)
2155 if (!
Sub::WorkerInit(parent, etaAxis, ipzAxis, deltaAxis))
return false;
2158 if (
GetC(parent,
"generated",
false) != 0) shrt.Append(
"'");
2161 if (!IsPrimary() && !IsSecondary())
2163 kRed+2, 20, etaAxis, ipzAxis);
2167 Form(
"#Delta_{%s}",shrt.Data()),
2168 kBlue+2, 21, etaAxis, deltaAxis, ipzAxis);
2169 if (!IsGenerated() &&
2175 "Parent particle type",
2176 kGreen+2, 22, etaAxis,
PdgAxis(), ipzAxis);
2178 if (IsGenerated()) {
2180 "Primary particle type",
2181 kYellow+2, 30, etaAxis,
PdgAxis());
2182 TAxis ptAxis(100, 0, 5);
2183 ptAxis.SetTitle(
"#it{p}_{T}");
2186 "Primary transverse momentum",
2187 kCyan+2, 30, etaAxis, ptAxis);
2189 if (IsPrimary() || IsSecondary() || IsCombinatoric()) {
2191 "#Delta by primary particle type",
2192 kMagenta, 22, etaAxis, deltaAxis,
PdgAxis());
2202 fEtaIPz->SetMarkerStyle(m);
2203 fEtaIPz->SetMarkerColor(c);
2204 fEtaIPz->SetLineColor(c);
2205 fEtaIPz->SetFillColor(c);
2208 fEtaDeltaIPz->SetMarkerStyle(m);
2209 fEtaDeltaIPz->SetMarkerColor(c);
2210 fEtaDeltaIPz->SetLineColor(c);
2211 fEtaDeltaIPz->SetFillColor(c);
2214 fEtaDeltaPdg->SetMarkerStyle(m);
2215 fEtaDeltaPdg->SetMarkerColor(c);
2216 fEtaDeltaPdg->SetLineColor(c);
2217 fEtaDeltaPdg->SetFillColor(c);
2220 fEtaPdgIPz->SetMarkerStyle(m);
2221 fEtaPdgIPz->SetMarkerColor(c);
2222 fEtaPdgIPz->SetLineColor(c);
2223 fEtaPdgIPz->SetFillColor(c);
2226 fEtaPdg->SetMarkerStyle(m);
2227 fEtaPdg->SetMarkerColor(c);
2228 fEtaPdg->SetLineColor(c);
2229 fEtaPdg->SetFillColor(c);
2232 fEtaPt->SetMarkerStyle(m);
2233 fEtaPt->SetMarkerColor(c);
2234 fEtaPt->SetLineColor(c);
2235 fEtaPt->SetFillColor(c);
2243 if (DebugLevel() > 0) Printf(
"In user exec");
2245 const AliVVertex* ip = 0;
2246 TClonesArray* tracklets = 0;
2248 if ((status &
kOKEvent) != kOKEvent) {
2249 AliWarningF(
"Event didn't pass %f, %p, %p", cent, ip, tracklets);
2252 if (DebugLevel() > 0) Printf(
"Got centrality=%f ipZ=%f %d tracklets",
2254 (ip ? ip->GetZ() : -1000),
2255 tracklets->GetEntriesFast());
2265 return (1 << (bin-1));
2271 TH1* status =
new TH1F(
"status",
"Status of task",
2273 status->SetMarkerSize(2);
2274 status->SetMarkerColor(kMagenta+2);
2275 status->SetLineColor(kMagenta+2);
2276 status->SetFillColor(kMagenta+2);
2277 status->SetFillStyle(1001);
2278 status->SetBarOffset(0.1);
2279 status->SetBarWidth(0.4);
2280 status->SetDirectory(0);
2281 status->SetStats(0);
2282 status->SetXTitle(
"Event have");
2283 status->SetYTitle(
"# Events");
2284 status->GetXaxis()->SetBinLabel(
kAll,
"Been seen");
2285 status->GetXaxis()->SetBinLabel(
kEvent,
"Event data");
2286 status->GetXaxis()->SetBinLabel(
kTracklets,
"Tracklets");
2287 status->GetXaxis()->SetBinLabel(
kTrigger,
"Trigger");
2288 status->GetXaxis()->SetBinLabel(
kIP,
"IP");
2289 status->GetXaxis()->SetBinLabel(
kCentrality,
"Centrality");
2290 status->GetXaxis()->SetBinLabel(
kCompleted,
"Completed");
2291 container->Add(status);
2297 const AliVVertex*& ip,
2298 TClonesArray*& tracklets)
2305 AliVEvent*
event = InputEvent();
2307 AliWarning(
"No event");
2315 if (!tracklets)
return ret;
2323 TIter nextTracklet(tracklets);
2324 while ((tracklet = static_cast<AliAODTracklet*>(nextTracklet()))) {
2326 if (signal && tracklet->
IsMeasured() && TMath::Abs(tracklet->
GetEta()) < 1) nOK++;
2332 if (!trg)
return ret;
2338 if (!ip)
return ret;
2343 Int_t nTracklets = 0;
2351 fIPz->Fill(ip->GetZ());
2368 if (!obj->IsA()->InheritsFrom(TClonesArray::Class())) {
2369 AliWarningF(
"Object %s is not a TClonesArray but a %s",
2370 obj->GetName(), obj->ClassName());
2373 return static_cast<TClonesArray*
>(obj);
2382 if (ip->GetNContributors() <= 0) {
2383 AliWarning(
"Not enough contributors for IP");
2387 if (ip->IsFromVertexerZ()) {
2390 ip->GetCovarianceMatrix(covar);
2391 Double_t sigmaZ = TMath::Sqrt(covar[5]);
2392 if (sigmaZ >= maxZError) {
2393 AliWarningF(
"IPz resolution = %f >= %f", sigmaZ, maxZError);
2398 if (ip->IsA()->InheritsFrom(AliVertex::Class())) {
2399 const AliVertex* ipv =
static_cast<const AliVertex*
>(ip);
2401 if (ipv->GetDispersion() >= maxDispersion) {
2402 AliWarningF(
"IP dispersion = %f >= %f",
2403 ipv->GetDispersion(), maxDispersion);
2412 AliWarningF(
"IPz = %fcm out of range [%f,%f]cm",
2424 const AliVVertex* ip =
event->GetPrimaryVertex();
2426 if (DebugLevel() > 1) AliWarning(
"No real IP for this event found!");
2429 return CheckIP(ip, maxDispersion, maxZError);
2437 static AliVertex* ip;
2440 ->FindListObject(
"AliAODSimpleHeader"));
2442 if (DebugLevel() > 1) AliWarning(
"No simple header");
2447 ip->SetXv(head->
fRecIP.X());
2448 ip->SetYv(head->
fRecIP.Y());
2449 ip->SetZv(head->
fRecIP.Z());
2450 ip->SetNContributors(10);
2452 return CheckIP(ip, maxDispersion, maxZError);
2460 const AliVVertex* ip =
FindRealIP(event,maxDispersion,maxZError);
2464 if (DebugLevel() > 1) AliWarning(
"No IP for this event found!");
2474 UInt_t evBits = fInputHandler->IsEventSelected();
2475 Bool_t trgOK = (evBits & fOfflineTriggerMask || fOfflineTriggerMask == 0);
2477 Printf(
"Trigger bits=0x%08x mask=0x%08x masked=0x%08x -> %s",
2478 evBits, fOfflineTriggerMask, evBits & fOfflineTriggerMask,
2479 trgOK ?
"selected" :
"rejected");
2486 if (centMeth.IsNull()) {
2489 AliCentrality* cent =
event->GetCentrality();
2490 if (!cent)
return -1;
2492 Double_t centPer = cent->GetCentralityPercentileUnchecked(centMeth);
2502 AliMultSelection* cent =
2503 static_cast<AliMultSelection*
>(
event->FindListObject(
"MultSelection"));
2505 AliWarning(
"No centrality in event");
2506 event->GetList()->Print();
2511 TString trkName(
"SPDTracklets");
2514 if (estName.EqualTo(
"fake", TString::kIgnoreCase)) estName =
"V0M";
2515 for (
Int_t i = 0; i < cent->GetNEstimators(); i++) {
2516 AliMultEstimator* e = cent->GetEstimator(i);
2518 if (estName.EqualTo(e->GetName()))
fCentIdx = i;
2519 if (trkName.EqualTo(e->GetName()))
fTrkIdx = i;
2520 else if (cl0Name.EqualTo(e->GetName()))
fCl0Idx = i;
2521 else if (cl1Name.EqualTo(e->GetName()))
fCl1Idx = i;
2524 AliWarning(
"Index for tracklet estimator not found!");
2526 AliWarning(
"Index for layer 0 cluster estimator not found!");
2528 AliWarning(
"Index for layer 1 cluster estimator not found!");
2531 AliWarningF(
"Centrality estimator %s not found",
fCentMethod.Data());
2536 AliMultEstimator* estCent = cent->GetEstimator(
fCentIdx);
2538 AliWarningF(
"Centrality estimator %s not available for this event",
2542 value = estCent->GetValue();
2546 AliMultEstimator* est = cent->GetEstimator(
fTrkIdx);
2547 if (est) nTracklets = est->GetValue();
2550 AliMultEstimator* est = cent->GetEstimator(
fCl0Idx);
2551 if (est) nCl0 = est->GetValue();
2554 AliMultEstimator* est = cent->GetEstimator(
fCl1Idx);
2555 if (est) nCl1 = est->GetValue();
2558 return estCent->GetPercentile();
2564 Int_t nCl0 = 0, nCl1 = 0;
2576 Int_t nCl0 = 0, nCl1 = 0;
2582 TIter nextTracklet(tracklets);
2583 Int_t nTracklet = 0;
2584 while ((tracklet = static_cast<AliAODTracklet*>(nextTracklet()))) {
2588 nTracklets = nTracklet;
2603 if (
fCentMethod.EqualTo(
"MB", TString::kIgnoreCase)) {
2604 Printf(
"MB centrality - not checked");
2609 if (
fCentMethod.EqualTo(
"fake",TString::kIgnoreCase))
2616 if (DebugLevel() > 1) Printf(
"Read centrality: %f%%", centPer);
2617 if (centPer < -safety)
return -2;
2618 if (centPer < +safety) centPer = safety;
2619 else if (centPer > 100-safety) centPer = 100-safety;
2622 AliWarningF(
"Centrality = %f lower than absolute minimum [%f]",
2627 AliWarningF(
"Centrality = %f out of range [%f,%f]",
2651 Double_t w = fWeights->LookupWeight(tracklet, cent, ipz, fWeightCorr);
2653 fEtaWeight->Fill(tracklet->
GetEta(), cent, w);
2658 case 310: printf(
"K0s ");
break;
2659 case 321: printf(
"K+- ");
break;
2660 case 3122: printf(
"Lambda");
break;
2661 case 3112: printf(
"Sigma-");
break;
2663 case 3222: printf(
"Sigma+");
break;
2664 case 3312: printf(
"Xi- ");
break;
2666 default: ok =
false;
break;
2670 case 0: printf(
" ");
break;
2671 case 310: printf(
"-K0s ");
break;
2672 case 321: printf(
"-K+- ");
break;
2673 case 3122: printf(
"-Lambda");
break;
2674 case 3112: printf(
"-Sigma-");
break;
2676 case 3222: printf(
"-Sigma+");
break;
2677 case 3312: printf(
"-Xi- ");
break;
2679 default: printf(
"-Other ");
2681 printf(
": %f", w); tracklet->
Print();
2686 printf(
"Looking up weight of tracklet -> %f ", w);
2710 const AliVVertex* ip,
2711 TClonesArray* tracklets)
2714 Double_t ipz = (ip ? ip->GetZ() : -1000);
2719 while ((bin = static_cast<CentBin*>(nextAcc()))) {
2721 if (!bin->
Accept(status, cent, ipz))
continue;
2726 if (nAcc <= 0)
return;
2734 TIter nextTracklet(tracklets);
2735 while ((tracklet = static_cast<AliAODTracklet*>(nextTracklet()))) {
2740 nMeasured += weight;
2743 else nGood += weight;
2747 TMath::Abs(tracklet->
GetEta()) <= 1) nGenerated ++;
2748 TIter nextBin(&toRun);
2749 while ((bin = static_cast<CentBin*>(nextBin()))) {
2753 TIter nextBin(&toRun);
2754 while ((bin = static_cast<CentBin*>(nextBin()))) {
2779 if (!centOK)
return false;
2811 while ((h = static_cast<Histos*>(next())))
2822 if (!fEtaIPz && !fEtaDeltaIPz)
return true;
2826 UChar_t flags = tracklet->
GetFlags();
2832 if (
fDebug > 3) Bits2String(flags, m);
2835 if (fMask != 0 && (flags & fMask) == 0) {
2836 if (
fDebug > 3) Printf(
"%14s (0x%02x,----) %6s %7s (0x%02x) ",
2837 GetName(),fMask,
"reject",m,flags);
2842 if (fEtaPdgIPz || fEtaPdg || fEtaDeltaPdg) {
2852 fEtaPdg->Fill(eta, pdgBin, weight);
2855 if (fVeto != 0 && (flags & fVeto) != 0) {
2856 if (
fDebug > 3) Printf(
"%14s (----,0x%02x) %6s %7s (0x%02x) ",
2857 GetName(), fVeto,
"veto", m, flags);
2861 if (
fDebug > 3) Printf(
"%14s (0x%02x,0x%02x) %6s %7s (0x%02x) ",
2862 GetName(), fMask, fVeto,
"accept", m, flags);
2866 fEtaDeltaPdg ->Fill(eta, delta, pdgBin, weight);
2868 if (pdgBin2 >= 0) fEtaPdgIPz->Fill(eta, delta, pdgBin2, weight);
2872 if (fEtaIPz && (signal == 0x3)) fEtaIPz->Fill(eta, ipZ, weight);
2874 if (fEtaDeltaIPz && (signal & 0x2)) fEtaDeltaIPz->Fill(eta,delta,ipZ,weight);
2877 if (!fEtaPdgIPz && !fEtaPt)
return true;
2880 fEtaPdgIPz ->Fill(eta, pdgBin, ipZ, weight);
2882 if (pdgBin2 >= 0) fEtaPdgIPz->Fill(eta, pdgBin2, ipZ, weight);
2885 if (fEtaPt) fEtaPt ->Fill(eta, tracklet->
GetParentPt(), weight);
2900 Bool_t save = TH1::GetDefaultSumw2();
2901 TH1::SetDefaultSumw2();
2904 if (GetOutputData(2)) {
2905 Warning(
"Terminate",
"Already have a result container, making a new one");
2906 resName.Append(
"New");
2909 results->SetName(resName);
2910 results->SetOwner();
2915 AliWarning(
"No sum container found!");
2920 AliWarningF(
"Failed to initialize centrality bins from %s",
2926 AliWarning(
"Failed to finalize results");
2930 PostData(2, results);
2931 TH1::SetDefaultSumw2(save);
2946 while ((h = static_cast<Histos*>(next())))
2960 if (
GetName()[0] ==
'm' &&
GetC(parent,
"generated")) {
2963 fEtaIPz->SetTitle(Form(
"%s'", fEtaIPz->GetTitle()));
2965 fEtaDeltaIPz->SetTitle(Form(
"#Delta_{%s}", fEtaIPz->GetTitle()));
2985 results->Add(
new DP(
"triggerEfficiency",
fTriggerEff));
2988 if (fOfflineTriggerMask & AliVEvent::kMB) {
2995 else if (fOfflineTriggerMask & AliVEvent::kINT7) {
2999 else if (fOfflineTriggerMask & AliVEvent::kINT5)
3001 else if (fOfflineTriggerMask == AliVEvent::kAny)
3003 results->Add(
new TNamed(
"trigger", tstr.Data()));
3007 Printf(
"Event summary:");
3011 fStatus->GetXaxis()->GetBinLabel(i));
3012 for (
Int_t i = 1; i <=
fCent->GetNbinsX(); i++)
3013 Printf(
" %6.2f-%6.2f%%: %d",
3014 fCent->GetXaxis()->GetBinLowEdge(i),
3015 fCent->GetXaxis()->GetBinUpEdge(i),
3019 fIPz ->Scale(1./nEvents);
3027 while ((bin = static_cast<CentBin*>(next()))) {
3029 AliWarningF(
"Failed to finalize %s", bin->
GetName());
3041 if (o && o->IsA()->InheritsFrom(TH1::Class())) {
3042 TH1* h =
static_cast<TH1*
>(o->Clone());
3047 AliWarningF(
"Object %p (etaWeight) is not a TH1 or not found",o);
3050 if (o && o->IsA()->InheritsFrom(TH1::Class())) {
3051 TH1* h =
static_cast<TH1*
>(o->Clone());
3056 AliWarningF(
"Object %p (weightCorr) is not a TH1 or not found",o);
3058 if (!fWeights)
return true;
3060 if (!fWeights->Retrieve(
fContainer))
return false;
3061 fWeights->Store(results);
3074 result->SetName(
fName);
3075 result->SetOwner(
true);
3076 parent->Add(result);
3079 status->Scale(1./status->GetBinContent(
kAll));
3082 Double_t vtxEff = status->GetBinContent(
kIP) / trigEff;
3085 result->Add(
new DP(
"triggerEfficiency", trigEff));
3086 result->Add(
new DP(
"ipEfficiency", vtxEff));
3091 ipZ->Scale(1./nEvents);
3094 cent->Scale(1./nEvents);
3103 while ((h = static_cast<Histos*>(next()))) {
3108 AliWarningF(
"Failed to finalize %s/%s",
GetName(), h->
GetName());
3119 AliWarningF(
"Failed to estimate Bg in %s/%s",
GetName(), h->
GetName());
3132 if (!fEtaPdg)
return true;
3135 TH2* etaPdg =
static_cast<TH2*
>(fEtaPdg->Clone());
3136 etaPdg->SetDirectory(0);
3137 etaPdg->Scale(1. / nEvents,
"width");
3138 result->Add(etaPdg);
3141 TAxis* yaxis = etaPdg->GetYaxis();
3142 Int_t first = yaxis->GetFirst();
3143 Int_t last = yaxis->GetLast();
3144 THStack* pdgs =
new THStack(
"all",
"");
3145 THStack* toPion =
new THStack(
"toPion",
"");
3146 THStack* toAll =
new THStack(
"toAll",
"");
3149 pdgOut->SetName(
"mix");
3150 result->Add(pdgOut);
3152 pdgOut->Add(toPion);
3155 TH1* all =
static_cast<TH1*
>(etaPdg->ProjectionX(
"total",
3156 1,etaPdg->GetNbinsY()));
3157 all->SetDirectory(0);
3158 all->SetName(
"total");
3159 all->SetTitle(
"All");
3160 all->SetYTitle(Form(
"d#it{N}_{%s}/d#eta",
"all"));
3161 all->SetFillColor(kBlack);
3162 all->SetMarkerColor(kBlack);
3163 all->SetLineColor(kBlack);
3164 all->SetMarkerStyle(20);
3165 all->SetFillStyle(0);
3166 all->SetFillColor(0);
3169 for (
Int_t i = 1; i <= etaPdg->GetNbinsY(); i++) {
3175 if (pdg < 0) pdg = 0;
3176 if (pdg == 22)
continue;
3178 TH1* h1 =
static_cast<TH1*
>(etaPdg->ProjectionX(Form(
"h%d", pdg),i,i));
3179 if (h1->GetEntries() <= 0)
continue;
3180 h1->SetDirectory(0);
3181 h1->SetName(Form(
"eta_%d", pdg));
3183 h1->SetYTitle(Form(
"d#it{N}_{%s}/d#eta", nme.Data()));
3184 h1->SetFillColor(col);
3185 h1->SetMarkerColor(col);
3186 h1->SetLineColor(col);
3187 h1->SetMarkerStyle(sty);
3188 h1->SetFillStyle(0);
3189 h1->SetFillColor(0);
3190 h1->SetBinContent(0,0);
3194 case 321: h1->SetBinContent(0, 0.15);
break;
3195 case 2212: h1->SetBinContent(0, 0.05);
break;
3196 case 310: h1->SetBinContent(0, 0.075);
break;
3197 case 3122: h1->SetBinContent(0, 0.018);
break;
3198 case 3212: h1->SetBinContent(0, 0.0055);
break;
3199 case 3322: h1->SetBinContent(0, 0.005);
break;
3200 case 211: h1->SetBinContent(0, 1);
break;
3201 default: h1->SetBinContent(0, -1);
break;
3205 if (pdg == 211) pion = h1;
3207 if (!pdgs->GetHists())
return true;
3209 TIter next(pdgs->GetHists());
3213 while ((tmp = static_cast<TH1*>(next()))) {
3214 if (tmp == all)
continue;
3216 TH1* rat =
static_cast<TH1*
>(tmp->Clone());
3218 rat->SetDirectory(0);
3219 rat->SetTitle(Form(
"%s / all", tmp->GetTitle()));
3222 if (tmp == pion)
continue;
3223 Double_t r276 = tmp->GetBinContent(0);
3224 if (r276 < 0 || r276 >= 1)
continue;
3227 rat =
static_cast<TH1*
>(tmp->Clone());
3229 rat->SetTitle(Form(
"%s / %s", tmp->GetTitle(), pion->GetTitle()));
3230 rat->SetDirectory(0);
3233 g->SetName(Form(
"%s_2760", rat->GetName()));
3234 g->SetTitle(Form(
"%s in #sqrt{s_{NN}}=2.76TeV", rat->GetTitle()));
3235 g->SetPoint(0,0,r276);
3236 g->SetPointError(0,.5,0);
3237 g->SetLineColor(rat->GetLineColor());
3238 g->SetLineStyle(rat->GetLineStyle());
3239 g->SetMarkerColor(rat->GetMarkerColor());
3240 g->SetMarkerStyle(rat->GetMarkerStyle());
3241 g->SetMarkerSize(1.5*rat->GetMarkerSize());
3242 rat->GetListOfFunctions()->Add(g,
"p");
3243 rat->SetMaximum(TMath::Max(rat->GetMaximum(),r276));
3244 rat->SetMinimum(TMath::Min(rat->GetMinimum(),r276));
3245 rmin = TMath::Min(rat->GetMinimum(),rmin);
3246 rmax = TMath::Max(rat->GetMaximum(),rmax);
3251 toPion->SetMaximum(1.1*rmax);
3266 pdgOut->SetName(pre);
3267 result->Add(pdgOut);
3268 TAxis* zaxis = fEtaDeltaPdg->GetZaxis();
3269 Int_t first = zaxis->GetFirst();
3270 Int_t last = zaxis->GetLast();
3272 Int_t nX = fEtaDeltaPdg->GetNbinsX();
3273 Int_t nY = fEtaDeltaPdg->GetNbinsY();
3274 Int_t nZ = fEtaDeltaPdg->GetNbinsZ();
3275 Int_t l1 = fEtaDeltaPdg->GetXaxis()->FindBin(-1);
3276 Int_t r1 = fEtaDeltaPdg->GetXaxis()->FindBin(+1);
3277 Int_t b1 = (isMid ? l1 : 1);
3278 Int_t b2 = (isMid ? r1 : l1-1);
3279 Int_t b3 = (isMid ? -1 : r1+1);
3280 Int_t b4 = (isMid ? -1 : nX);
3281 THStack*
stack =
new THStack(
"all", tit);
3284 TH1* total = fEtaDeltaPdg->ProjectionY(
"totalMid",1, 1,1, nZ);
3285 total->SetDirectory(0);
3286 total->SetName(
"total");
3287 total->SetTitle(
"Total");
3288 total->SetYTitle(Form(
"d#it{N}_{%s}/d#Delta",
"total"));
3289 total->SetFillColor(kBlack);
3290 total->SetMarkerColor(kBlack);
3291 total->SetLineColor(kBlack);
3292 total->SetMarkerStyle(24);
3293 total->SetFillStyle(0);
3294 total->SetFillColor(0);
3298 THStack* ratios =
new THStack(
"ratios",
"");
3299 TH1* ratioSig =
Make1D(0,
"ratioSig",
"Ratio to all", kGreen+1, 24, *zaxis);
3300 TH1* ratioBg =
Make1D(0,
"ratioBg",
"Ratio to all", kRed+1, 25, *zaxis);
3301 ratioSig->GetXaxis()->LabelsOption(
"v");
3302 ratioBg ->GetXaxis()->LabelsOption(
"v");
3303 ratioSig->SetFillColor(kGreen+1);
3304 ratioBg ->SetFillColor(kRed +1);
3305 ratioSig->SetFillStyle(1001);
3306 ratioBg ->SetFillStyle(1001);
3307 ratioSig->SetBarWidth(0.4);
3308 ratioBg ->SetBarWidth(0.4);
3309 ratioSig->SetBarOffset(0.05);
3310 ratioBg ->SetBarOffset(0.55);
3311 ratios->Add(ratioSig,
"bar0 e text30");
3312 ratios->Add(ratioBg,
"bar0 e text30");
3313 pdgOut->Add(ratios);
3315 THStack* rows =
new THStack(
"rows",
"");
3316 TH1* rowSig =
new TH1D(
"rowSig",
"row",6,0,6);
3317 rowSig->SetDirectory(0);
3318 rowSig->SetYTitle(
"Fraction of signal");
3319 rowSig->GetXaxis()->SetBinLabel(1,
"K^{0}_{S}");
3320 rowSig->GetXaxis()->SetBinLabel(2,
"K^{#pm}");
3321 rowSig->GetXaxis()->SetBinLabel(3,
"#Lambda");
3322 rowSig->GetXaxis()->SetBinLabel(4,
"#Xi");
3323 rowSig->GetXaxis()->SetBinLabel(5,
"#Sigma");
3324 rowSig->GetXaxis()->SetBinLabel(6,
"Other");
3325 rowSig->GetXaxis()->LabelsOption(
"v");
3326 rowSig->SetMaximum(100);
3327 rowSig->SetMinimum(0);
3328 rowSig->SetLineColor(kGreen+1);
3329 rowSig->SetMarkerColor(kGreen+1);
3330 rowSig->SetMarkerStyle(24);
3331 TH1* rowBg =
static_cast<TH1*
>(rowSig->Clone(
"rowBg"));
3332 rowBg->SetDirectory(0);
3333 rowBg->SetYTitle(
"Fraction of background");
3334 rowBg->SetLineColor(kRed+1);
3335 rowBg->SetMarkerColor(kRed+1);
3336 rowBg->SetMarkerStyle(25);
3337 rowSig->SetFillStyle(1001);
3338 rowBg ->SetFillColor(1001);
3339 rowSig->SetFillColor(kGreen+1);
3340 rowBg ->SetFillColor(kRed +1);
3341 rowSig->SetBarWidth(0.4);
3342 rowBg ->SetBarWidth(0.4);
3343 rowSig->SetBarOffset(0.05);
3344 rowBg ->SetBarOffset(0.55);
3345 rows->Add(rowSig,
"bar0 e text30");
3346 rows->Add(rowBg,
"bar0 e text30");
3355 for (
Int_t i = 1; i <= zaxis->GetNbins(); i++) {
3362 if (pdg < 0) pdg = 0;
3363 ratioSig->GetXaxis()->SetBinLabel(i, nme);
3364 ratioBg ->GetXaxis()->SetBinLabel(i, nme);
3365 if (pdg == 22)
continue;
3368 TH1* h1 = fEtaDeltaPdg->ProjectionY(Form(
"%d", pdg), b1, b2, i,i);
3369 h1->SetDirectory(0);
3371 TH1* h2 = fEtaDeltaPdg->ProjectionY(Form(
"t%d", pdg), b3, b4, i,i);
3372 h2->SetDirectory(0);
3377 if (h1->GetEntries() <= 0)
continue;
3378 h1->SetName(Form(
"%d", pdg));
3380 h1->SetYTitle(Form(
"d#it{N}_{%s}/d#Delta", nme.Data()));
3381 h1->SetFillColor(col);
3382 h1->SetMarkerColor(col);
3383 h1->SetLineColor(col);
3384 h1->SetMarkerStyle(sty);
3385 h1->SetFillStyle(0);
3386 h1->SetFillColor(0);
3387 h1->SetBinContent(0,ipdg);
3393 case 321: ptr = &hKpm;
break;
3394 case 310: ptr = &hK0S;
break;
3397 case 3222: ptr = &
hSigma;
break;
3400 case 3312: ptr = &hXi;
break;
3401 case 3122: ptr = &hLambda;
break;
3402 default: ptr = &hOther;
break;
3405 *ptr =
static_cast<TH1*
>(h1->Clone());
3407 (*ptr)->SetDirectory(0);
3408 if (ptr == &hOther) {
3409 (*ptr)->SetTitle(
"Other");
3410 (*ptr)->SetName(
"0");
3416 total->SetBinContent(0,0);
3417 total->Scale(1./nEvents);
3423 TH1* totInt =
new TH1D(
"totalIntegrals",
"Integrals of total:", 3, 0, 3);
3424 totInt->SetDirectory(0);
3425 totInt->GetXaxis()->SetBinLabel(1,Form(
"0#minus%4.1f", tailMax));
3426 totInt->GetXaxis()->SetBinLabel(2,Form(
"0#minus%3.1f",deltaCut));
3427 totInt->GetXaxis()->SetBinLabel(3,Form(
"%3.1f#minus%4.1f",tailDelta,tailMax));
3428 totInt->SetBinContent(1,iTot); totInt->SetBinError(1, eTot);
3429 totInt->SetBinContent(2,iSig); totInt->SetBinError(2, eSig);
3430 totInt->SetBinContent(3,iBg); totInt->SetBinError(3, eBg);
3431 pdgOut->Add(totInt);
3433 if (!stack->GetHists()) {
3434 AliWarningF(
"No histograms in the stack %s", stack->GetName());
3437 TH1* spec[] = { hK0S, hKpm, hLambda, hXi,
hSigma, hOther, 0 };
3440 for (
Int_t pbin=1; pbin<=6; pbin++) {
3441 TH1* h = spec[pbin-1];
3443 h->Scale(1./ nEvents);
3449 Printf(
"%10s (%d) signal=%6.4f+/-%6.4f background=%6.4f+/-%6.4f " 3450 "ratios %6.4f+/-%6.4f %6.4f+/-%6.4f",
3451 h->GetTitle(), pbin, iiSig, eiSig, iiBg, eiBg, rS, erS, rB, erB);
3453 rowSig->SetBinContent(pbin,100*rS);
3454 rowSig->SetBinError (pbin,100*TMath::Sqrt(erS));
3455 rowBg ->SetBinContent(pbin,100*rB);
3456 rowBg ->SetBinError (pbin,100*TMath::Sqrt(erB));
3459 TIter next(stack->GetHists());
3461 while ((tmp = static_cast<TH1*>(next()))) {
3464 if (tmp == total)
continue;
3465 Int_t pdg = tmp->GetBinContent(0); tmp->SetBinContent(0,0);
3466 tmp->Scale(1./ nEvents);
3471 Int_t bin = tmp->GetUniqueID();
3473 Printf(
" %10s(%4d,%3d) " 3474 "signal=%6.1f/%6.1f=%5.3f+/-%5.3f bg=%6.1f/%6.1f=%5.3f+/-%5.3f",
3475 tmp->GetTitle(),
pdg, bin, iiSig, iSig, rS, erS, iiBg, iBg, rB, erB);
3477 ratioSig->SetBinContent(bin, rS);
3478 ratioSig->SetBinError (bin, erS);
3479 ratioBg ->SetBinContent(bin, rB);
3480 ratioBg ->SetBinError (bin, erB);
3494 if (!fEtaDeltaPdg)
return true;
3497 pdgOut->SetName(
"specie");
3498 result->Add(pdgOut);
3500 ProjectEtaDeltaPdgPart(pdgOut,
3506 ProjectEtaDeltaPdgPart(pdgOut,
3522 if (!fEtaPdgIPz)
return true;
3526 result->Add(etaPdgIPz);
3529 TAxis* yaxis = etaPdgIPz->GetYaxis();
3530 Int_t first = yaxis->GetFirst();
3531 Int_t last = yaxis->GetLast();
3532 THStack* pdgs =
new THStack(
"all",
"");
3533 THStack* ratios =
new THStack(
"toPion",
"");
3537 pdgOut->SetName(
"types");
3538 result->Add(pdgOut);
3540 pdgOut->Add(ratios);
3541 for (
Int_t i = 1; i <= etaPdgIPz->GetNbinsY(); i++) {
3542 yaxis->SetRange(i,i);
3549 if (pdg < 0) pdg = 0;
3551 TH2* h2 =
static_cast<TH2*
>(etaPdgIPz->Project3D(
"zx e"));
3552 if (h2->GetEntries() <= 0)
continue;
3553 h2->SetDirectory(0);
3554 h2->SetName(Form(
"etaIPz_%d", pdg));
3555 h2->SetTitle(Form(
"%s#rightarrowX_{%s}", nme.Data(), shn.Data()));
3556 h2->SetYTitle(Form(
"d#it{N}^{2}_{%s#rightarrow%s}/" 3557 "(d#etadIP_{#it{z}})",
3558 nme.Data(), shn.Data()));
3559 h2->SetFillColor(col);
3560 h2->SetMarkerColor(col);
3561 h2->SetLineColor(col);
3565 h1->SetDirectory(0);
3566 h1->SetYTitle(Form(
"d#it{N}_{%s#rightarrow%s}/d#eta",
3567 nme.Data(), shn.Data()));
3568 h1->SetMarkerStyle(sty);
3571 if (pdg == 211) pion = h1;
3600 dtfs =
static_cast<TH2*
>(tmp->Clone(
"dtfs"));
3601 dtfs->SetDirectory(0);
3602 dtfs->SetTitle(
"X_{s}#rightarrowX");
3603 dtfs->SetYTitle(
"IP_{#it{z}} [cm]");
3611 if (!pdgs->GetHists()) {
3612 yaxis->SetRange(first, last);
3616 TIter next(pdgs->GetHists());
3618 while ((tmp = static_cast<TH1*>(next()))) {
3619 if (tmp == pion)
continue;
3620 TH1* rat =
static_cast<TH1*
>(tmp->Clone());
3622 rat->SetDirectory(0);
3626 yaxis->SetRange(first, last);
3637 result->SetName(
fName);
3638 result->SetOwner(
true);
3639 parent->Add(result);
3648 result->Add(etaIPz);
3652 TH2* etaPt =
static_cast<TH2*
>(fEtaPt->Clone());
3653 etaPt->SetDirectory(0);
3654 etaPt->Scale(1. / nEvents,
"width");
3658 TString shn(etaIPz ? etaIPz->GetTitle() :
"X");
3660 ProjectEtaPdg (result, nEvents);
3661 ProjectEtaDeltaPdg(result, nEvents, tailDelta, tailMax);
3662 ProjectEtaPdgIPz (result, ipz, shn);
3665 if (!fEtaDeltaIPz)
return true;
3671 result->Add(etaDeltaIPz);
3675 result->Add(etaDelta);
3682 Double_t maxDelta = etaDeltaIPz->GetYaxis()->GetXmax();
3683 Int_t lowBin = etaDeltaIPz->GetYaxis()->FindBin(tailDelta);
3684 Int_t sigBin = etaDeltaIPz->GetYaxis()->FindBin(1.5);
3685 Int_t highBin = TMath::Min(etaDeltaIPz->GetYaxis()->FindBin(tailMax),
3686 etaDeltaIPz->GetYaxis()->GetNbins());
3689 TH1* etaDeltaTail = etaDelta->ProjectionX(
"etaDeltaTail");
3690 etaDeltaTail ->SetDirectory(0);
3691 etaDeltaTail ->Reset();
3692 etaDeltaTail ->SetTitle(Form(
"#scale[.7]{#int}_{%3.1f}^{%4.1f}" 3695 etaDeltaIPz->GetTitle(),
3696 etaDeltaIPz->GetTitle()));
3697 etaDeltaTail ->SetYTitle(
"#scale[.7]{#int}_{tail}d#Delta d#it{N}/d#Delta");
3699 TH2* etaIPzDeltaTail =
static_cast<TH2*
>(etaDeltaIPz->Project3D(
"zx e"));
3700 etaIPzDeltaTail->SetName(
"etaIPzDeltaTail");
3701 etaIPzDeltaTail->SetDirectory(0);
3702 etaIPzDeltaTail->Reset();
3703 etaIPzDeltaTail->SetTitle(etaDeltaTail->GetTitle());
3704 etaIPzDeltaTail->SetZTitle(etaDelta->GetYaxis()->GetTitle());
3705 TH2* etaIPzDeltaMain =
static_cast<TH2*
>(etaDeltaIPz->Project3D(
"zx e"));
3706 etaIPzDeltaMain->SetName(
"etaIPzDeltaMain");
3707 etaIPzDeltaMain->SetDirectory(0);
3708 etaIPzDeltaMain->Reset();
3709 etaIPzDeltaMain->SetTitle(etaDeltaTail->GetTitle());
3710 etaIPzDeltaMain->SetZTitle(etaDelta->GetYaxis()->GetTitle());
3713 for (
Int_t i = 1; i <= etaDeltaTail->GetNbinsX(); i++) {
3715 intg = etaDelta->IntegralAndError(i, i, lowBin, highBin, eintg);
3716 etaDeltaTail->SetBinContent(i, intg);
3717 etaDeltaTail->SetBinError (i, eintg);
3719 for (
Int_t j = 1; j <= etaIPzDeltaTail->GetNbinsY(); j++) {
3721 intg = etaDeltaIPz->IntegralAndError(i,i,lowBin,highBin,j,j,eintg);
3722 etaIPzDeltaTail->SetBinContent(i, j, intg);
3723 etaIPzDeltaTail->SetBinError (i, j, eintg);
3725 intg = etaDeltaIPz->IntegralAndError(i,i,1,sigBin,j,j,eintg);
3726 etaIPzDeltaMain->SetBinContent(i, j, intg);
3727 etaIPzDeltaMain->SetBinError (i, j, eintg);
3730 result->Add(etaIPzDeltaTail);
3731 result->Add(etaIPzDeltaMain);
3732 result->Add(etaDeltaTail);
3735 intg = etaDeltaIPz->IntegralAndError(1,etaDeltaIPz->GetNbinsX(),
3737 1,etaDeltaIPz->GetNbinsZ(),
3744 Printf(
"%10s: Integral over eta,IPz: %9.4f +/- %9.4f",
3746 intg = etaDelta->IntegralAndError(1,etaDeltaIPz->GetNbinsX(),
3749 Printf(
"%10s: Integral over eta: %9.4f +/- %9.4f",
3751 intg = delta->IntegralAndError(lowBin, highBin, eintg);
3752 Printf(
"%10s: Integral: %9.4f +/- %9.4f",
3767 if (!h || !measCont) {
3768 AliWarningF(
"No sub-histos or measured container in %s",
GetName());
3773 AliWarningF(
"Failed to finalize %s/%s",
GetName(), h->
GetName());
3779 AliWarningF(
"%s/%s didn't put a container on output",
3783 const char* sub = h->
GetName();
3784 TString shrt(Form(
"%c", sub[0]));
3786 if (genCont) shrt.Append(
"'");
3788 TH2* background = 0;
3789 TH2* etaIPzScale = 0;
3795 etaIPzScale =
CopyH2(measCont,
"etaIPzDeltaTail",
3797 etaIPzScale->Divide(
GetH2(bgCont,
"etaIPzDeltaTail"));
3798 etaIPzScale->SetZTitle(
"k_{#eta,IP_{#it{z}}}");
3799 etaIPzScale->SetTitle(Form(
"k_{%s,#eta,IP_{#it{z}}}",shrt.Data()));
3800 bgCont->Add(etaIPzScale);
3806 TH1* etaScale =
CopyH1(measCont,
"etaDeltaTail",
3808 etaScale->Divide(
GetH1(bgCont,
"etaDeltaTail"));
3809 etaScale->SetYTitle(
"k_{#eta}");
3810 etaScale->SetTitle(Form(
"k_{%s,#eta}", shrt.Data()));
3811 bgCont->Add(etaScale);
3818 Double_t measIntE =
GetD(measCont,
"deltaTailError", -1);
3822 Double_t scale =
RatioE(measIntg, measIntE, bgIntg, bgIntE, scaleE);
3829 "scaleEtaDeltaIPz"),
3831 scaledEtaDeltaIPz->SetTitle(Form(
"%5.3f#times%s",
3832 scale, scaledEtaDeltaIPz->GetTitle()));
3833 scaledEtaDeltaIPz->SetDirectory(0);
3834 scaledEtaDeltaIPz->SetYTitle(
"k#timesd^{3}#it{N}/" 3835 "(d#Deltad#etadIP_{#it{z}})");
3836 bgCont->Add(scaledEtaDeltaIPz);
3840 TH2* scaledEtaDelta =
CopyH2(bgCont,
"etaDelta",
"scaledEtaDelta");
3841 scaledEtaDelta->SetTitle(scaledEtaDeltaIPz->GetTitle());
3842 scaledEtaDelta->SetZTitle(
"k#timesd^{2}#it{N}/(d#Deltad#eta)");
3843 Scale(scaledEtaDelta, etaScale);
3844 bgCont->Add(scaledEtaDelta);
3846 TH1* scaledDelta =
CopyH1(bgCont,
"delta",
"scaledDelta");
3847 scaledDelta->SetTitle(scaledEtaDeltaIPz->GetTitle());
3848 scaledDelta->SetYTitle(
"k#timesd#it{N}/d#Delta");
3849 Scale(scaledDelta,scale,scaleE);
3850 bgCont->Add(scaledDelta);
3854 scaledEtaDelta->SetName(
"scaledEtaDelta");
3855 scaledEtaDelta->SetTitle(scaledEtaDeltaIPz->GetTitle());
3856 scaledEtaDelta->SetYTitle(
"k#timesd^{2}#it{N}/(d#Deltad#eta)");
3857 bgCont->Add(scaledEtaDelta);
3861 scaledDelta->SetName(
"scaledDelta");
3862 scaledDelta->SetTitle(scaledEtaDeltaIPz->GetTitle());
3863 scaledDelta->SetYTitle(
"k#timesd#it{N}/d#Delta");
3864 bgCont->Add(scaledDelta);
3867 background =
CopyH2(bgCont,
"etaIPz",
"background");
3868 if (!background) AliWarningF(
"Didn't get background in %s", sub);
3869 else background->Multiply(etaIPzScale);
3876 background =
CopyH2(bgCont,
"etaIPz",
"background");
3877 TH2* beta =
CopyH2(bgCont,
"etaIPz",
"beta");
3878 if (!background || !beta)
3879 AliWarningF(
"Didn't get background or beta in %s", sub);
3881 beta->Divide(
GetH1(measCont,
"etaIPz"));
3882 beta->SetTitle(Form(
"#beta_{%s}", shrt.Data()));
3887 AliWarningF(
"Didn't get background in %s", sub);
3890 background->SetTitle(Form(
"#it{B}_{%s}", shrt.Data()));
3891 bgCont->Add(background);
3893 TH2* signal =
CopyH2(measCont,
"etaIPz",
"signal");
3895 AliWarningF(
"Didn't get signal in %s", sub);
3899 signal->SetTitle(Form(
"#it{S}_{%s}", shrt.Data()));
3900 signal->Add(background,-1);
3902 for (
Int_t i = 1; i <= signal->GetNbinsX(); i++) {
3903 for (
Int_t j = 1; j <= signal->GetNbinsX(); j++) {
3904 if (signal->GetBinContent(i,j)<1e-6) {
3905 signal->SetBinContent(i,j,0);
3906 signal->SetBinError (i,j,0);
3911 bgCont->Add(signal);
3916 alpha =
CopyH2(genCont,
"etaIPz",
"alpha");
3917 if (alpha && signal) {
3918 alpha->Divide(signal);
3919 alpha->SetTitle(Form(
"#alpha_{%s}", shrt.Data()));
3931 const char* weights,
3932 const char* sumFile,
3933 const char* resFile)
3937 ::Error(
"Create",
"No analysis manager to connect to.");
3942 if (weights && weights[0] !=
'\0') {
3946 TFile* wfile = TFile::Open(wurl.GetFile());
3948 ::Warning(
"Create",
"Failed to open weights file: %s",
3952 TString wnam(wurl.GetAnchor());
3953 if (wnam.IsNull()) wnam =
"weights";
3954 TObject* wobj = wfile->Get(wnam);
3956 ::Warning(
"Create",
"Failed to get weights %s from file %s",
3957 wnam.Data(), wfile->GetName());
3960 if (!wobj->IsA()->InheritsFrom(AliTrackletBaseWeights::Class())) {
3961 ::Warning(
"Create",
"Object %s from file %s not an " 3962 "AliTrackletBaseWeights but a %s",
3963 wnam.Data(), wfile->GetName(), wobj->ClassName());
3966 wret->
SetWeights(static_cast<AliTrackletBaseWeights*>(wobj));
virtual Bool_t ProcessTracklet(AliAODTracklet *tracklet, Double_t ipz, UShort_t signal, Double_t weight)=0
Int_t color[]
print message on plot with ok/not ok
static TProfile * GetP1(Container *parent, const char *name, Bool_t verb=true)
virtual void SetWeights(AliTrackletBaseWeights *w)
Histos & operator=(const Histos &)
static const TAxis & PdgAxis()
static void PdgAttr(Int_t pdg, TString &nme, Color_t &c, Style_t &s)
static TH2 * Make2D(Container *c, const TString &name, const TString &title, Color_t color, Style_t style, const TAxis &xAxis, const TAxis &yAxis)
virtual void SetWeightCalc(UChar_t mode=0)
void Print(Option_t *option="") const
Bool_t Connect(const char *sumFile=0, const char *resFile=0)
const AliVVertex * CheckIP(const AliVVertex *ip, Double_t maxDispersion=0.04, Double_t maxZError=0.25)
Double_t FindMultCentrality(AliVEvent *event, Double_t &value, Int_t &nTracklets, Int_t &nCl0, Int_t &nCl1)
virtual ~AliTrackletAODMCdNdeta()
virtual Bool_t FinalizeInit(Container *parent)=0
virtual void SetWeightMask(UChar_t mask=0xFF)
AliTrackletAODWeightedMCdNdeta & operator=(const AliTrackletAODWeightedMCdNdeta &o)
Bool_t MasterFinalize(Container *parent, TH1 *ipz, Double_t tailCut, Double_t tailMax)
Bool_t FinalizeInit(Container *parent)
static void PrintAxis(const TAxis &axis, Int_t nSig=2, const char *alt=0)
virtual Bool_t WorkerInit()
static void SetAxis(TAxis &axis, Int_t n, Double_t *borders)
virtual Double_t LookupWeight(AliAODTracklet *tracklet, Double_t cent, Double_t ipz)
Bool_t ProjectEtaDeltaPdg(Container *result, Int_t nEvents, Double_t tailCut, Double_t tailMax)
TProfile * fNGeneratedVsGood
Double_t FindCompatCentrality(AliVEvent *event)
virtual void SetWeightInverse(Bool_t inv)
static TProfile2D * Make2P(Container *c, const TString &name, const TString &title, Color_t color, Style_t style, const TAxis &xAxis, const TAxis &yAxis)
void ProcessEvent(UInt_t status, Double_t cent, const AliVVertex *ip, TClonesArray *tracklets)
static TH1 * GetH1(Container *parent, const char *name, Bool_t verb=true)
static const char * CentName(Double_t c1, Double_t c2)
void SetEtaAxis(Int_t n, Double_t max)
void Terminate(Option_t *)
TProfile2D * fCl0Cl1Tracklets
Bool_t ProjectEtaDeltaPdgPart(Container *result, Int_t nEvents, Double_t tailDelta, Double_t tailMax, const TString &pre, const TString &tit)
static TH3 * ScaleDelta(TH3 *h, TH2 *scale)
Bool_t WorkerInit(Container *parent, const TAxis &etaAxis, const TAxis &ipzAxis, const TAxis &deltaAxis)
virtual void SetWeightVeto(UChar_t veto=0xFF)
TH1 * SetAttr(TH1 *h, Color_t color, Style_t marker=20, Double_t size=1., Style_t fill=0, Style_t line=1, Width_t width=1)
void SetMaxDelta(Double_t x=25)
static TH2 * ScaleToIPz(TH2 *h, TH1 *ipZ, Bool_t full=false)
static TH2 * ProjectEtaDelta(TH3 *h)
void SetCentralityAxis(const TString &spec)
static TH1 * ProjectDelta(TH2 *h)
void SetWeightVeto(UChar_t veto=0x0)
static Double_t GetD(Container *parent, const char *name, Double_t def=-1, Bool_t verb=true)
TProfile * fNTrackletVsGood
virtual Real_t GetParentPt(Bool_t second=false) const
void SetTailDelta(Double_t x=5)
static TH3 * Make3D(Container *c, const TString &name, const TString &title, Color_t color, Style_t style, const TAxis &xAxis, const TAxis &yAxis, const TAxis &zAxis)
static TH1 * Scale(TH1 *h, Double_t x, Double_t xe)
Bool_t IsCombinatorics() const
CentBin & operator=(const CentBin &)
virtual ~AliTrackletAODWeightedMCdNdeta()
virtual Bool_t WorkerInit(Container *parent, const TAxis &etaAxis, const TAxis &ipzAxis, const TAxis &deltaAxis)
AliTrackletAODWeightedMCdNdeta()
void SetIPzAxis(Int_t n, Double_t max)
Utilities for midrapidity analysis.
void SetAbsMinCent(Double_t x=-1)
static TH1 * MakeStatus(Container *container)
CentBin & operator=(const CentBin &)
void Print(Option_t *option="") const
TClonesArray * FindTracklets(AliVEvent *event)
Bool_t MasterFinalize(Container *parent, TH1 *ipz, Double_t tailCut, Double_t tailMax)
void SetTailMaximum(Double_t x=-1)
void SetEtaAxis(Int_t n, Double_t min, Double_t max)
Bool_t IsSecondary() const
Bool_t InitCentBins(Container *existing)
Bool_t IsSuppressed() const
virtual void SetDebug(UShort_t lvl)
Sub & operator=(const Sub &)
static Double_t Integrate(TH1 *h, Double_t min, Double_t max, Double_t &err)
void SetWeightInverse(Bool_t inv)
virtual Bool_t MasterFinalize(Container *parent, TH1 *ipz, Double_t tailCut, Double_t tailMax)=0
void SetCentralityMethod(const TString &name)
Bool_t FinalizeInit(Container *parent)
Encode simulation weights for 2nd pass.
const AliVVertex * FindIP(AliVEvent *event, Double_t maxDispersion=0.04, Double_t maxZError=0.25)
const AliVVertex * FindSimpleIP(AliVEvent *event, Double_t maxDispersion=0.04, Double_t maxZError=0.25)
void SetDPhiShift(Double_t x=0.0045)
static UInt_t Bin2Flag(UInt_t bin)
AliTrackletAODMCdNdeta(const AliTrackletAODdNdeta &o)
Double_t FindCentrality(AliVEvent *event, Int_t &nTracklets)
TProfile * fCentTracklets
virtual AliTrackletAODdNdeta::CentBin * MakeCentBin(Float_t c1, Float_t c2)
void SetShiftedDPhiCut(Double_t x=-1)
void Print(Option_t *option="") const
TProfile * fNGeneratedVsFake
void SetIPzAxis(Int_t n, Double_t min, Double_t max)
const AliVVertex * FindRealIP(AliVEvent *event, Double_t maxDispersion=0.04, Double_t maxZError=0.25)
Bool_t IsMeasured() const
static TH2 * CopyH2(Container *parent, const char *name, const char *newName=0, Bool_t verb=true)
Double_t nEvents
plot quality messages
virtual Short_t GetParentPdg(Bool_t second=false) const
AliTrackletAODWeightedMCdNdeta(const char *name)
Bool_t EstimateBackground(Container *result, Container *measCont, Container *genCont, Histos *h, Double_t tailCut, Double_t tailMax)
void SetDeltaCut(Double_t x=1.5)
static TH1 * CopyH1(Container *parent, const char *name, const char *newName=0, Bool_t verb=true)
virtual void SetTriggerEfficiency(Double_t eff)
static TH1 * AverageOverIPz(TH2 *h, const char *name, UShort_t mode, TH1 *ipz, Double_t ipEff=0, TH2 *mask=0, Bool_t verb=false)
virtual const char * GetBranchName() const
static TH3 * GetH3(Container *parent, const char *name, Bool_t verb=true)
const char * GetName() const
static Double_t RatioE(Double_t n, Double_t en, Double_t d, Double_t ed, Double_t &er)
static TH2 * GetH2(Container *parent, const char *name, Bool_t verb=true)
Bool_t IsCombinatoric() const
static AliTrackletAODdNdeta * Create(Bool_t mc=false, const char *weights=0, const char *sumFile=0, const char *resFile=0)
Bool_t IsGenerated() const
Histos * MakeHistos(const char *name, Color_t color, Style_t style, UShort_t mask, UShort_t veto)
void UserExec(Option_t *)
void UserCreateOutputObjects()
AliTrackletAODMCdNdeta(const char *name)
Bool_t MasterFinalize(Container *results)
void SetPhiAxis(Int_t n, Double_t min, Double_t max)
Bool_t IsGenerated() const
Bool_t ProjectEtaPdgIPz(Container *result, TH1 *ipz, const TString &shn)
Bool_t IsDistinct() const
void SetAttr(Color_t c, Style_t m)
void SetEtaAxis(const TString &spec)
virtual Double_t LookupWeight(AliAODTracklet *tracklet, Double_t cent, Double_t ipz)
void SetMaxNTracklet(Double_t maxN)
virtual void Print(Option_t *option="") const
static Container * GetC(Container *parent, const char *name, Bool_t verb=true)
CentBin(const CentBin &o)
static Int_t PdgBin(Int_t pdg)
AliTrackletAODWeightedMCdNdeta(const AliTrackletAODWeightedMCdNdeta &o)
Bool_t ProjectEtaPdg(Container *result, Int_t nEvents)
Bool_t ProcessTracklet(AliAODTracklet *tracklet, Double_t ipz, UShort_t signal, Double_t weight)
void Print(Option_t *option="") const
Double_t FindFakeCentrality(AliVEvent *event, Int_t &nTracklets)
virtual UShort_t CheckTracklet(AliAODTracklet *tracklet) const
void SetIPzAxis(const TString &spec)
virtual Bool_t MasterFinalize(Container *results)
virtual ~AliTrackletAODdNdeta()
void SetWeightMask(UChar_t mask=0xFF)
AliTrackletBaseWeights * fWeights
UInt_t CheckEvent(Double_t ¢, const AliVVertex *&ip, TClonesArray *&tracklets)
static TH3 * CopyH3(Container *parent, const char *name, const char *newName=0, Bool_t verb=true)
Histos(const char *name="", Color_t color=kBlack, Style_t style=1, UChar_t mask=0, UChar_t veto=0)
static TObject * CloneAndAdd(Container *c, TObject *o)
CentBin(const CentBin &o)
virtual void SetDebug(UShort_t lvl)
void SetWeightCalc(UChar_t mode=0)
virtual const char * GetBranchName() const
Bool_t WorkerInit(Container *parent, const TAxis &etaAxis, const TAxis &ipzAxis, const TAxis &deltaAxis)
virtual void SetMinEta1(Int_t n)
static TH1 * Make1D(Container *c, const TString &name, const TString &title, Color_t color, Style_t style, const TAxis &xAxis)
Bool_t Accept(UInt_t status, Double_t cent, Double_t ipz)
TProfile * fNTrackletVsFake
virtual CentBin * MakeCentBin(Float_t c1, Float_t c2)
static TProfile * Make1P(Container *c, const TString &name, const TString &title, Color_t color, Style_t style, const TAxis &xAxis)
Bool_t IsMeasured() const
Bool_t IsInjected() const
void SetPhiAxis(Int_t n, Double_t max)
static void FixAxis(TAxis &axis, const char *title=0)
virtual CentBin * InitCentBin(Int_t bin, Float_t c1, Float_t c2, Container *existing, const TAxis &deltaAxis)
void SetCentralityAxis(Int_t n, Double_t *bins)
void SetWeights(AliTrackletBaseWeights *w)
AliTrackletAODdNdeta & operator=(const AliTrackletAODdNdeta &o)
Bool_t ProcessTracklet(AliAODTracklet *tracklet, Double_t ipz, UShort_t signal, Double_t weight)
static TProfile * GetP(Container *parent, const char *name, Bool_t verb=true)
static void CopyAttr(const TH1 *src, TH1 *dest)