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
1 change: 0 additions & 1 deletion PWGDQ/Core/CutsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5084,7 +5084,6 @@
return cut;
}


if (!nameStr.compare("NoelectronStandardQualityTPCOnly")) {
cut->AddCut(VarManager::kTPCchi2, 0.0, 4.0, true, VarManager::kTPCncls, 70, 161.);
return cut;
Expand Down Expand Up @@ -5929,7 +5928,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 5931 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
44 changes: 23 additions & 21 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
#include <Math/Vector3Dfwd.h>
#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
#include <Math/Vector4Dfwd.h>
#include <TH3.h>
#include <TMath.h>
#include <TMathBase.h>
#include <TObject.h>
#include <TRandom.h>
#include <TString.h>
#include <TH3.h>

#include <KFPTrack.h>
#include <KFPVertex.h>
Expand Down Expand Up @@ -1549,8 +1549,9 @@
fgEOR = eor;
}

static void SetEventQVectorCorrection(TH3F* qvec) {
fgObjQvec = qvec;
static void SetEventQVectorCorrection(TH3F* qvec)
{
fgObjQvec = qvec;
fgApplyQVectorCorrection = true;
}

Expand Down Expand Up @@ -1884,9 +1885,9 @@
}
if constexpr ((fillMap & MuonCov) > 0 || (fillMap & ReducedMuonCov) > 0) {
o2::dataformats::GlobalFwdTrack propmuon = PropagateMuon(muontrack, collision);
double px = propmuon.getP() * sin(M_PI / 2 - atan(mfttrack.tgl())) * cos(mfttrack.phi());

Check failure on line 1888 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double py = propmuon.getP() * sin(M_PI / 2 - atan(mfttrack.tgl())) * sin(mfttrack.phi());

Check failure on line 1889 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double pz = propmuon.getP() * cos(M_PI / 2 - atan(mfttrack.tgl()));

Check failure on line 1890 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double pt = std::sqrt(std::pow(px, 2) + std::pow(py, 2));
auto mftprop = o2::aod::fwdtrackutils::getTrackParCovFwdShift(mfttrack, fgzShiftFwd);
values[kX] = mftprop.getX();
Expand Down Expand Up @@ -4952,13 +4953,13 @@
values[kVertexingLxyErr] = (KFPV.GetCovariance(0) + KFGeoTwoProng.GetCovariance(0)) * dxPair2PV * dxPair2PV + (KFPV.GetCovariance(2) + KFGeoTwoProng.GetCovariance(2)) * dyPair2PV * dyPair2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoTwoProng.GetCovariance(1)) * dxPair2PV * dyPair2PV);
values[kVertexingLzErr] = (KFPV.GetCovariance(5) + KFGeoTwoProng.GetCovariance(5)) * dzPair2PV * dzPair2PV;
values[kVertexingLxyzErr] = (KFPV.GetCovariance(0) + KFGeoTwoProng.GetCovariance(0)) * dxPair2PV * dxPair2PV + (KFPV.GetCovariance(2) + KFGeoTwoProng.GetCovariance(2)) * dyPair2PV * dyPair2PV + (KFPV.GetCovariance(5) + KFGeoTwoProng.GetCovariance(5)) * dzPair2PV * dzPair2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoTwoProng.GetCovariance(1)) * dxPair2PV * dyPair2PV + (KFPV.GetCovariance(3) + KFGeoTwoProng.GetCovariance(3)) * dxPair2PV * dzPair2PV + (KFPV.GetCovariance(4) + KFGeoTwoProng.GetCovariance(4)) * dyPair2PV * dzPair2PV);
if (fabs(values[kVertexingLxy]) < 1.e-8f)

Check failure on line 4956 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLxy] = 1.e-8f;
values[kVertexingLxyErr] = values[kVertexingLxyErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyErr]) / values[kVertexingLxy];
if (fabs(values[kVertexingLz]) < 1.e-8f)

Check failure on line 4959 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLz] = 1.e-8f;
values[kVertexingLzErr] = values[kVertexingLzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLzErr]) / values[kVertexingLz];
if (fabs(values[kVertexingLxyz]) < 1.e-8f)

