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] Adding event selection flags to dimuonAll table #9052

Merged
merged 2 commits into from
Dec 19, 2024
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
48 changes: 24 additions & 24 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <vector>
#include <map>
#include <cmath>
#include <iostream>

Check warning on line 29 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Including iostream is discouraged. Use O2 logging instead.
#include <utility>
#include <complex>
#include <algorithm>
Expand Down Expand Up @@ -66,9 +66,9 @@

#include "Common/Core/EventPlaneHelper.h"

using std::complex;

Check warning on line 69 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[import-std-name]

Importing names from the std namespace is not allowed in headers.
using std::cout;

Check warning on line 70 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[import-std-name]

Importing names from the std namespace is not allowed in headers.
using std::endl;

Check warning on line 71 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[import-std-name]

Importing names from the std namespace is not allowed in headers.

using SMatrix55 = ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepSym<double, 5>>;
using SMatrix5 = ROOT::Math::SVector<double, 5>;
Expand Down Expand Up @@ -1335,9 +1335,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 warning on line 1338 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 warning on line 1339 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 warning on line 1340 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));
values[kX] = mfttrack.x();
values[kY] = mfttrack.y();
Expand Down Expand Up @@ -1510,30 +1510,6 @@
values[kVtxY] = event.posY();
values[kVtxZ] = event.posZ();
values[kVtxNcontrib] = event.numContrib();
if (fgUsedVars[kIsNoITSROFBorder]) {
values[kIsNoITSROFBorder] = (event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) > 0);
}
if (fgUsedVars[kIsNoTFBorder]) {
values[kIsNoTFBorder] = (event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) > 0);
}
if (fgUsedVars[kNoCollInTimeRangeStandard]) {
values[kNoCollInTimeRangeStandard] = (event.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) > 0);
}
if (fgUsedVars[kIsNoSameBunch]) {
values[kIsNoSameBunch] = (event.selection_bit(o2::aod::evsel::kNoSameBunchPileup) > 0);
}
if (fgUsedVars[kIsGoodZvtxFT0vsPV]) {
values[kIsGoodZvtxFT0vsPV] = (event.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) > 0);
}
if (fgUsedVars[kIsVertexITSTPC]) {
values[kIsVertexITSTPC] = (event.selection_bit(o2::aod::evsel::kIsVertexITSTPC) > 0);
}
if (fgUsedVars[kIsVertexTOFmatched]) {
values[kIsVertexTOFmatched] = (event.selection_bit(o2::aod::evsel::kIsVertexTOFmatched) > 0);
}
if (fgUsedVars[kIsSel8]) {
values[kIsSel8] = event.selection_bit(o2::aod::evsel::kIsTriggerTVX) && event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) && event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder);
}
if (fgUsedVars[kIsDoubleGap]) {
values[kIsDoubleGap] = (event.tag_bit(56 + kDoubleGap) > 0);
}
Expand All @@ -1560,6 +1536,30 @@
uint16_t bcInITSROF = (event.globalBC() + 3564 - fgITSROFbias) % fgITSROFlength;
values[kIsNoITSROFBorderRecomputed] = bcInITSROF > fgITSROFBorderMarginLow && bcInITSROF < fgITSROFlength - fgITSROFBorderMarginHigh ? 1.0 : 0.0;
}
if (fgUsedVars[kIsNoITSROFBorder]) {
values[kIsNoITSROFBorder] = (event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) > 0);
}
if (fgUsedVars[kIsNoTFBorder]) {
values[kIsNoTFBorder] = (event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) > 0);
}
if (fgUsedVars[kNoCollInTimeRangeStandard]) {
values[kNoCollInTimeRangeStandard] = (event.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) > 0);
}
if (fgUsedVars[kIsNoSameBunch]) {
values[kIsNoSameBunch] = (event.selection_bit(o2::aod::evsel::kNoSameBunchPileup) > 0);
}
if (fgUsedVars[kIsGoodZvtxFT0vsPV]) {
values[kIsGoodZvtxFT0vsPV] = (event.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) > 0);
}
if (fgUsedVars[kIsVertexITSTPC]) {
values[kIsVertexITSTPC] = (event.selection_bit(o2::aod::evsel::kIsVertexITSTPC) > 0);
}
if (fgUsedVars[kIsVertexTOFmatched]) {
values[kIsVertexTOFmatched] = (event.selection_bit(o2::aod::evsel::kIsVertexTOFmatched) > 0);
}
if (fgUsedVars[kIsSel8]) {
values[kIsSel8] = event.selection_bit(o2::aod::evsel::kIsTriggerTVX) && event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) && event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder);
}
if (fgUsedVars[kIsINT7]) {
values[kIsINT7] = (event.alias_bit(kINT7) > 0);
}
Expand Down Expand Up @@ -1814,7 +1814,7 @@
// if it is a displaced track longitudinally, add it to the track vector
if (abs(dca[0]) < 3.0 && abs(dca[1]) > 4.0) {
if (track.tgl() > 0.1) {
tracksP.push_back(track.z());

Check warning on line 1817 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.
}
if (track.tgl() < -0.1) {
tracksM.push_back(track.z());
Expand Down Expand Up @@ -3293,10 +3293,10 @@
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)
values[kVertexingLxy] = 1.e-8f;
values[kVertexingLxyErr] = values[kVertexingLxyErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyErr]) / values[kVertexingLxy];

