Skip to content

Commit d9c2565

Browse files
committed
adding hadron-lambda correlations
1 parent 09e438a commit d9c2565

1 file changed

Lines changed: 145 additions & 7 deletions

File tree

PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.cxx

Lines changed: 145 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "PWGLF/DataModel/LFStrangenessTables.h"
1515

1616
#include "Common/CCDB/EventSelectionParams.h"
17+
#include "Common/Core/RecoDecay.h"
1718
#include "Common/DataModel/Centrality.h"
1819
#include "Common/DataModel/EventSelection.h"
1920
#include "Common/DataModel/Multiplicity.h"
@@ -108,6 +109,11 @@ struct lambdaTwoPartPolarization {
108109
Configurable<float> cfgDaughPrPt{"cfgDaughPrPt", 0.5, "minimum daughter proton pt"};
109110
Configurable<float> cfgDaughPiPt{"cfgDaughPiPt", 0.2, "minimum daughter pion pt"};
110111

112+
Configurable<float> cfgTrackPtMin{"cfgTrackPtMin", 0.2, "minimum primary track pT selection"};
113+
Configurable<float> cfgTrackPtMax{"cfgTrackPtMax", 3., "minimum primary track pT selection"};
114+
Configurable<float> cfgTrackEtaMax{"cfgTrackEtaMax", 0.8, "maximum primary track Eta selection"};
115+
Configurable<float> cfgMinTPCClustersTrack{"cfgMinTPCClustersTrack", 70, "minimum primary tpc track ncluster selection"};
116+
111117
Configurable<float> cfgHypMassWindow{"cfgHypMassWindow", 0.005, "single lambda mass selection"};
112118

113119
Configurable<bool> cfgEffCor{"cfgEffCor", false, "flag to apply efficiency correction"};
@@ -166,6 +172,10 @@ struct lambdaTwoPartPolarization {
166172
histos.add("Ana/SignalCos2", "", {HistType::kTHnSparseF, {ptAxis, ptAxis, detaAxis, dphiAxis, centAxis, cosSigAxis}});
167173
histos.add("Ana/Acceptance", "", {HistType::kTHnSparseF, {ptAxis, centAxis, RapAxis, cosAccAxis}});
168174

175+
histos.add("AnaHL/SignalSin2", "", {HistType::kTHnSparseF, {ptAxis, ptAxis, detaAxis, dphiAxis, centAxis, cosSigAxis}});
176+
histos.add("AnaHL/SignalCos2", "", {HistType::kTHnSparseF, {ptAxis, ptAxis, detaAxis, dphiAxis, centAxis, cosSigAxis}});
177+
histos.add("AnaHL/Ref", "", {HistType::kTHnSparseF, {ptAxis, ptAxis, detaAxis, dphiAxis, centAxis}});
178+
169179
fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100);
170180
fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05);
171181
fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100);
@@ -218,7 +228,7 @@ struct lambdaTwoPartPolarization {
218228
} // event selection
219229

