From 275c0e18957315cccf84252f2f0e846d85948d27 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 6 Feb 2025 19:07:25 +0900 Subject: [PATCH] PWGEM/PhotonMeson: std::abs and std::fabs --- .../TableProducer/photonconversionbuilder.cxx | 30 +++++-------------- PWGEM/PhotonMeson/Tasks/pcmQC.cxx | 4 +-- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 4 +-- PWGEM/PhotonMeson/Utils/PCMUtilities.h | 28 ++++++++--------- 4 files changed, 26 insertions(+), 40 deletions(-) diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 9060bc9c9c2..836a6deccf0 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -102,8 +102,6 @@ struct PhotonConversionBuilder { Configurable max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; Configurable dcanegtopv{"dcanegtopv", 0.1, "DCA Neg To PV"}; Configurable dcapostopv{"dcapostopv", 0.1, "DCA Pos To PV"}; - Configurable min_pt_leg_at_sv{"min_pt_leg_at_sv", 0.0, "min pT for v0 legs at SV"}; // this is obsolete. - Configurable max_mean_its_cluster_size{"max_mean_its_cluster_size", 16.f, "max. x cos(lambda) for ITSonly tracks"}; // this is to suppress random combination for V0s with ITSonly tracks. default 3 + 1 for skimming. Configurable maxX{"maxX", 83.1, "max X for track IU"}; Configurable min_pt_trackiu{"min_pt_trackiu", 0.05, "min pT for trackiu"}; // this comes from online processing. pT of track seed is above 50 MeV/c in B = 0.5 T, 20 MeV/c in B = 0.2 T. @@ -115,6 +113,7 @@ struct PhotonConversionBuilder { Configurable max_dcav0dau_itsibss{"max_dcav0dau_itsibss", 1.0, "max distance btween 2 legs to V0s with ITS hits on ITSib SS"}; Configurable max_dcav0dau_tpc_inner_fc{"max_dcav0dau_tpc_inner_fc", 1.5, "max distance btween 2 legs to V0s with ITS hits on TPC inner FC"}; Configurable min_v0radius{"min_v0radius", 1.0, "min v0 radius"}; + Configurable max_v0radius{"max_v0radius", 90.0, "max v0 radius"}; Configurable margin_r_its{"margin_r_its", 3.0, "margin for r cut in cm"}; Configurable margin_r_tpc{"margin_r_tpc", 7.0, "margin for r cut in cm"}; Configurable margin_r_itstpc_tpc{"margin_r_itstpc_tpc", 7.0, "margin for r cut in cm"}; @@ -320,21 +319,6 @@ struct PhotonConversionBuilder { return false; } } - - if (isITSonlyTrack(track)) { - uint32_t itsClusterSizes = track.itsClusterSizes(); - int total_cluster_size = 0, nl = 0; - for (unsigned int layer = 0; layer < 7; layer++) { - int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf; - if (cluster_size_per_layer > 0) { - nl++; - } - total_cluster_size += cluster_size_per_layer; - } - if (static_cast(total_cluster_size) / static_cast(nl) * std::cos(std::atan(track.tgl())) > max_mean_its_cluster_size) { - return false; - } - } } return true; @@ -376,7 +360,7 @@ struct PhotonConversionBuilder { } template - void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ) + void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, const float dcaXY, const float dcaZ) { v0legs(track.collisionId(), track.globalIndex(), track.sign(), kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), dcaXY, dcaZ, @@ -422,6 +406,11 @@ struct PhotonConversionBuilder { // LOGF(info, "v0.collisionId() = %d , v0.posTrackId() = %d , v0.negTrackId() = %d", v0.collisionId(), v0.posTrackId(), v0.negTrackId()); + // if(isTPConlyTrack(ele)){ + // // LOGF(info, "TPConly: ele.globalIndex() = %d, ele.x() = %f, ele.y() = %f, ele.z() = %f, ele.tgl() = %f, ele.alpha() = %f, ele.snp() = %f, ele.signed1Pt() = %f", ele.globalIndex(), ele.x(), ele.y(), ele.z(), ele.tgl(), ele.alpha(), ele.snp(), ele.signed1Pt()); + // // LOGF(info, "TPConly: ele.globalIndex() = %d, ele.cYY() = %f, ele.cZY() = %f, ele.cZZ() = %f, ele.cSnpY() = %f, ele.cSnpZ() = %f, ele.cSnpSnp() = %f, ele.cTglY() = %f, ele.cTglZ() = %f, ele.cTglSnp() = %f, ele.cTglTgl() = %f, ele.c1PtY() = %f, ele.c1PtZ() = %f, ele.c1PtSnp() = %f, ele.c1PtTgl() = %f, ele.c1Pt21Pt2() = %f", ele.globalIndex(), ele.cYY(), ele.cZY(), ele.cZZ(), ele.cSnpY(), ele.cSnpZ(), ele.cSnpSnp(), ele.cTglY(), ele.cTglZ(), ele.cTglSnp(), ele.cTglTgl(), ele.c1PtY(), ele.c1PtZ(), ele.c1PtSnp(), ele.c1PtTgl(), ele.c1Pt21Pt2()); + // } + // Calculate DCA with respect to the collision associated to the v0, not individual tracks gpu::gpustd::array dcaInfo; @@ -498,7 +487,7 @@ struct PhotonConversionBuilder { if (rxy < std::fabs(gammaKF_DecayVtx.GetZ()) * std::tan(2 * std::atan(std::exp(-max_eta_v0))) - margin_z) { return; // RZ line cut } - if (rxy < min_v0radius) { + if (rxy < min_v0radius || max_v0radius < rxy) { return; } @@ -596,9 +585,6 @@ struct PhotonConversionBuilder { float pos_pt = RecoDecay::sqrtSumOfSquares(kfp_pos_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy()); float ele_pt = RecoDecay::sqrtSumOfSquares(kfp_ele_DecayVtx.GetPx(), kfp_ele_DecayVtx.GetPy()); - if (pos_pt < min_pt_leg_at_sv || ele_pt < min_pt_leg_at_sv) { - return; - } if (isITSonlyTrack(pos) && pos_pt > maxpt_itsonly) { return; diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index e593e69e52f..5b4d9c6be48 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -134,7 +134,7 @@ struct PCMQC { // v0 info fRegistry.add("V0/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false); - fRegistry.add("V0/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); + fRegistry.add("V0/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false); fRegistry.add("V0/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false); fRegistry.add("V0/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.99f, 1.0f}}, false); fRegistry.add("V0/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.99f, 1.0f}}, false); @@ -160,7 +160,7 @@ struct PCMQC { // v0leg info fRegistry.add("V0Leg/hPt", "pT;p_{T,e} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false); fRegistry.add("V0Leg/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -50, 50}}, false); - fRegistry.add("V0Leg/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); + fRegistry.add("V0Leg/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false); fRegistry.add("V0Leg/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -50.0f, 50.0f}, {200, -50.0f, 50.0f}}, false); fRegistry.add("V0Leg/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("V0Leg/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false); diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index 6005a6afbdc..bb050239175 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -176,7 +176,7 @@ struct PCMQCMC { // v0 info fRegistry.add("V0/primary/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false); - fRegistry.add("V0/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); + fRegistry.add("V0/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false); fRegistry.add("V0/primary/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false); fRegistry.add("V0/primary/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.99f, 1.0f}}, false); fRegistry.add("V0/primary/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.99f, 1.0f}}, false); @@ -212,7 +212,7 @@ struct PCMQCMC { // v0leg info fRegistry.add("V0Leg/primary/hPt", "pT;p_{T,e} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false); fRegistry.add("V0Leg/primary/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -50, 50}}, false); - fRegistry.add("V0Leg/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -3.0f, 1.0f}}, false); + fRegistry.add("V0Leg/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false); fRegistry.add("V0Leg/primary/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -50.0f, 50.0f}, {200, -50.0f, 50.0f}}, false); fRegistry.add("V0Leg/primary/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("V0Leg/primary/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false); diff --git a/PWGEM/PhotonMeson/Utils/PCMUtilities.h b/PWGEM/PhotonMeson/Utils/PCMUtilities.h index 63101c41418..625156cb373 100644 --- a/PWGEM/PhotonMeson/Utils/PCMUtilities.h +++ b/PWGEM/PhotonMeson/Utils/PCMUtilities.h @@ -24,7 +24,7 @@ //_______________________________________________________________________ inline bool checkAP(const float alpha, const float qt, const float alpha_max = 0.95, const float qt_max = 0.05) { - float ellipse = pow(alpha / alpha_max, 2) + pow(qt / qt_max, 2); + float ellipse = std::pow(alpha / alpha_max, 2) + std::pow(qt / qt_max, 2); if (ellipse < 1.0) { return true; } else { @@ -111,8 +111,8 @@ float getPtResolution(TV0 const& v0) float px = v0.px(); float py = v0.py(); float pt = v0.pt(); - float px_err = std::sqrt(fabs(v0.sigmaPx2())); - float py_err = std::sqrt(fabs(v0.sigmaPy2())); + float px_err = std::sqrt(std::fabs(v0.sigmaPx2())); + float py_err = std::sqrt(std::fabs(v0.sigmaPy2())); float pxy_err = v0.sigmaPxPy(); return std::sqrt(std::pow(px / pt * px_err, 2) + std::pow(py / pt * py_err, 2) + 2.f * px / pt * py / pt * pxy_err); } @@ -123,8 +123,8 @@ float getPhiResolution(TV0 const& v0) float px = v0.px(); float py = v0.py(); float pt = v0.pt(); - float px_err = std::sqrt(fabs(v0.sigmaPx2())); - float py_err = std::sqrt(fabs(v0.sigmaPy2())); + float px_err = std::sqrt(std::fabs(v0.sigmaPx2())); + float py_err = std::sqrt(std::fabs(v0.sigmaPy2())); float pxy_err = v0.sigmaPxPy(); return std::sqrt(std::pow(px / pt / pt * py_err, 2) + std::pow(py / pt / pt * px_err, 2) - 2.f * px / pt / pt * py / pt / pt * pxy_err); } @@ -137,9 +137,9 @@ float getThetaResolution(TV0 const& v0) float pz = v0.pz(); float pt = v0.pt(); float p = v0.p(); - float px_err = std::sqrt(fabs(v0.sigmaPx2())); - float py_err = std::sqrt(fabs(v0.sigmaPy2())); - float pz_err = std::sqrt(fabs(v0.sigmaPz2())); + float px_err = std::sqrt(std::fabs(v0.sigmaPx2())); + float py_err = std::sqrt(std::fabs(v0.sigmaPy2())); + float pz_err = std::sqrt(std::fabs(v0.sigmaPz2())); float pxy_err = v0.sigmaPxPy(); float pyz_err = v0.sigmaPyPz(); float pzx_err = v0.sigmaPzPx(); @@ -154,9 +154,9 @@ float getEtaResolution(TV0 const& v0) float pz = v0.pz(); float pt = v0.pt(); float p = v0.p(); - float px_err = std::sqrt(fabs(v0.sigmaPx2())); - float py_err = std::sqrt(fabs(v0.sigmaPy2())); - float pz_err = std::sqrt(fabs(v0.sigmaPz2())); + float px_err = std::sqrt(std::fabs(v0.sigmaPx2())); + float py_err = std::sqrt(std::fabs(v0.sigmaPy2())); + float pz_err = std::sqrt(std::fabs(v0.sigmaPz2())); float pxy_err = v0.sigmaPxPy(); float pyz_err = v0.sigmaPyPz(); float pzx_err = v0.sigmaPzPx(); @@ -170,9 +170,9 @@ float getPResolution(TV0 const& v0) float py = v0.py(); float pz = v0.pz(); float p = v0.p(); - float px_err = std::sqrt(fabs(v0.sigmaPx2())); - float py_err = std::sqrt(fabs(v0.sigmaPy2())); - float pz_err = std::sqrt(fabs(v0.sigmaPz2())); + float px_err = std::sqrt(std::fabs(v0.sigmaPx2())); + float py_err = std::sqrt(std::fabs(v0.sigmaPy2())); + float pz_err = std::sqrt(std::fabs(v0.sigmaPz2())); float pxy_err = v0.sigmaPxPy(); float pyz_err = v0.sigmaPyPz(); float pzx_err = v0.sigmaPzPx();