Skip to content
Merged
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
29 changes: 10 additions & 19 deletions PWGDQ/Tasks/dqEfficiency_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
// Configurable workflow for running several DQ or other PWG analyses

#include <iostream>

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

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <vector>
#include <algorithm>
#include <map>
Expand Down Expand Up @@ -311,7 +311,7 @@
auto ev2 = events.rawIteratorAt(*ev2It);
// compute 2-event quantities and mark the candidate split collisions
VarManager::FillTwoEvents(ev1, ev2);
if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
collisionSplittingMap[*ev1It] = true;
collisionSplittingMap[*ev2It] = true;
}
Expand All @@ -336,7 +336,7 @@
auto ev2 = events.rawIteratorAt(ev2It);
// compute 2-event quantities and mark the candidate split collisions
VarManager::FillTwoEvents(ev1, ev2);
if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
collisionSplittingMap[ev1It] = true;
collisionSplittingMap[ev2It] = true;
}
Expand Down Expand Up @@ -1299,7 +1299,7 @@
if (context.mOptions.get<bool>("processDummy")) {
return;
}
bool isMCGen = context.mOptions.get<bool>("processMCGen") || context.mOptions.get<bool>("processMCGenWithEventSelection");
bool isMCGen = context.mOptions.get<bool>("processMCGen");
VarManager::SetDefaultVarNames();

fEnableBarrelHistos = context.mOptions.get<bool>("processAllSkimmed") || context.mOptions.get<bool>("processBarrelOnlySkimmed") || context.mOptions.get<bool>("processBarrelOnlyWithCollSkimmed");
Expand Down Expand Up @@ -2050,7 +2050,7 @@
{
runSameEventPairing<true, VarManager::kDecayToEE, gkEventFillMapWithCov, gkTrackFillMapWithCov>(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks);
runSameEventPairing<true, VarManager::kDecayToMuMu, gkEventFillMapWithCov, gkMuonFillMapWithCov>(events, muonAssocsPerCollision, muonAssocs, muons, mcEvents, mcTracks);
// Feature replaced by processMCGen and processMCGenWithEventSelection
// Feature replaced by processMCGen
/*if (fConfigMC.runMCGenPair) {
runMCGen(mcEvents, mcTracks);
}*/
Expand All @@ -2062,7 +2062,7 @@
MyBarrelTracksWithCovWithAmbiguities const& barrelTracks, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks)
{
runSameEventPairing<true, VarManager::kDecayToEE, gkEventFillMapWithCov, gkTrackFillMapWithCov>(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks);
// Feature replaced by processMCGen and processMCGenWithEventSelection
// Feature replaced by processMCGen
/*if (fConfigMC.runMCGenPair) {
runMCGen(mcEvents, mcTracks);
}*/
Expand All @@ -2073,7 +2073,7 @@
MyBarrelTracksWithCovWithAmbiguitiesWithColl const& barrelTracks, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks)
{
runSameEventPairing<true, VarManager::kDecayToEE, gkEventFillMapWithCov, gkTrackFillMapWithCovWithColl>(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks);
// Feature replaced by processMCGen and processMCGenWithEventSelection
// Feature replaced by processMCGen
/*if (fConfigMC.runMCGenPair) {
runMCGen(mcEvents, mcTracks);
}*/
Expand All @@ -2083,19 +2083,18 @@
soa::Join<aod::ReducedMuonsAssoc, aod::MuonTrackCuts> const& muonAssocs, MyMuonTracksWithCovWithAmbiguities const& muons, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks)
{
runSameEventPairing<true, VarManager::kDecayToMuMu, gkEventFillMapWithCov, gkMuonFillMapWithCov>(events, muonAssocsPerCollision, muonAssocs, muons, mcEvents, mcTracks);
// Feature replaced by processMCGen and processMCGenWithEventSelection
// Feature replaced by processMCGen
/*if (fConfigMC.runMCGenPair) {
runMCGen(mcEvents, mcTracks);
}*/
}

void processMCGen(ReducedMCTracks const& mcTracks)
PresliceUnsorted<ReducedMCTracks> perReducedMcGenEvent = aod::reducedtrackMC::reducedMCeventId;

