Skip to content

Commit 8e899a6

Browse files
authored
[PWGUD] add zdc time cut (#17259)
1 parent fbbe848 commit 8e899a6

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

PWGUD/Tasks/flowCorrelationsUpc.cxx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ struct FlowCorrelationsUpc {
9191
O2_DEFINE_CONFIGURABLE(cfgRctFlagEnabled, bool, false, "use run condition table flag")
9292
O2_DEFINE_CONFIGURABLE(cfgRctFlagIndex, int, 1, "1: isCBTOk; 2:isCBTZdcOk; 3: isCBTHadronOk; 4:isCBTHadronZdcOk ")
9393
O2_DEFINE_CONFIGURABLE(cfgIRMaxCut, double, 50, "maximum interaction rate for UPC events")
94+
O2_DEFINE_CONFIGURABLE(cfgZdcTime, bool, false, "choose zdc time cut")
95+
O2_DEFINE_CONFIGURABLE(cfgZdcTimeCut, float, 2.0, "zdc time cut")
9496

9597
ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for histograms"};
9698
ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"};
@@ -167,6 +169,9 @@ struct FlowCorrelationsUpc {
167169
registry.add("deltaPhi_deltaEta_mixed", "deltaphi-deltaeta", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // histogram to check the delta eta and delta phi distribution
168170
registry.add("Nch_raw_vs_independent", "Raw vs Independent", {HistType::kTH2D, {axisMultiplicity, axisIndependent}});
169171
registry.add("interactionRate", "kHz", {HistType::kTH1F, {{50, 0, 50, "kHz"}}});
172+
registry.add("ZDCEnergy", "ZNA; ZNC; Count", {HistType::kTH2D, {{100, 0, 100}, {100, 0, 100}}});
173+
registry.add("ZDCTime", "ZNA; ZNC; Count", {HistType::kTH2D, {{100, -10, 10}, {100, -10, 10}}});
174+
registry.add("neutronClass", "ZNA; ZNC; Count", {HistType::kTH2D, {{2, 0, 2}, {2, 0, 2}}});
170175

171176
if (cfgUseNchRoughMCCorrected) {
172177
fnchRoughMCFunc = new TF1("fnchRoughMCFunc", cfgNchRoughMCFunction->c_str(), 0, 100);
@@ -225,6 +230,59 @@ struct FlowCorrelationsUpc {
225230
}
226231
}
227232

233+
template <typename C>
234+
// zdc time cut
235+
bool zdcTimeCut(const C& collision)
236+
{
237+
if (!cfgZdcTime) {
238+
return true;
239+
}
240+
int neutronClass = -1;
241+
float energyCommonZNA = collision.energyCommonZNA(), energyCommonZNC = collision.energyCommonZNC();
242+
float timeZNA = collision.timeZNA(), timeZNC = collision.timeZNC();
243+
if (std::isinf(energyCommonZNA))
244+
energyCommonZNA = -999;
245+
if (std::isinf(energyCommonZNC))
246+
energyCommonZNC = -999;
247+
if (std::isinf(timeZNA))
248+
timeZNA = -999;
249+
if (std::isinf(timeZNC))
250+
timeZNC = -999;
251+
registry.fill(HIST("ZDCEnergy"), energyCommonZNC, energyCommonZNA);
252+
registry.fill(HIST("ZDCTime"), timeZNC, timeZNA);
253+
if (std::abs(timeZNA) > cfgZdcTimeCut && std::abs(timeZNC) > cfgZdcTimeCut) {
254+
neutronClass = 0;
255+
registry.fill(HIST("neutronClass"), 0, 0);
256+
}
257+
if (std::abs(timeZNA) <= cfgZdcTimeCut && std::abs(timeZNC) > cfgZdcTimeCut) {
258+
neutronClass = 1;
259+
registry.fill(HIST("neutronClass"), 0, 1);
260+
}
261+
if (std::abs(timeZNA) > cfgZdcTimeCut && std::abs(timeZNC) <= cfgZdcTimeCut) {
262+
neutronClass = 2;
263+
registry.fill(HIST("neutronClass"), 1, 0);
264+
}
265+
if (std::abs(timeZNA) <= cfgZdcTimeCut && std::abs(timeZNC) <= cfgZdcTimeCut) {
266+
neutronClass = 3;
267+
registry.fill(HIST("neutronClass"), 1, 1);
268+
}
269+
if (cfgZdcTime) {
270+
// reject 0n0n and XnXn
271+
if (neutronClass == 0 || neutronClass == 3) { // o2-linter: disable=magic-number (ZDC time cut)
272+
return false;
273+
}
274+
// if A or C gap is requested, keep corresponding neutron class
275+
if (cfgGapSide == 0 || cfgGapSide == 1) {
276+
if ((cfgGapSide == 0 && neutronClass == 1) || (cfgGapSide == 1 && neutronClass == 2)) { // o2-linter: disable=magic-number (ZDC time cut)
277+
// accepted
278+
} else {
279+
return false;
280+
}
281+
}
282+
}
283+
return true;
284+
}
285+
228286
template <typename C>
229287
bool eventSelected(const C& collision)
230288
{
@@ -256,6 +314,10 @@ struct FlowCorrelationsUpc {
256314
return false;
257315
}
258316

317+
if (!zdcTimeCut(collision)) {
318+
return false;
319+
}
320+
259321
return true;
260322
}
261323

0 commit comments

Comments
 (0)