Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
if (runNumber != lastRunNumber) {
lastRunNumber = runNumber; // do it only once

if (runNumber >= 500000) {

Check failure on line 589 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.
auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), runNumber);
// first bc of the first orbit
bcSOR = runInfo.orbitSOR * o2::constants::lhc::LHCMaxBunches;
Expand Down Expand Up @@ -779,8 +779,8 @@
if (!col.selection_bit(kNoITSROFrameBorder))
continue;

std::vector<int> vCollsAssocToGivenColl = vCollsInTimeWin[colIndex];
std::vector<float> vCollsTimeDeltaWrtGivenColl = vTimeDeltaForColls[colIndex];
const std::vector<int>& vCollsAssocToGivenColl = vCollsInTimeWin[colIndex];
const std::vector<float>& vCollsTimeDeltaWrtGivenColl = vTimeDeltaForColls[colIndex];

LOGP(debug, " >> vCollsAssocToGivenColl.size={}", vCollsAssocToGivenColl.size());

Expand Down Expand Up @@ -1308,11 +1308,11 @@
float phiInitial = phi;

if (confUsePhiAtTPCinnerR) {
phi -= asin(confRadiusForPhiCorrection /*inner TPC radius*/ / 2 * 0.3 * sign * 0.5 / pt);

Check failure on line 1311 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (phi < 0)
phi += TMath::TwoPi();

Check failure on line 1313 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
else if (phi > TMath::TwoPi())
phi -= TMath::TwoPi();

Check failure on line 1315 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}

bool etaInRange = true;
Expand All @@ -1321,7 +1321,7 @@
if (confUseAorCsideForPhiStudy == 1 && eta > -0.1) // check if we are in C side
etaInRange = false;

