Skip to content

Commit d8f1e57

Browse files
committed
Added histograms for decay radii, created new registry for findable histograms
1 parent dbd5cd5 commit d8f1e57

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

PWGLF/TableProducer/Strangeness/sigmaminustask.cxx

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
#include "Common/DataModel/EventSelection.h"
1919
#include "Common/DataModel/PIDResponse.h"
2020

21+
#include "Common/Core/trackUtilities.h"
2122
#include "Framework/AnalysisTask.h"
2223
#include "Framework/runDataProcessing.h"
2324
#include "ReconstructionDataFormats/PID.h"
25+
#include "ReconstructionDataFormats/Track.h"
2426

2527
using namespace o2;
2628
using namespace o2::framework;
@@ -41,6 +43,7 @@ struct sigmaminustask {
4143
// Histograms are defined with HistogramRegistry
4244
HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
4345
HistogramRegistry rSigmaMinus{"sigmaminus", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
46+
HistogramRegistry rFindable{"findable", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
4447

4548
// Configurable for event selection
4649
Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"};
@@ -65,9 +68,11 @@ struct sigmaminustask {
6568
const AxisSpec vertexZAxis{100, -15., 15., "vrtx_{Z} [cm]"};
6669
const AxisSpec dcaMothAxis{100, 0, 1, "DCA [cm]"};
6770
const AxisSpec dcaDaugAxis{200, 0, 20, "DCA [cm]"};
71+
const AxisSpec radiusAxis{100, -1, 40, "Decay radius [cm]"};
6872

69-
const AxisSpec ptResolutionAxis{100, -0.5, 0.5, "#it{p}_{T}^{rec} - #it{p}_{T}^{gen} (GeV/#it{c})"};
70-
const AxisSpec massResolutionAxis{100, -0.1, 0.1, "m_{rec} - m_{gen} (GeV/#it{c}^{2})"};
73+
const AxisSpec ptResolutionAxis{100, -2, 2, "(#it{p}_{T}^{rec} - #it{p}_{T}^{gen}) / #it{p}_{T}^{gen}"};
74+
const AxisSpec massResolutionAxis{100, -2, 2, "(m_{rec} - m_{gen}) / m_{gen}"};
75+
const AxisSpec radiusResolutionAxis{100, -2, 2, "(r_{rec} - r_{gen}) / r_{gen}"};
7176

7277
const AxisSpec boolAxis{2, -0.5, 1.5, "Boolean value (0=false, 1=true)"};
7378
const AxisSpec filtersAxis{10, -0.5, 9.5, "Filter index"};
@@ -101,8 +106,11 @@ struct sigmaminustask {
101106

102107
if (doprocessFindable) {
103108
// Add findable Sigma histograms
104-
rSigmaMinus.add("h2MassPtFindable", "h2MassPtFindable", {HistType::kTH2F, {ptAxis, sigmaMassAxis}});
105-
rSigmaMinus.add("hFilterIndex", "hFilterIndex", {HistType::kTH1F, {filtersAxis}});
109+
rFindable.add("h2MassPtFindableAll", "h2MassPtFindableAll", {HistType::kTH2F, {ptAxis, sigmaMassAxis}});
110+
rFindable.add("hFilterIndex", "hFilterIndex", {HistType::kTH1F, {filtersAxis}});
111+
rFindable.add("h2MCRadiusFilterIndex", "h2RadiusFilterIndex", {HistType::kTH2F, {filtersAxis, radiusAxis}});
112+
rFindable.add("h2RecRadiusFilterIndex", "h2RecRadiusFilterIndex", {HistType::kTH2F, {filtersAxis, radiusAxis}});
113+
106114
}
107115
}
108116

@@ -191,6 +199,7 @@ struct sigmaminustask {
191199
float deltaXMother = mcTrackPiDau.vx() - piMother.vx();
192200
float deltaYMother = mcTrackPiDau.vy() - piMother.vy();
193201
float decayRadiusMC = std::sqrt(deltaXMother * deltaXMother + deltaYMother * deltaYMother);
202+
float decayRadiusRec = std::sqrt(kinkCand.xDecVtx() * kinkCand.xDecVtx() + kinkCand.yDecVtx() * kinkCand.yDecVtx());
194203

195204
// Check coherence of MCcollision Id for daughter MCparticle and reconstructed collision
196205
bool mcCollisionIdCheck = false;
@@ -209,10 +218,11 @@ struct sigmaminustask {
209218
rSigmaMinus.fill(HIST("h2BCId_comp2"), static_cast<int>(EvSel_vs_MCBCId), static_cast<int>(BCId_vs_EvSel));
210219

211220
rSigmaMinus.fill(HIST("h2MassPtMCRec"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.mSigmaMinus());
212-
rSigmaMinus.fill(HIST("h2MassResolution"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.mSigmaMinus() - MotherMassMC);
213-
rSigmaMinus.fill(HIST("h2PtResolution"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.ptMoth() - MotherpTMC);
221+
rSigmaMinus.fill(HIST("h2MassResolution"), kinkCand.mothSign() * kinkCand.ptMoth(), (kinkCand.mSigmaMinus() - MotherMassMC) / MotherMassMC);
222+
rSigmaMinus.fill(HIST("h2PtResolution"), kinkCand.mothSign() * kinkCand.ptMoth(), (kinkCand.ptMoth() - MotherpTMC) / MotherpTMC);
223+
rSigmaMinus.fill(HIST("h2RadiusResolution"), kinkCand.mothSign() * kinkCand.ptMoth(), (decayRadiusRec - decayRadiusMC) / decayRadiusMC);
214224
rSigmaMinus.fill(HIST("h2DCAMothPt"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.dcaMothPv());
215-
rSigmaMinus.fill(HIST("h2DCADaugPt"), kinkCand.mothSign() * kinkCand.ptDaug(), kinkCand.dcaDaugPv());
225+
rSigmaMinus.fill(HIST("h2DCADaugPt"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.dcaDaugPv());
216226

217227
if (std::abs(mcTrackPiDau.pdgCode()) == 211) {
218228
rSigmaMinus.fill(HIST("h2NSigmaTOFPiPt"), kinkCand.mothSign() * kinkCand.ptMoth(), dauTrack.tofNSigmaPi());
@@ -283,7 +293,7 @@ struct sigmaminustask {
283293

284294
PROCESS_SWITCH(sigmaminustask, processMC, "MC processing", false);
285295

286-
void processFindable(TracksFull const& tracks, aod::McTrackLabels const& trackLabelsMC, aod::McParticles const&, CollisionsFullMC const&)
296+
void processFindable(TracksFull const& tracks, aod::McTrackLabels const& trackLabelsMC, aod::KinkCands const& kinkCands, aod::McParticles const&, CollisionsFullMC const&)
287297
{
288298
for (const auto& motherTrack : tracks) {
289299
// Check if mother is Sigma in MC
@@ -367,15 +377,23 @@ struct sigmaminustask {
367377
} else {
368378
continue;
369379
}
370-
// 6 - geometric cuts: phi
371-
if (std::abs(motherTrack.phi() - daughterTrack.phi()) * radToDeg < 100.0) {
380+
// 6 - geometric cuts: phi difference
381+
if (std::abs(motherTrack.phi() - daughterTrack.phi()) * radToDeg < 50.0) {
372382
filterIndex += 1;
373383
rSigmaMinus.fill(HIST("hFilterIndex"), filterIndex);
374384
} else {
375385
continue;
376386
}
377-
378-
// 7 - collision selection
387+
// 7 - geometric cuts: z difference
388+
o2::track::TrackParCov trackParCovMoth = getTrackParCov(motherTrack);
389+
o2::track::TrackParCov trackParCovDaug = getTrackParCov(daughterTrack);
390+
if (std::abs(trackParCovMoth.getZ() - trackParCovDaug.getZ()) < 20.0) {
391+
filterIndex += 1;
392+
rSigmaMinus.fill(HIST("hFilterIndex"), filterIndex);
393+
} else {
394+
continue;
395+
}
396+
// 8 - collision selection
379397
auto collision = motherTrack.template collision_as<CollisionsFullMC>();
380398
if (!(std::abs(collision.posZ()) > cutzvertex || !collision.sel8())) {
381399
filterIndex += 1;
@@ -394,3 +412,12 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
394412
return WorkflowSpec{
395413
adaptAnalysisTask<sigmaminustask>(cfgc)};
396414
}
415+
416+
// Next steps:
417+
// 0. Resolution histograms should have relative values, not absolute OK
418+
// 1. New h2 with genRadius (recRadius) vs FilterIndex
419+
// 2. Get recRadius through a map on kinkCands, put a negative value if the candidate is not reconstructed
420+
// 2.1 Consider adding step in filters with the cuts on radius
421+
// 2.2 Add h2 of radius resolution vs pt
422+
// 3. Rewrite the findable method using maps to avoid the nested loop
423+
// 4. For generated h2, avoid mass axis, use a bool axis to easily distinguish sigma minus and sigma plus

0 commit comments

Comments
 (0)