Skip to content

Commit a2d31fa

Browse files
committed
add zdc time cut
1 parent f0e4c8d commit a2d31fa

1 file changed

Lines changed: 63 additions & 1 deletion

File tree

PWGUD/Tasks/flowCorrelationsUpc.cxx

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

9698
ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for histograms"};
9799
ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"};
@@ -161,13 +163,16 @@ struct FlowCorrelationsUpc {
161163

162164
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisIndependent, axisPtTrigger}}});
163165

164-
registry.add("eventcont", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event
166+
registry.add("eventcont", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event
165167
registry.get<TH1>(HIST("eventcont"))->GetXaxis()->SetBinLabel(4, "same");
166168
registry.get<TH1>(HIST("eventcont"))->GetXaxis()->SetBinLabel(5, "mix pair");
167169
registry.add("deltaPhi_deltaEta_same", "deltaphi-deltaeta", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // histogram to check the delta eta and delta phi distribution
168170
registry.add("deltaPhi_deltaEta_mixed", "deltaphi-deltaeta", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // histogram to check the delta eta and delta phi distribution
169171
registry.add("Nch_raw_vs_independent", "Raw vs Independent", {HistType::kTH2D, {axisMultiplicity, axisIndependent}});
170172
registry.add("interactionRate", "kHz", {HistType::kTH1F, {{50, 0, 50, "kHz"}}});
173+
registry.add("ZDCEnergy", "ZNA; ZNC; Count", {HistType::kTH2D, {{100, 0, 100}, {100, 0, 100}}});
174+
registry.add("ZDCTime", "ZNA; ZNC; Count", {HistType::kTH2D, {{100, -10, 10}, {100, -10, 10}}});
175+
registry.add("neutronClass", "ZNA; ZNC; Count", {HistType::kTH2D, {{2, 0, 2}, {2, 0, 2}}});
171176

172177
if (cfgUseNchRoughMCCorrected) {
173178
fnchRoughMCFunc = new TF1("fnchRoughMCFunc", cfgNchRoughMCFunction->c_str(), 0, 100);
@@ -226,6 +231,59 @@ struct FlowCorrelationsUpc {
226231
}
227232
}
228233

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

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

0 commit comments

Comments
 (0)