if (occupancy >= 0 && fabs(eta) < 0.8 && pt > 0.15 && etaInRange) {

Check failure on line 1324 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (nPV >= 10 && nPV < 200) {
if (isGoodGlobal) {
if (flagWhichDeltaTimeWin == 1 && flagNoCollNearby) {
Expand Down Expand Up @@ -1495,7 +1495,7 @@
float pt = track.pt();
float eta = track.eta();

if (fabs(eta) > 0.8)

Check failure on line 1498 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;
if (pt < 0.15)
continue;
Expand All @@ -1516,13 +1516,13 @@
float phiAtR = track.phi();
if (iRadius > 0) {
histos.fill(HIST("THnD_histos/QA_under_asin"), R / 2 * 0.3 * sign * 0.5 / pt);
histos.fill(HIST("THnD_histos/QA_asin"), asin(R / 2 * 0.3 * sign * 0.5 / pt));

Check failure on line 1519 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

phiAtR -= asin(R / 2 * 0.3 * sign * 0.5 / pt);

Check failure on line 1521 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (phiAtR < 0)
phiAtR += TMath::TwoPi();

Check failure on line 1523 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
else if (phiAtR > TMath::TwoPi())
phiAtR -= TMath::TwoPi();

Check failure on line 1525 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}
histos.fill(HIST("THnD_histos/phi_R_qOp_IR_occ_centr_eta"), phiAtR, iRadius, qpt, IR, occupancy, nPV, eta);
}
Expand Down
2 changes: 1 addition & 1 deletion DPG/Tasks/AOTEvent/eventSelectionQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ struct EventSelectionQaTask {
bool isVertexUPC = flags & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode; // is vertex with UPC settings

// the second collision in ROF
std::vector<int> vAssocToSameROF = vCollsInSameITSROF[colIndex];
const std::vector<int>& vAssocToSameROF = vCollsInSameITSROF[colIndex];
int thisColIndex = vAssocToSameROF[0];
float vZassoc = vCollVz[thisColIndex]; // vZ of the second collision in the same ROF
float nPVassoc = vTracksITS567perColl[thisColIndex]; // n PV tracks of the second collision in the same ROF
Expand Down
6 changes: 3 additions & 3 deletions DPG/Tasks/AOTEvent/rofOccupancyQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ struct RofOccupancyQaTask {
// LOGP(info, "#### starting new coll: bc={} bcInTF={} bcInITSROF={} rofId={}; noROFborder={}; rofOffset={} rofLength={}", vFoundGlobalBC[colIndex], bcInTF, bcInITSROF, rofId, bc.selection_bit(kNoITSROFrameBorder), rofOffset, rofLength);
// LOGP(info, "#### starting new coll: bcInTF={} bcInITSROF={} rofIdInTF={}; noROFborder={}, vZ={} mult={}; rofOffset={} rofLength={}", bcInTF, bcInITSROF, rofIdInTF, bc.selection_bit(kNoITSROFrameBorder), vZ, vTracksITS567perColl[colIndex], rofOffset, rofLength);

std::vector<int> vAssocToSameROF = vCollsInSameITSROF[colIndex];
const std::vector<int>& vAssocToSameROF = vCollsInSameITSROF[colIndex];
int nITS567tracksForRofVetoStrict = 0; // to veto events with other collisions in the same ITS ROF
float nSumAmplFT0CforRofVetoStrict = 0; // to veto events with other collisions in the same ITS ROF
// int nITS567tracksForRofVetoStandard = 0; // to veto events with other collisions in the same ITS ROF, with per-collision multiplicity above threshold
Expand Down Expand Up @@ -836,8 +836,8 @@ struct RofOccupancyQaTask {
vArrNoCollInSameRofWithCloseVz.push_back(vVzCutThisColl);
continue;
}
std::vector<int> vAssocToThisCol = vCollsInTimeWin[colIndex];
std::vector<float> vCollsTimeDeltaWrtGivenColl = vTimeDeltaForColls[colIndex];
const std::vector<int>& vAssocToThisCol = vCollsInTimeWin[colIndex];
const std::vector<float>& vCollsTimeDeltaWrtGivenColl = vTimeDeltaForColls[colIndex];
int nITS567tracksInFullTimeWindow = 0;
int sumAmpFT0CInFullTimeWindow = 0;
int nITS567tracksForVetoNarrow = 0; // to veto events with nearby collisions (narrower range)
Expand Down
6 changes: 3 additions & 3 deletions DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ struct tofPidQa {
int evtimeflag = 0;

if constexpr (fillHistograms) {
for (auto t : tracks) {
for (const auto& t : tracks) {
if (!t.hasTOF()) { // Skipping tracks without TOF
continue;
}
Expand Down Expand Up @@ -529,7 +529,7 @@ struct tofPidQa {
soa::Filtered<TrackCandidates> const& tracks)
{
isEventSelected<true>(collision, tracks);
for (auto t : tracks) {
for (const auto& t : tracks) {
isTrackSelected<true>(collision, t);
}
}
Expand All @@ -543,7 +543,7 @@ struct tofPidQa {
return;
}

for (auto t : tracks) {
for (const auto& t : tracks) {
if (!isTrackSelected<false>(collision, t)) {
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ struct tofPidQaDynamic {
int evtimeflag = 0;

if constexpr (fillHistograms) {
for (auto t : tracks) {
for (const auto& t : tracks) {
if (!t.hasTOF()) { // Skipping tracks without TOF
continue;
}
Expand Down Expand Up @@ -554,7 +554,7 @@ struct tofPidQaDynamic {
tofResponse->processSetup(collision.bc_as<o2::aod::BCsWithTimestamps>());

isEventSelected<true>(collision, tracks);
for (auto t : tracks) {
for (const auto& t : tracks) {
isTrackSelected<true>(collision, t);
}
}
Expand All @@ -568,7 +568,7 @@ struct tofPidQaDynamic {
return;
}

for (auto t : tracks) {
for (const auto& t : tracks) {
if (!isTrackSelected<false>(collision, t)) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct tofPidCollisionTimeQa {
}

listEfficiency.setObject(new THashList);
auto makeEfficiency = [&](TString effname, TString efftitle) {
auto makeEfficiency = [&](const TString& effname, const TString& efftitle) {
listEfficiency->Add(new TEfficiency(effname, efftitle + ";TOF multiplicity;Efficiency", nBinsMultiplicity, 0, rangeMultiplicity));
};

Expand Down
2 changes: 1 addition & 1 deletion DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ struct perfK0sResolution {
}

template <typename TCollision>
bool isEventAccepted(TCollision collision, bool fillHists)
bool isEventAccepted(const TCollision& collision, bool fillHists)
// check whether the collision passes our collision selections
{
if (fillHists)
Expand Down
12 changes: 6 additions & 6 deletions DPG/Tasks/AOTTrack/qaEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ struct QaEfficiency {
subList->SetName(partName);
listEfficiencyMC->Add(subList);

auto makeEfficiency = [&](const TString effname, auto h) { // 1D efficiencies
auto makeEfficiency = [&](const TString& effname, const auto& h) { // 1D efficiencies
LOG(debug) << " Making 1D TEfficiency " << effname << " from " << h->GetName();
const TAxis* axis = h->GetXaxis();
TString efftitle = h->GetTitle();
Expand Down Expand Up @@ -563,7 +563,7 @@ struct QaEfficiency {
makeEfficiency("ITS-TPC_vsPhi_Prm_Trk", hPhiTrkItsTpcPrm[histogramIndex]);
makeEfficiency("ITS-TPC-TOF_vsPhi_Prm", hPhiItsTpcTofPrm[histogramIndex]);

auto makeEfficiency2D = [&](const TString effname, auto h) { // 2D efficiencies
auto makeEfficiency2D = [&](const TString& effname, const auto& h) { // 2D efficiencies
LOG(debug) << " Making 2D TEfficiency " << effname << " from " << h->GetName();
const TAxis* axisX = h->GetXaxis();
const TAxis* axisY = h->GetYaxis();
Expand Down Expand Up @@ -898,7 +898,7 @@ struct QaEfficiency {
listEfficiencyData.setObject(new THashList);
if (makeEff) {
LOG(debug) << "Making TEfficiency for Data";
auto makeEfficiency = [&](TString effname, TString efftitle, auto templateHisto, TEfficiency*& eff) {
auto makeEfficiency = [&](const TString& effname, const TString& efftitle, auto templateHisto, TEfficiency*& eff) {
TAxis* axis = histos.get<TH1>(templateHisto)->GetXaxis();
if (axis->IsVariableBinSize()) {
eff = new TEfficiency(effname, efftitle, axis->GetNbins(), axis->GetXbins()->GetArray());
Expand Down Expand Up @@ -927,7 +927,7 @@ struct QaEfficiency {
"TPC-TOF M.E. in data " + tagPhi + ";#it{#varphi} (rad);Efficiency", HIST("Data/pos/phi/its_tpc_tof"),
effTPCTOFMatchingVsPhi);

auto makeEfficiency2D = [&](TString effname, TString efftitle, auto templateHistoX, auto templateHistoY, TEfficiency*& eff) {
auto makeEfficiency2D = [&](const TString& effname, const TString& efftitle, auto templateHistoX, auto templateHistoY, TEfficiency*& eff) {
TAxis* axisX = histos.get<TH1>(templateHistoX)->GetXaxis();
TAxis* axisY = histos.get<TH1>(templateHistoY)->GetYaxis();
if (axisX->IsVariableBinSize() || axisY->IsVariableBinSize()) {
Expand Down Expand Up @@ -1366,7 +1366,7 @@ struct QaEfficiency {
}

// Filling 1D efficiencies
auto doFillEfficiency = [&](const TString effname, auto num, auto den) {
auto doFillEfficiency = [&](const TString& effname, const auto& num, const auto& den) {
TEfficiency* eff = static_cast<TEfficiency*>(subList->FindObject(effname));
if (!eff) {
LOG(warning) << "Cannot find TEfficiency " << effname;
Expand Down Expand Up @@ -1436,7 +1436,7 @@ struct QaEfficiency {
}

// Filling 2D efficiencies
auto fillEfficiency2D = [&](const TString effname, auto num, auto den) {
auto fillEfficiency2D = [&](const TString& effname, const auto& num, const auto& den) {
TEfficiency* eff = static_cast<TEfficiency*>(subList->FindObject(effname));
if (!eff) {
LOG(warning) << "Cannot find TEfficiency " << effname;
Expand Down
4 changes: 2 additions & 2 deletions DPG/Tasks/AOTTrack/qaEventTrackLite.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct qaEventTrackLite {
///
return initBBok ? mMip * o2::common::BetheBlochAleph(x[0] / par[0], mBetheBlockAleph[0], mBetheBlockAleph[1], mBetheBlockAleph[2], mBetheBlockAleph[3], mBetheBlockAleph[4]) * std::pow(par[1], mChargeFactor) : 0.;
}
void setUpBetheBlockAleph(std::string str_case)
void setUpBetheBlockAleph(const std::string& str_case)
{
if (str_case.find("LHC22c") != std::string::npos) {
// From A. Kalteyer (2022 Jul 18)
Expand Down Expand Up @@ -418,7 +418,7 @@ struct qaEventTrackLite {
histos.fill(HIST("Tracks/TPC/dEdxvsP"), p, track.tpcSignal());
histos.fill(HIST("Tracks/TPC/dEdxvsPvsEta"), p, track.eta(), track.tpcSignal());
if (betheBlock.initBBok) {
auto tpcdEdxRes = [&](TF1 func) { return track.tpcSignal() - func.Eval(p); };
auto tpcdEdxRes = [&](const TF1& func) { return track.tpcSignal() - func.Eval(p); };
if (b_tpcResProton) {
histos.fill(HIST("Tracks/TPC/dEdxvsPproton"), p, tpcdEdxRes(funcBBproton));
histos.fill(HIST("Tracks/TPC/dEdxvsPprotonvsEta"), p, track.eta(), tpcdEdxRes(funcBBproton));
Expand Down
10 changes: 6 additions & 4 deletions DPG/Tasks/AOTTrack/qaTrackSplitting.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <cstdint>
#include <map>
#include <memory>
#include <type_traits>
#include <vector>

using namespace o2;
Expand Down Expand Up @@ -134,10 +135,11 @@ struct qaTrackSplitting {
if (!collision.sel8()) {
return;
}
typedef std::shared_ptr<TrackCandidatesMC::iterator> trkType;
using TrackType = const TrackCandidatesMC::iterator;
using TrackTypePtr = std::shared_ptr<TrackType>;

std::map<int64_t, std::vector<trkType>> particleUsageCounter;
for (auto track : tracks) {
std::map<int64_t, std::vector<TrackTypePtr>> particleUsageCounter;
for (const auto& track : tracks) {
histos.fill(HIST("tracks"), 0);
if (!track.has_mcParticle()) {
continue;
Expand All @@ -156,7 +158,7 @@ struct qaTrackSplitting {
continue;
}
histos.fill(HIST("tracks"), 4);
particleUsageCounter[track.mcParticleId()].push_back(std::make_shared<decltype(track)>(track));
particleUsageCounter[track.mcParticleId()].push_back(std::make_shared<TrackType>(track));
}
for (const auto& [mcId, tracksMatched] : particleUsageCounter) {
histos.fill(HIST("numberOfRecoed"), tracksMatched.size());
Expand Down
2 changes: 1 addition & 1 deletion DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ struct ProbeThirdTrack {
}

template <uint8_t channel, bool doMc, typename TTrackIndices, typename TTrack, typename TTracks, typename PParticles>
void loopOverThirdTrack(TTrackIndices const& groupedTrackThirdIndices, TTracks const& /*tracks*/, TTrack const& trackFirst, TTrack const& trackSecond, PParticles const mcParticles, const int motherIdxTag, const float radius)
void loopOverThirdTrack(TTrackIndices const& groupedTrackThirdIndices, TTracks const& /*tracks*/, TTrack const& trackFirst, TTrack const& trackSecond, PParticles const& mcParticles, const int motherIdxTag, const float radius)
{
for (const auto& trackIndex : groupedTrackThirdIndices) {
auto trackThird = trackIndex.template track_as<TTracks>();
Expand Down
4 changes: 2 additions & 2 deletions DPG/Tasks/ITS/filterTracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ struct FilterTracks {
{
}

void fillTableData(auto track)
void fillTableData(const auto& track)
{

filteredTracksCollIdx(track.collisionId());
Expand All @@ -235,7 +235,7 @@ struct FilterTracks {
filteredTracksTableExtraDet(track.itsClusterSizes(), track.itsChi2NCl(), track.tpcChi2NCl(), track.tpcNClsFound(), track.trackTime());
}

void fillTableDataMC(auto track, aod::McParticles const& mcParticles)
void fillTableDataMC(const auto& track, aod::McParticles const& mcParticles)
{

fillTableData(track);
Expand Down
Loading