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
2 changes: 1 addition & 1 deletion PWGLF/Tasks/Strangeness/cascadecorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <TFile.h>
#include <TH2F.h>
#include <TList.h>
#include <TLorentzVector.h>

Check failure on line 43 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TPDGCode.h>
#include <TProfile.h>

Expand Down Expand Up @@ -307,7 +307,7 @@
if (!gen.isPhysicalPrimary())
return;
int genpdg = gen.pdgCode();
if ((flag < 3 && std::abs(genpdg) == kXiMinus) || (flag > 1 && std::abs(genpdg) == kOmegaMinus)) {

Check failure on line 310 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 casc is consistent with Xi and has matched gen Xi OR cand is consistent with Omega and has matched gen omega
// have to do this in case we reco true Xi with only Omega hypothesis (or vice versa) (very unlikely)
registry.fill(HIST("truerec/hV0Radius"), rec.v0radius());
Expand Down Expand Up @@ -686,8 +686,8 @@
bool autoCorrelation(std::array<int, 3> triggerTracks, std::array<int, 3> assocTracks)
{
// function that loops over 2 arrays of track indices, checking for common elements
for (const int triggerTrack : triggerTracks) {

Check failure on line 689 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
for (const int assocTrack : assocTracks) {

Check failure on line 690 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 (triggerTrack == assocTrack)
return true;
}
Expand Down Expand Up @@ -804,7 +804,7 @@
double weight;
// Some QA on the cascades
for (auto const& casc : Cascades) {
if (casc.isSelected() <= 2) { // not exclusively an Omega --> consistent with Xi or both

Check failure on line 807 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 (casc.sign() < 0) {
registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi());
weight = getEfficiency(hEffXiMin, casc.pt(), casc.yXi());
Expand All @@ -816,7 +816,7 @@
registry.fill(HIST("hMassXiEffCorrected"), casc.mXi(), casc.sign(), casc.pt(), casc.yXi(), collision.posZ(), collision.centFT0M(), weight);
registry.fill(HIST("hRapidityXi"), casc.yXi());
}
if (casc.isSelected() >= 2) { // consistent with Omega or both

Check failure on line 819 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 (casc.sign() < 0) {
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega());
weight = getEfficiency(hEffOmegaMin, casc.pt(), casc.yOmega());
Expand Down Expand Up @@ -850,7 +850,7 @@
registry.fill(HIST("hEta"), casc.eta());
} // casc loop

for (auto& [c0, c1] : combinations(Cascades, Cascades)) { // combinations automatically applies strictly upper in case of 2 identical tables

Check failure on line 853 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
// Define the trigger as the particle with the highest pT. As we can't swap the cascade tables themselves, we swap the addresses and later dereference them
auto* triggerAddress = &c0;
auto* assocAddress = &c1;
Expand All @@ -877,7 +877,7 @@
double weightTrigg = 1.;
double weightAssoc = 1.;

if (trigger.isSelected() <= 2 && std::abs(trigger.yXi()) < maxRapidity) { // trigger Xi

Check failure on line 880 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 (doEfficiencyCorrection)
weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffXiMin, trigger.pt()) : getEfficiency(hEffXiPlus, trigger.pt());
if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi
Expand Down Expand Up @@ -933,7 +933,7 @@
registry.fill(HIST("MixedEvents/hMEVz1"), col1.posZ());
registry.fill(HIST("MixedEvents/hMEVz2"), col2.posZ());

for (auto& [casc1, casc2] : combinations(CombinationsFullIndexPolicy(cascades1, cascades2))) {

Check failure on line 936 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
// specify FullIndexPolicy since the cascades are from different collisions
auto* triggerAddress = &casc1;
auto* assocAddress = &casc2;
Expand Down Expand Up @@ -1004,7 +1004,7 @@
} // process mixed events

Configurable<float> etaGenCascades{"etaGenCascades", 0.8, "min/max of eta for generated cascades"};
Filter genCascadesFilter = nabs(aod::mcparticle::pdgCode) == (int) kXiMinus;
Filter genCascadesFilter = nabs(aod::mcparticle::pdgCode) == (int)kXiMinus;

void processMC(aod::McCollision const& mcCollision, soa::SmallGroups<soa::Join<aod::McCollisionLabels, MyCollisionsMult>> const& collisions, soa::Filtered<aod::McParticles> const& genCascades, aod::McParticles const& mcParticles)
{
Expand Down Expand Up @@ -1039,7 +1039,7 @@
registry.fill(HIST("MC/hRapidity"), casc.y());
}

for (auto& [c0, c1] : combinations(genCascades, genCascades)) { // combinations automatically applies strictly upper in case of 2 identical tables

Check failure on line 1042 in PWGLF/Tasks/Strangeness/cascadecorrelations.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.
// Define the trigger as the particle with the highest pT. As we can't swap the cascade tables themselves, we swap the addresses and later dereference them
auto* triggerAddress = &c0;
auto* assocAddress = &c1;
Expand Down
Loading