Skip to content

Commit b51dfb4

Browse files
authored
[PWGLF] Phi cut was added (#11527)
1 parent 8970fed commit b51dfb4

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

PWGMM/UE/Tasks/dedxAnalysis.cxx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "PWGLF/DataModel/LFStrangenessTables.h"
2929
#include "ReconstructionDataFormats/Track.h"
3030
#include "Common/Core/TrackSelectionDefaults.h"
31+
#include "TF1.h"
3132

3233
using namespace o2;
3334
using namespace o2::framework;
@@ -58,6 +59,8 @@ struct DedxAnalysis {
5859
float pionTofCut = 1.0;
5960
float invMassCut = 0.01;
6061
float invMassCutGamma = 0.0015;
62+
float magField = 1.0;
63+
float pTcut = 2.0;
6164

6265
// Configurable Parameters
6366
// Tracks cuts
@@ -103,6 +106,10 @@ struct DedxAnalysis {
103106
Configurable<std::vector<float>> calibrationFactorPos{"calibrationFactorPos", {50.5157, 50.6359, 50.3198, 49.3345, 48.9197, 49.4931, 50.0188, 50.1406}, "positive calibration factors"};
104107
ConfigurableAxis binP{"binP", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, ""};
105108

109+
// phi cut fits
110+
TF1* fphiCutHigh = nullptr;
111+
TF1* fphiCutLow = nullptr;
112+
106113
TrackSelection myTrackSelection()
107114
{
108115
TrackSelection selectedTracks;
@@ -130,6 +137,8 @@ struct DedxAnalysis {
130137
AxisSpec ptAxis = {binP, "pT (GeV/c)"};
131138
AxisSpec etaAxis{8, -0.8, 0.8, "#eta"};
132139
AxisSpec pAxis = {binP, "#it{p}/Z (GeV/c)"};
140+
fphiCutLow = new TF1("StandardPhiCutLow", "0.1/x/x+pi/18.0-0.025", 0, 50);
141+
fphiCutHigh = new TF1("StandardPhiCutHigh", "0.12/x+pi/18.0+0.035", 0, 50);
133142
if (calibrationMode) {
134143
// MIP for pions
135144
registryDeDx.add(
@@ -202,6 +211,11 @@ struct DedxAnalysis {
202211
"hdEdx_vs_phi", "dE/dx", HistType::kTH2F,
203212
{{100, 0.0, 6.4, "#phi"}, {dedxAxis}});
204213

214+
// phi cut
215+
registryDeDx.add(
216+
"hpt_vs_phi", "phi cut", HistType::kTH2F,
217+
{{ptAxis}, {100, 0.0, 6.4, "#phi"}});
218+
205219
registryDeDx.add(
206220
"hbeta_vs_p_Neg", "beta", HistType::kTH2F,
207221
{{pAxis}, {100, 0.0, 1.1, "#beta"}});
@@ -375,6 +389,33 @@ struct DedxAnalysis {
375389
return true;
376390
}
377391

392+
// Phi cut
393+
template <typename T>
394+
bool passedPhiCut(const T& trk, float magField, const TF1& fphiCutLow, const TF1& fphiCutHigh)
395+
{
396+
float pt = trk.pt();
397+
float phi = trk.phi();
398+
int charge = trk.sign();
399+
400+
if (pt < pTcut)
401+
return true;
402+
403+
if (magField < 0.) // for negatve polarity field
404+
phi = o2::constants::math::TwoPI - phi;
405+
if (charge < 0) // for negatve charge
406+
phi = o2::constants::math::TwoPI - phi;
407+
408+
// to center gap in the middle
409+
phi += o2::constants::math::PI / 18.0f;
410+
phi = std::fmod(phi, o2::constants::math::PI / 9.0f);
411+
412+
if (phi < fphiCutHigh.Eval(pt) && phi > fphiCutLow.Eval(pt))
413+
return false; // reject track
414+
415+
registryDeDx.fill(HIST("hpt_vs_phi"), pt, phi);
416+
return true;
417+
}
418+
378419
// Process Data
379420
void process(SelectedCollisions::iterator const& collision,
380421
aod::V0Datas const& fullV0s, PIDTracks const& tracks)
@@ -410,6 +451,10 @@ struct DedxAnalysis {
410451
if (!mySelectionPrim.IsSelected(trk))
411452
continue;
412453

454+
// phi cut
455+
if (!passedPhiCut(trk, magField, *fphiCutLow, *fphiCutHigh))
456+
continue;
457+
413458
float signedP = trk.sign() * trk.tpcInnerParam();
414459

415460
// MIP calibration for pions

0 commit comments

Comments
 (0)