@@ -44,8 +44,10 @@ using namespace o2::constants::physics;
4444using std::array;
4545
4646using SelectedCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>;
47+ using SimCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::McCollisionLabels>;
4748
4849using FullTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TrackSelectionExtension, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
50+ using MCTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TrackSelectionExtension, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::McTrackLabels>;
4951
5052struct strangeness_in_jets {
5153
@@ -65,6 +67,14 @@ struct strangeness_in_jets {
6567 true ,
6668 true };
6769
70+ // MC Histograms
71+ HistogramRegistry registryMC{
72+ " registryMC" ,
73+ {},
74+ OutputObjHandlingPolicy::AnalysisObject,
75+ true ,
76+ true };
77+
6878 // Global Parameters
6979 Configurable<float > ptLeadingMin{" ptLeadingMin" , 5 .0f , " pt leading min" };
7080 Configurable<float > Rjet{" Rjet" , 0 .3f , " jet resolution parameter R" };
@@ -96,18 +106,16 @@ struct strangeness_in_jets {
96106 // V0 Parameters
97107 Configurable<float > yMin{" yMin" , -0 .5f , " minimum y" };
98108 Configurable<float > yMax{" yMax" , +0 .5f , " maximum y" };
99- Configurable<float > minimumV0Radius{" minimumV0Radius" , 0 .5f ,
100- " Minimum V0 Radius" };
101- Configurable<float > maximumV0Radius{" maximumV0Radius" , 40 .0f ,
102- " Maximum V0 Radius" };
109+ Configurable<float > minimumV0Radius{" minimumV0Radius" , 0 .5f , " Minimum V0 Radius" };
110+ Configurable<float > maximumV0Radius{" maximumV0Radius" , 40 .0f , " Maximum V0 Radius" };
103111 Configurable<float > v0cospaMin{" v0cospaMin" , 0 .99f , " Minimum V0 CosPA" };
104- Configurable<float > dcaV0DaughtersMax{" dcaV0DaughtersMax" , 0 .5f ,
105- " Maximum DCA Daughters" };
112+ Configurable<float > dcaV0DaughtersMax{" dcaV0DaughtersMax" , 0 .5f , " Maximum DCA Daughters" };
106113
107114 void init (InitContext const &)
108115 {
109116 // Global Properties and QC
110117 registryQC.add (" number_of_events_data" , " number of events in data" , HistType::kTH1F , {{15 , 0 , 15 , " Event Cuts" }});
118+ registryQC.add (" number_of_events_mc" , " number of events in mc" , HistType::kTH1F , {{15 , 0 , 15 , " Event Cuts" }});
111119
112120 // Multiplicity Binning
113121 std::vector<double > multBinning = {0 , 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 , 100 };
@@ -122,6 +130,14 @@ struct strangeness_in_jets {
122130 // Histograms (K0s)
123131 registryData.add (" K0s_in_jet" , " K0s_in_jet" , HistType::kTH3F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }, {200 , 0.44 , 0.56 , " m_{#pi#pi} (GeV/#it{c}^{2})" }});
124132 registryData.add (" K0s_in_ue" , " K0s_in_ue" , HistType::kTH3F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }, {200 , 0.44 , 0.56 , " m_{#pi#pi} (GeV/#it{c}^{2})" }});
133+
134+ // Histograms (MC)
135+ registryMC.add (" K0s_generated" , " K0s_generated" , HistType::kTH2F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }});
136+ registryMC.add (" Lambda_generated" , " Lambda_generated" , HistType::kTH2F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }});
137+ registryMC.add (" AntiLambda_generated" , " AntiLambda_generated" , HistType::kTH2F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }});
138+ registryMC.add (" K0s_reconstructed" , " K0s_reconstructed" , HistType::kTH2F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }});
139+ registryMC.add (" Lambda_reconstructed" , " Lambda_reconstructed" , HistType::kTH2F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }});
140+ registryMC.add (" AntiLambda_reconstructed" , " AntiLambda_reconstructed" , HistType::kTH2F , {multBinning, {100 , 0.0 , 10.0 , " #it{p}_{T} (GeV/#it{c})" }});
125141 }
126142
127143 template <typename T1>
@@ -475,7 +491,7 @@ struct strangeness_in_jets {
475491 int label_jet_particle (0 );
476492 int i_jet_particle (0 );
477493
478- for (int i = 0 ; i < particle_ID. size () ; i++) {
494+ for (int i = 0 ; i < nParticles ; i++) {
479495
480496 // Skip Leading Particle & Elements already associated to the Jet
481497 if (particle_ID[i] == leading_ID || particle_ID[i] == -1 )
@@ -613,6 +629,97 @@ struct strangeness_in_jets {
613629 }
614630 }
615631 PROCESS_SWITCH (strangeness_in_jets, processData, " Process data" , true );
632+
633+ Preslice<aod::V0Datas> perCollision = o2::aod::v0data::collisionId;
634+ Preslice<aod::McParticles> perMCCollision = o2::aod::mcparticle::mcCollisionId;
635+
636+ void processMCefficiency (SimCollisions const & collisions, MCTracks const & mcTracks, aod::V0Datas const & fullV0s, aod::McCollisions const & mcCollisions, const aod::McParticles& mcParticles)
637+ {
638+ for (const auto & collision : collisions) {
639+ registryQC.fill (HIST (" number_of_events_mc" ), 0.5 );
640+ if (!collision.sel8 ())
641+ continue ;
642+
643+ registryQC.fill (HIST (" number_of_events_mc" ), 1.5 );
644+ if (abs (collision.posZ ()) > 10.0 )
645+ continue ;
646+
647+ registryQC.fill (HIST (" number_of_events_mc" ), 2.5 );
648+ float multiplicity = collision.centFT0M ();
649+
650+ auto v0s_per_coll = fullV0s.sliceBy (perCollision, collision.globalIndex ());
651+ auto mcParticles_per_coll = mcParticles.sliceBy (perMCCollision, collision.globalIndex ());
652+
653+ for (auto & v0 : v0s_per_coll) {
654+
655+ const auto & pos = v0.posTrack_as <MCTracks>();
656+ const auto & neg = v0.negTrack_as <MCTracks>();
657+ if (!pos.passedTPCRefit ())
658+ continue ;
659+ if (!neg.passedTPCRefit ())
660+ continue ;
661+ if (!pos.has_mcParticle ())
662+ continue ;
663+ if (!neg.has_mcParticle ())
664+ continue ;
665+
666+ auto posParticle = pos.mcParticle_as <aod::McParticles>();
667+ auto negParticle = neg.mcParticle_as <aod::McParticles>();
668+ if (!posParticle.has_mothers ())
669+ continue ;
670+ if (!negParticle.has_mothers ())
671+ continue ;
672+
673+ int pdg_parent (0 );
674+ bool isPhysPrim = false ;
675+ for (auto & particleMotherOfNeg : negParticle.mothers_as <aod::McParticles>()) {
676+ for (auto & particleMotherOfPos : posParticle.mothers_as <aod::McParticles>()) {
677+ if (particleMotherOfNeg.globalIndex () == particleMotherOfPos.globalIndex ()) {
678+ pdg_parent = particleMotherOfNeg.pdgCode ();
679+ isPhysPrim = particleMotherOfNeg.isPhysicalPrimary ();
680+ }
681+ }
682+ }
683+ if (pdg_parent == 0 )
684+ continue ;
685+ if (!isPhysPrim)
686+ continue ;
687+
688+ // K0s
689+ if (passedK0ShortSelection (v0, pos, neg, collision) && pdg_parent == 310 ) {
690+ registryMC.fill (HIST (" K0s_reconstructed" ), multiplicity, v0.pt ());
691+ }
692+ if (passedLambdaSelection (v0, pos, neg, collision) && pdg_parent == 3122 ) {
693+ registryMC.fill (HIST (" Lambda_reconstructed" ), multiplicity, v0.pt ());
694+ }
695+ if (passedAntiLambdaSelection (v0, pos, neg, collision) && pdg_parent == -3122 ) {
696+ registryMC.fill (HIST (" AntiLambda_reconstructed" ), multiplicity, v0.pt ());
697+ }
698+ }
699+
700+ for (auto & mcParticle : mcParticles_per_coll) {
701+
702+ if (mcParticle.y () < yMin || mcParticle.y () > yMax)
703+ continue ;
704+ if (!mcParticle.isPhysicalPrimary ())
705+ continue ;
706+
707+ // K0s
708+ if (mcParticle.pdgCode () == 310 ) {
709+ registryMC.fill (HIST (" K0s_Generated" ), multiplicity, mcParticle.pt ());
710+ }
711+ // Lambda
712+ if (mcParticle.pdgCode () == 3122 ) {
713+ registryMC.fill (HIST (" Lambda_Generated" ), multiplicity, mcParticle.pt ());
714+ }
715+ // AntiLambda
716+ if (mcParticle.pdgCode () == -3122 ) {
717+ registryMC.fill (HIST (" AntiLambda_Generated" ), multiplicity, mcParticle.pt ());
718+ }
719+ }
720+ }
721+ }
722+ PROCESS_SWITCH (strangeness_in_jets, processMCefficiency, " Process MC Efficiency" , false );
616723};
617724
618725WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments