Skip to content

Commit ccced85

Browse files
committed
dndetaMFTPbPb.cxx: Fix azimuthal angle selection for MC particles
1 parent 42859ff commit ccced85

1 file changed

Lines changed: 30 additions & 15 deletions

File tree

‎PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx‎

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ struct DndetaMFTPbPb {
328328

329329
struct : ConfigurableGroup {
330330
Configurable<float> etaRangeMidrap{"etaRangeMidrap", 1.0f, "Eta range for midrapidity tracks"};
331-
Configurable<bool> usephiCut{"usephiCut", false, "use azimuthal angle cut"};
331+
Configurable<bool> usePhiCut{"usePhiCut", false, "use azimuthal angle cut"};
332+
Configurable<bool> usePhiCutGen{"usePhiCutGen", false, "use azimuthal angle cut for particles"};
333+
Configurable<bool> usePhiCutExtra{"usePhiCutExtra", false, "use additional azimuthal angle cut"};
332334
Configurable<float> phiCut{"phiCut", 0.1f, "Cut on azimuthal angle of MFT tracks"};
333335
Configurable<float> minPhi{"minPhi", 0.f, ""};
334336
Configurable<float> maxPhi{"maxPhi", 6.2832, ""};
@@ -1141,20 +1143,25 @@ struct DndetaMFTPbPb {
11411143
}
11421144
float phi = track.phi();
11431145
o2::math_utils::bringTo02Pi(phi);
1144-
if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) {
1146+
if (phi < 0.f || TwoPI < phi) {
11451147
return false;
11461148
}
11471149
if constexpr (fillHis) {
11481150
registryQC.fill(HIST("Tracks/hTrkSel"), static_cast<int>(TrkSel::trkSelPhi));
11491151
}
1150-
if (trackCuts.usephiCut) {
1151-
if ((phi < trackCuts.phiCut) ||
1152-
((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) ||
1153-
(phi > TwoPI - trackCuts.phiCut) ||
1154-
((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) &&
1155-
(phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) {
1152+
if (trackCuts.usePhiCut) {
1153+
if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) {
11561154
return false;
11571155
}
1156+
if (trackCuts.usePhiCutExtra) {
1157+
if ((phi < trackCuts.phiCut) ||
1158+
((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) ||
1159+
(phi > TwoPI - trackCuts.phiCut) ||
1160+
((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) &&
1161+
(phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) {
1162+
return false;
1163+
}
1164+
}
11581165
}
11591166
if constexpr (fillHis) {
11601167
registryQC.fill(HIST("Tracks/hTrkSel"), static_cast<int>(TrkSel::trkSelPhiCut));
@@ -1336,17 +1343,22 @@ struct DndetaMFTPbPb {
13361343
}
13371344
float phi = particle.phi();
13381345
o2::math_utils::bringTo02Pi(phi);
1339-
if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) {
1346+
if (phi < 0.f || TwoPI < phi) {
13401347
return false;
13411348
}
1342-
if (trackCuts.usephiCut) {
1343-
if ((phi < trackCuts.phiCut) ||
1344-
((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) ||
1345-
(phi > TwoPI - trackCuts.phiCut) ||
1346-
((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) &&
1347-
(phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) {
1349+
if (trackCuts.usePhiCutGen) {
1350+
if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) {
13481351
return false;
13491352
}
1353+
if (trackCuts.usePhiCutExtra) {
1354+
if ((phi < trackCuts.phiCut) ||
1355+
((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) ||
1356+
(phi > TwoPI - trackCuts.phiCut) ||
1357+
((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) &&
1358+
(phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) {
1359+
return false;
1360+
}
1361+
}
13501362
}
13511363
return true;
13521364
}
@@ -1513,6 +1525,9 @@ struct DndetaMFTPbPb {
15131525
}
15141526
float phi = particle.phi();
15151527
o2::math_utils::bringTo02Pi(phi);
1528+
if (phi < 0.f || TwoPI < phi) {
1529+
continue;
1530+
}
15161531
if constexpr (isCent) {
15171532
registryMC.fill(HIST("Tracks/Centrality/EtaZvtxGen_t"), particle.eta(), zvtx, c, occ);
15181533
registryMC.fill(HIST("Tracks/Centrality/PhiEtaGen_t"), phi, particle.eta(), c, occ);

0 commit comments

Comments
 (0)