@@ -518,9 +518,7 @@ struct sigma0builder {
518518 {
519519 // Check if both V0s are made of the same tracks
520520 if (gamma1.posTrackExtraId () == gamma2.posTrackExtraId () ||
521- gamma1.negTrackExtraId () == gamma2.negTrackExtraId () ||
522- gamma1.posTrackExtraId () == gamma2.negTrackExtraId () ||
523- gamma1.negTrackExtraId () == gamma2.posTrackExtraId ()) {
521+ gamma1.negTrackExtraId () == gamma2.negTrackExtraId ()) {
524522 return ;
525523 }
526524
@@ -702,9 +700,7 @@ struct sigma0builder {
702700 {
703701 // Checking if both V0s are made of the very same tracks
704702 if (gamma.posTrackExtraId () == lambda.posTrackExtraId () ||
705- gamma.negTrackExtraId () == lambda.negTrackExtraId () ||
706- gamma.posTrackExtraId () == lambda.negTrackExtraId () ||
707- gamma.negTrackExtraId () == lambda.posTrackExtraId ()) {
703+ gamma.negTrackExtraId () == lambda.negTrackExtraId ()) {
708704 return false ;
709705 }
710706
@@ -939,52 +935,36 @@ struct sigma0builder {
939935 std::vector<int > bestLambdasArray;
940936
941937 // _______________________________________________
942- // Photon-only loop
943- for (auto & gamma : V0s) { // selecting photons from Sigma0
944- if (!gamma .has_v0MCCore ())
938+ // V0s loop
939+ for (auto & v0 : V0s) {
940+ if (!v0 .has_v0MCCore ())
945941 continue ;
946942
947- auto gammaMC = gamma .v0MCCore_as <soa::Join<aod::V0MCCores, aod::V0MCCollRefs>>();
943+ auto v0MC = v0 .v0MCCore_as <soa::Join<aod::V0MCCores, aod::V0MCCollRefs>>();
948944
949- if (gammaMC .pdgCode () == 22 ) {
950- histos.fill (HIST (" MC/h2dGammaXYConversion" ), gamma .x (), gamma .y ());
951- float GammaY = TMath::Abs (RecoDecay::y (std::array{gamma .px (), gamma .py (), gamma .pz ()}, o2::constants::physics::MassGamma));
945+ if (v0MC .pdgCode () == 22 ) {
946+ histos.fill (HIST (" MC/h2dGammaXYConversion" ), v0 .x (), v0 .y ());
947+ float GammaY = TMath::Abs (RecoDecay::y (std::array{v0 .px (), v0 .py (), v0 .pz ()}, o2::constants::physics::MassGamma));
952948 if (GammaY < 0.5 ) { // rapidity selection
953- histos.fill (HIST (" MC/h2dPtVsCentralityBeforeSel_MCAssocGamma" ), centrality, gamma .pt ()); // isgamma
949+ histos.fill (HIST (" MC/h2dPtVsCentralityBeforeSel_MCAssocGamma" ), centrality, v0 .pt ()); // isgamma
954950 }
955951 }
956952
957- // basic photon selection
958- if (!processPhotonCandidate (gamma))
959- continue ;
960-
961- // Save indices of best gamma candidates
962- bestGammasArray.push_back (gamma.globalIndex ());
963- }
964-
965- // _______________________________________________
966- // Lambda-only loop
967- for (auto & lambda : V0s) { // selecting lambdas from Sigma0
968- if (!lambda.has_v0MCCore ())
969- continue ;
970-
971- auto lambdaMC = lambda.v0MCCore_as <soa::Join<aod::V0MCCores, aod::V0MCCollRefs>>();
972- float lambdaY = TMath::Abs (RecoDecay::y (std::array{lambda.px (), lambda.py (), lambda.pz ()}, o2::constants::physics::MassLambda));
973-
953+ float lambdaY = TMath::Abs (RecoDecay::y (std::array{v0.px (), v0.py (), v0.pz ()}, o2::constants::physics::MassLambda));
974954 if (lambdaY < 0.5 ) {
975- if (lambdaMC .pdgCode () == 3122 ) // Is Lambda
976- histos.fill (HIST (" MC/h2dPtVsCentralityBeforeSel_MCAssocLambda" ), centrality, lambda .pt ());
977- if (lambdaMC .pdgCode () == -3122 ) // Is AntiLambda
978- histos.fill (HIST (" MC/h2dPtVsCentralityBeforeSel_MCAssocALambda" ), centrality, lambda .pt ());
955+ if (v0MC .pdgCode () == 3122 ) // Is Lambda
956+ histos.fill (HIST (" MC/h2dPtVsCentralityBeforeSel_MCAssocLambda" ), centrality, v0 .pt ());
957+ if (v0MC .pdgCode () == -3122 ) // Is AntiLambda
958+ histos.fill (HIST (" MC/h2dPtVsCentralityBeforeSel_MCAssocALambda" ), centrality, v0 .pt ());
979959 }
980960
981- // basic lambda selection
982- if (!processLambdaCandidate (lambda))
983- continue ;
961+ if (processPhotonCandidate (v0)) // selecting photons
962+ bestGammasArray.push_back (v0.globalIndex ()); // Save indices of best gamma candidates
984963
985- // Save indices of best lambda candidates
986- bestLambdasArray.push_back (lambda .globalIndex ());
964+ if ( processLambdaCandidate (v0)) // selecting lambdas
965+ bestLambdasArray.push_back (v0 .globalIndex ()); // Save indices of best lambda candidates
987966 }
967+
988968 // _______________________________________________
989969 // Pi0 optional loop
990970 if (doPi0QA) {
@@ -1137,25 +1117,15 @@ struct sigma0builder {
11371117 std::vector<int > bestLambdasArray;
11381118
11391119 // _______________________________________________
1140- // Photon-only loop
1141- for (auto & gamma : V0s) { // selecting photons
1142- if (! processPhotonCandidate (gamma))
1143- continue ;
1120+ // V0s loop
1121+ for (auto & v0 : V0s) {
1122+ if (processPhotonCandidate (v0)) // selecting photons
1123+ bestGammasArray. push_back (v0. globalIndex ()); // Save indices of best gamma candidates
11441124
1145- // Save indices of best gamma candidates
1146- bestGammasArray .push_back (gamma .globalIndex ());
1125+ if ( processLambdaCandidate (v0)) // selecting lambdas
1126+ bestLambdasArray .push_back (v0 .globalIndex ()); // Save indices of best lambda candidates
11471127 }
1148-
1149- // _______________________________________________
1150- // Lambda-only loop
1151- for (auto & lambda : V0s) { // selecting lambdas
1152- if (!processLambdaCandidate (lambda))
1153- continue ;
1154-
1155- // Save indices of best lambda candidates
1156- bestLambdasArray.push_back (lambda.globalIndex ());
1157- }
1158-
1128+
11591129 // _______________________________________________
11601130 // Pi0 optional loop
11611131 if (doPi0QA) {
@@ -1169,7 +1139,7 @@ struct sigma0builder {
11691139 }
11701140
11711141 // _______________________________________________
1172- // Sigma0 loop
1142+ // Sigma0 nested loop
11731143 for (size_t i = 0 ; i < bestGammasArray.size (); ++i) {
11741144 auto gamma = fullV0s.rawIteratorAt (bestGammasArray[i]);
11751145
0 commit comments