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
2 changes: 1 addition & 1 deletion PWGEM/Dilepton/Core/DimuonCut.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

Check failure on line 11 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
//
// Class for dimuon selection
//
Expand All @@ -32,7 +32,7 @@
#include <utility>
#include <vector>

using namespace o2::aod::pwgem::dilepton::utils::emtrackutil;

Check failure on line 35 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

class DimuonCut : public TNamed
{
Expand Down Expand Up @@ -67,7 +67,7 @@
};

template <typename TPair>
bool IsSelected(TPair const& pair) const

Check failure on line 70 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
auto t1 = std::get<0>(pair);
auto t2 = std::get<1>(pair);
Expand Down Expand Up @@ -194,7 +194,7 @@
return track.nClusters() >= mMinNClustersMCHMID;

case DimuonCuts::kChi2:
return track.chi2() / (2.f * (track.nClusters() + track.nClustersMFT()) - 5.f) < mMaxChi2;
return (track.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) ? track.chi2() / (2.f * (track.nClusters() + track.nClustersMFT()) - 5.f) : track.chi2()) < mMaxChi2;

case DimuonCuts::kMatchingChi2MCHMFT:
return track.chi2MatchMCHMFT() < mMaxMatchingChi2MCHMFT;
Expand Down Expand Up @@ -236,7 +236,7 @@
void SetTrackType(int track_type); // 0: MFT-MCH-MID (global muon), 3: MCH-MID (standalone muon)
void SetTrackPtRange(float minPt = 0.f, float maxPt = 1e10f);
void SetTrackEtaRange(float minEta = -1e10f, float maxEta = 1e10f);
void SetTrackPhiRange(float minPhi = 0.f, float maxPhi = 2.f * M_PI);

Check failure on line 239 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

Check failure on line 239 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
void SetNClustersMFT(int min, int max);
void SetNClustersMCHMID(int min, int max);
void SetChi2(float min, float max);
Expand All @@ -261,7 +261,7 @@
// kinematic cuts
float mMinTrackPt{0.f}, mMaxTrackPt{1e10f}; // range in pT
float mMinTrackEta{-1e10f}, mMaxTrackEta{1e10f}; // range in eta
float mMinTrackPhi{0.f}, mMaxTrackPhi{2.f * M_PI}; // range in phi

Check failure on line 264 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

Check failure on line 264 in PWGEM/Dilepton/Core/DimuonCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

// track quality cuts
int mTrackType{3};
Expand Down
40 changes: 30 additions & 10 deletions PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ struct skimmerPrimaryMuon {
if (maxDCAxy < dcaXY) {
return false;
}
if (chi2_per_ndf < 0.f || maxChi2GL < chi2_per_ndf) {
if (maxChi2GL < chi2_per_ndf) {
return false;
}
if (rAtAbsorberEnd < minRabsGL || maxRabs < rAtAbsorberEnd) {
Expand All @@ -193,7 +193,7 @@ struct skimmerPrimaryMuon {
if (eta < minEtaSA || maxEtaSA < eta) {
return false;
}
if (chi2_per_ndf < 0.f || maxChi2SA < chi2_per_ndf) {
if (maxChi2SA < chi2_per_ndf) {
return false;
}
} else {
Expand All @@ -214,14 +214,17 @@ struct skimmerPrimaryMuon {
return;
}

o2::dataformats::GlobalFwdTrack propmuonAtPV = propagateMuon(fwdtrack, collision, propagationPoint::kToVertex);
o2::dataformats::GlobalFwdTrack propmuonAtDCA = propagateMuon(fwdtrack, collision, propagationPoint::kToDCA);
if (fwdtrack.chi2() < 0.f) { // this should never happen. only for protection.
return;
}

o2::dataformats::GlobalFwdTrack propmuonAtPV = propagateMuon(fwdtrack, collision, propagationPoint::kToVertex);
float pt = propmuonAtPV.getPt();
float eta = propmuonAtPV.getEta();
float phi = propmuonAtPV.getPhi();
o2::math_utils::bringTo02Pi(phi);

o2::dataformats::GlobalFwdTrack propmuonAtDCA = propagateMuon(fwdtrack, collision, propagationPoint::kToDCA);
float cXXatDCA = propmuonAtDCA.getSigma2X();
float cYYatDCA = propmuonAtDCA.getSigma2Y();
float cXYatDCA = propmuonAtDCA.getSigmaXY();
Expand Down Expand Up @@ -255,24 +258,41 @@ struct skimmerPrimaryMuon {
int ndf_mchmft = 1;

if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) {
// apply r-absorber cut here to minimize the number of calling propagateMuon.
if (fwdtrack.rAtAbsorberEnd() < minRabsGL || maxRabs < fwdtrack.rAtAbsorberEnd()) {
return;
}

// apply dca cut here to minimize the number of calling propagateMuon.
if (maxDCAxy < dcaXY) {
return;
}

const auto& mchtrack = fwdtrack.template matchMCHTrack_as<TFwdTracks>(); // MCH-MID
const auto& mfttrack = fwdtrack.template matchMFTTrack_as<TMFTTracks>(); // MFTsa
nClustersMFT = mfttrack.nClusters();
mftClusterSizesAndTrackFlags = mfttrack.mftClusterSizesAndTrackFlags();
ndf_mchmft = 2.f * (mchtrack.nClusters() + nClustersMFT) - 5.f;
chi2mft = mfttrack.chi2();
// chi2mft = mfttrack.chi2() / (2.f * nClustersMFT - 5.f);

// apply chi2/ndf cut here to minimize the number of calling propagateMuon.
if (maxChi2GL < fwdtrack.chi2() / ndf_mchmft) {
return;
}

o2::dataformats::GlobalFwdTrack propmuonAtPV_Matched = propagateMuon(mchtrack, collision, propagationPoint::kToVertex);
ptMatchedMCHMID = propmuonAtPV_Matched.getPt();
etaMatchedMCHMID = propmuonAtPV_Matched.getEta();
phiMatchedMCHMID = propmuonAtPV_Matched.getPhi();
o2::math_utils::bringTo02Pi(phiMatchedMCHMID);

o2::dataformats::GlobalFwdTrack propmuonAtDCA_Matched = propagateMuon(mchtrack, collision, propagationPoint::kToDCA);
float dcaX_Matched = propmuonAtDCA_Matched.getX() - collision.posX();
float dcaY_Matched = propmuonAtDCA_Matched.getY() - collision.posY();
float dcaXY_Matched = std::sqrt(dcaX_Matched * dcaX_Matched + dcaY_Matched * dcaY_Matched);
pDCA = mchtrack.p() * dcaXY_Matched;

const auto& mfttrack = fwdtrack.template matchMFTTrack_as<TMFTTracks>();
nClustersMFT = mfttrack.nClusters();
mftClusterSizesAndTrackFlags = mfttrack.mftClusterSizesAndTrackFlags();
chi2mft = mfttrack.chi2() / (2.f * nClustersMFT - 5.f);
ndf_mchmft = 2.f * (mchtrack.nClusters() + nClustersMFT) - 5.f;

if (refitGlobalMuon) {
eta = mfttrack.eta();
phi = mfttrack.phi();
Expand Down
Loading