diff --git a/Common/TableProducer/PID/pidTPCBase.h b/Common/TableProducer/PID/pidTPCBase.h index bd948bc99e6..494f1bf8685 100644 --- a/Common/TableProducer/PID/pidTPCBase.h +++ b/Common/TableProducer/PID/pidTPCBase.h @@ -100,8 +100,8 @@ typedef struct Str_dEdx_correction { for (int i = 0; i < fMatrix.GetNrows(); i++) { for (int j = 0; j < fMatrix.GetNcols(); j++) { double param = fMatrix(i, j); - double value1 = i > static_cast(vec1.size()) ? 0 : vec1[i]; - double value2 = j > static_cast(vec2.size()) ? 0 : vec2[j]; + double value1 = i >= static_cast(vec1.size()) ? 0 : vec1[i]; + double value2 = j >= static_cast(vec2.size()) ? 0 : vec2[j]; result += param * value1 * value2; } } diff --git a/Common/TableProducer/eventSelection.cxx b/Common/TableProducer/eventSelection.cxx index e79c75a5c48..f7f0f0df4d5 100644 --- a/Common/TableProducer/eventSelection.cxx +++ b/Common/TableProducer/eventSelection.cxx @@ -287,9 +287,9 @@ struct BcSelectionTask { // first bc of the first orbit bcSOR = runInfo.orbitSOR * nBCsPerOrbit; // duration of TF in bcs - nBCsPerTF = confNumberOfOrbitsPerTF < 0 ? runInfo.orbitsPerTF * nBCsPerOrbit : confNumberOfOrbitsPerTF * nBCsPerOrbit; + nBCsPerTF = confNumberOfOrbitsPerTF < 0 ? runInfo.orbitsPerTF * nBCsPerOrbit : static_cast(confNumberOfOrbitsPerTF) * nBCsPerOrbit; if (strLPMProductionTag == "LHC25f3") // temporary workaround for MC production LHC25f3 anchored to Pb-Pb 2023 apass5 (to be removed once the info is in ccdb) - nBCsPerTF = 8 * nBCsPerOrbit; + nBCsPerTF = static_cast(8) * nBCsPerOrbit; } // timestamp of the middle of the run used to access run-wise CCDB entries diff --git a/Common/TableProducer/selectionStudyTable.cxx b/Common/TableProducer/selectionStudyTable.cxx index bd7febf9bb9..6f69da4b4f1 100644 --- a/Common/TableProducer/selectionStudyTable.cxx +++ b/Common/TableProducer/selectionStudyTable.cxx @@ -105,9 +105,6 @@ struct SelectionStudyTable { if (std::abs(mcPart.pdgCode()) == 3334) { ptom.push_back(mcPart.pt()); } - if (std::abs(mcPart.pdgCode()) == 3334) { - ptom.push_back(mcPart.pt()); - } // inclusive HF for now if (std::abs(mcPart.pdgCode()) == 421) { ptd.push_back(mcPart.pt()); diff --git a/Common/Tasks/qaMuon.cxx b/Common/Tasks/qaMuon.cxx index bf2659faf07..8e63c98d1bf 100644 --- a/Common/Tasks/qaMuon.cxx +++ b/Common/Tasks/qaMuon.cxx @@ -526,7 +526,7 @@ struct muonQa { for (size_t i = 0; i < 2; i++) { std::string topBottom = (i == 0) ? "top" : "bottom"; AxisSpec deAxis = {26, 0, 26, "DE index"}; - AxisSpec phiAxis = {16, -180, 180, "#phi (degrees)"}; + AxisSpec phiAxisInner = {16, -180, 180, "#phi (degrees)"}; for (size_t j = 0; j < 2; j++) { std::string sign = (j == 0) ? "positive" : "negative"; for (int chamber = 0; chamber < 10; chamber++) { @@ -535,8 +535,8 @@ struct muonQa { residualsHistosPerDE[i][j][chamber]["dx_vs_de"] = registryResidualsMFT.add((histPath + "dx_vs_de").c_str(), "Cluster x residual vs. DE index", {HistType::kTH2F, {deAxis, dxAxis}}); residualsHistosPerDE[i][j][chamber]["dy_vs_de"] = registryResidualsMFT.add((histPath + "dy_vs_de").c_str(), "Cluster y residual vs. DE index", {HistType::kTH2F, {deAxis, dxAxis}}); - residualsHistosPerDE[i][j][chamber]["dx_vs_phi"] = registryResidualsMFT.add((histPath + "dx_vs_phi").c_str(), "Cluster x residual vs. cluster #phi", {HistType::kTH2F, {phiAxis, dxAxis}}); - residualsHistosPerDE[i][j][chamber]["dy_vs_phi"] = registryResidualsMFT.add((histPath + "dy_vs_phi").c_str(), "Cluster y residual vs. cluster #phi", {HistType::kTH2F, {phiAxis, dxAxis}}); + residualsHistosPerDE[i][j][chamber]["dx_vs_phi"] = registryResidualsMFT.add((histPath + "dx_vs_phi").c_str(), "Cluster x residual vs. cluster #phi", {HistType::kTH2F, {phiAxisInner, dxAxis}}); + residualsHistosPerDE[i][j][chamber]["dy_vs_phi"] = registryResidualsMFT.add((histPath + "dy_vs_phi").c_str(), "Cluster y residual vs. cluster #phi", {HistType::kTH2F, {phiAxisInner, dxAxis}}); // mixed events histPath = std::string("Alignment/mixed-event/Residuals/MFT/MFT_") + topBottom + "/" + sign + "/CH" + std::to_string(chamber + 1) + "/"; @@ -544,8 +544,8 @@ struct muonQa { residualsHistosPerDEMixedEvents[i][j][chamber]["dx_vs_de"] = registryResidualsMFT.add((histPath + "dx_vs_de").c_str(), "Cluster x residual vs. DE index", {HistType::kTH2F, {deAxis, dxAxis}}); residualsHistosPerDEMixedEvents[i][j][chamber]["dy_vs_de"] = registryResidualsMFT.add((histPath + "dy_vs_de").c_str(), "Cluster y residual vs. DE index", {HistType::kTH2F, {deAxis, dxAxis}}); - residualsHistosPerDEMixedEvents[i][j][chamber]["dx_vs_phi"] = registryResidualsMFT.add((histPath + "dx_vs_phi").c_str(), "Cluster x residual vs. cluster #phi", {HistType::kTH2F, {phiAxis, dxAxis}}); - residualsHistosPerDEMixedEvents[i][j][chamber]["dy_vs_phi"] = registryResidualsMFT.add((histPath + "dy_vs_phi").c_str(), "Cluster y residual vs. cluster #phi", {HistType::kTH2F, {phiAxis, dxAxis}}); + residualsHistosPerDEMixedEvents[i][j][chamber]["dx_vs_phi"] = registryResidualsMFT.add((histPath + "dx_vs_phi").c_str(), "Cluster x residual vs. cluster #phi", {HistType::kTH2F, {phiAxisInner, dxAxis}}); + residualsHistosPerDEMixedEvents[i][j][chamber]["dy_vs_phi"] = registryResidualsMFT.add((histPath + "dy_vs_phi").c_str(), "Cluster y residual vs. cluster #phi", {HistType::kTH2F, {phiAxisInner, dxAxis}}); } } } @@ -619,7 +619,7 @@ struct muonQa { AxisSpec rAbsAxis = {10, 0., 100.0, "R_{abs} (cm)"}; AxisSpec dcaAxis = {400, -10.0, 10.0, "DCA"}; AxisSpec dcaAxisReduced = {40, -10.0, 10.0, "DCA"}; - AxisSpec phiAxis = {36, -180.0, 180.0, "#phi (degrees)"}; + AxisSpec phiAxisInner = {36, -180.0, 180.0, "#phi (degrees)"}; // dimuons AxisSpec invMassAxis = {400, 1, 5, "M_{#mu^{+}#mu^{-}} (GeV/c^{2})"}; AxisSpec invMassCorrelationAxis = {80, 0, 8, "M_{#mu^{+}#mu^{-}} (GeV/c^{2})"}; @@ -682,8 +682,8 @@ struct muonQa { registryDimuon.add("dimuon/same-event/single-muon-dimuon-correlations/invariantMass_pT_MuPosDca_MuonKine_MuonCuts", "#mu^{+}#mu^{-} and #mu^{+} DCA", {HistType::kTH3F, {invMassAxis2D, pTAxis2D, dcaAxisReduced}}); registryDimuon.add("dimuon/same-event/single-muon-dimuon-correlations/invariantMass_pT_MuNegDca_MuonKine_MuonCuts", "#mu^{+}#mu^{-} and #mu^{-} DCA", {HistType::kTH3F, {invMassAxis2D, pTAxis2D, dcaAxisReduced}}); // - registryDimuon.add("dimuon/same-event/single-muon-dimuon-correlations/invariantMass_pT_MuPosPhi_MuonKine_MuonCuts", "#mu^{+}#mu^{-} and #mu^{+} #phi", {HistType::kTH3F, {invMassAxis2D, pTAxis2D, phiAxis}}); - registryDimuon.add("dimuon/same-event/single-muon-dimuon-correlations/invariantMass_pT_MuNegPhi_MuonKine_MuonCuts", "#mu^{+}#mu^{-} and #mu^{-} #phi", {HistType::kTH3F, {invMassAxis2D, pTAxis2D, phiAxis}}); + registryDimuon.add("dimuon/same-event/single-muon-dimuon-correlations/invariantMass_pT_MuPosPhi_MuonKine_MuonCuts", "#mu^{+}#mu^{-} and #mu^{+} #phi", {HistType::kTH3F, {invMassAxis2D, pTAxis2D, phiAxisInner}}); + registryDimuon.add("dimuon/same-event/single-muon-dimuon-correlations/invariantMass_pT_MuNegPhi_MuonKine_MuonCuts", "#mu^{+}#mu^{-} and #mu^{-} #phi", {HistType::kTH3F, {invMassAxis2D, pTAxis2D, phiAxisInner}}); } // MCH-MID tracks with MCH acceptance cuts registryDimuon.add("dimuon/same-event/invariantMass_MuonKine_MuonCuts", "#mu^{+}#mu^{-} invariant mass", {HistType::kTH1F, {invMassAxis}}); @@ -1607,8 +1607,8 @@ struct muonQa { fgValues.dcaY = (propmuon.getY() - collision.y); float dcaXY = std::sqrt(fgValues.dcaX * fgValues.dcaX + fgValues.dcaY * fgValues.dcaY); - mch::TrackParam trackParam = mch::TrackParam(muon.first()); - float p = trackParam.p(); + mch::TrackParam trackParamInner = mch::TrackParam(muon.first()); + float p = trackParamInner.p(); fgValues.pDca = p * dcaXY; } @@ -1674,14 +1674,14 @@ struct muonQa { // double pz = pMCH * cos(M_PI / 2 - atan(mft.tgl())); double pt = std::sqrt(std::pow(px, 2) + std::pow(py, 2)); - double chi2 = muon.chi2(); + double chi2Inner = muon.chi2(); double signed1Pt = endPoint == kToDCA ? muon.signed1Pt() : sign / pt; SMatrix5 tpars(muon.x(), muon.y(), muon.phi(), muon.tgl(), signed1Pt); std::vector v1{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; SMatrix55 tcovs(v1.begin(), v1.end()); - o2::track::TrackParCovFwd fwdtrack{muon.z(), tpars, tcovs, chi2}; + o2::track::TrackParCovFwd fwdtrack{muon.z(), tpars, tcovs, chi2Inner}; track.setParameters(tpars); track.setZ(fwdtrack.getZ()); track.setCovariances(tcovs); diff --git a/Common/Tools/EventSelectionModule.h b/Common/Tools/EventSelectionModule.h index da724b4a658..fd7a4a4d10b 100644 --- a/Common/Tools/EventSelectionModule.h +++ b/Common/Tools/EventSelectionModule.h @@ -784,10 +784,10 @@ class EventSelectionModule diffVzParMean = *parMeans; diffVzParSigma = *parSigmas; LOGP(info, ">>> special treatment for diffVz for light ion run {}", runLightIons); - for (int i = 0; i < 5; i++) - LOGP(info, " mean par {} = {}", i, diffVzParMean[i]); - for (int i = 0; i < 5; i++) - LOGP(info, " sigma par {} = {}", i, diffVzParSigma[i]); + for (int j = 0; j < 5; j++) + LOGP(info, " mean par {} = {}", j, diffVzParMean[j]); + for (int j = 0; j < 5; j++) + LOGP(info, " sigma par {} = {}", j, diffVzParSigma[j]); break; } } @@ -1042,8 +1042,9 @@ class EventSelectionModule } } } - } // end of if TOF-matched vertex - else { // for non-TOF and low-mult vertices, consider nearby nominal bcs + // end of if TOF-matched vertex + } else { + // for non-TOF and low-mult vertices, consider nearby nominal bcs int64_t meanBC = globalBC + TMath::Nint(sumHighPtTime / sumHighPtW / bcNS); int64_t bestGlobalBC = findBestGlobalBC(meanBC, evselOpts.confSigmaBCforHighPtTracks, vNcontributors[colIndex], col.posZ(), mapGlobalBcVtxZ); if (bestGlobalBC > 0) { @@ -1062,7 +1063,7 @@ class EventSelectionModule foundBCindex = bc.globalIndex(); // keep original BC index } } // end of non-TOF matched vertices - // sanitity check: if BC was not found + // sanity check: if BC was not found if (foundBCindex == -1) { foundBCindex = bc.globalIndex(); } diff --git a/Common/Tools/PID/pidTPCModule.h b/Common/Tools/PID/pidTPCModule.h index 721fd86f826..144815c9c3e 100644 --- a/Common/Tools/PID/pidTPCModule.h +++ b/Common/Tools/PID/pidTPCModule.h @@ -189,8 +189,8 @@ typedef struct Str_dEdx_correction { for (int i = 0; i < fMatrix.GetNrows(); i++) { for (int j = 0; j < fMatrix.GetNcols(); j++) { double param = fMatrix(i, j); - double value1 = i > static_cast(vec1.size()) ? 0 : vec1[i]; - double value2 = j > static_cast(vec2.size()) ? 0 : vec2[j]; + double value1 = i >= static_cast(vec1.size()) ? 0 : vec1[i]; + double value2 = j >= static_cast(vec2.size()) ? 0 : vec2[j]; result += param * value1 * value2; } } @@ -201,14 +201,10 @@ typedef struct Str_dEdx_correction { class pidTPCModule { public: - pidTPCModule() - { - // constructor - } o2::aod::pid::pidTPCConfigurables pidTPCopts; // TPC PID Response - o2::pid::tpc::Response* response; + o2::pid::tpc::Response* response{nullptr}; // Network correction for TPC PID response ml::OnnxModel network; @@ -237,13 +233,13 @@ class pidTPCModule pidTPCopts = external_pidtpcopts; if (pidTPCopts.useCorrecteddEdx.value) { - LOGF(info, "***************************************************"); - LOGF(info, " WARNING: YOU HAVE SWITCHED ON 'corrected dEdx!"); - LOGF(info, " This mode is still in development and it is meant"); - LOGF(info, " ONLY FOR EXPERTS at this time. Please switch "); - LOGF(info, " this option off UNLESS you are absolutely SURE"); - LOGF(info, " of what you're doing! You've been warned!"); - LOGF(info, "***************************************************"); + LOGF(warning, "***************************************************"); + LOGF(warning, " WARNING: YOU HAVE SWITCHED ON 'corrected dEdx!"); + LOGF(warning, " This mode is still in development and it is meant"); + LOGF(warning, " ONLY FOR EXPERTS at this time. Please switch "); + LOGF(warning, " this option off UNLESS you are absolutely SURE"); + LOGF(warning, " of what you're doing! You've been warned!"); + LOGF(warning, "***************************************************"); } if (pidTPCopts.skipTPCOnly.value == -1) { @@ -262,7 +258,7 @@ class pidTPCModule pidTPCopts.skipTPCOnly.value = 1; // loop over devices in this execution - auto& workflows = context.services().template get(); + auto const& workflows = context.services().template get(); for (o2::framework::DeviceSpec const& device : workflows.devices) { // Look for propagation service if (device.name.compare("propagation-service") == 0) { @@ -544,7 +540,7 @@ class pidTPCModule constexpr int ExpectedInputDimensionsNNV3 = 8; constexpr auto NetworkVersionV2 = "2"; constexpr auto NetworkVersionV3 = "3"; - for (int i = 0; i < NParticleTypes; i++) { // Loop over particle number for which network correction is used + for (int j = 0; j < NParticleTypes; j++) { // Loop over particle number for which network correction is used for (auto const& trk : tracks) { if (!trk.hasTPC()) { continue; @@ -557,7 +553,7 @@ class pidTPCModule track_properties[counter_track_props] = trk.tpcInnerParam(); track_properties[counter_track_props + 1] = trk.tgl(); track_properties[counter_track_props + 2] = trk.signed1Pt(); - track_properties[counter_track_props + 3] = o2::track::pid_constants::sMasses[i]; + track_properties[counter_track_props + 3] = o2::track::pid_constants::sMasses[j]; track_properties[counter_track_props + 4] = trk.has_collision() ? mults[trk.collisionId()] / 11000. : 1.; track_properties[counter_track_props + 5] = std::sqrt(nNclNormalization / trk.tpcNClsFound()); if (input_dimensions == ExpectedInputDimensionsNNV2 && networkVersion == NetworkVersionV2) { @@ -587,9 +583,9 @@ class pidTPCModule float* output_network = network.evalModel(track_properties); auto stop_network_eval = std::chrono::high_resolution_clock::now(); duration_network += std::chrono::duration>(stop_network_eval - start_network_eval).count(); - for (uint64_t i = 0; i < prediction_size; i += output_dimensions) { - for (int j = 0; j < output_dimensions; j++) { - network_prediction[i + j + prediction_size * loop_counter] = output_network[i + j]; + for (uint64_t k = 0; k < prediction_size; k += output_dimensions) { + for (int l = 0; l < output_dimensions; l++) { + network_prediction[k + l + prediction_size * loop_counter] = output_network[k + l]; } }