Skip to content

Commit 09779f0

Browse files
authored
[DPG] Added VCH counter QA (#15474)
1 parent 86454aa commit 09779f0

File tree

1 file changed

+191
-52
lines changed

1 file changed

+191
-52
lines changed

DPG/Tasks/AOTEvent/lumiQa.cxx

Lines changed: 191 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct LumiQaTask {
3232
int lastRunNumber = -1;
3333
double maxSec = 1;
3434
double minSec = 0;
35+
TH1* hCalibV0A = nullptr;
3536
TH1* hCalibT0C = nullptr;
3637
static const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches;
3738
std::bitset<nBCsPerOrbit> bcPatternB;
@@ -48,9 +49,11 @@ struct LumiQaTask {
4849

4950
const AxisSpec axisMultZNA{2000, 0., 400., "ZNA multiplicity"};
5051
const AxisSpec axisMultZNC{2000, 0., 400., "ZNC multiplicity"};
52+
const AxisSpec axisMultV0A{1000, 0., 200000., "V0A multiplicity"};
5153
const AxisSpec axisMultT0M{1000, 0., 270000., "T0M multiplicity"};
5254
const AxisSpec axisMultT0A{1000, 0., 200000., "T0A multiplicity"};
5355
const AxisSpec axisMultT0C{1000, 0., 70000., "T0C multiplicity"};
56+
const AxisSpec axisCentV0A{100, 0., 100., "V0A centrality"};
5457
const AxisSpec axisCentT0C{100, 0., 100., "T0C centrality"};
5558
const AxisSpec axisTime{700, -35., 35., "time (ns)"};
5659
const AxisSpec axisMultChannelT0A{5000, 0., 5000., "T0A channel multiplicity"};
@@ -62,10 +65,24 @@ struct LumiQaTask {
6265

6366
histos.add("hMultZNA", "", kTH1F, {axisMultZNA});
6467
histos.add("hMultZNC", "", kTH1F, {axisMultZNC});
68+
histos.add("hMultV0A", "", kTH1F, {axisMultV0A});
6569
histos.add("hMultT0M", "", kTH1F, {axisMultT0M});
6670
histos.add("hMultT0A", "", kTH1F, {axisMultT0A});
6771
histos.add("hMultT0C", "", kTH1F, {axisMultT0C});
72+
histos.add("hCentV0A", "", kTH1F, {axisCentV0A});
6873
histos.add("hCentT0C", "", kTH1F, {axisCentT0C});
74+
75+
histos.add("hMultV0AselTVXB", "", kTH1F, {axisMultV0A});
76+
histos.add("hCentV0AselTVXB", "", kTH1F, {axisCentV0A});
77+
histos.add("hMultVCHselTVXB", "", kTH1F, {axisMultV0A});
78+
histos.add("hCentVCHselTVXB", "", kTH1F, {axisCentV0A});
79+
histos.add("hMultV0AselZACTVXB", "", kTH1F, {axisMultV0A});
80+
histos.add("hCentV0AselZACTVXB", "", kTH1F, {axisCentV0A});
81+
histos.add("hMultVCHselZACTVXB", "", kTH1F, {axisMultV0A});
82+
histos.add("hCentVCHselZACTVXB", "", kTH1F, {axisCentV0A});
83+
84+
histos.add("hMultT0CselTVXB", "", kTH1F, {axisMultT0C});
85+
histos.add("hCentT0CselTVXB", "", kTH1F, {axisCentT0C});
6986
histos.add("hMultT0MselTSC", "", kTH1F, {axisMultT0M});
7087
histos.add("hMultT0MselTCE", "", kTH1F, {axisMultT0M});
7188
histos.add("hMultT0CselTCE", "", kTH1F, {axisMultT0C});
@@ -86,15 +103,29 @@ struct LumiQaTask {
86103
histos.add("hTimeZNAselC", "", kTH1F, {axisTime});
87104
histos.add("hTimeZNCselC", "", kTH1F, {axisTime});
88105

89-
histos.add("hCounterTCE", "", kTH1D, {{1, 0., 1.}});
90-
histos.add("hCounterZNA", "", kTH1D, {{1, 0., 1.}});
91-
histos.add("hCounterZNC", "", kTH1D, {{1, 0., 1.}});
92-
histos.add("hCounterZEM", "", kTH1D, {{1, 0., 1.}});
106+
histos.add("hCounterTCEselB", "", kTH1D, {{1, 0., 1.}});
107+
histos.add("hCounterZNAselB", "", kTH1D, {{1, 0., 1.}});
108+
histos.add("hCounterZNCselB", "", kTH1D, {{1, 0., 1.}});
109+
histos.add("hCounterZEMselB", "", kTH1D, {{1, 0., 1.}});
110+
histos.add("hCounterVCHselB", "", kTH1D, {{1, 0., 1.}});
111+
112+
histos.add("hCounterTCEselA", "", kTH1D, {{1, 0., 1.}});
113+
histos.add("hCounterZNAselA", "", kTH1D, {{1, 0., 1.}});
114+
histos.add("hCounterZNCselA", "", kTH1D, {{1, 0., 1.}});
115+
histos.add("hCounterZEMselA", "", kTH1D, {{1, 0., 1.}});
116+
histos.add("hCounterVCHselA", "", kTH1D, {{1, 0., 1.}});
117+
118+
histos.add("hCounterTCEselC", "", kTH1D, {{1, 0., 1.}});
119+
histos.add("hCounterZNAselC", "", kTH1D, {{1, 0., 1.}});
120+
histos.add("hCounterZNCselC", "", kTH1D, {{1, 0., 1.}});
121+
histos.add("hCounterZEMselC", "", kTH1D, {{1, 0., 1.}});
122+
histos.add("hCounterVCHselC", "", kTH1D, {{1, 0., 1.}});
123+
93124
histos.add("hMultT0AperChannel", "", kTH2D, {axisMultChannelT0A, axisChannelsT0A});
94125
histos.add("hMultT0CperChannel", "", kTH2D, {axisMultChannelT0C, axisChannelsT0C});
95126
}
96127

97-
void process(BCsRun3 const& bcs, aod::Zdcs const&, aod::FT0s const&)
128+
void process(BCsRun3 const& bcs, aod::Zdcs const&, aod::FT0s const&, aod::FV0As const&)
98129
{
99130
int runNumber = bcs.iteratorAt(0).runNumber();
100131
const char* srun = Form("%d", runNumber);
@@ -117,6 +148,12 @@ struct LumiQaTask {
117148
return;
118149
}
119150

151+
hCalibV0A = reinterpret_cast<TH1*>(callst->FindObject("hCalibZeqFV0"));
152+
if (hCalibV0A == nullptr) {
153+
LOGF(info, "hCalibZeqFV0 histogram is not available for run=%d at timestamp=%llu", runNumber, ts);
154+
return;
155+
}
156+
120157
hCalibT0C = reinterpret_cast<TH1*>(callst->FindObject("hCalibZeqFT0C"));
121158
if (hCalibT0C == nullptr) {
122159
LOGF(info, "hCalibZeqFT0C histogram is not available for run=%d at timestamp=%llu", runNumber, ts);
@@ -136,71 +173,172 @@ struct LumiQaTask {
136173

137174
const AxisSpec axisBCs{nBCsPerOrbit, 0., static_cast<double>(nBCsPerOrbit), ""};
138175
const AxisSpec axisSeconds{nTimeBins, 0, timeInterval, "seconds"};
139-
histos.add("hSecondsBcsTCE", "", kTH2D, {axisSeconds, axisBCs});
140-
histos.add("hSecondsBcsZNA", "", kTH2D, {axisSeconds, axisBCs});
141-
histos.add("hSecondsBcsZNC", "", kTH2D, {axisSeconds, axisBCs});
142-
histos.add("hSecondsBcsZEM", "", kTH2D, {axisSeconds, axisBCs});
176+
histos.add("hSecondsBcsTCEselB", "", kTH2D, {axisSeconds, axisBCs});
177+
histos.add("hSecondsBcsZNAselB", "", kTH2D, {axisSeconds, axisBCs});
178+
histos.add("hSecondsBcsZNCselB", "", kTH2D, {axisSeconds, axisBCs});
179+
histos.add("hSecondsBcsZEMselB", "", kTH2D, {axisSeconds, axisBCs});
180+
histos.add("hSecondsBcsVCHselB", "", kTH2D, {axisSeconds, axisBCs});
181+
histos.add("hSecondsBcsTCEselA", "", kTH2D, {axisSeconds, axisBCs});
182+
histos.add("hSecondsBcsZNAselA", "", kTH2D, {axisSeconds, axisBCs});
183+
histos.add("hSecondsBcsZNCselA", "", kTH2D, {axisSeconds, axisBCs});
184+
histos.add("hSecondsBcsZEMselA", "", kTH2D, {axisSeconds, axisBCs});
185+
histos.add("hSecondsBcsVCHselA", "", kTH2D, {axisSeconds, axisBCs});
186+
histos.add("hSecondsBcsTCEselC", "", kTH2D, {axisSeconds, axisBCs});
187+
histos.add("hSecondsBcsZNAselC", "", kTH2D, {axisSeconds, axisBCs});
188+
histos.add("hSecondsBcsZNCselC", "", kTH2D, {axisSeconds, axisBCs});
189+
histos.add("hSecondsBcsZEMselC", "", kTH2D, {axisSeconds, axisBCs});
190+
histos.add("hSecondsBcsVCHselC", "", kTH2D, {axisSeconds, axisBCs});
143191
}
144192

145193
for (const auto& bc : bcs) {
146194
int64_t ts = bc.timestamp();
195+
auto inputMask = bc.inputMask();
147196
double secFromSOR = ts / 1000. - minSec;
148-
double bcInOrbit = bc.globalBC() % nBCsPerOrbit;
197+
int bcInOrbit = bc.globalBC() % nBCsPerOrbit;
198+
bool maskB = bcPatternB[bcInOrbit];
199+
bool maskA = bcPatternA[bcInOrbit];
200+
bool maskC = bcPatternC[bcInOrbit];
201+
bool tvxCTP = TESTBIT(inputMask, 2);
202+
bool tscCTP = TESTBIT(inputMask, 3);
203+
bool tceCTP = TESTBIT(inputMask, 4);
204+
bool vchCTP = TESTBIT(inputMask, 9);
205+
bool zemCTP = TESTBIT(inputMask, 24);
206+
bool zncCTP = TESTBIT(inputMask, 25);
207+
208+
LOGP(debug, "CTP: tvx={} tsc={} tce={} vch={} zem={} znc={}", tvxCTP, tscCTP, tceCTP, vchCTP, zemCTP, zncCTP);
209+
210+
bool tvx = bc.has_ft0() ? TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex) : 0;
211+
bool tsc = bc.has_ft0() ? TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitSCen) : 0;
212+
bool tce = bc.has_ft0() ? TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitCen) : 0;
213+
bool vch = bc.has_fv0a() ? TESTBIT(bc.fv0a().triggerMask(), o2::fit::Triggers::bitTrgCharge) : 0;
214+
215+
float meanTimeZNA = 0.;
216+
float meanTimeZNC = 0.;
217+
bool zna = bc.has_zdc() ? std::fabs(bc.zdc().timeZNA() - meanTimeZNA) < 2 : 0; // ns
218+
bool znc = bc.has_zdc() ? std::fabs(bc.zdc().timeZNC() - meanTimeZNC) < 2 : 0; // ns
219+
bool zem = zna || znc;
220+
bool zac = zna && znc;
221+
222+
// check if TCE triggers from FT0 mask and CTP are consistent
223+
if (tce != tceCTP) {
224+
LOGP(warning, "TCEfromFT0={} TCEfromCTP={}", tce, tceCTP);
225+
}
226+
149227
if (bc.has_zdc()) {
150228
float timeZNA = bc.zdc().timeZNA();
151229
float timeZNC = bc.zdc().timeZNC();
152230
float multZNA = bc.zdc().energyCommonZNA();
153231
float multZNC = bc.zdc().energyCommonZNC();
154-
155232
histos.fill(HIST("hMultZNA"), multZNA);
156233
histos.fill(HIST("hMultZNC"), multZNC);
157234
histos.fill(HIST("hTimeZNA"), timeZNA);
158235
histos.fill(HIST("hTimeZNC"), timeZNC);
159-
if (bc.has_ft0() && TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex)) { // TVX
236+
if (tvx) { // TVX
160237
histos.fill(HIST("hTimeZNAselTVX"), timeZNA);
161238
histos.fill(HIST("hTimeZNCselTVX"), timeZNC);
162239
}
163-
164-
if (bcPatternB[bc.globalBC() % nBCsPerOrbit]) { // B-mask
240+
if (maskB) { // B-mask
165241
histos.fill(HIST("hTimeZNAselB"), timeZNA);
166242
histos.fill(HIST("hTimeZNCselB"), timeZNC);
167243
}
168-
if (bcPatternA[bc.globalBC() % nBCsPerOrbit]) { // A-mask
244+
if (maskA) { // A-mask
169245
histos.fill(HIST("hTimeZNAselA"), timeZNA);
170246
histos.fill(HIST("hTimeZNCselA"), timeZNC);
171247
}
172-
if (bcPatternC[bc.globalBC() % nBCsPerOrbit]) { // C-mask
248+
if (maskC) { // C-mask
173249
histos.fill(HIST("hTimeZNAselC"), timeZNA);
174250
histos.fill(HIST("hTimeZNCselC"), timeZNC);
175251
}
176252

177-
double meanTimeZNA = 0;
178-
double meanTimeZNC = 0;
179-
if (runNumber == 544795) {
180-
meanTimeZNA = 0.49;
181-
meanTimeZNC = -5.19;
182-
} else if (runNumber == 544911) {
183-
meanTimeZNA = -1.44;
184-
meanTimeZNC = -11.39;
253+
// B-mask
254+
if (zna && maskB) {
255+
histos.get<TH1>(HIST("hCounterZNAselB"))->Fill(srun, 1);
256+
histos.fill(HIST("hSecondsBcsZNAselB"), secFromSOR, bcInOrbit);
257+
}
258+
if (znc && maskB) {
259+
histos.get<TH1>(HIST("hCounterZNCselB"))->Fill(srun, 1);
260+
histos.fill(HIST("hSecondsBcsZNCselB"), secFromSOR, bcInOrbit);
261+
}
262+
if (zem && maskB) {
263+
histos.get<TH1>(HIST("hCounterZEMselB"))->Fill(srun, 1);
264+
histos.fill(HIST("hSecondsBcsZEMselB"), secFromSOR, bcInOrbit);
265+
}
266+
267+
// A-mask
268+
if (zna && maskA) {
269+
histos.get<TH1>(HIST("hCounterZNAselA"))->Fill(srun, 1);
270+
histos.fill(HIST("hSecondsBcsZNAselA"), secFromSOR, bcInOrbit);
271+
}
272+
if (znc && maskA) {
273+
histos.get<TH1>(HIST("hCounterZNCselA"))->Fill(srun, 1);
274+
histos.fill(HIST("hSecondsBcsZNCselA"), secFromSOR, bcInOrbit);
275+
}
276+
if (zem && maskA) {
277+
histos.get<TH1>(HIST("hCounterZEMselA"))->Fill(srun, 1);
278+
histos.fill(HIST("hSecondsBcsZEMselA"), secFromSOR, bcInOrbit);
279+
}
280+
281+
// C-mask
282+
if (zna && maskC) {
283+
histos.get<TH1>(HIST("hCounterZNAselC"))->Fill(srun, 1);
284+
histos.fill(HIST("hSecondsBcsZNAselC"), secFromSOR, bcInOrbit);
285+
}
286+
if (znc && maskC) {
287+
histos.get<TH1>(HIST("hCounterZNCselC"))->Fill(srun, 1);
288+
histos.fill(HIST("hSecondsBcsZNCselC"), secFromSOR, bcInOrbit);
289+
}
290+
if (zem && maskC) {
291+
histos.get<TH1>(HIST("hCounterZEMselC"))->Fill(srun, 1);
292+
histos.fill(HIST("hSecondsBcsZEMselC"), secFromSOR, bcInOrbit);
293+
}
294+
}
295+
296+
if (bc.has_fv0a()) {
297+
float multV0A = 0.;
298+
for (auto mult : bc.fv0a().amplitude()) {
299+
multV0A += mult;
185300
}
301+
float centV0A = hCalibV0A->GetBinContent(hCalibV0A->FindFixBin(multV0A));
302+
histos.fill(HIST("hMultV0A"), multV0A);
303+
histos.fill(HIST("hCentV0A"), centV0A);
186304

187-
if (fabs(timeZNA - meanTimeZNA) < 2) {
188-
histos.get<TH1>(HIST("hCounterZNA"))->Fill(srun, 1);
189-
histos.fill(HIST("hSecondsBcsZNA"), secFromSOR, bcInOrbit);
305+
if (tvx && maskB) {
306+
histos.fill(HIST("hMultV0AselTVXB"), multV0A);
307+
histos.fill(HIST("hCentV0AselTVXB"), centV0A);
190308
}
191-
if (fabs(timeZNC - meanTimeZNC) < 2) {
192-
histos.get<TH1>(HIST("hCounterZNC"))->Fill(srun, 1);
193-
histos.fill(HIST("hSecondsBcsZNC"), secFromSOR, bcInOrbit);
309+
310+
if (tvx && maskB && vch) {
311+
histos.fill(HIST("hMultVCHselTVXB"), multV0A);
312+
histos.fill(HIST("hCentVCHselTVXB"), centV0A);
313+
histos.get<TH1>(HIST("hCounterVCHselB"))->Fill(srun, 1);
314+
histos.fill(HIST("hSecondsBcsVCHselB"), secFromSOR, bcInOrbit);
315+
}
316+
317+
if (tvx && maskA && vch) {
318+
histos.get<TH1>(HIST("hCounterVCHselA"))->Fill(srun, 1);
319+
histos.fill(HIST("hSecondsBcsVCHselA"), secFromSOR, bcInOrbit);
194320
}
195-
if (fabs(timeZNA - meanTimeZNA) < 2 || fabs(timeZNC - meanTimeZNC) < 2) {
196-
histos.get<TH1>(HIST("hCounterZEM"))->Fill(srun, 1);
197-
histos.fill(HIST("hSecondsBcsZEM"), secFromSOR, bcInOrbit);
321+
322+
if (tvx && maskC && vch) {
323+
histos.get<TH1>(HIST("hCounterVCHselC"))->Fill(srun, 1);
324+
histos.fill(HIST("hSecondsBcsVCHselC"), secFromSOR, bcInOrbit);
325+
}
326+
327+
if (tvx && maskB && zac) {
328+
histos.fill(HIST("hMultV0AselZACTVXB"), multV0A);
329+
histos.fill(HIST("hCentV0AselZACTVXB"), centV0A);
330+
}
331+
332+
if (tvx && maskB && vch && zac) {
333+
histos.fill(HIST("hMultVCHselZACTVXB"), multV0A);
334+
histos.fill(HIST("hCentVCHselZACTVXB"), centV0A);
198335
}
199336
}
200337

201338
if (!bc.has_ft0()) {
202339
continue;
203340
}
341+
204342
for (unsigned int ic = 0; ic < bc.ft0().amplitudeA().size(); ic++) {
205343
histos.fill(HIST("hMultT0AperChannel"), bc.ft0().amplitudeA()[ic], bc.ft0().channelA()[ic]);
206344
}
@@ -217,33 +355,34 @@ struct LumiQaTask {
217355
histos.fill(HIST("hMultT0C"), multT0C);
218356
histos.fill(HIST("hCentT0C"), centT0C);
219357

220-
if (TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitSCen)) { // TSC
221-
histos.fill(HIST("hMultT0MselTSC"), multT0M);
358+
if (tvx && maskB) {
359+
histos.fill(HIST("hMultT0CselTVXB"), multT0C);
360+
histos.fill(HIST("hCentT0CselTVXB"), centT0C);
222361
}
223362

224-
if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitCen)) { // TCE
225-
continue;
363+
if (tsc) {
364+
histos.fill(HIST("hMultT0MselTSC"), multT0M);
226365
}
227-
histos.fill(HIST("hMultT0MselTCE"), multT0M);
228-
histos.fill(HIST("hMultT0CselTCE"), multT0C);
229-
histos.fill(HIST("hCentT0CselTCE"), centT0C);
230366

231-
if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex)) { // TVX
232-
continue;
367+
if (tce) {
368+
histos.fill(HIST("hMultT0MselTCE"), multT0M);
369+
histos.fill(HIST("hMultT0CselTCE"), multT0C);
370+
histos.fill(HIST("hCentT0CselTCE"), centT0C);
233371
}
234-
histos.fill(HIST("hMultT0CselTVXTCE"), multT0C);
235-
histos.fill(HIST("hCentT0CselTVXTCE"), centT0C);
236372

237-
if (!bcPatternB[bc.globalBC() % nBCsPerOrbit]) { // B-mask
238-
continue;
373+
if (tce && tvx) {
374+
histos.fill(HIST("hMultT0CselTVXTCE"), multT0C);
375+
histos.fill(HIST("hCentT0CselTVXTCE"), centT0C);
239376
}
240-
histos.fill(HIST("hMultT0CselTVXTCEB"), multT0C);
241-
histos.fill(HIST("hCentT0CselTVXTCEB"), centT0C);
242377

243-
histos.get<TH1>(HIST("hCounterTCE"))->Fill(srun, 1);
244-
histos.fill(HIST("hSecondsBcsTCE"), secFromSOR, bcInOrbit);
245-
}
246-
}
378+
if (tce && tvx && maskB) {
379+
histos.fill(HIST("hMultT0CselTVXTCEB"), multT0C);
380+
histos.fill(HIST("hCentT0CselTVXTCEB"), centT0C);
381+
histos.get<TH1>(HIST("hCounterTCEselB"))->Fill(srun, 1);
382+
histos.fill(HIST("hSecondsBcsTCEselB"), secFromSOR, bcInOrbit);
383+
}
384+
} // bc loop
385+
} // process
247386
};
248387

249388
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)