Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions PWGCF/FemtoDream/Core/femtoDreamMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

#include "Math/Boost.h"
#include "Math/Vector4D.h"
#include "TLorentzVector.h"

Check failure on line 21 in PWGCF/FemtoDream/Core/femtoDreamMath.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include "TMath.h"
#include "TVector2.h"
#include <Math/VectorUtil.h>

#include <iostream>

Check failure on line 26 in PWGCF/FemtoDream/Core/femtoDreamMath.h

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <vector>

namespace o2::analysis::femtoDream
Expand Down Expand Up @@ -110,7 +110,7 @@

float Q32 = q12.M2() + q23.M2() + q31.M2();

return sqrt(-Q32);

Check failure on line 113 in PWGCF/FemtoDream/Core/femtoDreamMath.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}

/// Compute the transverse momentum of a pair of particles
Expand Down Expand Up @@ -140,6 +140,18 @@
return std::sqrt(std::pow(getkT(part1, mass1, part2, mass2), 2.) + std::pow(0.5 * (mass1 + mass2), 2.));
}

template <typename T1>
static float calcInvMassV0(const T1& trackpos, const float masspos, const T1& trackneg, const float massneg)
{
// 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::PxPyPzMVector v0 = negDaug + posDaug;
const ROOT::Math::PtEtaPhiMVector v0 = negDaug + posDaug;

return v0.M();
}

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)
{
Expand Down
33 changes: 33 additions & 0 deletions PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2025 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -15,7 +15,9 @@

#include "PWGCF/DataModel/FemtoDerived.h"
#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h"
#include "PWGCF/FemtoDream/Core/femtoDreamMath.h"
#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h"
#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h"

#include "DataFormatsParameters/GRPObject.h"
#include "Framework/ASoAHelpers.h"
Expand All @@ -30,7 +32,7 @@
#include "fairlogger/Logger.h"

#include <cstdint>
#include <iostream>

Check failure on line 35 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <vector>

using namespace o2;
Expand All @@ -42,10 +44,10 @@
struct femtoDreamDebugV0 {
SliceCache cache;

Configurable<int> ConfV01_PDGCode{"ConfV01_PDGCode", 3122, "V0 - PDG code"};

Check failure on line 47 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<int> ConfV01_ChildPos_PDGCode{"ConfV01_PosChild_PDGCode", 2212, "Positive Child - PDG code"};

Check failure on line 48 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<int> ConfV01_ChildNeg_PDGCode{"ConfV01_NegChild_PDGCode", 211, "Negative Child- PDG code"};

Check failure on line 49 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<aod::femtodreamparticle::cutContainerType> ConfV01_CutBit{"ConfV01_CutBit", 338, "V0 - Selection bit from cutCulator"};

Check failure on line 50 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfV0TempFitVarBins{"ConfV0TempFitVarBins", {300, 0.95, 1.}, "V0: binning of the TempFitVar in the pT vs. TempFitVar plot"};
ConfigurableAxis ConfV0TempFitVarMomentumBins{"ConfV0TempFitVarMomentumBins", {20, 0.5, 4.05}, "V0: pT binning of the pT vs. TempFitVar plot"};
ConfigurableAxis ConfBinmult{"ConfBinmult", {1, 0, 1}, "multiplicity Binning"};
Expand All @@ -68,6 +70,11 @@
ConfigurableAxis ConfChildTempFitVarBins{"ConfChildTempFitVarBins", {300, -0.15, 0.15}, "V0 child: binning of the TempFitVar in the pT vs. TempFitVar plot"};
ConfigurableAxis ConfChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"};

Configurable<bool> ConfIsLambda{"ConfIsLambda", false, "Set to true if V0 is Lambda, false if K0s"};
Configurable<bool> ConfRejectCompetingMass{"ConfRejectCompetingMass", false, "Reject the competing Cascade Mass (use only for debugging. More efficient to exclude it already at the producer level)"};
Configurable<float> ConfCompetingV0MassLowLimit{"ConfCompetingV0MassLowLimit", 0., "Lower Limit of the invariant mass window within which to reject the V0"};
Configurable<float> ConfCompetingV0MassUpLimit{"ConfCompetingV0MassUpLimit", 0., "Upper Limit of the invariant mass window within which to reject the V0"};

using FemtoFullParticles = soa::Join<aod::FDParticles, aod::FDExtParticles>;
Partition<FemtoFullParticles> partsV0 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && (ncheckbit(aod::femtodreamparticle::cut, ConfV01_CutBit));
Preslice<FemtoFullParticles> perCol = aod::femtodreamparticle::fdCollisionId;
Expand All @@ -84,13 +91,21 @@
HistogramRegistry EventRegistry{"Event", {}, OutputObjHandlingPolicy::AnalysisObject};
HistogramRegistry V0Registry{"FullV0QA", {}, OutputObjHandlingPolicy::AnalysisObject};

float massProton;
float massPion;

void init(InitContext&)
{
eventHisto.init(&EventRegistry, false);
posChildHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, false, ConfV01_ChildPos_PDGCode.value, true);
negChildHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, false, ConfV01_ChildNeg_PDGCode, true);
motherHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0TempFitVarMomentumBins, ConfDummy, ConfDummy, ConfV0TempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, false, ConfV01_PDGCode.value, true);
V0Registry.add("hArmenterosPodolanski/hArmenterosPodolanskiPlot", "; #alpha; p_{T} (MeV/#it{c})", kTH2F, {{100, -1, 1}, {500, -0.3, 2}});

massProton = o2::analysis::femtoDream::getMass(2212);
massPion = o2::analysis::femtoDream::getMass(211);
// massProton = getMass(2212);
// massPion = getMass(211);
}

/// Porduce QA plots for V0 selection in FemtoDream framework
Expand All @@ -99,7 +114,7 @@
{
auto groupPartsOne = Partition.sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
eventHisto.fillQA<false>(col);
for (auto& part : groupPartsOne) {

Check failure on line 117 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!part.has_children()) {
continue;
}
Expand Down Expand Up @@ -132,6 +147,24 @@
TVector3 p_perp = p_plus - (p_parent * (pL_plus / p_parent.Mag()));
double qtarm = p_perp.Mag();

// Competing mass rejection
if (ConfRejectCompetingMass) {
float invMassCompetingV0;
if (ConfIsLambda) {
if (part.sign() < 0) {
invMassCompetingV0 = FemtoDreamMath::calcInvMassV0(posChild, massPion, negChild, massProton);
} else {
invMassCompetingV0 = FemtoDreamMath::calcInvMassV0(posChild, massProton, negChild, massPion);
}
} else {
invMassCompetingV0 = FemtoDreamMath::calcInvMassV0(posChild, massPion, negChild, massPion);
}
if (invMassCompetingV0 > ConfCompetingV0MassLowLimit.value &&
invMassCompetingV0 < ConfCompetingV0MassUpLimit.value) {
continue;
}
}

V0Registry.fill(HIST("hArmenterosPodolanski/hArmenterosPodolanskiPlot"), alpha, qtarm);

motherHistos.fillQA<false, true>(part, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
Expand Down
Loading