Skip to content
Closed
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
2 changes: 1 addition & 1 deletion PWGDQ/Tasks/TagAndProbe.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/TagAndProbe.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 @@ -52,7 +52,7 @@
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <iostream>

Check failure on line 55 in PWGDQ/Tasks/TagAndProbe.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 @@ -164,7 +164,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 167 in PWGDQ/Tasks/TagAndProbe.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

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

Expand Down Expand Up @@ -356,12 +356,12 @@
std::map<int, std::vector<TString>> histNames = fMuonHistNames;
int ncuts = fNCutsMuon;

//uint32_t twoTrackFilter = static_cast<uint32_t>(0);
// uint32_t twoTrackFilter = static_cast<uint32_t>(0);
int sign1 = 0;
int sign2 = 0;

if (events.size() > 0) {
for (auto& event : events) {

Check failure on line 364 in PWGDQ/Tasks/TagAndProbe.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
VarManager::ResetValues(0, VarManager::kNVars);
// VarManager::FillEvent<gkEventFillMap>(event, VarManager::fgValues);
Expand All @@ -372,7 +372,7 @@
continue;
}

for (auto& [a1, a2] : o2::soa::combinations(groupedAssocs, groupedAssocs)) {

Check failure on line 375 in PWGDQ/Tasks/TagAndProbe.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 constexpr (TPairType == VarManager::kDecayToMuMu) {
// twoTrackFilter = a1.isMuonSelected_raw() & a2.isMuonSelected_raw() & fMuonFilterMask;
// if (!twoTrackFilter) { // the tracks must have at least one filter bit in common to continue
Expand All @@ -394,10 +394,10 @@
if (sign1 * sign2 < 0) {
fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues);

if (static_cast<int>(t1.trackType()) == 3) { // t1 is the tag (track MCHMID)

Check failure on line 397 in PWGDQ/Tasks/TagAndProbe.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.
if (static_cast<int>(t2.trackType()) == 3) { // t2 is the passing probe (track MCHMID)

Check failure on line 398 in PWGDQ/Tasks/TagAndProbe.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.
fHistMan->FillHistClass(histNames[icut][1].Data(), VarManager::fgValues);
} else if (static_cast<int>(t2.trackType()) == 4) { // t2 is the failing probe (MCHStandalone)

Check failure on line 400 in PWGDQ/Tasks/TagAndProbe.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.
fHistMan->FillHistClass(histNames[icut][2].Data(), VarManager::fgValues);
} else {
continue;
Expand All @@ -418,7 +418,7 @@
runTagAndProbe<true, VarManager::kDecayToMuMu, gkEventFillMapWithCov, gkMuonFillMapWithCov>(events, muonAssocsPerCollision, muonAssocs, muons);
}

void processDummy(MyEvents&)

Check failure on line 421 in PWGDQ/Tasks/TagAndProbe.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument MyEvents& is not const&.
{
// do nothing
}
Expand All @@ -441,7 +441,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 444 in PWGDQ/Tasks/TagAndProbe.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