2121#include < Framework/HistogramSpec.h>
2222#include < TLorentzVector.h>
2323#include < TRandom.h>
24+ #include < fairlogger/Logger.h>
2425
2526#include " Common/DataModel/PIDResponse.h"
2627#include " Common/DataModel/Centrality.h"
@@ -42,6 +43,8 @@ struct lambdaAnalysis_pb {
4243 Preslice<aod::ResoTracks> perRCol = aod::resodaughter::resoCollisionId;
4344 Preslice<aod::Tracks> perCollision = aod::track::collisionId;
4445 // Configurables.
46+
47+ Configurable<int > ConfEvtOccupancyInTimeRange{" ConfEvtOccupancyInTimeRange" , -1 , " Evt sel: maximum track occupancy" };
4548 Configurable<int > nBinsPt{" nBinsPt" , 100 , " N bins in pT histogram" };
4649 Configurable<int > nBinsInvM{" nBinsInvM" , 120 , " N bins in InvMass histogram" };
4750 Configurable<int > lambda1520id{" lambda1520id" , 3124 , " pdg" };
@@ -138,7 +141,7 @@ struct lambdaAnalysis_pb {
138141 histos.add (" QAbefore/Kaon/h2d_ka_nsigma_tof_vs_tpc" , " n#sigma^{TPC} vs n#sigma^{TOF} Kaons" , kTH2F , {axisTPCNsigma, axisTOFNsigma});
139142
140143 // QA After
141- histos.add (" QAafter/Proton/hd_pr_pt" , " p_{T}-spectra Protons" , kTH1F , {axisPt_pid});
144+ histos.add (" QAafter/Proton/hd_pr_pt" , " p_{T}-spectra Protons" , kTH2F , {axisPt_pid, axisCent });
142145 histos.add (" QAafter/Proton/h2d_pr_dca_z" , " dca_{z} Protons" , kTH2F , {axisPt_pid, axisDCAz});
143146 histos.add (" QAafter/Proton/h2d_pr_dca_xy" , " dca_{xy} Protons" , kTH2F , {axisPt_pid, axisDCAxy});
144147 histos.add (" QAafter/Proton/h2d_pr_dEdx_p" , " TPC Signal Protons" , kTH2F , {axisP_pid, axisdEdx});
@@ -153,7 +156,7 @@ struct lambdaAnalysis_pb {
153156 histos.add (" QAafter/Proton/h2d_Prka_nsigma_tof_p" , " Protons kaon" , kTH2F , {axisP_pid, axisTOFNsigma});
154157 histos.add (" QAafter/Proton/h2d_Prel_nsigma_tof_p" , " Protons electron" , kTH2F , {axisP_pid, axisTOFNsigma});
155158 histos.add (" QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc" , " n#sigma(TOF) vs n#sigma(TPC) Protons" , kTH2F , {axisTPCNsigma, axisTOFNsigma});
156- histos.add (" QAafter/Kaon/hd_ka_pt" , " p_{T}-spectra Kaons" , kTH1F , {axisPt_pid});
159+ histos.add (" QAafter/Kaon/hd_ka_pt" , " p_{T}-spectra Kaons" , kTH2F , {axisPt_pid, axisCent });
157160 histos.add (" QAafter/Kaon/h2d_ka_dca_z" , " dca_{z} Kaons" , kTH2F , {axisPt_pid, axisDCAz});
158161 histos.add (" QAafter/Kaon/h2d_ka_dca_xy" , " dca_{xy} Kaons" , kTH2F , {axisPt_pid, axisDCAxy});
159162 histos.add (" QAafter/Kaon/h2d_ka_dEdx_p" , " TPC Signal Kaon" , kTH2F , {axisP_pid, axisdEdx});
@@ -427,7 +430,7 @@ struct lambdaAnalysis_pb {
427430 auto _tpcnsigmaPr = trkPr.tpcNSigmaPr ();
428431
429432 // Proton
430- histos.fill (HIST (" QAafter/Proton/hd_pr_pt" ), _ptPr);
433+ histos.fill (HIST (" QAafter/Proton/hd_pr_pt" ), _ptPr, mult );
431434 histos.fill (HIST (" QAafter/Proton/h2d_pr_dca_z" ), _ptPr, trkPr.dcaZ ());
432435 histos.fill (HIST (" QAafter/Proton/h2d_pr_dca_xy" ), _ptPr, trkPr.dcaXY ());
433436 histos.fill (HIST (" QAafter/Proton/h2d_pr_dEdx_p" ), p_ptot, trkPr.tpcSignal ());
@@ -449,7 +452,7 @@ struct lambdaAnalysis_pb {
449452 auto _tpcnsigmaKa = trkKa.tpcNSigmaKa ();
450453
451454 // Kaon
452- histos.fill (HIST (" QAafter/Kaon/hd_ka_pt" ), _ptKa);
455+ histos.fill (HIST (" QAafter/Kaon/hd_ka_pt" ), _ptKa, mult );
453456 histos.fill (HIST (" QAafter/Kaon/h2d_ka_dca_z" ), _ptKa, trkKa.dcaZ ());
454457 histos.fill (HIST (" QAafter/Kaon/h2d_ka_dca_xy" ), _ptKa, trkKa.dcaXY ());
455458 histos.fill (HIST (" QAafter/Kaon/h2d_ka_dEdx_p" ), k_ptot, trkKa.tpcSignal ());
@@ -558,6 +561,8 @@ struct lambdaAnalysis_pb {
558561 {
559562
560563 // LOGF(info, " collisions: Index = %d %d", collision.globalIndex(),tracks.size());
564+ if (ConfEvtOccupancyInTimeRange > 0 && collision.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange)
565+ return ;
561566 histos.fill (HIST (" Event/h1d_ft0_mult_percentile" ), collision.cent ());
562567 fillDataHistos<false , false >(tracks, tracks, collision.cent ());
563568 }
@@ -597,7 +602,6 @@ struct lambdaAnalysis_pb {
597602 }
598603
599604 for (auto const & part : resoParents) {
600-
601605 if (abs (part.pdgCode ()) != lambda1520id) // // L* pdg_code = 3124
602606 continue ;
603607 if (abs (part.y ()) > 0.5 ) { // rapidity cut
@@ -616,7 +620,10 @@ struct lambdaAnalysis_pb {
616620
617621 if (!pass1 || !pass2) // If we have both decay products
618622 continue ;
619- auto mass = 1.520 ; // part.M()
623+
624+ TLorentzVector p4;
625+ p4.SetPxPyPzE (part.px (), part.py (), part.pz (), part.e ());
626+ auto mass = p4.M ();
620627 if (part.pdgCode () > 0 )
621628 histos.fill (HIST (" Analysis/h3d_gen_lstar_PM" ), mass, part.pt (), mult);
622629 else
@@ -637,7 +644,8 @@ struct lambdaAnalysis_pb {
637644
638645 SameKindPair<resoCols, resoTracks, BinningType2> pairs{binningPositions2, cNumMixEv, -1 , collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
639646 for (auto & [c1, t1, c2, t2] : pairs) {
640-
647+ if (ConfEvtOccupancyInTimeRange > 0 && c1.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange && c2.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange)
648+ return ;
641649 // LOGF(info, "processMCMixedDerived: Mixed collisions : %d (%.3f, %.3f,%d), %d (%.3f, %.3f,%d)",c1.globalIndex(), c1.posZ(), c1.cent(),c1.mult(), c2.globalIndex(), c2.posZ(), c2.cent(),c2.mult());
642650 histos.fill (HIST (" Event/mixing_vzVsmultpercentile" ), c1.cent (), c1.posZ (), c1.evtPl ());
643651 fillDataHistos<true , false >(t1, t2, c1.cent ());
@@ -656,7 +664,8 @@ struct lambdaAnalysis_pb {
656664
657665 if (doprocessData)
658666 LOG (error) << " Disable processData() first!" ;
659-
667+ if (ConfEvtOccupancyInTimeRange > 0 && collision.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange)
668+ return ;
660669 // LOGF(info, "inside df collisions: Index = %d %d", collision.globalIndex(),tracks.size());
661670 histos.fill (HIST (" Event/h1d_ft0_mult_percentile" ), collision.cent ());
662671 fillDataHistos<false , false >(tracks, tracks, collision.cent ());
@@ -676,6 +685,8 @@ struct lambdaAnalysis_pb {
676685
677686 SameKindPair<resoColDFs, resoTrackDFs, BinningTypeDF> pairs{binningPositions2, cNumMixEv, -1 , collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
678687 for (auto & [c1, t1, c2, t2] : pairs) {
688+ if (ConfEvtOccupancyInTimeRange > 0 && c1.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange && c2.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange)
689+ return ;
679690
680691 // LOGF(info, "processMCMixedDerived: Mixed collisions : %d (%.3f, %.3f,%d), %d (%.3f, %.3f,%d)",c1.globalIndex(), c1.posZ(), c1.cent(),c1.mult(), c2.globalIndex(), c2.posZ(), c2.cent(),c2.mult());
681692 histos.fill (HIST (" Event/mixing_vzVsmultpercentile" ), c1.cent (), c1.posZ (), c1.evtPl ());
@@ -691,13 +702,13 @@ struct lambdaAnalysis_pb {
691702 if (doprocessMix || doprocessMixDF)
692703 LOG (fatal) << " Disable processMix() or processMixDF() first!" ;
693704 LOGF (debug, " Event Mixing Started" );
694-
695705 BinningTypeEP binningPositions2{{cMixVtxBins, cMixMultBins, cMixEPAngle}, true };
696706 auto tracksTuple = std::make_tuple (tracks);
697707
698708 SameKindPair<resoColDFs, resoTrackDFs, BinningTypeEP> pairs{binningPositions2, cNumMixEv, -1 , collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
699709 for (auto & [c1, t1, c2, t2] : pairs) {
700-
710+ if (ConfEvtOccupancyInTimeRange > 0 && c1.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange && c2.trackOccupancyInTimeRange () > ConfEvtOccupancyInTimeRange)
711+ return ;
701712 // LOGF(info, "processMCMixedDerived: Mixed collisions : %d (%.3f, %.3f,%.3f), %d (%.3f, %.3f, %.3f)",c1.globalIndex(), c1.posZ(), c1.cent(),c1.evtPl(), c2.globalIndex(), c2.posZ(), c2.cent(),c2.evtPl());
702713 histos.fill (HIST (" Event/mixing_vzVsmultpercentile" ), c1.cent (), c1.posZ (), c1.evtPl ());
703714 fillDataHistos<true , false >(t1, t2, c1.cent ());
0 commit comments