Skip to content

Commit ee88a3c

Browse files
authored
Merge branch 'AliceO2Group:master' into Add-preselection-and-centrality-to-STTree-creatore
2 parents 90ed1a1 + 0eb4d42 commit ee88a3c

File tree

25 files changed

+2408
-833
lines changed

25 files changed

+2408
-833
lines changed

Common/Core/fwdtrackUtilities.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,45 @@ o2::track::TrackParCovFwd getTrackParCovFwd(TFwdTrack const& track, TFwdTrackCov
7575
return trackparCov;
7676
}
7777

78+
/// Produce TrackParCovFwds for MFT and FwdTracks, w/ or w/o cov, with z shift
79+
template <typename TFwdTrack, typename... TCovariance>
80+
o2::track::TrackParCovFwd getTrackParCovFwdShift(TFwdTrack const& track, float zshift, TCovariance const&... covOpt)
81+
{
82+
double chi2 = track.chi2();
83+
if constexpr (sizeof...(covOpt) == 0) {
84+
// No covariance passed
85+
if constexpr (std::is_same_v<std::decay_t<TFwdTrack>, aod::FwdTracks::iterator>) {
86+
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
87+
chi2 = track.chi2() * (2.f * track.nClusters() - 5.f);
88+
}
89+
}
90+
} else {
91+
// Covariance passed
92+
using TCov = std::decay_t<decltype((covOpt, ...))>;
93+
if constexpr (std::is_same_v<TCov, aod::FwdTracksCov::iterator>) {
94+
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
95+
chi2 = track.chi2() * (2.f * track.nClusters() - 5.f);
96+
}
97+
}
98+
}
99+
100+
SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt());
101+
102+
SMatrix55 tcovs;
103+
if constexpr (sizeof...(covOpt) == 1) {
104+
auto const& cov = (covOpt, ...);
105+
std::vector<double> v1{
106+
cov.cXX(), cov.cXY(), cov.cYY(), cov.cPhiX(), cov.cPhiY(),
107+
cov.cPhiPhi(), cov.cTglX(), cov.cTglY(), cov.cTglPhi(), cov.cTglTgl(),
108+
cov.c1PtX(), cov.c1PtY(), cov.c1PtPhi(), cov.c1PtTgl(), cov.c1Pt21Pt2()};
109+
tcovs = SMatrix55(v1.begin(), v1.end());
110+
} else {
111+
tcovs = SMatrix55{};
112+
}
113+
114+
return o2::track::TrackParCovFwd(track.z() + zshift, tpars, tcovs, chi2);
115+
}
116+
78117
/// propagate fwdtrack to a certain point.
79118
template <typename TFwdTrack, typename TFwdTrackCov, typename TCollision>
80119
o2::dataformats::GlobalFwdTrack propagateMuon(TFwdTrack const& muon, TFwdTrackCov const& cov, TCollision const& collision, const propagationPoint endPoint, const float matchingZ, const float bzkG)

PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ struct HadNucleiFemto {
199199
Configurable<float> settingCutHadDCAxyMin{"settingCutHadDCAxyMin", 0.3f, "DCAxy Min for Had"};
200200
Configurable<float> settingCutHadDCAzMin{"settingCutHadDCAzMin", 0.3f, "DCAz Min for Had"};
201201
Configurable<float> settingCutDeDCAzMin{"settingCutDeDCAzMin", 0.2f, "DCAxy Min for De"};
202-
Configurable<float> settingCutNsigTPCPrMin{"settingCutNsigTPCPrMin", 3.0f, "Minimum TPC Pr Nsigma cut on Pi"};
203-
Configurable<float> settingCutNsigTOFPrMin{"settingCutNsigTOFPrMin", 3.0f, "Minimum TOF Pr Nsigma cut on Pi"};
202+
Configurable<float> settingCutNsigTPCPrMin{"settingCutNsigTPCPrMin", 3.0f, "Minimum TPC Pr Nsigma cut for rejection"};
203+
Configurable<float> settingCutNsigTPCPiMin{"settingCutNsigTPCPiMin", 3.0f, "Minimum TPC Pi Nsigma cut for rejection"};
204+
Configurable<float> settingCutNsigTOFPrMin{"settingCutNsigTOFPrMin", 3.0f, "Minimum TOF Pr Nsigma cut for rejection"};
205+
Configurable<float> settingCutNsigTOFPiMin{"settingCutNsigTOFPiMin", 3.0f, "Minimum TOF Pi Nsigma cut for rejection"};
204206

205207
Configurable<bool> settingSaveUSandLS{"settingSaveUSandLS", true, "Save All Pairs"};
206208
Configurable<bool> settingFillMultiplicity{"settingFillMultiplicity", false, "Fill multiplicity table"};
@@ -278,6 +280,7 @@ struct HadNucleiFemto {
278280
{"hNuPhi", "phi distribution; phi(Nu)", {HistType::kTH1F, {{600, -4.0f, 4.0f}}}},
279281
{"hHadPhi", "phi distribution; phi(had)", {HistType::kTH1F, {{600, -4.0f, 4.0f}}}},
280282
{"h2dEdxNucandidates", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}},
283+
{"h2dEdxHadcandidates", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}},
281284
{"h2dEdx", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}},
282285
{"h2NsigmaNuTPC", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {200, -5.0f, 5.0f}}}},
283286
{"h2NsigmaNuComb", "NsigmaNu TPCTOF comb distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{comb}(Nu)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {100, 0.0f, 5.0f}}}},
@@ -306,7 +309,9 @@ struct HadNucleiFemto {
306309
{"hkStar_US_M", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
307310
{"hkStar_US_A", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
308311
{"h2NsigmaHadPrTPC", "NsigmaHad TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}},
312+
{"h2NsigmaHadPiTPC", "NsigmaHad TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(pi)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}},
309313
{"h2NsigmaHadPrTOF", "NsigmaHad TOF distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}},
314+
{"h2NsigmaHadPiTOF", "NsigmaHad TOF distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(pi)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}},
310315
{"hisBkgEM", "; isBkgEM;", {HistType::kTH1F, {{3, -1, 2}}}}},
311316
OutputObjHandlingPolicy::AnalysisObject,
312317
false,
@@ -502,6 +507,19 @@ struct HadNucleiFemto {
502507
if (std::abs(candidate.pt()) < settingCutHadptMin || std::abs(candidate.pt()) > settingCutHadptMax)
503508
return false;
504509

510+
// reject protons and pions
511+
if (std::abs(candidate.tpcNSigmaPr()) < settingCutNsigTPCPrMin || std::abs(candidate.tpcNSigmaPi()) < settingCutNsigTPCPiMin)
512+
return false;
513+
mQaRegistry.fill(HIST("h2NsigmaHadPrTPC"), candidate.tpcNSigmaPr());
514+
mQaRegistry.fill(HIST("h2NsigmaHadPiTPC"), candidate.tpcNSigmaPi());
515+
if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < settingCutNsigTOFPrMin)
516+
return false;
517+
if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < settingCutNsigTOFPiMin)
518+
return false;
519+
mQaRegistry.fill(HIST("h2NsigmaHadPrTOF"), candidate.tofNSigmaPr());
520+
mQaRegistry.fill(HIST("h2NsigmaHadPiTOF"), candidate.tofNSigmaPi());
521+
// rejection end
522+
505523
if (candidate.hasTOF() && candidate.tpcInnerParam() >= settingCutPinMinTOFHad) {
506524
auto tofNSigmaKa = candidate.tofNSigmaKa();
507525

@@ -514,12 +532,14 @@ struct HadNucleiFemto {
514532
}
515533
mQaRegistry.fill(HIST("h2NsigmaHadTPC"), candidate.sign() * candidate.pt(), tpcNSigmaKa);
516534
mQaRegistry.fill(HIST("h2NsigmaHadTOF"), candidate.sign() * candidate.pt(), tofNSigmaKa);
535+
mQaRegistry.fill(HIST("h2dEdxHadcandidates"), candidate.sign() * candidate.tpcInnerParam(), candidate.tpcSignal());
517536
return true;
518537
} else if (candidate.tpcInnerParam() < settingCutPinMinTOFHad) {
519538
if (std::abs(tpcNSigmaKa) > settingCutNsigmaTPCHad) {
520539
return false;
521540
}
522541
mQaRegistry.fill(HIST("h2NsigmaHadTPC"), candidate.sign() * candidate.pt(), tpcNSigmaKa);
542+
mQaRegistry.fill(HIST("h2dEdxHadcandidates"), candidate.sign() * candidate.tpcInnerParam(), candidate.tpcSignal());
523543
return true;
524544
}
525545
return false;
@@ -562,12 +582,14 @@ struct HadNucleiFemto {
562582
mQaRegistry.fill(HIST("h2NsigmaHadTPC"), candidate.sign() * candidate.pt(), tpcNSigmaPi);
563583
mQaRegistry.fill(HIST("h2NsigmaHadTOF"), candidate.sign() * candidate.pt(), tofNSigmaPi);
564584
mQaRegistry.fill(HIST("h2NsigmaHadComb"), candidate.sign() * candidate.pt(), combNsigma);
585+
mQaRegistry.fill(HIST("h2dEdxHadcandidates"), candidate.sign() * candidate.tpcInnerParam(), candidate.tpcSignal());
565586
return true;
566587
} else if (candidate.tpcInnerParam() < settingCutPinMinTOFHad) {
567588
if (std::abs(tpcNSigmaPi) > settingCutNsigmaTPCHad) {
568589
return false;
569590
}
570591
mQaRegistry.fill(HIST("h2NsigmaHadTPC"), candidate.sign() * candidate.pt(), tpcNSigmaPi);
592+
mQaRegistry.fill(HIST("h2dEdxHadcandidates"), candidate.sign() * candidate.tpcInnerParam(), candidate.tpcSignal());
571593
return true;
572594
}
573595
return false;

PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class FemtoUniverseParticleHisto
144144

145145
mHistogramRegistry->add((folderName + folderSuffix + "/hTrueRecoMomPart1").c_str(), "; #it{p}_{reco} (GeV/#it{c}); #it{p}_{truth} - #it{p}_{reco} (GeV/#it{c})", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
146146
mHistogramRegistry->add((folderName + folderSuffix + "/hTrueRecoThetaPart1").c_str(), "; #it{p}_{reco} (GeV/#it{c}); #it{#theta}_{truth} - #it{#theta}_{reco} (GeV/#it{c})", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
147-
mHistogramRegistry->add((folderName + folderSuffix + "/hTrueRecoMomPart1").c_str(), "; #it{p}_{reco} (GeV/#it{c}); #it{#phi}_{truth} - #it{#phi}_{reco} (GeV/#it{c})", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
147+
mHistogramRegistry->add((folderName + folderSuffix + "/hTrueRecoPhiPart1").c_str(), "; #it{p}_{reco} (GeV/#it{c}); #it{#phi}_{truth} - #it{#phi}_{reco} (GeV/#it{c})", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
148148

149149
if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) {
150150
/// Track histograms
@@ -355,9 +355,9 @@ class FemtoUniverseParticleHisto
355355
float part_theta = 2.0 * std::atan(std::exp(-part.eta()));
356356
float part_MC_theta = 2.0 * std::atan(std::exp(-part.fdMCParticle().eta()));
357357

358-
mHistogramRegistry->fill(histFolder + HIST("_MC/hTrueRecoMomPion"), part_p, (part_MC_p - part_p));
359-
mHistogramRegistry->fill(histFolder + HIST("_MC/hTrueRecoThetaPion"), part_p, (part_MC_theta - part_theta));
360-
mHistogramRegistry->fill(histFolder + HIST("_MC/hTrueRecoMomPion"), part_p, part.fdMCParticle().phi() - part.phi());
358+
mHistogramRegistry->fill(histFolder + HIST("_MC/hTrueRecoMomPart1"), part_p, (part_MC_p - part_p));
359+
mHistogramRegistry->fill(histFolder + HIST("_MC/hTrueRecoThetaPart1"), part_p, (part_MC_theta - part_theta));
360+
mHistogramRegistry->fill(histFolder + HIST("_MC/hTrueRecoPhiPart1"), part_p, part.fdMCParticle().phi() - part.phi());
361361
}
362362
}
363363

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,13 @@ struct FlowTask {
12531253
fGFW->Clear();
12541254
fFCptgen->clearVector();
12551255

1256+
if (cfgUseAdditionalEventCut) {
1257+
for (auto const& collision : collisions) {
1258+
if (!eventSelected(collision, mcParticles.size(), cent))
1259+
return;
1260+
}
1261+
}
1262+
12561263
double ptSum_Gap08 = 0.;
12571264
double count_Gap08 = 0.;
12581265
for (const auto& mcParticle : mcParticles) {

PWGCF/GenericFramework/Core/FlowContainer.cxx

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ TProfile* FlowContainer::GetCorrXXVsMulti(const char* order, int l_pti)
395395
}
396396
return retSubset;
397397
};
398-
TProfile* FlowContainer::GetCorrXXVsPt(const char* order, double lminmulti, double lmaxmulti)
398+
TH1D* FlowContainer::GetCorrXXVsPt(const char* order, double lminmulti, double lmaxmulti)
399399
{
400400
int minm = 1;
401401
int maxm = fProf->GetXaxis()->GetNbins();
@@ -408,35 +408,31 @@ TProfile* FlowContainer::GetCorrXXVsPt(const char* order, double lminmulti, doub
408408
if (lmaxmulti > lminmulti)
409409
maxm = fProf->GetXaxis()->FindBin(lmaxmulti - 0.001);
410410
ProfileSubset* rhProfSub = new ProfileSubset(*fProf);
411-
TProfile* retSubset = 0;
412411
TString l_name("");
413412
Ssiz_t l_pos = 0;
414413
while (fIDName.Tokenize(l_name, l_pos)) {
415414
TString ybl1(Form("%s%s_pt_1", l_name.Data(), order));
416415
TString ybl2(Form("%s%s_pt_%i", l_name.Data(), order, fNbinsPt));
417416
int ybn1 = fProf->GetYaxis()->FindBin(ybl1.Data());
418417
int ybn2 = fProf->GetYaxis()->FindBin(ybl2.Data());
419-
rhProfSub->GetYaxis()->SetRange(ybn1, ybn2);
420-
TProfile* tempprof = rhProfSub->GetSubset(kFALSE, "tempprof", minm, maxm, fNbinsPt, fbinsPt);
421-
if (!retSubset) {
422-
TString profname = Form("%s_MultiB_%i_%i", order, minm, maxm);
423-
retSubset = dynamic_cast<TProfile*>(tempprof->Clone(profname.Data()));
424-
} else {
425-
retSubset->Add(tempprof);
418+
if (fNbinsPt != (ybn2 - ybn1 + 1)) {
419+
printf("fNbinsPt is not matching the num of found histograms");
420+
return nullptr;
426421
}
427-
delete tempprof;
428-
}
429-
delete rhProfSub;
430-
if (fPtRebinEdges) {
431-
TString pnbu(retSubset->GetName());
432-
retSubset->SetName("TempName");
433-
TProfile* tempprof = dynamic_cast<TProfile*>(retSubset->Rebin(fPtRebin, pnbu.Data(), fPtRebinEdges));
434-
delete retSubset;
435-
retSubset = tempprof;
436-
} else {
437-
retSubset->RebinX(fPtRebin);
422+
TProfile* profY = rhProfSub->ProfileY("profY", minm, maxm);
423+
TH1D* histY = ProfToHist(profY);
424+
TH1D* hist = new TH1D("temphist", "temphist", fNbinsPt, fbinsPt);
425+
for (int ibin = 1; ibin < hist->GetNbinsX(); ibin++) {
426+
TString bLabel = rhProfSub->GetYaxis()->GetBinLabel(ibin + ybn1 - 1);
427+
hist->GetXaxis()->SetBinLabel(ibin, bLabel.Data());
428+
hist->SetBinContent(ibin, histY->GetBinContent(ibin + ybn1 - 1));
429+
hist->SetBinError(ibin, histY->GetBinError(ibin + ybn1 - 1));
430+
}
431+
delete histY;
432+
delete rhProfSub;
433+
return hist;
438434
}
439-
return retSubset;
435+
return nullptr;
440436
};
441437
TH1D* FlowContainer::ProfToHist(TProfile* inpf)
442438
{
@@ -462,16 +458,18 @@ TH1D* FlowContainer::GetHistCorrXXVsMulti(const char* order, int l_pti)
462458
}
463459
TH1D* FlowContainer::GetHistCorrXXVsPt(const char* order, double lminmulti, double lmaxmulti)
464460
{
465-
TProfile* tpf = GetCorrXXVsPt(order, lminmulti, lmaxmulti);
466-
TH1D* rethist = ProfToHist(tpf);
461+
TH1D* rethist = GetCorrXXVsPt(order, lminmulti, lmaxmulti);
462+
if (!rethist) {
463+
printf("GetCorrXXVsPt return nullptr!");
464+
return nullptr;
465+
}
467466
TProfile* refflow = GetRefFlowProfile(order, lminmulti, lmaxmulti);
468467
if (refflow) {
469468
refflow->RebinX(refflow->GetNbinsX());
470469
rethist->SetBinContent(0, refflow->GetBinContent(1));
471470
rethist->SetBinError(0, refflow->GetBinError(1));
472471
}
473472
delete refflow;
474-
delete tpf;
475473
return rethist;
476474
}
477475
TH1D* FlowContainer::GetVN2(TH1D* cn2)

PWGCF/GenericFramework/Core/FlowContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class FlowContainer : public TNamed
7272
double* GetMultiRebin(int& nBins);
7373
void SetPropagateErrors(bool newval) { fPropagateErrors = newval; }
7474
TProfile* GetCorrXXVsMulti(const char* order, int l_pti = 0); // pti = 0 for pt-integrated
75-
TProfile* GetCorrXXVsPt(const char* order, double lminmulti = -1, double lmaxmulti = -1); // 0 for multi. integrated
75+
TH1D* GetCorrXXVsPt(const char* order, double lminmulti = -1, double lmaxmulti = -1); // 0 for multi. integrated
7676
TH1D* GetHistCorrXXVsMulti(const char* order, int l_pti = 0); // pti = 0 for pt-integrated
7777
TH1D* GetHistCorrXXVsPt(const char* order, double lminmulti = -1, double lmaxmulti = -1); // 0 for multi. integrated
7878

0 commit comments

Comments
 (0)