Skip to content

Commit 078f377

Browse files
authored
Update lambdaR2Correlation.cxx
1 parent cfdd465 commit 078f377

1 file changed

Lines changed: 5 additions & 22 deletions

File tree

PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ struct LambdaTableProducer {
795795
if (!objEff) {
796796
LOGF(fatal, "Reco efficiency object not found !");
797797
} else {
798-
TH1F* histEff = reinterpret_cast<TH1F*>(objEff->Clone());
798+
TH1F* histEff = dynamic_cast<TH1F*>(objEff->Clone());
799799
if (histEff->GetDimension() == TwoDimCorr) {
800800
histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPtCent);
801801
effCorrFact = histEff->GetBinContent(histEff->FindBin(cent, v.pt()));
@@ -818,8 +818,8 @@ struct LambdaTableProducer {
818818
if (!objITSTPCMatchEff || !objITSTPCTOFMatchEff) {
819819
LOGF(fatal, "Matching efficiency object not found !");
820820
} else {
821-
TH1F* histITSTPCMatchEff = static_cast<TH1F*>(objITSTPCMatchEff->Clone());
822-
TH1F* histITSTPCTOFMatchEff = static_cast<TH1F*>(objITSTPCTOFMatchEff->Clone());
821+
TH1F* histITSTPCMatchEff = dynamic_cast<TH1F*>(objITSTPCMatchEff->Clone());
822+
TH1F* histITSTPCTOFMatchEff = dynamic_cast<TH1F*>(objITSTPCTOFMatchEff->Clone());
823823
// Lambda / Anti-Lambda
824824
if constexpr (part == kLambda || part == kAntiLambda) {
825825
auto posTrack = v.template posTrack_as<T>();
@@ -1561,19 +1561,6 @@ struct LambdaR2Correlation {
15611561
}
15621562
}
15631563

1564-
// Rap-Phi Bin Index
1565-
int getRapPhiBin(float const& rap, float const& phi)
1566-
{
1567-
const auto rapbin = static_cast<int>((rap - kminrap) / rapbinwidth);
1568-
const auto phibin = static_cast<int>(phi / phibinwidth);
1569-
1570-
if (rapbin >= 0 && phibin >= 0 && rapbin < nrapbins && phibin < nphibins) {
1571-
return rapbin * nphibins + phibin;
1572-
}
1573-
1574-
return -99;
1575-
}
1576-
15771564
template <typename A>
15781565
bool checkClosePair(A const& v1, A const& v2, int const& charge1, int const& charge2)
15791566
{
@@ -1590,12 +1577,8 @@ struct LambdaR2Correlation {
15901577
// DEta
15911578
float deta = v1[1] - v2[1];
15921579

1593-
// Check close-pair
1594-
if (std::abs(deta) < cDEtaCut && std::abs(dphistar) < cDPhiStarCut) {
1595-
return true;
1596-
}
1597-
1598-
return false;
1580+
// Return
1581+
return (std::abs(deta) < cDEtaCut && std::abs(dphistar) < cDPhiStarCut);
15991582
}
16001583

16011584
template <typename T, typename V>

0 commit comments

Comments
 (0)