Skip to content
Merged
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
70 changes: 35 additions & 35 deletions PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct HfCorrelatorLcScHadronsSelection {
for (const auto& candidate : candidates) {

auto yCand = estimateY<isCandSc>(candidate);

if (std::abs(yCand) > yCandMax || candidate.pt() < ptCandMin) {
isCandFound = false;
continue;
Expand All @@ -119,7 +119,7 @@ struct HfCorrelatorLcScHadronsSelection {
for (const auto& particle : mcParticles) {

isCandFound = matchCandAndMass<isCandSc>(particle, massCand);
if (!isCandFound){
if (!isCandFound) {
continue;
}

Expand All @@ -137,31 +137,31 @@ struct HfCorrelatorLcScHadronsSelection {

/// Code to select collisions with at least one Lc - for real data and data-like analysis
void processLcSelection(SelCollisions::iterator const& collision,
CandsLcDataFiltered const& candidates)
CandsLcDataFiltered const& candidates)
{
selectionCollision<false>(collision,candidates);
selectionCollision<false>(collision, candidates);
}
PROCESS_SWITCH(HfCorrelatorLcScHadronsSelection, processLcSelection, "Process Lc Collision Selection for Data and Mc", true);

void processScSelection(SelCollisions::iterator const& collision,
aod::HfCandSc const& candidates)
void processScSelection(SelCollisions::iterator const& collision,
aod::HfCandSc const& candidates)
{
selectionCollision<true>(collision,candidates);
selectionCollision<true>(collision, candidates);
}
PROCESS_SWITCH(HfCorrelatorLcScHadronsSelection, processScSelection, "Process Sc Collision Selection for Data and Mc", false);

void processLcSelectionMcRec(SelCollisions::iterator const& collision,
void processLcSelectionMcRec(SelCollisions::iterator const& collision,
CandsLcMcRecFiltered const& candidates)
{
selectionCollision<false>(collision,candidates);
selectionCollision<false>(collision, candidates);
}
PROCESS_SWITCH(HfCorrelatorLcScHadronsSelection, processLcSelectionMcRec, "Process Lc Selection McRec", false);
PROCESS_SWITCH(HfCorrelatorLcScHadronsSelection, processLcSelectionMcRec, "Process Lc Selection McRec", false);

void processScSelectionMcRec(SelCollisions::iterator const& collision,
CandsScMcRec const& candidates)
{
selectionCollision<true>(collision,candidates);
}
CandsScMcRec const& candidates)
{
selectionCollision<true>(collision, candidates);
}
PROCESS_SWITCH(HfCorrelatorLcScHadronsSelection, processScSelectionMcRec, "Process Sc Selection McRec", false);

void processLcSelectionMcGen(aod::McCollision const&,
Expand Down Expand Up @@ -241,12 +241,12 @@ struct HfCorrelatorLcScHadrons {
bool isSignal = false;

TRandom3* rnd = new TRandom3(0);
//std::vector<float> outputMl = {-1., -1., -1.};
// std::vector<float> outputMl = {-1., -1., -1.};
std::vector<float> outputMlPKPi = {-1., -1., -1.};
std::vector<float> outputMlPiKP = {-1., -1., -1.};

// Event Mixing for the Data Mode
//using SelCollisionsWithSc = soa::Join<aod::Collisions, aod::Mults, aod::EvSels>;
// using SelCollisionsWithSc = soa::Join<aod::Collisions, aod::Mults, aod::EvSels>;
using SelCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection>>;
using SelCollisionsMc = soa::Filtered<soa::Join<aod::McCollisions, aod::LcSelection, aod::MultsExtraMC>>; // collisionFilter applied

Expand Down Expand Up @@ -834,7 +834,8 @@ struct HfCorrelatorLcScHadrons {
}

template <bool isCandSc, typename CollisionType, typename PartType>
void doSameEventMcGen(CollisionType const& mcCollision, PartType const& mcParticles){
void doSameEventMcGen(CollisionType const& mcCollision, PartType const& mcParticles)
{

int counterCharmCand = 0;
registry.fill(HIST("hMcEvtCount"), 0);
Expand All @@ -850,9 +851,8 @@ struct HfCorrelatorLcScHadrons {
for (const auto& particle : mcParticles) {

double massCand = -999.0;
bool isCandFound = isCandSc ? matchCandAndMass<true>(particle, massCand) :
matchCandAndMass<false>(particle, massCand);
if (!isCandFound){
bool isCandFound = isCandSc ? matchCandAndMass<true>(particle, massCand) : matchCandAndMass<false>(particle, massCand);
if (!isCandFound) {
continue;
}
double yCand = RecoDecay::y(particle.pVector(), massCand);
Expand All @@ -866,10 +866,10 @@ struct HfCorrelatorLcScHadrons {
registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -PIHalf));
registry.fill(HIST("hYMcGen"), yCand);

int8_t chargeLc = pdg->GetParticle(particle.pdgCode())->Charge(); // Retrieve charge
if (chargeLc != 0){
chargeLc = chargeLc / std::abs(chargeLc);
}
int8_t chargeLc = pdg->GetParticle(particle.pdgCode())->Charge(); // Retrieve charge
if (chargeLc != 0) {
chargeLc = chargeLc / std::abs(chargeLc);
}

isPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt;
isNonPrompt = particle.originMcGen() == RecoDecay::OriginType::NonPrompt;
Expand All @@ -887,19 +887,19 @@ struct HfCorrelatorLcScHadrons {
listDaughters.clear();
const size_t expectedDaughters = isCandSc ? 4 : 3;

if (isCandSc){
if (massCand == o2::constants::physics::MassSigmaC0 || massCand == o2::constants::physics::MassSigmaCStar0){
if (isCandSc) {
if (massCand == o2::constants::physics::MassSigmaC0 || massCand == o2::constants::physics::MassSigmaCStar0) {
std::array<int, NDaughtersSc> arrDaughSc0PDG = {kProton, -kKPlus, kPiPlus, kPiMinus};
RecoDecay::getDaughters(particle, &listDaughters, arrDaughSc0PDG, 2);
} else {
std::array<int, NDaughtersSc> arrDaughScPlusPDG = {kProton, -kKPlus, kPiPlus, kPiPlus};
RecoDecay::getDaughters(particle, &listDaughters, arrDaughScPlusPDG, 2);
}
} else {
std::array<int, NDaughtersLc> arrDaughLcPDG = {kProton, -kKPlus, kPiPlus};
RecoDecay::getDaughters(particle, &listDaughters, arrDaughLcPDG, 2);
std::array<int, NDaughtersLc> arrDaughLcPDG = {kProton, -kKPlus, kPiPlus};
RecoDecay::getDaughters(particle, &listDaughters, arrDaughLcPDG, 2);
}

int counterDaughters = 0;
std::vector<int> prongsId(expectedDaughters);
if (listDaughters.size() == expectedDaughters) {
Expand All @@ -921,9 +921,9 @@ struct HfCorrelatorLcScHadrons {

if (std::find(prongsId.begin(), prongsId.end(), particleAssoc.globalIndex()) != prongsId.end()) {
if (!storeAutoCorrelationFlag) {
continue;
}
correlationStatus = true;
continue;
}
correlationStatus = true;
}

if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) {
Expand Down Expand Up @@ -1050,14 +1050,14 @@ struct HfCorrelatorLcScHadrons {

/// Lc-Hadron correlation pair builder - for Mc Gen-level analysis
void processMcGenLc(SelCollisionsMc::iterator const& mcCollision,
CandidatesLcMcGen const& mcParticles)
CandidatesLcMcGen const& mcParticles)
{
doSameEventMcGen<false>(mcCollision, mcParticles);
}
PROCESS_SWITCH(HfCorrelatorLcScHadrons, processMcGenLc, "Process Mc Gen Lc mode", false);

void processMcGenSc(SelCollisionsMc::iterator const& mcCollision,
CandidatesScMcGen const& mcParticles)
void processMcGenSc(SelCollisionsMc::iterator const& mcCollision,
CandidatesScMcGen const& mcParticles)
{
doSameEventMcGen<true>(mcCollision, mcParticles);
}
Expand Down
36 changes: 18 additions & 18 deletions PWGHF/HFC/Utils/utilsCorrelations.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "Common/DataModel/PIDResponseTPC.h"
#include "Common/DataModel/PIDResponseTOF.h"

using namespace o2::constants::physics;

Check failure on line 31 in PWGHF/HFC/Utils/utilsCorrelations.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

HfHelper hfHelper;

Expand All @@ -54,7 +54,7 @@
{
if (std::abs(deltaPhi) < o2::constants::math::PIThird) {
return Toward;
} else if (deltaPhi > 2. * o2::constants::math::PIThird && deltaPhi < 4. * o2::constants::math::PIThird) {

Check failure on line 57 in PWGHF/HFC/Utils/utilsCorrelations.h

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 Away;
} else {
return Transverse;
Expand Down Expand Up @@ -124,7 +124,8 @@
}

template <bool isScCand, typename McParticle>
bool matchCandAndMass(McParticle const& particle, double& massCand) {
bool matchCandAndMass(McParticle const& particle, double& massCand)
{
const auto pdgCand = std::abs(particle.pdgCode());
const auto matchGenFlag = std::abs(particle.flagMcMatchGen());

Expand Down Expand Up @@ -155,7 +156,7 @@
case BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi):
massCand = o2::constants::physics::MassSigmaCStarPlusPlus;
return true;

case BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi):
massCand = o2::constants::physics::MassSigmaCStarPlusPlus;
return true;
Expand All @@ -169,26 +170,25 @@
}
}

template <bool isCandSc, typename CandType>
double estimateY(CandType const& candidate)
{
double y = -999.;
const int chargeScZero = 0;
if constexpr (isCandSc) {
int8_t chargeCand = candidate.charge();

template <bool isCandSc, typename CandType>
double estimateY(CandType const& candidate)
{
double y = -999.;
const int chargeScZero = 0;
if constexpr (isCandSc) {
int8_t chargeCand = candidate.charge();

if (chargeCand == chargeScZero) {
y = hfHelper.ySc0(candidate);
} else {
y = hfHelper.yScPlusPlus(candidate);
}

if (chargeCand == chargeScZero) {
y = hfHelper.ySc0(candidate);
} else {
y = hfHelper.yLc(candidate);
y = hfHelper.yScPlusPlus(candidate);
}
return y;

} else {
y = hfHelper.yLc(candidate);
}
return y;
}

// ========= Find Leading Particle ==============
template <typename TTracks, typename T1> //// FIXME: 14 days
Expand Down
Loading