1919#include " Common/DataModel/Centrality.h"
2020#include " Common/DataModel/CollisionAssociationTables.h"
2121#include " Common/DataModel/EventSelection.h"
22+ #include " Common/DataModel/Multiplicity.h"
2223#include " Common/DataModel/PIDResponse.h"
2324
2425#include " CCDB/BasicCCDBManager.h"
@@ -43,9 +44,11 @@ namespace o2::aod
4344namespace lambdacollision
4445{
4546DECLARE_SOA_COLUMN (Cent, cent, float );
46- }
47+ DECLARE_SOA_COLUMN (Mult, mult, float );
48+ } // namespace lambdacollision
4749DECLARE_SOA_TABLE (LambdaCollisions, " AOD" , " LAMBDACOLS" , o2::soa::Index<>,
4850 lambdacollision::Cent,
51+ lambdacollision::Mult,
4952 aod::collision::PosX,
5053 aod::collision::PosY,
5154 aod::collision::PosZ);
@@ -56,6 +59,7 @@ namespace lambdamcgencollision
5659}
5760DECLARE_SOA_TABLE (LambdaMcGenCollisions, " AOD" , " LMCGENCOLS" , o2::soa::Index<>,
5861 lambdacollision::Cent,
62+ lambdacollision::Mult,
5963 o2::aod::mccollision::PosX,
6064 o2::aod::mccollision::PosY,
6165 o2::aod::mccollision::PosZ);
@@ -172,6 +176,11 @@ enum TrackLabels {
172176 kGenLambdaToPrPi
173177};
174178
179+ enum CentEstType {
180+ kCentFT0M = 0 ,
181+ kCentFV0A
182+ };
183+
175184enum RunType {
176185 kRun3 = 0 ,
177186 kRun2
@@ -229,6 +238,7 @@ struct LambdaTableProducer {
229238 Produces<aod::LambdaMcGenTracks> lambdaMCGenTrackTable;
230239
231240 // Collisions
241+ Configurable<int > cCentEstimator{" cCentEstimator" , 0 , " Centrality Estimator : 0-FT0M, 1-FV0A" };
232242 Configurable<float > cMinZVtx{" cMinZVtx" , -10.0 , " Min VtxZ cut" };
233243 Configurable<float > cMaxZVtx{" cMaxZVtx" , 10.0 , " Max VtxZ cut" };
234244 Configurable<float > cMinMult{" cMinMult" , 0 ., " Minumum Multiplicity" };
@@ -318,9 +328,8 @@ struct LambdaTableProducer {
318328 {" hPrimFracVsPtEtaCentLambda" , " hPrimFracVsPtEtaCentAntiLambda" }};
319329
320330 // Initialize Global Variables
321- float cent = 0 .;
331+ float cent = 0 ., mult = 0 . ;
322332 float pt = 0 ., eta = 0 ., rap = 0 ., phi = 0 .;
323- bool bSecondaryLambdaFlag = false ;
324333
325334 void init (InitContext const &)
326335 {
@@ -412,9 +421,7 @@ struct LambdaTableProducer {
412421 // McReco Histos
413422 histos.add (" Tracks/h2f_tracks_pid_before_sel" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
414423 histos.add (" Tracks/h2f_tracks_pid_after_sel" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
415- histos.add (" Tracks/h2f_lambda_from_sigma" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
416- histos.add (" Tracks/h2f_lambda_from_cascade" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
417- histos.add (" Tracks/h2f_lambda_from_omega" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
424+ histos.add (" Tracks/h2f_lambda_mothers_pdg" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
418425
419426 // McGen Histos
420427 histos.add (" McGen/h1f_collision_recgen" , " # of Reco Collision Associated to One Mc Generator Collision" , kTH1F , {axisMult});
@@ -481,7 +488,12 @@ struct LambdaTableProducer {
481488 }
482489
483490 if constexpr (run == kRun3 ) { // Run3 Min-Bias Trigger
484- cent = col.centFT0M ();
491+ // select centrality estimator
492+ if (cCentEstimator == kCentFT0M ) {
493+ cent = col.centFT0M ();
494+ } else if (cCentEstimator == kCentFV0A ) {
495+ cent = col.centFV0A ();
496+ }
485497 if (cSel8Trig && !col.sel8 ()) {
486498 return false ;
487499 }
@@ -495,7 +507,7 @@ struct LambdaTableProducer {
495507 }
496508 }
497509
498- if (cent <= cMinMult || cent >= cMaxMult) { // select centrality
510+ if (cent <= cMinMult || cent >= cMaxMult) { // select centrality percentile class
499511 return false ;
500512 }
501513
@@ -527,6 +539,9 @@ struct LambdaTableProducer {
527539 return false ;
528540 }
529541
542+ // Set Multiplicity
543+ mult = col.multNTracksPV ();
544+
530545 return true ;
531546 }
532547
@@ -772,7 +787,6 @@ struct LambdaTableProducer {
772787 // check for secondary lambda
773788 if (!mcpart.isPhysicalPrimary ()) {
774789 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kSecondaryLambda );
775- bSecondaryLambdaFlag = true ;
776790 return kSecondary ;
777791 }
778792
@@ -817,18 +831,6 @@ struct LambdaTableProducer {
817831 }
818832 }
819833
820- // get information about secondary lambdas
821- if (bSecondaryLambdaFlag) {
822- auto lambdaMothers = mcpart.template mothers_as <aod::McParticles>();
823- if (std::abs (lambdaMothers[0 ].pdgCode ()) == kSigmaMinus || std::abs (lambdaMothers[0 ].pdgCode ()) == kSigma0 || std::abs (lambdaMothers[0 ].pdgCode ()) == kSigmaPlus ) {
824- histos.fill (HIST (" Tracks/h2f_lambda_from_sigma" ), mcpart.pdgCode (), mcpart.pt ());
825- } else if (std::abs (lambdaMothers[0 ].pdgCode ()) == kXiMinus || std::abs (lambdaMothers[0 ].pdgCode ()) == kXi0 ) {
826- histos.fill (HIST (" Tracks/h2f_lambda_from_cascade" ), mcpart.pdgCode (), mcpart.pt ());
827- } else if (std::abs (lambdaMothers[0 ].pdgCode ()) == kOmegaMinus ) {
828- histos.fill (HIST (" Tracks/h2f_lambda_from_omega" ), mcpart.pdgCode (), mcpart.pt ());
829- }
830- }
831-
832834 return true ;
833835 }
834836
@@ -893,6 +895,14 @@ struct LambdaTableProducer {
893895 return primFrac * effCorrFact;
894896 }
895897
898+ template <typename V, typename T>
899+ void fillLambdaMothers (V const & v0, T const &)
900+ {
901+ auto mcpart = v0.template mcParticle_as <aod::McParticles>();
902+ auto lambdaMothers = mcpart.template mothers_as <aod::McParticles>();
903+ histos.fill (HIST (" Tracks/h2f_lambda_mothers_pdg" ), lambdaMothers[0 ].pdgCode (), v0.pt ());
904+ }
905+
896906 template <ParticleType part, typename C, typename V, typename T>
897907 void fillLambdaQAHistos (C const & col, V const & v0, T const &)
898908 {
@@ -973,7 +983,7 @@ struct LambdaTableProducer {
973983 histos.fill (HIST (" Events/h1f_collision_posZ" ), collision.posZ ());
974984
975985 // Fill Collision Table
976- lambdaCollisionTable (cent, collision.posX (), collision.posY (), collision.posZ ());
986+ lambdaCollisionTable (cent, mult, collision.posX (), collision.posY (), collision.posZ ());
977987
978988 // initialize v0track objects
979989 ParticleType v0Type = kLambda ;
@@ -1005,9 +1015,11 @@ struct LambdaTableProducer {
10051015 // we have v0 as lambda
10061016 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kAllSelPassed );
10071017
1008- // Remove lambda with ambiguous daughters
1009- if (cRemoveAmbiguousTracks && hasAmbiguousDaughters (v0, tracks)) {
1010- continue ;
1018+ // Remove lambda with ambiguous daughters (Only for run3)
1019+ if constexpr (run == kRun3 ) {
1020+ if (cRemoveAmbiguousTracks && hasAmbiguousDaughters (v0, tracks)) {
1021+ continue ;
1022+ }
10111023 }
10121024
10131025 // Get Lambda mass and kinematic variables
@@ -1021,13 +1033,21 @@ struct LambdaTableProducer {
10211033 if constexpr (dmc == kMC ) {
10221034 histos.fill (HIST (" Tracks/h2f_tracks_pid_before_sel" ), v0.mcParticle ().pdgCode (), v0.pt ());
10231035
1024- if (cSelMCPSV0) { // Get Primary/Secondary Lambda
1036+ // Get Primary/Secondary Lambda
1037+ if (cSelMCPSV0) {
10251038 v0PrmScdType = isPrimaryV0 (v0);
10261039 }
1027- if (cSelectTrueLambda && !selTrueMcRecLambda (v0, tracks)) { // check for true Lambda/Anti-Lambda
1040+
1041+ // check for true Lambda/Anti-Lambda
1042+ if (cSelectTrueLambda && !selTrueMcRecLambda (v0, tracks)) {
10281043 continue ;
10291044 }
10301045
1046+ // get mothers information
1047+ if (v0PrmScdType == kSecondary ) {
1048+ fillLambdaMothers (v0, tracks);
1049+ }
1050+
10311051 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kPassTrueLambdaSel );
10321052 histos.fill (HIST (" Tracks/h2f_tracks_pid_after_sel" ), v0.mcParticle ().pdgCode (), v0.pt ());
10331053
@@ -1073,7 +1093,7 @@ struct LambdaTableProducer {
10731093 void fillLambdaMcGenTables (C const & mcCollision, M const & mcParticles)
10741094 {
10751095 // Fill McGen Collision Table
1076- lambdaMCGenCollisionTable (cent, mcCollision.posX (), mcCollision.posY (), mcCollision.posZ ());
1096+ lambdaMCGenCollisionTable (cent, mult, mcCollision.posX (), mcCollision.posY (), mcCollision.posZ ());
10771097
10781098 // initialize track objects
10791099 ParticleType v0Type = kLambda ;
@@ -1203,11 +1223,13 @@ struct LambdaTableProducer {
12031223 SliceCache cache;
12041224 Preslice<soa::Join<aod::V0Datas, aod::McV0Labels>> perCollision = aod::v0data::collisionId;
12051225
1206- using CollisionsRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>;
1207- using CollisionsRun2 = soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms>;
1226+ using CollisionsRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFV0As, aod::PVMults >;
1227+ using CollisionsRun2 = soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms, aod::PVMults >;
12081228 using Tracks = soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCPr, aod::TrackCompColls>;
1209- using McV0Tracks = soa::Join<aod::V0Datas , aod::McV0Labels >;
1229+ using TracksRun2 = soa::Join<aod::Tracks , aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCPr >;
12101230 using TracksMC = soa::Join<Tracks, aod::McTrackLabels>;
1231+ using TracksMCRun2 = soa::Join<TracksRun2, aod::McTrackLabels>;
1232+ using McV0Tracks = soa::Join<aod::V0Datas, aod::McV0Labels>;
12111233
12121234 void processDataRun3 (CollisionsRun3::iterator const & collision, aod::V0Datas const & V0s, Tracks const & tracks)
12131235 {
@@ -1216,7 +1238,7 @@ struct LambdaTableProducer {
12161238
12171239 PROCESS_SWITCH (LambdaTableProducer, processDataRun3, " Process for Run3 DATA" , true );
12181240
1219- void processDataRun2 (CollisionsRun2::iterator const & collision, aod::V0Datas const & V0s, Tracks const & tracks)
1241+ void processDataRun2 (CollisionsRun2::iterator const & collision, aod::V0Datas const & V0s, TracksRun2 const & tracks)
12201242 {
12211243 fillLambdaRecoTables<kRun2 , kData >(collision, V0s, tracks);
12221244 }
@@ -1236,7 +1258,7 @@ struct LambdaTableProducer {
12361258 PROCESS_SWITCH (LambdaTableProducer, processMCRecoRun3, " Process for Run3 McReco DATA" , false );
12371259
12381260 void processMCRecoRun2 (soa::Join<CollisionsRun2, aod::McCollisionLabels>::iterator const & collision, aod::McCollisions const &,
1239- McV0Tracks const & V0s, TracksMC const & tracks, aod::McParticles const &)
1261+ McV0Tracks const & V0s, TracksMCRun2 const & tracks, aod::McParticles const &)
12401262 {
12411263 // check collision
12421264 if (!selCollision<kRun2 >(collision)) {
@@ -1259,7 +1281,7 @@ struct LambdaTableProducer {
12591281
12601282 void processMCRun2 (aod::McCollisions::iterator const & mcCollision,
12611283 soa::SmallGroups<soa::Join<CollisionsRun2, aod::McCollisionLabels>> const & collisions,
1262- McV0Tracks const & V0s, TracksMC const & tracks,
1284+ McV0Tracks const & V0s, TracksMCRun2 const & tracks,
12631285 aod::McParticles const & mcParticles)
12641286 {
12651287 analyzeMcRecoGen<kRun2 , kMC >(mcCollision, collisions, V0s, tracks, mcParticles);
@@ -1483,6 +1505,7 @@ struct LambdaR2Correlation {
14831505 const AxisSpec axisCheck (1 , 0 , 1 , " " );
14841506 const AxisSpec axisPosZ (220 , -11 , 11 , " V_{z} (cm)" );
14851507 const AxisSpec axisCent (cMultBins, " FT0M (%)" );
1508+ const AxisSpec axisChMult (200 , 0 , 200 , " N_{ch}" );
14861509 const AxisSpec axisMult (10 , 0 , 10 , " N_{#Lambda}" );
14871510 const AxisSpec axisMass (100 , 1.06 , 1.16 , " M_{#Lambda} (GeV/#it{c}^{2})" );
14881511 const AxisSpec axisPt (cNPtBins, cMinPt, cMaxPt, " p_{T} (GeV/#it{c})" );
@@ -1496,8 +1519,9 @@ struct LambdaR2Correlation {
14961519 // Event
14971520 histos.add (" Event/Reco/h1f_collision_posz" , " V_{Z} Distribution" , kTH1F , {axisPosZ});
14981521 histos.add (" Event/Reco/h1f_ft0m_mult_percentile" , " FT0M (%)" , kTH1F , {axisCent});
1499- histos.add (" Event/Reco/h1i_lambda_mult" , " #Lambda - Multiplicity" , kTH1I , {axisMult});
1500- histos.add (" Event/Reco/h1i_antilambda_mult" , " #bar{#Lambda} - Multiplicity" , kTH1I , {axisMult});
1522+ histos.add (" Event/Reco/h2f_Mult_vs_Centrality" , " N_{TPC} vs FT0M(%)" , kTH2F , {axisCent, axisChMult});
1523+ histos.add (" Event/Reco/h2f_lambda_mult" , " #Lambda - Multiplicity" , kTH2F , {axisCent, axisMult});
1524+ histos.add (" Event/Reco/h2f_antilambda_mult" , " #bar{#Lambda} - Multiplicity" , kTH2F , {axisCent, axisMult});
15011525
15021526 // Efficiency Histograms
15031527 // Single Particle Efficiencies
@@ -1510,6 +1534,8 @@ struct LambdaR2Correlation {
15101534
15111535 // Single and Two Particle Densities
15121536 // 1D Histograms
1537+ histos.add (" Reco/Primary/h2f_n1_mass_LaP" , " #rho_{1}^{#Lambda}" , kTH2F , {axisCent, axisMass});
1538+ histos.add (" Reco/Primary/h2f_n1_mass_LaM" , " #rho_{1}^{#bar{#Lambda}}" , kTH2F , {axisCent, axisMass});
15131539 histos.add (" Reco/Primary/h2f_n1_pt_LaP" , " #rho_{1}^{#Lambda}" , kTH2F , {axisCent, axisPt});
15141540 histos.add (" Reco/Primary/h2f_n1_pt_LaM" , " #rho_{1}^{#bar{#Lambda}}" , kTH2F , {axisCent, axisPt});
15151541 histos.add (" Reco/Primary/h2f_n1_eta_LaP" , " #rho_{1}^{#Lambda}" , kTH2F , {axisCent, axisEta});
@@ -1622,6 +1648,7 @@ struct LambdaR2Correlation {
16221648 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (SubDirPrmScd[pst]) + HIST (" Efficiency/h3f_n1_centptrap_" ) + HIST (SubDirHist[part]), cent, track.pt (), track.rap ());
16231649
16241650 // QA Plots
1651+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (SubDirPrmScd[pst]) + HIST (" h2f_n1_mass_" ) + HIST (SubDirHist[part]), cent, track.mass ());
16251652 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (SubDirPrmScd[pst]) + HIST (" h2f_n1_pt_" ) + HIST (SubDirHist[part]), cent, track.pt (), track.corrFact ());
16261653 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (SubDirPrmScd[pst]) + HIST (" h2f_n1_eta_" ) + HIST (SubDirHist[part]), cent, track.eta (), track.corrFact ());
16271654 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (SubDirPrmScd[pst]) + HIST (" h2f_n1_phi_" ) + HIST (SubDirHist[part]), cent, track.phi (), track.corrFact ());
@@ -1637,9 +1664,9 @@ struct LambdaR2Correlation {
16371664 // fill multiplicity histograms
16381665 if (ntrk != 0 ) {
16391666 if (part == kLambda ) {
1640- histos.fill (HIST (" Event/" ) + HIST (SubDirRecGen[rec_gen]) + HIST (" h1i_lambda_mult " ) , ntrk);
1667+ histos.fill (HIST (" Event/" ) + HIST (SubDirRecGen[rec_gen]) + HIST (" h2f_lambda_mult " ), cent , ntrk);
16411668 } else {
1642- histos.fill (HIST (" Event/" ) + HIST (SubDirRecGen[rec_gen]) + HIST (" h1i_antilambda_mult " ) , ntrk);
1669+ histos.fill (HIST (" Event/" ) + HIST (SubDirRecGen[rec_gen]) + HIST (" h2f_antilambda_mult " ), cent , ntrk);
16431670 }
16441671 }
16451672 }
@@ -1671,6 +1698,7 @@ struct LambdaR2Correlation {
16711698 {
16721699 histos.fill (HIST (" Event/Reco/h1f_collision_posz" ), collision.posZ ());
16731700 histos.fill (HIST (" Event/Reco/h1f_ft0m_mult_percentile" ), collision.cent ());
1701+ histos.fill (HIST (" Event/Reco/h2f_Mult_vs_Centrality" ), collision.cent (), collision.mult ());
16741702
16751703 cent = collision.cent ();
16761704
@@ -1723,6 +1751,7 @@ struct LambdaR2Correlation {
17231751 {
17241752 histos.fill (HIST (" Event/McGen/h1f_collision_posz" ), mcgencol.posZ ());
17251753 histos.fill (HIST (" Event/McGen/h1f_ft0m_mult_percentile" ), mcgencol.cent ());
1754+ histos.fill (HIST (" Event/McGen/h2f_Mult_vs_Centrality" ), mcgencol.cent (), mcgencol.mult ());
17261755
17271756 cent = mcgencol.cent ();
17281757
0 commit comments