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
28 changes: 24 additions & 4 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <iostream>

Check failure on line 18 in PWGDQ/Tasks/tableReader_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <numeric>
#include <vector>
#include <algorithm>
Expand Down Expand Up @@ -231,6 +231,7 @@

// Analysis task that produces event decisions (analysis cut, in bunch pileup and split collision check) and the Hash table used in event mixing
struct AnalysisEventSelection {

Produces<aod::EventCuts> eventSel;
Produces<aod::MixingHashes> hash;
OutputObj<THashList> fOutputList{"output"};
Expand Down Expand Up @@ -267,6 +268,8 @@

void init(o2::framework::InitContext& context)
{
LOG(info) << "Starting initialization of AnalysisEventSelection (idstoreh)";

bool isAnyProcessEnabled = context.mOptions.get<bool>("processSkimmed") || context.mOptions.get<bool>("processSkimmedWithZdc") || context.mOptions.get<bool>("processSkimmedWithMultExtra") || context.mOptions.get<bool>("processSkimmedWithMultExtraZdc");
bool isDummyEnabled = context.mOptions.get<bool>("processDummy");

Expand Down Expand Up @@ -331,6 +334,7 @@
fCCDB->setLocalObjectValidityChecking();
fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value);
fCCDBApi.init(fConfigCcdbUrl.value);
LOG(info) << "Initialization of AnalysisEventSelection finished (idstoreh)";
}

template <uint32_t TEventFillMap, typename TEvents>
Expand Down Expand Up @@ -425,7 +429,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 432 in PWGDQ/Tasks/tableReader_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 @@ -452,7 +456,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 459 in PWGDQ/Tasks/tableReader_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 @@ -551,6 +555,7 @@

void init(o2::framework::InitContext& context)
{
LOG(info) << "Starting initialization of AnalysisTrackSelection (idstoreh)";
if (context.mOptions.get<bool>("processDummy")) {
return;
}
Expand Down Expand Up @@ -600,6 +605,7 @@
fCCDB->setLocalObjectValidityChecking();
fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value);
fCCDBApi.init(fConfigCcdbUrl.value);
LOG(info) << "Initialization of AnalysisTrackSelection finished (idstoreh)";
}

template <uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvents, typename TTracks>
Expand Down Expand Up @@ -796,6 +802,7 @@

void init(o2::framework::InitContext& context)
{
LOG(info) << "Starting initialization of AnalysisMuonSelection (idstoreh)";
if (context.mOptions.get<bool>("processDummy")) {
return;
}
Expand Down Expand Up @@ -847,6 +854,7 @@
if (!o2::base::GeometryManager::isGeometryLoaded()) {
fCCDB->get<TGeoManager>(fConfigGeoPath);
}
LOG(info) << "Initialization of AnalysisMuonSelection finished (idstoreh)";
}

template <uint32_t TEventFillMap, uint32_t TMuonFillMap, typename TEvents, typename TMuons>
Expand Down Expand Up @@ -997,6 +1005,7 @@

void init(o2::framework::InitContext& context)
{
LOG(info) << "Starting initialization of AnalysisPrefilterSelection (idstoreh)";
if (context.mOptions.get<bool>("processDummy")) {
return;
}
Expand Down Expand Up @@ -1070,6 +1079,7 @@
VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill
VarManager::SetupTwoProngDCAFitter(5.0f, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, true); // TODO: get these parameters from Configurables
// VarManager::SetupTwoProngFwdDCAFitter(5.0f, true, 200.0f, 1.0e-3f, 0.9f, true);
LOG(info) << "Initialization of AnalysisPrefilterSelection finished (idstoreh)";
}

template <uint32_t TTrackFillMap, typename TTracks>
Expand Down Expand Up @@ -1247,6 +1257,7 @@

void init(o2::framework::InitContext& context)
{
LOG(info) << "Starting initialization of AnalysisSameEventPairing (idstoreh)";
fEnableBarrelHistos = context.mOptions.get<bool>("processAllSkimmed") || context.mOptions.get<bool>("processBarrelOnlySkimmed") || context.mOptions.get<bool>("processBarrelOnlyWithCollSkimmed") || context.mOptions.get<bool>("processBarrelOnlySkimmedNoCov") || context.mOptions.get<bool>("processBarrelOnlySkimmedNoCovWithMultExtra");
fEnableBarrelMixingHistos = context.mOptions.get<bool>("processMixingAllSkimmed") || context.mOptions.get<bool>("processMixingBarrelSkimmed");
fEnableMuonHistos = context.mOptions.get<bool>("processAllSkimmed") || context.mOptions.get<bool>("processMuonOnlySkimmed") || context.mOptions.get<bool>("processMuonOnlySkimmedMultExtra") || context.mOptions.get<bool>("processMixingMuonSkimmed");
Expand Down Expand Up @@ -1344,6 +1355,7 @@
}
}
}
LOG(info) << "Initialization of AnalysisSameEventPairing 1 (idstoreh)";

// get the muon track selection cuts
getTaskOptionValue<string>(context, "analysis-muon-selection", "cfgMuonCuts", tempCuts, false);
Expand Down Expand Up @@ -1425,6 +1437,8 @@
}
}

