Skip to content

Commit e0c87b8

Browse files
Nils314Nils Konert
andauthored
[PWGCF] Added function in SpecAna, mod invMassAxis in Pair (AliceO2Group#14364)
Co-authored-by: Nils Konert <[email protected]>
1 parent 018325e commit e0c87b8

File tree

2 files changed

+162
-1
lines changed

2 files changed

+162
-1
lines changed

PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,167 @@ struct FemtoDreamProducerTaskForSpecificAnalysis {
730730
createSpecifiedDerivedDataK0ShortKStar<false>(col, thegroupSelectedV0s, thegroupSelectedResos, parts);
731731
}
732732
PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, createSpecifiedDerivedDataNK0ShortNKStar, "Enable producing data with pp collisions for data K0Short-KStar", false);
733+
734+
/// The current version of femtoDreamProducerTaskReso.cxx still uses kV0Child and kResoChild for daughters of V0K0Short and ResoKStar, respectively.
735+
/// That means, that createSpecifiedDerivedDataK0ShortKStar() cannot fill the output tables correctly.
736+
/// For that, this function is created.
737+
/// For eventual future changes of femtoDreamProducerTaskReso.cxx, createSpecifiedDerivedDataK0ShortKStar() is kept as it is
738+
template <bool isMC, typename PartitionType, typename PartType>
739+
void createSpecifiedDerivedDataK0ShortKStarLegacy(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedResos, PartType parts)
740+
{
741+
// check v0's
742+
int v0Count = 0;
743+
int antiV0Count = 0;
744+
int resoCount = 0; // no antiparticles
745+
746+
for (const auto& V0 : groupSelectedV0s) {
747+
if ((V0.mLambda() > confMinInvMassV0) && (V0.mLambda() < confMaxInvMassV0)) {
748+
if (confRequireBitmask) {
749+
if (ncheckbit(V0.cut(), confCutV0SameForAntipart)) {
750+
const auto& posChild = parts.iteratorAt(V0.index() - 2);
751+
const auto& negChild = parts.iteratorAt(V0.index() - 1);
752+
if (((posChild.cut() & confChildPosCutV0) == confChildPosCutV0 &&
753+
(posChild.pidcut() & confChildPosTPCBitV0) == confChildPosTPCBitV0 &&
754+
(negChild.cut() & confChildNegCutV0) == confChildNegCutV0 &&
755+
(negChild.pidcut() & confChildNegTPCBitV0) == confChildNegTPCBitV0)) {
756+
v0Count++;
757+
}
758+
}
759+
} else {
760+
v0Count++;
761+
}
762+
} else if ((V0.mAntiLambda() > confMinInvMassAntiV0) && (V0.mAntiLambda() < confMaxInvMassAntiV0)) {
763+
if (confRequireBitmask) {
764+
if (ncheckbit(V0.cut(), confCutV0SameForAntipart)) {
765+
const auto& posChild = parts.iteratorAt(V0.index() - 2);
766+
const auto& negChild = parts.iteratorAt(V0.index() - 1);
767+
if (((posChild.cut() & confChildPosCutV0) == confChildPosCutV0 &&
768+
(posChild.pidcut() & confChildNegTPCBitV0) == confChildNegTPCBitV0 && // exchanged values because checking antiparticle daughters and pid of particles exchange
769+
(negChild.cut() & confChildNegCutV0) == confChildNegCutV0 &&
770+
(negChild.pidcut() & confChildPosTPCBitV0) == confChildPosTPCBitV0)) { // exchanged values because checking antiparticle daughters and pid of particles exchange
771+
antiV0Count++;
772+
}
773+
}
774+
} else {
775+
antiV0Count++;
776+
}
777+
}
778+
}
779+
780+
for (const auto& reso : groupSelectedResos) {
781+
if (confRequireBitmask) {
782+
783+
const auto& posresoChild = parts.iteratorAt(reso.index() - 2);
784+
const auto& negresoChild = parts.iteratorAt(reso.index() - 1);
785+
786+
if (((posresoChild.cut() & Reso.daughPosCutBit) == Reso.daughPosCutBit) &&
787+
((negresoChild.cut() & Reso.daughNegCutBit) == Reso.daughNegCutBit)) {
788+
789+
resoCount++;
790+
}
791+
} else {
792+
resoCount++;
793+
}
794+
}
795+
796+
std::vector<int> tmpIDtrack;
797+
798+
if ((v0Count >= confNumberOfV0 && resoCount >= confNumberOfReso) || (antiV0Count >= confNumberOfV0 && resoCount >= confNumberOfReso)) {
799+
eventRegistry.fill(HIST("hStatistiscs"), 1);
800+
outputCollision(col.posZ(), col.multV0M(), col.multNtr(), col.sphericity(), col.magField());
801+
802+
for (const auto& femtoParticle : parts) {
803+
804+
if (aod::femtodreamparticle::ParticleType::kResoChild == femtoParticle.partType()) {
805+
std::vector<int> childIDs;
806+
const auto& children = femtoParticle.childrenIds();
807+
childIDs.push_back(children[0]);
808+
childIDs.push_back(children[1]);
809+
outputParts(outputCollision.lastIndex(),
810+
femtoParticle.pt(),
811+
femtoParticle.eta(),
812+
femtoParticle.phi(),
813+
femtoParticle.partType(),
814+
femtoParticle.cut(),
815+
femtoParticle.pidcut(),
816+
femtoParticle.tempFitVar(),
817+
childIDs,
818+
femtoParticle.mLambda(),
819+
femtoParticle.mAntiLambda());
820+
}
821+
822+
if ((femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTPC_NegdaughTPC)) ||
823+
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTPC_NegdaughTOF)) ||
824+
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTOF_NegdaughTPC)) ||
825+
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTOF_NegdaughTOF))) {
826+
827+
std::vector<int> childIDs;
828+
const auto& children = femtoParticle.childrenIds();
829+
childIDs.push_back(children[0]);
830+
childIDs.push_back(children[1]);
831+
outputParts(outputCollision.lastIndex(),
832+
femtoParticle.pt(),
833+
femtoParticle.eta(),
834+
femtoParticle.phi(),
835+
femtoParticle.partType(),
836+
femtoParticle.cut(),
837+
femtoParticle.pidcut(),
838+
femtoParticle.tempFitVar(),
839+
childIDs,
840+
femtoParticle.mLambda(),
841+
femtoParticle.mAntiLambda());
842+
}
843+
844+
if (aod::femtodreamparticle::ParticleType::kV0Child == femtoParticle.partType()) {
845+
std::vector<int> childIDs;
846+
const auto& children = femtoParticle.childrenIds();
847+
childIDs.push_back(children[0]);
848+
childIDs.push_back(children[1]);
849+
850+
outputParts(outputCollision.lastIndex(),
851+
femtoParticle.pt(),
852+
femtoParticle.eta(),
853+
femtoParticle.phi(),
854+
femtoParticle.partType(),
855+
femtoParticle.cut(),
856+
femtoParticle.pidcut(),
857+
femtoParticle.tempFitVar(),
858+
childIDs,
859+
femtoParticle.mLambda(),
860+
femtoParticle.mAntiLambda());
861+
}
862+
if (aod::femtodreamparticle::ParticleType::kV0K0Short == femtoParticle.partType()) {
863+
std::vector<int> childIDs;
864+
const auto& children = femtoParticle.childrenIds();
865+
childIDs.push_back(children[0]);
866+
childIDs.push_back(children[1]);
867+
outputParts(outputCollision.lastIndex(),
868+
femtoParticle.pt(),
869+
femtoParticle.eta(),
870+
femtoParticle.phi(),
871+
femtoParticle.partType(),
872+
femtoParticle.cut(),
873+
femtoParticle.pidcut(),
874+
femtoParticle.tempFitVar(),
875+
childIDs,
876+
femtoParticle.mLambda(),
877+
femtoParticle.mAntiLambda());
878+
}
879+
}
880+
} else {
881+
eventRegistry.fill(HIST("hStatistiscs"), 2);
882+
}
883+
}
884+
void createSpecifiedDerivedDataNK0ShortNKStarLegacy(const o2::aod::FDCollision& col,
885+
const o2::aod::FDParticles& parts)
886+
{
887+
eventRegistry.fill(HIST("hStatistiscs"), 0);
888+
auto thegroupSelectedResos = selectedKStar->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
889+
auto thegroupSelectedV0s = selectedK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
890+
891+
createSpecifiedDerivedDataK0ShortKStarLegacy<false>(col, thegroupSelectedV0s, thegroupSelectedResos, parts);
892+
}
893+
PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, createSpecifiedDerivedDataNK0ShortNKStarLegacy, "Enable producing data with pp collisions for data K0Short-KStar with kV0Child/KResoChild daughter types", false);
733894
};
734895

735896
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0Reso.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ struct FemtoDreamPairTaskV0Reso {
257257

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

260-
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);
260+
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);
261261
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);
262262
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);
263263

0 commit comments

Comments
 (0)