Skip to content

Commit 01dd039

Browse files
rashiguptrashi234
andauthored
[PWGHF] Add configuration and electron hadron table (#10920)
Co-authored-by: Rashi Gupta <rashi.gupta@cern.ch>
1 parent aef770a commit 01dd039

File tree

5 files changed

+208
-148
lines changed

5 files changed

+208
-148
lines changed

PWGHF/HFC/DataModel/CorrelationTables.h

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,24 +473,47 @@ DECLARE_SOA_TABLE(DmesonSelection, "AOD", "DINCOLL", // Selection of D meson in
473473
aod::hf_selection_dmeson_collision::DmesonSel);
474474

475475
// Note: definition of columns and tables for Electron Hadron correlation pairs
476+
namespace hf_electron
477+
{
478+
DECLARE_SOA_COLUMN(PhiElectron, phiElectron, float); //! Phi of electron
479+
DECLARE_SOA_COLUMN(EtaElectron, etaElectron, float); //! Eta of electron
480+
DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of electron
481+
DECLARE_SOA_COLUMN(NElectronsLS, nElectronsLS, int); //! number of like-sign
482+
DECLARE_SOA_COLUMN(NElectronsUS, nElectronsUS, int); //! number of Unlike-sign
483+
DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicit
484+
DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision
485+
DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision
486+
487+
} // namespace hf_electron
488+
489+
DECLARE_SOA_TABLE(HfElectron, "AOD", "HFELECTRON", //! Hf Electron properties
490+
aod::hf_electron::PhiElectron,
491+
aod::hf_electron::EtaElectron,
492+
aod::hf_electron::PtElectron,
493+
aod::hf_electron::NElectronsLS,
494+
aod::hf_electron::NElectronsUS,
495+
aod::hf_electron::PoolBin,
496+
aod::hf_electron::GIndexCol,
497+
aod::hf_electron::TimeStamp);
498+
476499
namespace hf_correlation_electron_hadron
477500
{
478501
DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Electron and Hadrons
479502
DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Electron and Hadrons
480503
DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of Electron
481504
DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron;
482505
DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity
483-
DECLARE_SOA_COLUMN(IsLSEHCorr, isLSEHCorr, int); //! like sign Electron hadron coorelation
484-
DECLARE_SOA_COLUMN(IsULSEHCorr, isULSEHCorr, int); //! unLike sign Electron hadron coorelation
506+
DECLARE_SOA_COLUMN(NPairsLS, nPairsLS, int); //! number of like-sign electron-hadron pairs
507+
DECLARE_SOA_COLUMN(NPairsUS, nPairsUS, int); //! number of unlike-sign electron-hadron pairs
485508
} // namespace hf_correlation_electron_hadron
486509
DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs Informations
487510
hf_correlation_electron_hadron::DeltaPhi,
488511
hf_correlation_electron_hadron::DeltaEta,
489512
hf_correlation_electron_hadron::PtElectron,
490513
hf_correlation_electron_hadron::PtHadron,
491514
hf_correlation_electron_hadron::PoolBin,
492-
hf_correlation_electron_hadron::IsLSEHCorr,
493-
hf_correlation_electron_hadron::IsULSEHCorr);
515+
hf_correlation_electron_hadron::NPairsLS,
516+
hf_correlation_electron_hadron::NPairsUS);
494517

495518
// Note: definition of columns and tables for Electron Hadron correlation pairs for MC Gen
496519
namespace hf_correlation_mcgenelectron_hadron

PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx

