|
29 | 29 | #include "Common/Core/EventPlaneHelper.h" |
30 | 30 | #include "Common/Core/fwdtrackUtilities.h" |
31 | 31 | #include "Common/Core/trackUtilities.h" |
| 32 | +#include "Common/Core/PID/PIDTOFParamService.h" |
32 | 33 |
|
33 | 34 | #include <CommonConstants/LHCConstants.h> |
34 | 35 | #include <CommonConstants/PhysicsConstants.h> |
@@ -129,18 +130,19 @@ class VarManager : public TObject |
129 | 130 | ReducedMuon = BIT(14), |
130 | 131 | ReducedMuonExtra = BIT(15), |
131 | 132 | ReducedMuonCov = BIT(16), |
132 | | - ParticleMC = BIT(17), |
133 | | - Pair = BIT(18), // TODO: check whether we really need the Pair member here |
134 | | - AmbiTrack = BIT(19), |
135 | | - AmbiMuon = BIT(20), |
136 | | - DalitzBits = BIT(21), |
137 | | - TrackTPCPID = BIT(22), |
138 | | - TrackMFT = BIT(23), |
139 | | - ReducedTrackCollInfo = BIT(24), // TODO: remove it once new reduced data tables are produced for dielectron with ReducedTracksBarrelInfo |
140 | | - ReducedMuonCollInfo = BIT(25), // TODO: remove it once new reduced data tables are produced for dielectron with ReducedTracksBarrelInfo |
141 | | - MuonRealign = BIT(26), |
142 | | - MuonCovRealign = BIT(27), |
143 | | - MFTCov = BIT(28) |
| 133 | + Pair = BIT(17), // TODO: check whether we really need the Pair member here |
| 134 | + AmbiTrack = BIT(18), |
| 135 | + AmbiMuon = BIT(19), |
| 136 | + DalitzBits = BIT(20), |
| 137 | + TrackTPCPID = BIT(21), |
| 138 | + TrackMFT = BIT(22), |
| 139 | + ReducedTrackCollInfo = BIT(23), // TODO: remove it once new reduced data tables are produced for dielectron with ReducedTracksBarrelInfo |
| 140 | + ReducedMuonCollInfo = BIT(24), // TODO: remove it once new reduced data tables are produced for dielectron with ReducedTracksBarrelInfo |
| 141 | + MuonRealign = BIT(25), |
| 142 | + MuonCovRealign = BIT(26), |
| 143 | + MFTCov = BIT(27), |
| 144 | + TrackTOFService = BIT(28), |
| 145 | + ParticleMC = BIT(29) |
144 | 146 | }; |
145 | 147 |
|
146 | 148 | enum PairCandidateType { |
@@ -1190,7 +1192,7 @@ class VarManager : public TObject |
1190 | 1192 | static void FillPhoton(T const& photon, float* values = nullptr); |
1191 | 1193 | template <uint32_t fillMap, typename T, typename C> |
1192 | 1194 | static void FillTrackCollision(T const& track, C const& collision, float* values = nullptr); |
1193 | | - template <int candidateType, typename T1, typename T2, typename C> |
| 1195 | + template <int candidateType, uint32_t fillMap, typename T1, typename T2, typename C> |
1194 | 1196 | static void FillTrackCollisionMC(T1 const& track, T2 const& MotherTrack, C const& collision, float* values = nullptr); |
1195 | 1197 | template <uint32_t fillMap, typename T, typename C, typename M, typename P> |
1196 | 1198 | static void FillTrackCollisionMatCorr(T const& track, C const& collision, M const& materialCorr, P const& propagator, float* values = nullptr); |
@@ -1309,7 +1311,7 @@ class VarManager : public TObject |
1309 | 1311 | fgITSROFBorderMarginLow = marginLow; |
1310 | 1312 | fgITSROFBorderMarginHigh = marginHigh; |
1311 | 1313 | } |
1312 | | - |
| 1314 | + |
1313 | 1315 | static void SetSORandEOR(uint64_t sor, uint64_t eor) |
1314 | 1316 | { |
1315 | 1317 | fgSOR = sor; |
@@ -2657,6 +2659,12 @@ void VarManager::FillTrack(T const& track, float* values) |
2657 | 2659 | values[kTOFbeta] = track.beta(); |
2658 | 2660 | } |
2659 | 2661 | } |
| 2662 | + if constexpr ((fillMap & TrackTOFService) > 0) { |
| 2663 | + values[kTOFnSigmaEl] = track.tofNSigmaDynEl(); |
| 2664 | + values[kTOFnSigmaEl] = track.tofNSigmaDynPi(); |
| 2665 | + values[kTOFnSigmaEl] = track.tofNSigmaDynKa(); |
| 2666 | + values[kTOFnSigmaEl] = track.tofNSigmaDynPr(); |
| 2667 | + } |
2660 | 2668 | if constexpr ((fillMap & TrackTPCPID) > 0) { |
2661 | 2669 | values[kTPCnSigmaEl] = track.tpcNSigmaEl(); |
2662 | 2670 | values[kTPCnSigmaPi] = track.tpcNSigmaPi(); |
@@ -2847,47 +2855,55 @@ void VarManager::FillTrackMC(const U& mcStack, T const& track, float* values) |
2847 | 2855 | FillTrackDerived(values); |
2848 | 2856 | } |
2849 | 2857 |
|
2850 | | -template <int candidateType, typename T1, typename T2, typename C> |
| 2858 | +template <int candidateType, uint32_t fillMap, typename T1, typename T2, typename C> |
2851 | 2859 | void VarManager::FillTrackCollisionMC(T1 const& track, T2 const& MotherTrack, C const& collision, float* values) |
2852 | 2860 | { |
2853 | 2861 |
|
2854 | 2862 | if (!values) { |
2855 | 2863 | values = fgValues; |
2856 | 2864 | } |
2857 | 2865 |
|
2858 | | - float m = 0.0; |
2859 | | - float pdgLifetime = 0.0; |
2860 | | - if (std::abs(MotherTrack.pdgCode()) == 521) { |
2861 | | - m = o2::constants::physics::MassBPlus; |
2862 | | - pdgLifetime = 1.638e-12; // s |
2863 | | - } |
| 2866 | + float m = o2::constants::physics::MassBPlus; |
| 2867 | + float pdgLifetime = 1.638e-12; // s |
2864 | 2868 | if (std::abs(MotherTrack.pdgCode()) == 511) { |
2865 | 2869 | m = o2::constants::physics::MassB0; |
2866 | 2870 | pdgLifetime = 1.517e-12; // s |
2867 | 2871 | } |
2868 | 2872 |
|
| 2873 | + // Extract the collision primary vertex position using constexpr, since the collision type may be CollisionMC or ReducedMCEvent |
| 2874 | + double collPos[3] = {0.0, 0.0, 0.0}; |
| 2875 | + if constexpr (fillMap & ObjTypes::CollisionMC) { |
| 2876 | + collPos[0] = collision.posX(); |
| 2877 | + collPos[1] = collision.posY(); |
| 2878 | + collPos[2] = collision.posZ(); |
| 2879 | + } else if constexpr (fillMap & ObjTypes::ReducedEventMC) { |
| 2880 | + collPos[0] = collision.mcPosX(); |
| 2881 | + collPos[1] = collision.mcPosY(); |
| 2882 | + collPos[2] = collision.mcPosZ(); |
| 2883 | + } |
| 2884 | + |
2869 | 2885 | // displaced vertex is compued with decay product (track) and momentum of mother particle (MotherTrack) |
2870 | | - values[kMCVertexingLxy] = (collision.mcPosX() - track.vx()) * (collision.mcPosX() - track.vx()) + |
2871 | | - (collision.mcPosY() - track.vy()) * (collision.mcPosY() - track.vy()); |
2872 | | - values[kMCVertexingLz] = (collision.mcPosZ() - track.vz()) * (collision.mcPosZ() - track.vz()); |
| 2886 | + values[kMCVertexingLxy] = (collPos[0] - track.vx()) * (collPos[0] - track.vx()) + |
| 2887 | + (collPos[1] - track.vy()) * (collPos[1] - track.vy()); |
| 2888 | + values[kMCVertexingLz] = (collPos[2] - track.vz()) * (collPos[2] - track.vz()); |
2873 | 2889 | values[kMCVertexingLxyz] = values[kMCVertexingLxy] + values[kMCVertexingLz]; |
2874 | 2890 | values[kMCVertexingLxy] = std::sqrt(values[kMCVertexingLxy]); |
2875 | 2891 | values[kMCVertexingLz] = std::sqrt(values[kMCVertexingLz]); |
2876 | 2892 | values[kMCVertexingLxyz] = std::sqrt(values[kMCVertexingLxyz]); |
2877 | | - values[kMCVertexingTauz] = (collision.mcPosZ() - track.vz()) * m / (TMath::Abs(MotherTrack.pz()) * o2::constants::physics::LightSpeedCm2NS); |
| 2893 | + values[kMCVertexingTauz] = (collPos[2] - track.vz()) * m / (TMath::Abs(MotherTrack.pz()) * o2::constants::physics::LightSpeedCm2NS); |
2878 | 2894 | values[kMCVertexingTauxy] = values[kMCVertexingLxy] * m / (MotherTrack.pt() * o2::constants::physics::LightSpeedCm2NS); |
2879 | 2895 |
|
2880 | | - values[kMCCosPointingAngle] = ((collision.mcPosX() - track.vx()) * MotherTrack.px() + |
2881 | | - (collision.mcPosY() - track.vy()) * MotherTrack.py() + |
2882 | | - (collision.mcPosZ() - track.vz()) * MotherTrack.pz()) / |
| 2896 | + values[kMCCosPointingAngle] = ((collPos[0] - track.vx()) * MotherTrack.px() + |
| 2897 | + (collPos[1] - track.vy()) * MotherTrack.py() + |
| 2898 | + (collPos[2] - track.vz()) * MotherTrack.pz()) / |
2883 | 2899 | (MotherTrack.p() * values[VarManager::kMCVertexingLxyz]); |
2884 | 2900 |
|
2885 | 2901 | values[kMCLxyExpected] = (MotherTrack.pt() / m) * (pdgLifetime * o2::constants::physics::LightSpeedCm2S); |
2886 | 2902 | values[kMCLxyzExpected] = (MotherTrack.p() / m) * (pdgLifetime * o2::constants::physics::LightSpeedCm2S); |
2887 | 2903 |
|
2888 | | - values[kMCVertexingLzProjected] = ((track.vz() - collision.mcPosZ()) * MotherTrack.pz()) / TMath::Abs(MotherTrack.pz()); |
2889 | | - values[kMCVertexingLxyProjected] = (((track.vx() - collision.mcPosX()) * MotherTrack.px()) + ((track.vy() - collision.mcPosY()) * MotherTrack.py())) / TMath::Abs(MotherTrack.pt()); |
2890 | | - values[kMCVertexingLxyzProjected] = (((track.vx() - collision.mcPosX()) * MotherTrack.px()) + ((track.vy() - collision.mcPosY()) * MotherTrack.py()) + ((track.vz() - collision.mcPosZ()) * MotherTrack.pz())) / MotherTrack.p(); |
| 2904 | + values[kMCVertexingLzProjected] = ((track.vz() - collPos[2]) * MotherTrack.pz()) / TMath::Abs(MotherTrack.pz()); |
| 2905 | + values[kMCVertexingLxyProjected] = (((track.vx() - collPos[0]) * MotherTrack.px()) + ((track.vy() - collPos[1]) * MotherTrack.py())) / TMath::Abs(MotherTrack.pt()); |
| 2906 | + values[kMCVertexingLxyzProjected] = (((track.vx() - collPos[1]) * MotherTrack.px()) + ((track.vy() - collPos[1]) * MotherTrack.py()) + ((track.vz() - collPos[2]) * MotherTrack.pz())) / MotherTrack.p(); |
2891 | 2907 | values[kMCVertexingTauxyProjected] = values[kMCVertexingLxyProjected] * m / (MotherTrack.pt()); |
2892 | 2908 | values[kMCVertexingTauzProjected] = values[kMCVertexingLzProjected] * m / TMath::Abs(MotherTrack.pz()); |
2893 | 2909 | values[kMCVertexingTauxyzProjected] = values[kMCVertexingLxyzProjected] * m / (MotherTrack.p()); |
|
0 commit comments