Skip to content

Commit 0220c1c

Browse files
committed
Adds V0 process method
1 parent 4d6d9e0 commit 0220c1c

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

PWGLF/Tasks/Nuspex/piKpRAA.cxx

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file piKpRAA.cxx
13+
///
14+
/// \brief task for analysis of piKp RAA
15+
/// \author Omar Vazquez (omar.vazquez.rueda@cern.ch)
16+
/// \since August 10, 2025
1317

1418
#include "PWGLF/DataModel/LFStrangenessTables.h"
1519

@@ -49,7 +53,6 @@
4953
#include <cstddef>
5054
#include <cstdint>
5155
#include <cstdlib>
52-
#include <iostream>
5356
#include <numeric>
5457
#include <string>
5558
#include <string_view>
@@ -68,18 +71,19 @@ using BCsRun3 = soa::Join<aod::BCsWithTimestamps, aod::BcSels, aod::Run3MatchedT
6871

6972
using TracksFull = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelectionExtension, aod::TracksDCA, aod::TrackSelection, aod::TracksCovIU, aod::pidTPCPi, aod::pidTPCPr, aod::pidTOFPr, aod::pidTPCEl, aod::pidTOFFlags, aod::pidTOFbeta, aod::TOFSignal, aod::pidTOFFullPi, aod::pidTOFFullEl, aod::pidTOFFullMu>;
7073

71-
static constexpr int knEtaHists{9};
74+
static constexpr int kNEtaHists{9};
7275

73-
std::array<std::shared_ptr<TH2>, knEtaHists> dEdxPiV0{};
74-
std::array<std::shared_ptr<TH2>, knEtaHists> dEdxPrV0{};
75-
std::array<std::shared_ptr<TH2>, knEtaHists> dEdxElV0{};
76-
std::array<std::shared_ptr<TH2>, knEtaHists> dEdxPiTOF{};
77-
std::array<std::shared_ptr<TH2>, knEtaHists> dEdxElTOF{};
76+
std::array<std::shared_ptr<TH2>, kNEtaHists> dEdxPiV0{};
77+
std::array<std::shared_ptr<TH2>, kNEtaHists> dEdxPrV0{};
78+
std::array<std::shared_ptr<TH2>, kNEtaHists> dEdxElV0{};
79+
std::array<std::shared_ptr<TH2>, kNEtaHists> dEdxPiTOF{};
80+
std::array<std::shared_ptr<TH2>, kNEtaHists> dEdxElTOF{};
7881

