Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 54 additions & 46 deletions Common/TableProducer/zdcExtraTableProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,33 @@ struct ZdcExtraTableProducer {
Configurable<bool> cfgSaveQaHistos{"cfgSaveQaHistos", false, "Flag to save QA histograms"};

enum SelectionCriteria {
evSel_zvtx,
evSel_sel8,
evSel_occupancy,
evSel_kNoSameBunchPileup,
evSel_kIsGoodZvtxFT0vsPV,
evSel_kNoCollInTimeRangeStandard,
evSel_kIsVertexITSTPC,
evSel_kIsGoodITSLayersAll,
evSel_allEvents,
nEventSelections
ZVtxCut,
Sel8,
OccupancyCut,
NoSameBunchPileup,
IsGoodZvtxFT0vsPV,
NoCollInTimeRangeStandard,
IsVertexITSTPC,
IsGoodITSLayersAll,
AllEvents,
NEventSelections
};

HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};

void init(InitContext const&)
{

registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}});
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_allEvents + 1, "All events");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_zvtx + 1, "vtxZ");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_sel8 + 1, "Sel8");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_occupancy + 1, "kOccupancy");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoSameBunchPileup + 1, "kNoSameBunchPileup");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodZvtxFT0vsPV + 1, "kIsGoodZvtxFT0vsPV");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoCollInTimeRangeStandard + 1, "kNoCollInTimeRangeStandard");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsVertexITSTPC + 1, "kIsVertexITSTPC");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kIsGoodITSLayersAll");
registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{NEventSelections, 0, NEventSelections}}});
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(AllEvents + 1, "AllEvents");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(ZVtxCut + 1, "ZVtxCut");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(Sel8 + 1, "Sel8");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(OccupancyCut + 1, "OccupancyCut");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(NoSameBunchPileup + 1, "NoSameBunchPileup");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(IsGoodZvtxFT0vsPV + 1, "IsGoodZvtxFT0vsPV");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(NoCollInTimeRangeStandard + 1, "NoCollInTimeRangeStandard");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(IsVertexITSTPC + 1, "IsVertexITSTPC");
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(IsGoodITSLayersAll + 1, "IsGoodITSLayersAll");

// Skip histogram registration if QA flag is false
if (!cfgSaveQaHistos) {
Expand Down Expand Up @@ -129,62 +129,63 @@ struct ZdcExtraTableProducer {
uint8_t selectionBits = 0;
bool selected;

registry.fill(HIST("hEventCount"), evSel_allEvents);
registry.fill(HIST("hEventCount"), AllEvents);

selected = std::fabs(collision.posZ()) < cfgEvSelVtxZ;
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_zvtx);
registry.fill(HIST("hEventCount"), evSel_zvtx);
SETBIT(selectionBits, ZVtxCut);
registry.fill(HIST("hEventCount"), ZVtxCut);
}

selected = collision.sel8();
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_sel8);
registry.fill(HIST("hEventCount"), evSel_sel8);
SETBIT(selectionBits, Sel8);
registry.fill(HIST("hEventCount"), Sel8);
}

auto occupancy = collision.trackOccupancyInTimeRange();
selected = occupancy <= cfgEvSelsMaxOccupancy;
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_occupancy);
registry.fill(HIST("hEventCount"), evSel_occupancy);
SETBIT(selectionBits, OccupancyCut);
registry.fill(HIST("hEventCount"), OccupancyCut);
}

selected = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup);
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_kNoSameBunchPileup);
registry.fill(HIST("hEventCount"), evSel_kNoSameBunchPileup);
SETBIT(selectionBits, NoSameBunchPileup);
registry.fill(HIST("hEventCount"), NoSameBunchPileup);
}

selected = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV);
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_kIsGoodZvtxFT0vsPV);
registry.fill(HIST("hEventCount"), evSel_kIsGoodZvtxFT0vsPV);
SETBIT(selectionBits, IsGoodZvtxFT0vsPV);
registry.fill(HIST("hEventCount"), IsGoodZvtxFT0vsPV);
}

selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard);
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_kNoCollInTimeRangeStandard);
registry.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeStandard);
SETBIT(selectionBits, NoCollInTimeRangeStandard);
registry.fill(HIST("hEventCount"), NoCollInTimeRangeStandard);
}

selected = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC);
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_kIsVertexITSTPC);
registry.fill(HIST("hEventCount"), evSel_kIsVertexITSTPC);
SETBIT(selectionBits, IsVertexITSTPC);
registry.fill(HIST("hEventCount"), IsVertexITSTPC);
}

selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll);
if (selected) {
selectionBits |= (uint8_t)(0x1u << evSel_kIsGoodITSLayersAll);
registry.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll);
SETBIT(selectionBits, IsGoodITSLayersAll);
registry.fill(HIST("hEventCount"), IsGoodITSLayersAll);
}

return selectionBits;
}

void process(ColEvSels const& cols, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/)
{

// collision-based event selection
constexpr int NTowers = 4; // number of ZDC towers

Expand All @@ -195,23 +196,30 @@ struct ZdcExtraTableProducer {

uint8_t evSelection = eventSelected(collision);

// add event selection
if (cfgEvSelSel8 && !(evSelection & (1 << evSel_sel8)))
if (cfgEvSelSel8 && !TESTBIT(evSelection, Sel8)) {
continue;
if (!(evSelection & (1 << evSel_zvtx)))
}
if (!TESTBIT(evSelection, ZVtxCut)) {
continue;
if (cfgEvSelsDoOccupancySel && !(evSelection & (1 << evSel_occupancy)))
}
if (cfgEvSelsDoOccupancySel && !TESTBIT(evSelection, OccupancyCut)) {
continue;
if (cfgEvSelsNoSameBunchPileupCut && !(evSelection & (1 << evSel_kNoSameBunchPileup)))
}
if (cfgEvSelsNoSameBunchPileupCut && !TESTBIT(evSelection, NoSameBunchPileup)) {
continue;
if (cfgEvSelsIsGoodZvtxFT0vsPV && !(evSelection & (1 << evSel_kIsGoodZvtxFT0vsPV)))
}
if (cfgEvSelsIsGoodZvtxFT0vsPV && !TESTBIT(evSelection, IsGoodZvtxFT0vsPV)) {
continue;
if (cfgEvSelsNoCollInTimeRangeStandard && !(evSelection & (1 << evSel_kNoCollInTimeRangeStandard)))
}
if (cfgEvSelsNoCollInTimeRangeStandard && !TESTBIT(evSelection, NoCollInTimeRangeStandard)) {
continue;
if (cfgEvSelsIsVertexITSTPC && !(evSelection & (1 << evSel_kIsVertexITSTPC)))
}
if (cfgEvSelsIsVertexITSTPC && !TESTBIT(evSelection, IsVertexITSTPC)) {
continue;
if (cfgEvSelsIsGoodITSLayersAll && !(evSelection & (1 << evSel_kIsGoodITSLayersAll)))
}
if (cfgEvSelsIsGoodITSLayersAll && !TESTBIT(evSelection, IsGoodITSLayersAll)) {
continue;
}

float centrality = collision.centFT0C();

Expand Down
Loading