Skip to content

Commit 8d262d2

Browse files
committed
remove unnecessary checks
1 parent 1ee99ed commit 8d262d2

File tree

1 file changed

+6
-39
lines changed

1 file changed

+6
-39
lines changed

PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,8 @@ struct Derivedupcanalysis {
911911
histos.add("eventQA/hTracksPVeta1VsTracksGlobal", "hTracksPVeta1VsTracksGlobal", kTH3F, {axisNTracksPVeta1, axisNTracksGlobal, axisSelGap});
912912
histos.add("eventQA/hCentralityVsTracksGlobal", "hCentralityVsTracksGlobal", kTH3F, {axisFT0Cqa, axisNTracksGlobal, axisSelGap});
913913
histos.add("eventQA/hFT0amplVsTracksGlobal", "hFT0amplVsTracksGlobal", kTH3F, {axisDetectors.axisFT0Aampl, axisNTracksGlobal, axisSelGap});
914-
histos.add("eventQA/hGapSide", "Gap side; Entries", kTH1F, {{5, -0.5, 4.5}});
915914
histos.add("eventQA/hRawGapSide", "Raw Gap side; Entries", kTH1F, {{6, -1.5, 4.5}});
916-
histos.add("eventQA/hSelGapSide", "Selected gap side; Entries", kTH1F, {axisSelGap});
915+
histos.add("eventQA/hSelGapSide", "Selected gap side (with n); Entries", kTH1F, {axisSelGap});
917916
histos.add("eventQA/hPosX", "Vertex position in x", kTH2F, {{100, -0.1, 0.1}, axisSelGap});
918917
histos.add("eventQA/hPosY", "Vertex position in y", kTH2F, {{100, -0.1, 0.1}, axisSelGap});
919918
histos.add("eventQA/hPosZ", "Vertex position in z", kTH2F, {{100, -20., 20.}, axisSelGap});
@@ -943,6 +942,7 @@ struct Derivedupcanalysis {
943942
histos.add("eventQA/mc/hNTracksPVeta1vsMCNParticlesEta10rec", "hNTracksPVeta1vsMCNParticlesEta10rec", kTH2F, {axisNTracksPVeta1, axisNTracksPVeta1});
944943
histos.add("eventQA/mc/hNTracksGlobalvstotalMultMCParticles", "hNTracksGlobalvstotalMultMCParticles", kTH2F, {axisNTracksGlobal, axisNchInvMass});
945944
histos.add("eventQA/mc/hNTracksPVeta1vstotalMultMCParticles", "hNTracksPVeta1vstotalMultMCParticles", kTH2F, {axisNTracksPVeta1, axisNchInvMass});
945+
histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1F, {{5, -0.5, 4.5}});
946946
}
947947

