Skip to content

Commit 3a10697

Browse files
authored
Add BC based centrality
1 parent 6746819 commit 3a10697

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,23 @@ struct HeavyionMultiplicity {
357357
histos.add("hRecMCdndeta", "hRecMCdndeta", kTHnSparseD, {axisVtxZ, centAxis, axisOccupancy, axisEta, axisPhi, axisRecTrkType}, false);
358358
histos.add("etaResolution", "etaResolution", kTH2D, {axisEta, axisDeltaEta});
359359
}
360+
361+
if (doprocessBcData) {
362+
histos.add("BcHist", "BcHist", kTH1D, {axisEvent}, false);
363+
auto hstat = histos.get<TH1>(HIST("BcHist"));
364+
auto* x = hstat->GetXaxis();
365+
x->SetBinLabel(1, "All events");
366+
x->SetBinLabel(2, "kIsTriggerTVX");
367+
x->SetBinLabel(3, "kNoTimeFrameBorder");
368+
x->SetBinLabel(4, "kNoITSROFrameBorder");
369+
x->SetBinLabel(5, "kNoSameBunchPileup"); // reject collisions in case of pileup with another collision in the same foundBC
370+
x->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); // small difference between z-vertex from PV and from FT0
371+
x->SetBinLabel(7, "ApplyNoCollInTimeRangeStandard");
372+
histos.add("BcCentFT0CHist", "BcCentFT0CHist", kTH1D, {axisCent}, false);
373+
histos.add("BcCentFT0MHist", "BcCentFT0MHist", kTH1D, {axisCent}, false);
374+
histos.add("CollCentFT0CHist", "CollCentFT0CHist", kTH1D, {axisCent}, false);
375+
histos.add("CollCentFT0MHist", "CollCentFT0MHist", kTH1D, {axisCent}, false);
376+
}
360377
}
361378

362379
template <typename CheckCol>
@@ -402,6 +419,37 @@ struct HeavyionMultiplicity {
402419
return true;
403420
}
404421

422+
template <typename CheckBc>
423+
bool isBCSelected(CheckBc const& bc)
424+
{
425+
histos.fill(HIST("BcHist"), 1);
426+
if (!bc.selection_bit(o2::aod::evsel::kIsTriggerTVX)) {
427+
return false;
428+
}
429+
histos.fill(HIST("BcHist"), 2);
430+
if (isApplyTFcut && !bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
431+
return false;
432+
}
433+
histos.fill(HIST("BcHist"), 3);
434+
if (isApplyITSROcut && !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
435+
return false;
436+
}
437+
histos.fill(HIST("BcHist"), 4);
438+
if (isApplySameBunchPileup && !bc.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
439+
return false;
440+
}
441+
histos.fill(HIST("BcHist"), 5);
442+
if (isApplyGoodZvtxFT0vsPV && !bc.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
443+
return false;
444+
}
445+
histos.fill(HIST("BcHist"), 6);
446+
if (isApplyNoCollInTimeRangeStandard && !bc.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
447+
return false;
448+
}
449+
histos.fill(HIST("BcHist"), 7);
450+
return true;
451+
}
452+
405453
template <typename CheckColCent>
406454
float selColCent(CheckColCent const& col)
407455
{
@@ -971,6 +1019,29 @@ struct HeavyionMultiplicity {
9711019
} // collision loop
9721020
}
9731021

1022+
PresliceUnsorted<o2::soa::Join<o2::aod::Collisions, o2::aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms>> perFoundBC = aod::evsel::foundBCId;
1023+
void processBcData(soa::Join<aod::BCs, aod::BcSels, aod::Timestamps, aod::BCCentFT0Cs, aod::BCCentFT0Ms, aod::Run3MatchedToBCSparse> const& bcs, soa::Join<aod::Collisions, aod::EvSels, aod::PVMults, aod::CentFT0Cs, aod::CentFT0Ms> const& collisions)
1024+
{
1025+
for (const auto& bc : bcs) {
1026+
if (!isBCSelected(bc)) {
1027+
continue;
1028+
}
1029+
histos.fill(HIST("BcCentFT0CHist"), bc.centFT0C());
1030+
histos.fill(HIST("BcCentFT0MHist"), bc.centFT0M());
1031+
auto collisionsInBC = collisions.sliceBy(perFoundBC, bc.globalIndex());
1032+
for (const auto& collision : collisionsInBC) {
1033+
if (!isEventSelected(collision)) {
1034+
continue;
1035+
}
1036+
if (std::abs(collision.posZ()) >= vtxRange) {
1037+
continue;
1038+
}
1039+
histos.fill(HIST("CollCentFT0CHist"), collision.centFT0C());
1040+
histos.fill(HIST("CollCentFT0MHist"), collision.centFT0M());
1041+
} // collision table
1042+
} // bc table
1043+
}
1044+
9741045
PROCESS_SWITCH(HeavyionMultiplicity, processData, "process data CentFT0C", false);
9751046
PROCESS_SWITCH(HeavyionMultiplicity, processCorrelation, "do correlation study in data", false);
9761047
PROCESS_SWITCH(HeavyionMultiplicity, processMonteCarlo, "process MC CentFT0C", false);
@@ -979,6 +1050,7 @@ struct HeavyionMultiplicity {
9791050
PROCESS_SWITCH(HeavyionMultiplicity, processGen, "process pure MC gen", false);
9801051
PROCESS_SWITCH(HeavyionMultiplicity, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false);
9811052
PROCESS_SWITCH(HeavyionMultiplicity, processMCeff, "process extra efficiency function", false);
1053+
PROCESS_SWITCH(HeavyionMultiplicity, processBcData, "process BC Centrality", false);
9821054
};
9831055

9841056
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)