|
26 | 26 | #include <Framework/HistogramSpec.h> |
27 | 27 | #include <Framework/Logger.h> |
28 | 28 |
|
| 29 | +#include <TF1.h> |
| 30 | + |
29 | 31 | #include <array> |
30 | 32 | #include <chrono> |
31 | 33 | #include <cmath> |
@@ -69,6 +71,8 @@ struct ConfCpr : o2::framework::ConfigurableGroup { |
69 | 71 | o2::framework::Configurable<bool> plotAngularCorrelation{"plotAngularCorrelation", false, "Plot angular correlation of particles (eta1 vs eta2 & phi1 vs phi2"}; |
70 | 72 | o2::framework::Configurable<float> detaMax{"detaMax", 0.01f, "Maximium deta"}; |
71 | 73 | 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"}; |
72 | 76 | o2::framework::Configurable<float> detaCenter{"detaCenter", 0.f, "Center of deta cut"}; |
73 | 77 | o2::framework::Configurable<float> dphistarCenter{"dphistarCenter", 0.f, "Center of dphistar cut"}; |
74 | 78 | 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 |
191 | 195 | { |
192 | 196 | mDetaMax = confCpr.detaMax.value; |
193 | 197 | 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 | + } |
194 | 203 |
|
195 | 204 | // check the limits |
196 | | - if (mDetaMax <= 0 || mDphistarMax <= 0) { |
| 205 | + if (mDetaMax <= 0 || (!mKtDependent && mDphistarMax <= 0)) { |
197 | 206 | LOG(fatal) << "Limits for Close Pair Rejection are invalid (0 or negative). Breaking..."; |
198 | 207 | } |
199 | 208 |
|
@@ -292,6 +301,12 @@ class CloseTrackRejection |
292 | 301 | mAverageDphistar = 0.f; // if computation at all radii fail, set it 0 |
293 | 302 | } |
294 | 303 |
|
| 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 | + |
295 | 310 | if (mPlotAngularCorrelation) { |
296 | 311 | mPhi1 = t1.phi(); |
297 | 312 | mPhi2 = t2.phi(); |
@@ -414,6 +429,8 @@ class CloseTrackRejection |
414 | 429 | float mDphistarMax = 0.f; |
415 | 430 | float mDetaCenter = 0.f; |
416 | 431 | float mDphistarCenter = 0.f; |
| 432 | + bool mKtDependent = false; |
| 433 | + TF1 mDphistarMaxFunc; |
417 | 434 |
|
418 | 435 | float mAverageDphistar = 0.f; |
419 | 436 | float mDeta = 0.f; |
|
0 commit comments