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
10 changes: 5 additions & 5 deletions PWGCF/DataModel/FemtoDerived.h
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/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef PWGCF_DATAMODEL_FEMTODERIVED_H_

Check failure on line 11 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
#define PWGCF_DATAMODEL_FEMTODERIVED_H_

#include "PWGHF/Core/HfHelper.h"
Expand Down Expand Up @@ -48,9 +48,9 @@

using BitMaskType = uint32_t; //! Definition of the data type for the collision masks

DECLARE_SOA_COLUMN(BitMaskTrackOne, bitmaskTrackOne, BitMaskType); //! Bit for track one

Check failure on line 51 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(BitMaskTrackTwo, bitmaskTrackTwo, BitMaskType); //! Bit for track two

Check failure on line 52 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(BitMaskTrackThree, bitmaskTrackThree, BitMaskType); //! Bit for track three

Check failure on line 53 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(Downsample, downsample, bool); //! Flag for downsampling

Expand Down Expand Up @@ -91,7 +91,7 @@

namespace mcfdcolllabel
{
DECLARE_SOA_INDEX_COLUMN(FDMCCollision, fdMCCollision); //! MC collision for femtodreamcollision

Check failure on line 94 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
}
DECLARE_SOA_TABLE_STAGED(FDMCCollLabels, "FDMCCollLabel", mcfdcolllabel::FDMCCollisionId);

Expand Down Expand Up @@ -139,13 +139,13 @@

static constexpr std::string_view TrackTypeName[kNTrackTypes] = {"Trk", "Pos", "Neg", "Bach"}; //! Naming of the different particle types

DECLARE_SOA_INDEX_COLUMN(FDCollision, fdCollision);

Check failure on line 142 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(Pt, pt, float); //! p_T (GeV/c)
DECLARE_SOA_COLUMN(Eta, eta, float); //! Eta
DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi
DECLARE_SOA_COLUMN(PartType, partType, uint8_t); //! Type of the particle, according to femtodreamparticle::ParticleType
DECLARE_SOA_COLUMN(Cut, cut, cutContainerType); //! Bit-wise container for the different selection criteria
DECLARE_SOA_COLUMN(PIDCut, pidcut, cutContainerType); //! Bit-wise container for the different PID selection criteria \todo since bit-masking cannot be done yet with filters we use a second field for the PID

Check failure on line 148 in PWGCF/DataModel/FemtoDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TempFitVar, tempFitVar, float); //! Observable for the template fitting (Track: DCA_xy, V0: CPA)
DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Children, children); //! Field for the track indices to remove auto-correlations
DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! The invariant mass of V0 candidate, assuming lambda
Expand Down Expand Up @@ -245,14 +245,14 @@
DECLARE_SOA_COLUMN(Prong0Phi, prong0Phi, float); //! Track phi of charm hadron prong0
DECLARE_SOA_COLUMN(Prong1Phi, prong1Phi, float); //! Track phi of charm hadron prong1
DECLARE_SOA_COLUMN(Prong2Phi, prong2Phi, float); //! Track phi of charm hadron prong2
DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! Selection of mass hypothesis for charm hadron (1 for Lc -> pkpi, 2 for Lc -> pikp, 4 for D+ -> pikpi)
DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int); //! Selection of mass hypothesis for charm hadron (1 for Lc -> pkpi, 2 for Lc -> pikp, 4 for D+ -> pikpi)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that int8_t is the only integral type affected by this issue. Why not use int16_t?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestion! Using int16_t would indeed be more memory-efficient, but I kept it as int for consistency with other columns and to avoid additional casting in the task code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I couldn't find a line where additional casting would be needed. Can you refer them?

Copy link
Collaborator Author

@zhangbiao-phy zhangbiao-phy Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here:

Filter hfMcSelFilter = (nabs(aod::fdhf::flagMc) == charmHadMcSel);

I will get the error if I didn't caste it to int16_t: Reason: Failed to create filter: ExpressionValidationError: Function bool greater_than_or_equal_to(int16, int32) not supported yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why charmHadMcSel has to be int.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your solution is to promote all concerned variables to int. I am proposing to make them the smallest working integral type, which AFAIK is int16_t .

I agree with your point and I also want to improve it with this point. However as I mentioned above, I already tried int16_t. It doesn't work (seems not support). So could you please approve it with current version?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are referring to the error

Function bool greater_than_or_equal_to(int16, int32) not supported yet.

