Skip to content
Open
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
8 changes: 8 additions & 0 deletions PWGLF/DataModel/LFResonanceTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
DECLARE_SOA_COLUMN(IsInSel8, isInSel8, bool); //! InSel8
DECLARE_SOA_COLUMN(IsInAfterAllCuts, isInAfterAllCuts, bool); //! InAfterAllCuts
DECLARE_SOA_COLUMN(ImpactParameter, impactParameter, float); //! ImpactParameter
DECLARE_SOA_COLUMN(MCMultiplicity, mcMultiplicity, float); //! MC Multiplicity

Check failure on line 79 in PWGLF/DataModel/LFResonanceTables.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.

} // namespace resocollision
DECLARE_SOA_TABLE(ResoCollisions, "AOD", "RESOCOLLISION",
Expand Down Expand Up @@ -171,7 +171,7 @@
#define requireSign() requireTrackFlag(ResoTrackFlags::kSign)

#define DECLARE_DYN_TRKSEL_COLUMN(name, getter, mask) \
DECLARE_SOA_DYNAMIC_COLUMN(name, getter, [](ResoTrackFlags::flagtype flags) -> bool { return ResoTrackFlags::checkFlag(flags, mask); });

Check failure on line 174 in PWGLF/DataModel/LFResonanceTables.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_INDEX_COLUMN(ResoCollision, resoCollision);
DECLARE_SOA_INDEX_COLUMN(ResoCollisionDF, resoCollisionDF);
Expand Down Expand Up @@ -211,7 +211,7 @@
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(Alpha, alpha, float); //! Alpha of the decay vertex
DECLARE_SOA_COLUMN(QtArm, qtarm, float); //! Armenteros Qt of the decay vertex

Check failure on line 214 in PWGLF/DataModel/LFResonanceTables.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(TpcSignal10, tpcSignal10, int8_t); //! TPC signal of the track x10
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosPi10, daughterTPCNSigmaPosPi10, int8_t); //! TPC PID x10 of the positive daughter as Pion
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosKa10, daughterTPCNSigmaPosKa10, int8_t); //! TPC PID x10 of the positive daughter as Kaon
Expand All @@ -231,6 +231,9 @@
DECLARE_SOA_COLUMN(DaughterTOFNSigmaBachPi10, daughterTOFNSigmaBachPi10, int8_t); //! TOF PID x10 of the bachelor daughter as Pion
DECLARE_SOA_COLUMN(DaughterTOFNSigmaBachKa10, daughterTOFNSigmaBachKa10, int8_t); //! TOF PID x10 of the bachelor daughter as Kaon
DECLARE_SOA_COLUMN(DaughterTOFNSigmaBachPr10, daughterTOFNSigmaBachPr10, int8_t); //! TOF PID x10 of the bachelor daughter as Proton
DECLARE_SOA_COLUMN(NCrossedRowsPos, nCrossedRowsPos, uint8_t); //! Number of TPC crossed rows of the positive daughter
DECLARE_SOA_COLUMN(NCrossedRowsNeg, nCrossedRowsNeg, uint8_t); //! Number of TPC crossed rows of the negative daughter
DECLARE_SOA_COLUMN(NCrossedRowsBach, nCrossedRowsBach, uint8_t); //! Number of TPC crossed rows of the bachelor daughter
// For MC
DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! Index of the corresponding MC particle
DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool);
Expand Down Expand Up @@ -365,13 +368,13 @@
static uint8_t encodeNSigma(float nSigma)
{
const float x = std::abs(nSigma);
if (x <= 1.5)

Check failure on line 371 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return 0; // Return 0 when absolute nSigma is smaller than 1.5
float t = (x - 1.5) / 0.2;
int encoded = static_cast<int>(std::ceil(t)); // (1.5,1.7]->1, ..., (3.3,3.5]->10
if (encoded < 1)
encoded = 1;
if (encoded > 10)

Check failure on line 377 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
encoded = 10;
return static_cast<uint8_t>(encoded);
}
Expand All @@ -381,7 +384,7 @@
{
if (encoded == 0)
return 1.5;
if (encoded > 10)

Check failure on line 387 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
encoded = 10;
return 1.5 + static_cast<float>(encoded) * 0.2;
}
Expand Down Expand Up @@ -443,12 +446,12 @@
static uint8_t encodeDCA(float DCA)
{
float x = std::fabs(DCA);
if (x < 0.1)

Check failure on line 449 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return 0;
int encoded = static_cast<int>(std::ceil((x - 0.1) / 0.1)); // (0.1, 0.2] -> 1, ..., (1.4, 1.5] -> 14
if (encoded < 1)
encoded = 1;
if (encoded > 14)

Check failure on line 454 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
encoded = 15;
return static_cast<uint8_t>(encoded);
}
Expand Down Expand Up @@ -643,6 +646,8 @@
v0data::DCAPosToPV,
v0data::DCANegToPV,
v0data::DCAV0ToPV,
resodaughter::NCrossedRowsPos,
resodaughter::NCrossedRowsNeg,
resodaughter::MLambda,
resodaughter::MAntiLambda,
resodaughter::MK0Short,
Expand Down Expand Up @@ -710,6 +715,9 @@
cascdata::DCAXYCascToPV,
cascdata::DCAZCascToPV,
cascdata::Sign,
resodaughter::NCrossedRowsPos,
resodaughter::NCrossedRowsNeg,
resodaughter::NCrossedRowsBach,
resodaughter::MLambda,
resodaughter::MXi,
resodaughter::TransRadius,
Expand Down
20 changes: 11 additions & 9 deletions PWGLF/TableProducer/Resonances/resonanceInitializer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@
int evtPlDetId = cfgEvtPl - evtPlRefAId * 10000 - evtPlRefBId * 100;

