Skip to content
Closed
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
19 changes: 12 additions & 7 deletions PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
Configurable<bool> applyEfficiencyCorrection{"applyEfficiencyCorrection", false, "apply efficiency correction"};
Configurable<bool> applyEfficiencyForTrigger{"applyEfficiencyForTrigger", false, "apply efficiency correction for the trigger particle"};
Configurable<bool> applyEfficiencyPropagation{"applyEfficiencyPropagation", false, "propagate also the efficiency uncertainty"};
Configurable<bool> applyPurityHadron{"applyPurityHadron",false,"apply the purity correction for associated hadrons"};
Configurable<bool> applyPurityTrigger{"applyPurityTrigger",false,"apply the purity correction for trigger particle"};
Configurable<bool> applyPurityHadron{"applyPurityHadron", false, "apply the purity correction for associated hadrons"};
Configurable<bool> applyPurityTrigger{"applyPurityTrigger", false, "apply the purity correction for trigger particle"};
} efficiencyFlags;
Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository to use"};
Configurable<std::string> efficiencyCCDBPath{"efficiencyCCDBPath", "GLO/Config/GeometryAligned", "Path of the efficiency corrections"};
Expand Down Expand Up @@ -262,8 +262,8 @@

std::vector<std::vector<float>> axisRanges;

const float ctauxiPDG = 4.91; // from PDG

Check failure on line 265 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
const float ctauomegaPDG = 2.461; // from PDG

Check failure on line 266 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.

/// Function to aid in calculating delta-phi
/// \param phi1 first phi value
Expand Down Expand Up @@ -524,9 +524,9 @@
return false;
// dcacascdaughters
float ptDepCut = systCuts.dcaCacsDauPar0;
if (casc.pt() > 1 && casc.pt() < 4)

Check failure on line 527 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
ptDepCut = systCuts.dcaCacsDauPar1;
else if (casc.pt() > 4)

Check failure on line 529 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
ptDepCut = systCuts.dcaCacsDauPar2;
if (casc.dcacascdaughters() > ptDepCut)
return false;
Expand Down Expand Up @@ -559,7 +559,7 @@
double phaseProton = (-0.3 * B * assoc[2]) / (2 * assoc[1]);
double phaseTrack = (-0.3 * B * trigg[2]) / (2 * trigg[1]);

