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
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

/// Partition for selected particles
Partition<aod::FDParticles> selectedParts = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) &&
ifnode(aod::femtodreamparticle::pt * (nexp(aod::femtodreamparticle::eta) + nexp(-1.f * aod::femtodreamparticle::eta)) / 2.f <= confPIDthrMom, ncheckbit(aod::femtodreamparticle::pidcut, confTPCPIDBit), ncheckbit(aod::femtodreamparticle::pidcut, confTPCTOFPIDBit));

Check failure on line 70 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

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.

/// V0 selection
Configurable<float> confMinInvMassV0{"confMinInvMassV0", 1.08, "Minimum invariant mass of V0 (particle)"};
Expand Down Expand Up @@ -730,6 +730,167 @@
createSpecifiedDerivedDataK0ShortKStar<false>(col, thegroupSelectedV0s, thegroupSelectedResos, parts);
}
PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, createSpecifiedDerivedDataNK0ShortNKStar, "Enable producing data with pp collisions for data K0Short-KStar", false);

/// The current version of femtoDreamProducerTaskReso.cxx still uses kV0Child and kResoChild for daughters of V0K0Short and ResoKStar, respectively.
/// That means, that createSpecifiedDerivedDataK0ShortKStar() cannot fill the output tables correctly.
/// For that, this function is created.
/// For eventual future changes of femtoDreamProducerTaskReso.cxx, createSpecifiedDerivedDataK0ShortKStar() is kept as it is
template <bool isMC, typename PartitionType, typename PartType>
void createSpecifiedDerivedDataK0ShortKStarLegacy(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedResos, PartType parts)
{
// check v0's
int v0Count = 0;
int antiV0Count = 0;
int resoCount = 0; // no antiparticles

for (const auto& V0 : groupSelectedV0s) {
if ((V0.mLambda() > confMinInvMassV0) && (V0.mLambda() < confMaxInvMassV0)) {
if (confRequireBitmask) {
if (ncheckbit(V0.cut(), confCutV0SameForAntipart)) {
const auto& posChild = parts.iteratorAt(V0.index() - 2);
const auto& negChild = parts.iteratorAt(V0.index() - 1);
if (((posChild.cut() & confChildPosCutV0) == confChildPosCutV0 &&
(posChild.pidcut() & confChildPosTPCBitV0) == confChildPosTPCBitV0 &&
(negChild.cut() & confChildNegCutV0) == confChildNegCutV0 &&
(negChild.pidcut() & confChildNegTPCBitV0) == confChildNegTPCBitV0)) {
v0Count++;
}
}
} else {
v0Count++;
}
} else if ((V0.mAntiLambda() > confMinInvMassAntiV0) && (V0.mAntiLambda() < confMaxInvMassAntiV0)) {
if (confRequireBitmask) {
if (ncheckbit(V0.cut(), confCutV0SameForAntipart)) {
const auto& posChild = parts.iteratorAt(V0.index() - 2);
const auto& negChild = parts.iteratorAt(V0.index() - 1);
if (((posChild.cut() & confChildPosCutV0) == confChildPosCutV0 &&
(posChild.pidcut() & confChildNegTPCBitV0) == confChildNegTPCBitV0 && // exchanged values because checking antiparticle daughters and pid of particles exchange
(negChild.cut() & confChildNegCutV0) == confChildNegCutV0 &&
(negChild.pidcut() & confChildPosTPCBitV0) == confChildPosTPCBitV0)) { // exchanged values because checking antiparticle daughters and pid of particles exchange
antiV0Count++;
}
}
} else {
antiV0Count++;
}
}
}

for (const auto& reso : groupSelectedResos) {
if (confRequireBitmask) {

const auto& posresoChild = parts.iteratorAt(reso.index() - 2);
const auto& negresoChild = parts.iteratorAt(reso.index() - 1);

if (((posresoChild.cut() & Reso.daughPosCutBit) == Reso.daughPosCutBit) &&
((negresoChild.cut() & Reso.daughNegCutBit) == Reso.daughNegCutBit)) {

resoCount++;
}
} else {
resoCount++;
}
}

std::vector<int> tmpIDtrack;

if ((v0Count >= confNumberOfV0 && resoCount >= confNumberOfReso) || (antiV0Count >= confNumberOfV0 && resoCount >= confNumberOfReso)) {
eventRegistry.fill(HIST("hStatistiscs"), 1);
outputCollision(col.posZ(), col.multV0M(), col.multNtr(), col.sphericity(), col.magField());

for (const auto& femtoParticle : parts) {

if (aod::femtodreamparticle::ParticleType::kResoChild == femtoParticle.partType()) {
std::vector<int> childIDs;
const auto& children = femtoParticle.childrenIds();
childIDs.push_back(children[0]);
childIDs.push_back(children[1]);
outputParts(outputCollision.lastIndex(),
femtoParticle.pt(),
femtoParticle.eta(),
femtoParticle.phi(),
femtoParticle.partType(),
femtoParticle.cut(),
femtoParticle.pidcut(),
femtoParticle.tempFitVar(),
childIDs,
femtoParticle.mLambda(),
femtoParticle.mAntiLambda());
}

if ((femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTPC_NegdaughTPC)) ||
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTPC_NegdaughTOF)) ||
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTOF_NegdaughTPC)) ||
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTOF_NegdaughTOF))) {

std::vector<int> childIDs;
const auto& children = femtoParticle.childrenIds();
childIDs.push_back(children[0]);
childIDs.push_back(children[1]);
outputParts(outputCollision.lastIndex(),
femtoParticle.pt(),
femtoParticle.eta(),
femtoParticle.phi(),
femtoParticle.partType(),
femtoParticle.cut(),
femtoParticle.pidcut(),
femtoParticle.tempFitVar(),
childIDs,
femtoParticle.mLambda(),
femtoParticle.mAntiLambda());
}

