Skip to content
Snippets Groups Projects
Commit 5b56b19b authored by Finn King's avatar Finn King
Browse files

Merge branch 'fix_displayEvents' into 'master'

delete the histogram after writing it to avoid memory leak

See merge request corryvreckan/corryvreckan!711
parents 2a52a29e c95a56c6
Branches master
No related tags found
No related merge requests found
Pipeline #9961276 passed
......@@ -27,20 +27,21 @@ StatusCode EventDisplay::run(const std::shared_ptr<Clipboard>& clipboard) {
}
std::string title = "map_event_" + std::to_string(event_number_);
auto* histogram = new TProfile2D(title.c_str(),
"rawValues; column; row; raw values",
detector_->nPixels().X(),
-0.5,
detector_->nPixels().X() - 0.5,
detector_->nPixels().Y(),
-0.5,
detector_->nPixels().Y() - 0.5);
auto histogram = new TProfile2D(title.c_str(),
"rawValues; column; row; raw values",
detector_->nPixels().X(),
-0.5,
detector_->nPixels().X() - 0.5,
detector_->nPixels().Y(),
-0.5,
detector_->nPixels().Y() - 0.5);
for(const auto& pixel : pixels) {
histogram->Fill(pixel->column(), pixel->row(), pixel->raw());
}
histogram->Write();
delete histogram;
event_number_++;
// Return value telling analysis to keep running
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment