Skip to content

Commit d00904c

Browse files
authored
PWGMM: Adding MCRec and MCGen process functions (#6671)
1 parent 931ba71 commit d00904c

1 file changed

Lines changed: 235 additions & 40 deletions

File tree

PWGMM/UE/Tasks/lambdak0sflattenicity.cxx

Lines changed: 235 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ struct lambdak0sflattenicity {
110110

111111
// Histograms
112112
// Event selection
113-
rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}});
113+
rEventSelection.add("hVertexZ", "hVertexZ", {HistType::kTH1F, {vertexZAxis}});
114+
rEventSelection.add("hVertexZGen", "hVertexZGen", {HistType::kTH1F, {vertexZAxis}});
114115
rEventSelection.add("hEventsRejected", "hEventsRejected", {HistType::kTH1F, {{11, -0.5, 10.5}}});
115116
rEventSelection.add("hEventsSelected", "hEventsSelected", {HistType::kTH1F, {{11, -0.5, 10.5}}});
116117

@@ -128,6 +129,7 @@ struct lambdak0sflattenicity {
128129
rKzeroShort.add("hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}});
129130
rKzeroShort.add("hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}});
130131
rKzeroShort.add("hMassK0spT", "hMassK0spT", {HistType::kTH2F, {{K0sMassAxis}, {ptAxis}}});
132+
rKzeroShort.add("hPtK0ShortGen", "hPtK0ShortGen", {HistType::kTH1F, {ptAxis}});
131133

132134
// Lambda reconstruction
133135
// Mass
@@ -143,6 +145,7 @@ struct lambdak0sflattenicity {
143145
rLambda.add("hctauLambda", "hctauLambda", {HistType::kTH1F, {{40, 0.0f, 40.0f, "c#tau (cm)"}}});
144146
rLambda.add("h2DdecayRadiusLambda", "h2DdecayRadiusLambda", {HistType::kTH1F, {{100, 0.0f, 1.0f, "c#tau (cm)"}}});
145147
rLambda.add("hMassLambdapT", "hMassLambdapT", {HistType::kTH2F, {{LambdaMassAxis}, {ptAxis}}});
148+
rLambda.add("hPtLambdaGen", "hPtLambdaGen", {HistType::kTH1F, {ptAxis}});
146149

147150
// AntiLambda reconstruction
148151
// Mass
@@ -158,6 +161,7 @@ struct lambdak0sflattenicity {
158161
rAntiLambda.add("hctauAntiLambda", "hctauAntiLambda", {HistType::kTH1F, {{40, 0.0f, 40.0f, "c#tau (cm)"}}});
159162
rAntiLambda.add("h2DdecayRadiusAntiLambda", "h2DdecayRadiusAntiLambda", {HistType::kTH1F, {{100, 0.0f, 1.0f, "c#tau (cm)"}}});
160163
rAntiLambda.add("hMassAntiLambdapT", "hMassAntiLambdapT", {HistType::kTH2F, {{AntiLambdaMassAxis}, {ptAxis}}});
164+
rAntiLambda.add("hPtAntiLambdaGen", "hPtAntiLambdaGen", {HistType::kTH1F, {ptAxis}});
161165

162166
rFlattenicity.add("hEv", "Ev", HistType::kTH1F, {{6, -0.5, 5.5, "index activated detector"}});
163167
rFlattenicity.add("hFV0amplRing1to4", "FV01to4", HistType::kTH1F, {{4000, -0.5, +49999.5, "FV0 amplitude"}});
@@ -197,6 +201,16 @@ struct lambdak0sflattenicity {
197201
rFlattenicity.add("hAmpV0vsVtx", "", HistType::kTH2F, {{30, -15.0, +15.0, "Trk mult"}, {1000, -0.5, +39999.5, "FV0 amplitude"}});
198202
rFlattenicity.add("hAmpT0AvsVtx", "", HistType::kTH2F, {{30, -15.0, +15.0, "Vtx_z"}, {600, -0.5, +5999.5, "FT0A amplitude"}});
199203
rFlattenicity.add("hAmpT0CvsVtx", "", HistType::kTH2F, {{30, -15.0, +15.0, "Vtx_z"}, {600, -0.5, +5999.5, "FT0C amplitude"}});
204+
205+
if (doprocessDataRun3 && (doprocessRecMC || doprocessGenMC)) {
206+
LOGF(fatal, "Both Data and MC are both set to true; try again with only one of them set to true");
207+
}
208+
if (!doprocessDataRun3 && !(doprocessRecMC || doprocessGenMC)) {
209+
LOGF(fatal, "Both Data and MC set to false; try again with only one of them set to false");
210+
}
211+
if ((doprocessRecMC && !doprocessGenMC) || (!doprocessRecMC && doprocessGenMC)) {
212+
LOGF(fatal, "MCRec and MCGen are set to opposite switches, try again with both set to either true or false");
213+
}
200214
}
201215

202216
int getT0ASector(int i_ch)
@@ -400,72 +414,54 @@ struct lambdak0sflattenicity {
400414

401415
std::array<float, 8> estimator;
402416

403-
// Defining filters for events (event selection)
404-
// Processed events will be already fulfilling the event selection requirements
405-
Filter eventFilter = (o2::aod::evsel::sel8 == true);
406-
Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex);
407-
408-
// Filters on V0s
409-
// Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only
410-
Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv &&
411-
nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv &&
412-
aod::v0data::dcaV0daughters < v0setting_dcav0dau);
413-
414-
Filter trackFilter = (nabs(aod::track::eta) < cfgTrkEtaCut);
415-
using TrackCandidates = soa::Filtered<soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCPi, aod::pidTPCPr>>;
416-
417-
void process(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::BarrelMults>>::iterator const& collision,
418-
soa::Filtered<aod::V0Datas> const& V0s, TrackCandidates const& tracks, soa::Join<aod::BCs, aod::Timestamps> const& /*bcs*/,
419-
aod::MFTTracks const& /*mfttracks*/, aod::FT0s const& /*ft0s*/,
420-
aod::FV0As const& /*fv0s*/)
417+
template <typename TCollision>
418+
bool isEventSelected(TCollision const& collision)
421419
{
422-
// Fill the event counter
423-
auto vtxZ = collision.posZ();
424-
auto vtxY = collision.posY();
425-
auto vtxX = collision.posX();
426-
427420
rEventSelection.fill(HIST("hEventsSelected"), 0);
428421

429422
if (!collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
430423
rEventSelection.fill(HIST("hEventsRejected"), 0);
431-
return;
424+
return false;
432425
}
433426
rEventSelection.fill(HIST("hEventsSelected"), 1);
434427

435428
if (!collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
436429
rEventSelection.fill(HIST("hEventsRejected"), 1);
437-
return;
430+
return false;
438431
}
439432
rEventSelection.fill(HIST("hEventsSelected"), 2);
440433

441434
if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
442435
rEventSelection.fill(HIST("hEventsRejected"), 2);
443-
return;
436+
return false;
444437
}
445438
rEventSelection.fill(HIST("hEventsSelected"), 3);
446439

447440
if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
448441
rEventSelection.fill(HIST("hEventsRejected"), 3);
449-
return;
442+
return false;
450443
}
451444
rEventSelection.fill(HIST("hEventsSelected"), 4);
452445

453446
if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) {
454447
rEventSelection.fill(HIST("hEventsRejected"), 4);
455-
return;
448+
return false;
456449
}
457450
rEventSelection.fill(HIST("hEventsSelected"), 5);
458451

459452
if (collision.isInelGt0() == false) {
460453
rEventSelection.fill(HIST("hEventsRejected"), 5);
461-
return;
454+
return false;
462455
}
463456
rEventSelection.fill(HIST("hEventsSelected"), 6);
464457

465-
rEventSelection.fill(HIST("hVertexZRec"), vtxZ);
466-
467-
// ============== Flattenicity estimation begins =====================
458+
return true;
459+
}
468460

461+
// ============== Flattenicity estimation begins ===================== //
462+
template <typename TCollision, typename Tracks>
463+
void EstimateFlattenicity(TCollision const& collision, Tracks const& tracks)
464+
{
469465
const int nDetVtx = 3;
470466
TGraph* gVtx[nDetVtx];
471467
const char* nameDet[nDetVtx] = {"AmpV0", "AmpT0A", "AmpT0C"};
@@ -490,6 +486,7 @@ struct lambdak0sflattenicity {
490486
for (int i_d = 0; i_d < nDetVtx; ++i_d) {
491487
gVtx[i_d]->SetName(Form("g%s", nameDet[i_d]));
492488
}
489+
auto vtxZ = collision.posZ();
493490

494491
float sumAmpFV0 = 0;
495492
float sumAmpFV01to4Ch = 0;
@@ -531,6 +528,7 @@ struct lambdak0sflattenicity {
531528
RhoLattice[channelv0phi] = ampl_ch / 2.0; // two channels per bin
532529
}
533530
}
531+
534532
rFlattenicity.fill(HIST("hAmpV0vsVtxBeforeCalibration"), vtxZ, sumAmpFV0);
535533
if (applyCalibVtx) {
536534
sumAmpFV0 *= gVtx[0]->Eval(vtxZ);
@@ -595,6 +593,7 @@ struct lambdak0sflattenicity {
595593
}
596594
rFlattenicity.fill(HIST("hFT0C"), amplitude);
597595
}
596+
598597
rFlattenicity.fill(HIST("hAmpT0AvsVtxBeforeCalibration"), vtxZ, sumAmpFT0A);
599598
rFlattenicity.fill(HIST("hAmpT0CvsVtxBeforeCalibration"), vtxZ, sumAmpFT0C);
600599
if (applyCalibVtx) {
@@ -676,18 +675,30 @@ struct lambdak0sflattenicity {
676675
float flatenicity_ft0v0 = 0.5 * flattenicityfv0 + 0.5 * flatenicity_t0c;
677676
estimator[6] = 1.0 - flatenicity_ft0v0;
678677
estimator[7] = ptT;
679-
static_for<0, 7>([&](auto i) {
680-
constexpr int index = i.value;
681-
rFlattenicity.fill(HIST(nhEst[index]), estimator[index], estimator[0]); });
678+
679+
rFlattenicity.fill(HIST(nhEst[0]), estimator[0], estimator[0]);
680+
rFlattenicity.fill(HIST(nhEst[1]), estimator[1], estimator[0]);
681+
rFlattenicity.fill(HIST(nhEst[2]), estimator[2], estimator[0]);
682+
rFlattenicity.fill(HIST(nhEst[3]), estimator[3], estimator[0]);
683+
rFlattenicity.fill(HIST(nhEst[4]), estimator[4], estimator[0]);
684+
rFlattenicity.fill(HIST(nhEst[5]), estimator[5], estimator[0]);
685+
rFlattenicity.fill(HIST(nhEst[6]), estimator[6], estimator[0]);
686+
rFlattenicity.fill(HIST(nhEst[7]), estimator[7], estimator[0]);
687+
682688
// plot pt vs estimators
683689
for (auto& track : tracks) {
684690
if (!track.isGlobalTrack()) {
685691
continue;
686692
}
687693
float pt = track.pt();
688-
static_for<0, 7>([&](auto i) {
689-
constexpr int index = i.value;
690-
rFlattenicity.fill(HIST(nhPtEst[index]), estimator[index], pt); });
694+
rFlattenicity.fill(HIST(nhEst[0]), estimator[0], pt);
695+
rFlattenicity.fill(HIST(nhEst[1]), estimator[1], pt);
696+
rFlattenicity.fill(HIST(nhEst[2]), estimator[2], pt);
697+
rFlattenicity.fill(HIST(nhEst[3]), estimator[3], pt);
698+
rFlattenicity.fill(HIST(nhEst[4]), estimator[4], pt);
699+
rFlattenicity.fill(HIST(nhEst[5]), estimator[5], pt);
700+
rFlattenicity.fill(HIST(nhEst[6]), estimator[6], pt);
701+
rFlattenicity.fill(HIST(nhEst[7]), estimator[7], pt);
691702
}
692703

693704
for (int iCh = 0; iCh < 48; ++iCh) {
@@ -698,8 +709,39 @@ struct lambdak0sflattenicity {
698709
rFlattenicity.fill(HIST("fMultFv0"), sumAmpFV0);
699710
rFlattenicity.fill(HIST("hFlatFT0CvsFlatFT0A"), flatenicity_t0c, flatenicity_t0a);
700711
}
712+
}
713+
// ====================== Flattenicity estimation ends =====================
714+
715+
// Defining filters for events (event selection)
716+
// Processed events will be already fulfilling the event selection requirements
717+
Filter eventFilter = (o2::aod::evsel::sel8 == true);
718+
Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex);
701719

702-
// ====================== Flattenicity estimation ends =====================
720+
// Filters on V0s
721+
// Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only
722+
Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv &&
723+
nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv &&
724+
aod::v0data::dcaV0daughters < v0setting_dcav0dau);
725+
726+
Filter trackFilter = (nabs(aod::track::eta) < cfgTrkEtaCut);
727+
using TrackCandidates = soa::Filtered<soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCPi, aod::pidTPCPr>>;
728+
729+
void processDataRun3(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::BarrelMults>>::iterator const& collision,
730+
soa::Filtered<aod::V0Datas> const& V0s, TrackCandidates const& tracks, soa::Join<aod::BCs, aod::Timestamps> const& /*bcs*/,
731+
aod::MFTTracks const& /*mfttracks*/, aod::FT0s const& /*ft0s*/,
732+
aod::FV0As const& /*fv0s*/)
733+
{
734+
if (!(isEventSelected(collision))) { // Checking if the event passes the selection criteria
735+
return;
736+
}
737+
738+
auto vtxZ = collision.posZ();
739+
auto vtxY = collision.posY();
740+
auto vtxX = collision.posX();
741+
742+
EstimateFlattenicity(collision, tracks);
743+
744+
rEventSelection.fill(HIST("hVertexZ"), vtxZ);
703745

704746
for (const auto& v0 : V0s) {
705747
const auto& posDaughterTrack = v0.posTrack_as<TrackCandidates>();
@@ -783,6 +825,159 @@ struct lambdak0sflattenicity {
783825
}
784826
}
785827
}
828+
829+
using TrackCandidatesMC = soa::Filtered<soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCPi, aod::pidTPCPr, aod::McTrackLabels>>;
830+
void processRecMC(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::BarrelMults>>::iterator const& collision,
831+
soa::Filtered<soa::Join<aod::V0Datas, aod::McV0Labels>> const& V0s,
832+
TrackCandidatesMC const& tracks,
833+
soa::Join<aod::BCs, aod::Timestamps> const& /*bcs*/,
834+
aod::MFTTracks const& /*mfttracks*/, aod::FT0s const& /*ft0s*/,
835+
aod::FV0As const& /*fv0s*/, aod::McParticles const&)
836+
{
837+
if (!(isEventSelected(collision))) { // Checking if the event passes the selection criteria
838+
return;
839+
}
840+
841+
auto vtxZ = collision.posZ();
842+
auto vtxY = collision.posY();
843+
auto vtxX = collision.posX();
844+
845+
EstimateFlattenicity(collision, tracks);
846+
847+
rEventSelection.fill(HIST("hVertexZ"), vtxZ);
848+
849+
for (const auto& v0 : V0s) {
850+
851+
const auto& posDaughterTrack = v0.posTrack_as<TrackCandidatesMC>();
852+
const auto& negDaughterTrack = v0.negTrack_as<TrackCandidatesMC>();
853+
854+
if (!posDaughterTrack.has_mcParticle() || !negDaughterTrack.has_mcParticle()) {
855+
continue;
856+
}
857+
if (TMath::Abs(posDaughterTrack.eta()) > 0.8 || TMath::Abs(negDaughterTrack.eta()) > 0.8) {
858+
continue;
859+
}
860+
861+
auto mcnegtrack = negDaughterTrack.mcParticle_as<aod::McParticles>();
862+
auto mcpostrack = posDaughterTrack.mcParticle_as<aod::McParticles>();
863+
864+
float massK0s = v0.mK0Short();
865+
float massLambda = v0.mLambda();
866+
float massAntiLambda = v0.mAntiLambda();
867+
868+
rKzeroShort.fill(HIST("hMassK0s"), massK0s);
869+
rLambda.fill(HIST("hMassLambda"), massLambda);
870+
rAntiLambda.fill(HIST("hMassAntiLambda"), massAntiLambda);
871+
872+
float decayvtxX = v0.x();
873+
float decayvtxY = v0.y();
874+
float decayvtxZ = v0.z();
875+
876+
float decaylength = TMath::Sqrt(TMath::Power(decayvtxX - vtxX, 2) + TMath::Power(decayvtxY - vtxY, 2) + TMath::Power(decayvtxZ - vtxZ, 2));
877+
float v0p = TMath::Sqrt(v0.pt() * v0.pt() + v0.pz() * v0.pz());
878+
879+
float ctauK0s = decaylength * massK0s / v0p;
880+
float ctauLambda = decaylength * massLambda / v0p;
881+
float ctauAntiLambda = decaylength * massAntiLambda / v0p;
882+
883+
// Cut on dynamic columns for K0s
884+
885+
for (auto& particleMotherOfNeg : mcnegtrack.mothers_as<aod::McParticles>()) {
886+
for (auto& particleMotherOfPos : mcpostrack.mothers_as<aod::McParticles>()) {
887+
if (particleMotherOfNeg == particleMotherOfPos && (particleMotherOfNeg.pdgCode() == 3122 || particleMotherOfNeg.pdgCode() == -3122 || particleMotherOfNeg.pdgCode() == 310) && particleMotherOfNeg.isPhysicalPrimary()) {
888+
889+
if (particleMotherOfNeg.pdgCode() == 310 && v0.v0cosPA() >= v0setting_cospaK0s && v0.v0radius() >= v0setting_radiusK0s && TMath::Abs(posDaughterTrack.tpcNSigmaPi()) <= NSigmaTPCPion && TMath::Abs(negDaughterTrack.tpcNSigmaPi()) <= NSigmaTPCPion && ctauK0s < v0setting_ctauK0s && TMath::Abs(v0.rapidity(0)) <= 0.5 && TMath::Abs(massLambda - pdgmassLambda) > 0.005 && TMath::Abs(massAntiLambda - pdgmassLambda) > 0.005) {
890+
891+
rKzeroShort.fill(HIST("hMassK0sSelected"), massK0s);
892+
rKzeroShort.fill(HIST("hDCAV0DaughtersK0s"), v0.dcaV0daughters());
893+
rKzeroShort.fill(HIST("hV0CosPAK0s"), v0.v0cosPA());
894+
rKzeroShort.fill(HIST("hrapidityK0s"), v0.rapidity(0));
895+
rKzeroShort.fill(HIST("hctauK0s"), ctauK0s);
896+
rKzeroShort.fill(HIST("h2DdecayRadiusK0s"), v0.v0radius());
897+
rKzeroShort.fill(HIST("hMassK0spT"), massK0s, v0.pt());
898+
899+
// Filling the PID of the V0 daughters in the region of the K0s peak
900+
if (0.45 < massK0s && massK0s < 0.55) {
901+
rKzeroShort.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam());
902+
rKzeroShort.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam());
903+
}
904+
}
905+
906+
// Cut on dynamic columns for Lambda
907+
if (particleMotherOfNeg.pdgCode() == 3122 && v0.v0cosPA() >= v0setting_cospaLambda && v0.v0radius() >= v0setting_radiusLambda && TMath::Abs(posDaughterTrack.tpcNSigmaPr()) <= NSigmaTPCProton && TMath::Abs(negDaughterTrack.tpcNSigmaPi()) <= NSigmaTPCPion && ctauLambda < v0setting_ctauLambda && TMath::Abs(v0.rapidity(1)) <= 0.5 && TMath::Abs(massK0s - pdgmassK0s) > 0.01) {
908+
909+
rLambda.fill(HIST("hMassLambdaSelected"), massLambda);
910+
rLambda.fill(HIST("hDCAV0DaughtersLambda"), v0.dcaV0daughters());
911+
rLambda.fill(HIST("hV0CosPALambda"), v0.v0cosPA());
912+
rLambda.fill(HIST("hrapidityLambda"), v0.rapidity(1));
913+
rLambda.fill(HIST("hctauLambda"), ctauLambda);
914+
rLambda.fill(HIST("h2DdecayRadiusLambda"), v0.v0radius());
915+
rLambda.fill(HIST("hMassLambdapT"), massLambda, v0.pt());
916+
917+
// Filling the PID of the V0 daughters in the region of the Lambda peak
918+
if (1.015 < massLambda && massLambda < 1.215) {
919+
rLambda.fill(HIST("hNSigmaPosPionFromLambda"), posDaughterTrack.tpcNSigmaPr(), posDaughterTrack.tpcInnerParam());
920+
rLambda.fill(HIST("hNSigmaNegPionFromLambda"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam());
921+
}
922+
}
923+
924+
// Cut on dynamic columns for AntiLambda
925+
if (particleMotherOfNeg.pdgCode() == -3122 && v0.v0cosPA() >= v0setting_cospaLambda && v0.v0radius() >= v0setting_radiusLambda && TMath::Abs(posDaughterTrack.tpcNSigmaPi()) <= NSigmaTPCPion && TMath::Abs(negDaughterTrack.tpcNSigmaPr()) <= NSigmaTPCProton && ctauAntiLambda < v0setting_ctauLambda && TMath::Abs(v0.rapidity(2)) <= 0.5 && TMath::Abs(massK0s - pdgmassK0s) > 0.01) {
926+
927+
rAntiLambda.fill(HIST("hMassAntiLambdaSelected"), massAntiLambda);
928+
rAntiLambda.fill(HIST("hDCAV0DaughtersAntiLambda"), v0.dcaV0daughters());
929+
rAntiLambda.fill(HIST("hV0CosPAAntiLambda"), v0.v0cosPA());
930+
rAntiLambda.fill(HIST("hrapidityAntiLambda"), v0.rapidity(2));
931+
rAntiLambda.fill(HIST("hctauAntiLambda"), ctauAntiLambda);
932+
rAntiLambda.fill(HIST("h2DdecayRadiusAntiLambda"), v0.v0radius());
933+
rAntiLambda.fill(HIST("hMassAntiLambdapT"), massAntiLambda, v0.pt());
934+
935+
// Filling the PID of the V0 daughters in the region of the AntiLambda peak
936+
if (1.015 < massAntiLambda && massAntiLambda < 1.215) {
937+
rAntiLambda.fill(HIST("hNSigmaPosPionFromAntiLambda"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam());
938+
rAntiLambda.fill(HIST("hNSigmaNegPionFromAntiLambda"), negDaughterTrack.tpcNSigmaPr(), negDaughterTrack.tpcInnerParam());
939+
}
940+
}
941+
}
942+
}
943+
}
944+
}
945+
}
946+
947+
Filter posZFilterMC = (nabs(o2::aod::mccollision::posZ) < cutzvertex);
948+
void processGenMC(soa::Filtered<aod::McCollisions>::iterator const& mcCollision,
949+
const soa::SmallGroups<soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels>>& collisions,
950+
aod::McParticles const& mcParticles)
951+
{
952+
if (collisions.size() < 1) // to process generated collisions that've been reconstructed at least once
953+
{
954+
return;
955+
}
956+
957+
rEventSelection.fill(HIST("hVertexZGen"), mcCollision.posZ());
958+
959+
for (const auto& mcParticle : mcParticles) {
960+
961+
if (mcParticle.isPhysicalPrimary() && mcParticle.y() < 0.5) {
962+
963+
if (mcParticle.pdgCode() == 310) {
964+
rKzeroShort.fill(HIST("hPtK0ShortGen"), mcParticle.pt());
965+
}
966+
967+
if (mcParticle.pdgCode() == 3122) {
968+
rLambda.fill(HIST("hPtLambdaGen"), mcParticle.pt());
969+
}
970+
971+
if (mcParticle.pdgCode() == -3122) {
972+
rAntiLambda.fill(HIST("hPtAntiLambdaGen"), mcParticle.pt());
973+
}
974+
}
975+
}
976+
}
977+
978+
PROCESS_SWITCH(lambdak0sflattenicity, processDataRun3, "Process Run 3 Data", false);
979+
PROCESS_SWITCH(lambdak0sflattenicity, processRecMC, "Process Run 3 mc, reconstructed", true);
980+
PROCESS_SWITCH(lambdak0sflattenicity, processGenMC, "Process Run 3 mc, generated", true);
786981
};
787982

788983
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)