Skip to content

Commit 9c9588a

Browse files
committed
Update Lc task
1 parent 6826646 commit 9c9588a

File tree

7 files changed

+234
-128
lines changed

7 files changed

+234
-128
lines changed

ALICE3/TableProducer/alice3-decayfinder.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct alice3decayFinder {
7979

8080
// Vertexing
8181
Configurable<bool> propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"};
82-
Configurable<bool> useAbsDCA{"useAbsDCA", false, "Minimise abs. distance rather than chi2"};
82+
Configurable<bool> useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"};
8383
Configurable<bool> useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"};
8484
Configurable<double> maxR{"maxR", 200., "reject PCA's above this radius"};
8585
Configurable<double> maxDZIni{"maxDZIni", 1e9, "reject (if>0) PCA candidate if tracks DZ exceeds threshold"};
@@ -324,19 +324,21 @@ struct alice3decayFinder {
324324
o2::track::TrackParCov trackParVar0 = getTrackParCov(prong0);
325325
o2::track::TrackParCov trackParVar1 = getTrackParCov(prong1);
326326
o2::track::TrackParCov trackParVar2 = getTrackParCov(prong2);
327-
328327
//}-{}-{}-{}-{}-{}-{}-{}-{}-{}
329328
// Move close to minima
330329
int nCand = 0;
331330
try {
331+
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 0.f); // builds candidate
332332
nCand = fitter3.process(trackParVar0, trackParVar1, trackParVar2);
333333
} catch (...) {
334334
LOG(info) << "Second vertex fit failed";
335335
return false;
336336
}
337+
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 1.f); // builds candidate
337338
if (nCand == 0) {
338339
return false;
339340
}
341+
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 2.f); // builds candidate
340342
//}-{}-{}-{}-{}-{}-{}-{}-{}-{}
341343

