forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AliceO2Group:master' into master
- Loading branch information
Showing
78 changed files
with
2,130 additions
and
684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,11 @@ | |
/// | ||
/// \author Vít Kučera <[email protected]>, CERN | ||
|
||
#ifndef O2_ANALYSIS_TRACKUTILITIES_H_ | ||
#define O2_ANALYSIS_TRACKUTILITIES_H_ | ||
#ifndef COMMON_CORE_TRACKUTILITIES_H_ | ||
#define COMMON_CORE_TRACKUTILITIES_H_ | ||
|
||
#include <utility> // std::move | ||
#include "CommonConstants/MathConstants.h" | ||
#include "ReconstructionDataFormats/Track.h" | ||
#include "ReconstructionDataFormats/Vertex.h" | ||
#include "Common/Core/RecoDecay.h" | ||
|
@@ -128,4 +130,26 @@ void getPxPyPz(T const& trackPars, U& pVec) | |
pVec[2] = pt * trackPars.getTgl(); | ||
} | ||
|
||
#endif // O2_ANALYSIS_TRACKUTILITIES_H_ | ||
/// Calculates DCA XYZ of a track w.r.t. the primary vertex and its uncertainty if required. | ||
/// \param track track from a table containing `o2::aod::TracksCov, o2::aod::TracksDCA`. | ||
/// \param sigmaDcaXYZ2 pointer to the sigma^2 of the impact parameter in XYZ to be calculated | ||
/// \return impact parameter in XYZ of the track w.r.t the primary vertex | ||
template <typename T> | ||
float getDcaXYZ(T const& track, float* sigmaDcaXYZ2 = nullptr) | ||
{ | ||
float dcaXY = track.dcaXY(); | ||
float dcaZ = track.dcaZ(); | ||
float dcaXYZ = std::sqrt(dcaXY * dcaXY + dcaZ * dcaZ); | ||
if (sigmaDcaXYZ2) { | ||
if (dcaXYZ < o2::constants::math::Almost0) { | ||
*sigmaDcaXYZ2 = o2::constants::math::VeryBig; // Protection against division by zero | ||
} else { | ||
float dFdxy = 2.f * dcaXY / dcaXYZ; | ||
float dFdz = 2.f * dcaZ / dcaXYZ; | ||
*sigmaDcaXYZ2 = track.cYY() * dFdxy * dFdxy + track.cZZ() * dFdz * dFdz + 2.f * track.cZY() * dFdxy * dFdz; | ||
} | ||
} | ||
return dcaXYZ; | ||
} | ||
|
||
#endif // COMMON_CORE_TRACKUTILITIES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.