27 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest") <<
"[DTOccupancyTest]: Constructor";
35 rootFile =
new TFile(
"DTOccupancyTest.root",
"RECREATE");
36 ntuple =
new TNtuple(
"OccupancyNtuple",
38 "ls:wh:st:se:lay1MeanCell:lay1RMS:lay2MeanCell:lay2RMS:lay3MeanCell:lay3RMS:lay4MeanCell:"
39 "lay4RMS:lay5MeanCell:lay5RMS:lay6MeanCell:lay6RMS:lay7MeanCell:lay7RMS:lay8MeanCell:lay8RMS:"
40 "lay9MeanCell:lay9RMS:lay10MeanCell:lay10RMS:lay11MeanCell:lay11RMS:lay12MeanCell:lay12RMS");
60 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest") <<
" destructor called" << endl;
64 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest") <<
"[DTOccupancyTest]: BeginRun";
77 for (
int wh = -2; wh <= 2; ++wh) {
78 bookHistos(ibooker, wh,
string(
"Occupancies"),
"OccupancySummary");
82 string title =
"Occupancy Summary";
84 title =
"Test Pulse Occupancy Summary";
109 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest")
110 <<
"[DTOccupancyTest]: End of LS transition, performing the DQM client operation";
130 if (chamberOccupancyHisto !=
nullptr) {
133 float chamberPercentage = 1.;
135 int sector = chId.
sector();
140 if (resultSect4 >
result) {
143 }
else if (sector == 14) {
146 if (resultSect10 >
result) {
152 if ((sector == 4 || sector == 10) && chId.
station() == 4)
153 chamberPercentage = chamberPercentage / 2.;
161 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest")
166 string nEvtsName =
"DT/EventInfo/Counters/nProcessedEventsDigi";
177 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest")
178 <<
"[DTOccupancyTest] ME: " << nEvtsName <<
" not found!" << endl;
186 ntuple->AutoSave(
"SaveSelf");
190 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest") <<
"[DTOccupancyTest] endjob called!";
210 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest")
211 <<
"[DTOccupancyTest]: booking wheel histo:" <<
histoName <<
" (tag " <<
histoTag
214 string histoTitle =
"Occupancy summary WHEEL: " +
wheel.str();
216 histoTitle =
"TP Occupancy summary WHEEL: " +
wheel.str();
237 string folder =
"Occupancies/";
249 for (Int_t
i = firstBinX;
i < lastBinX + 1;
i++) {
250 for (Int_t
j = firstBinY;
j < lastBinY + 1;
j++) {
251 if (
histo->GetBinContent(
i,
j) > 0) {
254 sum +=
histo->GetBinContent(
i,
j);
271 int nBinsX =
histo->GetNbinsX();
273 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest") <<
"--- Occupancy test for chamber: " << chId << endl;
275 int compDeadCell = 0;
279 for (
int slay = 1; slay <= 3; ++slay) {
280 int binYlow = ((slay - 1) * 4) + 1;
282 if (chId.
station() == 4 && slay == 2)
284 for (
int lay = 1; lay <= 4; ++lay) {
288 int binY = binYlow + (lay - 1);
289 int totalDeadCells = 0;
290 int nDeadCellsInARow = 1;
291 int nDeadCellsInARowMax = 0;
292 int nCellsZeroCount = 0;
293 bool previousIsDead =
false;
295 int interDeadCells = 0;
299 for (
int cell = firstWire; cell != (nWires + firstWire); ++cell) {
300 double cellOccup =
histo->GetBinContent(cell, binY);
301 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest") <<
" cell occup: " << cellOccup;
302 totOccup += cellOccup;
304 if (cellOccup == 0) {
307 if (previousIsDead) {
311 if (nDeadCellsInARow > nDeadCellsInARowMax)
312 nDeadCellsInARowMax = nDeadCellsInARow;
313 nDeadCellsInARow = 1;
316 previousIsDead =
true;
318 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest") <<
" below reference" << endl;
320 previousIsDead =
false;
324 if (nDeadCellsInARow > nDeadCellsInARowMax)
325 nDeadCellsInARowMax = nDeadCellsInARow;
327 compDeadCell += totalDeadCells;
328 if (nDeadCellsInARowMax >= 7.) {
329 histo->SetBinContent(nBinsX + 1, binY, -1.);
336 chamberPercentage = 1. - (
float(compDeadCell) / totCell);
352 if (totOccup < min_occup)
355 chamberPercentage = 1.;
357 if (chamberPercentage < 0.2)
359 if (chamberPercentage < 0.5)
361 if (chamberPercentage < 0.75)
363 if (chamberPercentage < 0.9)
371 return string(
"DT/10-TestPulses/");
372 return string(
"DT/01-Digi/");