Skip to content
Merged
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
151 changes: 75 additions & 76 deletions PWGLF/Utils/strangenessBuilderModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// or submit itself to any jurisdiction.

/// \file strangenessBuilderModule.h
/// \brief strangeness builder module
/// \brief strangeness builder module
/// \author ALICE

// simple checkers, but ensure 8 bit integers
Expand Down Expand Up @@ -184,80 +184,80 @@
static constexpr float defaultLifetimeCuts[1][4] = {{20, 60, 40, 20}};

struct products : o2::framework::ProducesGroup {
//__________________________________________________
// V0 tables
o2::framework::Produces<aod::V0Indices> v0indices; // standard part of V0Datas
o2::framework::Produces<aod::V0CoresBase> v0cores; // standard part of V0Datas
o2::framework::Produces<aod::V0Covs> v0covs; // for decay chain reco

//__________________________________________________
// cascade tables
o2::framework::Produces<aod::CascIndices> cascidx; // standard part of CascDatas
o2::framework::Produces<aod::KFCascIndices> kfcascidx; // standard part of KFCascDatas
o2::framework::Produces<aod::TraCascIndices> tracascidx; // standard part of TraCascDatas
o2::framework::Produces<aod::StoredCascCores> cascdata; // standard part of CascDatas
o2::framework::Produces<aod::StoredKFCascCores> kfcascdata; // standard part of KFCascDatas
o2::framework::Produces<aod::StoredTraCascCores> tracascdata; // standard part of TraCascDatas
o2::framework::Produces<aod::CascCovs> casccovs; // for decay chain reco
o2::framework::Produces<aod::KFCascCovs> kfcasccovs; // for decay chain reco
o2::framework::Produces<aod::TraCascCovs> tracasccovs; // for decay chain reco

//__________________________________________________
// interlink tables
o2::framework::Produces<aod::V0DataLink> v0dataLink; // de-refs V0s -> V0Data
o2::framework::Produces<aod::CascDataLink> cascdataLink; // de-refs Cascades -> CascData
o2::framework::Produces<aod::KFCascDataLink> kfcascdataLink; // de-refs Cascades -> KFCascData
o2::framework::Produces<aod::TraCascDataLink> tracascdataLink; // de-refs Cascades -> TraCascData

//__________________________________________________
// secondary auxiliary tables
o2::framework::Produces<aod::V0TrackXs> v0trackXs; // for decay chain reco
o2::framework::Produces<aod::CascTrackXs> cascTrackXs; // for decay chain reco

//__________________________________________________
// further auxiliary / optional if desired
o2::framework::Produces<aod::CascBBs> cascbb;
o2::framework::Produces<aod::V0DauCovs> v0daucovs; // covariances of daughter tracks
o2::framework::Produces<aod::V0DauCovIUs> v0daucovIUs; // covariances of daughter tracks
o2::framework::Produces<aod::V0TraPosAtDCAs> v0dauPositions; // auxiliary debug information
o2::framework::Produces<aod::V0TraPosAtIUs> v0dauPositionsIU; // auxiliary debug information
o2::framework::Produces<aod::V0Ivanovs> v0ivanovs; // information for Marian's tests

//__________________________________________________
// MC information: V0
o2::framework::Produces<aod::McV0Labels> v0labels; // MC labels for V0s
o2::framework::Produces<aod::V0MCCores> v0mccores; // mc info storage
o2::framework::Produces<aod::V0CoreMCLabels> v0CoreMCLabels; // interlink V0Cores -> V0MCCores
o2::framework::Produces<aod::V0MCCollRefs> v0mccollref; // references collisions from V0MCCores

// MC information: Cascades
o2::framework::Produces<aod::McCascLabels> casclabels; // MC labels for cascades
o2::framework::Produces<aod::McKFCascLabels> kfcasclabels; // MC labels for KF cascades
o2::framework::Produces<aod::McTraCascLabels> tracasclabels; // MC labels for tracked cascades
o2::framework::Produces<aod::McCascBBTags> bbtags; // bb tags (inv structure tagging in mc)
o2::framework::Produces<aod::CascMCCores> cascmccores; // mc info storage
o2::framework::Produces<aod::CascCoreMCLabels> cascCoreMClabels; // interlink CascCores -> CascMCCores
o2::framework::Produces<aod::CascMCCollRefs> cascmccollrefs; // references MC collisions from MC cascades

//__________________________________________________
// cascade interlinks
// FIXME: commented out until strangederivedbuilder adjusted accordingly
// o2::framework::Produces<aod::CascToTraRefs> cascToTraRefs; // cascades -> tracked
// o2::framework::Produces<aod::CascToKFRefs> cascToKFRefs; // cascades -> KF
// o2::framework::Produces<aod::TraToCascRefs> traToCascRefs; // tracked -> cascades
// o2::framework::Produces<aod::KFToCascRefs> kfToCascRefs; // KF -> cascades

//__________________________________________________
// Findable tags
o2::framework::Produces<aod::V0FoundTags> v0FoundTag;
o2::framework::Produces<aod::CascFoundTags> cascFoundTag;
//__________________________________________________
// V0 tables
o2::framework::Produces<aod::V0Indices> v0indices; // standard part of V0Datas
o2::framework::Produces<aod::V0CoresBase> v0cores; // standard part of V0Datas
o2::framework::Produces<aod::V0Covs> v0covs; // for decay chain reco

//__________________________________________________
// cascade tables
o2::framework::Produces<aod::CascIndices> cascidx; // standard part of CascDatas
o2::framework::Produces<aod::KFCascIndices> kfcascidx; // standard part of KFCascDatas
o2::framework::Produces<aod::TraCascIndices> tracascidx; // standard part of TraCascDatas
o2::framework::Produces<aod::StoredCascCores> cascdata; // standard part of CascDatas
o2::framework::Produces<aod::StoredKFCascCores> kfcascdata; // standard part of KFCascDatas
o2::framework::Produces<aod::StoredTraCascCores> tracascdata; // standard part of TraCascDatas
o2::framework::Produces<aod::CascCovs> casccovs; // for decay chain reco
o2::framework::Produces<aod::KFCascCovs> kfcasccovs; // for decay chain reco
o2::framework::Produces<aod::TraCascCovs> tracasccovs; // for decay chain reco

//__________________________________________________
// interlink tables
o2::framework::Produces<aod::V0DataLink> v0dataLink; // de-refs V0s -> V0Data
o2::framework::Produces<aod::CascDataLink> cascdataLink; // de-refs Cascades -> CascData
o2::framework::Produces<aod::KFCascDataLink> kfcascdataLink; // de-refs Cascades -> KFCascData
o2::framework::Produces<aod::TraCascDataLink> tracascdataLink; // de-refs Cascades -> TraCascData

//__________________________________________________
// secondary auxiliary tables
o2::framework::Produces<aod::V0TrackXs> v0trackXs; // for decay chain reco
o2::framework::Produces<aod::CascTrackXs> cascTrackXs; // for decay chain reco

//__________________________________________________
// further auxiliary / optional if desired
o2::framework::Produces<aod::CascBBs> cascbb;
o2::framework::Produces<aod::V0DauCovs> v0daucovs; // covariances of daughter tracks
o2::framework::Produces<aod::V0DauCovIUs> v0daucovIUs; // covariances of daughter tracks
o2::framework::Produces<aod::V0TraPosAtDCAs> v0dauPositions; // auxiliary debug information
o2::framework::Produces<aod::V0TraPosAtIUs> v0dauPositionsIU; // auxiliary debug information
o2::framework::Produces<aod::V0Ivanovs> v0ivanovs; // information for Marian's tests

//__________________________________________________
// MC information: V0
o2::framework::Produces<aod::McV0Labels> v0labels; // MC labels for V0s
o2::framework::Produces<aod::V0MCCores> v0mccores; // mc info storage
o2::framework::Produces<aod::V0CoreMCLabels> v0CoreMCLabels; // interlink V0Cores -> V0MCCores
o2::framework::Produces<aod::V0MCCollRefs> v0mccollref; // references collisions from V0MCCores

// MC information: Cascades
o2::framework::Produces<aod::McCascLabels> casclabels; // MC labels for cascades
o2::framework::Produces<aod::McKFCascLabels> kfcasclabels; // MC labels for KF cascades
o2::framework::Produces<aod::McTraCascLabels> tracasclabels; // MC labels for tracked cascades
o2::framework::Produces<aod::McCascBBTags> bbtags; // bb tags (inv structure tagging in mc)
o2::framework::Produces<aod::CascMCCores> cascmccores; // mc info storage
o2::framework::Produces<aod::CascCoreMCLabels> cascCoreMClabels; // interlink CascCores -> CascMCCores
o2::framework::Produces<aod::CascMCCollRefs> cascmccollrefs; // references MC collisions from MC cascades

//__________________________________________________
// cascade interlinks
// FIXME: commented out until strangederivedbuilder adjusted accordingly
// o2::framework::Produces<aod::CascToTraRefs> cascToTraRefs; // cascades -> tracked
// o2::framework::Produces<aod::CascToKFRefs> cascToKFRefs; // cascades -> KF
// o2::framework::Produces<aod::TraToCascRefs> traToCascRefs; // tracked -> cascades
// o2::framework::Produces<aod::KFToCascRefs> kfToCascRefs; // KF -> cascades

//__________________________________________________
// Findable tags
o2::framework::Produces<aod::V0FoundTags> v0FoundTag;
o2::framework::Produces<aod::CascFoundTags> cascFoundTag;
};

