2525#include < cmath>
2626#include < array>
2727#include < cstdlib>
28+ #include < vector>
2829
2930#include " TRandom3.h"
3031#include " Math/Vector3D.h"
@@ -76,8 +77,6 @@ struct highmasslambda {
7677 // fill output
7778 Configurable<bool > useSP{" useSP" , false , " useSP" };
7879 Configurable<bool > useSignDCAV0{" useSignDCAV0" , true , " useSignDCAV0" };
79- Configurable<bool > additionalEvSel{" additionalEvSel" , true , " additionalEvSel" };
80- Configurable<bool > additionalEvSel2{" additionalEvSel2" , false , " additionalEvSel2" };
8180 Configurable<bool > fillDefault{" fillDefault" , false , " fill Occupancy" };
8281 Configurable<int > cfgOccupancyCut{" cfgOccupancyCut" , 2500 , " Occupancy cut" };
8382 Configurable<bool > fillDecayLength{" fillDecayLength" , true , " fill decay length" };
@@ -88,6 +87,8 @@ struct highmasslambda {
8887 Configurable<float > cfgCutCentralityMax{" cfgCutCentralityMax" , 50 .0f , " Accepted maximum Centrality" };
8988 Configurable<float > cfgCutCentralityMin{" cfgCutCentralityMin" , 30 .0f , " Accepted minimum Centrality" };
9089 // proton track cut
90+ Configurable<bool > rejectPID{" reject PID" , true , " pion, kaon, electron rejection" };
91+ Configurable<float > cfgCutTOFBeta{" cfgCutTOFBeta" , 0.0 , " cut TOF beta" };
9192 Configurable<bool > ispTdifferentialDCA{" ispTdifferentialDCA" , true , " is pT differential DCA" };
9293 Configurable<bool > isPVContributor{" isPVContributor" , true , " is PV contributor" };
9394 Configurable<float > confMinRot{" confMinRot" , 5.0 * TMath::Pi () / 6.0 , " Minimum of rotation" };
@@ -109,7 +110,7 @@ struct highmasslambda {
109110 Configurable<int > cfgTPCcluster{" cfgTPCcluster" , 70 , " Number of TPC cluster" };
110111 Configurable<int > PIDstrategy{" PIDstrategy" , 0 , " 0: TOF Veto, 1: TOF Veto opti, 2: TOF, 3: TOF loose 1, 4: TOF loose 2, 5: old pt dep" };
111112 Configurable<float > nsigmaCutTPC{" nsigmacutTPC" , 3.0 , " Value of the TPC Nsigma cut" };
112- Configurable<float > nsigmaCutCombined{ " nsigmaCutCombined " , 3.0 , " TPC TOF combined PID" };
113+ Configurable<float > nsigmaCutTOF{ " nsigmaCutTOF " , 3.0 , " TOF PID" };
113114 Configurable<float > nsigmaCutTPCPre{" nsigmacutTPCPre" , 3.0 , " Value of the TPC Nsigma cut Pre filter" };
114115 Configurable<float > kaonrejpar{" kaonrejpar" , 1.0 , " Kaon rej. par" };
115116 // Configs for V0
@@ -156,7 +157,7 @@ struct highmasslambda {
156157 Filter pidFilter = nabs(aod::pidtpc::tpcNSigmaPr) < nsigmaCutTPCPre;
157158
158159 using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::FV0Mults, aod::TPCMults, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::EPCalibrationTables, aod::Mults>>;
159- using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullEl, aod::pidTOFFullEl>>;
160+ using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPr, aod::pidTOFbeta, aod:: pidTOFFullPr, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullEl, aod::pidTOFFullEl>>;
160161 using AllTrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi>;
161162 using ResoV0s = aod::V0Datas;
162163
@@ -227,7 +228,7 @@ struct highmasslambda {
227228 histos.add (" hNsigmaProtonPionTPC_afterKa" , " NsigmaProton-Pion TPC distribution" , kTH3F , {{60 , -3 .0f , 3 .0f }, {200 , -10 .0f , 10 .0f }, {60 , 0 .0f , 6 .0f }});
228229 histos.add (" hNsigmaProtonKaonTPC_afterKa" , " NsigmaProton-Kaon TPC distribution" , kTH3F , {{60 , -3 .0f , 3 .0f }, {200 , -10 .0f , 10 .0f }, {60 , 0 .0f , 6 .0f }});
229230
230- histos.add (" hNsigmaProtonTPC" , " NsigmaProton TPC distribution" , kTH2F , {{100 , -5 .0f , 5 .0f }, {60 , 0 .0f , 6 .0f }});
231+ histos.add (" hNsigmaProtonTPC" , " NsigmaProton TPC distribution" , kTH3F , {{100 , -5 .0f , 5 .0f }, {60 , 0 .0f , 6 .0f }, occupancyBinning });
231232 histos.add (" hNsigmaProtonTOF" , " NsigmaProton TOF distribution" , kTH2F , {{1000 , -50 .0f , 50 .0f }, {60 , 0 .0f , 6 .0f }});
232233 histos.add (" hNsigmaProtonTOFPre" , " NsigmaProton TOF distribution Pre sel" , kTH2F , {{1000 , -50 .0f , 50 .0f }, {60 , 0 .0f , 6 .0f }});
233234 histos.add (" hMassvsDecaySum" , " hMassvsDecaySum" , kTH2F , {thnAxisInvMass, thnAxisDCASum});
@@ -394,23 +395,17 @@ struct highmasslambda {
394395 template <typename T>
395396 bool selectionPID1 (const T& candidate)
396397 {
397- if (candidate.tpcInnerParam () < 0.7 && TMath::Abs ( candidate.tpcNSigmaPr ()) < 3.0 ) {
398+ if (candidate.tpcInnerParam () < 0.9 && candidate.tpcNSigmaPr () > - 2.0 && candidate. tpcNSigmaPr () < nsigmaCutTPC ) {
398399 return true ;
399400 }
400- if (candidate.tpcInnerParam () >= 0.7 ) {
401- // printf("I am here: %.3f\n", candidate.tpcInnerParam());
401+ if (candidate.tpcInnerParam () >= 0.9 ) {
402402 if (candidate.hasTOF ()) {
403- auto combinedPID = TMath::Sqrt (candidate.tpcNSigmaPr () * candidate.tpcNSigmaPr () + candidate.tofNSigmaPr () * candidate.tofNSigmaPr ()) / TMath::Sqrt (2.0 );
404- // printf("combine PIDA: %.3f\n", combinedPID);
405- if (combinedPID < nsigmaCutCombined) {
403+ if (candidate.beta () > cfgCutTOFBeta && candidate.tpcNSigmaPr () > -2.0 && candidate.tpcNSigmaPr () < nsigmaCutTPC && TMath::Abs (candidate.tofNSigmaPr ()) < nsigmaCutTOF) {
406404 return true ;
407405 }
408406 }
409407 if (!candidate.hasTOF ()) {
410- if (candidate.tpcInnerParam () < 1.5 && TMath::Abs (candidate.tpcNSigmaPr ()) < 3.0 ) {
411- return true ;
412- }
413- if (candidate.tpcInnerParam () >= 1.5 && candidate.tpcNSigmaPr () > -2.0 && candidate.tpcNSigmaPr () < 2.0 ) {
408+ if (candidate.tpcNSigmaPr () > -2.0 && candidate.tpcNSigmaPr () < nsigmaCutTPC) {
414409 return true ;
415410 }
416411 }
@@ -422,16 +417,11 @@ struct highmasslambda {
422417 template <typename T>
423418 bool selectionPID2 (const T& candidate)
424419 {
425- if (candidate.tpcInnerParam () < 0.7 && TMath::Abs ( candidate.tpcNSigmaPr ()) < 3.0 ) {
420+ if (candidate.tpcInnerParam () < 0.9 && candidate.tpcNSigmaPr () > - 2.0 && candidate. tpcNSigmaPr () < nsigmaCutTPC ) {
426421 return true ;
427422 }
428- if (candidate.tpcInnerParam () >= 0.7 ) {
429- if (candidate.hasTOF ()) {
430- auto combinedPID = TMath::Sqrt (candidate.tpcNSigmaPr () * candidate.tpcNSigmaPr () + candidate.tofNSigmaPr () * candidate.tofNSigmaPr ()) / TMath::Sqrt (2.0 );
431- if (combinedPID < nsigmaCutCombined) {
432- return true ;
433- }
434- }
423+ if (candidate.tpcInnerParam () >= 0.9 && candidate.beta () > cfgCutTOFBeta && candidate.tpcNSigmaPr () > -2.0 && candidate.tpcNSigmaPr () < nsigmaCutTPC && TMath::Abs (candidate.tofNSigmaPr ()) < nsigmaCutTOF) {
424+ return true ;
435425 }
436426 return false ;
437427 }
@@ -440,18 +430,17 @@ struct highmasslambda {
440430 template <typename T>
441431 bool selectionPID3 (const T& candidate)
442432 {
443- if (candidate.tpcInnerParam () < 0.7 && TMath::Abs ( candidate.tpcNSigmaPr ()) < 3.0 ) {
433+ if (candidate.tpcInnerParam () < 0.9 && candidate.tpcNSigmaPr () > - 2.0 && candidate. tpcNSigmaPr () < nsigmaCutTPC ) {
444434 return true ;
445435 }
446- if (candidate.tpcInnerParam () >= 0.7 ) {
436+ if (candidate.tpcInnerParam () >= 0.9 ) {
447437 if (candidate.hasTOF ()) {
448- auto combinedPID = TMath::Sqrt (candidate.tpcNSigmaPr () * candidate.tpcNSigmaPr () + candidate.tofNSigmaPr () * candidate.tofNSigmaPr ()) / TMath::Sqrt (2.0 );
449- if (combinedPID < nsigmaCutCombined) {
438+ if (candidate.beta () > cfgCutTOFBeta && candidate.tpcNSigmaPr () > -2.0 && candidate.tpcNSigmaPr () < nsigmaCutTPC && TMath::Abs (candidate.tofNSigmaPr ()) < nsigmaCutTOF) {
450439 return true ;
451440 }
452441 }
453442 if (!candidate.hasTOF ()) {
454- if (candidate.tpcInnerParam () < 1.5 && TMath::Abs ( candidate.tpcNSigmaPr ()) < 3.0 ) {
443+ if (candidate.tpcInnerParam () < 1.5 && candidate.tpcNSigmaPr () > - 2.0 && candidate. tpcNSigmaPr () < nsigmaCutTPC ) {
455444 return true ;
456445 }
457446 }
@@ -463,21 +452,17 @@ struct highmasslambda {
463452 template <typename T>
464453 bool selectionPID4 (const T& candidate)
465454 {
466- if (candidate.tpcInnerParam () < 0.7 && TMath::Abs ( candidate.tpcNSigmaPr ()) < 3.0 ) {
455+ if (candidate.tpcInnerParam () < 0.9 && candidate.tpcNSigmaPr () > - 2.0 && candidate. tpcNSigmaPr () < nsigmaCutTPC ) {
467456 return true ;
468457 }
469- if (candidate.tpcInnerParam () >= 0.7 ) {
458+ if (candidate.tpcInnerParam () >= 0.9 ) {
470459 if (candidate.hasTOF ()) {
471- auto combinedPID = TMath::Sqrt (candidate.tpcNSigmaPr () * candidate.tpcNSigmaPr () + candidate.tofNSigmaPr () * candidate.tofNSigmaPr ()) / TMath::Sqrt (2.0 );
472- if (combinedPID < nsigmaCutCombined) {
460+ if (candidate.beta () > cfgCutTOFBeta && candidate.tpcNSigmaPr () > -2.0 && candidate.tpcNSigmaPr () < nsigmaCutTPC && TMath::Abs (candidate.tofNSigmaPr ()) < nsigmaCutTOF) {
473461 return true ;
474462 }
475463 }
476464 if (!candidate.hasTOF ()) {
477- if (candidate.tpcInnerParam () < 1.5 && TMath::Abs (candidate.tpcNSigmaPr ()) < 3.0 ) {
478- return true ;
479- }
480- if (candidate.tpcInnerParam () >= 1.5 && candidate.tpcInnerParam () < 1.8 && candidate.tpcNSigmaPr () > -1.5 && candidate.tpcNSigmaPr () < 2.0 ) {
465+ if (candidate.tpcInnerParam () < 1.5 && candidate.tpcInnerParam () < 1.8 && candidate.tpcNSigmaPr () > -2.0 && candidate.tpcNSigmaPr () < nsigmaCutTPC) {
481466 return true ;
482467 }
483468 }
@@ -578,21 +563,14 @@ struct highmasslambda {
578563 double v2, v2Rot;
579564 void processSameEvent (EventCandidates::iterator const & collision, TrackCandidates const & tracks, AllTrackCandidates const &, ResoV0s const & V0s, aod::BCs const &)
580565 {
581- if (!collision.sel8 ()) {
566+ if (!collision.sel8 () || !collision. triggereventep () || !collision. selection_bit (aod::evsel:: kNoTimeFrameBorder ) || !collision. selection_bit (aod::evsel:: kNoITSROFrameBorder ) || !collision. selection_bit (aod::evsel:: kNoSameBunchPileup ) || !collision. selection_bit (aod::evsel:: kIsGoodZvtxFT0vsPV ) || !collision. selection_bit (o2::aod::evsel:: kNoCollInTimeRangeStandard ) ) {
582567 return ;
583568 }
569+
584570 auto centrality = collision.centFT0C ();
585571 auto multTPC = collision.multNTracksPV ();
586572 histos.fill (HIST (" hFTOCvsTPCNoCut" ), centrality, multTPC);
587- if (!collision.triggereventep ()) {
588- return ;
589- }
590- if (additionalEvSel && (!collision.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
591- return ;
592- }
593- if (additionalEvSel2 && (!collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard ))) {
594- return ;
595- }
573+
596574 int occupancy = collision.trackOccupancyInTimeRange ();
597575 auto psiFT0C = collision.psiFT0C ();
598576 auto psiFT0A = collision.psiFT0A ();
@@ -634,19 +612,19 @@ struct highmasslambda {
634612 histos.fill (HIST (" hNsigmaProtonElectronTPC" ), track1.tpcNSigmaPr (), track1.tpcNSigmaEl (), track1.tpcInnerParam ());
635613 histos.fill (HIST (" hNsigmaProtonPionTPC" ), track1.tpcNSigmaPr (), track1.tpcNSigmaPi (), track1.tpcInnerParam ());
636614 histos.fill (HIST (" hNsigmaProtonKaonTPC" ), track1.tpcNSigmaPr (), track1.tpcNSigmaKa (), track1.tpcInnerParam ());
637- if (!rejectPi (track1)) {
615+ if (rejectPID && !rejectPi (track1)) {
638616 continue ;
639617 }
640618 histos.fill (HIST (" hNsigmaProtonElectronTPC_afterPi" ), track1.tpcNSigmaPr (), track1.tpcNSigmaEl (), track1.tpcInnerParam ());
641619 histos.fill (HIST (" hNsigmaProtonPionTPC_afterPi" ), track1.tpcNSigmaPr (), track1.tpcNSigmaPi (), track1.tpcInnerParam ());
642620 histos.fill (HIST (" hNsigmaProtonKaonTPC_afterPi" ), track1.tpcNSigmaPr (), track1.tpcNSigmaKa (), track1.tpcInnerParam ());
643- if (!rejectEl (track1)) {
621+ if (rejectPID && !rejectEl (track1)) {
644622 continue ;
645623 }
646624 histos.fill (HIST (" hNsigmaProtonElectronTPC_afterEl" ), track1.tpcNSigmaPr (), track1.tpcNSigmaEl (), track1.tpcInnerParam ());
647625 histos.fill (HIST (" hNsigmaProtonPionTPC_afterEl" ), track1.tpcNSigmaPr (), track1.tpcNSigmaPi (), track1.tpcInnerParam ());
648626 histos.fill (HIST (" hNsigmaProtonKaonTPC_afterEl" ), track1.tpcNSigmaPr (), track1.tpcNSigmaKa (), track1.tpcInnerParam ());
649- if (!rejectKa (track1)) {
627+ if (rejectPID && !rejectKa (track1)) {
650628 continue ;
651629 }
652630 histos.fill (HIST (" hNsigmaProtonElectronTPC_afterKa" ), track1.tpcNSigmaPr (), track1.tpcNSigmaEl (), track1.tpcInnerParam ());
@@ -673,7 +651,7 @@ struct highmasslambda {
673651 histos.fill (HIST (" hDcaxy" ), track1.dcaXY ());
674652 histos.fill (HIST (" hDcaz" ), track1.dcaZ ());
675653 histos.fill (HIST (" hNsigmaProtonTPCDiff" ), track1.tpcNSigmaPr (), track1.tpcNSigmaKa (), track1.pt ());
676- histos.fill (HIST (" hNsigmaProtonTPC" ), track1.tpcNSigmaPr (), track1.pt ());
654+ histos.fill (HIST (" hNsigmaProtonTPC" ), track1.tpcNSigmaPr (), track1.pt (), occupancy );
677655 if (track1.hasTOF ()) {
678656 histos.fill (HIST (" hNsigmaProtonTOF" ), track1.tofNSigmaPr (), track1.pt ());
679657 }
@@ -792,24 +770,15 @@ struct highmasslambda {
792770 BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicityClass, axisEPAngle}, true };
793771 Pair<EventCandidates, TrackCandidates, ResoV0s, BinningTypeVertexContributor> pairs{binningOnPositions, cfgNoMixedEvents, -1 , collisions, tracksV0sTuple, &cache}; // -1 is the number of the bin to skip
794772 for (auto & [collision1, tracks1, collision2, tracks2] : pairs) {
795- if (!collision1.sel8 () || !collision2.sel8 ()) {
796- continue ;
797- }
798- if (!collision1.triggereventep () || !collision2.triggereventep ()) {
773+ if (!collision1.sel8 () || !collision1.triggereventep () || !collision1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision1.selection_bit (aod::evsel::kNoITSROFrameBorder ) || !collision1.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision1.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ) || !collision1.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
799774 continue ;
800775 }
801- if (additionalEvSel && (!collision1 .selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision1 .selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
776+ if (!collision2. sel8 () || !collision2. triggereventep () || !collision2 .selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision2. selection_bit (aod::evsel:: kNoITSROFrameBorder ) || !collision2. selection_bit (aod::evsel:: kNoSameBunchPileup ) || !collision2 .selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ) || !collision2. selection_bit (o2::aod::evsel:: kNoCollInTimeRangeStandard )) {
802777 continue ;
803778 }
804- if (additionalEvSel && (!collision2. selection_bit (aod::evsel:: kNoSameBunchPileup ) || ! collision2.selection_bit (aod::evsel:: kIsGoodZvtxFT0vsPV ) )) {
779+ if (collision1. bcId () == collision2.bcId ( )) {
805780 continue ;
806781 }
807- if (additionalEvSel2 && (!collision1.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard ))) {
808- return ;
809- }
810- if (additionalEvSel2 && (!collision2.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard ))) {
811- return ;
812- }
813782 auto centrality = collision1.centFT0C ();
814783 auto psiFT0C = collision1.psiFT0C ();
815784 auto QFT0C = collision1.qFT0C ();
@@ -820,13 +789,13 @@ struct highmasslambda {
820789 continue ;
821790 }
822791 if (!track1.hasTOF ()) {
823- if (!rejectPi (track1)) {
792+ if (rejectPID && !rejectPi (track1)) {
824793 continue ;
825794 }
826- if (!rejectEl (track1)) {
795+ if (rejectPID && !rejectEl (track1)) {
827796 continue ;
828797 }
829- if (!rejectKa (track1)) {
798+ if (rejectPID && !rejectKa (track1)) {
830799 continue ;
831800 }
832801 }
0 commit comments