@@ -86,6 +86,8 @@ struct Phianalysisrun3pbpb {
8686 Configurable<bool > additionalEvSel4{" additionalEvSel4" , true , " Additional evsel4" };
8787 Configurable<bool > additionalEvSel5{" additionalEvSel5" , true , " Additional evsel5" };
8888 Configurable<bool > additionalEvSel6{" additionalEvSel6" , true , " Additional evsel6" };
89+ Configurable<bool > selHasBC{" selHasBC" , true , " Has BC?" };
90+ Configurable<bool > selHasFT0{" selHasFT0" , true , " Has FT0?" };
8991 Configurable<bool > cutvz{" cutvz" , true , " Vz cut" };
9092 Configurable<bool > cutvzgen{" cutvzgen" , true , " Vz cut" };
9193 Configurable<bool > isINELgt0{" isINELgt0" , true , " INEL>0 selection" };
@@ -375,6 +377,12 @@ struct Phianalysisrun3pbpb {
375377 if (!collision.sel8 ())
376378 return false ;
377379
380+ if (selectionConfig.selHasBC && !collision.has_foundBC ())
381+ return false ;
382+
383+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ())
384+ return false ;
385+
378386 if (selectionConfig.additionalEvSel1 && !collision.selection_bit (aod::evsel::kNoTimeFrameBorder ))
379387 return false ;
380388
@@ -519,6 +527,12 @@ struct Phianalysisrun3pbpb {
519527 if (cfgDoSel8 && !collision.sel8 ()) {
520528 return ;
521529 }
530+ if (selectionConfig.selHasBC && !collision.has_foundBC ()) {
531+ return ;
532+ }
533+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ()) {
534+ return ;
535+ }
522536 histos.fill (HIST (" hEvtSelInfo" ), 2.5 );
523537 if (selectionConfig.additionalEvSel1 && !collision.selection_bit (aod::evsel::kNoTimeFrameBorder )) {
524538 return ;
@@ -685,6 +699,12 @@ struct Phianalysisrun3pbpb {
685699 if (!c2.sel8 ()) {
686700 continue ;
687701 }
702+ if (selectionConfig.selHasBC && (!c1.has_foundBC () || !c2.has_foundBC ())) {
703+ continue ;
704+ }
705+ if (selectionConfig.selHasFT0 && (!c1.has_foundFT0 () || !c2.has_foundFT0 ())) {
706+ continue ;
707+ }
688708 if (selectionConfig.additionalEvSel1 && (!c1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !c2.selection_bit (aod::evsel::kNoTimeFrameBorder ))) {
689709 continue ;
690710 }
@@ -761,6 +781,12 @@ struct Phianalysisrun3pbpb {
761781 if (!c2.sel8 ()) {
762782 continue ;
763783 }
784+ if (selectionConfig.selHasBC && (!c1.has_foundBC () || !c2.has_foundBC ())) {
785+ continue ;
786+ }
787+ if (selectionConfig.selHasFT0 && (!c1.has_foundFT0 () || !c2.has_foundFT0 ())) {
788+ continue ;
789+ }
764790 if (selectionConfig.additionalEvSel1 && (!c1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !c2.selection_bit (aod::evsel::kNoTimeFrameBorder ))) {
765791 continue ;
766792 }
@@ -838,6 +864,12 @@ struct Phianalysisrun3pbpb {
838864 if (!c2.sel8 ()) {
839865 continue ;
840866 }
867+ if (selectionConfig.selHasBC && (!c1.has_foundBC () || !c2.has_foundBC ())) {
868+ continue ;
869+ }
870+ if (selectionConfig.selHasFT0 && (!c1.has_foundFT0 () || !c2.has_foundFT0 ())) {
871+ continue ;
872+ }
841873 if (selectionConfig.additionalEvSel1 && (!c1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !c2.selection_bit (aod::evsel::kNoTimeFrameBorder ))) {
842874 continue ;
843875 }
@@ -915,6 +947,12 @@ struct Phianalysisrun3pbpb {
915947 if (!c2.sel8 ()) {
916948 continue ;
917949 }
950+ if (selectionConfig.selHasBC && (!c1.has_foundBC () || !c2.has_foundBC ())) {
951+ continue ;
952+ }
953+ if (selectionConfig.selHasFT0 && (!c1.has_foundFT0 () || !c2.has_foundFT0 ())) {
954+ continue ;
955+ }
918956 if (selectionConfig.additionalEvSel1 && (!c1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !c2.selection_bit (aod::evsel::kNoTimeFrameBorder ))) {
919957 continue ;
920958 }
@@ -978,6 +1016,12 @@ struct Phianalysisrun3pbpb {
9781016 if (!collision.sel8 ()) {
9791017 return ;
9801018 }
1019+ if (selectionConfig.selHasBC && !collision.has_foundBC ()) {
1020+ return ;
1021+ }
1022+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ()) {
1023+ return ;
1024+ }
9811025 if (selectionConfig.additionalEvSel2 && (!collision.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
9821026 return ;
9831027 }
@@ -1075,6 +1119,12 @@ struct Phianalysisrun3pbpb {
10751119 if (cfgDoSel8 && !RecCollision.sel8 ()) {
10761120 continue ;
10771121 }
1122+ if (selectionConfig.selHasBC && !RecCollision.has_foundBC ()) {
1123+ continue ;
1124+ }
1125+ if (selectionConfig.selHasFT0 && !RecCollision.has_foundFT0 ()) {
1126+ continue ;
1127+ }
10781128 if (std::abs (RecCollision.posZ ()) > selectionConfig.cfgCutVertex ) {
10791129 continue ;
10801130 }
@@ -1288,6 +1338,12 @@ struct Phianalysisrun3pbpb {
12881338 if (cfgDoSel8 && !collision.sel8 ()) {
12891339 continue ;
12901340 }
1341+ if (selectionConfig.selHasBC && !collision.has_foundBC ()) {
1342+ continue ;
1343+ }
1344+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ()) {
1345+ continue ;
1346+ }
12911347 if (std::abs (collision.mcCollision ().posZ ()) > selectionConfig.cfgCutVertex ) {
12921348 continue ;
12931349 }
@@ -1368,6 +1424,12 @@ struct Phianalysisrun3pbpb {
13681424 if (cfgDoSel8 && !collision.sel8 ()) {
13691425 return ;
13701426 }
1427+ if (selectionConfig.selHasBC && !collision.has_foundBC ()) {
1428+ return ;
1429+ }
1430+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ()) {
1431+ return ;
1432+ }
13711433 if (std::abs (collision.mcCollision ().posZ ()) > selectionConfig.cfgCutVertex ) {
13721434 return ;
13731435 }
@@ -1494,6 +1556,12 @@ struct Phianalysisrun3pbpb {
14941556 if (!collision.sel8 ()) {
14951557 return ;
14961558 }
1559+ if (selectionConfig.selHasBC && !collision.has_foundBC ()) {
1560+ return ;
1561+ }
1562+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ()) {
1563+ return ;
1564+ }
14971565 if (selectionConfig.additionalEvSel1 && !collision.selection_bit (aod::evsel::kNoTimeFrameBorder )) {
14981566 return ;
14991567 }
@@ -1615,6 +1683,12 @@ struct Phianalysisrun3pbpb {
16151683 if (!c2.sel8 ()) {
16161684 continue ;
16171685 }
1686+ if (selectionConfig.selHasBC && (!c1.has_foundBC () || !c2.has_foundBC ())) {
1687+ continue ;
1688+ }
1689+ if (selectionConfig.selHasFT0 && (!c1.has_foundFT0 () || !c2.has_foundFT0 ())) {
1690+ continue ;
1691+ }
16181692 if (selectionConfig.additionalEvSel1 && (!c1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !c2.selection_bit (aod::evsel::kNoTimeFrameBorder ))) {
16191693 continue ;
16201694 }
@@ -1691,11 +1765,10 @@ struct Phianalysisrun3pbpb {
16911765 // all events
16921766 histos.fill (HIST (" hMC1" ), 0.5 );
16931767
1694- // vertex QA (not selection)
1695- if (!selectionConfig.cutvzgen ||
1696- std::abs (mcCollision.posZ ()) < selectionConfig.cfgCutVertex ) {
1697- histos.fill (HIST (" hMC1" ), 1.5 );
1768+ if (selectionConfig.cutvzgen && std::abs (mcCollision.posZ ()) > selectionConfig.cfgCutVertex ) {
1769+ return ;
16981770 }
1771+ histos.fill (HIST (" hMC1" ), 1.5 );
16991772
17001773 // INEL>0 selection
17011774 if (isApplyInelgt0 && !mcCollision.isInelGt0 ())
@@ -1717,6 +1790,12 @@ struct Phianalysisrun3pbpb {
17171790 if (cfgDoSel8 && !collision.sel8 ()) {
17181791 continue ;
17191792 }
1793+ if (selectionConfig.selHasBC && !collision.has_foundBC ()) {
1794+ continue ;
1795+ }
1796+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ()) {
1797+ continue ;
1798+ }
17201799 histos.fill (HIST (" hMC1" ), 5.5 );
17211800 if (selectionConfig.cutvz &&
17221801 std::abs (collision.posZ ()) > selectionConfig.cfgCutVertex ) {
@@ -1825,6 +1904,12 @@ struct Phianalysisrun3pbpb {
18251904 if (cfgDoSel8 && !collision.sel8 ()) {
18261905 return ;
18271906 }
1907+ if (selectionConfig.selHasBC && !collision.has_foundBC ()) {
1908+ return ;
1909+ }
1910+ if (selectionConfig.selHasFT0 && !collision.has_foundFT0 ()) {
1911+ return ;
1912+ }
18281913 if (selectionConfig.cutvz &&
18291914 std::abs (collision.posZ ()) > selectionConfig.cfgCutVertex ) {
18301915 return ;
@@ -1932,29 +2017,36 @@ struct Phianalysisrun3pbpb {
19322017 if (!ispTdepPID && (!selectionPID (track1) || !selectionPID (track2))) {
19332018 continue ;
19342019 }
1935- if (ispTdepPID &&
1936- ( selectionPIDpTdependent (track1, 0 ) || selectionPIDpTdependent (track1, 1 )) &&
1937- ( selectionPIDpTdependent (track2, 0 ) || selectionPIDpTdependent (track2, 1 ))) {
1938-
2020+ if (ispTdepPID && !( selectionPIDpTdependent (track1, 0 ) || selectionPIDpTdependent (track1, 1 ))) {
2021+ continue ;
2022+ }
2023+ if (ispTdepPID && !( selectionPIDpTdependent (track2, 0 ) || selectionPIDpTdependent (track2, 1 ))) {
19392024 continue ;
19402025 }
19412026 histos.fill (HIST (" TPC_Nsigma1_MC" ), track1.tpcNSigmaKa (), multiplicity, track1.pt ());
19422027 histos.fill (HIST (" TOF_Nsigma1_MC" ), track1.tofNSigmaKa (), multiplicity, track1.pt ());
19432028 histos.fill (HIST (" trkDCAxy" ), track1.dcaXY (), multiplicity, track1.pt ());
19442029 histos.fill (HIST (" trkDCAz" ), track1.dcaZ (), multiplicity, track1.pt ());
2030+ std::array<float , 3 > pvec0 = {track1.px (), track1.py (), track1.pz ()};
2031+ std::array<float , 3 > pvec1 = {track2.px (), track2.py (), track2.pz ()};
2032+ std::array<std::array<float , 3 >, 2 > arrMomrec = {pvec0, pvec1};
2033+ recMass = RecoDecay::m (arrMomrec, std::array{massKa, massKa});
2034+
2035+ // reconstructed-pair rapidity, cut with the same rapiditycut1/rapiditycut2 that fillinvMass() applies to data
2036+ auto recRapidity = RecoDecay::y (std::array<float , 3 >{track1.px () + track2.px (), track1.py () + track2.py (), track1.pz () + track2.pz ()}, recMass);
2037+ if (recRapidity < rapiditycut1 || recRapidity > rapiditycut2) {
2038+ continue ;
2039+ }
2040+
19452041 if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex ()) {
19462042 histos.fill (HIST (" h1PhiRecsplit1" ), mothertrack1.pt ());
19472043 continue ;
19482044 }
19492045 oldindex = mothertrack1.globalIndex ();
1950- std::array<float , 3 > pvec0 = {track1.px (), track1.py (), track1.pz ()};
1951- std::array<float , 3 > pvec1 = {track2.px (), track2.py (), track2.pz ()};
1952- std::array<std::array<float , 3 >, 2 > arrMomrec = {pvec0, pvec1};
19532046
19542047 auto motherP = mothertrack1.p ();
19552048 auto motherE = mothertrack1.e ();
19562049 genMass = std::sqrt (motherE * motherE - motherP * motherP);
1957- recMass = RecoDecay::m (arrMomrec, std::array{massKa, massKa});
19582050
19592051 histos.fill (HIST (" h1PhifinalRec" ), mothertrack1.pt ());
19602052 histos.fill (HIST (" h3PhifinalRec" ), mothertrack1.pt (), multiplicity, recMass);
0 commit comments