Changes in external/ExRootAnalysis/ExRootResult.cc [341014c:cab38f6] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/ExRootAnalysis/ExRootResult.cc
r341014c rcab38f6 12 12 #include "ExRootAnalysis/ExRootUtilities.h" 13 13 14 #include "TROOT.h" 15 #include "TFile.h" 16 #include "TClass.h" 17 #include "TStyle.h" 14 18 #include "TCanvas.h" 15 #include "TClass.h" 16 #include "TFile.h" 17 #include "TFolder.h" 19 #include "TLegend.h" 20 #include "TPaveText.h" 21 #include "TPaveStats.h" 22 #include "TList.h" 18 23 #include "TH2.h" 19 24 #include "THStack.h" 20 #include "TLegend.h" 21 #include "TList.h" 25 #include "TProfile.h" 22 26 #include "TObjArray.h" 23 #include "TPaveStats.h" 24 #include "TPaveText.h" 25 #include "TProfile.h" 26 #include "TROOT.h" 27 #include "TStyle.h" 27 #include "TFolder.h" 28 28 29 29 #include <iostream> … … 37 37 //------------------------------------------------------------------------------ 38 38 39 ExRootResult::ExRootResult() : 40 fCanvas(0), fFolder(0) 39 ExRootResult::ExRootResult() : fCanvas(0), fFolder(0) 41 40 { 42 41 } … … 46 45 ExRootResult::~ExRootResult() 47 46 { 48 set<TObject 47 set<TObject*>::iterator itPool; 49 48 for(itPool = fPool.begin(); itPool != fPool.end(); ++itPool) 50 49 { … … 69 68 TFile *file = new TFile(fileName, "RECREATE"); 70 69 file->cd(); 71 std::map<TObject 70 std::map<TObject*, PlotSettings>::iterator itPlotMap; 72 71 for(itPlotMap = fPlotMap.begin(); itPlotMap != fPlotMap.end(); ++itPlotMap) 73 72 { … … 124 123 // gStyle->SetOptFit(101); 125 124 126 fCanvas = static_cast<TCanvas 125 fCanvas = static_cast<TCanvas*>(gROOT->FindObject("c1")); 127 126 if(fCanvas) 128 127 { … … 155 154 if(!plot) return; 156 155 157 std::map<TObject 156 std::map<TObject*, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot); 158 157 if(itPlotMap != fPlotMap.end()) 159 158 { … … 179 178 if(plot->IsA()->InheritsFrom(TH1::Class())) 180 179 { 181 histogram = static_cast<TH1 182 } 183 184 map<TObject 180 histogram = static_cast<TH1*>(plot); 181 } 182 183 map<TObject*, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot); 185 184 if(itPlotMap != fPlotMap.end()) 186 185 { … … 225 224 TCanvas *canvas = GetCanvas(); 226 225 227 map<TObject 226 map<TObject*, PlotSettings>::iterator itPlotMap; 228 227 229 228 for(itPlotMap = fPlotMap.begin(); itPlotMap != fPlotMap.end(); ++itPlotMap) … … 237 236 if(object->IsA()->InheritsFrom(TH1::Class())) 238 237 { 239 histogram = static_cast<TH1 238 histogram = static_cast<TH1*>(object); 240 239 } 241 240 else if(object->IsA()->InheritsFrom(THStack::Class())) 242 241 { 243 stack = static_cast<THStack 244 histogram = static_cast<TH1 242 stack = static_cast<THStack*>(object); 243 histogram = static_cast<TH1*>(stack->GetHists()->First()); 245 244 } 246 245 … … 272 271 if(histogram) 273 272 { 274 stats = static_cast<TPaveStats 273 stats = static_cast<TPaveStats*>(histogram->FindObject("stats")); 275 274 if(stats) 276 275 { … … 301 300 302 301 TH1 *ExRootResult::AddHist1D(const char *name, const char *title, 303 const char *xlabel, const char *ylabel,304 Int_t nxbins, Axis_t xmin, Axis_t xmax,305 Int_t logx, Int_t logy)302 const char *xlabel, const char *ylabel, 303 Int_t nxbins, Axis_t xmin, Axis_t xmax, 304 Int_t logx, Int_t logy) 306 305 { 307 306 TH1F *hist = new TH1F(name, title, nxbins, xmin, xmax); … … 325 324 326 325 TH1 *ExRootResult::AddHist1D(const char *name, const char *title, 327 const char *xlabel, const char *ylabel,328 Int_t nxbins, const Float_t *bins,329 Int_t logx, Int_t logy)326 const char *xlabel, const char *ylabel, 327 Int_t nxbins, const Float_t *bins, 328 Int_t logx, Int_t logy) 330 329 { 331 330 TH1F *hist = new TH1F(name, title, nxbins, bins); … … 349 348 350 349 TProfile *ExRootResult::AddProfile(const char *name, const char *title, 351 const char *xlabel, const char *ylabel,352 Int_t nxbins, Axis_t xmin, Axis_t xmax,353 Int_t logx, Int_t logy)350 const char *xlabel, const char *ylabel, 351 Int_t nxbins, Axis_t xmin, Axis_t xmax, 352 Int_t logx, Int_t logy) 354 353 { 355 354 TProfile *profile = new TProfile(name, title, nxbins, xmin, xmax); … … 373 372 374 373 TH2 *ExRootResult::AddHist2D(const char *name, const char *title, 375 const char *xlabel, const char *ylabel,376 Int_t nxbins, Axis_t xmin, Axis_t xmax,377 Int_t nybins, Axis_t ymin, Axis_t ymax,378 Int_t logx, Int_t logy)374 const char *xlabel, const char *ylabel, 375 Int_t nxbins, Axis_t xmin, Axis_t xmax, 376 Int_t nybins, Axis_t ymin, Axis_t ymax, 377 Int_t logx, Int_t logy) 379 378 { 380 379 TH2F *hist = new TH2F(name, title, nxbins, xmin, xmax, nybins, ymin, ymax);
Note:
See TracChangeset
for help on using the changeset viewer.