Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/ExRootAnalysis/ExRootResult.cc

    r341014c rcab38f6  
    1212#include "ExRootAnalysis/ExRootUtilities.h"
    1313
     14#include "TROOT.h"
     15#include "TFile.h"
     16#include "TClass.h"
     17#include "TStyle.h"
    1418#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"
    1823#include "TH2.h"
    1924#include "THStack.h"
    20 #include "TLegend.h"
    21 #include "TList.h"
     25#include "TProfile.h"
    2226#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"
    2828
    2929#include <iostream>
     
    3737//------------------------------------------------------------------------------
    3838
    39 ExRootResult::ExRootResult() :
    40   fCanvas(0), fFolder(0)
     39ExRootResult::ExRootResult() : fCanvas(0), fFolder(0)
    4140{
    4241}
     
    4645ExRootResult::~ExRootResult()
    4746{
    48   set<TObject *>::iterator itPool;
     47  set<TObject*>::iterator itPool;
    4948  for(itPool = fPool.begin(); itPool != fPool.end(); ++itPool)
    5049  {
     
    6968  TFile *file = new TFile(fileName, "RECREATE");
    7069  file->cd();
    71   std::map<TObject *, PlotSettings>::iterator itPlotMap;
     70  std::map<TObject*, PlotSettings>::iterator itPlotMap;
    7271  for(itPlotMap = fPlotMap.begin(); itPlotMap != fPlotMap.end(); ++itPlotMap)
    7372  {
     
    124123  // gStyle->SetOptFit(101);
    125124
    126   fCanvas = static_cast<TCanvas *>(gROOT->FindObject("c1"));
     125  fCanvas = static_cast<TCanvas*>(gROOT->FindObject("c1"));
    127126  if(fCanvas)
    128127  {
     
    155154  if(!plot) return;
    156155
    157   std::map<TObject *, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
     156  std::map<TObject*, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
    158157  if(itPlotMap != fPlotMap.end())
    159158  {
     
    179178  if(plot->IsA()->InheritsFrom(TH1::Class()))
    180179  {
    181     histogram = static_cast<TH1 *>(plot);
    182   }
    183 
    184   map<TObject *, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
     180    histogram = static_cast<TH1*>(plot);
     181  }
     182
     183  map<TObject*, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
    185184  if(itPlotMap != fPlotMap.end())
    186185  {
     
    225224  TCanvas *canvas = GetCanvas();
    226225
    227   map<TObject *, PlotSettings>::iterator itPlotMap;
     226  map<TObject*, PlotSettings>::iterator itPlotMap;
    228227
    229228  for(itPlotMap = fPlotMap.begin(); itPlotMap != fPlotMap.end(); ++itPlotMap)
     
    237236    if(object->IsA()->InheritsFrom(TH1::Class()))
    238237    {
    239       histogram = static_cast<TH1 *>(object);
     238      histogram = static_cast<TH1*>(object);
    240239    }
    241240    else if(object->IsA()->InheritsFrom(THStack::Class()))
    242241    {
    243       stack = static_cast<THStack *>(object);
    244       histogram = static_cast<TH1 *>(stack->GetHists()->First());
     242      stack = static_cast<THStack*>(object);
     243      histogram = static_cast<TH1*>(stack->GetHists()->First());
    245244    }
    246245
     
    272271    if(histogram)
    273272    {
    274       stats = static_cast<TPaveStats *>(histogram->FindObject("stats"));
     273      stats = static_cast<TPaveStats*>(histogram->FindObject("stats"));
    275274      if(stats)
    276275      {
     
    301300
    302301TH1 *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)
    306305{
    307306  TH1F *hist = new TH1F(name, title, nxbins, xmin, xmax);
     
    325324
    326325TH1 *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)
    330329{
    331330  TH1F *hist = new TH1F(name, title, nxbins, bins);
     
    349348
    350349TProfile *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)
    354353{
    355354  TProfile *profile = new TProfile(name, title, nxbins, xmin, xmax);
     
    373372
    374373TH2 *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)
    379378{
    380379  TH2F *hist = new TH2F(name, title, nxbins, xmin, xmax, nybins, ymin, ymax);
Note: See TracChangeset for help on using the changeset viewer.