Skip to content
Snippets Groups Projects
Commit 14ec4a9c authored by Viktor Klochkov's avatar Viktor Klochkov :eyes:
Browse files

add rapidity getter

parent 79e67b29
No related branches found
No related tags found
No related merge requests found
Pipeline #3158 failed
#ifndef BASE_CONSTANTS_H
#define BASE_CONSTANTS_H
#include <map>
#include <Rtypes.h>
namespace AnalysisTree {
......@@ -17,6 +18,7 @@ constexpr ShortInt_t UndefValueShort = -999;
constexpr Integer_t UndefValueInt = -999;
constexpr bool Unused{false};
const std::map<int, float> MassMap = { {211, 0.14}, {-211, 0.14}, {2212, 0.938} };
namespace Exyz{
enum Exyz : ShortInt_t {
......
......@@ -105,6 +105,11 @@ class Track : public Container {
Floating_t GetPhi() const { return atan2(py_, px_); }
Floating_t GetEta() const { return 0.5 * log ( (GetP() + pz_) / (GetP()-pz_) ); }
Floating_t GetP() const { return sqrt(px_*px_ + py_*py_ + pz_*pz_); }
Floating_t GetRapidity(int pid) const {
const float mass = MassMap.find(pid)->second;
const float e = sqrt( mass*mass + GetP()*GetP() );
return 0.5*log( (e+GetPz()) / (e-GetPz()) );
}
void MemoryTest()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment