Skip to content

Commit f29788b

Browse files
committed
added dcaHadron Histogram
1 parent 2dcc449 commit f29788b

File tree

1 file changed

+104
-65
lines changed

1 file changed

+104
-65
lines changed

PWGHF/HFL/Tasks/taskSingleElectron.cxx

Lines changed: 104 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2-
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3-
// All rights not expressly granted are reserved.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright
3+
// holders. All rights not expressly granted are reserved.
44
//
55
// This software is distributed under the terms of the GNU General Public
66
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
@@ -12,6 +12,7 @@
1212
/// \file taskSingleElectron.cxx
1313
/// \brief task for electrons from heavy-flavour hadron decays
1414
/// \author Jonghan Park (Jeonbuk National University)
15+
/// \author Seul I Jeong (Pusan National University)
1516

1617
#include "Common/DataModel/EventSelection.h"
1718
#include "Common/DataModel/PIDResponseTOF.h"
@@ -41,11 +42,7 @@ using namespace o2::constants::physics;
4142
using namespace o2::framework;
4243
using namespace o2::framework::expressions;
4344

44-
enum PdgCode {
45-
kEta = 221,
46-
kOmega = 223,
47-
kEtaPrime = 331
48-
};
45+
enum PdgCode { kEta = 221, kOmega = 223, kEtaPrime = 331 };
4946

5047
enum SourceType {
5148
NotElec = 0, // not electron
@@ -88,41 +85,63 @@ struct HfTaskSingleElectron {
8885
Configurable<float> ptTrackMax{"ptTrackMax", 10., "max pt cut"};
8986
Configurable<float> ptTrackMin{"ptTrackMin", 0.5, "min pt cut"};
9087
Configurable<float> etaTrackMax{"etaTrackMax", 0.8, "eta cut"};
91-
Configurable<int> tpcNCrossedRowMin{"tpcNCrossedRowMin", 70, "max of TPC n cluster crossed rows"};
92-
Configurable<float> tpcNClsFoundOverFindableMin{"tpcNClsFoundOverFindableMin", 0.8, "min # of TPC found/findable clusters"};
93-
Configurable<float> tpcChi2perNClMax{"tpcChi2perNClMax", 4., "min # of tpc chi2 per clusters"};
94-
Configurable<int> itsIBClsMin{"itsIBClsMin", 3, "min # of its clusters in IB"};
95-
Configurable<float> itsChi2perNClMax{"itsChi2perNClMax", 6., "min # of tpc chi2 per clusters"};
88+
Configurable<int> tpcNCrossedRowMin{"tpcNCrossedRowMin", 70,
89+
"max of TPC n cluster crossed rows"};
90+
Configurable<float> tpcNClsFoundOverFindableMin{
91+
"tpcNClsFoundOverFindableMin", 0.8,
92+
"min # of TPC found/findable clusters"};
93+
Configurable<float> tpcChi2perNClMax{"tpcChi2perNClMax", 4.,
94+
"min # of tpc chi2 per clusters"};
95+
Configurable<int> itsIBClsMin{"itsIBClsMin", 3,
96+
"min # of its clusters in IB"};
97+
Configurable<float> itsChi2perNClMax{"itsChi2perNClMax", 6.,
98+
"min # of tpc chi2 per clusters"};
9699
Configurable<float> dcaxyMax{"dcaxyMax", 1., "max of track dca in xy"};
97100
Configurable<float> dcazMax{"dcazMax", 2., "max of track dca in z"};
98101
Configurable<float> tofNSigmaMax{"tofNSigmaMax", 3., "max of tof nsigma"};
99102
Configurable<float> tpcNSigmaMin{"tpcNSigmaMin", -1., "min of tpc nsigma"};
100103
Configurable<float> tpcNSigmaMax{"tpcNSigmaMax", 3., "max of tpc nsigma"};
101104

102-
Configurable<int> nBinsP{"nBinsP", 1500, "number of bins of particle momentum"};
105+
Configurable<int> nBinsP{"nBinsP", 1500,
106+
"number of bins of particle momentum"};
103107
Configurable<int> nBinsPt{"nBinsPt", 100, "N bins in pT histo"};
104108

109+
Configurable<int> tpcNSigmaHadronMax{"tpcNSigmaHadronMax", -3,
110+
"max of tpc hadron nsigma"};
111+
Configurable<int> tpcNSigmaHadronMin{"tpcNSigmaHadronMin", -5,
112+
"min of tpc hadron nsigma"};
113+
105114
// SliceCache
106115
SliceCache cache;
107116

108117
// using declarations
109118
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels>;
110-
using TracksEl = soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension, aod::TracksExtra, aod::TracksDCA, aod::pidTOFFullEl, aod::pidTPCFullEl>;
111-
using McTracksEl = soa::Join<aod::Tracks, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl, aod::pidTPCFullEl, aod::McTrackLabels>;
119+
using TracksEl =
120+
soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension,
121+
aod::TracksExtra, aod::TracksDCA, aod::pidTOFFullEl,
122+
aod::pidTPCFullEl>;
123+
using McTracksEl =
124+
soa::Join<aod::Tracks, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl,
125+
aod::pidTPCFullEl, aod::McTrackLabels>;
112126

113127
// Filter
114128
Filter collZFilter = nabs(aod::collision::posZ) < posZMax;
115129

116130
// Partition
117131

118132
// ConfigurableAxis
119-
ConfigurableAxis axisPtEl{"axisPtEl", {VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f, 2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f}, "electron pt bins"};
133+
ConfigurableAxis axisPtEl{
134+
"axisPtEl",
135+
{VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f,
136+
1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f,
137+
2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f},
138+
"electron pt bins"};
120139

121140
// Histogram registry
122-
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
141+
HistogramRegistry histos{
142+
"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
123143

124-
void init(InitContext const&)
125-
{
144+
void init(InitContext const &) {
126145
// AxisSpec
127146
const AxisSpec axisEvt{4, 0., 4., "nEvents"};
128147
const AxisSpec axisNCont{100, 0., 100., "nCont"};
@@ -137,7 +156,10 @@ struct HfTaskSingleElectron {
137156
histos.add("nEvents", "Number of events", kTH1D, {{1, 0., 1.}});
138157
histos.add("VtxZ", "VtxZ; cm; entries", kTH1D, {axisPosZ});
139158
histos.add("etaTrack", "etaTrack; #eta; entries", kTH1D, {axisEta});
140-
histos.add("ptTrack", "#it{p}_{T} distribution of selected tracks; #it{p}_{T} (GeV/#it{c}); entries", kTH1D, {axisPt});
159+
histos.add("ptTrack",
160+
"#it{p}_{T} distribution of selected tracks; #it{p}_{T} "
161+
"(GeV/#it{c}); entries",
162+
kTH1D, {axisPt});
141163

142164
// QA plots for trigger track selection
143165
histos.add("tpcNClsTrack", "tpcNClsTrack", kTH1D, {{200, 0, 200}});
@@ -163,6 +185,7 @@ struct HfTaskSingleElectron {
163185
histos.add("dcaCharm", "", kTH2D, {{axisPtEl}, {axisTrackIp}});
164186
histos.add("dcaDalitz", "", kTH2D, {{axisPtEl}, {axisTrackIp}});
165187
histos.add("dcaConv", "", kTH2D, {{axisPtEl}, {axisTrackIp}});
188+
histos.add("dcaHadron", "", kTH2D, {{axisPtEl}, {axisTrackIp}});
166189

167190
// QA plots for MC
168191
histos.add("hPdgC", "", kTH1D, {{10001, -0.5, 10000.5}});
@@ -171,9 +194,7 @@ struct HfTaskSingleElectron {
171194
histos.add("hPdgCo", "", kTH1D, {{10001, -0.5, 10000.5}});
172195
}
173196

174-
template <typename TrackType>
175-
bool trackSel(const TrackType& track)
176-
{
197+
template <typename TrackType> bool trackSel(const TrackType &track) {
177198
if ((track.pt() > ptTrackMax) || (track.pt() < ptTrackMin)) {
178199
return false;
179200
}
@@ -213,8 +234,7 @@ struct HfTaskSingleElectron {
213234
}
214235

215236
template <typename TrackType>
216-
int getElecSource(const TrackType& track, double& mpt, int& mpdg)
217-
{
237+
int getElecSource(const TrackType &track, double &mpt, int &mpdg) {
218238
auto mcpart = track.mcParticle();
219239
if (std::abs(mcpart.pdgCode()) != kElectron) {
220240
return NotElec;
@@ -227,43 +247,50 @@ struct HfTaskSingleElectron {
227247
int grmotherPt = -999;
228248
int ggrmotherPt = -999.; // mother, grand mother, grand grand mother pt
229249

230-
auto partMother = mcpart.template mothers_as<aod::McParticles>(); // first mother particle of electron
231-
auto partMotherCopy = partMother; // copy of the first mother
232-
auto mctrack = partMother; // will change all the time
250+
auto partMother =
251+
mcpart.template mothers_as<aod::McParticles>(); // first mother particle
252+
// of electron
253+
auto partMotherCopy = partMother; // copy of the first mother
254+
auto mctrack = partMother; // will change all the time
233255

234256
motherPt = partMother.front().pt(); // first mother pt
235257
motherPdg = std::abs(partMother.front().pdgCode()); // first mother pdg
236-
mpt = motherPt; // copy of first mother pt
237-
mpdg = motherPdg; // copy of first mother pdg
258+
mpt = motherPt; // copy of first mother pt
259+
mpdg = motherPdg; // copy of first mother pdg
238260

239261
// check if electron from charm hadrons
240-
if ((static_cast<int>(motherPdg / 100.) % 10) == kCharm || (static_cast<int>(motherPdg / 1000.) % 10) == kCharm) {
262+
if ((static_cast<int>(motherPdg / 100.) % 10) == kCharm ||
263+
(static_cast<int>(motherPdg / 1000.) % 10) == kCharm) {
241264

242265
// iterate until B hadron is found as an ancestor
243266
while (partMother.size()) {
244267
mctrack = partMother.front().template mothers_as<aod::McParticles>();
245268
if (mctrack.size()) {
246-
auto const& grmothersIdsVec = mctrack.front().mothersIds();
269+
auto const &grmothersIdsVec = mctrack.front().mothersIds();
247270

248271
if (grmothersIdsVec.empty()) {
249272
return DirectCharm;
250273
}
251274
grmotherPt = mctrack.front().pt();
252275
grmotherPdg = std::abs(mctrack.front().pdgCode());
253-
if ((static_cast<int>(grmotherPdg / 100.) % 10) == kBottom || (static_cast<int>(grmotherPdg / 1000.) % 10) == kBottom) {
276+
if ((static_cast<int>(grmotherPdg / 100.) % 10) == kBottom ||
277+
(static_cast<int>(grmotherPdg / 1000.) % 10) == kBottom) {
254278
mpt = grmotherPt;
255279
mpdg = grmotherPdg;
256280
return BeautyCharm;
257281
}
258282
}
259283
partMother = mctrack;
260284
}
261-
} else if ((static_cast<int>(motherPdg / 100.) % 10) == kBottom || (static_cast<int>(motherPdg / 1000.) % 10) == kBottom) { // check if electron from beauty hadrons
285+
} else if ((static_cast<int>(motherPdg / 100.) % 10) == kBottom ||
286+
(static_cast<int>(motherPdg / 1000.) % 10) ==
287+
kBottom) { // check if electron from beauty hadrons
262288
return DirectBeauty;
263-
} else if (motherPdg == kGamma) { // check if electron from photon conversion
289+
} else if (motherPdg ==
290+
kGamma) { // check if electron from photon conversion
264291
mctrack = partMother.front().template mothers_as<aod::McParticles>();
265292
if (mctrack.size()) {
266-
auto const& grmothersIdsVec = mctrack.front().mothersIds();
293+
auto const &grmothersIdsVec = mctrack.front().mothersIds();
267294
if (grmothersIdsVec.empty()) {
268295
return DirectGamma;
269296
}
@@ -274,7 +301,7 @@ struct HfTaskSingleElectron {
274301
partMother = mctrack;
275302
mctrack = partMother.front().template mothers_as<aod::McParticles>();
276303
if (mctrack.size()) {
277-
auto const& ggrmothersIdsVec = mctrack.front().mothersIds();
304+
auto const &ggrmothersIdsVec = mctrack.front().mothersIds();
278305
if (ggrmothersIdsVec.empty()) {
279306
if (grmotherPdg == kPi0) {
280307
return GammaPi0;
@@ -351,17 +378,17 @@ struct HfTaskSingleElectron {
351378
} else { // check if electron from Dalitz decays
352379
mctrack = partMother.front().template mothers_as<aod::McParticles>();
353380
if (mctrack.size()) {
354-
auto const& grmothersIdsVec = mctrack.front().mothersIds();
381+
auto const &grmothersIdsVec = mctrack.front().mothersIds();
355382
if (grmothersIdsVec.empty()) {
356383
static const std::map<int, SourceType> pdgToSource = {
357-
{kPi0, Pi0},
358-
{PdgCode::kEta, Eta},
359-
{PdgCode::kOmega, Omega},
360-
{kPhi, Phi},
361-
{PdgCode::kEtaPrime, EtaPrime},
362-
{kRho770_0, Rho0},
363-
{kKPlus, Ke3},
364-
{kK0Long, K0l}};
384+
{kPi0, Pi0},
385+
{PdgCode::kEta, Eta},
386+
{PdgCode::kOmega, Omega},
387+
{kPhi, Phi},
388+
{PdgCode::kEtaPrime, EtaPrime},
389+
{kRho770_0, Rho0},
390+
{kKPlus, Ke3},
391+
{kK0Long, K0l}};
365392

366393
auto it = pdgToSource.find(motherPdg);
367394
if (it != pdgToSource.end()) {
@@ -421,9 +448,8 @@ struct HfTaskSingleElectron {
421448
return Else;
422449
}
423450

424-
void processData(soa::Filtered<MyCollisions>::iterator const& collision,
425-
TracksEl const& tracks)
426-
{
451+
void processData(soa::Filtered<MyCollisions>::iterator const &collision,
452+
TracksEl const &tracks) {
427453
float const flagAnalysedEvt = 0.5;
428454

429455
if (!collision.sel8()) {
@@ -437,7 +463,7 @@ struct HfTaskSingleElectron {
437463
histos.fill(HIST("VtxZ"), collision.posZ());
438464
histos.fill(HIST("nEvents"), flagAnalysedEvt);
439465

440-
for (const auto& track : tracks) {
466+
for (const auto &track : tracks) {
441467

442468
if (!trackSel(track)) {
443469
continue;
@@ -451,7 +477,8 @@ struct HfTaskSingleElectron {
451477
histos.fill(HIST("ptTrack"), track.pt());
452478

453479
histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows());
454-
histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls());
480+
histos.fill(HIST("tpcFoundFindableTrack"),
481+
track.tpcCrossedRowsOverFindableCls());
455482
histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl());
456483
histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel());
457484
histos.fill(HIST("itsChi2Track"), track.itsChi2NCl());
@@ -467,22 +494,29 @@ struct HfTaskSingleElectron {
467494
}
468495
histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl());
469496
histos.fill(HIST("tpcNSigPAfterTofCut"), track.p(), track.tpcNSigmaEl());
470-
histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl());
497+
histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(),
498+
track.tpcNSigmaEl());
471499

472-
if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) {
500+
if (track.tpcNSigmaEl() < tpcNSigmaMin ||
501+
track.tpcNSigmaEl() > tpcNSigmaMax) {
473502
continue;
474503
}
504+
505+
if (track.tpcNSigmaEl() < tpcNSigmaHadronMax &&
506+
track.tpcNSigmaEl() > tpcNSigmaHadronMin) {
507+
508+
histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY());
509+
}
510+
475511
histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl());
476512

477513
histos.fill(HIST("dcaTrack"), track.pt(), track.dcaXY());
478514
}
479515
}
480516
PROCESS_SWITCH(HfTaskSingleElectron, processData, "For real data", true);
481517

482-
void processMc(soa::Filtered<MyCollisions>::iterator const& collision,
483-
McTracksEl const& tracks,
484-
aod::McParticles const&)
485-
{
518+
void processMc(soa::Filtered<MyCollisions>::iterator const &collision,
519+
McTracksEl const &tracks, aod::McParticles const &) {
486520
float const flagAnalysedEvt = 0.5;
487521

488522
if (!collision.sel8()) {
@@ -496,7 +530,7 @@ struct HfTaskSingleElectron {
496530
histos.fill(HIST("VtxZ"), collision.posZ());
497531
histos.fill(HIST("nEvents"), flagAnalysedEvt);
498532

499-
for (const auto& track : tracks) {
533+
for (const auto &track : tracks) {
500534

501535
if (!trackSel(track)) {
502536
continue;
@@ -506,7 +540,8 @@ struct HfTaskSingleElectron {
506540
histos.fill(HIST("ptTrack"), track.pt());
507541

508542
histos.fill(HIST("tpcNClsTrack"), track.tpcNClsCrossedRows());
509-
histos.fill(HIST("tpcFoundFindableTrack"), track.tpcCrossedRowsOverFindableCls());
543+
histos.fill(HIST("tpcFoundFindableTrack"),
544+
track.tpcCrossedRowsOverFindableCls());
510545
histos.fill(HIST("tpcChi2Track"), track.tpcChi2NCl());
511546
histos.fill(HIST("itsIBClsTrack"), track.itsNClsInnerBarrel());
512547
histos.fill(HIST("dcaXYTrack"), track.dcaXY());
@@ -539,13 +574,19 @@ struct HfTaskSingleElectron {
539574
histos.fill(HIST("dcaDalitz"), track.pt(), track.dcaXY());
540575
}
541576

577+
if (track.tpcNSigmaEl() < tpcNSigmaHadronMax &&
578+
track.tpcNSigmaEl() > tpcNSigmaHadronMin)
579+
histos.fill(HIST("dcaHadron"), track.pt(), track.dcaXY());
580+
542581
if (std::abs(track.tofNSigmaEl()) > tofNSigmaMax) {
543582
continue;
544583
}
545584
histos.fill(HIST("tofNSigPtQA"), track.pt(), track.tofNSigmaEl());
546-
histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(), track.tpcNSigmaEl());
585+
histos.fill(HIST("tpcNSigPtAfterTofCut"), track.pt(),
586+
track.tpcNSigmaEl());
547587

548-
if (track.tpcNSigmaEl() < tpcNSigmaMin || track.tpcNSigmaEl() > tpcNSigmaMax) {
588+
if (track.tpcNSigmaEl() < tpcNSigmaMin ||
589+
track.tpcNSigmaEl() > tpcNSigmaMax) {
549590
continue;
550591
}
551592
histos.fill(HIST("tpcNSigPtQA"), track.pt(), track.tpcNSigmaEl());
@@ -556,8 +597,6 @@ struct HfTaskSingleElectron {
556597
PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false);
557598
};
558599

559-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
560-
{
561-
return WorkflowSpec{
562-
adaptAnalysisTask<HfTaskSingleElectron>(cfgc)};
600+
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc) {
601+
return WorkflowSpec{adaptAnalysisTask<HfTaskSingleElectron>(cfgc)};
563602
}

0 commit comments

Comments
 (0)