Skip to content

Commit

Permalink
[PWGCF,PWGHF] FemtoDream: Fixes in the Cascade Selection and Seperati…
Browse files Browse the repository at this point in the history
…on of Producer (AliceO2Group#10128)
  • Loading branch information
gmantzar authored Feb 22, 2025
1 parent 1449ec4 commit 07b63f5
Show file tree
Hide file tree
Showing 22 changed files with 1,440 additions and 412 deletions.
15 changes: 15 additions & 0 deletions PWGCF/DataModel/FemtoDerived.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ DECLARE_SOA_COLUMN(DecayVtxX, decayVtxX, float); //! X position of the decay
DECLARE_SOA_COLUMN(DecayVtxY, decayVtxY, float); //! Y position of the decay vertex
DECLARE_SOA_COLUMN(DecayVtxZ, decayVtxZ, float); //! Z position of the decay vertex
DECLARE_SOA_COLUMN(MKaon, mKaon, float); //! The invariant mass of V0 candidate, assuming kaon
// Here the cascade specific collums
DECLARE_SOA_COLUMN(CascV0DCAtoPV, cascV0DCAtoPV, float); //! DCA of the daughter V0 to the primar vertex
DECLARE_SOA_COLUMN(CascDaughDCA, cascDaughDCA, float); //! DCA between daughters
DECLARE_SOA_COLUMN(CascTransRadius, cascTransRadius, float); //! Transverse radius of the decay vertex of the cascade
DECLARE_SOA_COLUMN(CascDecayVtxX, cascDecayVtxX, float); //! X position of the decay vertex of the cascade
DECLARE_SOA_COLUMN(CascDecayVtxY, cascDecayVtxY, float); //! Y position of the decay vertex of the cascade
DECLARE_SOA_COLUMN(CascDecayVtxZ, cascDecayVtxZ, float); //! Z position of the decay vertex of the cascade
DECLARE_SOA_COLUMN(MOmega, mOmega, float); //! The invariant mass of Cascade candidate, assuming Omega
} // namespace femtodreamparticle

namespace fdhf
Expand Down Expand Up @@ -384,6 +392,13 @@ DECLARE_SOA_TABLE_STAGED(FDExtParticles, "FDEXTPARTICLE",
femtodreamparticle::DecayVtxY,
femtodreamparticle::DecayVtxZ,
femtodreamparticle::MKaon,
femtodreamparticle::CascV0DCAtoPV,
femtodreamparticle::CascDaughDCA,
femtodreamparticle::CascTransRadius,
femtodreamparticle::CascDecayVtxX,
femtodreamparticle::CascDecayVtxY,
femtodreamparticle::CascDecayVtxZ,
femtodreamparticle::MOmega,
femtodreamparticle::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, femtodreamparticle::TPCNClsCrossedRows>)
using FDFullParticle = FDExtParticles::iterator;

Expand Down
52 changes: 13 additions & 39 deletions PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,7 @@ enum CascadeSel {
kCascadeV0TranRadMax,
kCascadeV0DCAtoPVMin,
kCascadeV0DCAtoPVMax

// kNcascadeSelection
// kCascadeV0MassMin,
// kCascadeV0MassMax
};
/*
kCascadeDCAPosToPV,
kCascadeDCANegToPV,
kCascadeDCABachToPV,
*/

enum ChildTrackType { kPosTrack,
kNegTrack,
Expand Down Expand Up @@ -101,11 +92,6 @@ class FemtoDreamCascadeSelection
nCascadeTranRadMin(0),
nCascadeTranRadMax(0),
nCascadeDecVtxMax(0),
/*
nCascadeDCAPosToPV(0),
nCascadeDCANegToPV(0),
nCascadeDCABachToPV(0),
*/
nCascadeV0DCADaughMax(0),
nCascadeV0CPAMin(0),
nCascadeV0TranRadMin(0),
Expand All @@ -121,11 +107,6 @@ class FemtoDreamCascadeSelection
fCascadeTranRadMin(9999999),
fCascadeTranRadMax(-9999999),
fCascadeDecVtxMax(-9999999),
/*
fCascadeDCAPosToPV(9999999),
fCascadeDCANegToPV(9999999),
fCascadeDCABachToPV(9999999),
*/
fCascadeV0DCADaughMax(-9999999),
fCascadeV0CPAMin(9999999),
fCascadeV0TranRadMin(9999999),
Expand All @@ -141,7 +122,6 @@ class FemtoDreamCascadeSelection
fInvMassCompetingLowLimit(1.5),
fInvMassCompetingUpLimit(2.0),
isCascOmega(false)
/*,nSigmaPIDOffsetTPC(0.)*/
{
}

Expand Down Expand Up @@ -174,7 +154,7 @@ class FemtoDreamCascadeSelection
} else if (child == femtoDreamCascadeSelection::kNegTrack) {
NegDaughTrack.setSelection(selVal, selVar, selType);
} else if (child == femtoDreamCascadeSelection::kBachTrack) {
BachDaugTrack.setSelection(selVal, selVar, selType);
BachDaughTrack.setSelection(selVal, selVar, selType);
}
}

Expand All @@ -187,7 +167,7 @@ class FemtoDreamCascadeSelection
} else if (child == femtoDreamCascadeSelection::kNegTrack) {
NegDaughTrack.setPIDSpecies(pids);
} else if (child == femtoDreamCascadeSelection::kBachTrack) {
BachDaugTrack.setPIDSpecies(pids);
BachDaughTrack.setPIDSpecies(pids);
}
}

Expand Down Expand Up @@ -315,7 +295,7 @@ class FemtoDreamCascadeSelection

FemtoDreamTrackSelection PosDaughTrack;
FemtoDreamTrackSelection NegDaughTrack;
FemtoDreamTrackSelection BachDaugTrack;
FemtoDreamTrackSelection BachDaughTrack;

static constexpr int kNcascadeSelection = 16;

Expand Down Expand Up @@ -431,9 +411,9 @@ void FemtoDreamCascadeSelection::init(HistogramRegistry* QAregistry, HistogramRe
aod::femtodreamparticle::TrackType::kNegChild,
aod::femtodreamparticle::cutContainerType>(mQAHistogramRegistry, mHistogramRegistry);

BachDaugTrack.init<aod::femtodreamparticle::ParticleType::kCascadeBachelor,
aod::femtodreamparticle::TrackType::kBachelor,
aod::femtodreamparticle::cutContainerType>(mQAHistogramRegistry, mHistogramRegistry);
BachDaughTrack.init<aod::femtodreamparticle::ParticleType::kCascadeBachelor,
aod::femtodreamparticle::TrackType::kBachelor,
aod::femtodreamparticle::cutContainerType>(mQAHistogramRegistry, mHistogramRegistry);
}