if (aod::femtodreamparticle::ParticleType::kV0Child == femtoParticle.partType()) {
std::vector<int> childIDs;
const auto& children = femtoParticle.childrenIds();
childIDs.push_back(children[0]);
childIDs.push_back(children[1]);

outputParts(outputCollision.lastIndex(),
femtoParticle.pt(),
femtoParticle.eta(),
femtoParticle.phi(),
femtoParticle.partType(),
femtoParticle.cut(),
femtoParticle.pidcut(),
femtoParticle.tempFitVar(),
childIDs,
femtoParticle.mLambda(),
femtoParticle.mAntiLambda());
}
if (aod::femtodreamparticle::ParticleType::kV0K0Short == femtoParticle.partType()) {
std::vector<int> childIDs;
const auto& children = femtoParticle.childrenIds();
childIDs.push_back(children[0]);
childIDs.push_back(children[1]);
outputParts(outputCollision.lastIndex(),
femtoParticle.pt(),
femtoParticle.eta(),
femtoParticle.phi(),
femtoParticle.partType(),
femtoParticle.cut(),
femtoParticle.pidcut(),
femtoParticle.tempFitVar(),
childIDs,
femtoParticle.mLambda(),
femtoParticle.mAntiLambda());
}
}
} else {
eventRegistry.fill(HIST("hStatistiscs"), 2);
}
}
void createSpecifiedDerivedDataNK0ShortNKStarLegacy(const o2::aod::FDCollision& col,
const o2::aod::FDParticles& parts)
{
eventRegistry.fill(HIST("hStatistiscs"), 0);
auto thegroupSelectedResos = selectedKStar->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
auto thegroupSelectedV0s = selectedK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);

createSpecifiedDerivedDataK0ShortKStarLegacy<false>(col, thegroupSelectedV0s, thegroupSelectedResos, parts);
}
PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, createSpecifiedDerivedDataNK0ShortNKStarLegacy, "Enable producing data with pp collisions for data K0Short-KStar with kV0Child/KResoChild daughter types", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
2 changes: 1 addition & 1 deletion PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0Reso.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ struct FemtoDreamPairTaskV0Reso {

eventHisto.init(&registry, Option.isMC);

v0HistoPartOne.init(&registry, Binning.multTempFit, Option.dummy, Binning.pTTrack, Option.dummy, Option.dummy, Binning.tempFitVarV0, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.isMC, V01.pdgCode);
v0HistoPartOne.init(&registry, Binning.multTempFit, Option.dummy, Binning.pTTrack, Option.dummy, Option.dummy, Binning.tempFitVarV0, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Binning.invMass, Option.dummy, Option.isMC, V01.pdgCode);
posChildHistos.init(&registry, Binning.multTempFit, Option.dummy, Binning.pTV0Child, Option.dummy, Option.dummy, Binning.tempFitVarV0Child, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0);
negChildHistos.init(&registry, Binning.multTempFit, Option.dummy, Binning.pTV0Child, Option.dummy, Option.dummy, Binning.tempFitVarV0Child, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0);

Expand Down
Loading