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
8 changes: 6 additions & 2 deletions ALICE3/TableProducer/alice3-decayfinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

// Vertexing
Configurable<bool> propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"};
Configurable<bool> useAbsDCA{"useAbsDCA", false, "Minimise abs. distance rather than chi2"};
Configurable<bool> useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"};
Configurable<bool> useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"};
Configurable<double> maxR{"maxR", 200., "reject PCA's above this radius"};
Configurable<double> maxDZIni{"maxDZIni", 1e9, "reject (if>0) PCA candidate if tracks DZ exceeds threshold"};
Expand Down Expand Up @@ -149,10 +149,10 @@

HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

Partition<aod::McParticles> trueD = aod::mcparticle::pdgCode == 421;

Check failure on line 152 in ALICE3/TableProducer/alice3-decayfinder.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.
Partition<aod::McParticles> trueDbar = aod::mcparticle::pdgCode == -421;

Check failure on line 153 in ALICE3/TableProducer/alice3-decayfinder.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.
Partition<aod::McParticles> trueLc = aod::mcparticle::pdgCode == 4122;

Check failure on line 154 in ALICE3/TableProducer/alice3-decayfinder.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.
Partition<aod::McParticles> trueLcbar = aod::mcparticle::pdgCode == -4122;

Check failure on line 155 in ALICE3/TableProducer/alice3-decayfinder.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.

// filter expressions for D mesons
static constexpr uint32_t trackSelectionPiPlusFromD = 1 << kInnerTOFPion | 1 << kOuterTOFPion | 1 << kRICHPion | 1 << kTruePiPlusFromD;
Expand Down Expand Up @@ -281,12 +281,12 @@
dmeson.Ndaug[2] = negP[2];

// return mass and kinematic variables
dmeson.mass = RecoDecay::m(array{array{posP[0], posP[1], posP[2]}, array{negP[0], negP[1], negP[2]}}, array{posMass, negMass});

Check failure on line 284 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
dmeson.pt = std::hypot(posP[0] + negP[0], posP[1] + negP[1]);
dmeson.ptdaugPos = std::hypot(posP[0], posP[1]);
dmeson.ptdaugNeg = std::hypot(negP[0], negP[1]);
dmeson.phi = RecoDecay::phi(array{posP[0] + negP[0], posP[1] + negP[1]});

Check failure on line 288 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
dmeson.eta = RecoDecay::eta(array{posP[0] + negP[0], posP[1] + negP[1], posP[2] + negP[2]});

Check failure on line 289 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
dmeson.y = RecoDecay::y(std::array{posP[0] + negP[0], posP[1] + negP[1], posP[2] + negP[2]}, dmeson.mass);
const auto posSV = fitter.getPCACandidate();
dmeson.posSV[0] = posSV[0];
Expand Down Expand Up @@ -324,19 +324,21 @@
o2::track::TrackParCov trackParVar0 = getTrackParCov(prong0);
o2::track::TrackParCov trackParVar1 = getTrackParCov(prong1);
o2::track::TrackParCov trackParVar2 = getTrackParCov(prong2);

//}-{}-{}-{}-{}-{}-{}-{}-{}-{}
// Move close to minima
int nCand = 0;
try {
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 0.f); // builds candidate
nCand = fitter3.process(trackParVar0, trackParVar1, trackParVar2);
} catch (...) {
LOG(info) << "Second vertex fit failed";
return false;
}
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 1.f); // builds candidate
if (nCand == 0) {
return false;
}
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 2.f); // builds candidate
//}-{}-{}-{}-{}-{}-{}-{}-{}-{}

auto covMatrixPCA = fitter3.calcPCACovMatrixFlat();
Expand All @@ -345,6 +347,7 @@
if (cand3prong.dcaDau > dcaDaughtersSelection) {
return false;
}
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 3.f); // builds candidate

cand3prong.primaryVertex = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()};
auto secondaryVertex = fitter3.getPCACandidate();
Expand Down Expand Up @@ -395,14 +398,14 @@
cand3prong.errorImpactParameterZ2 = impactParameter2.getSigmaZ2();

// return mass
cand3prong.mass = RecoDecay::m(array{array{P0[0], P0[1], P0[2]},

Check failure on line 401 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
array{P1[0], P1[1], P1[2]},
array{P2[0], P2[1], P2[2]}},
daughtersMasses3Prong);

cand3prong.pt = std::hypot(P0[0] + P1[0] + P2[0], P0[1] + P1[1] + P2[1]);
cand3prong.phi = RecoDecay::phi(array{P0[0] + P1[0] + P2[0], P0[1] + P1[1] + P2[1]});

Check failure on line 407 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
cand3prong.eta = RecoDecay::eta(array{P0[0] + P1[0] + P2[0], P0[1] + P1[1] + P2[1], P0[2] + P1[2] + P2[2]});

