Skip to content

Commit 5791eb9

Browse files
authored
Add files via upload
1 parent 41f8e83 commit 5791eb9

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎PWGJE/Tasks/jetChargedV2.cxx‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,8 @@ struct JetChargedV2 {
936936
registry.fill(HIST("leadJetEtaMCP"), leadingJetEta);
937937
}
938938

939-
// Integrate the rho modulation fit over [phi - radius, phi + radius], wrapping phi into
940-
// [0, 2pi) first (the fitted function is periodic in phi).
939+
// Integrate the rho modulation fit over [phi - radius, phi + radius]. The integration
940+
// limits are kept inside [0, 2pi) by splitting the window into two pieces whenever it
941941
double getRhoLocalIntegral(TF1* fitFunc, double phi, double radius, float fitRangeMargin)
942942
{
943943
if (!fitFunc) {
@@ -951,7 +951,16 @@ struct JetChargedV2 {
951951
}
952952
}
953953
phi = RecoDecay::constrainAngle(phi, 0.);
954-
return fitFunc->Integral(phi - radius, phi + radius);
954+
const double twoPi = o2::constants::math::TwoPI;
955+
const double low = phi - radius;
956+
const double high = phi + radius;
957+
if (low < 0.) { // window crosses 0: split into two pieces
958+
return fitFunc->Integral(low + twoPi, twoPi) + fitFunc->Integral(0., high);
959+
}
960+
if (high > twoPi) { // window crosses 2*pi: split into two pieces
961+
return fitFunc->Integral(low, twoPi) + fitFunc->Integral(0., high - twoPi);
962+
}
963+
return fitFunc->Integral(low, high);
955964
}
956965

957966
void getRhoLocalIntegral(TF1* fitFunc, double phi, double radius, float fitRangeMargin, double& integralValue)

0 commit comments

Comments
 (0)