342344
auto covMatrixPCA = fitter3.calcPCACovMatrixFlat();
@@ -345,6 +347,7 @@ struct alice3decayFinder {
345347
if (cand3prong.dcaDau > dcaDaughtersSelection) {
346348
return false;
347349
}
350+
histos.fill(HIST("hCandidateBuilderStatus3Prong"), 3.f); // builds candidate
348351

349352
cand3prong.primaryVertex = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()};
350353
auto secondaryVertex = fitter3.getPCACandidate();
@@ -571,6 +574,7 @@ struct alice3decayFinder {
571574
}
572575
}
573576
if (doprocessFindLc) {
577+
histos.add("hCandidateBuilderStatus3Prong", "hCandidateBuilderStatus3Prong", kTH1D, {{10, -0.5, 9.5}});
574578
histos.add("h2dGen3Prong", "h2dGen3Prong", kTH2F, {axisPt, axisEta});
575579
histos.add("h2dGen3ProngBar", "h2dGen3ProngBar", kTH2F, {axisPt, axisEta});
576580
histos.add("h3dRec3Prong", "h3dRec3Prong", kTH3F, {axisPt, axisEta, axisLcMass});

ALICE3/TableProducer/alice3-decaypreselector.cxx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,38 @@
1717
// HF decays. Work in progress: use at your own risk!
1818
//
1919

20-
#include <cmath>
21-
#include <array>
22-
#include <cstdlib>
23-
#include <map>
24-
#include <iterator>
25-
#include <vector>
26-
#include <utility>
20+
#include "PWGLF/DataModel/LFParticleIdentification.h"
21+
#include "PWGLF/DataModel/LFStrangenessTables.h"
2722

28-
#include "Framework/runDataProcessing.h"
29-
#include "Framework/RunningWorkflowInfo.h"
30-
#include "Framework/AnalysisTask.h"
31-
#include "Framework/AnalysisDataModel.h"
32-
#include "Framework/ASoAHelpers.h"
33-
#include "DCAFitter/DCAFitterN.h"
34-
#include "ReconstructionDataFormats/Track.h"
23+
#include "ALICE3/DataModel/A3DecayFinderTables.h"
24+
#include "ALICE3/DataModel/OTFRICH.h"
25+
#include "ALICE3/DataModel/OTFTOF.h"
3526
#include "Common/Core/RecoDecay.h"
36-
#include "Common/Core/trackUtilities.h"
37-
#include "PWGLF/DataModel/LFStrangenessTables.h"
38-
#include "PWGLF/DataModel/LFParticleIdentification.h"
3927
#include "Common/Core/TrackSelection.h"
28+
#include "Common/Core/trackUtilities.h"
4029
#include "Common/DataModel/TrackSelectionTables.h"
41-
#include "DetectorsBase/Propagator.h"
42-
#include "DetectorsBase/GeometryManager.h"
43-
#include "DataFormatsParameters/GRPObject.h"
44-
#include "DataFormatsParameters/GRPMagField.h"
45-
#include "CCDB/BasicCCDBManager.h"
46-
#include "DataFormatsCalibration/MeanVertexObject.h"
47-
#include "ALICE3/DataModel/OTFTOF.h"
48-
#include "ALICE3/DataModel/OTFRICH.h"
49-
#include "ALICE3/DataModel/A3DecayFinderTables.h"
30+
31+
#include <CCDB/BasicCCDBManager.h>
32+
#include <DCAFitter/DCAFitterN.h>
33+
#include <DataFormatsCalibration/MeanVertexObject.h>
34+
#include <DataFormatsParameters/GRPMagField.h>
35+
#include <DataFormatsParameters/GRPObject.h>
36+
#include <DetectorsBase/GeometryManager.h>
37+
#include <DetectorsBase/Propagator.h>
38+
#include <Framework/ASoAHelpers.h>
39+
#include <Framework/AnalysisDataModel.h>
40+
#include <Framework/AnalysisTask.h>
41+
#include <Framework/RunningWorkflowInfo.h>
42+
#include <Framework/runDataProcessing.h>
43+
#include <ReconstructionDataFormats/Track.h>
44+
45+
#include <array>
46+
#include <cmath>
47+
#include <cstdlib>
48+
#include <iterator>
49+
#include <map>
50+
#include <utility>
51+
#include <vector>
5052

5153
using namespace o2;
5254
using namespace o2::framework;

ALICE3/TableProducer/alice3HfSelector3Prong.cxx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ struct Alice3HfSelector3Prong {
120120
labels[1 + aod::SelectionStep::RecoMl] = "ML selection";
121121
static const AxisSpec axisSelections = {kNBinsSelections, 0.5, kNBinsSelections + 0.5, ""};
122122
registry.add("hSelections", "Selections;;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisSelections, {(std::vector<double>)binsPt, "#it{p}_{T} (GeV/#it{c})"}}});
123+
registry.add("hSelectionsTopology", "hSelectionsTopology", {HistType::kTH1D, {{10, -0.5, 9.5, "Selection step"}}});
123124
for (int iBin = 0; iBin < kNBinsSelections; ++iBin) {
124125
registry.get<TH2>(HIST("hSelections"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data());
125126
}
@@ -151,52 +152,66 @@ struct Alice3HfSelector3Prong {
151152
bool selectionTopol(const T& cand, float candPt)
152153
{
153154
int const ptBin = findBin(binsPt, candPt);
154-
155+
auto fillQAHistogram = [&](float bin) {
156+
if (activateQA) {
157+
registry.fill(HIST("hSelectionsTopology"), bin);
158+
}
159+
};
160+
fillQAHistogram(0.f);
155161
// check that the cand pT is within the analysis range
156162
if (candPt < ptCandMin || candPt >= ptCandMax) {
157163
return false;
158164
}
165+
fillQAHistogram(1.f);
159166

160167
// cut on daughter pT
161168
if (cand.ptProng0() < cuts->get(ptBin, "pT prong 0") ||
162169
cand.ptProng1() < cuts->get(ptBin, "pT prong 1") ||
163170
cand.ptProng2() < cuts->get(ptBin, "pT prong 2")) {
164171
return false;
165172
}
173+
fillQAHistogram(2.f);
166174

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

172181
// cand chi2PCA
173182
if (cand.chi2PCA() > cuts->get(ptBin, "Chi2PCA")) {
174183
return false;
175184
}
185+
fillQAHistogram(4.f);
176186

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

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

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

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

196210
// cand daughter prong DCA
197211
if (!isSelectedCandidateProngDca(cand)) {
198212
return false;
199213
}
214+
fillQAHistogram(9.f);
200215

201216
return true;
202217
}
@@ -292,6 +307,9 @@ struct Alice3HfSelector3Prong {
292307

293308
// looping over 3-prong cands
294309
for (const auto& cand : cands) {
310+
if (activateQA) {
311+
registry.fill(HIST("hSelections"), 1, cand.pt());
312+
}
295313
outputMl = {-1.f, -1.f, -1.f};
296314
pidMask = 0;
297315

ALICE3/Tasks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ o2physics_add_dpl_workflow(alice3-multicharm
6666

6767
o2physics_add_dpl_workflow(alice3-hf-task-3prong
6868
SOURCES alice3HfTask3Prong.cxx
69-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::SGCutParHolder O2Physics::MLCore
69+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
7070
COMPONENT_NAME Analysis)
7171

7272
o2physics_add_dpl_workflow(alice3-efficiency

ALICE3/Tasks/alice3-qa-singleparticle.cxx

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
/// \brief Task to monitor the single particle QA, at the particle and track level, showing the tracked and the origin of particles
1616
///
1717

18-
// O2 includes
19-
#include "Framework/AnalysisTask.h"
20-
#include "Framework/runDataProcessing.h"
21-
#include "Framework/HistogramRegistry.h"
22-
#include "Framework/O2DatabasePDGPlugin.h"
23-
#include "TDatabasePDG.h"
24-
#include "TMCProcess.h"
18+
#include <Framework/AnalysisTask.h>
19+
#include <Framework/HistogramRegistry.h>
20+
#include <Framework/O2DatabasePDGPlugin.h>
21+
#include <Framework/runDataProcessing.h>
22+
23+
#include <TDatabasePDG.h>
24+
#include <TMCProcess.h>
25+
26+
#include <vector>
2527

2628
using namespace o2;
2729
using namespace o2::framework;
@@ -97,11 +99,9 @@ struct Alice3SingleParticle {
9799
const AxisSpec axisProdz{prodBinsZ, prodMinZ, prodMaxZ, "Prod. Vertex Z (cm)"};
98100
const AxisSpec axisProdRadius{prodBins, 0., 2. * prodMax, "Prod. Vertex Radius (cm)"};
99101

100-
if (!doprocessParticleOnly) {
101-
histos.add("event/VtxX", "Vertex X", kTH1D, {axisVx});
102-
histos.add("event/VtxY", "Vertex Y", kTH1D, {axisVy});
103-
histos.add("event/VtxZ", "Vertex Z", kTH1D, {axisVz});
104-
}
102+
histos.add("event/VtxX", "Vertex X", kTH1D, {axisVx});
103+
histos.add("event/VtxY", "Vertex Y", kTH1D, {axisVy});
104+
histos.add("event/VtxZ", "Vertex Z", kTH1D, {axisVz});
105105

106106
histos.add("particle/PDGs", "Particle PDGs", kTH2D, {axisPDGs, axisCharge});
107107
histos.add("particle/PDGsPrimaries", "Particle PDGs of Primaries", kTH2D, {axisPDGs, axisCharge});
@@ -145,6 +145,7 @@ struct Alice3SingleParticle {
145145
histos.add("particle/Py", "Particle Py " + tit, kTH1D, {axisPy});
146146
histos.add("particle/Pz", "Particle Pz " + tit, kTH1D, {axisPz});
147147

148+
histos.add("particle/daughters/Number", "Number of Daughters " + tit, kTH1D, {{20, -0.5, 19.5}});
148149
histos.add("particle/daughters/PDGs", "Daughters PDGs " + tit, kTH2D, {axisPDGs, axisCharge});
149150
histos.add("particle/daughters/PDGsPrimaries", "Daughters PDGs Primaries of " + tit, kTH2D, {axisPDGs, axisCharge});
150151
histos.add("particle/daughters/PDGsSecondaries", "Daughters PDGs Secondaries of " + tit, kTH2D, {axisPDGs, axisCharge});
@@ -158,6 +159,7 @@ struct Alice3SingleParticle {
158159
histos.add("particle/daughters/prodRadiusVsPt", "Daughters Prod. Vertex Radius " + tit, kTH2D, {axisPt, axisProdRadius});
159160
histos.add("particle/daughters/prodRadius3DVsPt", "Daughters Prod. Vertex Radius XYZ " + tit, kTH2D, {axisPt, axisProdRadius});
160161

162+
histos.add("particle/mothers/Number", "Number of Mothers " + tit, kTH1D, {{20, -0.5, 19.5}});
161163
histos.add("particle/mothers/PDGs", "Mothers PDGs " + tit, kTH2D, {axisPDGs, axisCharge});
162164
histos.add("particle/mothers/PDGsPrimaries", "Mothers PDGs Primaries of " + tit, kTH2D, {axisPDGs, axisCharge});
163165
histos.add("particle/mothers/PDGsSecondaries", "Mothers PDGs Secondaries of " + tit, kTH2D, {axisPDGs, axisCharge});
@@ -167,6 +169,8 @@ struct Alice3SingleParticle {
167169
histos.add("particle/mothers/prodRadiusVsPt", "Mothers Prod. Vertex Radius " + tit, kTH2D, {axisPt, axisProdRadius});
168170
histos.add("particle/mothers/prodRadius3DVsPt", "Mothers Prod. Vertex Radius XYZ " + tit, kTH2D, {axisPt, axisProdRadius});
169171

172+
// Go up one generation
173+
histos.add("particle/mothers/mothers/Number", "Number of Mothers mothers " + tit, kTH1D, {{20, -0.5, 19.5}});
170174
histos.add("particle/mothers/mothers/PDGs", "Mothers mothers PDGs " + tit, kTH2D, {axisPDGs, axisCharge});
171175
histos.add("particle/mothers/mothers/PDGsPrimaries", "Mothers mothers PDGs Primaries of " + tit, kTH2D, {axisPDGs, axisCharge});
172176
histos.add("particle/mothers/mothers/PDGsSecondaries", "Mothers mothers PDGs Secondaries of " + tit, kTH2D, {axisPDGs, axisCharge});
@@ -272,6 +276,7 @@ struct Alice3SingleParticle {
272276
histos.fill(HIST("particle/prodVz"), mcParticle.vz());
273277
if (mcParticle.has_daughters()) {
274278
auto daughters = mcParticle.daughters_as<aod::McParticles>();
279+
histos.fill(HIST("particle/daughters/Number"), daughters.size());
275280
for (const auto& daughter : daughters) {
276281
const auto& pdgStringDau = getPdgCodeString(daughter);
277282
const auto& pdgChargeDau = getCharge(daughter);
@@ -293,6 +298,8 @@ struct Alice3SingleParticle {
293298
histos.fill(HIST("particle/daughters/prodRadiusVsPt"), mcParticle.pt(), std::sqrt(daughter.vx() * daughter.vx() + daughter.vy() * daughter.vy()));
294299
histos.fill(HIST("particle/daughters/prodRadius3DVsPt"), mcParticle.pt(), std::sqrt(daughter.vx() * daughter.vx() + daughter.vy() * daughter.vy() + daughter.vz() * daughter.vz()));
295300
}
301+
} else {
302+
histos.fill(HIST("particle/daughters/Number"), 0.f);
296303
}
297304
if (mcParticle.has_mothers()) {
298305
const auto& mothers = mcParticle.mothers_as<aod::McParticles>();
@@ -415,8 +422,14 @@ struct Alice3SingleParticle {
415422
}
416423
PROCESS_SWITCH(Alice3SingleParticle, processStandard, "Process IU tracks", true);
417424

418-
void processParticleOnly(const aod::McParticles& mcParticles)
425+
void processParticleOnly(const o2::aod::McCollisions& colls,
426+
const aod::McParticles& mcParticles)
419427
{
428+
for (const auto& col : colls) {
429+
histos.fill(HIST("event/VtxX"), col.posX());
430+
histos.fill(HIST("event/VtxY"), col.posY());
431+
histos.fill(HIST("event/VtxZ"), col.posZ());
432+
}
420433
for (const auto& mcParticle : mcParticles) {
421434
const auto& pdgString = getPdgCodeString(mcParticle);
422435
const auto& pdgCharge = getCharge(mcParticle);
@@ -467,6 +480,7 @@ struct Alice3SingleParticle {
467480
histos.fill(HIST("particle/prodVz"), mcParticle.vz());
468481
if (mcParticle.has_daughters()) {
469482
auto daughters = mcParticle.daughters_as<aod::McParticles>();
483+
histos.fill(HIST("particle/daughters/Number"), daughters.size());
470484
for (const auto& daughter : daughters) {
471485
const auto& pdgStringDau = getPdgCodeString(daughter);
472486
const auto& pdgChargeDau = getCharge(daughter);
@@ -484,6 +498,8 @@ struct Alice3SingleParticle {
484498
histos.fill(HIST("particle/daughters/prodRadiusVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy()));
485499
histos.fill(HIST("particle/daughters/prodRadius3DVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy() + mcParticle.vz() * mcParticle.vz()));
486500
}
501+
} else {
502+
histos.fill(HIST("particle/daughters/Number"), 0.f);
487503
}
488504
if (mcParticle.has_mothers()) {
489505
auto mothers = mcParticle.mothers_as<aod::McParticles>();
@@ -586,6 +602,7 @@ struct Alice3SingleParticle {
586602
histos.fill(HIST("particle/prodVz"), mcParticle.vz());
587603
if (mcParticle.has_daughters()) {
588604
auto daughters = mcParticle.daughters_as<aod::McParticles>();
605+
histos.fill(HIST("particle/daughters/Number"), daughters.size());
589606
for (const auto& daughter : daughters) {
590607
const auto& pdgStringDau = getPdgCodeString(daughter);
591608
const auto& pdgChargeDau = getCharge(daughter);
@@ -603,6 +620,8 @@ struct Alice3SingleParticle {
603620
histos.fill(HIST("particle/daughters/prodRadiusVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy()));
604621
histos.fill(HIST("particle/daughters/prodRadius3DVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy() + mcParticle.vz() * mcParticle.vz()));
605622
}
623+
} else {
624+
histos.fill(HIST("particle/daughters/Number"), 0.f);
606625
}
607626
if (mcParticle.has_mothers()) {
608627
auto mothers = mcParticle.mothers_as<aod::McParticles>();

0 commit comments

Comments
 (0)