Skip to content

Commit c8d6c18

Browse files
authored
Merge pull request #59 from alibuild/alibot-cleanup-16646
[PWGHF] Please consider the following formatting changes to #16646
2 parents b3c597e + f448bae commit c8d6c18

1 file changed

Lines changed: 62 additions & 65 deletions

File tree

PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx

Lines changed: 62 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,19 @@ struct HfCorrelatorLcScHadronsSelection {
143143
isCandFound = false;
144144
continue;
145145
}
146-
if constexpr (IsMc) {
146+
if constexpr (IsMc) {
147147
auto const mcFlag = std::abs(candidate.flagMcMatchRec());
148148

149149
// Cast enums to int to safely compare against the absolute integer flag
150-
bool isSc0 = (mcFlag == static_cast<int>(o2::hf_decay::hf_cand_sigmac::DecayChannelMain::Sc0ToPKPiPi));
151-
bool isScPlusPlus = (mcFlag == static_cast<int>(o2::hf_decay::hf_cand_sigmac::DecayChannelMain::ScplusplusToPKPiPi));
152-
bool isLc = (mcFlag == static_cast<int>(o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi));
150+
bool isSc0 = (mcFlag == static_cast<int>(o2::hf_decay::hf_cand_sigmac::DecayChannelMain::Sc0ToPKPiPi));
151+
bool isScPlusPlus = (mcFlag == static_cast<int>(o2::hf_decay::hf_cand_sigmac::DecayChannelMain::ScplusplusToPKPiPi));
152+
bool isLc = (mcFlag == static_cast<int>(o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi));
153153

154154
if (!(isSc0 || isScPlusPlus || isLc)) {
155155
isCandFound = false;
156156
continue;
157157
}
158-
159-
}
158+
}
160159
isCandFound = true;
161160
break;
162161
}
@@ -564,7 +563,7 @@ struct HfCorrelatorLcScHadrons {
564563
return y;
565564
}
566565

