@@ -60,6 +60,8 @@ struct lambdaspincorrelation {
6060
6161 Produces<aod::LambdaEvents> lambdaEvent;
6262 Produces<aod::LambdaPairs> lambdaPair;
63+ Produces<aod::LambdaEventmcs> lambdaEventmc;
64+ Produces<aod::LambdaPairmcs> lambdaPairmc;
6365
6466 Service<o2::ccdb::BasicCCDBManager> ccdb;
6567
@@ -340,7 +342,105 @@ struct lambdaspincorrelation {
340342 }
341343 }
342344 }
343- PROCESS_SWITCH (lambdaspincorrelation, processData, " Process data" , true );
345+ PROCESS_SWITCH (lambdaspincorrelation, processData, " Process data" , false );
346+
347+ void processMc (EventCandidates::iterator const & collision, AllTrackCandidates const &, ResoV0s const & V0s)
348+ {
349+ std::vector<ROOT::Math::PxPyPzMVector> lambdaMother, protonDaughter, pionDaughter;
350+ std::vector<int > v0Status = {};
351+ std::vector<bool > doubleStatus = {};
352+ std::vector<float > v0Cospa = {};
353+ std::vector<float > v0Radius = {};
354+ std::vector<float > dcaPositive = {};
355+ std::vector<float > dcaNegative = {};
356+ std::vector<int > positiveIndex = {};
357+ std::vector<int > negativeIndex = {};
358+ std::vector<float > dcaBetweenDaughter = {};
359+ int numbV0 = 0 ;
360+ // LOGF(info, "event collisions: (%d)", collision.index());
361+ auto centrality = collision.centFT0C ();
362+ auto vz = collision.posZ ();
363+ int occupancy = collision.trackOccupancyInTimeRange ();
364+ histos.fill (HIST (" hEvtSelInfo" ), 0.5 );
365+ if ((rctCut.requireRCTFlagChecker && rctChecker (collision)) && collision.selection_bit (aod::evsel::kNoSameBunchPileup ) && collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ) && collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard ) && collision.sel8 () && collision.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll ) && occupancy < cfgCutOccupancy) {
366+ histos.fill (HIST (" hEvtSelInfo" ), 1.5 );
367+ for (const auto & v0 : V0s) {
368+ // LOGF(info, "v0 index 0 : (%d)", v0.index());
369+ auto [lambdaTag, aLambdaTag, isValid] = getLambdaTags (v0, collision);
370+ if (isValid) {
371+ // LOGF(info, "v0 index 1 : (%d)", v0.index());
372+ if (lambdaTag) {
373+ histos.fill (HIST (" hV0Info" ), 0.5 );
374+ }
375+ if (aLambdaTag) {
376+ histos.fill (HIST (" hV0Info" ), 1.5 );
377+ }
378+ if (lambdaTag && aLambdaTag) {
379+ doubleStatus.push_back (true );
380+ if (std::abs (v0.mLambda () - 1.1154 ) < std::abs (v0.mAntiLambda () - 1.1154 )) {
381+ lambdaTag = true ;
382+ aLambdaTag = false ;
383+ } else {
384+ lambdaTag = false ;
385+ aLambdaTag = true ;
386+ }
387+ } else {
388+ doubleStatus.push_back (false );
389+ }
390+ if (lambdaTag) {
391+ histos.fill (HIST (" hV0Info" ), 2.5 );
392+ }
393+ if (aLambdaTag) {
394+ histos.fill (HIST (" hV0Info" ), 3.5 );
395+ }
396+ // LOGF(info, "v0 index2: (%d)", v0.index());
397+ auto postrack1 = v0.template posTrack_as <AllTrackCandidates>();
398+ auto negtrack1 = v0.template negTrack_as <AllTrackCandidates>();
399+ positiveIndex.push_back (postrack1.globalIndex ());
400+ negativeIndex.push_back (negtrack1.globalIndex ());
401+ v0Cospa.push_back (v0.v0cosPA ());
402+ v0Radius.push_back (v0.v0radius ());
403+ dcaPositive.push_back (std::abs (v0.dcapostopv ()));
404+ dcaNegative.push_back (std::abs (v0.dcanegtopv ()));
405+ dcaBetweenDaughter.push_back (std::abs (v0.dcaV0daughters ()));
406+ if (lambdaTag) {
407+ v0Status.push_back (0 );
408+ proton = ROOT::Math::PxPyPzMVector (v0.pxpos (), v0.pypos (), v0.pzpos (), o2::constants::physics::MassProton);
409+ antiPion = ROOT::Math::PxPyPzMVector (v0.pxneg (), v0.pyneg (), v0.pzneg (), o2::constants::physics::MassPionCharged);
410+ lambda = proton + antiPion;
411+ lambdaMother.push_back (lambda);
412+ protonDaughter.push_back (proton);
413+ pionDaughter.push_back (antiPion);
414+ histos.fill (HIST (" hLambdaMass" ), lambda.M ());
415+ } else if (aLambdaTag) {
416+ v0Status.push_back (1 );
417+ antiProton = ROOT::Math::PxPyPzMVector (v0.pxneg (), v0.pyneg (), v0.pzneg (), o2::constants::physics::MassProton);
418+ pion = ROOT::Math::PxPyPzMVector (v0.pxpos (), v0.pypos (), v0.pzpos (), o2::constants::physics::MassPionCharged);
419+ antiLambda = antiProton + pion;
420+ lambdaMother.push_back (antiLambda);
421+ protonDaughter.push_back (antiProton);
422+ pionDaughter.push_back (pion);
423+ histos.fill (HIST (" hLambdaMass" ), lambda.M ());
424+ }
425+ numbV0 = numbV0 + 1 ;
426+ }
427+ }
428+ if (numbV0 > 1 && v0Cospa.size () > 1 ) {
429+ histos.fill (HIST (" hEvtSelInfo" ), 2.5 );
430+ lambdaEventmc (centrality, vz);
431+ auto indexEvent = lambdaEventmc.lastIndex ();
432+ // // Fill track table for V0//////////////////
433+ for (auto if1 = lambdaMother.begin (); if1 != lambdaMother.end (); ++if1) {
434+ auto i5 = std::distance (lambdaMother.begin (), if1);
435+ lambdaDummy = lambdaMother.at (i5);
436+ protonDummy = protonDaughter.at (i5);
437+ pionDummy = pionDaughter.at (i5);
438+ lambdaPairmc (indexEvent, v0Status.at (i5), doubleStatus.at (i5), v0Cospa.at (i5), v0Radius.at (i5), dcaPositive.at (i5), dcaNegative.at (i5), dcaBetweenDaughter.at (i5), lambdaDummy.Pt (), lambdaDummy.Eta (), lambdaDummy.Phi (), lambdaDummy.M (), protonDummy.Pt (), protonDummy.Eta (), protonDummy.Phi (), positiveIndex.at (i5), negativeIndex.at (i5));
439+ }
440+ }
441+ }
442+ }
443+ PROCESS_SWITCH (lambdaspincorrelation, processMc, " Process montecarlo" , true );
344444};
345445WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
346446{
0 commit comments