Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions PWGEM/Dilepton/Utils/EMFwdTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ namespace o2::aod::pwgem::dilepton::utils
class EMFwdTrack
{
public:
EMFwdTrack(float pt, float eta, float phi, float /*mass*/, int8_t charge, float dcaX, float dcaY, float cXX, float cXY, float cYY)
EMFwdTrack(float pt, float eta, float phi, float /*mass*/, int8_t sign, float dcaX, float dcaY, float cXX, float cXY, float cYY)
{
fSigned1Pt = static_cast<float>(charge) / pt;
fPt = pt;
fEta = eta;
fPhi = phi;
fSign = sign;
fDCAx = dcaX;
fDCAy = dcaY;
fCXX = cXX;
Expand All @@ -37,28 +38,28 @@ class EMFwdTrack

~EMFwdTrack() {}

float pt() const { return 1.f / std::fabs(fSigned1Pt); }
float pt() const { return fPt; }
float eta() const { return fEta; }
float phi() const { return fPhi; }
int8_t sign() const { return (fSigned1Pt > 0 ? +1 : -1); }
int8_t sign() const { return fSign; }
float fwdDcaX() const { return fDCAx; }
float fwdDcaY() const { return fDCAy; }
float fwdDcaXY() const { return std::sqrt(std::pow(fDCAx, 2) + std::pow(fDCAy, 2)); }
float p() const { return 1.f / std::fabs(fSigned1Pt) * std::cosh(fEta); }
float px() const { return 1.f / std::fabs(fSigned1Pt) * std::cos(fPhi); }
float py() const { return 1.f / std::fabs(fSigned1Pt) * std::sin(fPhi); }
float pz() const { return 1.f / std::fabs(fSigned1Pt) * std::sinh(fEta); }
// float e(const float mass) const { return std::hypot(fPt * std::cosh(fEta), mass); } // e2 = p2 + m2
float signed1Pt() const { return fSigned1Pt; }
float p() const { return fPt * std::cosh(fEta); }
float px() const { return fPt * std::cos(fPhi); }
float py() const { return fPt * std::sin(fPhi); }
float pz() const { return fPt * std::sinh(fEta); }
float signed1Pt() const { return fSign / fPt; }

float cXX() const { return fCXX; }
float cXY() const { return fCXY; }
float cYY() const { return fCYY; }

protected:
float fSigned1Pt;
float fPt;
float fEta;
float fPhi;
int8_t fSign;
float fDCAx;
float fDCAy;
float fCXX;
Expand All @@ -69,11 +70,11 @@ class EMFwdTrack
class EMFwdTrackWithCov : public EMFwdTrack
{
public:
EMFwdTrackWithCov(float pt, float eta, float phi, float mass, int8_t charge, float dcaX, float dcaY, float cXX, float cXY, float cYY,
EMFwdTrackWithCov(float pt, float eta, float phi, float mass, int8_t sign, float dcaX, float dcaY, float cXX, float cXY, float cYY,
float X = 0.f, float Y = 0.f, float Z = 0.f, float tgl = 0.f,
float cPhiX = 0.f, float cPhiY = 0.f, float cPhiPhi = 0.f,
float cTglX = 0.f, float cTglY = 0.f, float cTglPhi = 0.f, float cTglTgl = 0.f,
float c1PtX = 0.f, float c1PtY = 0.f, float c1PtPhi = 0.f, float c1PtTgl = 0.f, float c1Pt21Pt2 = 0.f, float chi2 = 0.f) : EMFwdTrack(pt, eta, phi, mass, charge, dcaX, dcaY, cXX, cXY, cYY)
float c1PtX = 0.f, float c1PtY = 0.f, float c1PtPhi = 0.f, float c1PtTgl = 0.f, float c1Pt21Pt2 = 0.f, float chi2 = 0.f) : EMFwdTrack(pt, eta, phi, mass, sign, dcaX, dcaY, cXX, cXY, cYY)
{
fX = X;
fY = Y;
Expand Down
32 changes: 17 additions & 15 deletions PWGEM/Dilepton/Utils/EMTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
class EMTrack
{
public:
EMTrack(float pt, float eta, float phi, float /*mass*/, int8_t charge = 0, float dcaXY = 0.f, float dcaZ = 0.f, float CYY = 0, float CZY = 0, float CZZ = 0)
EMTrack(float pt, float eta, float phi, float /*mass*/, int8_t sign = 0, float dcaXY = 0.f, float dcaZ = 0.f, float CYY = 0, float CZY = 0, float CZZ = 0)
{
fSigned1Pt = static_cast<float>(charge) / pt;
fPt = pt;
fEta = eta;
fPhi = phi;
fSign = sign;
fDCAxy = dcaXY;
fDCAz = dcaZ;
fCYY = CYY;
Expand All @@ -42,27 +43,28 @@

~EMTrack() {}

float pt() const { return 1.f / std::fabs(fSigned1Pt); }
float pt() const { return fPt; }
float eta() const { return fEta; }
float phi() const { return fPhi; }
int8_t sign() const { return (fSigned1Pt > 0 ? +1 : -1); }
int8_t sign() const { return fSign; }
float dcaXY() const { return fDCAxy; }
float dcaZ() const { return fDCAz; }

float cYY() const { return fCYY; }
float cZY() const { return fCZY; }
float cZZ() const { return fCZZ; }

float p() const { return 1.f / std::fabs(fSigned1Pt) * std::cosh(fEta); }
float px() const { return 1.f / std::fabs(fSigned1Pt) * std::cos(fPhi); }
float py() const { return 1.f / std::fabs(fSigned1Pt) * std::sin(fPhi); }
float pz() const { return 1.f / std::fabs(fSigned1Pt) * std::sinh(fEta); }
float signed1Pt() const { return fSigned1Pt; }
float p() const { return fPt * std::cosh(fEta); }
float px() const { return fPt * std::cos(fPhi); }
float py() const { return fPt * std::sin(fPhi); }
float pz() const { return fPt * std::sinh(fEta); }
float signed1Pt() const { return fSign / fPt; }

protected:
float fSigned1Pt;
float fPt;
float fEta;
float fPhi;
int8_t fSign;
float fDCAxy;
float fDCAz;
float fCYY;
Expand All @@ -73,12 +75,12 @@
class EMTrackWithCov : public EMTrack
{
public:
EMTrackWithCov(float pt, float eta, float phi, float mass, int8_t charge = 0, float dcaXY = 0.f, float dcaZ = 0.f,
EMTrackWithCov(float pt, float eta, float phi, float mass, int8_t sign = 0, float dcaXY = 0.f, float dcaZ = 0.f,
float CYY = 0.f, float CZY = 0.f, float CZZ = 0.f,
float X = 0.f, float Y = 0.f, float Z = 0.f, float Alpha = 0.f, float Snp = 0.f, float Tgl = 0.f,
float CSnpY = 0.f, float CSnpZ = 0.f, float CSnpSnp = 0.f,
float CTglY = 0.f, float CTglZ = 0.f, float CTglSnp = 0.f, float CTglTgl = 0.f,
float C1PtY = 0.f, float C1PtZ = 0.f, float C1PtSnp = 0.f, float C1PtTgl = 0.f, float C1Pt21Pt2 = 0.f) : EMTrack(pt, eta, phi, mass, charge, dcaXY, dcaZ, CYY, CZY, CZZ)
float C1PtY = 0.f, float C1PtZ = 0.f, float C1PtSnp = 0.f, float C1PtTgl = 0.f, float C1Pt21Pt2 = 0.f) : EMTrack(pt, eta, phi, mass, sign, dcaXY, dcaZ, CYY, CZY, CZZ)
{
fX = X;
fY = Y;
Expand Down Expand Up @@ -149,7 +151,7 @@
class EMPair : public EMTrack
{
public:
EMPair(float pt, float eta, float phi, float mass, int8_t charge = 0) : EMTrack(pt, eta, phi, mass, charge, 0, 0, 0, 0, 0)
EMPair(float pt, float eta, float phi, float mass, int8_t sign = 0) : EMTrack(pt, eta, phi, mass, sign, 0, 0, 0, 0, 0)
{
fMass = mass;
fPairDCA = 999.f;
Expand All @@ -162,7 +164,7 @@

~EMPair() {}
float mass() const { return fMass; }
float rapidity() const { return std::log((std::sqrt(std::pow(fMass, 2) + std::pow(1.f / std::fabs(fSigned1Pt) * std::cosh(fEta), 2)) + 1.f / std::fabs(fSigned1Pt) * std::sinh(fEta)) / std::sqrt(std::pow(fMass, 2) + std::pow(1.f / std::fabs(fSigned1Pt), 2))); }
float rapidity() const { return std::log((std::sqrt(std::pow(fMass, 2) + std::pow(fPt * std::cosh(fEta), 2)) + fPt * std::sinh(fEta)) / std::sqrt(std::pow(fMass, 2) + std::pow(fPt, 2))); }

void setPairDCA(float dca) { fPairDCA = dca; }
float getPairDCA() const { return fPairDCA; }
Expand All @@ -188,7 +190,7 @@
float eta = std::atanh(pz / std::sqrt(std::pow(px, 2) + std::pow(py, 2) + std::pow(pz, 2)));
float phi = std::atan2(py, px);
if (phi < 0.f) {
phi += 2.f * M_PI;

Check failure on line 193 in PWGEM/Dilepton/Utils/EMTrack.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}

fVPos.SetPt(pt);
Expand All @@ -202,7 +204,7 @@
float eta = std::atanh(pz / std::sqrt(std::pow(px, 2) + std::pow(py, 2) + std::pow(pz, 2)));
float phi = std::atan2(py, px);
if (phi < 0.f) {
phi += 2.f * M_PI;

Check failure on line 207 in PWGEM/Dilepton/Utils/EMTrack.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}

fVNeg.SetPt(pt);
Expand Down Expand Up @@ -239,7 +241,7 @@
float fVz;
};

class EMTrackUL // ultra-light track. Use this when you don't care charge or DCA. e.g. dilepton-hadron correlation.
class EMTrackUL // ultra-light track. Use this when you don't care sign or DCA. e.g. dilepton-hadron correlation.
{
public:
EMTrackUL(float pt, float eta, float phi)
Expand Down
Loading