for (double r = 0.8; r <= 2.5; r += 0.05) {

Check failure on line 562 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
dPhiStar = dPhi + std::asin(phaseProton * r) - std::asin(phaseTrack * r);
dPhiStarMean += (dPhiStar / 34);
}
Expand Down Expand Up @@ -727,7 +727,7 @@
if (doDeltaPhiStarCheck) {
double deltaPhiStar = calculateAverageDeltaPhiStar(triggForDeltaPhiStar, assocForDeltaPhiStar, bField);
double deltaPhiStarPion = calculateAverageDeltaPhiStar(triggForDeltaPhiStar, assocForDeltaPhiStarPion, bField);
if ((Index == 0 && triggSign > 0) || (Index == 1 && triggSign > 0) || (Index == 2 && triggSign < 0)) {

Check failure on line 730 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
histos.fill(HIST("sameEvent/LeftBg/") + HIST(kV0names[Index]) + HIST("DeltaPhiStar"), deltaPhiStar, trigg.eta() - etaProton, 0.5);
if (Index == 0) {
histos.fill(HIST("sameEvent/LeftBg/") + HIST(kV0names[Index]) + HIST("DeltaPhiStar"), deltaPhiStarPion, trigg.eta() - etaPion, -0.5);
Expand All @@ -742,18 +742,18 @@
}
if (assocCandidate.compatible(Index, systCuts.dEdxCompatibility) && (!doMCassociation || assocCandidate.mcTrue(Index)) && (!doAssocPhysicalPrimary || assocCandidate.mcPhysicalPrimary()) && !mixing && -massWindowConfigurations.maxPeakNSigma < assocCandidate.invMassNSigma(Index) && assocCandidate.invMassNSigma(Index) < +massWindowConfigurations.maxPeakNSigma) {
fillCorrelationHistogram(histos.get<THn>(HIST("sameEvent/Signal/") + HIST(kV0names[Index])), binFillThn, etaWeight, efficiency * efficiencytrigg, totalEffUncert, 1.0f, 0.0f);
if (std::abs(deltaphi) < 0.8 && doITSClustersQA) {

Check failure on line 745 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
histos.fill(HIST("hITSClusters") + HIST(kV0names[Index]) + HIST("NegativeDaughterToward"), ptassoc, negtrack.itsNCls(), assoc.v0radius());
histos.fill(HIST("hITSClusters") + HIST(kV0names[Index]) + HIST("PositiveDaughterToward"), ptassoc, postrack.itsNCls(), assoc.v0radius());
}
if (std::abs(deltaphi) > 1 && std::abs(deltaphi) < 2 && doITSClustersQA) {

Check failure on line 749 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
histos.fill(HIST("hITSClusters") + HIST(kV0names[Index]) + HIST("NegativeDaughterTransverse"), ptassoc, negtrack.itsNCls(), assoc.v0radius());
histos.fill(HIST("hITSClusters") + HIST(kV0names[Index]) + HIST("PositiveDaughterTransverse"), ptassoc, postrack.itsNCls(), assoc.v0radius());
}
if (doDeltaPhiStarCheck) {
double deltaPhiStar = calculateAverageDeltaPhiStar(triggForDeltaPhiStar, assocForDeltaPhiStar, bField);
double deltaPhiStarPion = calculateAverageDeltaPhiStar(triggForDeltaPhiStar, assocForDeltaPhiStarPion, bField);
if ((Index == 0 && triggSign > 0) || (Index == 1 && triggSign > 0) || (Index == 2 && triggSign < 0)) {

Check failure on line 756 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
histos.fill(HIST("sameEvent/Signal/") + HIST(kV0names[Index]) + HIST("DeltaPhiStar"), deltaPhiStar, trigg.eta() - etaProton, 0.5);
if (Index == 0) {
histos.fill(HIST("sameEvent/Signal/") + HIST(kV0names[Index]) + HIST("DeltaPhiStar"), deltaPhiStarPion, trigg.eta() - etaPion, -0.5);
Expand All @@ -771,7 +771,7 @@
if (doDeltaPhiStarCheck) {
double deltaPhiStar = calculateAverageDeltaPhiStar(triggForDeltaPhiStar, assocForDeltaPhiStar, bField);
double deltaPhiStarPion = calculateAverageDeltaPhiStar(triggForDeltaPhiStar, assocForDeltaPhiStarPion, bField);
if ((Index == 0 && triggSign > 0) || (Index == 1 && triggSign > 0) || (Index == 2 && triggSign < 0)) {

Check failure on line 774 in PWGLF/Tasks/Strangeness/hStrangeCorrelation.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.
histos.fill(HIST("sameEvent/RightBg/") + HIST(kV0names[Index]) + HIST("DeltaPhiStar"), deltaPhiStar, trigg.eta() - etaProton, 0.5);
if (Index == 0) {
histos.fill(HIST("sameEvent/RightBg/") + HIST(kV0names[Index]) + HIST("DeltaPhiStar"), deltaPhiStarPion, trigg.eta() - etaPion, -0.5);
Expand Down Expand Up @@ -1059,19 +1059,23 @@
efficiencyUncertainty = hEfficiencyUncertaintyPion->Interpolate(ptassoc, assoc.eta());
} else {
efficiency = hEfficiencyHadron->Interpolate(ptassoc, assoc.eta());
if(efficiencyFlags.applyPurityHadron) purity = hPurityHadron->Interpolate(ptassoc);
if (efficiencyFlags.applyPurityHadron)
purity = hPurityHadron->Interpolate(ptassoc);
if (efficiencyFlags.applyEfficiencyPropagation) {
efficiencyUncertainty = hEfficiencyUncertaintyHadron->Interpolate(ptassoc, assoc.eta());
if(efficiencyFlags.applyPurityHadron)purityUncertainty = hPurityUncertaintyHadron->Interpolate(ptassoc);
if (efficiencyFlags.applyPurityHadron)
purityUncertainty = hPurityUncertaintyHadron->Interpolate(ptassoc);
}
}
}
if (efficiencyFlags.applyEfficiencyForTrigger) {
efficiencyTrigg = hEfficiencyTrigger->Interpolate(pttrigger, trigg.eta());
if(efficiencyFlags.applyPurityTrigger)purityTrigger = hPurityHadron->Interpolate(pttrigger);
if (efficiencyFlags.applyPurityTrigger)
purityTrigger = hPurityHadron->Interpolate(pttrigger);
if (efficiencyFlags.applyEfficiencyPropagation) {
triggerEfficiencyUncert = hEfficiencyUncertaintyTrigger->Interpolate(ptassoc, assoc.eta());
if(efficiencyFlags.applyPurityTrigger)triggerPurityUncertainty = hPurityUncertaintyHadron->Interpolate(ptassoc);
if (efficiencyFlags.applyPurityTrigger)
triggerPurityUncertainty = hPurityUncertaintyHadron->Interpolate(ptassoc);
}
}
if (efficiency == 0) { // check for zero efficiency, do not apply if the case
Expand Down Expand Up @@ -1694,7 +1698,8 @@
float purity = 1.0f;
if (efficiencyFlags.applyEfficiencyCorrection) {
efficiency = hEfficiencyHadron->Interpolate(assoc.pt(), assoc.eta());
if(efficiencyFlags.applyPurityHadron)purity = hPurityHadron->Interpolate(assoc.pt());
if (efficiencyFlags.applyPurityHadron)
purity = hPurityHadron->Interpolate(assoc.pt());
}
if (efficiency == 0) { // check for zero efficiency, do not apply if the case
efficiency = 1;
Expand Down
Loading