@@ -48,6 +48,7 @@ namespace o2::aod
4848namespace tree
4949{
5050DECLARE_SOA_COLUMN (GapSide, gapSide, float );
51+ DECLARE_SOA_COLUMN (GapSideTimeZN, gapSideTimeZN, float );
5152DECLARE_SOA_COLUMN (Sbp, sbp, int );
5253DECLARE_SOA_COLUMN (ITSROFb, itsROFb, int );
5354DECLARE_SOA_COLUMN (VtxITSTPCCut, vtxITSTPCCut, int );
@@ -84,6 +85,7 @@ DECLARE_SOA_COLUMN(MultiplicitySideC, multiplicitySideC, int);
8485} // namespace tree
8586DECLARE_SOA_TABLE (TREE, " AOD" , " Tree" ,
8687 tree::GapSide,
88+ tree::GapSideTimeZN,
8789 tree::Sbp,
8890 tree::ITSROFb,
8991 tree::VtxITSTPCCut,
@@ -406,7 +408,7 @@ struct UpcPhotonuclearAnalysisJMG {
406408
407409 switch (SideGap) {
408410 case 0 : // Gap in A side
409- if (( collision.timeZNA () > cutGapAMyEnergyZNA) && (collision.timeZNC () < cutGapAMyEnergyZNC )) {
411+ if (!( std::abs ( collision.timeZNA ()) > cutGapATimeZNA && std::abs (collision.timeZNC ()) < cutGapATimeZNC )) {
410412 return false ;
411413 }
412414 if (useEnergyZN && ((collision.energyCommonZNA () < cutGapAMyEnergyZNA) && (collision.energyCommonZNC () >= cutGapAMyEnergyZNC))) {
@@ -423,7 +425,7 @@ struct UpcPhotonuclearAnalysisJMG {
423425 // }
424426 break ;
425427 case 1 : // Gap in C side
426- if (( collision.timeZNA () < cutGapCMyEnergyZNA) && (collision.timeZNC () > cutGapCMyEnergyZNC )) {
428+ if (!( std::abs ( collision.timeZNA ()) < cutGapCTimeZNA && std::abs (collision.timeZNC ()) > cutGapCTimeZNC )) {
427429 return false ;
428430 }
429431 if (useEnergyZN && ((collision.energyCommonZNA () >= cutGapCMyEnergyZNA) && (collision.energyCommonZNC () < cutGapCMyEnergyZNC))) {
@@ -616,6 +618,7 @@ struct UpcPhotonuclearAnalysisJMG {
616618 {
617619 histos.fill (HIST (" Events/hCountCollisions" ), 0 );
618620 int sgSide = reconstructedCollision.gapSide ();
621+ int sgSideTimeZN = -1 ;
619622 int nTracksCharged = 0 ;
620623 float sumPt = 0 ;
621624 int nchPVGapSideA = 0 ;
@@ -634,8 +637,16 @@ struct UpcPhotonuclearAnalysisJMG {
634637 float phiVal = RecoDecay::constrainAngle (phi (track.px (), track.py ()), 0 .f );
635638 histos.fill (HIST (" etaphiVtx" ), reconstructedCollision.posZ (), eta (track.px (), track.py (), track.pz ()), phiVal);
636639 }
640+ bool isGapATimeZN = (std::abs (reconstructedCollision.timeZNA ()) > cutGapATimeZNA) && (std::abs (reconstructedCollision.timeZNC ()) < cutGapATimeZNC);
641+ bool isGapCTimeZN = (std::abs (reconstructedCollision.timeZNA ()) < cutGapCTimeZNA) && (std::abs (reconstructedCollision.timeZNC ()) > cutGapCTimeZNC);
642+ if (isGapATimeZN) {
643+ sgSideTimeZN = 0 ;
644+ }
645+ if (isGapCTimeZN) {
646+ sgSideTimeZN = 1 ;
647+ }
637648
638- switch (sgSide ) {
649+ switch (sgSideTimeZN ) {
639650 case 0 : // gap for side A
640651 if (isCollisionCutSG (reconstructedCollision, 0 ) == false ) {
641652 return ;
@@ -762,6 +773,7 @@ struct UpcPhotonuclearAnalysisJMG {
762773 break ;
763774 }
764775 tree (sgSide,
776+ sgSideTimeZN,
765777 reconstructedCollision.sbp (),
766778 reconstructedCollision.itsROFb (),
767779 reconstructedCollision.vtxITSTPC (),
@@ -894,20 +906,20 @@ struct UpcPhotonuclearAnalysisJMG {
894906 return ;
895907 }
896908 histos.fill (HIST (" Events/hCollisionsFlow" ), 7 );
897- bool cutGapAMyTimeZN = (reconstructedCollision.timeZNA () > cutGapAMyEnergyZNA ) && (reconstructedCollision.timeZNC () < cutGapAMyEnergyZNC );
898- bool cutGapCMyTimeZN = (reconstructedCollision.timeZNA () < cutGapCMyEnergyZNA ) && (reconstructedCollision.timeZNC () > cutGapCMyEnergyZNC );
899- if (cutGapAMyTimeZN || cutGapCMyTimeZN ) {
909+ bool isGapATimeZN = (std::abs ( reconstructedCollision.timeZNA ()) > cutGapATimeZNA ) && (std::abs ( reconstructedCollision.timeZNC ()) < cutGapATimeZNC );
910+ bool isGapCTimeZN = (std::abs ( reconstructedCollision.timeZNA ()) < cutGapCTimeZNA ) && (std::abs ( reconstructedCollision.timeZNC ()) > cutGapCTimeZNC );
911+ if (!(isGapATimeZN || isGapCTimeZN) ) {
900912 return ;
901913 }
902914 histos.fill (HIST (" Events/hCollisionsFlow" ), 8 );
903915
904- bool cutGapAMyEnergyZN = useEnergyZN && ((reconstructedCollision.energyCommonZNA () < cutGapAMyEnergyZNA) && (reconstructedCollision.energyCommonZNC () >= cutGapAMyEnergyZNC));
905- bool cutGapCMyEnergyZN = useEnergyZN && ((reconstructedCollision.energyCommonZNA () >= cutGapCMyEnergyZNA) && (reconstructedCollision.energyCommonZNC () < cutGapCMyEnergyZNC));
906- if (cutGapAMyEnergyZN || cutGapCMyEnergyZN ) {
916+ bool isGapAMyEnergyZN = useEnergyZN && ((reconstructedCollision.energyCommonZNA () < cutGapAMyEnergyZNA) && (reconstructedCollision.energyCommonZNC () >= cutGapAMyEnergyZNC));
917+ bool isGapCMyEnergyZN = useEnergyZN && ((reconstructedCollision.energyCommonZNA () >= cutGapCMyEnergyZNA) && (reconstructedCollision.energyCommonZNC () < cutGapCMyEnergyZNC));
918+ if (isGapAMyEnergyZN || isGapCMyEnergyZN ) {
907919 return ;
908920 }
909921 histos.fill (HIST (" Events/hCollisionsFlow" ), 9 );
910- if (cutGapAMyTimeZN && useFV0 && reconstructedCollision.totalFV0AmplitudeA () > cutGapAFV0Amplitude) {
922+ if (isGapATimeZN && useFV0 && reconstructedCollision.totalFV0AmplitudeA () > cutGapAFV0Amplitude) {
911923 return ;
912924 }
913925 histos.fill (HIST (" Events/hCollisionsFlow" ), 10 );
0 commit comments