220230
template <typename TCollision, typename V0>
221-
bool SelectionV0(TCollision const& collision, V0 const& candidate, int LambdaTag)
231+
bool selectionV0(TCollision const& collision, V0 const& candidate, int LambdaTag)
222232
{
223233
if (candidate.v0radius() < cfgv0radiusMin)
224234
return false;
@@ -270,6 +280,107 @@ struct lambdaTwoPartPolarization {
270280
return true;
271281
}
272282

283+
template <typename Track>
284+
bool selectTrack(Track const& track)
285+
{
286+
if (!track.isGlobalTrack()) {
287+
return false;
288+
}
289+
if (track.pt() < cfgTrackPtMin || track.pt() > cfgTrackPtMax) {
290+
return false;
291+
}
292+
if (std::abs(track.eta()) > cfgTrackEtaMax) {
293+
return false;
294+
}
295+
if (track.tpcNClsFound() < cfgMinTPCClustersTrack) {
296+
return false;
297+
}
298+
return true;
299+
}
300+
301+
template <typename Trk1, typename Trk2>
302+
void FillHistogramsRef(Trk1 const& trks1, Trk2 const& trks2)
303+
{
304+
for (auto& trk1 : trks1) {
305+
if (!selectTrack(trk1)) {
306+
continue;
307+
}
308+
for (auto& trk2 : trks2) {
309+
if (!selectTrack(trk2)) {
310+
continue;
311+
}
312+
313+
if (trk1.globalIndex() >= trk2.globalIndex()) {
314+
continue;
315+
}
316+
317+
histos.fill(HIST("AnaHL/Ref"), trk1.pt(), trk2.pt(), trk1.eta() - trk2.eta(), RecoDecay::constrainAngle(trk1.phi() - trk2.phi(), -constants::math::PI * 0.5), centrality);
318+
}
319+
}
320+
}
321+
322+
template <typename C, typename V0, typename Trk>
323+
void FillHistogramsLH(C const& c1, V0 const& v0s, Trk const& trks)
324+
{
325+
for (auto& trk : trks) {
326+
if (!selectTrack(trk)) {
327+
continue;
328+
}
329+
330+
for (auto& v01 : v0s) {
331+
auto postrack_v01 = v01.template posTrack_as<TrackCandidates>();
332+
auto negtrack_v01 = v01.template negTrack_as<TrackCandidates>();
333+
334+
int LambdaTag = 0;
335+
int aLambdaTag = 0;
336+
337+
if (isSelectedV0Daughter(postrack_v01, 0) && isSelectedV0Daughter(negtrack_v01, 1)) {
338+
LambdaTag = 1;
339+
}
340+
if (isSelectedV0Daughter(negtrack_v01, 0) && isSelectedV0Daughter(postrack_v01, 1)) {
341+
aLambdaTag = 1;
342+
}
343+
344+
if (postrack_v01.globalIndex() == trk.globalIndex() || negtrack_v01.globalIndex() == trk.globalIndex()) {
345+
continue;
346+
}
347+
348+
if (LambdaTag == aLambdaTag)
349+
continue;
350+
351+
if (!selectionV0(c1, v01, LambdaTag))
352+
continue;
353+
354+
if (LambdaTag) {
355+
ProtonVec1 = ROOT::Math::PxPyPzMVector(v01.pxpos(), v01.pypos(), v01.pzpos(), massPr);
356+
PionVec1 = ROOT::Math::PxPyPzMVector(v01.pxneg(), v01.pyneg(), v01.pzneg(), massPi);
357+
V01Tag = 0;
358+
}
359+
if (aLambdaTag) {
360+
ProtonVec1 = ROOT::Math::PxPyPzMVector(v01.pxneg(), v01.pyneg(), v01.pzneg(), massPr);
361+
PionVec1 = ROOT::Math::PxPyPzMVector(v01.pxpos(), v01.pypos(), v01.pzpos(), massPi);
362+
V01Tag = 1;
363+
}
364+
365+
LambdaVec1 = ProtonVec1 + PionVec1;
366+
LambdaVec1.SetM(massLambda);
367+
368+
ROOT::Math::Boost boost1{LambdaVec1.BoostToCM()};
369+
ProtonBoostedVec1 = boost1(ProtonVec1);
370+
371+
costhetastar1 = ProtonBoostedVec1.Pz() / ProtonBoostedVec1.P();
372+
dphi = RecoDecay::constrainAngle(v01.phi() - trk.phi(), -constants::math::PI * 0.5);
373+
374+
weight = 1.0;
375+
weight *= cfgEffCor ? 1.0 / EffMap->GetBinContent(EffMap->GetXaxis()->FindBin(v01.pt()), EffMap->GetYaxis()->FindBin(centrality)) : 1.;
376+
weight *= cfgAccCor ? 1.0 / AccMap->GetBinContent(AccMap->GetXaxis()->FindBin(v01.pt()), AccMap->GetYaxis()->FindBin(v01.yLambda())) : 1.;
377+
378+
histos.fill(HIST("AnaHL/SignalSin2"), trk.pt(), v01.pt(), v01.yLambda() - trk.eta(), dphi, centrality, costhetastar1 * std::sin(2.0 * dphi) * weight);
379+
histos.fill(HIST("AnaHL/SignalCos2"), trk.pt(), v01.pt(), v01.yLambda() - trk.eta(), dphi, centrality, costhetastar1 * std::cos(2.0 * dphi) * weight);
380+
}
381+
}
382+
}
383+
273384
template <typename C1, typename C2, typename V01, typename V02>
274385
void FillHistograms(C1 const& c1, C2 const& c2, V01 const& V01s, V02 const& V02s)
275386
{
@@ -290,7 +401,7 @@ struct lambdaTwoPartPolarization {
290401
if (LambdaTag == aLambdaTag)
291402
continue;
292403

293-
if (!SelectionV0(c1, v01, LambdaTag))
404+
if (!selectionV0(c1, v01, LambdaTag))
294405
continue;
295406

296407
if (LambdaTag) {
@@ -332,7 +443,7 @@ struct lambdaTwoPartPolarization {
332443
if (LambdaTag == aLambdaTag)
333444
continue;
334445

335-
if (!SelectionV0(c2, v02, LambdaTag))
446+
if (!selectionV0(c2, v02, LambdaTag))
336447
continue;
337448

338449
if (doprocessDataSame) {
@@ -368,17 +479,44 @@ struct lambdaTwoPartPolarization {
368479
weight *= -1.0;
369480
}
370481

371-
dphi = TVector2::Phi_0_2pi(v01.phi() - v02.phi());
372-
if (dphi > constants::math::PI * 1.5) {
373-
dphi -= constants::math::PI * 2.0;
374-
}
482+
dphi = RecoDecay::constrainAngle(v01.phi() - v02.phi(), -constants::math::PI * 0.5);
375483

376484
histos.fill(HIST("Ana/Signal"), v01.pt(), v02.pt(), v01.yLambda() - v02.yLambda(), dphi, centrality, costhetastar1 * costhetastar2 * weight);
377485
histos.fill(HIST("Ana/SignalCos2"), v01.pt(), v02.pt(), v01.yLambda() - v02.yLambda(), dphi, centrality, costhetastar1 * costhetastar2 * std::cos(2.0 * dphi) * weight);
378486
}
379487
}
380488
}
381489

490+
void processDataSameHadron(EventCandidates::iterator const& collision,
491+
TrackCandidates const& tracks, aod::V0Datas const& V0s,
492+
aod::BCsWithTimestamps const&)
493+
{
494+
if (cfgCentEst == 1) {
495+
centrality = collision.centFT0C();
496+
} else if (cfgCentEst == 2) {
497+
centrality = collision.centFT0M();
498+
}
499+
if (!eventSelected(collision) && cfgEvtSel) {
500+
return;
501+
}
502+
503+
histos.fill(HIST("QA/CentDist"), centrality, 1.0);
504+
histos.fill(HIST("QA/PVzDist"), collision.posZ(), 1.0);
505+
506+
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
507+
if (cfgEffCor) {
508+
EffMap = ccdb->getForTimeStamp<TProfile2D>(cfgEffCorPath.value, bc.timestamp());
509+
}
510+
if (cfgAccCor) {
511+
AccMap = ccdb->getForTimeStamp<TProfile2D>(cfgAccCorPath.value, bc.timestamp());
512+
}
513+
514+
// FillHistograms(collision, collision, V0s, V0s);
515+
FillHistogramsRef(tracks, tracks);
516+
FillHistogramsLH(collision, V0s, tracks);
517+
}
518+
PROCESS_SWITCH(lambdaTwoPartPolarization, processDataSameHadron, "Process event for same data with hadrons", true);
519+
382520
void processDataSame(EventCandidates::iterator const& collision,
383521
TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s,
384522
aod::BCsWithTimestamps const&)

0 commit comments

Comments
 (0)