Skip to content
Open
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
10 changes: 10 additions & 0 deletions PWGDQ/Core/CutsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3067,6 +3067,11 @@
return cut;
}

if (nameStr == "muonEtaCut") {
cut->AddCut(GetAnalysisCut("muonEtaCut"));
return cut;
}

if (nameStr == "muonMinimalCuts") {
cut->AddCut(GetAnalysisCut("muonMinimalCuts"));
return cut;
Expand Down Expand Up @@ -5999,7 +6004,7 @@
if (icase == 0) {
cut->AddCut(VarManager::kTPCnSigmaEl, -4., 4., false, VarManager::kPin, 0.0, 1e+10, false);
cut->AddCut(VarManager::kTPCnSigmaPi, -99., 2.5, true, VarManager::kPin, 0.0, 1e+10, false);
} else if (icase == 1 || icase == 2) {

Check failure on line 6007 in PWGDQ/Core/CutsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -4., 4., false, VarManager::kPin, 0.0, 1e+10, false);
cut->AddCut(VarManager::kTPCnSigmaPi_Corr, -99., 2.5, true, VarManager::kPin, 0.0, 1e+10, false);
}
Expand Down Expand Up @@ -6558,6 +6563,11 @@
return cut;
}

if (nameStr == "muonEtaCut") {
cut->AddCut(VarManager::kEta, -4.0, -2.5);
return cut;
}

if (nameStr == "muonMinimalCuts") {
cut->AddCut(VarManager::kEta, -4.0, -2.5);
cut->AddCut(VarManager::kMuonRAtAbsorberEnd, 17.6, 89.5);
Expand Down
3 changes: 0 additions & 3 deletions PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Luca,

Why do you comment here instead of removing the line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remnant of a previous test. Now removed

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <Framework/runDataProcessing.h>

#include <TH1.h>
#include <TLorentzVector.h>

Check failure on line 45 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMath.h>
#include <TString.h>

Expand Down Expand Up @@ -98,8 +98,8 @@

} // namespace muon_trk_eff_bins
// Constants
static const double muonMass = 0.105658; // in GeV from PDG

Check failure on line 101 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
static const int muonPDG = 13;

Check failure on line 102 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.

/// muon tracking efficiency task
struct tableMakerMuonMchTrkEfficiency {
Expand Down Expand Up @@ -182,7 +182,7 @@
const char* elabels[6] = {"all", "selected", "sel >0 muon", "sel >1 muon", "sel >2 muon", "sel >3 muon"};
registry.add("hEventCounter", "hEventCounter", {HistType::kTH1F, {axisEvt}});
auto hEvent = registry.get<TH1>(HIST("hEventCounter"));
for (int i = 0; i < 6; i++)

Check failure on line 185 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
hEvent->GetXaxis()->SetBinLabel(i + 1, elabels[i]);

// define axes to be used
Expand Down Expand Up @@ -227,7 +227,7 @@
registry.add("hEtaPtPhi", "hEtaPtPhi", {HistType::kTH3F, {{axisEtaRed}, {axisPt}, {axisPhiRed}}});
registry.add("selected/hEtaPtPhi", Form("hEtaPtPhi_%s", cutNamesStr.Data()), {HistType::kTH3F, {{axisEtaRed}, {axisPt}, {axisPhiRed}}});

for (int i = 0; i < 10; i++) {

Check failure on line 230 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.add(Form("selected/hNhitsPerChamber_%i", i), Form("hNhitsPerChamber_%i_%s", i, cutNamesStr.Data()), defaultNhitsPerChamber, false);
}

Expand All @@ -246,7 +246,7 @@

/// extrapolate tracks to a given r value (spherical coordinates)
/// to mimic the (x,y) position in a given chamber
void extrapolate(TLorentzVector vec, int ich, double& x, double& y)

Check failure on line 249 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
{ // i = 0..9
double zposCh[10] = {5, 5, 7, 7, 10, 10, 12.5, 12.5, 14.5, 14.5};
double theta = vec.Theta();
Expand Down Expand Up @@ -284,7 +284,7 @@
const int nChambers = 10;
bool isNChamberHit[nChambers] = {0};
double xCh[nChambers], yCh[nChambers];
TLorentzVector mvector;

Check failure on line 287 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
mvector.SetPtEtaPhiM(mPt, mEta, mPhi, muonMass);
for (int i = 0; i < nChambers; i++) {
xCh[i] = 0.;
Expand Down Expand Up @@ -420,8 +420,7 @@
for (int i = 0; i < ncuts; i++)
nselmuons.push_back(0);

rowCandidateBase.reserve(tracksMuon.size());
for (auto& muon : tracksMuon) {

Check failure on line 423 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

VarManager::FillTrack<TMuonFillMap>(muon);

Expand Down Expand Up @@ -486,9 +485,7 @@
for (int i = 0; i < ncuts; i++)
nselmuons.push_back(0);

rowCandidateBase.reserve(tracksMuon.size());
rowCandidateGen.reserve(tracksMuon.size());
for (auto& muon : tracksMuon) {

Check failure on line 488 in PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
///
/// First compute MC matched quantities using either the DQ skimmed or the Framework data models
double mGenPt = 0., mGenEta = 0., mGenPhi = 0.;
Expand Down
2 changes: 0 additions & 2 deletions PWGDQ/Tasks/taskFwdTrackPid.cxx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here, why would you comment instead of removing if this is fixing an issue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remnant of a previous test. Now removed

Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ struct taskFwdTrackPid {
template <bool TMatchedOnly, uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvent, typename Muons, typename MftTracks>
void runFwdTrackPid(TEvent const& event, Muons const& muons, MftTracks const& mftTracks)
{
fwdPidAllList.reserve(1);
for (const auto& muon : muons) {
if (muon.has_matchMFTTrack() && muon.trackType() == 0 && TMath::Abs(muon.fwdDcaX()) < fConfigMaxDCA && TMath::Abs(muon.fwdDcaY()) < fConfigMaxDCA) {
auto mftTrack = muon.template matchMFTTrack_as<MyMftTracks>();
Expand All @@ -157,7 +156,6 @@ struct taskFwdTrackPid {
template <bool TMatchedOnly, uint32_t TEventFillMap, uint32_t TEventMCFillMap, uint32_t TTrackFillMap, typename TEvent, typename Muons, typename MftTracks, typename TEventsMC, typename TTracksMC>
void runFwdTrackPidMC(TEvent const& event, Muons const& muons, MftTracks const& mftTracks, TEventsMC const& /*eventsMC*/, TTracksMC const& /*tracksMC*/)
{
fwdPidAllList.reserve(1);
for (const auto& muon : muons) {
if (muon.has_matchMFTTrack() && muon.trackType() == 0 && TMath::Abs(muon.fwdDcaX()) < fConfigMaxDCA && TMath::Abs(muon.fwdDcaY()) < fConfigMaxDCA) {
auto mftTrack = muon.template matchMFTTrack_as<MyMftTracksMC>();
Expand Down
Loading