Skip to content
Merged
35 changes: 22 additions & 13 deletions PWGCF/DataModel/FemtoDerived.h
Original file line numberDiff line numberDiff 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,22 +8,24 @@
// 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 <cmath>
#include "Framework/ASoA.h"
#include "MathUtils/Utils.h"
#include "Framework/DataTypes.h"
#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
#include "PWGHF/DataModel/CandidateSelectionTables.h"

#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/DataTypes.h"
#include "Framework/Expressions.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/PIDResponse.h"
#include "MathUtils/Utils.h"

#include <cmath>

namespace o2::aod
{
Expand All@@ -46,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
DECLARE_SOA_COLUMN(BitMaskTrackTwo, bitmaskTrackTwo, BitMaskType); //! Bit for track two

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(BitMaskTrackThree, bitmaskTrackThree, BitMaskType); //! Bit for track three

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.

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
} // namespace femtodreamcollision

Expand DownExpand Up@@ -88,17 +90,23 @@
/// FemtoDreamTrack
namespace femtodreamparticle
{
/// Distinuishes the different particle types
/// Distinguishes the different particle types
enum ParticleType {

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.
kTrack, //! Track
kV0, //! V0
kV0Child, //! Child track of a V0
kCascade, //! Cascade
kCascadeV0,
kCascadeV0Child,
kCascadeBachelor, //! Bachelor track of a cascade
kCharmHadron, //! Bachelor track of a cascade
kNParticleTypes //! Number of particle types
kCascadeBachelor, //! Bachelor track of a cascade
kCharmHadron, //! Bachelor track of a cascade
kReso, //! Resonances (phi)
kResoChild, // Child track of a Resonance
kResoPosdaughTPC_NegdaughTPC, // cases for Phi-daughters for TPC or TOF combinations
kResoPosdaughTPC_NegdaughTOF,
kResoPosdaughTOF_NegdaughTPC,
kResoPosdaughTOF_NegdaughTOF,
kNParticleTypes //! Number of particle types
};

enum MomentumType {
Expand All@@ -107,8 +115,9 @@
kPtpc //! momentum at the inner wall of the TPC (useful for PID plots)
};

static constexpr std::string_view ParticleTypeName[kNParticleTypes] = {"Tracks", "V0", "V0Child", "Cascade", "CascadeV0", "CascadeV0Child", "CascadeBachelor", "CharmHadron"}; //! Naming of the different particle types
static constexpr std::string_view TempFitVarName[kNParticleTypes] = {"/hDCAxy", "/hCPA", "/hDCAxy", "/hCPA", "/hCPA", "/hDCAxy", "/hDCAxy", "/hCPA"};
static constexpr std::string_view ParticleTypeName[kNParticleTypes] = {"Track", "V0", "V0Child", "Cascade", "CascadeV0", "CascadeV0Child", "CascadeBachelor", "CharmHadron", "Reso", "ResoChild", "ResoPosdaughTPC_NegdaughTPC", "ResoPosdaughTPC_NegdaughTOF", "ResoPosdaughTOF_NegdaughTPC", "ResoPosdaughTOF_NegdaughTOF"}; //! Naming of the different particle types

static constexpr std::string_view TempFitVarName[kNParticleTypes] = {"/hDCAxy", "/hCPA", "/hDCAxy", "/hCPA", "/hCPA", "/hDCAxy", "/hDCAxy", "/hCPA", "/hDCAxy", "/hDCAxy", "/hDCAxy", "/hDCAxy", "/hDCAxy", "/hDCAxy"};

using cutContainerType = uint32_t; //! Definition of the data type for the bit-wise container for the different selection criteria

Expand All@@ -130,13 +139,13 @@
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
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

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(MLambda, mLambda, float); //! The invariant mass of V0 candidate, assuming lambda
DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float); //! The invariant mass of V0 candidate, assuming antilambda

DECLARE_SOA_DYNAMIC_COLUMN(Theta, theta, //! Compute the theta of the track
[](float eta) -> float {
return 2.f * std::atan(std::exp(-eta));

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_DYNAMIC_COLUMN(Px, px, //! Compute the momentum in x in GeV/c
[](float pt, float phi) -> float {
Expand Down
27 changes: 15 additions & 12 deletions PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2025 CERN and copyright holders of ALICE O2.
// Copyright 2019-2022 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All@@ -16,15 +16,16 @@
#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMOBJECTSELECTION_H_
#define PWGCF_FEMTODREAM_CORE_FEMTODREAMOBJECTSELECTION_H_

#include "PWGCF/DataModel/FemtoDerived.h"
#include "PWGCF/FemtoDream/Core/femtoDreamSelection.h"

#include "Framework/HistogramRegistry.h"
#include "ReconstructionDataFormats/PID.h"

#include <algorithm>
#include <string>
#include <vector>

#include "PWGCF/FemtoDream/Core/femtoDreamSelection.h"
#include "ReconstructionDataFormats/PID.h"
#include "Framework/HistogramRegistry.h"
#include "PWGCF/DataModel/FemtoDerived.h"

using namespace o2;
using namespace o2::framework;

Expand DownExpand Up@@ -69,7 +70,7 @@ class FemtoDreamObjectSelection
{
std::vector<selValDataType> tmpSelVals = selVals; // necessary due to some features of the Configurable
std::vector<FemtoDreamSelection<selValDataType, selVariable>> tempVec;
for (const selValDataType selVal : tmpSelVals) {
for (const selValDataType& selVal : tmpSelVals) {
tempVec.push_back(FemtoDreamSelection<selValDataType, selVariable>(selVal, selVar, selType));
}
setSelection(tempVec);
Expand DownExpand Up@@ -97,7 +98,7 @@ class FemtoDreamObjectSelection
}

/// Then, the sorted selections are added to the overall container of cuts
for (auto& sel : sels) {
for (const auto& sel : sels) {
mSelections.push_back(sel);
}
}
Expand All@@ -121,7 +122,7 @@ class FemtoDreamObjectSelection
break;
}

for (auto sel : mSelections) {
for (auto& sel : mSelections) {
if (sel.getSelectionVariable() == selVar) {
switch (sel.getSelectionType()) {
case (femtoDreamSelection::SelectionType::kUpperLimit):
Expand DownExpand Up@@ -164,7 +165,7 @@ class FemtoDreamObjectSelection
std::vector<FemtoDreamSelection<selValDataType, selVariable>> getSelections(selVariable selVar)
{
std::vector<FemtoDreamSelection<selValDataType, selVariable>> selValVec;
for (auto it : mSelections) {
for (auto& it : mSelections) {
if (it.getSelectionVariable() == selVar) {
selValVec.push_back(it);
}
Expand All@@ -177,9 +178,11 @@ class FemtoDreamObjectSelection
std::vector<selVariable> getSelectionVariables()
{
std::vector<selVariable> selVarVec;
for (auto it : mSelections) {
for (auto& it : mSelections) {
auto selVar = it.getSelectionVariable();
if (std::none_of(selVarVec.begin(), selVarVec.end(), [selVar](selVariable a) { return a == selVar; })) {
if (std::none_of(selVarVec.begin(),
selVarVec.end(),
[selVar](selVariable a) { return a == selVar; })) {
selVarVec.push_back(selVar);
}
}
Expand Down
Loading
Loading