Skip to content
Draft
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
15 changes: 9 additions & 6 deletions PWGDQ/Tasks/dqEfficiency_withAssoc.cxx
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 PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Use constant references for table subscriptions in process functions.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -236,6 +236,7 @@
using MyEventsSelected = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::EventCuts, aod::ReducedMCEventLabels>;
using MyEventsVtxCov = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::ReducedMCEventLabels>;
using MyEventsVtxCovSelected = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::EventCuts, aod::ReducedMCEventLabels>;
using MyEventsVtxCovSelectedInfo = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::EventCuts, aod::ReducedMCEventLabels, aod::ReducedEventsInfo>;
using MyEventsVtxCovSelectedMultExtra = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::EventCuts, aod::ReducedEventsMultPV, aod::ReducedEventsMultAll, aod::ReducedMCEventLabels>;
using MyEventsVtxCovSelectedQvector = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::EventCuts, aod::ReducedEventsQvector>;
using MyEventsQvector = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsQvector>;
Expand Down Expand Up @@ -1732,7 +1733,7 @@
for (int isig = 0; isig < objRecSigArray->GetEntries(); ++isig) {
MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objRecSigArray->At(isig)->GetName());
if (sig) {
if (sig->GetNProngs() != 2) { // NOTE: 2-prong signals required

Check failure on line 1736 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
continue;
}
fRecMCSignals.push_back(sig);
Expand All @@ -1744,7 +1745,7 @@
if (addMCSignalsStr != "") {
std::vector<MCSignal*> addMCSignals = dqmcsignals::GetMCSignalsFromJSON(addMCSignalsStr.Data());
for (auto const& mcIt : addMCSignals) {
if (mcIt->GetNProngs() != 2) { // NOTE: only 2 prong signals

Check failure on line 1748 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
continue;
}
fRecMCSignals.push_back(mcIt);
Expand All @@ -1757,7 +1758,7 @@
for (int isig = 0; isig < objEmuRecSigArray->GetEntries(); ++isig) {
MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objEmuRecSigArray->At(isig)->GetName());
if (sig) {
if (sig->GetNProngs() != 2) { // NOTE: 2-prong signals required

Check failure on line 1761 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
continue;
}
fEmuRecMCSignals.push_back(sig);
Expand All @@ -1767,7 +1768,7 @@
if (addEmuMCSignalsStr != "") {
std::vector<MCSignal*> addEmuMCSignals = dqmcsignals::GetMCSignalsFromJSON(addEmuMCSignalsStr.Data());
for (auto const& mcIt : addEmuMCSignals) {
if (mcIt->GetNProngs() != 2) {

Check failure on line 1771 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
continue;
}
fEmuRecMCSignals.push_back(mcIt);
Expand Down Expand Up @@ -2094,7 +2095,7 @@
if (addMCSignalsGenStr != "") {
std::vector<MCSignal*> addMCSignals = dqmcsignals::GetMCSignalsFromJSON(addMCSignalsGenStr.Data());
for (auto const& mcIt : addMCSignals) {
if (mcIt->GetNProngs() > 2) { // NOTE: only 2 prong signals

Check failure on line 2098 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
continue;
}
fGenMCSignals.push_back(mcIt);
Expand All @@ -2116,7 +2117,7 @@
if (sig->GetNProngs() == 1) {
histNames += Form("MCTruthGen_%s;", sig->GetName()); // TODO: Add these names to a std::vector to avoid using Form in the process function
histNames += Form("MCTruthGenSel_%s;", sig->GetName());
} else if (sig->GetNProngs() == 2) {

Check failure on line 2120 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
histNames += Form("MCTruthGenPair_%s;", sig->GetName());
histNames += Form("MCTruthGenPairSel_%s;", sig->GetName());
histNames += Form("MCTruthGenPseudoPolPair_%s;", sig->GetName());
Expand Down Expand Up @@ -2343,8 +2344,8 @@
t1.sign() + t2.sign(), twoTrackFilter, mcDecision);

if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedTrackCollInfo) > 0) {
dielectronInfoList(t1.collisionId(), t1.trackId(), t2.trackId());
dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ());
dielectronInfoList(event.collisionId(), t1.trackId(), t2.trackId());
dileptonInfoList(event.collisionId(), event.posX(), event.posY(), event.posZ());
}
if constexpr (trackHasCov && TTwoProngFitter) {
dielectronsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauzProjected], VarManager::fgValues[VarManager::kVertexingLzProjected], VarManager::fgValues[VarManager::kVertexingLxyProjected]);
Expand Down Expand Up @@ -2433,7 +2434,7 @@
VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi],
t1.sign() + t2.sign(), twoTrackFilter, mcDecision);
if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedMuonCollInfo) > 0) {
dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ());
dileptonInfoList(event.collisionId(), event.posX(), event.posY(), event.posZ());
}

