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