948948
if (doprocessV0sMC) {
@@ -1070,7 +1070,6 @@ struct Derivedupcanalysis {
10701070
histos.fill(HIST("eventQA/hPosY"), collision.posY(), gap);
10711071
histos.fill(HIST("eventQA/hPosZ"), collision.posZ(), gap);
10721072

1073-
histos.fill(HIST("eventQA/hGapSide"), collision.gapSide());
10741073
histos.fill(HIST("eventQA/hSelGapSide"), gap);
10751074
histos.fill(HIST("eventQA/hFT0"), collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), gap);
10761075
histos.fill(HIST("eventQA/hFDD"), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), gap);
@@ -1746,15 +1745,6 @@ struct Derivedupcanalysis {
17461745
if (selGapSide < -0.5)
17471746
break;
17481747

1749-
if (!neutron.has_straMCCollision() || !collision.has_straMCCollision())
1750-
continue;
1751-
1752-
const auto& mcCollisionNeutron = neutron.straMCCollision_as<StraMCCollisionsFull>(); // take gen. collision associated to the neutron
1753-
1754-
// Consider neutrons from the same collision
1755-
if (mcCollisionNeutron.globalIndex() != mcCollision.globalIndex())
1756-
continue;
1757-
17581748
const float eta = neutron.eta();
17591749
switch (selGapSide) {
17601750
case 0: // SGA
@@ -1831,15 +1821,6 @@ struct Derivedupcanalysis {
18311821
if (selGapSide < -0.5)
18321822
break;
18331823

1834-
if (!neutron.has_straMCCollision() || !collision.has_straMCCollision())
1835-
continue;
1836-
1837-
const auto& mcCollisionNeutron = neutron.straMCCollision_as<StraMCCollisionsFull>(); // take gen. collision associated to the neutron
1838-
1839-
// Consider neutrons from the same collision
1840-
if (mcCollisionNeutron.globalIndex() != mcCollision.globalIndex())
1841-
continue;
1842-
18431824
const float eta = neutron.eta();
18441825
switch (selGapSide) {
18451826
case 0: // SGA
@@ -1980,22 +1961,14 @@ struct Derivedupcanalysis {
19801961
histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide());
19811962

19821963
int selGapSide = collision.isUPC() ? getGapSide(collision) : -1;
1964+
int selGapSideNoNeutrons = selGapSide;
19831965

19841966
auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex());
19851967
if (checkNeutronsInMC) {
19861968
for (const auto& neutron : groupedNeutrons) {
19871969
if (selGapSide < -0.5)
19881970
break;
19891971

1990-
if (!neutron.has_straMCCollision() || !collision.has_straMCCollision())
1991-
continue;
1992-
1993-
const auto& mcCollisionNeutron = neutron.straMCCollision_as<StraMCCollisionsFull>(); // take gen. collision associated to the neutron
1994-
1995-
// Consider neutrons from the same collision
1996-
if (mcCollisionNeutron.globalIndex() != mcCollision.globalIndex())
1997-
continue;
1998-
19991972
const float eta = neutron.eta();
20001973
switch (selGapSide) {
20011974
case 0: // SGA
@@ -2019,6 +1992,7 @@ struct Derivedupcanalysis {
20191992
if (evSels.studyUPConly && (selGapSide < -0.5))
20201993
return;
20211994

1995+
histos.fill(HIST("eventQA/hSelGapSideNoNeutrons"), selGapSideNoNeutrons);
20221996
fillHistogramsQA(collision, selGapSide);
20231997

20241998
histos.fill(HIST("eventQA/mc/hNTracksGlobalvsMCNParticlesEta08rec"), collision.multNTracksGlobal(), mcCollision.multMCNParticlesEta08());
@@ -2102,22 +2076,14 @@ struct Derivedupcanalysis {
21022076
histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide());
21032077

21042078
int selGapSide = collision.isUPC() ? getGapSide(collision) : -1;
2079+
int selGapSideNoNeutrons = selGapSide;
21052080

21062081
auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex());
21072082
if (checkNeutronsInMC) {
21082083
for (const auto& neutron : groupedNeutrons) {
21092084
if (selGapSide < -0.5)
21102085
break;
21112086

2112-
if (!neutron.has_straMCCollision() || !collision.has_straMCCollision())
2113-
continue;
2114-
2115-
const auto& mcCollisionNeutron = neutron.straMCCollision_as<StraMCCollisionsFull>(); // take gen. collision associated to the neutron
2116-
2117-
// Consider neutrons from the same collision
2118-
if (mcCollisionNeutron.globalIndex() != mcCollision.globalIndex())
2119-
continue;
2120-
21212087
const float eta = neutron.eta();
21222088
switch (selGapSide) {
21232089
case 0: // SGA
@@ -2141,6 +2107,7 @@ struct Derivedupcanalysis {
21412107
if (evSels.studyUPConly && (selGapSide < -0.5))
21422108
return;
21432109

2110+
histos.fill(HIST("eventQA/hSelGapSideNoNeutrons"), selGapSideNoNeutrons);
21442111
fillHistogramsQA(collision, selGapSide);
21452112

21462113
histos.fill(HIST("eventQA/mc/hNTracksGlobalvsMCNParticlesEta08rec"), collision.multNTracksGlobal(), mcCollision.multMCNParticlesEta08());

0 commit comments

Comments
 (0)