// strangenessBuilder: 1st-order configurables
struct coreConfigurables : o2::framework::ConfigurableGroup {
o2::framework::Configurable<o2::framework::LabeledArray<int>> enabledTables{"enabledTables",
{defaultParameters[0], nTables, nParameters, tableNames, parameterNames},
"Produce this table: -1 for autodetect; otherwise, 0/1 is false/true"};
{defaultParameters[0], nTables, nParameters, tableNames, parameterNames},
"Produce this table: -1 for autodetect; otherwise, 0/1 is false/true"};
std::vector<int> mEnabledTables; // Vector of enabled tables

// first order deduplication implementation
Expand Down Expand Up @@ -371,22 +371,22 @@
// constructor
}

// mass windows
// mass windows
float getMassSigmaK0Short(float pt)
{
return preSelectOpts.massCutK0->get("constant") + pt * preSelectOpts.massCutK0->get("linear") + preSelectOpts.massCutK0->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutK0->get("expoRelax"));

Check failure on line 377 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
float getMassSigmaLambda(float pt)
{
return preSelectOpts.massCutLambda->get("constant") + pt * preSelectOpts.massCutLambda->get("linear") + preSelectOpts.massCutLambda->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutLambda->get("expoRelax"));

Check failure on line 381 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
float getMassSigmaXi(float pt)
{
return preSelectOpts.massCutXi->get("constant") + pt * preSelectOpts.massCutXi->get("linear") + preSelectOpts.massCutXi->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutXi->get("expoRelax"));

