diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index c27599409c0..42a58a16a4f 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -172,9 +172,9 @@ struct HfTaskElectronWeakBoson { // track - match if (emcClusters.size() < 1) - continue; + continue; if (track.phi() < 1.39 || track.phi() > 3.265) - continue; + continue; auto tracksofcluster = matchedtracks.sliceBy(perClusterMatchedTracks, track.globalIndex()); // LOGF(info, "Number of matched track: %d", tracksofcluster.size()); @@ -184,63 +184,58 @@ struct HfTaskElectronWeakBoson { double dEta_mim = 999.9; if (tracksofcluster.size() > 0) { - int nmatch = 0; - for (const auto& match : tracksofcluster) { - if (match.emcalcluster_as().time() < minTime || match.emcalcluster_as().time() > maxTime) - continue; - if (match.emcalcluster_as().m02() < minM02 || match.emcalcluster_as().m02() > maxM02) - continue; - - double emc_m20 = match.emcalcluster_as().m20(); - double emc_m02 = match.emcalcluster_as().m02(); - double emc_energy = match.emcalcluster_as().energy(); - double emc_phi = match.emcalcluster_as().phi(); - double emc_eta = match.emcalcluster_as().eta(); - double emc_time = match.emcalcluster_as().time(); - // LOG(info) << "tr phi0 = " << match.track_as().phi(); - // LOG(info) << "tr phi1 = " << track.phi(); - // LOG(info) << "emc phi = " << emc_phi; - if (nmatch == 0) { - double dPhi = match.track_as().phi() - emc_phi; - double dEta = match.track_as().eta() - emc_eta; - - histos.fill(HIST("MatchPhiHistogram"), emc_phi, match.track_as().phi()); - histos.fill(HIST("MatchEtaHistogram"), emc_eta, match.track_as().eta()); - - double R = sqrt(pow(dPhi, 2)+pow(dEta, 2)); - if (R < Rmim) - { - Rmim = R; - dPhi_mim = dPhi; - dEta_mim = dEta; - } - histos.fill(HIST("TrMatchHistogram"), dPhi, dEta); - histos.fill(HIST("EMCtimeHistogram"), emc_time); - - if (R < MatchR_cut) - continue; - - double eop = emc_energy / match.track_as().p(); - // LOG(info) << "E/p" << eop; - histos.fill(HIST("EopNsigTPCHistogram"), match.track_as().tpcNSigmaEl(), eop); - histos.fill(HIST("M02Histogram"), match.track_as().tpcNSigmaEl(), emc_m02); - histos.fill(HIST("M20Histogram"), match.track_as().tpcNSigmaEl(), emc_m20); - if (match.track_as().tpcNSigmaEl() > -1.0 && match.track_as().tpcNSigmaEl() <3) - { - histos.fill(HIST("EopHistogram"), match.track_as().pt(), eop); - } - } - nmatch++; - } - } - - - if (Rmim < 10.0) - { - // LOG(info) << "R mim = " << Rmim; - histos.fill(HIST("TrMatchHistogram_mim"), dPhi_mim, dEta_mim); - } - + int nmatch = 0; + for (const auto& match : tracksofcluster) { + if (match.emcalcluster_as().time() < minTime || match.emcalcluster_as().time() > maxTime) + continue; + if (match.emcalcluster_as().m02() < minM02 || match.emcalcluster_as().m02() > maxM02) + continue; + + double emc_m20 = match.emcalcluster_as().m20(); + double emc_m02 = match.emcalcluster_as().m02(); + double emc_energy = match.emcalcluster_as().energy(); + double emc_phi = match.emcalcluster_as().phi(); + double emc_eta = match.emcalcluster_as().eta(); + double emc_time = match.emcalcluster_as().time(); + // LOG(info) << "tr phi0 = " << match.track_as().phi(); + // LOG(info) << "tr phi1 = " << track.phi(); + // LOG(info) << "emc phi = " << emc_phi; + if (nmatch == 0) { + double dPhi = match.track_as().phi() - emc_phi; + double dEta = match.track_as().eta() - emc_eta; + + histos.fill(HIST("MatchPhiHistogram"), emc_phi, match.track_as().phi()); + histos.fill(HIST("MatchEtaHistogram"), emc_eta, match.track_as().eta()); + + double R = sqrt(pow(dPhi, 2) + pow(dEta, 2)); + if (R < Rmim) { + Rmim = R; + dPhi_mim = dPhi; + dEta_mim = dEta; + } + histos.fill(HIST("TrMatchHistogram"), dPhi, dEta); + histos.fill(HIST("EMCtimeHistogram"), emc_time); + + if (R < MatchR_cut) + continue; + + double eop = emc_energy / match.track_as().p(); + // LOG(info) << "E/p" << eop; + histos.fill(HIST("EopNsigTPCHistogram"), match.track_as().tpcNSigmaEl(), eop); + histos.fill(HIST("M02Histogram"), match.track_as().tpcNSigmaEl(), emc_m02); + histos.fill(HIST("M20Histogram"), match.track_as().tpcNSigmaEl(), emc_m20); + if (match.track_as().tpcNSigmaEl() > -1.0 && match.track_as().tpcNSigmaEl() < 3) { + histos.fill(HIST("EopHistogram"), match.track_as().pt(), eop); + } + } + nmatch++; + } + } + + if (Rmim < 10.0) { + // LOG(info) << "R mim = " << Rmim; + histos.fill(HIST("TrMatchHistogram_mim"), dPhi_mim, dEta_mim); + } } // end of track loop }