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
23 changes: 20 additions & 3 deletions PWGDQ/Tasks/dqEfficiency_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <TString.h>

#include <algorithm>
#include <iostream>

Check failure on line 50 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 <map>
#include <memory>
#include <string>
Expand Down Expand Up @@ -359,7 +359,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 362 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 @@ -384,7 +384,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 387 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 @@ -768,6 +768,7 @@
Configurable<std::string> fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Configurable<int64_t> fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
Configurable<float> fConfigMagField{"cfgMagField", 5.0f, "Manually set magnetic field"};
Configurable<std::string> fConfigGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};

Configurable<std::string> fConfigMCSignals{"cfgMuonMCSignals", "", "Comma separated list of MC signals"};
Expand Down Expand Up @@ -884,7 +885,9 @@
o2::base::Propagator::initFieldFromGRP(grpmag);
VarManager::SetMagneticField(grpmag->getNominalL3Field());
} else {
LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", events.begin().timestamp());
// LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", events.begin().timestamp());
// If the magnetic field is not found it is configured by had by the user
VarManager::SetMagneticField(fConfigMagField.value);
}
fCurrentRun = events.begin().runNumber();
}
Expand Down Expand Up @@ -2173,9 +2176,12 @@

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

void processMCGen(soa::Filtered<MyEventsVtxCovSelected> const& events, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& mcTracks)
void processMCGen(soa::Filtered<MyEventsVtxCovSelected> const& events, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks)
{
// Fill Generated histograms taking into account all generated tracks
uint32_t mcDecision = 0;
int isig = 0;

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.
Expand Down Expand Up @@ -2209,9 +2215,15 @@
// auto track_raw = groupedMCTracks.rawIteratorAt(track.globalIndex());
for (auto& sig : fGenMCSignals) {
if (sig->CheckSignal(true, track_raw)) {
mcDecision |= (static_cast<uint32_t>(1) << isig);
fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), VarManager::fgValues);
if (useMiniTree.fConfigMiniTree) {
auto mcEvent = mcEvents.rawIteratorAt(track_raw.reducedMCeventId());
dileptonMiniTreeGen(mcDecision, mcEvent.impactParameter(), track_raw.pt(), track_raw.eta(), track_raw.phi(), -999, -999, -999);
}
}
}
isig++;
}
} // end loop over reconstructed events
if (fHasTwoProngGenMCsignals) {
Expand All @@ -2224,12 +2236,17 @@
continue;
}
if (sig->CheckSignal(true, t1_raw, t2_raw)) {
// mcDecision |= (static_cast<uint32_t>(1) << isig);
mcDecision |= (static_cast<uint32_t>(1) << isig);
VarManager::FillPairMC<VarManager::kDecayToMuMu>(t1, t2); // NOTE: This feature will only work for muons
fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues);
if (useMiniTree.fConfigMiniTree) {
// WARNING! To be checked
dileptonMiniTreeGen(mcDecision, -999, t1.pt(), t1.eta(), t1.phi(), t2.pt(), t2.eta(), t2.phi());
}
}
}
}
isig++;
}
}
}
Expand Down Expand Up @@ -2434,14 +2451,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 2454 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 2455 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 2457 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 2458 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 2460 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 2461 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 @@ -4075,7 +4092,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 4095 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