// MC Resonance parent filter
Partition<aod::McParticles> selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == 313) // K*

Check failure on line 254 in PWGLF/TableProducer/Resonances/resonanceInitializer.cxx

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.
|| (nabs(aod::mcparticle::pdgCode) == 323) // K*pm

Check failure on line 255 in PWGLF/TableProducer/Resonances/resonanceInitializer.cxx

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.
|| (nabs(aod::mcparticle::pdgCode) == 333) // phi
|| (nabs(aod::mcparticle::pdgCode) == 9010221) // f_0(980)
|| (nabs(aod::mcparticle::pdgCode) == 10221) // f_0(1370)
Expand Down Expand Up @@ -796,6 +796,8 @@
v0.dcapostopv(),
v0.dcanegtopv(),
v0.dcav0topv(),
static_cast<uint8_t>(v0.template posTrack_as<TrackType>().tpcNClsCrossedRows()),
static_cast<uint8_t>(v0.template negTrack_as<TrackType>().tpcNClsCrossedRows()),
v0.mLambda(),
v0.mAntiLambda(),
v0.mK0Short(),
Expand Down Expand Up @@ -858,6 +860,9 @@
casc.dcaXYCascToPV(),
casc.dcaZCascToPV(),
casc.sign(),
static_cast<uint8_t>(casc.template posTrack_as<TrackType>().tpcNClsCrossedRows()),
static_cast<uint8_t>(casc.template negTrack_as<TrackType>().tpcNClsCrossedRows()),
static_cast<uint8_t>(casc.template bachelor_as<TrackType>().tpcNClsCrossedRows()),
casc.mLambda(),
casc.mXi(),
casc.v0radius(), casc.cascradius(), casc.x(), casc.y(), casc.z());
Expand Down Expand Up @@ -1736,6 +1741,9 @@
resoSpheroCollisions(computeSpherocity(tracks, trackSphMin, trackSphDef));
resoEvtPlCollisions(0, 0, 0, 0);
fillMCCollision<false>(collision, mcParticles);
// Loop over all MC particles
auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex());
fillMCParticles(mcParts, mcParticles);

// Loop over tracks
if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) {
Expand All @@ -1746,10 +1754,6 @@
fillMicroTracks<true>(collision, tracks);
}
fillV0s<true>(collision, V0s, tracks);

// Loop over all MC particles
auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex());
fillMCParticles(mcParts, mcParticles);
}
PROCESS_SWITCH(ResonanceInitializer, processTrackV0MC, "Process for MC", false);

Expand Down Expand Up @@ -1825,6 +1829,9 @@
mult = mcCollision.multMCNParticlesEta10();

fillMCCollision<false>(collision, mcParticles, impactpar, mult);
// Loop over all MC particles
auto mcParts = selectedMCParticles->sliceBy(perMcCollision, mcId);
fillMCParticles(mcParts, mcParticles);

// Loop over tracks
if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) {
Expand All @@ -1839,16 +1846,11 @@
}
fillV0s<true>(collision, V0s, tracks);
fillCascades<true>(collision, Cascades, tracks);

// Loop over all MC particles
auto mcParts = selectedMCParticles->sliceBy(perMcCollision, mcId);
fillMCParticles(mcParts, mcParticles);
}
PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascMC, "Process for MC", false);

// Following the discussions at the PAG meeting (https://indico.cern.ch/event/1583408/)
// we have introduced an auxiliary task that, when the resonanceInitializer.cxx is used,
// Only consider N_rec / N_gen i.e. not consider level of N_gen at least once
void processMCgen(soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::MultMCExtras>::iterator const& mcCollision,
aod::McParticles const& mcParticles,
const soa::SmallGroups<o2::soa::Join<ResoEvents001, aod::McCollisionLabels>>& collisions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,8 @@ struct ResonanceDaughterInitializer {
v0.dcapostopv(),
v0.dcanegtopv(),
v0.dcav0topv(),
0,
0,
v0.mLambda(),
v0.mAntiLambda(),
v0.mK0Short(),
Expand Down Expand Up @@ -1206,6 +1208,9 @@ struct ResonanceDaughterInitializer {
casc.dcaXYCascToPV(),
casc.dcaZCascToPV(),
casc.sign(),
0,
0,
0,
casc.mLambda(),
casc.mXi(),
casc.v0radius(), casc.cascradius(), casc.x(), casc.y(), casc.z());
Expand Down
Loading
Loading