Check failure on line 4962 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLxyz] = 1.e-8f;
values[kVertexingLxyzErr] = values[kVertexingLxyzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyzErr]) / values[kVertexingLxyz];
values[kVertexingTauxy] = KFGeoTwoProng.GetPseudoProperDecayTime(KFPV, KFGeoTwoProng.GetMass()) / (o2::constants::physics::LightSpeedCm2NS);
Expand Down Expand Up @@ -5362,13 +5363,13 @@
values[kVertexingLxyErr] = (KFPV.GetCovariance(0) + KFGeoThreeProng.GetCovariance(0)) * dxTriplet2PV * dxTriplet2PV + (KFPV.GetCovariance(2) + KFGeoThreeProng.GetCovariance(2)) * dyTriplet2PV * dyTriplet2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoThreeProng.GetCovariance(1)) * dxTriplet2PV * dyTriplet2PV);
values[kVertexingLzErr] = (KFPV.GetCovariance(5) + KFGeoThreeProng.GetCovariance(5)) * dzTriplet2PV * dzTriplet2PV;
values[kVertexingLxyzErr] = (KFPV.GetCovariance(0) + KFGeoThreeProng.GetCovariance(0)) * dxTriplet2PV * dxTriplet2PV + (KFPV.GetCovariance(2) + KFGeoThreeProng.GetCovariance(2)) * dyTriplet2PV * dyTriplet2PV + (KFPV.GetCovariance(5) + KFGeoThreeProng.GetCovariance(5)) * dzTriplet2PV * dzTriplet2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoThreeProng.GetCovariance(1)) * dxTriplet2PV * dyTriplet2PV + (KFPV.GetCovariance(3) + KFGeoThreeProng.GetCovariance(3)) * dxTriplet2PV * dzTriplet2PV + (KFPV.GetCovariance(4) + KFGeoThreeProng.GetCovariance(4)) * dyTriplet2PV * dzTriplet2PV);
if (fabs(values[kVertexingLxy]) < 1.e-8f)

Check failure on line 5366 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLxy] = 1.e-8f;
values[kVertexingLxyErr] = values[kVertexingLxyErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyErr]) / values[kVertexingLxy];
if (fabs(values[kVertexingLz]) < 1.e-8f)

Check failure on line 5369 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLz] = 1.e-8f;
values[kVertexingLzErr] = values[kVertexingLzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLzErr]) / values[kVertexingLz];
if (fabs(values[kVertexingLxyz]) < 1.e-8f)

Check failure on line 5372 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLxyz] = 1.e-8f;
values[kVertexingLxyzErr] = values[kVertexingLxyzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyzErr]) / values[kVertexingLxyz];

