Skip to content
Snippets Groups Projects
Commit baf35f43 authored by Eric Pooser's avatar Eric Pooser Committed by Cdaq Account
Browse files

remove creation of root file for monitoring histos

parent 1811adba
No related branches found
No related tags found
No related merge requests found
......@@ -1914,38 +1914,39 @@ void OnlineGUI::PrintPages() {
if(!useJPG) fCanvas->Print(filename+"]");
//
cout << "Writing histograms to root file '" << filename << "'." << endl;
filename.Resize(filename.Last('.'));
filename += ".root";
TFile* hroot = new TFile(filename,"recreate");
UInt_t pageCount = fConfig->GetPageCount();
for (UInt_t iPage=0; iPage<pageCount; ++iPage) {
UInt_t drawCount = fConfig->GetDrawCount(iPage);
for (UInt_t iDraw=0; iDraw<drawCount; ++iDraw) {
TString macro = fConfig->GetDrawCommand(iPage, iDraw).macro;
if (macro != "") {
TString histName = macro.Remove(0, macro.First('\"')+1);
histName.Resize(macro.First('\"'));
fRootFile.RootFile->cd();
TH1F* h1f = dynamic_cast<TH1F*>(gDirectory->Get(histName));
TH2F* h2f = dynamic_cast<TH2F*>(gDirectory->Get(histName));
hroot->cd();
if (h1f) h1f->Write();
else if (h2f) h2f->Write();
else cout << histName << " not found!" << endl;
}
}
}
hroot->Write();
hroot->Close();
delete hroot;
cout << "Root file '" << filename << "' done." << endl;
// filename.Resize(filename.Last('.'));
// filename += ".root";
// TFile* hroot = new TFile(filename,"recreate");
// cout << "Writing histograms to root file '" << filename << "'." << endl;
// UInt_t pageCount = fConfig->GetPageCount();
// for (UInt_t iPage=0; iPage<pageCount; ++iPage) {
// UInt_t drawCount = fConfig->GetDrawCount(iPage);
// for (UInt_t iDraw=0; iDraw<drawCount; ++iDraw) {
// TString macro = fConfig->GetDrawCommand(iPage, iDraw).macro;
// if (macro != "") {
// TString histName = macro.Remove(0, macro.First('\"')+1);
// histName.Resize(macro.First('\"'));
// fRootFile.RootFile->cd();
// TH1F* h1f = dynamic_cast<TH1F*>(gDirectory->Get(histName));
// TH2F* h2f = dynamic_cast<TH2F*>(gDirectory->Get(histName));
// hroot->cd();
// if (h1f) h1f->Write();
// else if (h2f) h2f->Write();
// // else cout << histName << " not found!" << endl;
// }
// }
// }
// hroot->Write();
// hroot->Close();
// delete hroot;
// cout << "Root file '" << filename << "' done." << endl;
//
#ifdef STANDALONE
......
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