567-
template <typename TCollision, typename V0>
566+
template <typename TCollision, typename V0>
568567
bool selectionV0(TCollision const& collision, V0 const& candidate)
569568
{
570569
if (candidate.v0radius() < cfgV0.cfgV0radiusMin) {
@@ -824,11 +823,11 @@ struct HfCorrelatorLcScHadrons {
824823

825824
// Correlate Lc with all Lambda V0 in the same event
826825
for (const auto& v0 : v0s) {
827-
826+
828827
const int v0Lambda = 1;
829828
const int v0AntiLambda = -1;
830829

831-
if (!selectionV0(collision, v0)){
830+
if (!selectionV0(collision, v0)) {
832831
continue;
833832
}
834833

@@ -1014,89 +1013,87 @@ struct HfCorrelatorLcScHadrons {
10141013

10151014
if (passV0Sel && v0Mc.pdgCode() == kLambda0) {
10161015
if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) {
1017-
registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1018-
registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1019-
if (cfgV0.calEffV0 && v0Mc.isPhysicalPrimary() && v0Mc.producedByGenerator()) {
1020-
registry.fill(HIST("hV0PrimLambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1021-
registry.fill(HIST("hV0PrimLambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1022-
}
1016+
registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1017+
registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1018+
if (cfgV0.calEffV0 && v0Mc.isPhysicalPrimary() && v0Mc.producedByGenerator()) {
1019+
registry.fill(HIST("hV0PrimLambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1020+
registry.fill(HIST("hV0PrimLambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1021+
}
10231022

1024-
if (passPIDSelection(trackV0Pos, cfgCharmCand.trkPIDspecies, cfgCharmCand.pidTPCMax, cfgCharmCand.pidTOFMax, cfgCharmCand.tofPIDThreshold, cfgCharmCand.forceTOF)) {
1025-
registry.fill(HIST("hV0LambdaPiKRejMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1026-
registry.fill(HIST("hV0LambdaReflPiKRejMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1023+
if (passPIDSelection(trackV0Pos, cfgCharmCand.trkPIDspecies, cfgCharmCand.pidTPCMax, cfgCharmCand.pidTOFMax, cfgCharmCand.tofPIDThreshold, cfgCharmCand.forceTOF)) {
1024+
registry.fill(HIST("hV0LambdaPiKRejMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1025+
registry.fill(HIST("hV0LambdaReflPiKRejMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1026+
}
10271027
}
10281028
}
1029-
}
10301029
if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar) {
1031-
if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) {
1032-
registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1033-
registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1030+
if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) {
1031+
registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1032+
registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
10341033

1035-
if (cfgV0.calEffV0 && v0Mc.isPhysicalPrimary() && v0Mc.producedByGenerator()) {
1036-
registry.fill(HIST("hV0PrimLambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1037-
registry.fill(HIST("hV0PrimLambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1038-
}
1039-
if (passPIDSelection(trackV0Neg, cfgCharmCand.trkPIDspecies, cfgCharmCand.pidTPCMax, cfgCharmCand.pidTOFMax, cfgCharmCand.tofPIDThreshold, cfgCharmCand.forceTOF)) {
1040-
registry.fill(HIST("hV0LambdaPiKRejMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1041-
registry.fill(HIST("hV0LambdaReflPiKRejMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1034+
if (cfgV0.calEffV0 && v0Mc.isPhysicalPrimary() && v0Mc.producedByGenerator()) {
1035+
registry.fill(HIST("hV0PrimLambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1036+
registry.fill(HIST("hV0PrimLambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1037+
}
1038+
if (passPIDSelection(trackV0Neg, cfgCharmCand.trkPIDspecies, cfgCharmCand.pidTPCMax, cfgCharmCand.pidTOFMax, cfgCharmCand.tofPIDThreshold, cfgCharmCand.forceTOF)) {
1039+
registry.fill(HIST("hV0LambdaPiKRejMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
1040+
registry.fill(HIST("hV0LambdaReflPiKRejMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
1041+
}
10421042
}
10431043
}
1044-
}
1045-
if (cfgV0.calEffV0 && countV0 == 1) {
1044+
if (cfgV0.calEffV0 && countV0 == 1) {
10461045
auto genPart = mcParticles.sliceBy(perTrueCollision, v0Mc.mcCollisionId());
10471046

1048-
for (const auto& particle : genPart) {
1049-
1050-
if (std::abs(particle.pdgCode()) != kLambda0) {
1051-
continue;
1052-
}
1053-
1054-
if (std::abs(particle.y()) > cfgCharmCand.yCandMax) {
1055-
continue;
1056-
}
1057-
if (!particle.isPhysicalPrimary() || !particle.producedByGenerator()) {
1058-
continue;
1059-
}
1047+
for (const auto& particle : genPart) {
10601048

1061-
auto daughterParts = particle.template daughters_as<aod::McParticles>();
1062-
const int8_t nDaughtersV0 = 2;
1049+
if (std::abs(particle.pdgCode()) != kLambda0) {
1050+
continue;
1051+
}
10631052

1064-
if (daughterParts.size() != nDaughtersV0) {
1065-
continue;
1066-
}
1053+
if (std::abs(particle.y()) > cfgCharmCand.yCandMax) {
1054+
continue;
1055+
}
1056+
if (!particle.isPhysicalPrimary() || !particle.producedByGenerator()) {
1057+
continue;
1058+
}
10671059

1068-
int8_t countPassedDaughter = 0;
1069-
for (const auto& currentDaughter : daughterParts) {
1060+
auto daughterParts = particle.template daughters_as<aod::McParticles>();
1061+
const int8_t nDaughtersV0 = 2;
10701062

1071-
if (std::abs(currentDaughter.eta()) > cfgCharmCand.etaTrackMax) {
1063+
if (daughterParts.size() != nDaughtersV0) {
10721064
continue;
10731065
}
10741066

1075-
if (std::abs(currentDaughter.pdgCode()) == kProton) {
1067+
int8_t countPassedDaughter = 0;
1068+
for (const auto& currentDaughter : daughterParts) {
10761069

1077-
if (currentDaughter.pt() > cfgV0.cfgV0DaughPrPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPrPtMin) {
1070+
if (std::abs(currentDaughter.eta()) > cfgCharmCand.etaTrackMax) {
10781071
continue;
10791072
}
10801073

1081-
} else if (std::abs(currentDaughter.pdgCode()) == kPiPlus) {
1082-
if (currentDaughter.pt() > cfgV0.cfgV0DaughPiPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPiPtMin) {
1074+
if (std::abs(currentDaughter.pdgCode()) == kProton) {
1075+
1076+
if (currentDaughter.pt() > cfgV0.cfgV0DaughPrPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPrPtMin) {
1077+
continue;
1078+
}
1079+
1080+
} else if (std::abs(currentDaughter.pdgCode()) == kPiPlus) {
1081+
if (currentDaughter.pt() > cfgV0.cfgV0DaughPiPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPiPtMin) {
1082+
continue;
1083+
}
1084+
1085+
} else {
10831086
continue;
10841087
}
1085-
1086-
} else {
1087-
continue;
1088+
countPassedDaughter++;
1089+
}
1090+
if (countPassedDaughter == nDaughtersV0) {
1091+
registry.fill(HIST("hV0PtPrimLambdaMcGen"), particle.pt());
10881092
}
1089-
countPassedDaughter++;
1090-
}
1091-
if (countPassedDaughter == nDaughtersV0) {
1092-
registry.fill(HIST("hV0PtPrimLambdaMcGen"), particle.pt());
10931093
}
10941094
}
1095-
}
10961095
countV0++;
1097-
10981096
}
1099-
11001097
}
11011098
}
11021099

0 commit comments

Comments
 (0)