@@ -1120,6 +1120,7 @@ struct TableMaker {
11201120 for (const auto & muonId : fwdtrackIndices) { // start loop over tracks
11211121 auto muon = muonId.template fwdtrack_as <TMuons>();
11221122 trackFilteringTag = static_cast <uint64_t >(0 );
1123+ int realignRemoveFlag = 0 ;
11231124 if constexpr (static_cast <bool >(TMuonRealignFillMap)) {
11241125 // Update muon information using realigned tracks
11251126 if (static_cast <int >(muon.trackType ()) > 2 ) {
@@ -1128,6 +1129,7 @@ struct TableMaker {
11281129 if (muonRealignSelected.size () == 1 ) {
11291130 for (const auto & muonRealign : muonRealignSelected) {
11301131 VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
1132+ realignRemoveFlag = muonRealign.isRemovable ();
11311133 }
11321134 } else {
11331135 LOGF (fatal, " Inconsistent size of realigned muon track candidates." );
@@ -1151,7 +1153,7 @@ struct TableMaker {
11511153 trackTempFilterMap |= (uint8_t (1 ) << i);
11521154 }
11531155
1154- if (!trackTempFilterMap) { // does not pass the cuts
1156+ if (!trackTempFilterMap || realignRemoveFlag ) { // does not pass the cuts
11551157 nDel++;
11561158 } else { // it passes the cuts and will be saved in the tables
11571159 newEntryNb[muon.index ()] = muon.index () - nDel;
@@ -1174,11 +1176,13 @@ struct TableMaker {
11741176 if (static_cast <int >(muon.trackType ()) > 2 ) {
11751177 // Update only MCH or MCH-MID tracks with realigned information
11761178 auto muonRealignSelected = tracksMuonRealign.sliceBy (fwdtrackRealignPerMuon, muonId.fwdtrackId ());
1179+ int realignRemoveFlag = 0 ;
11771180 if (muonRealignSelected.size () == 1 ) {
11781181 for (const auto & muonRealign : muonRealignSelected) {
11791182 LOGF (debug, " Muon original - collisionId:%d x:%g y:%g z:%g phi:%g tgl:%g signed1pt:%g pt:%g p:%g eta:%g chi2:%g" , muon.collisionId (), muon.x (), muon.y (), muon.z (), muon.phi (), muon.tgl (), muon.signed1Pt (), muon.pt (), muon.p (), muon.eta (), muon.chi2 ());
11801183 LOGF (debug, " Muon realigned - collisionId:%d x:%g y:%g z:%g phi:%g tgl:%g signed1pt:%g pt:%g p:%g eta:%g chi2:%g" , muonRealign.collisionId (), muonRealign.x (), muonRealign.y (), muonRealign.z (), muonRealign.phi (), muonRealign.tgl (), muonRealign.signed1Pt (), muonRealign.pt (), muonRealign.p (), muonRealign.eta (), muonRealign.chi2 ());
11811184 VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
1185+ realignRemoveFlag = muonRealign.isRemovable ();
11821186
11831187 // recalculte pDca for global muon tracks
11841188 VarManager::FillTrackCollision<TMuonRealignFillMap>(muonRealign, collision);
@@ -1187,6 +1191,11 @@ struct TableMaker {
11871191 VarManager::FillPropagateMuon<TMuonRealignFillMap>(muonRealign, collision);
11881192 }
11891193 }
1194+
1195+ if (realignRemoveFlag) {
1196+ continue ;
1197+ }
1198+
11901199 } else {
11911200 LOGF (fatal, " Inconsistent size of realigned muon track candidates." );
11921201 }
0 commit comments