7982
struct piKpRAA {
8083

8184
static constexpr float kZero{0.0f};
8285
static constexpr float kOne{1.0f};
86+
static constexpr float kTenToMinusNine{1e-9};
8387
static constexpr float kMinCharge{3.f};
8488
static constexpr float kMinPMIP{0.4f};
8589
static constexpr float kMaxPMIP{0.6f};
@@ -88,8 +92,8 @@ struct piKpRAA {
8892
static constexpr float kMindEdxMIPPlateau{65.0f};
8993
static constexpr float kMaxdEdxMIPPlateau{95.0f};
9094

91-
static constexpr float lowEta[knEtaHists] = {-0.8, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6};
92-
static constexpr float highEta[knEtaHists] = {0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8};
95+
static constexpr float kLowEta[kNEtaHists] = {-0.8, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6};
96+
static constexpr float kHighEta[kNEtaHists] = {0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8};
9397

9498
static constexpr float DefaultLifetimeCuts[1][2] = {{30., 20.}};
9599
Configurable<LabeledArray<float>> lifetimecut{"lifetimecut", {DefaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"};
@@ -231,8 +235,8 @@ struct piKpRAA {
231235
const AxisSpec axisPtPhiCut{binsPtPhiCut, "#it{p}_{T} (GeV/#it{c})"};
232236
const AxisSpec axisPtV0s{binsPtV0s, "#it{p}_{T} (GeV/#it{c})"};
233237
const AxisSpec axisCent{binsCent, "T0C centrality"};
234-
const char* endingEta[knEtaHists] = {"88", "86", "64", "42", "20", "02", "24", "46", "68"};
235-
const char* latexEta[knEtaHists] = {"|#eta|<0.8", "-0.8<#eta<-0.6", "-0.6<#eta<-0.4", "-0.4<#eta<-0.2", "-0.2<#eta<0", "0<#eta<0.2", "0.2<#eta<0.4", "0.4<#eta<0.6", "0.6<#eta<0.8"};
238+
const char* endingEta[kNEtaHists] = {"88", "86", "64", "42", "20", "02", "24", "46", "68"};
239+
const char* latexEta[kNEtaHists] = {"|#eta|<0.8", "-0.8<#eta<-0.6", "-0.6<#eta<-0.4", "-0.4<#eta<-0.2", "-0.2<#eta<0", "0<#eta<0.2", "0.2<#eta<0.4", "0.4<#eta<0.6", "0.6<#eta<0.8"};
236240

237241
registry.add("EventCounter", ";;Events", kTH1F, {axisEvent});
238242

@@ -314,7 +318,7 @@ struct piKpRAA {
314318
registry.add("dEdxVsEtaElMIPV0", "e^{+} + e^{-} (0.4 < #it{p} < 0.6 GeV/#it{c});#eta; dE/dx", kTH2F, {{{axisEta}, {100, 0, 100}}});
315319
registry.add("dEdxVsEtaElMIPV0p", "e^{+} + e^{-} (0.4 < #it{p} < 0.6 GeV/#it{c});#eta; #LTdE/dx#GT", kTProfile, {axisEta});
316320

317-
for (int i = 0; i < knEtaHists; ++i) {
321+
for (int i = 0; i < kNEtaHists; ++i) {
318322
dEdxPiV0[i] = registry.add<TH2>(Form("dEdxPiV0_%s", endingEta[i]), Form("#pi^{+} + #pi^{-}, %s;Momentum (GeV/#it{c}); dE/dx", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx});
319323
dEdxPrV0[i] = registry.add<TH2>(Form("dEdxPrV0_%s", endingEta[i]), Form("p + #bar{p}, %s;Momentum (GeV/#it{c}); dE/dx", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx});
320324
dEdxElV0[i] = registry.add<TH2>(Form("dEdxElV0_%s", endingEta[i]), Form("e^{+} + e^{-}, %s;Momentum (GeV/#it{c}); dE/dx", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx});
@@ -392,7 +396,7 @@ struct piKpRAA {
392396
const int charge{track.sign()};
393397

394398
float phiPrime{phi};
395-
PhiPrime(phiPrime, magField, charge);
399+
phiPrimeFunc(phiPrime, magField, charge);
396400
registry.fill(HIST("NclFoundVsPVsPhipBeforeCut"), momentum, phiPrime, track.tpcNClsFound());
397401
registry.fill(HIST("NclFoundVsPtVsPhipBeforeCut"), pt, phiPrime, track.tpcNClsFound());
398402

@@ -425,8 +429,8 @@ struct piKpRAA {
425429
registry.fill(HIST("dEdxVsMomentum"), momentum, dedx);
426430

427431
int indexEta{0};
428-
for (int i = 1; i < knEtaHists; ++i) {
429-
if (eta >= lowEta[i] && eta < highEta[i]) {
432+
for (int i = 1; i < kNEtaHists; ++i) {
433+
if (eta >= kLowEta[i] && eta < kHighEta[i]) {
430434
indexEta = i;
431435
break;
432436
}
@@ -483,8 +487,8 @@ struct piKpRAA {
483487
float negTrkdEdx{negTrack.tpcSignal()};
484488
float posTrackPhiPrime{posTrack.phi()};
485489
float negTrackPhiPrime{negTrack.phi()};
486-
PhiPrime(posTrackPhiPrime, magField, posTrackCharge);
487-
PhiPrime(negTrackPhiPrime, magField, negTrackCharge);
490+
phiPrimeFunc(posTrackPhiPrime, magField, posTrackCharge);
491+
phiPrimeFunc(negTrackPhiPrime, magField, negTrackCharge);
488492

489493
// Skip v0s with like-sig daughters
490494
if (posTrack.sign() == negTrack.sign())
@@ -521,7 +525,7 @@ struct piKpRAA {
521525
const TVector3 pneg(negTrack.px(), negTrack.py(), negTrack.pz());
522526
double alpha, qT;
523527

524-
GetArmeterosVariables(ppos, pneg, alpha, qT);
528+
getArmeterosVariables(ppos, pneg, alpha, qT);
525529
registry.fill(HIST("ArmAll"), alpha, qT);
526530

527531
// Passes V0 topological cuts?
@@ -546,15 +550,15 @@ struct piKpRAA {
546550

547551
int posIndexEta{0};
548552
int negIndexEta{0};
549-
for (int i = 1; i < knEtaHists; ++i) {
550-
if (posTrkEta >= lowEta[i] && posTrkEta < highEta[i]) {
553+
for (int i = 1; i < kNEtaHists; ++i) {
554+
if (posTrkEta >= kLowEta[i] && posTrkEta < kHighEta[i]) {
551555
posIndexEta = i;
552556
break;
553557
}
554558
}
555559

556-
for (int i = 1; i < knEtaHists; ++i) {
557-
if (negTrkEta >= lowEta[i] && negTrkEta < highEta[i]) {
560+
for (int i = 1; i < kNEtaHists; ++i) {
561+
if (negTrkEta >= kLowEta[i] && negTrkEta < kHighEta[i]) {
558562
negIndexEta = i;
559563
break;
560564
}
@@ -685,13 +689,13 @@ struct piKpRAA {
685689
PROCESS_SWITCH(piKpRAA, processCalibrationAndV0s, "Process QA", true);
686690

687691
template <typename T, typename U>
688-
void GetArmeterosVariables(const T& ppos, const T& pneg, U& alpha, U& qT)
692+
void getArmeterosVariables(const T& ppos, const T& pneg, U& alpha, U& qT)
689693
{
690694

691695
alpha = 0., qT = 0.;
692696
TVector3 pV0 = ppos + pneg;
693697
double pV0mag = pV0.Mag();
694-
if (pV0mag < 1e-9)
698+
if (pV0mag < kTenToMinusNine)
695699
return; // protect against zero momentum
696700

697701
const TVector3 u = pV0 * (1.0 / pV0mag);
@@ -705,7 +709,7 @@ struct piKpRAA {
705709

706710
// α: longitudinal asymmetry (uses + and − labels by charge)
707711
double denom = pLpos + pLneg;
708-
if (std::abs(denom) < 1e-9)
712+
if (std::abs(denom) < kTenToMinusNine)
709713
return; // avoid 0 division (unphysical for V0s)
710714

711715
alpha = (pLpos - pLneg) / denom; // equivalently / pV0mag
@@ -863,7 +867,7 @@ struct piKpRAA {
863867
return grpo->getNominalL3Field();
864868
}
865869

866-
void PhiPrime(float& phi, const int& magField, const int& charge)
870+
void phiPrimeFunc(float& phi, const int& magField, const int& charge)
867871
{
868872

869873
if (magField < 0) // for negatve polarity field

0 commit comments

Comments
 (0)