Skip to content

Commit d6596cb

Browse files
committed
Added TF counter
1 parent 8eda4f5 commit d6596cb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎PWGUD/TableProducer/upcCandProducerBarrel.cxx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <Framework/runDataProcessing.h>
4141
#include <ReconstructionDataFormats/Vertex.h>
4242

43+
#include <TH1.h>
4344
#include <TH2.h>
4445
#include <TH3.h>
4546

@@ -336,6 +337,7 @@ struct UpcCandProducerBarrel {
336337
const AxisSpec axisOccupancy{nBinsOccupancy, 0., 250000., "FT0-based occupancy"};
337338
const AxisSpec axisTFs{nBinsTF, 0., 4.e7, "TFs"}; // 100 bins -> 400000 TFs per bin (1 bin ~ 1140 seconds for 32 orbits per TF)
338339

340+
registry.add("hTF", "TF counts", HistType::kTH1D, {axisTFs});
339341
registry.add("hTVX", "TVX counts", HistType::kTH2D, {axisBCs, axisTFs});
340342
registry.add("hTVXRCT", "TVX counts after RCT selection", HistType::kTH2D, {axisBCs, axisTFs});
341343
registry.add("hTVXRCTnoPileupROF", "TVX counts after RCT and ROF pileup selection", HistType::kTH2D, {axisBCs, axisTFs});
@@ -414,9 +416,12 @@ struct UpcCandProducerBarrel {
414416
std::vector<size_t> localTFIndex;
415417
localTFIndex.reserve(bcs.size());
416418
// Cache the local TF slot for each BC row for collision and MC lookups
419+
auto hTF = registry.get<TH1>(HIST("hTF"));
417420
for (const auto& bc : bcs) {
418-
const auto tfID = static_cast<uint32_t>((static_cast<int64_t>(bc.globalBC()) - bcSOR) / nBCsPerTF);
421+
const int64_t globalBC = bc.globalBC();
422+
const uint32_t tfID = (globalBC - bcSOR) / nBCsPerTF;
419423
if (tfIDs.empty() || tfID != tfIDs.back()) {
424+
hTF->Fill(tfID);
420425
tfIDs.push_back(tfID);
421426
tfPassesRCT.push_back(static_cast<uint8_t>(rctChecker(bc)));
422427
}

0 commit comments

Comments
 (0)