Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PWGDQ] fix bug in tableMakerMuonTrkEfficiency #9475

Merged
merged 2 commits into from
Jan 24, 2025
Merged
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
8 changes: 5 additions & 3 deletions PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
///
/// \author Zaida Conesa del Valle <[email protected]>
///
#include <iostream>

#include <vector>
#include <memory>
#include <string>
#include <algorithm>
#include <TH1F.h>
#include <TH3F.h>
Expand All @@ -27,7 +29,7 @@
#include <TList.h>
#include <TString.h>
#include <TLorentzVector.h>
#include "TDatabasePDG.h"

Check warning on line 32 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Direct use of TDatabasePDG is not allowed. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG>.
//
#include "Common/DataModel/TrackSelectionTables.h"
//
Expand Down Expand Up @@ -128,8 +130,8 @@

using myMuons = soa::Join<aod::FwdTracks, aod::FwdTracksDCA>;
using myMuonsMC = soa::Join<aod::FwdTracks, aod::McFwdTrackLabels, aod::FwdTracksDCA>;
using myReducedMuons = soa::Join<aod::ReducedMuons, aod::ReducedMuonsExtra, aod::ReducedMuonsInfo>;
using myReducedMuonsMC = soa::Join<aod::ReducedMuons, aod::ReducedMuonsExtra, aod::ReducedMuonsLabels, aod::ReducedMuonsInfo>;
using myReducedMuons = soa::Join<aod::ReducedMuons, aod::ReducedMuonsExtra>;
using myReducedMuonsMC = soa::Join<aod::ReducedMuons, aod::ReducedMuonsExtra, aod::ReducedMuonsLabels>;

// bit maps used for the Fill functions of the VarManager
constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision;
Expand Down Expand Up @@ -246,9 +248,9 @@
double zposCh[10] = {5, 5, 7, 7, 10, 10, 12.5, 12.5, 14.5, 14.5};
double theta = vec.Theta();
double phi = vec.Phi();
double r = zposCh[ich] / TMath::Cos(theta);

Check warning on line 251 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
double myx = r * TMath::Sin(theta) * TMath::Cos(phi);

Check warning on line 252 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
double myy = r * TMath::Sin(theta) * TMath::Sin(phi);

Check warning on line 253 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
x = myx;
y = myy;
}
Expand Down Expand Up @@ -423,7 +425,7 @@
LOGF(debug, " %i / %f / %f / %f", muon.trackType(), muon.eta(), muon.pt(), muon.p());
int mType = muon.trackType();
double mPt = muon.pt();
double mEta = TMath::Abs(muon.eta());

Check warning on line 428 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
double mPhi = muon.phi();
uint16_t mchBitmap = muon.mchBitMap();

Expand Down Expand Up @@ -497,12 +499,12 @@
LOGF(warning, "MC particle PDG code not found, skip...");
continue;
}
if (TMath::Abs(particle.pdgCode()) != muonPDG) {

Check warning on line 502 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
LOGF(warning, "MC particle does not correspond to a muon, skip...");
continue;
}
mGenPt = particle.pt();
mGenEta = TMath::Abs(particle.eta());

Check warning on line 507 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
mGenPhi = particle.phi();
}
if constexpr ((TMuonFillMap & VarManager::ObjTypes::Muon) > 0) {
Expand All @@ -519,12 +521,12 @@

auto particlePdgCode = particle.pdgCode();

if (TMath::Abs(particlePdgCode) != muonPDG) {

Check warning on line 524 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
LOGF(warning, "MC particle does not correspond to a muon, skip...");
continue;
}
mGenPt = particle.pt();
mGenEta = TMath::Abs(particle.eta());

Check warning on line 529 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
mGenPhi = particle.phi();
}

Expand All @@ -535,7 +537,7 @@
LOGF(debug, " %i / %f / %f / %f", muon.trackType(), muon.eta(), muon.pt(), muon.p());
int mType = muon.trackType();
double mPt = muon.pt();
double mEta = TMath::Abs(muon.eta());

Check warning on line 540 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
double mPhi = muon.phi();
uint16_t mchBitmap = muon.mchBitMap();

Expand Down
Loading