|
42 | 42 | #include "Common/DataModel/TrackSelectionTables.h" |
43 | 43 | #include "Common/DataModel/EventSelection.h" |
44 | 44 | #include "Common/DataModel/Qvectors.h" |
| 45 | +#include "Common/DataModel/PIDResponseITS.h" |
45 | 46 |
|
46 | 47 | #include "Common/Core/trackUtilities.h" |
47 | 48 | #include "Common/Core/TrackSelection.h" |
|
57 | 58 | #include "CCDB/BasicCCDBManager.h" |
58 | 59 |
|
59 | 60 | #include "PWGLF/DataModel/LFStrangenessTables.h" |
| 61 | +#include "PWGMM/Mult/DataModel/Index.h" // for Particles2Tracks table |
60 | 62 |
|
61 | 63 | using namespace o2; |
62 | 64 | using namespace o2::framework; |
@@ -168,6 +170,18 @@ struct lambdapolarization { |
168 | 170 |
|
169 | 171 | std::string fullCCDBShiftCorrPath; |
170 | 172 |
|
| 173 | + double GetPhiInRange(double phi) |
| 174 | + { |
| 175 | + double result = phi; |
| 176 | + while (result < 0) { |
| 177 | + result = result + 2. * TMath::Pi() / 2; |
| 178 | + } |
| 179 | + while (result > 2. * TMath::Pi() / 2) { |
| 180 | + result = result - 2. * TMath::Pi() / 2; |
| 181 | + } |
| 182 | + return result; |
| 183 | + } |
| 184 | + |
171 | 185 | template <typename T> |
172 | 186 | int GetDetId(const T& name) |
173 | 187 | { |
@@ -301,6 +315,16 @@ struct lambdapolarization { |
301 | 315 | } |
302 | 316 | } |
303 | 317 |
|
| 318 | + if (doprocessMC_ITSTPC) { |
| 319 | + histos.add("hImpactParameter", "Impact parameter", kTH1F, {{200, 0.0f, 20.0f}}); |
| 320 | + histos.add("hEventPlaneAngle", "hEventPlaneAngle", kTH1F, {{200, -2.0f * TMath::Pi(), 2.0f * TMath::Pi()}}); |
| 321 | + histos.add("hEventPlaneAngleRec", "hEventPlaneAngleRec", kTH1F, {{200, -2.0f * TMath::Pi(), 2.0f * TMath::Pi()}}); |
| 322 | + histos.add("hNchVsImpactParameter", "hNchVsImpactParameter", kTH2F, {{200, 0.0f, 20.0f}, {500, -0.5f, 5000.5f}}); |
| 323 | + histos.add("hSparseMCGenWeight", "hSparseMCGenWeight", HistType::kTHnSparseF, {centAxis, {36, 0.0f, TMath::Pi()}, {50, 0.0f, 1}, ptAxis, {8, -0.8, 0.8}}); |
| 324 | + histos.add("hSparseMCRecWeight", "hSparseMCRecWeight", HistType::kTHnSparseF, {centAxis, {36, 0.0f, TMath::Pi()}, {50, 0.0f, 1}, ptAxis, {8, -0.8, 0.8}}); |
| 325 | + histos.add("hSparseMCRecAllTrackWeight", "hSparseMCRecAllTrackWeight", HistType::kTHnSparseF, {centAxis, {36, 0.0, TMath::Pi()}, {50, 0.0f, 1}, ptAxis, {8, -0.8, 0.8}}); |
| 326 | + } |
| 327 | + |
304 | 328 | if (cfgShiftCorrDef) { |
305 | 329 | for (auto i = 2; i < cfgnMods + 2; i++) { |
306 | 330 | histos.add(Form("psi%d/ShiftFIT", i), "", kTProfile3D, {centQaAxis, basisAxis, shiftAxis}); |
@@ -798,6 +822,7 @@ struct lambdapolarization { |
798 | 822 | histos.fill(HIST("psi4/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), qvecMag * TMath::Cos(relphi), centrality, weight); |
799 | 823 | histos.fill(HIST("psi4/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); |
800 | 824 |
|
| 825 | + |
801 | 826 | if (cfgRapidityDep) { |
802 | 827 | histos.fill(HIST("psi4/h_alambda_cos2_rap"), v0.mAntiLambda(), v0.pt(), angle * angle, centrality, v0.yLambda(), weight); |
803 | 828 | } |
@@ -855,6 +880,89 @@ struct lambdapolarization { |
855 | 880 | } // FIXME: need to fill different histograms for different harmonic |
856 | 881 | } |
857 | 882 | PROCESS_SWITCH(lambdapolarization, processData, "Process Event for data", true); |
| 883 | + |
| 884 | + using recoTracks = soa::Join<aod::TracksIU, aod::TracksExtra>; |
| 885 | + void processMC_ITSTPC(aod::McCollision const& mcCollision, soa::Join<aod::McParticles, aod::ParticlesToTracks> const& mcParticles, recoTracks const&) |
| 886 | + { |
| 887 | + float imp = mcCollision.impactParameter(); |
| 888 | + float evPhi = mcCollision.eventPlaneAngle() / 2.0; |
| 889 | + float centclass = -999; |
| 890 | + if (imp >= 0 && imp < 3.49) { |
| 891 | + centclass = 2.5; |
| 892 | + } |
| 893 | + if (imp >= 3.49 && imp < 4.93) { |
| 894 | + centclass = 7.5; |
| 895 | + } |
| 896 | + if (imp >= 4.93 && imp < 6.98) { |
| 897 | + centclass = 15.0; |
| 898 | + } |
| 899 | + if (imp >= 6.98 && imp < 8.55) { |
| 900 | + centclass = 25.0; |
| 901 | + } |
| 902 | + if (imp >= 8.55 && imp < 9.87) { |
| 903 | + centclass = 35.0; |
| 904 | + } |
| 905 | + if (imp >= 9.87 && imp < 11) { |
| 906 | + centclass = 45.0; |
| 907 | + } |
| 908 | + if (imp >= 11 && imp < 12.1) { |
| 909 | + centclass = 55.0; |
| 910 | + } |
| 911 | + if (imp >= 12.1 && imp < 13.1) { |
| 912 | + centclass = 65.0; |
| 913 | + } |
| 914 | + if (imp >= 13.1 && imp < 14) { |
| 915 | + centclass = 75.0; |
| 916 | + } |
| 917 | + // if (evPhi < 0) |
| 918 | + // evPhi += 2. * TMath::Pi(); |
| 919 | + |
| 920 | + int nCh = 0; |
| 921 | + |
| 922 | + if (centclass > 0 && centclass < 80) { |
| 923 | + // event within range |
| 924 | + histos.fill(HIST("hImpactParameter"), imp); |
| 925 | + histos.fill(HIST("hEventPlaneAngle"), evPhi); |
| 926 | + for (auto const& mcParticle : mcParticles) { |
| 927 | + |
| 928 | + float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle(); |
| 929 | + // focus on bulk: e, mu, pi, k, p |
| 930 | + int pdgCode = TMath::Abs(mcParticle.pdgCode()); |
| 931 | + if (pdgCode != 3122) |
| 932 | + continue; |
| 933 | + if (!mcParticle.isPhysicalPrimary()) |
| 934 | + continue; |
| 935 | + if (TMath::Abs(mcParticle.eta()) > 0.8) // main acceptance |
| 936 | + continue; |
| 937 | + histos.fill(HIST("hSparseMCGenWeight"), centclass, GetPhiInRange(deltaPhi), TMath::Power(TMath::Cos(2.0 * GetPhiInRange(deltaPhi)), 2.0), mcParticle.pt(), mcParticle.eta()); |
| 938 | + nCh++; |
| 939 | + bool validGlobal = false; |
| 940 | + bool validAny = false; |
| 941 | + if (mcParticle.has_tracks()) { |
| 942 | + auto const& tracks = mcParticle.tracks_as<recoTracks>(); |
| 943 | + for (auto const& track : tracks) { |
| 944 | + if (track.hasTPC() && track.hasITS()) { |
| 945 | + validGlobal = true; |
| 946 | + } |
| 947 | + if (track.hasTPC() || track.hasITS()) { |
| 948 | + validAny = true; |
| 949 | + } |
| 950 | + } |
| 951 | + } |
| 952 | + // if valid global, fill |
| 953 | + if (validGlobal) { |
| 954 | + histos.fill(HIST("hSparseMCRecWeight"), centclass, GetPhiInRange(deltaPhi), TMath::Power(TMath::Cos(2.0 * GetPhiInRange(deltaPhi)), 2.0), mcParticle.pt(), mcParticle.eta()); |
| 955 | + } |
| 956 | + if (validAny) { |
| 957 | + histos.fill(HIST("hSparseMCRecAllTrackWeight"), centclass, GetPhiInRange(deltaPhi), TMath::Power(TMath::Cos(2.0 * GetPhiInRange(deltaPhi)), 2.0), mcParticle.pt(), mcParticle.eta()); |
| 958 | + histos.fill(HIST("hEventPlaneAngleRec"), GetPhiInRange(deltaPhi)); |
| 959 | + } |
| 960 | + // if any track present, fill |
| 961 | + } |
| 962 | + } |
| 963 | + histos.fill(HIST("hNchVsImpactParameter"), imp, nCh); |
| 964 | + } |
| 965 | + PROCESS_SWITCH(lambdapolarization, processMC_ITSTPC, "Process MC for ITSTPC", false); |
858 | 966 | }; |
859 | 967 |
|
860 | 968 | WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
|
0 commit comments