162 std::unordered_map<unsigned int, PotPlots>
potPlots_;
176 std::unordered_map<unsigned int, PlanePlots>
planePlots_;
202 std::unordered_map<unsigned int, ChannelPlots>
channelPlots_;
241 "sent digis percentage",
"sent digis percentage (sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
253 activityPerBX = ibooker.
book1D(
"activity per BX CMS",
title +
" Activity per BX;Event.BX", 3600, -1.5, 3598. + 0.5);
256 ibooker.
book2D(
"digi distribution",
title +
" digi distribution;plane;channel", 10, -0.5, 4.5, 12, 0, 12);
258 dataSamplesRaw = ibooker.
book1D(
"raw Samples",
title +
" Raw Samples; ADC", 256, 0, 256);
260 baseline = ibooker.
book2D(
"baseline",
title +
" baseline (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
261 noiseRMS = ibooker.
book2D(
"noise RMS",
title +
" noise RMS (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
264 ibooker.
book2D(
"digis sent",
title +
" digi sent (sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
266 ibooker.
book2D(
"all digis",
title +
" all digis(sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
267 digiSentPercentage = ibooker.
book2D(
"sent digis percentage",
268 title +
" sent digis percentage (sampic);board + 0.5 sampic;channel",
276 hitDistribution2d = ibooker.
book2D(
"hits in planes",
277 title +
" hits in planes;plane number;x (mm)",
284 hitDistribution2dWithTime = ibooker.
book2D(
"hits in planes with time",
285 title +
" hits in planes with time;plane number;x (mm)",
292 hitDistribution2d_lumisection = ibooker.
book2D(
"hits in planes lumisection",
293 title +
" hits in planes in the last lumisection;plane number;x (mm)",
301 recHitTime = ibooker.
book1D(
"recHit time",
title +
" time in the recHits; t (ns)", 500, -25, 25);
302 amplitude = ibooker.
book1D(
"amplitude",
title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
303 tirggerCellTime = ibooker.
book1D(
"trigger cell time",
title +
" Trigger Cell Time; t (ns)", 390, -25, 25);
304 baselineRMS = ibooker.
book2D(
"noise RMS",
title +
" noise RMS (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
306 ibooker.
book2D(
"mean amplitude",
title +
" Mean Amplitude (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
307 cellOfMax = ibooker.
book2D(
"cell of max",
title +
" cell of max (0-23);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
309 hitRate = ibooker.
book2D(
"hit rate",
title +
" hit rate (Hz);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
311 planesWithDigis = ibooker.
book1D(
312 "active planes digis",
title +
" active planes with digis sent (per event);number of active planes", 6, -0.5, 5.5);
313 planesWithTime = ibooker.
book1D(
314 "active planes with time",
title +
" active planes with time (per event);number of active planes", 6, -0.5, 5.5);
320 ibooker.
book2D(
"tomography 210",
321 title +
" tomography (only with time) with strips 210 (all planes);x + 50*plane(mm);y (mm)",
329 ibooker.
book2D(
"tomography 220",
330 title +
" tomography (only with time) with strips 220 (all planes);x + 50*plane(mm);y (mm)",
348 digiDistribution = ibooker.
book1D(
"digi distribution",
title +
" digi distribution;channel", 12, 0, 12);
350 hitProfile = ibooker.
book1D(
"hit distribution with time",
351 title +
" hit distribution (with time);y (+ 15 for x>3) (mm)",
356 hitMultiplicity = ibooker.
book1D(
"channels per plane",
title +
" channels per plane; ch per plane", 13, -0.5, 12.5);
358 hitMultiplicityWithTime = ibooker.
book1D(
359 "channels per plane with time",
title +
" channels per plane with time; ch per plane", 13, -0.5, 12.5);
371 activityPerBX = ibooker.
book1D(
"activity per BX",
title +
" Activity per BX;Event.BX", 1000, -1.5, 998. + 0.5);
372 dataSamplesRaw = ibooker.
book1D(
"raw samples",
title +
" Raw Samples; ADC", 256, 0, 256);
373 cellOfMax = ibooker.
book1D(
"cell of max",
title +
" cell of max; cell", 24, 0, 24);
375 tirggerCellTime = ibooker.
book1D(
"sampic trigger time",
title +
" Sampic Trigger Time; t (ns)", 100, -25, 25);
376 recHitTime = ibooker.
book1D(
"recHit Time",
title +
" recHit Time; t (ns)", 500, -25, 25);
377 amplitude = ibooker.
book1D(
"amplitude",
title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
378 noiseSamples = ibooker.
book1D(
"noise samples",
title +
" noise samples; V", 50, 0, 1);
380 hitTime = ibooker.
book1D(
"hit time",
title +
"hit time;t - t_previous (us)", 100, 0, 10000);
381 hitRate = ibooker.
book1D(
"hit rate",
title +
"hit rate;rate (Hz)", 100, 0, 10000);
383 stripTomography210 = ibooker.
book2D(
"tomography 210",
384 title +
" tomography with strips 210;x (mm);y (mm)",
391 stripTomography220 = ibooker.
book2D(
"tomography 220",
392 title +
" tomography with strips 220;x (mm);y (mm)",
413 verbosity_(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
470 auto d = std::make_shared<totemds::Cache>();
471 d->hitDistribution2dMap.reserve(
potPlots_.size());
473 d->hitDistribution2dMap[
plot.first] =
474 std::unique_ptr<TH2F>(static_cast<TH2F *>(
plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
508 edm::LogProblem(
"TotemTimingDQMSource") <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs "
509 "are not valid. Skipping this event.\n"
510 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n"
511 <<
" fedInfo.isValid = " << fedInfo.
isValid();
518 std::set<uint8_t> boardSet;
519 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
520 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
522 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
523 for (
const auto &digis : *timingDigis) {
527 detId_pot.setChannel(0);
531 for (
const auto &digi : digis) {
536 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
538 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
539 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
541 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
543 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
545 boardSet.insert(digi.eventInfo().hardwareId());
546 std::bitset<16> chMap(digi.eventInfo().channelMap());
547 for (
int i = 0;
i < 16; ++
i) {
554 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
559 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
561 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
562 channelsPerPlane[detId_plane]++;
564 channelsPerPlane[detId_plane] = 0;
571 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
576 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
582 ++(lumiCache->hitsCounterMap[detId]);
588 for (
const auto &
rechits : *timingRecHits) {
592 detId_pot.setChannel(0);
596 for (
const auto &rechit :
rechits) {
598 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
600 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
601 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
602 float yCorrected = rechit.y();
604 float x_shift = detId.plane();
605 x_shift += (rechit.x() > 2) ? 0.25 : 0;
606 int startBin = hitHistoTmpYAxis->FindBin(yCorrected - 0.5 * rechit.yWidth());
608 for (
int i = 0;
i < numOfBins; ++
i) {
609 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
610 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
611 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift,
612 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
617 for (
int i = 0;
i < numOfBins; ++
i)
618 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
619 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
621 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
622 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
627 float x_shift = (rechit.x() > 2) ? 15 : 0;
628 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
631 float yCorrected = rechit.y() +
verticalShiftTop_ - 0.5 * rechit.yWidth() + x_shift;
632 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
633 for (
int i = 0;
i < numOfBins; ++
i)
634 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
636 float yCorrected = rechit.y() +
verticalShiftBot_ + 0.5 * rechit.yWidth() + (15 - x_shift);
637 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
638 int totBins = hitProfileHistoTmp->GetNbinsX();
639 for (
int i = 0;
i < numOfBins; ++
i)
640 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(totBins - startBin +
i));
643 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
644 channelsPerPlaneWithTime[detId_plane]++;
646 channelsPerPlaneWithTime[detId_plane] = 0;
650 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.sampicThresholdTime());
651 channelPlots_[detId].tirggerCellTime->Fill(rechit.sampicThresholdTime());
662 for (
const auto &
rechits : *timingRecHits) {
666 detId_pot.setChannel(0);
672 for (
const auto &rechit :
rechits) {
676 for (
const auto &ds : *stripTracks) {
687 rp_x = (
geometry->sensor(plId_V)->translation().x() +
geometry->sensor(plId_U)->translation().x()) / 2;
688 rp_y = (
geometry->sensor(plId_V)->translation().y() +
geometry->sensor(plId_U)->translation().y()) / 2;
693 for (
const auto &striplt : ds) {
694 if (striplt.isValid() && stripId.arm() == detId.arm()) {
700 double x = striplt.x0() - rp_x;
701 double y = striplt.y0() - rp_y;
703 potPlots_[detId_pot].stripTomography210->Fill(
x + detId.plane() * 50,
y + y_shift);
706 potPlots_[detId_pot].stripTomography220->Fill(
x + detId.plane() * 50,
y + y_shift);
719 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
720 plt.second.planesWithDigisSet.clear();
721 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
722 plt.second.planesWithTimeSet.clear();
725 for (
const auto &plt : channelsPerPlane) {
726 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
728 for (
const auto &plt : channelsPerPlaneWithTime) {
729 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
738 auto lumiCache = luminosityBlockCache(iLumi.
index());
740 *(
plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[
plot.first]);
746 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
747 TH2F *histoSent =
plot.second.digiSent->getTH2F();
748 TH2F *histoAll =
plot.second.digiAll->getTH2F();
750 hitHistoTmp->Divide(histoSent, histoAll);
751 hitHistoTmp->Scale(100);
752 hitHistoGlobalTmp->Add(hitHistoTmp, 1);
754 plot.second.baseline->Reset();
755 plot.second.noiseRMS->Reset();
756 plot.second.meanAmplitude->Reset();
757 plot.second.cellOfMax->Reset();
758 plot.second.hitRate->Reset();
763 plot.second.baseline->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetMean());
764 plot.second.noiseRMS->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS());
765 plot.second.meanAmplitude->Fill(chId.
plane(), chId.
channel(), chPlot.second.amplitude->getTH1F()->GetMean());
766 plot.second.cellOfMax->Fill(chId.
plane(), chId.
channel(), chPlot.second.cellOfMax->getTH1F()->GetMean());
767 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first];
774 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[
plot.first];
775 if (hitsCounterPerLumisection != 0) {