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
16 changes: 8 additions & 8 deletions PWGLF/TableProducer/Strangeness/sigma0builder.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/TableProducer/Strangeness/sigma0builder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -182,8 +182,8 @@
// Lambda criteria:
struct : ConfigurableGroup {
std::string prefix = "lambdaSelections"; // JSON group name
Configurable<float> Lambda_MLThreshold{"Lambda_MLThreshold", 0.1, "Decision Threshold value to select lambdas"};

Check failure on line 185 in PWGLF/TableProducer/Strangeness/sigma0builder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> AntiLambda_MLThreshold{"AntiLambda_MLThreshold", 0.1, "Decision Threshold value to select antilambdas"};

Check failure on line 186 in PWGLF/TableProducer/Strangeness/sigma0builder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<bool> doMCAssociation{"doMCAssociation", false, "if MC, select true lambda/alambdas only"};
Configurable<float> LambdaMinDCANegToPv{"LambdaMinDCANegToPv", .05, "min DCA Neg To PV (cm)"};
Configurable<float> LambdaMinDCAPosToPv{"LambdaMinDCAPosToPv", .05, "min DCA Pos To PV (cm)"};
Expand Down Expand Up @@ -1081,7 +1081,7 @@
// Assumption: first mother is the physical one
auto const& lambdaMother = lambdaMothers.front();
int lambdaMotherIndex = lambdaMother.globalIndex();

// ============================================================
// 2) --- EMCal cluster: loop over MC contributors ---
// ============================================================
Expand Down Expand Up @@ -1117,21 +1117,21 @@
// Require true photon, please
if (mcPhoton.pdgCode() != PDG_t::kGamma)
continue;

// Get Sigma0 index from photon mother
auto const& photonMothers = mcPhoton.template mothers_as<aod::McParticles>();
auto const& photonMothers = mcPhoton.template mothers_as<aod::McParticles>();
if (photonMothers.empty()) // No mothers? Weird
continue;

// Assumption: first mother is the physical one
auto const& photonMother = photonMothers.front();
int photonMotherIndex = photonMother.globalIndex();
int photonMotherIndex = photonMother.globalIndex();

// ------------------------------------------------------------
// Check 2:
// Does this photon share the same mother as the Lambda?
// ------------------------------------------------------------
if (photonMotherIndex == lambdaMotherIndex) {
if (photonMotherIndex == lambdaMotherIndex) {
matchedPhotonId = daughterId;
matchedMotherIndex = photonMotherIndex;
MCinfo.EMCalClusterAmplitude = cluster.amplitudeA()[i];
Expand Down Expand Up @@ -1282,7 +1282,7 @@
}
if (fillHists)
histos.fill(HIST("hEventSelection"), 16 /* INEL > 0 */);
if (eventSelections.requireINEL1 && collision.multNTracksPVeta1() < 2) {

Check failure on line 1285 in PWGLF/TableProducer/Strangeness/sigma0builder.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.
return false;
}
if (fillHists)
Expand Down Expand Up @@ -1395,7 +1395,7 @@
continue;
}

if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10() < 2) {

Check failure on line 1398 in PWGLF/TableProducer/Strangeness/sigma0builder.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.
continue;
}
}
Expand Down Expand Up @@ -1472,7 +1472,7 @@
continue;
}

