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: 13 additions & 15 deletions PWGLF/Tasks/QC/v0cascadesqa.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 PWGLF/Tasks/QC/v0cascadesqa.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 All @@ -19,8 +19,8 @@

#include <cmath>
// #include <cstdlib>
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Common/CCDB/ctpRateFetcher.h"
#include "Common/Core/TrackSelection.h"
Expand Down Expand Up @@ -53,7 +53,7 @@
kXiM,
kXiP,
kOmegaM,
kOmegaP};
kOmegaP };

// using DaughterTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTOFPi, aod::pidTPCPi, aod::pidTOFPr, aod::pidTPCPr, aod::pidTOFKa, aod::pidTPCKa>;
using DaughterTracks = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCPr, aod::pidTPCKa>;
Expand Down Expand Up @@ -279,7 +279,7 @@
ConfigurableAxis axisCascDCABachToPV{"axisCascDCABachToPV", {100, -1.0f, 1.0f}, "DCA bach. to PV (cm)"};
ConfigurableAxis axisInvMassXi{"axisInvMassXi", {80, 1.28f, 1.36f}, "Inv. mass (GeV/#it{c}%{2})"};
ConfigurableAxis axisInvMassOmega{"axisInvMassOmega", {80, 1.63f, 1.71f}, "Inv. mass (GeV/#it{c}%{2})"};

} axisConfigurations;

int dauEtaFlag = 0;
Expand Down Expand Up @@ -631,7 +631,7 @@
return false;

// armenteros (for K0s only)
if (v0Type == kK0s && v0Selections.armPodCut > 1e-4 && v0.qtarm() * v0Selections.armPodCut < std::abs(v0.alpha()))

Check failure on line 634 in PWGLF/Tasks/QC/v0cascadesqa.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.
return false;

// rapidity
Expand Down Expand Up @@ -675,7 +675,7 @@
if (negTrackExtra.itsChi2NCl() > v0Selections.maxITSchi2PerNcls)
return false;

// ITS only tag
// ITS only tag
if (v0Selections.requirePosITSonly) {
if (posTrackExtra.tpcNClsCrossedRows() > 0)
return false;
Expand All @@ -697,7 +697,7 @@
if (negTrackExtra.tpcChi2NCl() > v0Selections.maxTPCchi2PerNcls)
return false;

// check the maximum fraction of allowed shared TPC
// check the maximum fraction of allowed shared TPC
if (posTrackExtra.tpcFractionSharedCls() > v0Selections.maxFractionTPCSharedClusters)
return false;
if (negTrackExtra.tpcFractionSharedCls() > v0Selections.maxFractionTPCSharedClusters)
Expand Down Expand Up @@ -730,7 +730,7 @@
if (std::fabs(negTrackExtra.tpcNSigmaPr()) > v0Selections.tpcPidNsigmaCutLaPr)
return false;
}

// TOF Requirement checks
if (v0Selections.requirePosHasTOF && !v0.positiveHasTOF()) {
return false;
Expand Down Expand Up @@ -793,7 +793,7 @@
if (negTrackExtra.hasTRD() && negTRDhits < v0Selections.minTRDclusters) {
return false;
}

return true;
}

Expand Down Expand Up @@ -1017,7 +1017,7 @@
{
if (!v0.isPhysicalPrimary())
return false;

bool isPositiveProton = v0.pdgCodePositive() == PDG_t::kProton;
bool isPositivePion = v0.pdgCodePositive() == PDG_t::kPiPlus || (doTreatPiToMuon && v0.pdgCodePositive() == PDG_t::kMuonPlus);
bool isNegativeProton = v0.pdgCodeNegative() == PDG_t::kProtonBar;
Expand All @@ -1041,7 +1041,7 @@
{
if (!casc.isPhysicalPrimary())
return false;

bool isBachelorPionPlus = casc.pdgCodeBachelor() == PDG_t::kPiPlus || (doTreatPiToMuon && casc.pdgCodeBachelor() == PDG_t::kMuonPlus);
bool isBachelorKaonPlus = casc.pdgCodeBachelor() == PDG_t::kKPlus;
bool isBachelorPionMinus = casc.pdgCodeBachelor() == PDG_t::kPiMinus || (doTreatPiToMuon && casc.pdgCodeBachelor() == PDG_t::kMuonMinus);
Expand Down Expand Up @@ -1078,8 +1078,8 @@
}
histos_event.fill(HIST("hEventCounter"), 1.5);

for (auto& v0 : fullV0s) {

Check failure on line 1081 in PWGLF/Tasks/QC/v0cascadesqa.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 (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut ||
if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut ||
std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut)
continue; // remove acceptance that's badly reproduced by MC / superfluous in future

Expand Down Expand Up @@ -1184,8 +1184,8 @@
}
}