/// check whether the most open cuts are fulfilled - most of this should have
Expand Down Expand Up @@ -506,7 +486,6 @@ bool FemtoDreamCascadeSelection::isSelectedMinimal(Col const& col, Casc const& c
const float invMass = isCascOmega ? cascade.mOmega() : cascade.mXi();
// const float invMass = cascade.mXi();

// LOGF(info, "GG producer: Charge %i", cascade.sign());
if (invMassLambda < fV0InvMassLowLimit || invMassLambda > fV0InvMassUpLimit) {
return false;
}
Expand All @@ -515,15 +494,13 @@ bool FemtoDreamCascadeSelection::isSelectedMinimal(Col const& col, Casc const& c
return false;
}

/*
if (fRejectCompetingMass) {
const float invMassCompeting = isCascOmega ? cascade.mXi() : cascade.mOmega();
if (invMassCompeting > fInvMassCompetingLowLimit &&
invMassCompeting < fInvMassCompetingUpLimit) {
return false;
}
}
*/

if (nCascadePtMin > 0 && cascade.pt() < fCascadePtMin) {
return false;
Expand Down Expand Up @@ -579,7 +556,7 @@ bool FemtoDreamCascadeSelection::isSelectedMinimal(Col const& col, Casc const& c
if (!NegDaughTrack.isSelectedMinimal(negTrack)) {
return false;
}
if (!BachDaugTrack.isSelectedMinimal(bachTrack)) {
if (!BachDaughTrack.isSelectedMinimal(bachTrack)) {
return false;
}

Expand All @@ -589,10 +566,10 @@ bool FemtoDreamCascadeSelection::isSelectedMinimal(Col const& col, Casc const& c
template <typename cutContainerType, typename Col, typename Casc, typename Track>
std::array<cutContainerType, 8> FemtoDreamCascadeSelection::getCutContainer(Col const& col, Casc const& casc, Track const& posTrack, Track const& negTrack, Track const& bachTrack)
{
// Cut bit
auto outputPosTrack = PosDaughTrack.getCutContainer<false, cutContainerType>(posTrack, casc.positivept(), casc.positiveeta(), casc.dcapostopv());
auto outputNegTrack = NegDaughTrack.getCutContainer<false, cutContainerType>(negTrack, casc.negativept(), casc.negativeeta(), casc.dcanegtopv());
auto outputBachTrack = BachDaugTrack.getCutContainer<false, cutContainerType>(bachTrack, casc.bachelorpt(), casc.bacheloreta(), casc.dcabachtopv());
auto outputPosTrack = PosDaughTrack.getCutContainer<false, cutContainerType>(posTrack, posTrack.pt(), posTrack.eta(), posTrack.dcaXY());
auto outputNegTrack = NegDaughTrack.getCutContainer<false, cutContainerType>(negTrack, negTrack.pt(), negTrack.eta(), negTrack.dcaXY());
auto outputBachTrack = BachDaughTrack.getCutContainer<false, cutContainerType>(bachTrack, bachTrack.pt(), bachTrack.eta(), bachTrack.dcaXY());

cutContainerType output = 0;
size_t counter = 0;

Expand All @@ -608,7 +585,6 @@ std::array<cutContainerType, 8> FemtoDreamCascadeSelection::getCutContainer(Col
const auto cpav0 = casc.v0cosPA(col.posX(), col.posY(), col.posZ());
const auto v0dcatopv = casc.dcav0topv(col.posX(), col.posY(), col.posZ());

// LOGF(info, "GG producer: New dcatoPV: %f", dcav0topv);
float observable = 0.;
for (auto& sel : mSelections) {

Expand Down Expand Up @@ -661,14 +637,12 @@ std::array<cutContainerType, 8> FemtoDreamCascadeSelection::getCutContainer(Col
break;
case (femtoDreamCascadeSelection::kCascadeV0DCAtoPVMin):
observable = v0dcatopv;
// LOGF(info, "==> Now it is: %f", dcav0topv);
break;
case (femtoDreamCascadeSelection::kCascadeV0DCAtoPVMax):
observable = v0dcatopv;
break;
} // switch
sel.checkSelectionSetBit(observable, output, counter, nullptr);
//}
} // for loop

return {
Expand Down Expand Up @@ -711,8 +685,8 @@ void FemtoDreamCascadeSelection::fillQA(Col const& col, Casc const& casc, Track
aod::femtodreamparticle::TrackType::kPosChild, false, cutstage>(posTrack);
NegDaughTrack.fillQA<aod::femtodreamparticle::ParticleType::kCascadeV0Child,
aod::femtodreamparticle::TrackType::kNegChild, false, cutstage>(negTrack);
BachDaugTrack.fillQA<aod::femtodreamparticle::ParticleType::kCascadeBachelor,
aod::femtodreamparticle::TrackType::kBachelor, false, cutstage>(bachTrack);
BachDaughTrack.fillQA<aod::femtodreamparticle::ParticleType::kCascadeBachelor,
aod::femtodreamparticle::TrackType::kBachelor, false, cutstage>(bachTrack);
}
}

Expand Down
15 changes: 15 additions & 0 deletions PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ class FemtoDreamCollisionSelection
return true;
}

template <typename C, typename Casc, typename CascC, typename T>
bool isCollisionWithoutTrkCasc(C const& col, Casc const& Cascades, CascC& CascadeCuts, T const& /*Tracks*/)
{
// check if there is no selected Cascade
for (auto const& Cascade : Cascades) {
auto postrack = Cascade.template posTrack_as<T>();
auto negtrack = Cascade.template negTrack_as<T>();
auto bachtrack = Cascade.template bachelor_as<T>();
if (CascadeCuts.isSelectedMinimal(col, Cascade, postrack, negtrack, bachtrack)) {
return false;
}
}
return true;
}

/// Some basic QA of the event
/// \tparam T type of the collision
/// \param col Collision
Expand Down
2 changes: 1 addition & 1 deletion PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FemtoDreamDetaDphiStar
radiiTPC = radiiTPCtoCut;
fillQA = fillTHSparse;

if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && (mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kTrack || mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kCascadeV0Child)) {
if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && (mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kTrack || mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kCascadeV0Child || mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kCascadeBachelor)) {
std::string dirName = static_cast<std::string>(dirNames[0]);
histdetadpi[0][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(histNames[0][0]) + static_cast<std::string>(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
histdetadpi[0][1] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(histNames[1][0]) + static_cast<std::string>(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
Expand Down
13 changes: 13 additions & 0 deletions PWGCF/FemtoDream/Core/femtoDreamMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@ class FemtoDreamMath
{
return std::sqrt(std::pow(getkT(part1, mass1, part2, mass2), 2.) + std::pow(0.5 * (mass1 + mass2), 2.));
}

template <typename T1>
static float getInvMassCascade(const T1& trackpos, const float masspos, const T1& trackneg, const float massneg, const T1& trackbach, const float massbach, const float massv0)
{
// calculate the invariant mass
const ROOT::Math::PtEtaPhiMVector posDaug(trackpos.pt(), trackpos.eta(), trackpos.phi(), masspos);
const ROOT::Math::PtEtaPhiMVector negDaug(trackneg.pt(), trackneg.eta(), trackneg.phi(), massneg);
const ROOT::Math::PtEtaPhiMVector bachDaug(trackbach.pt(), trackbach.eta(), trackbach.phi(), massbach);
const ROOT::Math::PxPyPzMVector v0(posDaug.Px() + negDaug.Px(), posDaug.Py() + negDaug.Py(), posDaug.Pz() + negDaug.Pz(), massv0);
const ROOT::Math::PxPyPzMVector casc = v0 + bachDaug;

return casc.M();
}
};

} // namespace o2::analysis::femtoDream
Expand Down
Loading

0 comments on commit 07b63f5

Please sign in to comment.