Check failure on line 408 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
cand3prong.Pdaug0[0] = P0[0];
cand3prong.Pdaug0[1] = P0[1];
cand3prong.Pdaug0[2] = P0[2];
Expand Down Expand Up @@ -571,6 +574,7 @@
}
}
if (doprocessFindLc) {
histos.add("hCandidateBuilderStatus3Prong", "hCandidateBuilderStatus3Prong", kTH1D, {{10, -0.5, 9.5}});
histos.add("h2dGen3Prong", "h2dGen3Prong", kTH2F, {axisPt, axisEta});
histos.add("h2dGen3ProngBar", "h2dGen3ProngBar", kTH2F, {axisPt, axisEta});
histos.add("h3dRec3Prong", "h3dRec3Prong", kTH3F, {axisPt, axisEta, axisLcMass});
Expand Down
54 changes: 28 additions & 26 deletions ALICE3/TableProducer/alice3-decaypreselector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,38 @@
// HF decays. Work in progress: use at your own risk!
//

#include <cmath>
#include <array>
#include <cstdlib>
#include <map>
#include <iterator>
#include <vector>
#include <utility>
#include "PWGLF/DataModel/LFParticleIdentification.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Framework/runDataProcessing.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/ASoAHelpers.h"
#include "DCAFitter/DCAFitterN.h"
#include "ReconstructionDataFormats/Track.h"
#include "ALICE3/DataModel/A3DecayFinderTables.h"
#include "ALICE3/DataModel/OTFRICH.h"
#include "ALICE3/DataModel/OTFTOF.h"
#include "Common/Core/RecoDecay.h"
#include "Common/Core/trackUtilities.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/LFParticleIdentification.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "DetectorsBase/Propagator.h"
#include "DetectorsBase/GeometryManager.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsCalibration/MeanVertexObject.h"
#include "ALICE3/DataModel/OTFTOF.h"
#include "ALICE3/DataModel/OTFRICH.h"
#include "ALICE3/DataModel/A3DecayFinderTables.h"

#include <CCDB/BasicCCDBManager.h>
#include <DCAFitter/DCAFitterN.h>
#include <DataFormatsCalibration/MeanVertexObject.h>
#include <DataFormatsParameters/GRPMagField.h>
#include <DataFormatsParameters/GRPObject.h>
#include <DetectorsBase/GeometryManager.h>
#include <DetectorsBase/Propagator.h>
#include <Framework/ASoAHelpers.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisTask.h>
#include <Framework/RunningWorkflowInfo.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/Track.h>
Comment on lines +31 to +43
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the style.


#include <array>
#include <cmath>
#include <cstdlib>
#include <iterator>
#include <map>
#include <utility>
#include <vector>

using namespace o2;
using namespace o2::framework;
Expand Down
20 changes: 19 additions & 1 deletion ALICE3/TableProducer/alice3HfSelector3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ struct Alice3HfSelector3Prong {
labels[1 + aod::SelectionStep::RecoMl] = "ML selection";
static const AxisSpec axisSelections = {kNBinsSelections, 0.5, kNBinsSelections + 0.5, ""};
registry.add("hSelections", "Selections;;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisSelections, {(std::vector<double>)binsPt, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hSelectionsTopology", "hSelectionsTopology", {HistType::kTH1D, {{10, -0.5, 9.5, "Selection step"}}});
for (int iBin = 0; iBin < kNBinsSelections; ++iBin) {
registry.get<TH2>(HIST("hSelections"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data());
}
Expand Down Expand Up @@ -151,52 +152,66 @@ struct Alice3HfSelector3Prong {
bool selectionTopol(const T& cand, float candPt)
{
int const ptBin = findBin(binsPt, candPt);

auto fillQAHistogram = [&](float bin) {
if (activateQA) {
registry.fill(HIST("hSelectionsTopology"), bin);
}
};
fillQAHistogram(0.f);
// check that the cand pT is within the analysis range
if (candPt < ptCandMin || candPt >= ptCandMax) {
return false;
}
fillQAHistogram(1.f);

// cut on daughter pT
if (cand.ptProng0() < cuts->get(ptBin, "pT prong 0") ||
cand.ptProng1() < cuts->get(ptBin, "pT prong 1") ||
cand.ptProng2() < cuts->get(ptBin, "pT prong 2")) {
return false;
}
fillQAHistogram(2.f);

// cosine of pointing angle
if (cand.cpa() <= cuts->get(ptBin, "cos pointing angle")) {
return false;
}
fillQAHistogram(3.f);

// cand chi2PCA
if (cand.chi2PCA() > cuts->get(ptBin, "Chi2PCA")) {
return false;
}
fillQAHistogram(4.f);

if (cand.decayLength() <= cuts->get(ptBin, "decay length")) {
return false;
}
fillQAHistogram(5.f);

// cand decay length XY
if (cand.decayLengthXY() <= cuts->get(ptBin, "decLengthXY")) {
return false;
}
fillQAHistogram(6.f);

// cand normalized decay length XY
if (cand.decayLengthXYNormalised() < cuts->get(ptBin, "normDecLXY")) {
return false;
}
fillQAHistogram(7.f);

// cand impact parameter XY
if (std::abs(cand.impactParameterXY()) > cuts->get(ptBin, "impParXY")) {
return false;
}
fillQAHistogram(8.f);

// cand daughter prong DCA
if (!isSelectedCandidateProngDca(cand)) {
return false;
}
fillQAHistogram(9.f);

return true;
}
Expand Down Expand Up @@ -292,6 +307,9 @@ struct Alice3HfSelector3Prong {

// looping over 3-prong cands
for (const auto& cand : cands) {
if (activateQA) {
registry.fill(HIST("hSelections"), 1, cand.pt());
}
outputMl = {-1.f, -1.f, -1.f};
pidMask = 0;

Expand Down
2 changes: 1 addition & 1 deletion ALICE3/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ o2physics_add_dpl_workflow(alice3-multicharm

o2physics_add_dpl_workflow(alice3-hf-task-3prong
SOURCES alice3HfTask3Prong.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::SGCutParHolder O2Physics::MLCore
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-efficiency
Expand Down
2 changes: 2 additions & 0 deletions ALICE3/Tasks/alice3-qa-singleparticle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <TDatabasePDG.h>
#include <TMCProcess.h>

#include <vector>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand Down
Loading
Loading