Check failure on line 385 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
float getMassSigmaOmega(float pt)
{
return preSelectOpts.massCutOm->get("constant") + pt * preSelectOpts.massCutOm->get("linear") + preSelectOpts.massCutOm->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutOm->get("expoRelax"));

Check failure on line 389 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}

// helper object
Expand Down Expand Up @@ -494,7 +494,7 @@
std::vector<int> ao2dV0toV0List; // index to relate v0s -> v0List
std::vector<int> v0Map; // index to relate v0List -> v0sFromCascades

// declaration of structs here
// declaration of structs here
// (N.B.: will be invisible to the outside, create your own copies)
o2::pwglf::strangenessbuilder::coreConfigurables baseOpts;
o2::pwglf::strangenessbuilder::v0Configurables v0BuilderOpts;
Expand All @@ -504,11 +504,11 @@
template <typename TBaseConfigurables, typename TV0Configurables, typename TCascadeConfigurables, typename TPreSelOpts, typename THistoRegistry, typename TInitContext>
void init(TBaseConfigurables const& inputBaseOpts, TV0Configurables const& inputV0BuilderOpts, TCascadeConfigurables const& inputCascadeBuilderOpts, TPreSelOpts const& inputPreSelectOpts, THistoRegistry& histos, TInitContext& context)
{
// read in configurations from the task where it's used
// read in configurations from the task where it's used
// could be grouped even further, but should work
baseOpts = inputBaseOpts;
v0BuilderOpts = inputV0BuilderOpts;
cascadeBuilderOpts = inputCascadeBuilderOpts;
v0BuilderOpts = inputV0BuilderOpts;
cascadeBuilderOpts = inputCascadeBuilderOpts;
preSelectOpts = inputPreSelectOpts;

// setup bookkeeping histogram
Expand Down Expand Up @@ -773,7 +773,6 @@
// }
}


//__________________________________________________
template <class TBCs, typename THistoRegistry, typename TCollisions, typename TMCCollisions, typename TV0s, typename TCascades, typename TTracks, typename TMCParticles>
void prepareBuildingLists(THistoRegistry& histos, TCollisions const& collisions, TMCCollisions const& mcCollisions, TV0s const& v0s, TCascades const& cascades, TTracks const& tracks, TMCParticles const& mcParticles)
Expand Down Expand Up @@ -966,10 +965,10 @@

bool trackIsInteresting = false;
if (
(originParticle.pdgCode() == 310 && v0BuilderOpts.mc_addGeneratedK0Short.value > 0) ||

Check failure on line 968 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == 3122 && v0BuilderOpts.mc_addGeneratedLambda.value > 0) ||

Check failure on line 969 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == -3122 && v0BuilderOpts.mc_addGeneratedAntiLambda.value > 0) ||

Check failure on line 970 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == 22 && v0BuilderOpts.mc_addGeneratedGamma.value > 0)) {

Check failure on line 971 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
trackIsInteresting = true;
}
if (!trackIsInteresting) {
Expand Down Expand Up @@ -1019,7 +1018,7 @@
currentV0Entry.pdgCode = positiveTrackIndex.pdgCode;
currentV0Entry.particleId = positiveTrackIndex.originId;
currentV0Entry.isCollinearV0 = false;
if (v0BuilderOpts.mc_addGeneratedGammaMakeCollinear.value && currentV0Entry.pdgCode == 22) {

Check failure on line 1021 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
currentV0Entry.isCollinearV0 = true;
}
currentV0Entry.found = false;
Expand Down Expand Up @@ -1463,7 +1462,7 @@
straHelper.v0.daughterDCA,
straHelper.v0.positiveDCAxy,
straHelper.v0.negativeDCAxy,
TMath::Cos(straHelper.v0.pointingAngle),

Check failure on line 1465 in PWGLF/Utils/strangenessBuilderModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
straHelper.v0.dcaToPV,
v0.v0Type);
products.v0dataLink(products.v0cores.lastIndex(), -1);
Expand Down
Loading