1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //------------------------------------------------------------------------------
17 // Implementation of abstract AliPerformanceObject class. It keeps information from
18 // comparison of reconstructed and MC particle tracks.
20 // Author: J.Otwinowski 14/04/2008
21 //------------------------------------------------------------------------------
29 #include "TPostScript.h"
34 #include "AliPerformanceObject.h"
38 ClassImp(AliPerformanceObject)
40 //_____________________________________________________________________________
41 AliPerformanceObject::AliPerformanceObject():
42 TNamed("AliPerformanceObject","AliPerformanceObject"),
49 //_____________________________________________________________________________
50 AliPerformanceObject::AliPerformanceObject(const char* name, const char* title):
58 //_____________________________________________________________________________
59 AliPerformanceObject::~AliPerformanceObject(){
63 //_____________________________________________________________________________
64 void AliPerformanceObject::PrintHisto(Bool_t logz, Char_t * outFileName) {
65 // draw all histograms from the folder
66 // and store them in the output *.ps file
69 TFolder *folder = this->GetAnalysisFolder();
71 AliDebug(AliLog::kError, "folder not available");
75 TCanvas *can = new TCanvas("can");
79 const char* suffix=".ps";
81 if(outFileName) sprintf(fname,"%s",outFileName);
82 else sprintf(fname,"%s%s",folder->GetName(),suffix);
84 TPostScript *ps = new TPostScript(fname,112);
85 Printf("Histograms are stored in %s", fname);
86 TIter iter(folder->GetListOfFolders());
91 while ((obj = (TH1*)iter()) !=0) {
102 if(obj->TestBit(TH1::kLogX))
107 if (obj->GetYaxis() && obj->GetZaxis()) {
108 if(logz) gPad->SetLogz();
112 obj->SetMarkerStyle(24);
113 obj->SetMarkerSize(1.0);
117 if ((pad_count%4) == 0) {
121 //printf("count %d \n",count);
128 //_____________________________________________________________________________
129 Double_t * AliPerformanceObject::CreateLogAxis(Int_t nbins, Double_t xmin, Double_t xmax) {
130 // retun pointer to the array with log axis
131 // it is user responsibility to delete the array
133 Double_t logxmin = TMath::Log10(xmin);
134 Double_t logxmax = TMath::Log10(xmax);
135 Double_t binwidth = (logxmax-logxmin)/nbins;
137 Double_t *xbins = new Double_t[nbins+1];
140 for (Int_t i=1;i<=nbins;i++) {
141 xbins[i] = xmin + TMath::Power(10,logxmin+i*binwidth);