@@ -152,12 +152,17 @@ struct HfCorrelatorHfeHadrons {
152152 int gCollisionId = collision.globalIndex ();
153153 int64_t timeStamp = bc.timestamp ();
154154
155+ // Add hadron Table For Mix Event Electron Hadron correlation
156+ for (const auto & hTrack : tracks) {
157+ registry.fill (HIST (" hTracksBin" ), poolBin);
158+ entryHadron (hTrack.phi (), hTrack.eta (), hTrack.pt (), poolBin, gCollisionId , timeStamp);
159+ }
160+
155161 // Construct Deta Phi between electrons and hadrons
156162
157163 double ptElectron = -999 ;
158164 double phiElectron = -999 ;
159165 double etaElectron = -999 ;
160- int nElectron = 0 ;
161166
162167 for (const auto & eTrack : electron) {
163168 ptElectron = eTrack.ptTrack ();
@@ -209,10 +214,7 @@ struct HfCorrelatorHfeHadrons {
209214 if (ptCondition && (ptElectron < ptHadron)) {
210215 continue ;
211216 }
212- if (nElectron == 0 ) {
213- registry.fill (HIST (" hTracksBin" ), poolBin);
214- entryHadron (phiHadron, etaHadron, ptHadron, poolBin, gCollisionId , timeStamp);
215- }
217+
216218 deltaPhi = RecoDecay::constrainAngle (phiElectron - phiHadron, -o2::constants::math::PIHalf);
217219 deltaEta = etaElectron - etaHadron;
218220 registry.fill (HIST (" hInclusiveEHCorrel" ), ptElectron, ptHadron, deltaPhi, deltaEta);
@@ -236,7 +238,7 @@ struct HfCorrelatorHfeHadrons {
236238 entryElectronHadronPair (deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr);
237239
238240 } // end Hadron Track loop
239- nElectron++;
241+
240242 } // end Electron loop
241243 }
242244
0 commit comments