Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PWGLF] Update v0qaanalysis.cxx #9898

Merged
merged 4 commits into from
Feb 12, 2025
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
25 changes: 7 additions & 18 deletions PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
///
/// \author Francesca Ercolessi (francesca.ercolessi@cern.ch)

#include <vector>
#include <utility>

#include "Framework/AnalysisTask.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
Expand Down Expand Up @@ -166,7 +169,7 @@
return false;
}
registry.fill(HIST("hNEvents"), 2.5);
if (TMath::Abs(collision.posZ()) > cutzvertex) {

Check warning on line 172 in PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
return false;
}
registry.fill(HIST("hNEvents"), 3.5);
Expand Down Expand Up @@ -206,7 +209,7 @@
registry.fill(HIST("hCentFT0M"), collision.centFT0M());
registry.fill(HIST("hCentFV0A"), collision.centFV0A());

for (auto& v0 : V0s) { // loop over V0s

Check warning on line 212 in PWGLF/TableProducer/Strangeness/v0qaanalysis.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 (v0.v0Type() != v0TypeSelection) {
continue;
Expand All @@ -217,15 +220,8 @@
float ctauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short;

// ITS clusters
int posITSNhits = 0, negITSNhits = 0;
for (unsigned int i = 0; i < 7; i++) {
if (v0.posTrack_as<DauTracks>().itsClusterMap() & (1 << i)) {
posITSNhits++;
}
if (v0.negTrack_as<DauTracks>().itsClusterMap() & (1 << i)) {
negITSNhits++;
}
}
const int posITSNhits = v0.posTrack_as<DauTracks>().itsNCls();
const int negITSNhits = v0.negTrack_as<DauTracks>().itsNCls();

// Event flags
int evFlag = 0;
Expand All @@ -243,8 +239,8 @@

if (v0.v0radius() > v0radius &&
v0.v0cosPA() > v0cospa &&
TMath::Abs(v0.posTrack_as<DauTracks>().eta()) < etadau &&

Check warning on line 242 in PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
TMath::Abs(v0.negTrack_as<DauTracks>().eta()) < etadau) {

Check warning on line 243 in PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.

// Fill table
myv0s(v0.pt(), v0.yLambda(), v0.yK0Short(),
Expand Down Expand Up @@ -304,7 +300,7 @@
}

auto v0sThisCollision = V0s.sliceBy(perCol, collision.globalIndex());
for (auto& v0 : v0sThisCollision) { // loop over V0s

Check warning on line 303 in PWGLF/TableProducer/Strangeness/v0qaanalysis.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 (!v0.has_mcParticle()) {
continue;
Expand Down Expand Up @@ -348,11 +344,11 @@
int lPDG = 0;
bool isDauK0Short = false, isDauLambda = false, isDauAntiLambda = false;
bool isprimary = false;
if (TMath::Abs(v0mcparticle.pdgCode()) == 310 || TMath::Abs(v0mcparticle.pdgCode()) == 3122) {

Check warning on line 347 in PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
lPDG = v0mcparticle.pdgCode();
isprimary = v0mcparticle.isPhysicalPrimary();
}
for (auto& mcparticleDaughter0 : v0mcparticle.daughters_as<aod::McParticles>()) {

Check warning on line 351 in PWGLF/TableProducer/Strangeness/v0qaanalysis.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 (auto& mcparticleDaughter1 : v0mcparticle.daughters_as<aod::McParticles>()) {
if (mcparticleDaughter0.pdgCode() == 211 && mcparticleDaughter1.pdgCode() == -211) {
isDauK0Short = true;
Expand All @@ -366,15 +362,8 @@
}
}

int posITSNhits = 0, negITSNhits = 0;
for (unsigned int i = 0; i < 7; i++) {
if (v0.posTrack_as<DauTracksMC>().itsClusterMap() & (1 << i)) {
posITSNhits++;
}
if (v0.negTrack_as<DauTracksMC>().itsClusterMap() & (1 << i)) {
negITSNhits++;
}
}
const int posITSNhits = v0.posTrack_as<DauTracksMC>().itsNCls();
const int negITSNhits = v0.negTrack_as<DauTracksMC>().itsNCls();

float ctauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0;
float ctauAntiLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0Bar;
Expand All @@ -382,8 +371,8 @@

if (v0.v0radius() > v0radius &&
v0.v0cosPA() > v0cospa &&
TMath::Abs(v0.posTrack_as<DauTracksMC>().eta()) < etadau &&

Check warning on line 374 in PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
TMath::Abs(v0.negTrack_as<DauTracksMC>().eta()) < etadau // &&

Check warning on line 375 in PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
) {

// Fill table
Expand Down Expand Up @@ -454,7 +443,7 @@

registry.fill(HIST("hNEventsMCGen"), 0.5);

if (TMath::Abs(mcCollision.posZ()) > MCcutzvertex) {

Check warning on line 446 in PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
return;
}
registry.fill(HIST("hNEventsMCGen"), 1.5);
Expand Down
Loading