void processMCGen(soa::Filtered<MyEventsVtxCovSelected> const& events, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& mcTracks)
{
// loop over mc stack and fill histograms for pure MC truth signals
// group all the MC tracks which belong to the MC event corresponding to the current reconstructed event
// auto groupedMCTracks = tracksMC.sliceBy(aod::reducedtrackMC::reducedMCeventId, event.reducedMCevent().globalIndex());
// Fill Generated histograms taking into account all generated tracks
for (auto& mctrack : mcTracks) {

VarManager::FillTrackMC(mcTracks, mctrack);
// NOTE: Signals are checked here mostly based on the skimmed MC stack, so depending on the requested signal, the stack could be incomplete.
// NOTE: However, the working model is that the decisions on MC signals are precomputed during skimming and are stored in the mcReducedFlags member.
Expand All @@ -2106,13 +2105,8 @@
}
}
}
}

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

void processMCGenWithEventSelection(soa::Filtered<MyEventsVtxCovSelected> const& events,
ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& mcTracks)
{
// Fill Generated histograms taking into account selected collisions
for (auto& event : events) {
if (!event.isEventSelected_bit(0)) {
continue;
Expand All @@ -2124,9 +2118,7 @@
auto groupedMCTracks = mcTracks.sliceBy(perReducedMcGenEvent, event.reducedMCeventId());
groupedMCTracks.bindInternalIndicesTo(&mcTracks);
for (auto& track : groupedMCTracks) {

VarManager::FillTrackMC(mcTracks, track);

auto track_raw = groupedMCTracks.rawIteratorAt(track.globalIndex());
for (auto& sig : fGenMCSignals) {
if (sig->CheckSignal(true, track_raw)) {
Expand All @@ -2147,7 +2139,6 @@
PROCESS_SWITCH(AnalysisSameEventPairing, processBarrelOnlyWithCollSkimmed, "Run barrel only pairing, with skimmed tracks and with collision information", false);
PROCESS_SWITCH(AnalysisSameEventPairing, processMuonOnlySkimmed, "Run muon only pairing, with skimmed tracks", false);
PROCESS_SWITCH(AnalysisSameEventPairing, processMCGen, "Loop over MC particle stack and fill generator level histograms", false);
PROCESS_SWITCH(AnalysisSameEventPairing, processMCGenWithEventSelection, "Loop over MC particle stack and fill generator level histograms with event selection", false);
PROCESS_SWITCH(AnalysisSameEventPairing, processDummy, "Dummy function, enabled only if none of the others are enabled", false);
};

Expand Down Expand Up @@ -2312,14 +2303,14 @@
}
}
// Check that the leg cut masks make sense
if (static_cast<int>(std::floor(TMath::Log2(fLegAFilterMask))) + 1 > objArray->GetEntries()) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
LOGF(fatal, "fConfigLegAFilterMask has highest bit at position %d, but track-selection only has %d cuts!", static_cast<int>(std::floor(TMath::Log2(fLegAFilterMask))) + 1, objArray->GetEntries());

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
if (static_cast<int>(std::floor(TMath::Log2(fLegBFilterMask))) + 1 > objArray->GetEntries()) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
LOGF(fatal, "fConfigLegBFilterMask has highest bit at position %d, but track-selection only has %d cuts!", static_cast<int>(std::floor(TMath::Log2(fLegBFilterMask))) + 1, objArray->GetEntries());

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
if (static_cast<int>(std::floor(TMath::Log2(fLegCFilterMask))) + 1 > objArray->GetEntries()) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
LOGF(fatal, "fConfigLegCFilterMask has highest bit at position %d, but track-selection only has %d cuts!", static_cast<int>(std::floor(TMath::Log2(fLegCFilterMask))) + 1, objArray->GetEntries());

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}

// Get the cuts defining the legs
Expand Down Expand Up @@ -3980,7 +3971,7 @@
// The histogram classes and their components histograms are defined below depending on the name of the histogram class
//
std::unique_ptr<TObjArray> objArray(histClasses.Tokenize(";"));
for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
TString classStr = objArray->At(iclass)->GetName();
histMan->AddHistClass(classStr.Data());

Expand Down
Loading