Skip to content

Commit def19b7

Browse files
committed
[PWGCF] Femto: add optional kT-dependent dphistar cut in close pair rejection
1 parent 2a90090 commit def19b7

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

PWGCF/Femto/Core/closePairRejection.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include <Framework/HistogramSpec.h>
2727
#include <Framework/Logger.h>
2828

29+
#include <TF1.h>
30+
2931
#include <array>
3032
#include <chrono>
3133
#include <cmath>
@@ -69,6 +71,8 @@ struct ConfCpr : o2::framework::ConfigurableGroup {
6971
o2::framework::Configurable<bool> plotAngularCorrelation{"plotAngularCorrelation", false, "Plot angular correlation of particles (eta1 vs eta2 & phi1 vs phi2"};
7072
o2::framework::Configurable<float> detaMax{"detaMax", 0.01f, "Maximium deta"};
7173
o2::framework::Configurable<float> dphistarMax{"dphistarMax", 0.01f, "Maximum dphistar"};
74+
o2::framework::Configurable<bool> ktDependent{"ktDependent", false, "If true, use dphistarMaxFormula instead of dphistarMax"};
75+
o2::framework::Configurable<std::string> dphistarMaxFormula{"dphistarMaxFormula", "0.01", "Maximum dphistar as TFormula, x=kT"};
7276
o2::framework::Configurable<float> detaCenter{"detaCenter", 0.f, "Center of deta cut"};
7377
o2::framework::Configurable<float> dphistarCenter{"dphistarCenter", 0.f, "Center of dphistar cut"};
7478
o2::framework::Configurable<float> kinematicMin{"kinematicMin", -1.f, "Minimum kstar/Q3 of pair/triplet for plotting (Set to negative value to turn off the cut)"};
@@ -191,9 +195,14 @@ class CloseTrackRejection
191195
{
192196
mDetaMax = confCpr.detaMax.value;
193197
mDphistarMax = confCpr.dphistarMax.value;
198+
mKtDependent = confCpr.ktDependent.value;
199+
200+
if (mKtDependent) {
201+
mDphistarMaxFunc = TF1((std::string(prefix) + "DphistarMax").c_str(), confCpr.dphistarMaxFormula.value.c_str(), 0.f, 10.f);
202+
}
194203

195204
// check the limits
196-
if (mDetaMax <= 0 || mDphistarMax <= 0) {
205+
if (mDetaMax <= 0 || (!mKtDependent && mDphistarMax <= 0)) {
197206
LOG(fatal) << "Limits for Close Pair Rejection are invalid (0 or negative). Breaking...";
198207
}
199208

@@ -292,6 +301,12 @@ class CloseTrackRejection
292301
mAverageDphistar = 0.f; // if computation at all radii fail, set it 0
293302
}
294303

304+
if (mKtDependent) {
305+
const float ktx = t1.pt() * std::cos(t1.phi()) + t2.pt() * std::cos(t2.phi());
306+
const float kty = t1.pt() * std::sin(t1.phi()) + t2.pt() * std::sin(t2.phi());
307+
mDphistarMax = mDphistarMaxFunc.Eval(0.5f * std::hypot(ktx, kty));
308+
}
309+
295310
if (mPlotAngularCorrelation) {
296311
mPhi1 = t1.phi();
297312
mPhi2 = t2.phi();
@@ -414,6 +429,8 @@ class CloseTrackRejection
414429
float mDphistarMax = 0.f;
415430
float mDetaCenter = 0.f;
416431
float mDphistarCenter = 0.f;
432+
bool mKtDependent = false;
433+
TF1 mDphistarMaxFunc;
417434

418435
float mAverageDphistar = 0.f;
419436
float mDeta = 0.f;

0 commit comments

Comments
 (0)