if constexpr (TTwoProngFitter) {
Expand Down Expand Up @@ -2610,8 +2611,10 @@

PresliceUnsorted<ReducedMCTracks> perReducedMcEvent = aod::reducedtrackMC::reducedMCeventId;

template <int TPairType>
void runMCGen(MyEventsVtxCovSelected const& events, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks)
template <int TPairType, typename TEvents>
void runMCGen(TEvents const& events,
ReducedMCEvents const& mcEvents,
ReducedMCTracks const& mcTracks)
{
uint32_t mcDecision = 0;
int isig = 0;
Expand Down Expand Up @@ -2689,7 +2692,7 @@
mcDecision = 0;
isig = 0;
for (auto const& sig : fGenMCSignals) {
if (sig->GetNProngs() != 2) { // NOTE: 2-prong signals required here

Check failure on line 2695 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
continue;
}
// cout << " Checking signal: " << sig->GetName() << endl;
Expand Down Expand Up @@ -2912,7 +2915,7 @@
} else {
fHistMan->FillHistClass(mcNames[2].Data(), dqefficiency_helpers::varValues());
}
if (!fConfigQA || mcNames.size() < 11) {

Check failure on line 2918 in PWGDQ/Tasks/dqEfficiency_withAssoc.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.
continue;
}
// QA fills (PM only, mirroring the dilepton MC layout: indices 3..10)
Expand Down Expand Up @@ -3068,7 +3071,7 @@
runMCGen<VarManager::kDecayToEE>(events, mcEvents, mcTracks);
}

void processBarrelOnlyWithCollSkimmed(MyEventsVtxCovSelected const& events,
void processBarrelOnlyWithCollSkimmed(MyEventsVtxCovSelectedInfo const& events,
soa::Join<aod::ReducedTracksAssoc, aod::BarrelTrackCuts, aod::Prefilter> const& barrelAssocs,
MyBarrelTracksWithCovWithAmbiguitiesWithColl const& barrelTracks, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks)
{
Expand Down Expand Up @@ -3316,7 +3319,7 @@

void processMixingElectronMuonSkimmed(soa::Filtered<MyEventsVtxCovHashSelected>& events,
soa::Join<aod::ReducedTracksAssoc, aod::BarrelTrackCuts, aod::Prefilter> const& barrelAssocs, MyBarrelTracksWithCovWithAmbiguities const& barrelTracks,
soa::Join<aod::ReducedMuonsAssoc, aod::MuonTrackCuts> const& muonAssocs, MyMuonTracksWithCovWithAmbiguities const& muons)

Check failure on line 3322 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument soa::Filtered<MyEventsVtxCovHashSelected>& events is not const&.
{
runEmuSameSideMixing<VarManager::kElectronMuon, gkEventFillMap>(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, muonAssocsPerCollision, muonAssocs, muons);
}
Expand Down
11 changes: 6 additions & 5 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ using MyEventsVtxCovSelectedMultExtra = soa::Join<aod::ReducedEvents, aod::Reduc
using MyEventsHashSelected = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::EventCuts, aod::MixingHashes>;
using MyEventsVtxCov = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov>;
using MyEventsVtxCovSelected = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::EventCuts>;
using MyEventsVtxCovSelectedInfo = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::EventCuts, aod::ReducedEventsInfo>;
using MyEventsVtxCovSelectedQvector = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsMultPV, aod::ReducedEventsMultAll, aod::ReducedEventsVtxCov, aod::EventCuts, aod::ReducedEventsQvectorCentr, aod::ReducedEventsQvectorCentrExtra>;
using MyEventsVtxCovSelectedQvectorWithHash = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsMultPV, aod::ReducedEventsMultAll, aod::ReducedEventsVtxCov, aod::EventCuts, aod::ReducedEventsQvectorCentr, aod::ReducedEventsQvectorCentrExtra, aod::MixingHashes>;
using MyEventsVtxCovZdcFitSelected = soa::Join<aod::ReducedEvents, aod::ReducedEventsExtended, aod::ReducedEventsVtxCov, aod::ReducedZdcs, aod::ReducedFITs, aod::EventCuts>;
Expand Down Expand Up @@ -2053,8 +2054,8 @@ struct AnalysisSameEventPairing {
t1.sign() + t2.sign(), twoTrackFilter, 0);

if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedTrackCollInfo) > 0) {
dielectronInfoList(t1.collisionId(), t1.trackId(), t2.trackId());
dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ());
dielectronInfoList(event.collisionId(), t1.trackId(), t2.trackId());
dileptonInfoList(event.collisionId(), event.posX(), event.posY(), event.posZ());
}
if (fConfigOptions.polarTables.value) {
dileptonPolarList(VarManager::fgValues[VarManager::kCosThetaHE], VarManager::fgValues[VarManager::kPhiHE], VarManager::fgValues[VarManager::kPhiTildeHE],
Expand Down Expand Up @@ -2175,7 +2176,7 @@ struct AnalysisSameEventPairing {
VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi],
t1.sign() + t2.sign(), twoTrackFilter, 0);
if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedMuonCollInfo) > 0) {
dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ());
dileptonInfoList(event.collisionId(), event.posX(), event.posY(), event.posZ());
}

