Skip to content

Commit f050205

Browse files
authored
Apply different event fractions to electron and hadron tables for event mixing
1 parent 0ae12ab commit f050205

1 file changed

Lines changed: 25 additions & 21 deletions

File tree

‎PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx‎

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "PWGHF/HFC/DataModel/CorrelationTables.h"
1818
#include "PWGHF/HFL/DataModel/ElectronSelectionTable.h"
19-
#include "PWGJE/DataModel/EMCALClusters.h"
2019

2120
#include "Common/CCDB/TriggerAliases.h"
2221
#include "Common/Core/RecoDecay.h"
@@ -92,7 +91,8 @@ struct HfCorrelatorHfeHadrons {
9291
// Electron hadron correlation condition
9392
Configurable<bool> ptCondition{"ptCondition", true, "Electron pT should be greater than associate particle pT"};
9493

95-
Configurable<float> eventFractionToAnalyze{"eventFractionToAnalyze", -1, "Fraction of events to analyze (use only for ME offline on very large samples)"};
94+
Configurable<float> electronEventFraction{"electronEventFraction", -1, "Fraction of events to analyze (use only for ME offline on very large samples)"};
95+
Configurable<float> hadronEventFraction{"hadronEventFraction", -1, "Fraction of events to analyze (use only for ME offline on very large samples)"};
9696

9797
TRandom3 rnd{0};
9898

@@ -212,41 +212,45 @@ struct HfCorrelatorHfeHadrons {
212212
}
213213

214214
// Electron-hadron Correlation
215-
template <bool IsMc, typename TracksType, typename ElectronType, typename EmcClusterType, typename CollisionType, typename BcType, typename McParticlesType>
216-
void fillCorrelation(CollisionType const& collision, ElectronType const& electrons, TracksType const& tracks, EmcClusterType const& emcClusters, BcType const&, McParticlesType const&)
215+
template <bool IsMc, typename TracksType, typename ElectronType, typename CollisionType, typename BcType, typename McParticlesType>
216+
void fillCorrelation(CollisionType const& collision, ElectronType const& electrons, TracksType const& tracks, BcType const&, McParticlesType const&)
217217
{
218218
if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) {
219219
return;
220220
}
221-
// skip events with no clusters
222-
if (emcClusters.size() == 0 && skipNoEmcClusters) {
223-
return;
224-
}
225221

226222
int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M()));
227223
auto bc = collision.template bc_as<BcType>();
228224
int gCollisionId = collision.globalIndex();
229225
int64_t timeStamp = bc.timestamp();
230226

231-
bool skipEventTableFilling = false;
232-
if (eventFractionToAnalyze > 0) {
233-
if (rnd.Uniform(0, 1) > eventFractionToAnalyze) {
234-
skipEventTableFilling = true;
227+
bool skipEventElectronTableFilling = false;
228+
bool skipEventHadronTableFilling = false;
229+
if (electronEventFraction > 0) {
230+
if (rnd.Uniform(0, 1) > electronEventFraction) {
231+
skipEventElectronTableFilling = true;
235232
}
236233
}
237234

238-
registry.fill(HIST("hNevents"), 1);
235+
if (hadronEventFraction > 0) {
236+
if (rnd.Uniform(0, 1) > hadronEventFraction) {
237+
skipEventHadronTableFilling = true;
238+
}
239+
}
239240

241+
registry.fill(HIST("hZvertex"), collision.posZ());
240242
// fraction of event which used for Event mixing
241-
if (!skipEventTableFilling) {
243+
if (!skipEventElectronTableFilling) {
242244
registry.fill(HIST("hTracksBin"), poolBin);
243-
registry.fill(HIST("hZvertex"), collision.posZ());
245+
}
246+
if (!skipEventHadronTableFilling) {
247+
registry.fill(HIST("hNevents"), 1);
244248
}
245249
for (const auto& hTrack : tracks) {
246250
if (!selAssoHadron(hTrack)) {
247251
continue;
248252
}
249-
if (!skipEventTableFilling) {
253+
if (!skipEventHadronTableFilling) {
250254
registry.fill(HIST("hptHadron"), hTrack.pt());
251255

252256
entryHadron(hTrack.phi(), hTrack.eta(), hTrack.pt(), poolBin, gCollisionId, timeStamp);
@@ -340,7 +344,7 @@ struct HfCorrelatorHfeHadrons {
340344
}
341345
}
342346

343-
if (!skipEventTableFilling) {
347+
if (!skipEventElectronTableFilling) {
344348
registry.fill(HIST("hElectronBin"), poolBin);
345349
entryElectron(phiElectron, etaElectron, ptElectron, nElectronLS, nElectronUS, poolBin, gCollisionId, timeStamp);
346350
}
@@ -452,10 +456,10 @@ struct HfCorrelatorHfeHadrons {
452456

453457
void processData(TableCollision const& collision,
454458
aod::HfCorrSelEl const& electrons,
455-
TableTracks const& tracks, aod::EMCALClusters const& emcClusters,
459+
TableTracks const& tracks,
456460
aod::BCsWithTimestamps const& bcs)
457461
{
458-
fillCorrelation<false>(collision, electrons, tracks, emcClusters, bcs, 0);
462+
fillCorrelation<false>(collision, electrons, tracks, bcs, 0);
459463
}
460464

461465
PROCESS_SWITCH(HfCorrelatorHfeHadrons, processData, "Process for Data", false);
@@ -464,10 +468,10 @@ struct HfCorrelatorHfeHadrons {
464468

465469
void processMcRec(McTableCollision const& mcCollision,
466470
aod::HfCorrSelEl const& mcElectrons,
467-
McTableTracks const& mcTracks, aod::EMCALClusters const& emcClusters,
471+
McTableTracks const& mcTracks,
468472
aod::BCsWithTimestamps const& bcs, aod::McParticles const& mcParticle)
469473
{
470-
fillCorrelation<true>(mcCollision, mcElectrons, mcTracks, emcClusters, bcs, mcParticle);
474+
fillCorrelation<true>(mcCollision, mcElectrons, mcTracks, bcs, mcParticle);
471475
}
472476

473477
PROCESS_SWITCH(HfCorrelatorHfeHadrons, processMcRec, "Process MC Reco mode", true);

0 commit comments

Comments
 (0)