@@ -937,17 +937,24 @@ struct TableMakerMC {
937937 if constexpr ((static_cast <bool >(TMuonRealignFillMap)) && static_cast <int >(muon.trackType ()) > 2 ) {
938938 // refill kinematic info and recalculate propagation in case of using realigned muons
939939 auto muonRealignSelected = muonsRealign.sliceBy (fwdtrackRealignPerMuon, assoc.fwdtrackId ());
940+ int realignRemoveFlag = 0 ;
940941 if (muonRealignSelected.size () == 1 ) {
941942 for (const auto & muonRealign : muonRealignSelected) {
942943 // refill muon information with realigned tracks
943944 VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
945+ realignRemoveFlag = muonRealign.isRemovable ();
944946
945947 if (fConfigVariousOptions .fPropMuon ) {
946948 VarManager::FillPropagateMuon<TMuonRealignFillMap>(muonRealign, collision);
947949 }
948950
949951 VarManager::FillTrackCollision<TMuonRealignFillMap>(muonRealign, collision);
950952 }
953+
954+ if (realignRemoveFlag) {
955+ continue ;
956+ }
957+
951958 } else {
952959 LOGF (fatal, " Inconsistent size of realigned muon track candidates." );
953960 }
@@ -1068,17 +1075,24 @@ struct TableMakerMC {
10681075 if constexpr ((static_cast <bool >(TMuonRealignFillMap)) && static_cast <int >(muon.trackType ()) > 2 ) {
10691076 // refill kinematic info and recalculate propagation in case of using realigned muons
10701077 auto muonRealignSelected = muonsRealign.sliceBy (fwdtrackRealignPerMuon, muon.globalIndex ());
1078+ int realignRemoveFlag = 0 ;
10711079 if (muonRealignSelected.size () == 1 ) {
10721080 for (const auto & muonRealign : muonRealignSelected) {
10731081 // refill muon information with realigned tracks
10741082 VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
1083+ realignRemoveFlag = muonRealign.isRemovable ();
10751084
10761085 if (fConfigVariousOptions .fPropMuon ) {
10771086 VarManager::FillPropagateMuon<TMuonRealignFillMap>(muonRealign, collision);
10781087 }
10791088
10801089 VarManager::FillTrackCollision<TMuonRealignFillMap>(muonRealign, collision);
10811090 }
1091+
1092+ if (realignRemoveFlag) {
1093+ continue ;
1094+ }
1095+
10821096 } else {
10831097 LOGF (fatal, " Inconsistent size of realigned muon track candidates." );
10841098 }
0 commit comments