LOG(info) << "Initialization of AnalysisSameEventPairing 2 (idstoreh)";

fCurrentRun = 0;

fCCDB->setURL(fConfigCCDB.url.value);
Expand Down Expand Up @@ -1486,6 +1500,7 @@
VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill
fOutputList.setObject(fHistMan->GetMainHistogramList());
}
LOG(info) << "Finished initialization of AnalysisSameEventPairing (idstoreh)";
}

void initParamsFromCCDB(uint64_t timestamp, int runNumber, bool withTwoProngFitter = true)
Expand Down Expand Up @@ -2214,6 +2229,7 @@

void init(o2::framework::InitContext& context)
{
LOG(info) << "Initialization of AnalysisAsymmetricPairing started (idstoreh)";
if (context.mOptions.get<bool>("processDummy")) {
return;
}
Expand Down Expand Up @@ -2281,14 +2297,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 2300 in PWGDQ/Tasks/tableReader_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 2301 in PWGDQ/Tasks/tableReader_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 2303 in PWGDQ/Tasks/tableReader_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 2304 in PWGDQ/Tasks/tableReader_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 2306 in PWGDQ/Tasks/tableReader_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 2307 in PWGDQ/Tasks/tableReader_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 @@ -2442,6 +2458,7 @@
dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONHistograms.value.c_str()); // ad-hoc histograms via JSON
VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill
fOutputList.setObject(fHistMan->GetMainHistogramList());
LOG(info) << "Initialization of AnalysisAsymmetricPairing finished (idstoreh)";
}

void initParamsFromCCDB(uint64_t timestamp, bool isTriplets)
Expand Down Expand Up @@ -2919,6 +2936,7 @@

void init(o2::framework::InitContext& context)
{
LOG(info) << "Initialization of AnalysisDileptonTrack started (idstoreh)";
bool isBarrel = context.mOptions.get<bool>("processBarrelSkimmed");
bool isBarrelME = context.mOptions.get<bool>("processBarrelMixedEvent");
bool isBarrelAsymmetric = context.mOptions.get<bool>("processDstarToD0Pi");
Expand All @@ -2944,6 +2962,7 @@

// For each track/muon selection used to produce dileptons, create a separate histogram directory using the
// name of the track/muon cut.
LOG(info) << "Initialization of AnalysisDileptonTrack 1 (idstoreh)";
if (isBarrel || isMuon || isBarrelAsymmetric) {
// Get the list of single track and muon cuts computed in the dedicated tasks upstream
// We need this to know the order in which they were computed, and also to make sure that in this task we do not ask
Expand Down Expand Up @@ -2982,7 +3001,7 @@
for (int icut = 0; icut < cfgTrackSelection_objArrayTrackCuts->GetEntries(); icut++) {
fTrackCutNames.push_back(cfgTrackSelection_objArrayTrackCuts->At(icut)->GetName());
}

LOG(info) << "Initialization of AnalysisDileptonTrack 2 (idstoreh)";
// get the list of associated track cuts to be combined with the dileptons and
// check that these were computed upstream and create a bit mask
TObjArray* cfgDileptonTrack_objArrayTrackCuts = nullptr;
Expand Down Expand Up @@ -3022,7 +3041,7 @@
getTaskOptionValue<string>(context, "analysis-asymmetric-pairing", "cfgPairCuts", cfgPairing_PairCuts, false);
getTaskOptionValue<string>(context, "analysis-asymmetric-pairing", "cfgCommonTrackCuts", cfgPairing_CommonTrackCuts, false);
}

LOG(info) << "Initialization of AnalysisDileptonTrack 3 (idstoreh)";
if (cfgPairing_TrackCuts.empty()) {
LOG(fatal) << "There are no dilepton cuts specified in the upstream in the same-event-pairing or asymmetric-pairing";
}
Expand All @@ -3041,7 +3060,7 @@
}
}
} // end if (common cuts)

LOG(info) << "Initialization of AnalysisDileptonTrack 4 (idstoreh)";
// Get also the pair cuts specified via the JSON parameters
if (isBarrelAsymmetric) {
getTaskOptionValue<string>(context, "analysis-asymmetric-pairing", "cfgPairCutsJSON", cfgPairing_PairCutsJSON, false);
Expand All @@ -3068,7 +3087,7 @@
} else {
fNLegCuts = fNCuts;
}

LOG(info) << "Initialization of AnalysisDileptonTrack 5 (idstoreh)";
// loop over single lepton cuts
for (int icut = 0; icut < fNLegCuts; ++icut) {

Expand Down Expand Up @@ -3133,6 +3152,7 @@

VarManager::SetUseVars(fHistMan->GetUsedVars());
fOutputList.setObject(fHistMan->GetMainHistogramList());
LOG(info) << "Initialization of AnalysisDileptonTrack finished (idstoreh)";
}

// init parameters from CCDB
Expand Down Expand Up @@ -3514,7 +3534,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 3537 in PWGDQ/Tasks/tableReader_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