I believe that one is irrelevant to my proposal.
I assume that in that case flagMc was int16 and charmHadMcSel was int.
What I am proposing is to have both of them int16 which should be supported.

Copy link
Collaborator Author

@zhangbiao-phy zhangbiao-phy Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already tried both case (flagMc was int16 and charmHadMcSel was int16). it is not the case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? What is not the case? What is the error then?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to investigate locally. Go ahead.

DECLARE_SOA_COLUMN(BDTBkg, bdtBkg, float); //! Background score using Boosted Decision Tree for charm hadron
DECLARE_SOA_COLUMN(BDTPrompt, bdtPrompt, float); //! Prompt signal score using Boosted Decision Tree for charm hadron
DECLARE_SOA_COLUMN(BDTFD, bdtFD, float); //! Feed-down score using Boosted Decision Tree for charm hadron
DECLARE_SOA_COLUMN(FlagMc, flagMc, int8_t); //! To select MC particle among charm hadrons, { DplusToPiKPi = 1, LcToPKPi = 2, DsToKKPi = 4, XicToPKP = 8, N3ProngD = 2ecays };
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
DECLARE_SOA_COLUMN(FlagMc, flagMc, int); //! To select MC particle among charm hadrons, { DplusToPiKPi = 1, LcToPKPi = 17, DsToKKPi = 6, XicToPKPi = 21, N3ProngD = 2ecays };
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
DECLARE_SOA_COLUMN(TrkPt, trkPt, float); //! Transverse momentum of associate femto particle
DECLARE_SOA_COLUMN(TrkEta, trkEta, float); //! Eta of associate femto particle
DECLARE_SOA_COLUMN(TrkPhi, trkPhi, float); //! Phi of associate femto particle
Expand Down
12 changes: 9 additions & 3 deletions PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ struct HfTaskCharmHadronsFemtoDream {

Filter eventMultiplicity = aod::femtodreamcollision::multNtr >= eventSel.multMin && aod::femtodreamcollision::multNtr <= eventSel.multMax;
Filter eventMultiplicityPercentile = aod::femtodreamcollision::multV0M >= eventSel.multPercentileMin && aod::femtodreamcollision::multV0M <= eventSel.multPercentileMax;
Filter hfCandSelFilter = aod::fdhf::candidateSelFlag >= static_cast<int8_t>(charmHadCandSel.value);
Filter hfMcSelFilter = nabs(aod::fdhf::flagMc) == static_cast<int8_t>(charmHadMcSel.value);
Filter hfCandSelFilter = aod::fdhf::candidateSelFlag >= charmHadCandSel;
Filter hfMcSelFilter = (nabs(aod::fdhf::flagMc) == charmHadMcSel);
Filter trackEtaFilterLow = ifnode(aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack), aod::femtodreamparticle::eta < etaTrack1Max, true);
Filter trackEtaFilterUp = ifnode(aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack), aod::femtodreamparticle::eta > etaTrack1Min, true);
Filter trackPtFilterLow = ifnode(aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack), aod::femtodreamparticle::pt < ptTrack1Max, true);
Expand Down Expand Up @@ -583,7 +583,7 @@ struct HfTaskCharmHadronsFemtoDream {
part.tpcNSigmaPr(),
part.tofNSigmaPr());
}
if (!sliceCharmHad.size() || !sliceTrk1.size()) {
if (sliceCharmHad.size() > 0 || sliceTrk1.size() > 0) {
rowFemtoResultColl(
col.globalIndex(),
timeStamp,
Expand All @@ -592,6 +592,7 @@ struct HfTaskCharmHadronsFemtoDream {
} else {
return;
}

doSameEvent<false>(sliceTrk1, sliceCharmHad, parts, col);
}
PROCESS_SWITCH(HfTaskCharmHadronsFemtoDream, processSameEvent, "Enable processing same event", false);
Expand Down Expand Up @@ -631,6 +632,11 @@ struct HfTaskCharmHadronsFemtoDream {
auto sliceMcTrk1 = partitionMcTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
auto sliceMcCharmHad = partitionMcCharmHadron->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);

if (sliceMcCharmHad.size() > 0) {
for (auto const& part : sliceMcCharmHad) {
registryCharmHadronQa.fill(HIST("CharmHadronQA/hPtVsMass"), part.pt(), getCharmHadronMass(part));
}
}
if (sliceMcTrk1.size() == 0 && sliceMcCharmHad.size() == 0) {
return;
}
Expand Down
Loading