if constexpr (TTwoProngFitter) {
Expand Down Expand Up @@ -2211,7 +2212,7 @@ struct AnalysisSameEventPairing {
}
if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedMuonCollInfo) > 0) {
if constexpr (eventHasQvector || eventHasQvectorCentr) {
dileptonFlowList(t1.collisionId(), VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kCentFT0C],
dileptonFlowList(event.collisionId(), VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kCentFT0C],
VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi], t1.sign() + t2.sign(), isFirst,
VarManager::fgValues[VarManager::kU2Q2], VarManager::fgValues[VarManager::kR2SP_AB], VarManager::fgValues[VarManager::kR2SP_AC], VarManager::fgValues[VarManager::kR2SP_BC],
VarManager::fgValues[VarManager::kU3Q3], VarManager::fgValues[VarManager::kR3SP],
Expand Down Expand Up @@ -3001,7 +3002,7 @@ struct AnalysisSameEventPairing {
runSameEventPairing<false, VarManager::kDecayToEE, gkEventFillMapWithMultExtra, gkTrackFillMap>(events, trackAssocsPerCollision, barrelAssocs, barrelTracks);
}

void processBarrelOnlyWithCollSkimmed(MyEventsVtxCovSelected const& events,
void processBarrelOnlyWithCollSkimmed(MyEventsVtxCovSelectedInfo const& events,
soa::Join<aod::ReducedTracksAssoc, aod::BarrelTrackCuts, aod::Prefilter> const& barrelAssocs,
MyBarrelTracksWithCovWithAmbiguitiesWithColl const& barrelTracks)
{
Expand Down
Loading