for (auto& casc : fullCascades) {

Check failure on line 1187 in PWGLF/Tasks/QC/v0cascadesqa.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 (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut ||
if (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut ||
std::abs(casc.positiveeta()) > cascSelections.daughterEtaCut ||
std::abs(casc.bacheloreta()) > cascSelections.daughterEtaCut)
continue; // remove acceptance that's badly reproduced by MC / superfluous in future
Expand All @@ -1193,7 +1193,7 @@
histos_Casc.fill(HIST("CascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()), casc.sign());
histos_Casc.fill(HIST("V0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), casc.sign());

double v0cospatoxi = RecoDecay::cpa(array{casc.x(), casc.y(), casc.z()}, array{casc.xlambda(), casc.ylambda(), casc.zlambda()}, array{casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()});

Check failure on line 1196 in PWGLF/Tasks/QC/v0cascadesqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

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

histos_Casc.fill(HIST("V0CosPAToXi"), v0cospatoxi, casc.sign());
histos_Casc.fill(HIST("CascRadius"), casc.cascradius(), casc.sign());
Expand Down Expand Up @@ -1240,13 +1240,12 @@
}
}
}


////////////////////////////////
////////// QA - MC /////////////
////////////////////////////////

void processMonteCarlo(soa::Join<aod::Collisions, aod::EvSels, aod::PVMults, aod::McCollisionLabels>::iterator const& collision, soa::Join<aod::McCollisions, aod::MultsExtraMC> const&, soa::Join<aod::V0Datas, aod::V0TOFPIDs, aod::V0TOFNSigmas, aod::V0CoreMCLabels> const& fullV0s, soa::Join<aod::V0MCDatas, aod::V0MCCollRefs> const&, soa::Join<aod::CascDatas, aod::CascTOFPIDs, aod::CascTOFNSigmas, aod::CascCoreMCLabels> const& fullCascades, soa::Join<aod::CascMCDatas, aod::CascMCCollRefs> const&, DaughterTracks&, aod::BCsWithTimestamps const&)

Check failure on line 1248 in PWGLF/Tasks/QC/v0cascadesqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument DaughterTracks& is not const&.
{
if (!isEventAccepted(collision, false)) {
return;
Expand All @@ -1265,8 +1264,8 @@
return;
}

for (auto& v0 : fullV0s) {

Check failure on line 1267 in PWGLF/Tasks/QC/v0cascadesqa.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 (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut ||
if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut ||
std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut)
continue; // remove acceptance that's badly reproduced by MC / superfluous in future

Expand All @@ -1292,8 +1291,8 @@
}
}

for (auto& casc : fullCascades) {

Check failure on line 1294 in PWGLF/Tasks/QC/v0cascadesqa.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 (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut ||
if (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut ||
std::abs(casc.positiveeta()) > cascSelections.daughterEtaCut ||
std::abs(casc.bacheloreta()) > cascSelections.daughterEtaCut)
continue; // remove acceptance that's badly reproduced by MC / superfluous in future
Expand Down Expand Up @@ -1371,7 +1370,7 @@

histos_event.fill(HIST("hEventCounterMC"), 1.5);

for (auto& mcparticle : mcParticles) {

Check failure on line 1373 in PWGLF/Tasks/QC/v0cascadesqa.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 (!mcparticle.has_daughters()) {
continue;
Expand All @@ -1379,7 +1378,7 @@

double vx = 0;
double vy = 0;
for (auto& mcparticleDaughter0 : mcparticle.daughters_as<aod::McParticles>()) {

Check failure on line 1381 in PWGLF/Tasks/QC/v0cascadesqa.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.
vx = mcparticleDaughter0.vx();
vy = mcparticleDaughter0.vy();
if (vx != 0 && vy != 0)
Expand Down Expand Up @@ -1410,7 +1409,6 @@
}
}


PROCESS_SWITCH(v0cascadesQA, processReconstructed, "Process reconstructed event and V0s+cascades in data", true);
PROCESS_SWITCH(v0cascadesQA, processMonteCarlo, "Process reconstructed event and V0s+cascades in MC", false);
PROCESS_SWITCH(v0cascadesQA, processGenerated, "Process MC level event and V0s+cascades in MC", false);
Expand Down
Loading