Skip to content

Commit 12926d1

Browse files
author
Niveditha Ramasubramanian
committed
changes to TLorentzVector
1 parent dd32cd8 commit 12926d1

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

PWGUD/Tasks/upcPolarisationJPsiIncorr.cxx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+
// Copyright 2019-2020 CERN and copyOAright holders of ALICE O2.
22
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33
// All rights not expressly granted are reserved.
44
//
@@ -17,6 +17,7 @@
1717

1818
#include "PWGUD/DataModel/UDTables.h"
1919

20+
#include "TPDGCode.h"
2021
#include "CCDB/BasicCCDBManager.h"
2122
#include "DataFormatsParameters/GRPECSObject.h"
2223
#include "DataFormatsParameters/GRPLHCIFData.h"
@@ -25,14 +26,18 @@
2526
#include "Framework/O2DatabasePDGPlugin.h"
2627
#include "Framework/runDataProcessing.h"
2728

28-
#include "TLorentzVector.h"
29+
#include "LorentzVector.h"
2930
#include "TMath.h"
3031
#include "TRandom3.h"
3132
#include "TSystem.h"
3233

3334
#include <unordered_map>
3435
#include <vector>
3536

37+
#include "Math/Vector4D.h"
38+
39+
using namespace ROOT::Math;
40+
3641
// table for saving tree with info on data
3742
namespace dimu
3843
{
@@ -69,8 +74,7 @@ const int kReqMatchMFTTracks = 2;
6974
const int kMaxChi2MFTMatch = 30;
7075
const float kMaxZDCTime = 2.;
7176
const float kMaxZDCTimeHisto = 10.;
72-
const int kMuonPDG = 13;
73-
77+
const PDG_t kMuonPDG = kMuonPlus;
7478
struct upcPolarisationJPsiIncorr {
7579

7680
// a pdg object
@@ -209,9 +213,8 @@ struct upcPolarisationJPsiIncorr {
209213
{
210214
float rAbs = fwdTrack.rAtAbsorberEnd();
211215
float pDca = fwdTrack.pDca();
212-
TLorentzVector p;
213216
auto mMu = particleMass(kMuonPDG);
214-
p.SetXYZM(fwdTrack.px(), fwdTrack.py(), fwdTrack.pz(), mMu);
217+
LorentzVector<PxPyPzM4D<float>> p(fwdTrack.px(), fwdTrack.py(), fwdTrack.pz(), mMu);
215218
float eta = p.Eta();
216219
float pt = p.Pt();
217220

@@ -273,11 +276,10 @@ struct upcPolarisationJPsiIncorr {
273276
return;
274277

275278
// form Lorentz vectors
276-
TLorentzVector p1, p2;
277279
auto mMu = particleMass(kMuonPDG);
278-
p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu);
279-
p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu);
280-
TLorentzVector p = p1 + p2;
280+
LorentzVector<PxPyPzM4D<float>> p1(tr1.px(), tr1.py(), tr1.pz(), mMu);
281+
LorentzVector<PxPyPzM4D<float>> p2(tr2.px(), tr2.py(), tr2.pz(), mMu);
282+
LorentzVector p = p1 + p2;
281283

282284
// cut on pair kinematics
283285
// select mass

0 commit comments

Comments
 (0)