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::DrawHisto(Bool_t logz) {
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";
80 sprintf(fname,"%s%s",folder->GetName(),suffix);
81 TPostScript *ps = new TPostScript(fname,112);
82 Printf("Histograms are stored in %s", fname);
83 TIter iter(folder->GetListOfFolders());
88 while ((obj = (TH1*)iter()) !=0) {
99 if(obj->TestBit(TH1::kLogX))
104 if (obj->GetYaxis() && obj->GetZaxis()) {
105 if(logz) gPad->SetLogz();
109 obj->SetMarkerStyle(24);
110 obj->SetMarkerSize(1.0);
114 if ((pad_count%4) == 0) {
118 //printf("count %d \n",count);
125 //_____________________________________________________________________________
126 Double_t * AliPerformanceObject::CreateLogAxis(Int_t nbins, Double_t xmin, Double_t xmax) {
127 // retun pointer to the array with log axis
128 // it is user responsibility to delete the array
130 Double_t logxmin = TMath::Log10(xmin);
131 Double_t logxmax = TMath::Log10(xmax);
132 Double_t binwidth = (logxmax-logxmin)/nbins;
134 Double_t *xbins = new Double_t[nbins+1];
137 for (Int_t i=1;i<=nbins;i++) {
138 xbins[i] = xmin + TMath::Power(10,logxmin+i*binwidth);