Skip to content

Commit c5da8d2

Browse files
committed
Add histogram to monitor the level of event pool
1 parent 231298c commit c5da8d2

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎PWGEM/Dilepton/Core/DileptonMixingTest.h‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
#include <TH2.h>
6767
#include <TH3.h>
6868
#include <TList.h>
69+
#include <TProfile.h>
6970
#include <TRandom3.h>
7071
#include <TString.h>
7172

@@ -453,6 +454,7 @@ struct Dilepton {
453454

454455
emh_pos = new TEMH(ndepth);
455456
emh_neg = new TEMH(ndepth);
457+
maxBufferedEvents = static_cast<double>(ndepth.value) * (zvtx_bin_edges.size() - 1) * (cent_bin_edges.size() - 1) * (ep_bin_edges.size() - 1) * (occ_bin_edges.size() - 1);
456458

457459
DefineEMEventCut();
458460
addhistograms();
@@ -468,6 +470,9 @@ struct Dilepton {
468470

469471
fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::HistType::kTH1D, {{10001, -0.5, 10000.5}}, true);
470472

473+
fRegistry.add("Pair/mix/hEventBufferFillLevel", "Event buffer fill level;Number of processed events;Buffered events / maximum buffered events", o2::framework::HistType::kTProfile, {{1500, 0.5, 15000000.5}}, false);
474+
fRegistry.get<TProfile>(HIST("Pair/mix/hEventBufferFillLevel"))->SetCanExtend(TH1::kXaxis);
475+
471476
if (doprocessTriggerAnalysis) {
472477
LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value.data());
473478
fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::HistType::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5
@@ -1344,6 +1349,18 @@ struct Dilepton {
13441349
std::unordered_map<int, bool> map_best_match_globalmuon;
13451350

13461351
std::vector<int> used_trackIds_per_col;
1352+
uint64_t nProcessedEvents = 0;
1353+
double maxBufferedEvents = 0.;
1354+
1355+
void fillEventBufferLevel()
1356+
{
1357+
++nProcessedEvents;
1358+
if (cfgDoMix && nProcessedEvents % 10000 == 0) {
1359+
const double fraction = static_cast<double>(map_mixed_eventId_to_globalBC.size()) / maxBufferedEvents;
1360+
fRegistry.fill(HIST("Pair/mix/hEventBufferFillLevel"), nProcessedEvents, fraction);
1361+
}
1362+
}
1363+
13471364
int ndf = 0;
13481365

13491366
template <bool isTriggerAnalysis, typename TCollisions, typename TLeptons, typename TPresilce, typename TCut, typename TAllTracks>
@@ -1355,6 +1372,7 @@ struct Dilepton {
13551372
const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()};
13561373
float centrality = centralities[cfgCentEstimator];
13571374
if (centralities[cfgCentEstimator] < eventcuts.cfgCentMin || eventcuts.cfgCentMax < centralities[cfgCentEstimator]) {
1375+
fillEventBufferLevel();
13581376
continue;
13591377
}
13601378

@@ -1395,19 +1413,23 @@ struct Dilepton {
13951413
fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2);
13961414

13971415
if (!fEMEventCut.IsSelected(collision)) {
1416+
fillEventBufferLevel();
13981417
continue;
13991418
}
14001419
if (eventcuts.cfgRequireGoodRCT && !rctChecker.checkTable(collision)) {
1420+
fillEventBufferLevel();
14011421
continue;
14021422
}
14031423

14041424
if (nmod > 0 && !isGoodQvector(qvectors)) {
1425+
fillEventBufferLevel();
14051426
continue;
14061427
}
14071428

14081429
if constexpr (isTriggerAnalysis) {
14091430
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(zorroGroup.cfg_swt_name.value);
14101431
if (!collision.triggerMask_bit(emswtId)) {
1432+
fillEventBufferLevel();
14111433
continue;
14121434
}
14131435

@@ -1488,6 +1510,7 @@ struct Dilepton {
14881510
used_trackIds_per_col.shrink_to_fit();
14891511

14901512
if (!cfgDoMix || !(nuls > 0 || nlspp > 0 || nlsmm > 0)) {
1513+
fillEventBufferLevel();
14911514
continue;
14921515
}
14931516

@@ -1597,6 +1620,7 @@ struct Dilepton {
15971620

15981621
} // end of if pair exist
15991622

1623+
fillEventBufferLevel();
16001624
} // end of collision loop
16011625

16021626
} // end of DF

0 commit comments

Comments
 (0)