if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10() < 2) {

Check failure on line 1475 in PWGLF/TableProducer/Strangeness/sigma0builder.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.
continue;
}
}
Expand Down Expand Up @@ -1603,7 +1603,7 @@
for (auto const& daughter : daughters) {
histos.fill(HIST("GenQA/h2dSigma0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode());

if (GenInfo.NDaughters == 2) {

Check failure on line 1606 in PWGLF/TableProducer/Strangeness/sigma0builder.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 (daughter.pdgCode() == PDG_t::kGamma)
GenInfo.MCDau1Pt = daughter.pt();

Expand Down Expand Up @@ -2402,7 +2402,7 @@
// Momentum components
float gammapx = gammapT * std::cos(gamma.phi());
float gammapy = gammapT * std::sin(gamma.phi());
float gammapz = gammapT * std::sinh(gamma.eta());
float gammapz = gammapT * std::sinh(gamma.eta());

//_______________________________________________
// Sigma0 pre-selections
Expand Down Expand Up @@ -2439,7 +2439,7 @@
if constexpr (requires { gamma.mcParticleIds(); lambda.motherMCPartId(); }) {

auto sigma0MCInfo = getClusterV0PairMCInfo(gamma, lambda, collision, mcparticles);

sigma0mccores(sigma0MCInfo.V0PairMCParticleID, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator,
sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, sigma0MCInfo.EMCalClusterAmplitude,
sigma0MCInfo.V01PDGCodePos, sigma0MCInfo.V01PDGCodeNeg, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign,
Expand Down Expand Up @@ -2954,7 +2954,7 @@
auto v0MC = v0.template v0MCCore_as<soa::Join<aod::V0MCCores, aod::V0MCCollRefs>>();
auto mcv0Photon = mcparticles.rawIteratorAt(v0MC.particleIdMC());

if (mcv0Photon.pdgCode() != PDG_t::kGamma || !mcv0Photon.isPhysicalPrimary() || TMath::Abs(mcv0Photon.y()) > 0.5)

Check failure on line 2957 in PWGLF/TableProducer/Strangeness/sigma0builder.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.
continue;

// MC pT histo
Expand Down Expand Up @@ -3044,7 +3044,7 @@
// Select TRUE + PRIMARY photons
// ============================================================

if (mcPhoton.pdgCode() != PDG_t::kGamma || !mcPhoton.isPhysicalPrimary() || TMath::Abs(mcPhoton.y()) > 0.5)

Check failure on line 3047 in PWGLF/TableProducer/Strangeness/sigma0builder.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.
continue;

// ============================================================
Expand Down Expand Up @@ -3101,7 +3101,7 @@

// Process MC generated photons
for (const auto& mcpart : mcparticles) {
if (mcpart.pdgCode() != PDG_t::kGamma || !mcpart.isPhysicalPrimary() || TMath::Abs(mcpart.y()) > 0.5)

Check failure on line 3104 in PWGLF/TableProducer/Strangeness/sigma0builder.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.
continue;

histos.fill(HIST("PhotonMCQA/hGenPhoton"), mcpart.pt());
Expand Down
10 changes: 5 additions & 5 deletions PWGLF/Tasks/Strangeness/sigmaanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,9 @@ struct sigmaanalysis {
histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisReso});
histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt});
histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt});
histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows});
histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows});
histos.add(histodir + "/MC/Reso/h2dAntiLambdaPtResolution", "h2dAntiLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt});
histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows});
histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows});
histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisReso});
histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt});
histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisReso});
Expand Down Expand Up @@ -1011,7 +1011,7 @@ struct sigmaanalysis {
// Gamma MC association
if (sigma.photonPDGCode() == PDG_t::kGamma) {
if (sigma.photonmcpt() > 0) {
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt()/sigma.photonmcpt()) - 1.f); // pT resolution
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt() / sigma.photonmcpt()) - 1.f); // pT resolution
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution
}
}
Expand Down Expand Up @@ -1041,7 +1041,7 @@ struct sigmaanalysis {
if (sigma.isSigma0()) {
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution
if (sigma.mcpt() > 0) {
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt()/sigma.mcpt()) - 1.f); // pT resolution
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt() / sigma.mcpt()) - 1.f); // pT resolution
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution
}
}
Expand Down Expand Up @@ -1664,7 +1664,7 @@ struct sigmaanalysis {
auto sigma0 = fullSigma0s.rawIteratorAt(sigma0grouped[coll.globalIndex()][i]);

// if MC
if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0(); }) {
if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0(); }) {
if (doMCAssociation && !(sigma0.isSigma0() || sigma0.isAntiSigma0()))
continue;

Expand Down
Loading