Commit 0c4fd5c6 authored by Daniel Hynds's avatar Daniel Hynds
Browse files

add check for histogram existence in monitoring


Former-commit-id: 53fa8abef869c78dbfda588e8b2d943dd4e7ea1b
parent 6e4d5a7e
......@@ -125,8 +125,13 @@ void OnlineMonitor::finalise(){
void OnlineMonitor::AddHisto(string canvasName, string histoName, string style){
gui->histograms[canvasName].push_back((TH1*)gDirectory->Get(histoName.c_str()));
gui->styles[gui->histograms[canvasName].back()] = style;
TH1* histogram = (TH1*)gDirectory->Get(histoName.c_str());
if(histogram){
gui->histograms[canvasName].push_back((TH1*)gDirectory->Get(histoName.c_str()));
gui->styles[gui->histograms[canvasName].back()] = style;
}else{
tcout<<"Histogram "<<histoName<<" does not exist"<<std::endl;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment