|
20 | 20 | #include <unordered_map> |
21 | 21 |
|
22 | 22 | #include "Framework/runDataProcessing.h" |
| 23 | +#include "Framework/O2DatabasePDGPlugin.h" |
23 | 24 | #include "Framework/AnalysisTask.h" |
24 | 25 | #include "Framework/AnalysisDataModel.h" |
25 | 26 | #include "CCDB/BasicCCDBManager.h" |
26 | 27 | #include "DataFormatsParameters/GRPLHCIFData.h" |
27 | 28 | #include "DataFormatsParameters/GRPECSObject.h" |
28 | 29 | #include "PWGUD/DataModel/UDTables.h" |
29 | 30 |
|
30 | | -#include "TDatabasePDG.h" |
| 31 | +//#include "TDatabasePDG.h" |
31 | 32 | #include "TLorentzVector.h" |
32 | 33 | #include "TSystem.h" |
33 | 34 | #include "TMath.h" |
@@ -167,7 +168,7 @@ const float kPtMin = 0.; |
167 | 168 | struct fwdMuonsUPC { |
168 | 169 |
|
169 | 170 | // a pdg object |
170 | | - TDatabasePDG* pdg = nullptr; |
| 171 | + Service<o2::framework::O2DatabasePDG> pdg; |
171 | 172 |
|
172 | 173 | using CandidatesFwd = soa::Join<o2::aod::UDCollisions, o2::aod::UDCollisionsSelsFwd>; |
173 | 174 | using ForwardTracks = soa::Join<o2::aod::UDFwdTracks, o2::aod::UDFwdTracksExtra>; |
@@ -227,7 +228,7 @@ struct fwdMuonsUPC { |
227 | 228 | void init(InitContext&) |
228 | 229 | { |
229 | 230 | // PDG |
230 | | - pdg = TDatabasePDG::Instance(); |
| 231 | + //pdg = TDatabasePDG::Instance(); |
231 | 232 |
|
232 | 233 | // binning of pT axis fr fit |
233 | 234 | std::vector<double> ptFitBinning = { |
@@ -338,13 +339,14 @@ struct fwdMuonsUPC { |
338 | 339 | // FUNCTIONS |
339 | 340 |
|
340 | 341 | // retrieve particle mass (GeV/c^2) from TDatabasePDG |
341 | | - float particleMass(TDatabasePDG* pdg, int pid) |
| 342 | + float particleMass(int pid) |
342 | 343 | { |
343 | | - auto mass = 0.; |
344 | | - TParticlePDG* pdgparticle = pdg->GetParticle(pid); |
345 | | - if (pdgparticle != nullptr) { |
346 | | - mass = pdgparticle->Mass(); |
347 | | - } |
| 344 | + auto mass = pdg->Mass(pid); |
| 345 | + |
| 346 | + //auto pdgparticle = pdg->GetParticle(pid); |
| 347 | + //if (pdgparticle != nullptr) { |
| 348 | + // mass = pdgparticle->Mass(); |
| 349 | + //} |
348 | 350 | return mass; |
349 | 351 | } |
350 | 352 |
|
@@ -446,7 +448,7 @@ struct fwdMuonsUPC { |
446 | 448 | float rAbs = fwdTrack.rAtAbsorberEnd(); |
447 | 449 | float pDca = fwdTrack.pDca(); |
448 | 450 | TLorentzVector p; |
449 | | - auto mMu = particleMass(pdg, 13); |
| 451 | + auto mMu = particleMass(13); |
450 | 452 | p.SetXYZM(fwdTrack.px(), fwdTrack.py(), fwdTrack.pz(), mMu); |
451 | 453 | float eta = p.Eta(); |
452 | 454 | float pt = p.Pt(); |
@@ -530,7 +532,7 @@ struct fwdMuonsUPC { |
530 | 532 |
|
531 | 533 | // form Lorentz vectors |
532 | 534 | TLorentzVector p1, p2; |
533 | | - auto mMu = particleMass(pdg, 13); |
| 535 | + auto mMu = particleMass(13); |
534 | 536 | p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); |
535 | 537 | p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); |
536 | 538 | TLorentzVector p = p1 + p2; |
@@ -655,7 +657,7 @@ struct fwdMuonsUPC { |
655 | 657 |
|
656 | 658 | // create Lorentz vectors |
657 | 659 | TLorentzVector p1, p2; |
658 | | - auto mMu = particleMass(pdg, 13); |
| 660 | + auto mMu = particleMass(13); |
659 | 661 | p1.SetXYZM(McPart1.px(), McPart1.py(), McPart1.pz(), mMu); |
660 | 662 | p2.SetXYZM(McPart2.px(), McPart2.py(), McPart2.pz(), mMu); |
661 | 663 | TLorentzVector p = p1 + p2; |
@@ -750,7 +752,7 @@ struct fwdMuonsUPC { |
750 | 752 |
|
751 | 753 | // form Lorentz vectors |
752 | 754 | TLorentzVector p1, p2; |
753 | | - auto mMu = particleMass(pdg, 13); |
| 755 | + auto mMu = particleMass(13); |
754 | 756 | p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); |
755 | 757 | p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); |
756 | 758 | TLorentzVector p = p1 + p2; |
|
0 commit comments