Expand Down Expand Up @@ -6080,17 +6081,17 @@
if (useCoherentJpsiA2) {
// remove daughter from TPC Q-vector
// TODO: remove based on track cut in qVectorTable
float Q2X0A = values[kQ2X0A]*values[kMultA];
float Q2Y0A = values[kQ2Y0A]*values[kMultA];
float Q2X0A = values[kQ2X0A] * values[kMultA];
float Q2Y0A = values[kQ2Y0A] * values[kMultA];
float nNorm = values[kMultA];

int centBin = static_cast<int>(values[kCentFT0C]) + 1; // centrality bin
int detIdx = 6; // TPC all
int centBin = static_cast<int>(values[kCentFT0C]) + 1; // centrality bin
int detIdx = 6; // TPC all
EventPlaneHelper epHelper;
// checkTrack(t1);
if (isSelectedinTPC(t1) && values[kAmbi1] > 0) {
float qx1 = t1.pt()*TMath::Cos(2. * t1.phi());
float qy1 = t1.pt()*TMath::Sin(2. * t1.phi());
float qx1 = t1.pt() * TMath::Cos(2. * t1.phi());
float qy1 = t1.pt() * TMath::Sin(2. * t1.phi());
if (fgApplyQVectorCorrection) {
epHelper.DoRecenter(qx1, qy1, fgObjQvec->GetBinContent(centBin, 1, detIdx + 1), fgObjQvec->GetBinContent(centBin, 2, detIdx + 1));
epHelper.DoTwist(qx1, qy1, fgObjQvec->GetBinContent(centBin, 3, detIdx + 1), fgObjQvec->GetBinContent(centBin, 4, detIdx + 1));
Expand All @@ -6102,8 +6103,8 @@
}
// checkTrack(t2);
if (isSelectedinTPC(t2) && values[kAmbi2] > 0) {
float qx2 = t2.pt()*TMath::Cos(2. * t2.phi());
float qy2 = t2.pt()*TMath::Sin(2. * t2.phi());
float qx2 = t2.pt() * TMath::Cos(2. * t2.phi());
float qy2 = t2.pt() * TMath::Sin(2. * t2.phi());
if (fgApplyQVectorCorrection) {
epHelper.DoRecenter(qx2, qy2, fgObjQvec->GetBinContent(centBin, 1, detIdx + 1), fgObjQvec->GetBinContent(centBin, 2, detIdx + 1));
epHelper.DoTwist(qx2, qy2, fgObjQvec->GetBinContent(centBin, 3, detIdx + 1), fgObjQvec->GetBinContent(centBin, 4, detIdx + 1));
Expand All @@ -6119,9 +6120,9 @@
values[kQ2Y0A] = -999.;
return;
}
Q2X0A = nNorm > 0 ? Q2X0A/nNorm : NAN;
Q2Y0A = nNorm > 0 ? Q2Y0A/nNorm : NAN;

Q2X0A = nNorm > 0 ? Q2X0A / nNorm : NAN;
Q2Y0A = nNorm > 0 ? Q2Y0A / nNorm : NAN;

float Psi2A = getEventPlane(2, Q2X0A, Q2Y0A);
values[kPsi2A] = Psi2A;
Expand Down Expand Up @@ -6154,11 +6155,11 @@
float sinPsi2CPP = b_FT0C_RF.Dot(yAxis_RF.Cross(daughterVec_RF));
float Psi2CPP = sinPsi2CPP > 0 ? TMath::ACos(cosPsi2CPP) : -1. * TMath::ACos(cosPsi2CPP);
values[kDeltaPhiPP_TPC] = phi_PP > Psi2APP ? phi_PP - Psi2APP : Psi2APP - phi_PP;
values[kDeltaPhiPP_TPC] = values[kDeltaPhiPP_TPC] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiPP_TPC] : values[kDeltaPhiPP_TPC];
values[kDeltaPhiPP_TPC] = values[kDeltaPhiPP_TPC] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiPP_TPC] : values[kDeltaPhiPP_TPC];
values[kDeltaPhiPP_FT0A] = phi_PP > Psi2BPP ? phi_PP - Psi2BPP : Psi2BPP - phi_PP;
values[kDeltaPhiPP_FT0A] = values[kDeltaPhiPP_FT0A] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiPP_FT0A] : values[kDeltaPhiPP_FT0A];
values[kDeltaPhiPP_FT0A] = values[kDeltaPhiPP_FT0A] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiPP_FT0A] : values[kDeltaPhiPP_FT0A];
values[kDeltaPhiPP_FT0C] = phi_PP > Psi2CPP ? phi_PP - Psi2CPP : Psi2CPP - phi_PP;
values[kDeltaPhiPP_FT0C] = values[kDeltaPhiPP_FT0C] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiPP_FT0C] : values[kDeltaPhiPP_FT0C];
values[kDeltaPhiPP_FT0C] = values[kDeltaPhiPP_FT0C] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiPP_FT0C] : values[kDeltaPhiPP_FT0C];
// fold delta phi to [0, pi/2]
values[kDeltaPhiPP_TPC] = values[kDeltaPhiPP_TPC] > TMath::Pi() / 2. ? TMath::Pi() - values[kDeltaPhiPP_TPC] : values[kDeltaPhiPP_TPC];
values[kDeltaPhiPP_FT0A] = values[kDeltaPhiPP_FT0A] > TMath::Pi() / 2. ? TMath::Pi() - values[kDeltaPhiPP_FT0A] : values[kDeltaPhiPP_FT0A];
Expand All @@ -6177,11 +6178,11 @@
// reaction plane
float phi = v_daughter.Phi() > TMath::Pi() ? 2. * TMath::Pi() - v_daughter.Phi() : v_daughter.Phi();
values[kDeltaPhiRP_TPC] = phi > Psi2A ? phi - Psi2A : Psi2A - phi;
values[kDeltaPhiRP_TPC] = values[kDeltaPhiRP_TPC] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiRP_TPC] : values[kDeltaPhiRP_TPC];
values[kDeltaPhiRP_TPC] = values[kDeltaPhiRP_TPC] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiRP_TPC] : values[kDeltaPhiRP_TPC];
values[kDeltaPhiRP_FT0A] = phi > Psi2B ? phi - Psi2B : Psi2B - phi;
values[kDeltaPhiRP_FT0A] = values[kDeltaPhiRP_FT0A] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiRP_FT0A] : values[kDeltaPhiRP_FT0A];
values[kDeltaPhiRP_FT0A] = values[kDeltaPhiRP_FT0A] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiRP_FT0A] : values[kDeltaPhiRP_FT0A];
values[kDeltaPhiRP_FT0C] = phi > Psi2C ? phi - Psi2C : Psi2C - phi;
values[kDeltaPhiRP_FT0C] = values[kDeltaPhiRP_FT0C] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiRP_FT0C] : values[kDeltaPhiRP_FT0C];
values[kDeltaPhiRP_FT0C] = values[kDeltaPhiRP_FT0C] > TMath::Pi() ? 2. * TMath::Pi() - values[kDeltaPhiRP_FT0C] : values[kDeltaPhiRP_FT0C];
// fold delta phi to [0, pi/2]
values[kDeltaPhiRP_TPC] = values[kDeltaPhiRP_TPC] > TMath::Pi() / 2. ? TMath::Pi() - values[kDeltaPhiRP_TPC] : values[kDeltaPhiRP_TPC];
values[kDeltaPhiRP_FT0A] = values[kDeltaPhiRP_FT0A] > TMath::Pi() / 2. ? TMath::Pi() - values[kDeltaPhiRP_FT0A] : values[kDeltaPhiRP_FT0A];
Expand Down Expand Up @@ -7045,7 +7046,8 @@
}

