Skip to content

Commit 2ee1153

Browse files
authored
[PWGCF] Update lambdaR2Correlation.cxx
Added a method to remove the V0s whose daughters are not uniquely associated to a single collision, i.e. removal of ambiguous tracks.
1 parent 3d73704 commit 2ee1153

File tree

1 file changed

+42
-11
lines changed

1 file changed

+42
-11
lines changed

PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "Common/DataModel/PIDResponse.h"
2020
#include "Common/DataModel/Centrality.h"
2121
#include "Common/DataModel/EventSelection.h"
22+
#include "Common/DataModel/CollisionAssociationTables.h"
2223
#include "Framework/AnalysisTask.h"
2324
#include "Framework/ASoAHelpers.h"
2425
#include "Framework/runDataProcessing.h"
@@ -152,8 +153,8 @@ enum TrackLabels {
152153
kPassV0KinCuts,
153154
kPassV0TopoSel,
154155
kAllSelPassed,
155-
kNotPrimaryLambda,
156-
kNotSecondaryLambda,
156+
kPrimaryLambda,
157+
kSecondaryLambda,
157158
kLambdaDauNotMcParticle,
158159
kLambdaNotPrPiMinus,
159160
kAntiLambdaNotAntiPrPiPlus,
@@ -242,14 +243,15 @@ struct LambdaTableProducer {
242243
Configurable<bool> cIsGoodITSLayers{"cIsGoodITSLayers", false, "Good ITS Layers All"};
243244

244245
// Tracks
245-
Configurable<float> cTrackMinPt{"cTrackMinPt", 0.16, "p_{T} minimum"};
246-
Configurable<float> cTrackMaxPt{"cTrackMaxPt", 999.0, "p_{T} minimum"};
246+
Configurable<float> cTrackMinPt{"cTrackMinPt", 0.15, "p_{T} minimum"};
247+
Configurable<float> cTrackMaxPt{"cTrackMaxPt", 999.0, "p_{T} maximum"};
247248
Configurable<float> cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"};
248-
Configurable<int> cMinTpcCrossedRows{"cMinTpcCrossedRows", 80, "TPC Min Crossed Rows"};
249+
Configurable<int> cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "TPC Min Crossed Rows"};
249250
Configurable<float> cMinTpcCROverCls{"cMinTpcCROverCls", 0.8, "Tpc Min Crossed Rows Over Findable Clusters"};
250251
Configurable<float> cMaxTpcSharedClusters{"cMaxTpcSharedClusters", 0.4, "Tpc Max Shared Clusters"};
251252
Configurable<float> cMaxChi2Tpc{"cMaxChi2Tpc", 4, "Max Chi2 Tpc"};
252-
Configurable<double> cTpcNsigmaCut{"cTpcNsigmaCut", 5.0, "TPC NSigma Selection Cut"};
253+
Configurable<double> cTpcNsigmaCut{"cTpcNsigmaCut", 3.0, "TPC NSigma Selection Cut"};
254+
Configurable<bool> cRemoveAmbiguousTracks{"cRemoveAmbiguousTracks", false, "Remove Ambiguous Tracks"};
253255

254256
// V0s
255257
Configurable<double> cMinDcaProtonToPV{"cMinDcaProtonToPV", 0.02, "Minimum Proton DCAr to PV"};
@@ -436,8 +438,8 @@ struct LambdaTableProducer {
436438
histos.get<TH1>(HIST("McGen/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotCol, "kTotCol");
437439
histos.get<TH1>(HIST("McGen/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kPassSelCol, "kPassSelCol");
438440
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kTracksBeforeHasMcParticle, "kTracksBeforeHasMcParticle");
439-
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotPrimaryLambda, "kNotPrimaryLambda");
440-
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotSecondaryLambda, "kNotSecondaryLambda");
441+
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPrimaryLambda, "kPrimaryLambda");
442+
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kSecondaryLambda, "kSecondaryLambda");
441443
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaDauNotMcParticle, "kLambdaDauNotMcParticle");
442444
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaNotPrPiMinus, "kLambdaNotPrPiMinus");
443445
histos.get<TH1>(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAntiLambdaNotAntiPrPiPlus, "kAntiLambdaNotAntiPrPiPlus");
@@ -736,19 +738,43 @@ struct LambdaTableProducer {
736738
return true;
737739
}
738740

741+
template <typename V, typename T>
742+
bool hasAmbiguousDaughters(V const& v0, T const&)
743+
{
744+
auto posTrack = v0.template posTrack_as<T>();
745+
auto negTrack = v0.template negTrack_as<T>();
746+
747+
auto posTrackCompCols = posTrack.compatibleCollIds();
748+
auto negTrackCompCols = negTrack.compatibleCollIds();
749+
750+
// Check if daughter tracks belongs to more than one collision (Ambiguous Tracks)
751+
if (posTrackCompCols.size() > 1 || negTrackCompCols.size() > 1) {
752+
return true;
753+
}
754+
755+
// Check if compatible collision index matches the track collision index
756+
if (((posTrackCompCols.size() != 0) && (posTrackCompCols[0] != posTrack.collisionId())) ||
757+
((negTrackCompCols.size() != 0) && (negTrackCompCols[0] != negTrack.collisionId()))) {
758+
return true;
759+
}
760+
761+
// Pass as not ambiguous
762+
return false;
763+
}
764+
739765
template <typename V>
740766
PrmScdType isPrimaryV0(V const& v0)
741767
{
742768
auto mcpart = v0.template mcParticle_as<aod::McParticles>();
743769

744770
// check for secondary lambda
745771
if (!mcpart.isPhysicalPrimary()) {
746-
histos.fill(HIST("Tracks/h1f_tracks_info"), kNotPrimaryLambda);
772+
histos.fill(HIST("Tracks/h1f_tracks_info"), kSecondaryLambda);
747773
bSecondaryLambdaFlag = true;
748774
return kSecondary;
749775
}
750776

751-
histos.fill(HIST("Tracks/h1f_tracks_info"), kNotSecondaryLambda);
777+
histos.fill(HIST("Tracks/h1f_tracks_info"), kPrimaryLambda);
752778
return kPrimary;
753779
}
754780

@@ -977,6 +1003,11 @@ struct LambdaTableProducer {
9771003
// we have v0 as lambda
9781004
histos.fill(HIST("Tracks/h1f_tracks_info"), kAllSelPassed);
9791005

1006+
// Remove lambda with ambiguous daughters
1007+
if (cRemoveAmbiguousTracks && hasAmbiguousDaughters(v0, tracks)) {
1008+
continue;
1009+
}
1010+
9801011
// Get Lambda mass and kinematic variables
9811012
mass = (v0Type == kLambda) ? v0.mLambda() : v0.mAntiLambda();
9821013
pt = v0.pt();
@@ -1172,7 +1203,7 @@ struct LambdaTableProducer {
11721203

11731204
using CollisionsRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>;
11741205
using CollisionsRun2 = soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms>;
1175-
using Tracks = soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCPr>;
1206+
using Tracks = soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCPr, aod::TrackCompColls>;
11761207
using McV0Tracks = soa::Join<aod::V0Datas, aod::McV0Labels>;
11771208
using TracksMC = soa::Join<Tracks, aod::McTrackLabels>;
11781209

0 commit comments

Comments
 (0)