Lines changed: 89 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ struct HfCorrelatorHfeHadrons {
4747

4848
Produces<aod::HfEHadronPair> entryElectronHadronPair;
4949
Produces<aod::HfEHadronMcPair> entryElectronHadronPairmcGen;
50+
Produces<aod::HfElectron> entryElectron;
51+
Produces<aod::Hadron> entryHadron;
5052
// Configurables
5153
// Event Selection
5254
Configurable<float> zPvPosMax{"zPvPosMax", 10., "Maximum z of the primary vertex (cm)"};
@@ -78,37 +80,36 @@ struct HfCorrelatorHfeHadrons {
7880

7981
ConfigurableAxis binsDeltaEta{"binsDeltaEta", {30, -1.8, 1.8}, "#it{#Delta#eta}"};
8082
ConfigurableAxis binsDeltaPhi{"binsDeltaPhi", {32, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, "#it{#Delta#varphi}"};
81-
ConfigurableAxis binsP{"binsP", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"};
82-
83-
HistogramConfigSpec hCorrelSpec{HistType::kTHnSparseD, {{binsP}, {binsP}, {binsDeltaPhi}, {binsDeltaEta}}};
83+
ConfigurableAxis binsPt{"binsPt", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"};
84+
ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"};
8485

8586
HistogramRegistry registry{
8687
"registry",
87-
{{"hInclusiveEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
88-
{"hLSEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
89-
{"hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
90-
{"hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta Non Hf for McGen Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
91-
{"hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
92-
{"hptElectron", "hptElectron", {HistType::kTH1F, {{binsP}}}},
93-
94-
{"hMixEventInclusiveEHCorrl", "Sparse for mix event Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
95-
{"hMixEventLSEHCorrel", "Sparse for mix event Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
96-
{"hMixEventULSEHCorrel", "Sparse for mix event Delta phi and Delta eta Unlike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
97-
{"hMixEventMcGenInclusiveEHCorrl", "Sparse for mix event Delta phi and Delta eta Mc gen Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec},
98-
{"hMixEventMcGenNonHfEHCorrl", "Sparse for mix event Delta phi and Delta eta Mc gen Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", hCorrelSpec}}};
88+
{}};
9989

10090
void init(InitContext&)
10191
{
102-
registry.get<THnSparse>(HIST("hInclusiveEHCorrel"))->Sumw2();
103-
registry.get<THnSparse>(HIST("hLSEHCorrel"))->Sumw2();
104-
registry.get<THnSparse>(HIST("hULSEHCorrel"))->Sumw2();
105-
registry.get<THnSparse>(HIST("hMCgenInclusiveEHCorrl"))->Sumw2();
106-
registry.get<THnSparse>(HIST("hMCgenNonHfEHCorrel"))->Sumw2();
107-
registry.get<THnSparse>(HIST("hMixEventInclusiveEHCorrl"))->Sumw2();
108-
registry.get<THnSparse>(HIST("hMixEventLSEHCorrel"))->Sumw2();
109-
registry.get<THnSparse>(HIST("hMixEventULSEHCorrel"))->Sumw2();
110-
registry.get<THnSparse>(HIST("hMixEventMcGenInclusiveEHCorrl"))->Sumw2();
111-
registry.get<THnSparse>(HIST("hMixEventMcGenNonHfEHCorrl"))->Sumw2();
92+
AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{Electron}- #eta_{Hadron}"};
93+
AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{Electron}- #varphi_{Hadron}"};
94+
AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"};
95+
AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"};
96+
97+
registry.add("hInclusiveEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
98+
registry.add("hLSEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
99+
registry.add("hULSEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
100+
registry.add("hMCgenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen Non Hf Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
101+
registry.add("hMCgenInclusiveEHCorrl", "Sparse for Delta phi and Delta eta for McGen Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
102+
registry.add("hptElectron", "hptElectron", {HistType::kTH1D, {axisPt}});
103+
104+
registry.add("hMixEventInclusiveEHCorrl", "Sparse for mix event Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
105+
registry.add("hMixEventLSEHCorrel", "Sparse for mix event Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
106+
registry.add("hMixEventULSEHCorrel", "Sparse for mix event Delta phi and Delta eta Unlike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
107+
registry.add("hMixEventMcGenInclusiveEHCorrl", "Sparse for mix event Delta phi and Delta eta Mc gen Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
108+
registry.add("hMixEventMcGenNonHfEHCorrl", "Sparse for mix event Delta phi and Delta eta Mc gen Non Hf Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}});
109+
registry.add("hElectronBin", "Electron bin", {HistType::kTH1D, {axisPoolBin}});
110+
registry.add("hLSElectronBin", "Electron bin", {HistType::kTH1D, {axisPoolBin}});
111+
registry.add("hULSElectronBin", "Electron bin", {HistType::kTH1D, {axisPoolBin}});
112+
registry.add("hTracksBin", "Particles associated pool bin", {HistType::kTH1D, {axisPoolBin}});
112113
}
113114

114115
// Associated Hadron Selection Cut
@@ -132,18 +133,22 @@ struct HfCorrelatorHfeHadrons {
132133
}
133134

134135
// Electron-hadron Correlation
135-
template <typename TracksType, typename ElectronType, typename CollisionType>
136-
void fillCorrelation(CollisionType const& collision, ElectronType const& electron, TracksType const& tracks)
136+
template <typename TracksType, typename ElectronType, typename CollisionType, typename BcType>
137+
void fillCorrelation(CollisionType const& collision, ElectronType const& electron, TracksType const& tracks, BcType const&)
137138
{
138139
if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7))))
139140
return;
140141
int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFV0M()));
142+
auto bc = collision.template bc_as<aod::BCsWithTimestamps>();
143+
int gCollisionId = collision.globalIndex();
144+
int64_t timeStamp = bc.timestamp();
141145

142146
// Construct Deta Phi between electrons and hadrons
143147

144148
double ptElectron = -999;
145149
double phiElectron = -999;
146150
double etaElectron = -999;
151+
int nElectron = 0;
147152

148153
for (const auto& eTrack : electron) {
149154
ptElectron = eTrack.ptTrack();
@@ -155,51 +160,76 @@ struct HfCorrelatorHfeHadrons {
155160
double ptHadron = -999;
156161
double etaHadron = -999;
157162
double phiHadron = -999;
163+
158164
if (!eTrack.isEmcal()) {
159165
continue;
160166
}
161167
registry.fill(HIST("hptElectron"), ptElectron);
168+
int nElectronLS = 0;
169+
int nElectronUS = 0;
170+
if (eTrack.nElPairLS() > 0) {
171+
for (int i = 0; i < eTrack.nElPairLS(); ++i) {
162172

163-
for (const auto& hTrack : tracks) {
164-
if (hTrack.globalIndex() == eTrack.trackId()) {
165-
continue;
173+
++nElectronLS;
174+
registry.fill(HIST("hLSElectronBin"), poolBin);
166175
}
176+
}
177+
if (eTrack.nElPairUS() > 0) {
178+
for (int i = 0; i < eTrack.nElPairUS(); ++i) {
167179

180+
++nElectronUS;
181+
registry.fill(HIST("hULSElectronBin"), poolBin);
182+
}
183+
}
184+
185+
registry.fill(HIST("hElectronBin"), poolBin);
186+
entryElectron(phiElectron, etaElectron, ptElectron, nElectronLS, nElectronUS, poolBin, gCollisionId, timeStamp);
187+
188+
for (const auto& hTrack : tracks) {
168189
// Apply Hadron cut
169190
if (!selAssoHadron(hTrack)) {
170191
continue;
171192
}
172-
173-
ptHadron = hTrack.pt();
174-
phiHadron = hTrack.phi();
175-
etaHadron = hTrack.eta();
193+
if (nElectron == 0) {
194+
registry.fill(HIST("hTracksBin"), poolBin);
195+
entryHadron(phiHadron, etaHadron, ptHadron, poolBin, gCollisionId, timeStamp);
196+
}
197+
if (hTrack.globalIndex() == eTrack.trackId()) {
198+
continue;
199+
}
176200

177201
if (ptCondition && (ptElectron < ptHadron)) {
178202
continue;
179203
}
204+
ptHadron = hTrack.pt();
205+
phiHadron = hTrack.phi();
206+
etaHadron = hTrack.eta();
180207

181208
deltaPhi = RecoDecay::constrainAngle(phiElectron - phiHadron, -o2::constants::math::PIHalf);
182209
deltaEta = etaElectron - etaHadron;
183210
registry.fill(HIST("hInclusiveEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta);
184-
int isLSElectroncorr = 0;
185-
int isULSElectroncorr = 0;
186-
if (eTrack.isLSElectron() > 0) {
187-
for (int i = 0; i < eTrack.isLSElectron(); ++i) {
188211

212+
int nElHadLSCorr = 0;
213+
int nElHadUSCorr = 0;
214+
if (eTrack.nElPairLS() > 0) {
215+
for (int i = 0; i < eTrack.nElPairLS(); ++i) {
216+
217+
++nElHadLSCorr;
189218
registry.fill(HIST("hLSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta);
190-
++isLSElectroncorr;
191219
}
192220
}
193-
if (eTrack.isULSElectron() > 0) {
194-
for (int i = 0; i < eTrack.isULSElectron(); ++i) {
221+
if (eTrack.nElPairUS() > 0) {
222+
for (int i = 0; i < eTrack.nElPairUS(); ++i) {
195223

196224
registry.fill(HIST("hULSEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta);
197-
++isULSElectroncorr;
225+
++nElHadUSCorr;
198226
}
199227
}
200-
entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, isLSElectroncorr, isULSElectroncorr);
201-
}
202-
}
228+
entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr);
229+
230+
} // end Hadron Track loop
231+
nElectron++;
232+
} // end Electron loop
203233
}
204234

205235
// mix event electron-hadron correlation
@@ -241,44 +271,44 @@ struct HfCorrelatorHfeHadrons {
241271
deltaEtaMix = etaElectronMix - etaHadronMix;
242272

243273
registry.fill(HIST("hMixEventInclusiveEHCorrl"), ptElectronMix, ptHadronMix, deltaPhiMix, deltaEtaMix);
244-
int isLSElectroncorr = 0;
245-
int isULSElectroncorr = 0;
246-
if (t1.isLSElectron() > 0) {
247-
for (int i = 0; i < t1.isLSElectron(); ++i) {
274+
int nElHadLSCorr = 0;
275+
int nElHadUSCorr = 0;
276+
if (t1.nElPairLS() > 0) {
277+
for (int i = 0; i < t1.nElPairLS(); ++i) {
248278

249279
registry.fill(HIST("hMixEventLSEHCorrel"), ptElectronMix, ptHadronMix, deltaPhiMix, deltaEtaMix);
250-
++isLSElectroncorr;
280+
++nElHadLSCorr;
251281
}
252282
}
253-
if (t1.isULSElectron() > 0) {
254-
for (int i = 0; i < t1.isULSElectron(); ++i) {
283+
if (t1.nElPairUS() > 0) {
284+
for (int i = 0; i < t1.nElPairUS(); ++i) {
255285

256286
registry.fill(HIST("hMixEventULSEHCorrel"), ptElectronMix, ptHadronMix, deltaPhiMix, deltaEtaMix);
257-
++isULSElectroncorr;
287+
++nElHadUSCorr;
258288
}
259289
}
260-
entryElectronHadronPair(deltaPhiMix, deltaEtaMix, ptElectronMix, ptHadronMix, poolBin, isLSElectroncorr, isULSElectroncorr);
290+
entryElectronHadronPair(deltaPhiMix, deltaEtaMix, ptElectronMix, ptHadronMix, poolBin, nElHadLSCorr, nElHadUSCorr);
261291
}
262292
}
263293

264294
// ======= Process starts for Data, Same event ============
265295

266296
void processData(TableCollision const& collision,
267297
aod::HfCorrSelEl const& electron,
268-
TableTracks const& tracks)
298+
TableTracks const& tracks, aod::BCsWithTimestamps const& bc)
269299
{
270-
fillCorrelation(collision, electron, tracks);
300+
fillCorrelation(collision, electron, tracks, bc);
271301
}
272302

273-
PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false);
303+
PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", true);
274304

275305
// ======= Process starts for McRec, Same event ============
276306

277307
void processMcRec(McTableCollision const& mcCollision,
278308
aod::HfCorrSelEl const& mcElectron,
279309
McTableTracks const& mcTracks)
280310
{
281-
fillCorrelation(mcCollision, mcElectron, mcTracks);
311+
fillCorrelation(mcCollision, mcElectron, mcTracks, 0);
282312
}
283313

284314
PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", false);
@@ -339,7 +369,7 @@ struct HfCorrelatorHfeHadrons {
339369
}
340370
}
341371
}
342-
PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", true);
372+
PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcGen, "Process MC Gen mode", false);
343373
// ====================== Implement Event mixing on Data ===============================
344374

345375
// ====================== Implement Event mixing on Data ===================================

0 commit comments

Comments
 (0)