Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TkDQM: Add checks to avoid Segfault when a ME is not present at harvesting step #36151

Merged
merged 4 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions DQM/SiPixelPhase1Track/plugins/SiPixelPhase1ResidualsExtra.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ void SiPixelPhase1ResidualsExtra::fillMEs(DQMStore::IBooker& iBooker, DQMStore::
MonitorElement* me2_y = iGetter.get(
"PixelPhase1/Tracks/ResidualsExtra/PXBarrel/DRnR_y_per_SignedModule_per_SignedLadder_PXLayer_" + layer);

if (me_x == nullptr || me_y == nullptr || me2_x == nullptr || me2_y == nullptr) {
edm::LogWarning("SiPixelPhase1ResidualsExtra")
<< "Residuals plots for Pixel BPIX Layer" << layer << " not found. Skipping ResidualsExtra plots generation.";
continue;
}

for (int i = 1; i <= me_x->getNbinsY(); i++) {
if (i == (me_x->getNbinsY() / 2 + 1))
continue; //Middle bin of y axis is empty
Expand Down Expand Up @@ -389,6 +395,13 @@ void SiPixelPhase1ResidualsExtra::fillMEs(DQMStore::IBooker& iBooker, DQMStore::
"PixelPhase1/Tracks/ResidualsExtra/PXForward/DRnR_x_per_PXDisk_per_SignedBladePanel_PXRing_" + ring);
MonitorElement* me2_y = iGetter.get(
"PixelPhase1/Tracks/ResidualsExtra/PXForward/DRnR_y_per_PXDisk_per_SignedBladePanel_PXRing_" + ring);

if (me_x == nullptr || me_y == nullptr || me2_x == nullptr || me2_y == nullptr) {
edm::LogWarning("SiPixelPhase1ResidualsExtra")
<< "Residuals plots for Pixel FPIX Ring" << ring << " not found. Skipping ResidualsExtra plots generation.";
continue;
}

bool posSide = false;
for (int j = 1; j <= me_x->getNbinsX(); j++) {
if (j == 4)
Expand Down
5 changes: 5 additions & 0 deletions DQM/TrackingMonitor/src/TrackFoldedOccupancyClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ void TrackFoldedOccupancyClient::dqmEndJob(DQMStore::IBooker& ibooker, DQMStore:
hname = "TrackEtaPhiInvertedoutofphase_";
MonitorElement* TrackEtaPhiInvertedoutofphase = igetter.get(inFolder + hname + histTag_);

if (TrackEtaPhi == nullptr || TrackEtaPhiInverted == nullptr || TrackEtaPhiInvertedoutofphase == nullptr) {
edm::LogWarning("TrackFoldedOccupancyClient") << "MEs needed for this module not found. Skipping.";
return;
}

TkEtaPhi_Ratio_byFoldingmap->divide(TrackEtaPhi, TrackEtaPhiInverted, 1., 1., "");
TkEtaPhi_Ratio_byFoldingmap_op->divide(TrackEtaPhi, TrackEtaPhiInvertedoutofphase, 1., 1., "");

Expand Down