@@ -1050,54 +1050,48 @@ struct K892analysispbpb {
10501050 auto impactPar = mcCollision.impactParameter();
10511051 histos.fill(HIST("QAevent/hImpactParameterGen"), impactPar);
10521052
1053- // Signal loss estimation
1054- for (const auto& mcPart : mcParticles) {
1055- if (std::abs(mcPart.y()) >= 0.5 || std::abs(mcPart.pdgCode()) != 313)
1056- continue;
1057-
1058- // signal loss estimation
1059- if (mcPart.pdgCode() > 0) // no cuts, purely generated
1060- histos.fill(HIST("QAevent/k892genBeforeEvtSel"), mcPart.pt(), impactPar);
1061- else
1062- histos.fill(HIST("QAevent/k892genBeforeEvtSelAnti"), mcPart.pt(), impactPar);
1063- }
1064-
1065- if (recCollisions.size() == 0)
1066- return;
1067-
1068- auto numcontributors = -999;
10691053 bool isSel = false;
10701054 auto centrality = -999.;
1071- for (const auto& RecCollision : recCollisions) {
1072- if (!myEventSelections(RecCollision))
1073- continue;
1074-
1075- if (RecCollision.numContrib() <= numcontributors)
1076- continue;
1077- else
1078- numcontributors = RecCollision.numContrib();
1079-
1080- centrality = RecCollision.centFT0C();
1081- isSel = true;
1055+ if (recCollisions.size() > 0) {
1056+ auto numcontributors = -999;
1057+ for (const auto& RecCollision : recCollisions) {
1058+ if (!myEventSelections(RecCollision))
1059+ continue;
1060+
1061+ if (RecCollision.numContrib() <= numcontributors)
1062+ continue;
1063+ else
1064+ numcontributors = RecCollision.numContrib();
1065+
1066+ centrality = RecCollision.centFT0C();
1067+ isSel = true;
1068+ }
10821069 }
1083-
1084- if (!isSel)
1085- return;
1086-
1087- histos.fill(HIST("QAevent/hImpactParameterRec"), impactPar);
1088- histos.fill(HIST("QAevent/hImpactParvsCentrRec"), centrality, impactPar);
1089-
1070+
1071+ if (isSel) {
1072+ histos.fill(HIST("QAevent/hImpactParameterRec"), impactPar);
1073+ histos.fill(HIST("QAevent/hImpactParvsCentrRec"), centrality, impactPar);
1074+ }
1075+
10901076 // Generated MC
10911077 for (const auto& mcPart : mcParticles) {
10921078 if (std::abs(mcPart.y()) >= 0.5 || std::abs(mcPart.pdgCode()) != 313)
10931079 continue;
10941080
10951081 // signal loss estimation
10961082 if (mcPart.pdgCode() > 0) // no cuts, purely generated
1097- histos.fill(HIST("QAevent/k892genAfterEvtSel "), mcPart.pt(), impactPar);
1083+ histos.fill(HIST("QAevent/k892genBeforeEvtSel "), mcPart.pt(), impactPar);
10981084 else
1099- histos.fill(HIST("QAevent/k892genAfterEvtSelAnti"), mcPart.pt(), impactPar);
1100-
1085+ histos.fill(HIST("QAevent/k892genBeforeEvtSelAnti"), mcPart.pt(), impactPar);
1086+
1087+
1088+ if (isSel) {
1089+ // signal loss estimation
1090+ if (mcPart.pdgCode() > 0) // no cuts, purely generated
1091+ histos.fill(HIST("QAevent/k892genAfterEvtSel"), mcPart.pt(), impactPar);
1092+ else
1093+ histos.fill(HIST("QAevent/k892genAfterEvtSelAnti"), mcPart.pt(), impactPar);
1094+ }
11011095 } // end loop on gen particles
11021096 }
11031097 PROCESS_SWITCH(K892analysispbpb, processEvtLossSigLossMC, "Process Signal Loss, Event Loss", false);
0 commit comments