Check warning on line 3296 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.
if (fabs(values[kVertexingLz]) < 1.e-8f)
values[kVertexingLz] = 1.e-8f;
values[kVertexingLzErr] = values[kVertexingLzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLzErr]) / values[kVertexingLz];

Check warning on line 3299 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.
if (fabs(values[kVertexingLxyz]) < 1.e-8f)
values[kVertexingLxyz] = 1.e-8f;
values[kVertexingLxyzErr] = values[kVertexingLxyzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyzErr]) / values[kVertexingLxyz];
Expand Down
2 changes: 2 additions & 0 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, ReducedTracks, "_0"); //! Ind
DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, ReducedTracks, "_1"); //! Index to second prong
DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, Tracks, "_0"); //! Index of first prong in Tracks table
DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, Tracks, "_1"); //! Index of second prong in Tracks table
DECLARE_SOA_BITMAP_COLUMN(EventSelection, evSelection, 8); //! Event selection bits (ambiguity, splitting candidate)
DECLARE_SOA_COLUMN(Mass, mass, float); //!
DECLARE_SOA_COLUMN(Pt, pt, float); //!
DECLARE_SOA_COLUMN(Eta, eta, float); //!
Expand Down Expand Up @@ -781,6 +782,7 @@ DECLARE_SOA_TABLE(DielectronsAll, "AOD", "RTDIELECTRONALL", //!

DECLARE_SOA_TABLE(DimuonsAll, "AOD", "RTDIMUONALL", //!
collision::PosX, collision::PosY, collision::PosZ, collision::NumContrib,
evsel::Selection, reducedpair::EventSelection,
reducedevent::MCPosX, reducedevent::MCPosY, reducedevent::MCPosZ,
reducedpair::Mass,
reducedpair::McDecision,
Expand Down
1 change: 1 addition & 0 deletions PWGDQ/Tasks/dqEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ struct AnalysisSameEventPairing {
if constexpr ((TPairType == VarManager::kDecayToMuMu) && muonHasCov) {
if (fConfigFlatTables.value) {
dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(),
event.selection_raw(), 0,
event.reducedMCevent().mcPosX(), event.reducedMCevent().mcPosY(), event.reducedMCevent().mcPosZ(),
VarManager::fgValues[VarManager::kMass],
dileptonMcDecision,
Expand Down
2 changes: 2 additions & 0 deletions PWGDQ/Tasks/dqEfficiency_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,7 @@ struct AnalysisSameEventPairing {
if (!event.isEventSelected_bit(0)) {
continue;
}
uint8_t evSel = event.isEventSelected_raw();
// Reset the fValues array
VarManager::ResetValues(0, VarManager::kNVars);
VarManager::FillEvent<gkEventFillMap>(event, VarManager::fgValues);
Expand Down Expand Up @@ -1646,6 +1647,7 @@ struct AnalysisSameEventPairing {
dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]);
if (fConfigOptions.flatTables.value) {
dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(),
event.selection_raw(), evSel,
-999., -999., -999.,
VarManager::fgValues[VarManager::kMass],
mcDecision,
Expand Down
1 change: 1 addition & 0 deletions PWGDQ/Tasks/tableReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ struct AnalysisSameEventPairing {
dimuonExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]);
if (fConfigFlatTables.value) {
dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(),
event.selection_raw(), 0,
-999., -999., -999.,
VarManager::fgValues[VarManager::kMass],
false,
Expand Down
2 changes: 2 additions & 0 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,7 @@ struct AnalysisSameEventPairing {
if (!event.isEventSelected_bit(0)) {
continue;
}
uint8_t evSel = event.isEventSelected_raw();
// Reset the fValues array
VarManager::ResetValues(0, VarManager::kNVars);
VarManager::FillEvent<gkEventFillMap>(event, VarManager::fgValues);
Expand Down Expand Up @@ -1548,6 +1549,7 @@ struct AnalysisSameEventPairing {
dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]);
if (fConfigOptions.flatTables.value) {
dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(),
event.selection_raw(), evSel,
-999., -999., -999.,
VarManager::fgValues[VarManager::kMass],
false,
Expand Down
Loading