template <typename T>
bool VarManager::isSelectedinTPC(const T& t) {
bool VarManager::isSelectedinTPC(const T& t)
{
bool trackSelected = false;
if constexpr (requires { t.hasTPC(); }) {
trackSelected = true;
Expand Down
4 changes: 2 additions & 2 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ struct AnalysisSameEventPairing {
LOGF(fatal, "Flow resolution histograms not available in CCDB at timestamp=%llu", timestamp);
}
} else if (fConfigOptions.useLocalFlow) {
TString pathFlow = fConfigCCDB.flowPathLocal.value;
TString pathFlow = fConfigCCDB.flowPathLocal.value;
TFile* fileFlow = TFile::Open(pathFlow.Data(), "READ");
if (fileFlow == nullptr || fileFlow->IsZombie()) {
LOGF(fatal, "Flow resolution file %s cannot be opened", pathFlow.Data());
Expand Down Expand Up @@ -1955,7 +1955,7 @@ struct AnalysisSameEventPairing {
if (groupedAssocs.size() == 0) {
continue;
}

if (fillFlowReso) {
if (ResoFlowSP == nullptr || ResoFlowEP == nullptr) {
LOGF(fatal, "Flow resolution histograms are not available, cannot fill flow variables!");
Expand Down
2 changes: 1 addition & 1 deletion PWGDQ/Tasks/tableReader_withAssoc_direct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ struct AnalysisSameEventPairing {
}
} else if (fConfigOptions.useLocalFlow) {
// LOGP(info, "Developing");
TString pathFlow = fConfigCCDB.flowPathLocal.value;
TString pathFlow = fConfigCCDB.flowPathLocal.value;
TFile* fileFlow = TFile::Open(pathFlow.Data(), "READ");
if (fileFlow == nullptr || fileFlow->IsZombie()) {
LOGF(fatal, "Flow resolution file %s cannot be opened", pathFlow.Data());
Expand Down
Loading