Skip to content

Commit 1d768bb

Browse files
authored
Merge branch 'AliceO2Group:master' into A2-PR
2 parents aa42c35 + a1f49d4 commit 1d768bb

50 files changed

Lines changed: 3834 additions & 1902 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ALICE3/TableProducer/alice3StrangenessTofPid.cxx

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "ALICE3/DataModel/OTFStrangeness.h"
2020
#include "ALICE3/DataModel/tracksAlice3.h"
2121
#include "ALICE3/Utils/a3StrangenessTofPidHelper.h"
22+
#include "Common/Core/TableHelper.h"
2223
#include "Common/Core/trackUtilities.h"
2324

2425
#include <Framework/AnalysisDataModel.h>
@@ -94,7 +95,6 @@ struct Alice3StrangenessTofPid {
9495
Configurable<bool> histosAntiXi{"histosAntiXi", true, "Produce histograms for anti xi candidates"};
9596
Configurable<bool> histosOmega{"histosOmega", true, "Produce histograms for omega candidates"};
9697
Configurable<bool> histosAntiOmega{"histosAntiOmega", true, "Produce histograms for anti omega candidates"};
97-
9898
} produce;
9999

100100
Configurable<float> magneticField{"magneticField", 20.0f, "Magnetic field (in kilogauss)"};
@@ -105,13 +105,33 @@ struct Alice3StrangenessTofPid {
105105
static constexpr float NanoToPico = 1e+3;
106106
static constexpr std::array<float, o2::track::kLabCovMatSize> ParentTrackCovMatrix{};
107107

108-
void init(InitContext&)
108+
struct TimeOfFlight {
109+
float iTofResolution{}, iTofRadius{};
110+
float oTofResolution{}, oTofRadius{};
111+
} tof;
112+
113+
void init(InitContext& initContext)
109114
{
110-
// Todo: First try and get from tofpid task
111-
tofPidCasc.setResolution(cfgTof.innerResolution, cfgTof.outerResolution);
112-
tofPidCasc.setRadius(cfgTof.innerRadius, cfgTof.innerResolution);
115+
auto tryGetCfgFromTask = [&](const char* targetCfg, float& localVariable, float localCfg) {
116+
if (!common::core::getTaskOptionValue(initContext, "on-the-fly-tof-pid", targetCfg, localVariable, false)) {
117+
LOG(info) << "Failed to get '" << targetCfg << "' from on-the-fly-tof-pid, using localCfg value " << localCfg;
118+
localVariable = localCfg;
119+
} else {
120+
LOG(info) << "Got '" << targetCfg << "' = " << localVariable << " from on-the-fly-tof-pid";
121+
}
122+
};
123+
124+
tryGetCfgFromTask("innerTOFTimeReso", tof.iTofResolution, cfgTof.innerResolution);
125+
tryGetCfgFromTask("innerTOFRadius", tof.iTofRadius, cfgTof.innerRadius);
126+
tryGetCfgFromTask("outerTOFTimeReso", tof.oTofResolution, cfgTof.outerResolution);
127+
tryGetCfgFromTask("outerTOFRadius", tof.oTofRadius, cfgTof.outerRadius);
128+
129+
tofPidCasc.setResolution(tof.iTofResolution, tof.oTofResolution);
130+
tofPidCasc.setRadius(tof.iTofRadius, tof.oTofRadius);
113131
tofPidCasc.setMagneticField(magneticField);
114132

133+
// Todo: doProcessV0s
134+
115135
if (doprocessCascades) {
116136
if (produce.histosXi) {
117137
histos.add("Xi/hInnerArrivalTimeDeltaNeg", "hInnerArrivalTimeDeltaNeg", kTH1D, {{axes.axisTimeDelta}});

ALICE3/Tasks/alice3-qa-singleparticle.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ struct Alice3SingleParticle {
249249
} else {
250250
histos.get<TH2>(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f);
251251
}
252-
if (mcParticle.pdgCode() != PDG) {
252+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
253253
continue;
254254
}
255255
if (mcParticle.y() < yMin || mcParticle.y() > yMax) {
@@ -417,7 +417,7 @@ struct Alice3SingleParticle {
417417
LOG(info) << "Track " << track.globalIndex() << " comes from a " << mothers[0].pdgCode() << " and is a " << mcParticle.pdgCode();
418418
}
419419
} else {
420-
if (mcParticle.pdgCode() != PDG) {
420+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
421421
continue;
422422
}
423423
histos.fill(HIST("track/Pt"), track.pt() * charge);
@@ -469,7 +469,7 @@ struct Alice3SingleParticle {
469469
} else {
470470
histos.get<TH2>(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f);
471471
}
472-
if (mcParticle.pdgCode() != PDG) {
472+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
473473
continue;
474474
}
475475
if (mcParticle.y() < yMin || mcParticle.y() > yMax) {
@@ -609,7 +609,7 @@ struct Alice3SingleParticle {
609609
} else {
610610
histos.get<TH2>(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f);
611611
}
612-
if (mcParticle.pdgCode() != PDG) {
612+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
613613
continue;
614614
}
615615
if (mcParticle.y() < yMin || mcParticle.y() > yMax) {
@@ -734,7 +734,7 @@ struct Alice3SingleParticle {
734734
LOG(info) << "Track " << track.globalIndex() << " comes from a " << mothers[0].pdgCode() << " and is a " << mcParticle.pdgCode();
735735
}
736736
} else {
737-
if (mcParticle.pdgCode() != PDG) {
737+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
738738
continue;
739739
}
740740
histos.fill(HIST("track/Pt"), track.pt() * charge);

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct ConfCascadeFilters : o2::framework::ConfigurableGroup {
7272
o2::framework::Configurable<std::vector<float>> lambdaTransRadMin{"lambdaTransRadMin", {0.9f}, "Minimum transverse radius (cm)"}; \
7373
o2::framework::Configurable<std::vector<float>> lambdaDcaDauMax{"lambdaDcaDauMax", {0.5f}, "Maximum DCA between the daughters at decay vertex (cm)"}; \
7474
o2::framework::Configurable<std::vector<float>> lambdaDcaToPvMin{"lambdaDcaToPvMin", {0.3f}, "Minimum DCA between the lambda and primary vertex"}; \
75-
o2::framework::Configurable<std::vector<float>> dauAbsEtaMax{"dauAbsEtaMax", {0.8f}, "Minimum DCA of the daughters from primary vertex (cm)"}; \
75+
o2::framework::Configurable<std::vector<float>> dauAbsEtaMax{"dauAbsEtaMax", {0.8f}, "Maximum |eta| of all daughters"}; \
7676
o2::framework::Configurable<std::vector<float>> dauDcaMin{"dauDcaMin", {0.05f}, "Minimum DCA of the daughters from primary vertex (cm)"}; \
7777
o2::framework::Configurable<std::vector<float>> dauTpcClustersMin{"dauTpcClustersMin", {80.f}, "Minimum number of TPC clusters for daughter tracks"}; \
7878
o2::framework::Configurable<std::vector<float>> posDauTpc{"posDauTpc", {5.f}, "Maximum |nsimga_Pion/Proton| TPC for positive daughter tracks"}; \
@@ -639,5 +639,114 @@ class CascadeBuilder
639639
bool mProduceOmegaExtras = false;
640640
};
641641

642+
struct ConfCascadeTablesDerivedToDerived : o2::framework::ConfigurableGroup {
643+
std::string prefix = std::string("CascadeTables");
644+
o2::framework::Configurable<int> limitXi{"limitXi", 1, "At least this many xi need to be in the collision"};
645+
o2::framework::Configurable<int> limitOmega{"limitOmega", 0, "At least this many omega need to be in the collision"};
646+
};
647+
648+
struct CascadeBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {
649+
o2::framework::Produces<o2::aod::StoredFXis> producedXis;
650+
o2::framework::Produces<o2::aod::StoredFXiMasks> producedXiMasks;
651+
o2::framework::Produces<o2::aod::StoredFOmegas> producedOmegas;
652+
o2::framework::Produces<o2::aod::StoredFOmegaMasks> producedOmegaMasks;
653+
};
654+
655+
class CascadeBuilderDerivedToDerived
656+
{
657+
public:
658+
CascadeBuilderDerivedToDerived() = default;
659+
~CascadeBuilderDerivedToDerived() = default;
660+
661+
template <typename T>
662+
void init(T& config)
663+
{
664+
mLimitXi = config.limitXi.value;
665+
mLimitOmega = config.limitOmega.value;
666+
667+
if (mLimitXi == 0 && mLimitOmega == 0) {
668+
LOG(fatal) << "Both xi limit and omega limit are 0. Breaking...";
669+
}
670+
}
671+
672+
template <typename T1, typename T2, typename T3, typename T4>
673+
bool collisionHasTooFewXis(T1 const& col, T2 const& /*xiTable*/, T3& partitionXi, T4& cache)
674+
{
675+
auto xiSlice = partitionXi->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
676+
return xiSlice.size() < mLimitXi;
677+
}
678+
679+
template <typename T1, typename T2, typename T3, typename T4>
680+
bool collisionHasTooFewOmegas(T1 const& col, T2 const& /*omegaTable*/, T3& partitionOmega, T4& cache)
681+
{
682+
auto omegaSlice = partitionOmega->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
683+
return omegaSlice.size() < mLimitOmega;
684+
}
685+
686+
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
687+
void processXis(T1 const& col, T2 const& /*xiTable*/, T3 const& oldTrackTable, T4& partitionXi, T5& trackBuilder, T6& cache, T7& newXiTable, T8& newTrackTable, T9& newCollisionTable)
688+
{
689+
auto xiSlice = partitionXi->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
690+
691+
for (auto const& xi : xiSlice) {
692+
693+
// auto bachelor = xi.template bachelor_as<T3>();
694+
// auto posDaughter = xi.template posDau_as<T3>();
695+
// auto negDaughter = xi.template negDau_as<T3>();
696+
auto bachelor = oldTrackTable.rawIteratorAt(xi.bachelorId() - oldTrackTable.offset());
697+
auto posDaughter = oldTrackTable.rawIteratorAt(xi.posDauId() - oldTrackTable.offset());
698+
auto negDaughter = oldTrackTable.rawIteratorAt(xi.negDauId() - oldTrackTable.offset());
699+
700+
int bachelorIndex = trackBuilder.getDaughterIndex(bachelor, newTrackTable, newCollisionTable);
701+
int posDaughterIndex = trackBuilder.getDaughterIndex(posDaughter, newTrackTable, newCollisionTable);
702+
int negDaughterIndex = trackBuilder.getDaughterIndex(negDaughter, newTrackTable, newCollisionTable);
703+
704+
newXiTable.producedXis(newCollisionTable.producedCollision.lastIndex(),
705+
xi.signedPt(),
706+
xi.eta(),
707+
xi.phi(),
708+
xi.mass(),
709+
bachelorIndex,
710+
posDaughterIndex,
711+
negDaughterIndex);
712+
newXiTable.producedXiMasks(xi.mask());
713+
}
714+
}
715+
716+
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
717+
void processOmegas(T1 const& col, T2 const& /*omegaTable*/, T3 const& oldTrackTable, T4& partitionOmega, T5& trackBuilder, T6& cache, T7& newOmegaTable, T8& newTrackTable, T9& newCollisionTable)
718+
{
719+
auto omegaSlice = partitionOmega->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
720+
721+
for (auto const& omega : omegaSlice) {
722+
723+
// auto bachelor = omega.template bachelor_as<T3>();
724+
// auto posDaughter = omega.template posDau_as<T3>();
725+
// auto negDaughter = omega.template negDau_as<T3>();
726+
auto bachelor = oldTrackTable.rawIteratorAt(omega.bachelorId() - oldTrackTable.offset());
727+
auto posDaughter = oldTrackTable.rawIteratorAt(omega.posDauId() - oldTrackTable.offset());
728+
auto negDaughter = oldTrackTable.rawIteratorAt(omega.negDauId() - oldTrackTable.offset());
729+
730+
int bachelorIndex = trackBuilder.getDaughterIndex(bachelor, newTrackTable, newCollisionTable);
731+
int posDaughterIndex = trackBuilder.getDaughterIndex(posDaughter, newTrackTable, newCollisionTable);
732+
int negDaughterIndex = trackBuilder.getDaughterIndex(negDaughter, newTrackTable, newCollisionTable);
733+
734+
newOmegaTable.producedOmegas(newCollisionTable.producedCollision.lastIndex(),
735+
omega.signedPt(),
736+
omega.eta(),
737+
omega.phi(),
738+
omega.mass(),
739+
bachelorIndex,
740+
posDaughterIndex,
741+
negDaughterIndex);
742+
newOmegaTable.producedOmegaMasks(omega.mask());
743+
}
744+
}
745+
746+
private:
747+
int mLimitXi = 0;
748+
int mLimitOmega = 0;
749+
};
750+
642751
} // namespace o2::analysis::femto::cascadebuilder
643752
#endif // PWGCF_FEMTO_CORE_CASCADEBUILDER_H_

PWGCF/Femto/Core/pairHistManager.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
3333
#include <Math/Vector4Dfwd.h>
3434
#include <TH1.h>
35+
#include <TH3.h>
3536

3637
#include <algorithm>
3738
#include <array>
@@ -220,6 +221,7 @@ struct ConfPairBinning : o2::framework::ConfigurableGroup {
220221
o2::framework::ConfigurableAxis shKstar{"shKstar", {{60, 0.0f, 0.3f}}, "k*/qinv binning for SH histograms"};
221222
o2::framework::ConfigurableAxis shCentBins{"shCentBins", {o2::framework::VARIABLE_WIDTH, 0.0f, 200.0f}, "SH: multiplicity/centrality bin edges (like FemtoUniverse confMultKstarBins)"};
222223
o2::framework::ConfigurableAxis shKtBins{"shKtBins", {o2::framework::VARIABLE_WIDTH, 0.1f, 0.2f, 0.3f, 0.4f}, "SH: kT bin edges (like FemtoUniverse confKtKstarBins)"};
224+
o2::framework::Configurable<bool> shPlot1D{"shPlot1D", false, "(SH) Also fill 1D qinv/k* numerator/denominator (h1D) per (mult,kT) bin"};
223225
};
224226

225227
struct ConfPairCuts : o2::framework::ConfigurableGroup {
@@ -542,6 +544,7 @@ class PairHistManager
542544
mPlotSH = ConfPairBinning.plotSH.value;
543545
mShLMax = ConfPairBinning.shLMax.value;
544546
mShFrame = ConfPairBinning.shFrame.value;
547+
mShPlot1D = ConfPairBinning.shPlot1D.value;
545548
if (mPlotSH) {
546549
mShKstarSpec = {ConfPairBinning.shKstar, "k* (GeV/#it{c})"};
547550
mYlm.initializeYlms();
@@ -975,9 +978,15 @@ class PairHistManager
975978

976979
mShReal.resize(nCent);
977980
mShImag.resize(nCent);
981+
mShCov.resize(nCent);
982+
mSh1D.resize(nCent);
983+
mShBinCount.resize(nCent);
978984
for (int iCent = 0; iCent < nCent; ++iCent) {
979985
mShReal[iCent].resize(nKt);
980986
mShImag[iCent].resize(nKt);
987+
mShCov[iCent].resize(nKt);
988+
mSh1D[iCent].resize(nKt);
989+
mShBinCount[iCent].resize(nKt);
981990
// folder name: mult_{low}_{high}
982991
const std::string centFolder = "mult_" + std::to_string(static_cast<int>(mShCentEdges[iCent])) +
983992
"_" + std::to_string(static_cast<int>(mShCentEdges[iCent + 1]));
@@ -1020,9 +1029,30 @@ class PairHistManager
10201029
titleIm += "; k* (GeV/#it{c}); Im[A_{l}^{m}]";
10211030
mShReal[iCent][iKt][ihist] = mHistogramRegistry->add<TH1>(nameRe.c_str(), titleRe.c_str(), o2::framework::kTH1D, {mShKstarSpec});
10221031
mShImag[iCent][iKt][ihist] = mHistogramRegistry->add<TH1>(nameIm.c_str(), titleIm.c_str(), o2::framework::kTH1D, {mShKstarSpec});
1032+
mShReal[iCent][iKt][ihist]->Sumw2();
1033+
mShImag[iCent][iKt][ihist]->Sumw2();
10231034
++ihist;
10241035
}
10251036
}
1037+
1038+
// SH covariance TH3D
1039+
const int nAxisLM = 2 * nJM;
1040+
const o2::framework::AxisSpec covLmAxis{nAxisLM, -0.5, static_cast<double>(nAxisLM) - 0.5, "l,m #times (re,im)"};
1041+
std::string nameCov = dir;
1042+
nameCov += "Cov";
1043+
mShCov[iCent][iKt] = mHistogramRegistry->add<TH3>(nameCov.c_str(), "SH covariance; k* (GeV/#it{c}); l,m; l,m", o2::framework::kTH3D, {mShKstarSpec, covLmAxis, covLmAxis});
1044+
mShCov[iCent][iKt]->Sumw2();
1045+
1046+
std::string nameBinCount = dir;
1047+
nameBinCount += "BinCount";
1048+
mShBinCount[iCent][iKt] = mHistogramRegistry->add<TH1>(nameBinCount.c_str(), "SH bin occupancy; k* (GeV/#it{c}); Entries", o2::framework::kTH1D, {mShKstarSpec});
1049+
1050+
if (mShPlot1D) {
1051+
std::string name1D = dir;
1052+
name1D += "h1D";
1053+
mSh1D[iCent][iKt] = mHistogramRegistry->add<TH1>(name1D.c_str(), "1D distribution; k* (GeV/#it{c}); Entries", o2::framework::kTH1D, {mShKstarSpec});
1054+
mSh1D[iCent][iKt]->Sumw2();
1055+
}
10261056
}
10271057
}
10281058
}
@@ -1214,6 +1244,24 @@ class PairHistManager
12141244
mShReal[iCent][iKt][i]->Fill(mShKv, std::real(mShYlmBuffer[i]));
12151245
mShImag[iCent][iKt][i]->Fill(mShKv, -std::imag(mShYlmBuffer[i]));
12161246
}
1247+
// covariance: outer product of the (re, -im) Ylm vector packed on 2*nJM axes
1248+
// (each Ylm contributes two consecutive axis bins: even = real, odd = -imag)
1249+
static constexpr int ComponentsPerLM = 2;
1250+
const int nAxisLM = ComponentsPerLM * static_cast<int>(mShYlmBuffer.size());
1251+
for (int iz = 0; iz < nAxisLM; ++iz) {
1252+
const double vz = (iz % ComponentsPerLM == 0) ? std::real(mShYlmBuffer[iz / ComponentsPerLM]) : -std::imag(mShYlmBuffer[iz / ComponentsPerLM]);
1253+
for (int ip = 0; ip < nAxisLM; ++ip) {
1254+
const double vp = (ip % ComponentsPerLM == 0) ? std::real(mShYlmBuffer[ip / ComponentsPerLM]) : -std::imag(mShYlmBuffer[ip / ComponentsPerLM]);
1255+
mShCov[iCent][iKt]->Fill(mShKv, static_cast<double>(iz), static_cast<double>(ip), vz * vp);
1256+
}
1257+
}
1258+
1259+
mShBinCount[iCent][iKt]->Fill(mShKv, 1.0);
1260+
if (mShPlot1D) {
1261+
// FemtoUniverse h1D = f3d[0]: qinv (=2k*) for identical-LCMS, else k*.
1262+
const float sh1DValue = (mShFrame == ShFrameLcmsIdentical) ? (2.0f * mKstar) : mKstar;
1263+
mSh1D[iCent][iKt]->Fill(sh1DValue);
1264+
}
12171265
}
12181266
}
12191267
}
@@ -1580,6 +1628,11 @@ class PairHistManager
15801628
// SH histograms binned in [iCent][iKt][ihist]; ihist = l*(l+1)+m
15811629
std::vector<std::vector<std::vector<std::shared_ptr<TH1>>>> mShReal;
15821630
std::vector<std::vector<std::vector<std::shared_ptr<TH1>>>> mShImag;
1631+
// SH covariance matrix per [iCent][iKt]; TH3d: k* on X, 2*nJM (l,m x re/im)
1632+
std::vector<std::vector<std::shared_ptr<TH3>>> mShCov;
1633+
bool mShPlot1D = false;
1634+
std::vector<std::vector<std::shared_ptr<TH1>>> mSh1D;
1635+
std::vector<std::vector<std::shared_ptr<TH1>>> mShBinCount;
15831636
std::vector<std::complex<double>> mShYlmBuffer; // reused, allocated once
15841637
std::vector<double> mShCentEdges;
15851638
std::vector<double> mShKtEdges;

PWGCF/Femto/Core/particleCleaner.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ class ParticleCleaner
232232

233233
private:
234234
bool mActivate = false;
235-
bool mRejectParticleWithoutMcParticle = true;
236-
bool mRejectParticleWithoutMcMother = true;
237-
bool mRejectParticleWithoutMcPartonicMother = true;
235+
bool mRejectParticleWithoutMcParticle = false;
236+
bool mRejectParticleWithoutMcMother = false;
237+
bool mRejectParticleWithoutMcPartonicMother = false;
238238
std::vector<int> mRequiredPdgCodes;
239239
std::vector<int> mRejectedPdgCodes;
240240
std::vector<int> mRequiredMotherPdgCodes;

0 commit comments

Comments
 (0)