Skip to content
Open
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
27 changes: 27 additions & 0 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <iostream>

Check failure on line 56 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 <map>
#include <memory>
#include <numeric>
Expand Down Expand Up @@ -258,7 +258,7 @@
void PrintBitMap(TMap map, int nbits)
{
for (int i = 0; i < nbits; i++) {
cout << ((map & (TMap(1) << i)) > 0 ? "1" : "0");

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

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}

Expand Down Expand Up @@ -329,7 +329,7 @@
TString eventCutJSONStr = fConfigEventCutsJSON.value;
if (eventCutJSONStr != "") {
std::vector<AnalysisCut*> jsonCuts = dqcuts::GetCutsFromJSON(eventCutJSONStr.Data());
for (auto& cutIt : jsonCuts) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
fEventCut->AddCut(cutIt);
}
}
Expand Down Expand Up @@ -389,7 +389,7 @@
fSelMap.clear();
fBCCollMap.clear();

for (auto& event : events) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
// Reset the fValues array and fill event observables
VarManager::ResetValues(0, VarManager::kNEventWiseVariables);
VarManager::FillEvent<TEventFillMap>(event);
Expand Down Expand Up @@ -480,10 +480,10 @@
auto& bc2Events = bc2It->second;

// loop over events in the first BC
for (auto ev1It : bc1Events) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
auto ev1 = events.rawIteratorAt(ev1It);
// loop over events in the second BC
for (auto ev2It : bc2Events) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
auto ev2 = events.rawIteratorAt(ev2It);
// compute 2-event quantities and mark the candidate split collisions
VarManager::FillTwoEvents(ev1, ev2);
Expand All @@ -502,7 +502,7 @@

// publish the table
uint8_t evSel = static_cast<uint8_t>(0);
for (auto& event : events) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
evSel = 0;
if (fSelMap[event.globalIndex()]) { // event passed the user cuts
evSel |= (static_cast<uint8_t>(1) << 0);
Expand Down Expand Up @@ -611,7 +611,7 @@
TString addTrackCutsStr = fConfigCutsJSON.value;
if (addTrackCutsStr != "") {
std::vector<AnalysisCut*> addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data());
for (auto& t : addTrackCuts) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
fTrackCuts.push_back(reinterpret_cast<AnalysisCompositeCut*>(t));
}
}
Expand All @@ -625,7 +625,7 @@

// set one histogram directory for each defined track cut
TString histDirNames = "TrackBarrel_BeforeCuts;";
for (auto& cut : fTrackCuts) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
histDirNames += Form("TrackBarrel_%s;", cut->GetName());
}
if (fConfigPublishAmbiguity) {
Expand Down Expand Up @@ -689,7 +689,7 @@
uint32_t filterMap = static_cast<uint32_t>(0);
int iCut = 0;

for (auto& assoc : assocs) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

// if the event from this association is not selected, reject also the association
auto event = assoc.template reducedevent_as<TEvents>();
Expand Down Expand Up @@ -1223,6 +1223,7 @@
Produces<aod::DileptonsInfo> dileptonInfoList;
Produces<aod::JPsieeCandidates> PromptNonPromptSepTable;
Produces<aod::DileptonPolarization> dileptonPolarList;
Produces<aod::DileptonsMiniTree> dileptonMiniTree;

o2::base::MatLayerCylSet* fLUT = nullptr;
int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc.
Expand Down Expand Up @@ -1275,6 +1276,13 @@
Configurable<bool> loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"};
} fConfigML;

// Configurables to create output tree (flat tables or minitree)
struct : ConfigurableGroup {
Configurable<bool> fConfigMiniTree{"useMiniTree.cfgMiniTree", false, "Produce a single flat table with minimal information for analysis"};
Configurable<float> fConfigMiniTreeMinMass{"useMiniTree.cfgMiniTreeMinMass", 2, "Min. mass cut for minitree"};
Configurable<float> fConfigMiniTreeMaxMass{"useMiniTree.cfgMiniTreeMaxMass", 5, "Max. mass cut for minitree"};
} useMiniTree;

Service<o2::ccdb::BasicCCDBManager> fCCDB;
o2::ccdb::CcdbApi fCCDBApi;

Expand Down Expand Up @@ -1697,6 +1705,9 @@
if (fConfigOptions.polarTables.value) {
dileptonPolarList.reserve(1);
}
if (useMiniTree.fConfigMiniTree) {
dileptonMiniTree.reserve(1);
}
fAmbiguousPairs.clear();
constexpr bool eventHasQvector = ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0);
constexpr bool eventHasQvectorCentr = ((TEventFillMap & VarManager::ObjTypes::CollisionQvect) > 0);
Expand Down Expand Up @@ -1971,6 +1982,22 @@
}
if (sign1 * sign2 < 0) {
PromptNonPromptSepTable(VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kVertexingTauxyProjected], VarManager::fgValues[VarManager::kVertexingTauxyProjectedPoleJPsiMass], VarManager::fgValues[VarManager::kVertexingTauzProjected], isAmbiInBunch, isAmbiOutOfBunch, VarManager::fgValues[VarManager::kMultFT0A], VarManager::fgValues[VarManager::kMultFT0C], VarManager::fgValues[VarManager::kCentFT0M], VarManager::fgValues[VarManager::kVtxNcontribReal]);
if (useMiniTree.fConfigMiniTree) {
// By default (kPt1, kEta1, kPhi1) are for the positive charge
float dileptonMass = VarManager::fgValues[VarManager::kMass];
if (dileptonMass > useMiniTree.fConfigMiniTreeMinMass && dileptonMass < useMiniTree.fConfigMiniTreeMaxMass) {
// In the miniTree the positive daughter is positioned as first
if (sign1 > 0) {
dileptonMiniTree(VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kRap],
VarManager::fgValues[VarManager::kCentFT0C], VarManager::fgValues[VarManager::kCos2DeltaPhi],
VarManager::fgValues[VarManager::kPt1], VarManager::fgValues[VarManager::kEta1], VarManager::fgValues[VarManager::kPhi1], VarManager::fgValues[VarManager::kPt2], VarManager::fgValues[VarManager::kEta2], VarManager::fgValues[VarManager::kPhi2]);
} else {
dileptonMiniTree(VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kRap],
VarManager::fgValues[VarManager::kCentFT0C], VarManager::fgValues[VarManager::kCos2DeltaPhi],
VarManager::fgValues[VarManager::kPt1], VarManager::fgValues[VarManager::kEta1], VarManager::fgValues[VarManager::kPhi1], VarManager::fgValues[VarManager::kPt2], VarManager::fgValues[VarManager::kEta2], VarManager::fgValues[VarManager::kPhi2]);
}
}
}
if constexpr (TPairType == VarManager::kDecayToMuMu) {
fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues);
if (isAmbiInBunch) {
Expand Down
Loading