|
54 | 54 | #include "DataFormatsParameters/GRPMagField.h" |
55 | 55 | #include "CCDB/BasicCCDBManager.h" |
56 | 56 | #include "PWGLF/DataModel/LFStrangenessTables.h" |
| 57 | +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" |
57 | 58 | #include "Common/DataModel/FT0Corrected.h" |
58 | 59 |
|
59 | 60 | using namespace o2; |
60 | 61 | using namespace o2::framework; |
61 | 62 | using namespace o2::framework::expressions; |
62 | 63 | using std::array; |
63 | 64 |
|
| 65 | +using dauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>; |
| 66 | +using v0Candidates = soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras>; |
| 67 | + |
64 | 68 | struct lambdapolsp { |
65 | 69 |
|
66 | 70 | int mRunNumber; |
@@ -427,6 +431,49 @@ struct lambdapolsp { |
427 | 431 | return true; |
428 | 432 | } |
429 | 433 |
|
| 434 | + template <typename TV0> |
| 435 | + bool isCompatible(TV0 const& v0, int pid /*0: lambda, 1: antilambda*/) |
| 436 | + { |
| 437 | + // checks if this V0 is compatible with the requested hypothesis |
| 438 | + |
| 439 | + // de-ref track extras |
| 440 | + auto posTrackExtra = v0.template posTrackExtra_as<dauTracks>(); |
| 441 | + auto negTrackExtra = v0.template negTrackExtra_as<dauTracks>(); |
| 442 | + |
| 443 | + // check for desired kinematics |
| 444 | + if (pid == 0 && (v0.positivept() < cfgDaughPrPt || v0.negativept() < cfgDaughPiPt)) { |
| 445 | + return false; // doesn´t pass lambda pT sels |
| 446 | + } |
| 447 | + if (pid == 1 && (v0.positivept() < cfgDaughPiPt || v0.negativept() < cfgDaughPrPt)) { |
| 448 | + return false; // doesn´t pass antilambda pT sels |
| 449 | + } |
| 450 | + if (std::abs(v0.positiveeta()) > ConfDaughEta || std::abs(v0.negativeeta()) > ConfDaughEta) { |
| 451 | + return false; |
| 452 | + } |
| 453 | + |
| 454 | + // check TPC tracking properties |
| 455 | + if (posTrackExtra.tpcNClsCrossedRows() < 70 || negTrackExtra.tpcNClsCrossedRows() < 70) { |
| 456 | + return false; |
| 457 | + } |
| 458 | + if (posTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin || negTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin) { |
| 459 | + return false; |
| 460 | + } |
| 461 | + if (posTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8 || negTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8) { |
| 462 | + return false; |
| 463 | + } |
| 464 | + |
| 465 | + // check TPC PID |
| 466 | + if (pid == 0 && ((std::abs(posTrackExtra.tpcNSigmaPr()) > ConfDaughPIDCuts) || (std::abs(negTrackExtra.tpcNSigmaPi()) > ConfDaughPIDCuts))) { |
| 467 | + return false; |
| 468 | + } |
| 469 | + if (pid == 1 && ((std::abs(posTrackExtra.tpcNSigmaPi()) > ConfDaughPIDCuts) || (std::abs(negTrackExtra.tpcNSigmaPr()) > ConfDaughPIDCuts))) { |
| 470 | + return false; |
| 471 | + } |
| 472 | + |
| 473 | + // if we made it this far, it's good |
| 474 | + return true; |
| 475 | + } |
| 476 | + |
430 | 477 | double GetPhiInRange(double phi) |
431 | 478 | { |
432 | 479 | double result = phi; |
@@ -743,6 +790,136 @@ struct lambdapolsp { |
743 | 790 | } |
744 | 791 | } |
745 | 792 | PROCESS_SWITCH(lambdapolsp, processData, "Process data", true); |
| 793 | + |
| 794 | + // process function for derived data - mimics the functionality of the original data |
| 795 | + void processDerivedData(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraZDCSP>::iterator const& collision, v0Candidates const& V0s, dauTracks const&) |
| 796 | + { |
| 797 | + //___________________________________________________________________________________________________ |
| 798 | + // event selection |
| 799 | + if (!collision.sel8()) { |
| 800 | + return; |
| 801 | + } |
| 802 | + auto centrality = collision.centFT0C(); |
| 803 | + if (!collision.triggereventsp()) { // provided by StraZDCSP |
| 804 | + return; |
| 805 | + } |
| 806 | + |
| 807 | + if (additionalEvSel && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { |
| 808 | + return; |
| 809 | + } |
| 810 | + // histos.fill(HIST("hCentrality2"), centrality); |
| 811 | + // if (additionalEvSel2 && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) { |
| 812 | + if (additionalEvSel2 && (collision.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision.trackOccupancyInTimeRange() < cfgMinOccupancy)) { |
| 813 | + return; |
| 814 | + } |
| 815 | + // histos.fill(HIST("hCentrality3"), centrality); |
| 816 | + if (additionalEvSel3 && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { |
| 817 | + return; |
| 818 | + } |
| 819 | + |
| 820 | + //___________________________________________________________________________________________________ |
| 821 | + // retrieve further info provided by StraZDCSP |
| 822 | + auto psiZDCC = collision.psiZDCC(); |
| 823 | + auto psiZDCA = collision.psiZDCA(); |
| 824 | + |
| 825 | + // fill histograms |
| 826 | + histos.fill(HIST("hCentrality"), centrality); |
| 827 | + if (!checkwithpub) { |
| 828 | + // histos.fill(HIST("hVtxZ"), collision.posZ()); |
| 829 | + histos.fill(HIST("hpRes"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA - psiZDCC)))); |
| 830 | + if (QA) { |
| 831 | + histos.fill(HIST("hpResSin"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA - psiZDCC)))); |
| 832 | + histos.fill(HIST("hpCosPsiA"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA)))); |
| 833 | + histos.fill(HIST("hpCosPsiC"), centrality, (TMath::Cos(GetPhiInRange(psiZDCC)))); |
| 834 | + histos.fill(HIST("hpSinPsiA"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA)))); |
| 835 | + histos.fill(HIST("hpSinPsiC"), centrality, (TMath::Sin(GetPhiInRange(psiZDCC)))); |
| 836 | + } |
| 837 | + } |
| 838 | + |
| 839 | + //___________________________________________________________________________________________________ |
| 840 | + // loop over V0s as necessary |
| 841 | + for (auto v0 : V0s) { |
| 842 | + bool LambdaTag = isCompatible(v0, 0); |
| 843 | + bool aLambdaTag = isCompatible(v0, 1); |
| 844 | + |
| 845 | + if (LambdaTag == aLambdaTag) |
| 846 | + continue; |
| 847 | + |
| 848 | + if (!SelectionV0(collision, v0)) { |
| 849 | + continue; |
| 850 | + } |
| 851 | + |
| 852 | + if (LambdaTag) { |
| 853 | + Proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPr); |
| 854 | + Pion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPi); |
| 855 | + } |
| 856 | + if (aLambdaTag) { |
| 857 | + Proton = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPr); |
| 858 | + Pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi); |
| 859 | + } |
| 860 | + Lambda = Proton + Pion; |
| 861 | + |
| 862 | + ROOT::Math::Boost boost{Lambda.BoostToCM()}; |
| 863 | + fourVecDauCM = boost(Proton); |
| 864 | + threeVecDauCM = fourVecDauCM.Vect(); |
| 865 | + // beamvector = ROOT::Math::XYZVector(0, 0, 1); |
| 866 | + // eventplaneVec = ROOT::Math::XYZVector(collision.qFT0C(), collision.qFT0A(), 0); //this needs to be changed |
| 867 | + // eventplaneVecNorm = eventplaneVec.Cross(beamvector); //z' |
| 868 | + phiangle = TMath::ATan2(fourVecDauCM.Py(), fourVecDauCM.Px()); |
| 869 | + // double phiangledir = fourVecDauCM.Phi(); |
| 870 | + |
| 871 | + auto phiminuspsiC = GetPhiInRange(phiangle - psiZDCC); |
| 872 | + auto phiminuspsiA = GetPhiInRange(phiangle - psiZDCA); |
| 873 | + // histos.fill(HIST("hpsiApsiC"), psiZDCA, psiZDCC); |
| 874 | + // histos.fill(HIST("hpsiApsiC"), GetPhiInRange(GetPhiInRange(phiangle) - GetPhiInRange(psiZDCA)), phiminuspsiA); |
| 875 | + // histos.fill(HIST("hphiminuspsiA"), (phiminuspsiA)); |
| 876 | + // histos.fill(HIST("hphiminuspsiC"), (phiminuspsiC)); |
| 877 | + // auto cosThetaStar = eventplaneVecNorm.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVecNorm.Mag2()); |
| 878 | + auto cosThetaStar = fourVecDauCM.Pz() / fourVecDauCM.P(); // A0 correction |
| 879 | + auto sinThetaStar = TMath::Sqrt(1 - (cosThetaStar * cosThetaStar)); |
| 880 | + auto PolC = TMath::Sin(phiminuspsiC); |
| 881 | + auto PolA = TMath::Sin(phiminuspsiA); |
| 882 | + |
| 883 | + // needed for corrections |
| 884 | + auto sinPhiStar = TMath::Sin(GetPhiInRange(phiangle)); |
| 885 | + auto cosPhiStar = TMath::Cos(GetPhiInRange(phiangle)); |
| 886 | + auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(Lambda.Phi() - phiangle)); // A2 correction |
| 887 | + auto phiphiStar = GetPhiInRange(Lambda.Phi() - phiangle); |
| 888 | + |
| 889 | + auto candmass = 0.0; |
| 890 | + auto candpt = 0.0; |
| 891 | + auto candeta = 0.0; |
| 892 | + |
| 893 | + if (LambdaTag) { |
| 894 | + candmass = v0.mLambda(); |
| 895 | + candpt = v0.pt(); |
| 896 | + candeta = v0.eta(); |
| 897 | + |
| 898 | + histos.fill(HIST("hSparseLambdaPolA"), candmass, candpt, candeta, PolA, centrality); |
| 899 | + histos.fill(HIST("hSparseLambdaPolC"), candmass, candpt, candeta, PolC, centrality); |
| 900 | + histos.fill(HIST("hSparseLambda_corr1a"), candmass, candpt, candeta, sinPhiStar, centrality); |
| 901 | + histos.fill(HIST("hSparseLambda_corr1b"), candmass, candpt, candeta, cosPhiStar, centrality); |
| 902 | + histos.fill(HIST("hSparseLambda_corr1c"), candmass, candpt, candeta, phiphiStar, centrality); |
| 903 | + histos.fill(HIST("hSparseLambda_corr2a"), candmass, candpt, candeta, sinThetaStar, centrality); |
| 904 | + histos.fill(HIST("hSparseLambda_corr2b"), candmass, candpt, candeta, sinThetaStarcosphiphiStar, centrality); |
| 905 | + } |
| 906 | + |
| 907 | + if (aLambdaTag) { |
| 908 | + candmass = v0.mAntiLambda(); |
| 909 | + candpt = v0.pt(); |
| 910 | + candeta = v0.eta(); |
| 911 | + |
| 912 | + histos.fill(HIST("hSparseAntiLambdaPolA"), candmass, candpt, candeta, PolA, centrality); |
| 913 | + histos.fill(HIST("hSparseAntiLambdaPolC"), candmass, candpt, candeta, PolC, centrality); |
| 914 | + histos.fill(HIST("hSparseAntiLambda_corr1a"), candmass, candpt, candeta, sinPhiStar, centrality); |
| 915 | + histos.fill(HIST("hSparseAntiLambda_corr1b"), candmass, candpt, candeta, cosPhiStar, centrality); |
| 916 | + histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, candpt, candeta, phiphiStar, centrality); |
| 917 | + histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, candpt, candeta, sinThetaStar, centrality); |
| 918 | + histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, candpt, candeta, sinThetaStarcosphiphiStar, centrality); |
| 919 | + } |
| 920 | + } // end loop over V0s |
| 921 | + } |
| 922 | + PROCESS_SWITCH(lambdapolsp, processDerivedData, "Process derived data", false); |
746 | 923 | }; |
747 | 924 | WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
748 | 925 | { |
|
0 commit comments