ROOT logo
// $Id: THealPainter.cxx,v 1.11 2009/04/18 05:52:36 oxon Exp $
// Author: Akira Okumura 2008/07/07

/*****************************************************************************
   Copyright (C) 2008-, Akira Okumura
   All rights reserved.
******************************************************************************/

#include <float.h>

#include "Healoption.h"
#include "Hparam.h"
#include "TClass.h"
#include "TColor.h"
#include "TCrown.h"
#include "TCutG.h"
#include "TGaxis.h"
#include "TGraphDelaunay.h"
#include "TF1.h"
#include "TLatex.h"
#include "TMath.h"
#include "TPad.h"
#include "TPainter3dAlgorithms.h"
#include "TPaveText.h"
#include "TROOT.h"
#include "TStyle.h"
#include "TText.h"
#include "TVirtualPadEditor.h"

#include "THealPix.h"
#include "THealPainter.h"
#include "THealPaletteAxis.h"

static THealPix* gCurrentHeal = 0;

static Healoption_t Healoption;
static Hparam_t  Healparam;

static const Int_t kNMAX = 2000;
static const Double_t d2r = TMath::DegToRad();

ClassImp(THealPainter)

//______________________________________________________________________________
THealPainter::THealPainter()
{
  fHeal  = 0;
  fXaxis = 0;
  fYaxis = 0;
  fZaxis = 0;
  fFunctions = 0;
}

//______________________________________________________________________________
THealPainter::~THealPainter()
{
}

//______________________________________________________________________________
Int_t THealPainter::DistancetoPrimitive(Int_t px, Int_t py)
{
  return 0;
}

//______________________________________________________________________________
void THealPainter::DrawPanel()
{
  gCurrentHeal = fHeal;
  if(!gPad){
    Error("DrawPanel", "need to draw HEALPix first");
    return;
  } // if
  TVirtualPadEditor* editor = TVirtualPadEditor::GetPadEditor();
  editor->Show();
  gROOT->ProcessLine(Form("((TCanvas*)0x%lx)->Selected((TVirtualPad*)0x%lx, (TObject*)0x%lx, 1)", gPad->GetCanvas(), gPad, fHeal));
}

//______________________________________________________________________________
void THealPainter::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
}

//______________________________________________________________________________
TList* THealPainter::GetContourList(Double_t contour) const
{
  TGraphDelaunay* dt;
  
  // Check if fHeal contains a TGraphDelaunay
  TList* hl = fHeal->GetListOfFunctions();
  dt = (TGraphDelaunay*)hl->FindObject("TGraphDelaunay");
  if(!dt) return 0;
  /*
  gCurrentHeal = fHeal;
  
  if(!fGraph2DPainter) ((THistPainter*)this)->fGraph2DPainter = new TGraph2DPainter(dt);
  
  return fGraph2DPainter->GetContourList(contour);
  */
  return 0;
}

//______________________________________________________________________________
Bool_t THealPainter::IsInside(Int_t bin /*ix*/, Int_t /*iy*/)
{
  for (Int_t i=0;i<fNcuts;i++) {
    Double_t x, y;
    fHeal->GetBinCenter(bin, x, y);
    if(!fHeal->IsDegree()){
      x *= TMath::RadToDeg();
      y *= TMath::RadToDeg();
    } // if
    if(Healoption.System == kGalactic || Healoption.System == kLatLong){
      x -= 180;
      y = 90 - y;
    } else if(Healoption.System == kCelestial){
      y = 90 - y;
    } // if

    if (fCutsOpt[i] > 0) {
      if (!fCuts[i]->IsInside(x,y)) return kFALSE;
    } else {
      if (fCuts[i]->IsInside(x,y))  return kFALSE;
    }
  }
  return kTRUE;
}

//______________________________________________________________________________
Bool_t THealPainter::IsInside(Double_t x, Double_t y)
{
  for(Int_t i = 0; i < fNcuts; i++){
    if(fCutsOpt[i] > 0){
      if(!fCuts[i]->IsInside(x,y)) return kFALSE;
    } else {
      if(fCuts[i]->IsInside(x,y))  return kFALSE;
    } // if
  } // if
  return kTRUE;
}

//______________________________________________________________________________
Int_t THealPainter::MakeChopt(Option_t* choptin)
{
  if(gPad->GetLogx() || gPad->GetLogy()){
    Error("MakeChopt", "logarithmic X/Y axis is not supported.");
  } // if

  char *l;
  char chopt[128];
  Int_t nch = strlen(choptin);
  strcpy(chopt,choptin);
  
  Healoption.Axis = Healoption.Heal    = Healoption.Same    = Healoption.Func =
  Healoption.Scat = Healoption.Color   = Healoption.Contour = Healoption.Logz =
  Healoption.Lego = Healoption.Surf    = Healoption.Off     = Healoption.Tri  =
  Healoption.AxisPos = Healoption.Box = 0;
  
  //    special 2D options
  Healoption.List     = 0;
  Healoption.Zscale   = 0;
  Healoption.FrontBox = 1;
  Healoption.BackBox  = 1;
  Healoption.System   = kThetaPhi;
  Healoption.Proj     = kEquirect;
  Healoption.Xinv     = 0;
  Healoption.Yinv     = 0;
  
  Healoption.HighRes  = 0;
  
  Healoption.Zero     = 0;
  
  //check for graphical cuts
  MakeCuts(chopt);
  
  for (Int_t i = 0;i < nch; i++) chopt[i] = toupper(chopt[i]);
  Healoption.Scat = 1;
  if(!nch) Healoption.Heal = 1;
  if(fFunctions->First()) Healoption.Func = 2;
  
  l = strstr(chopt,"GL");
  if (l) {
    strncpy(l,"  ",2);
  }
  l = strstr(chopt,"X+");
  if (l) {
    Healoption.AxisPos = 10;
    strncpy(l,"  ",2);
  }
  l = strstr(chopt,"Y+");
  if (l) {
    Healoption.AxisPos += 1;
    strncpy(l,"  ",2);
  }
  if((Healoption.AxisPos == 10 || Healoption.AxisPos == 1) && (nch == 2)) Healoption.Heal = 1;
  if(Healoption.AxisPos == 11 && nch == 4) Healoption.Heal = 1;
  
  // Coordinate options
  l = strstr(chopt, "THETAPHI");
  if(l){
    if(nch == 8) Healoption.Heal = 1;
    Healoption.System = kThetaPhi;
    strncpy(l, "        ", 8);
  } // if
  l = strstr(chopt, "GALACTIC");
  if(l){
    if(nch == 8) Healoption.Heal = 1;
    Healoption.System = kGalactic;
    strncpy(l, "        ", 8);
  } // if
  l = strstr(chopt, "CELESTIAL");
  if(l){
    if(nch == 9) Healoption.Heal = 1;
    Healoption.System = kCelestial;
    strncpy(l, "         ", 9);
  } // if
  l = strstr(chopt, "LATLONG");
  if(l){
    if(nch == 7) Healoption.Heal = 1;
    Healoption.System = kLatLong;
    strncpy(l, "       ", 7);
  } // if

  // Projection options
  l = strstr(chopt, "EQUIRECT");
  if(l){
    if(nch == 8) Healoption.Heal = 1;
    Healoption.Proj = kEquirect;
    strncpy(l, "        ", 8);
  } // if
  l = strstr(chopt, "HAMMER");
  if(l){
    if(nch == 6) Healoption.Heal = 1;
    Healoption.Proj = kHammer;
    strncpy(l, "      ", 6);
  } // if
  l = strstr(chopt, "LAMBERT1");
  if(l){
    if(nch == 8) Healoption.Heal = 1;
    Healoption.Proj = kLambert;
    strncpy(l, "        ", 8);
  } // if
  l = strstr(chopt, "LAMBERT2");
  if(l){
    if(nch == 8) Healoption.Heal = 1;
    Healoption.Proj = kLambert + 10;
    strncpy(l, "        ", 8);
  } // if
  l = strstr(chopt, "LAMBERT");
  if(l){
    if(nch == 7) Healoption.Heal = 1;
    Healoption.Proj = kLambert;
    strncpy(l, "       ", 7);
  } // if
  l = strstr(chopt, "POLAR1");
  if(l){
    if(nch == 6) Healoption.Heal = 1;
    Healoption.Proj = kPolar;
    strncpy(l, "      ", 6);
  } // if
  l = strstr(chopt, "POLAR2");
  if(l){
    if(nch == 6) Healoption.Heal = 1;
    Healoption.Proj = kPolar + 10;
    strncpy(l, "      ", 6);
  } // if
  l = strstr(chopt, "POLAR");
  if(l){
    if(nch == 5) Healoption.Heal = 1;
    Healoption.Proj = kPolar;
    strncpy(l, "     ", 5);
  } // if

  // Inversed plot option
  l = strstr(chopt, "XINV");
  if(l){
    if(nch == 4) Healoption.Heal = 1;
    Healoption.Xinv = 1;
    strncpy(l, "    ", 4);
  } // if
  l = strstr(chopt, "YINV");
  if(l){
    if(nch == 4) Healoption.Heal = 1;
    Healoption.Yinv = 1;
    strncpy(l, "    ", 4);
  } // if

  l = strstr(chopt,"SAMES");
  if (l) {
    if (nch == 5) Healoption.Heal = 1;
    Healoption.Same = 2;
    strncpy(l,"     ",5);
  }
  l = strstr(chopt,"SAME");
  if (l) {
    if (nch == 4) Healoption.Heal = 1;
    Healoption.Same = 1;
    strncpy(l,"    ",4);
  }
  l = strstr(chopt,"LEGO");
  if (l) {
    Healoption.Scat = 0;
    Healoption.Lego = 1; strncpy(l,"    ",4);
    if (l[4] == '1') { Healoption.Lego = 11; l[4] = ' '; }
    if (l[4] == '2') { Healoption.Lego = 12; l[4] = ' '; }
    l = strstr(chopt,"FB"); if (l) { Healoption.FrontBox = 0; strncpy(l,"  ",2); }
    l = strstr(chopt,"BB"); if (l) { Healoption.BackBox = 0;  strncpy(l,"  ",2); }
    l = strstr(chopt,"0");  if (l) { Healoption.Zero = 1;  strncpy(l," ",1); }
  }
  
  l = strstr(chopt,"SURF");
  if (l) {
    Healoption.Scat = 0;
    Healoption.Surf = 1; strncpy(l,"    ",4);
    if (l[4] == '1') { Healoption.Surf = 11; l[4] = ' '; }
    if (l[4] == '2') { Healoption.Surf = 12; l[4] = ' '; }
    if (l[4] == '3') { Healoption.Surf = 13; l[4] = ' '; }
    if (l[4] == '4') { Healoption.Surf = 14; l[4] = ' '; }
    if (l[4] == '5') { Healoption.Surf = 15; l[4] = ' '; }
    if (l[4] == '6') { Healoption.Surf = 16; l[4] = ' '; }
    l = strstr(chopt,"FB");   if (l) { Healoption.FrontBox = 0; strncpy(l,"  ",2); }
    l = strstr(chopt,"BB");   if (l) { Healoption.BackBox = 0;  strncpy(l,"  ",2); }
  }
  
  l = strstr(chopt,"LIST");    if (l) { Healoption.List = 1;  strncpy(l,"    ",4);}
  
  l = strstr(chopt,"CONT");
  if (l) {
    Healoption.Scat = 0;
    Healoption.Contour = 1; strncpy(l,"    ",4);
    if (l[4] == '1') { Healoption.Contour = 11; l[4] = ' '; }
    if (l[4] == '2') { Healoption.Contour = 12; l[4] = ' '; }
    if (l[4] == '3') { Healoption.Contour = 13; l[4] = ' '; }
    if (l[4] == '4') { Healoption.Contour = 14; l[4] = ' '; }
    if (l[4] == '5') { Healoption.Contour = 15; l[4] = ' '; }
  }
  l = strstr(chopt,"BOX" ); if (l) { Healoption.Box    = 1; strncpy(l,"   ",3); }
  l = strstr(chopt,"COLZ"); if (l) { Healoption.Color  = 2; strncpy(l,"    ",4); Healoption.Scat = 0; Healoption.Zscale = 1;}
  l = strstr(chopt,"COL" ); if (l) { Healoption.Color  = 1; strncpy(l,"   ", 3); Healoption.Scat = 0; }
  l = strstr(chopt,"FUNC"); if (l) { Healoption.Func   = 2; strncpy(l,"    ",4); Healoption.Heal = 0; }
  l = strstr(chopt,"HEAL"); if (l) { Healoption.Heal   = 2; strncpy(l,"    ",4); Healoption.Func = 0;}
  l = strstr(chopt,"AXIS"); if (l) { Healoption.Axis   = 1; strncpy(l,"    ",4); }
  l = strstr(chopt,"AXIG"); if (l) { Healoption.Axis   = 2; strncpy(l,"    ",4); }
  l = strstr(chopt,"SCAT"); if (l) { Healoption.Scat   = 1; strncpy(l,"    ",4); }
  
  if (strstr(chopt,"A"))   Healoption.Axis = -1;
  if (strstr(chopt,"][")) {Healoption.Off  =1; Healoption.Heal =1;}
  if (strstr(chopt,"Z"))   Healoption.Zscale =1;
  if (strstr(chopt,"H"))   Healoption.Heal =2;
  if (strstr(chopt,"9"))  Healoption.HighRes = 1;
  
  if (Healoption.Surf == 15) {
    if (Healoption.System == kPOLAR || Healoption.System == kCARTESIAN) {
      Healoption.Surf = 13;
      Warning("MakeChopt","option SURF5 is not supported in Cartesian and Polar modes");
    }
  }
  
  //      Copy options from current style
  Healoption.Logz = gPad->GetLogz(); // Z only
  
  //       Check options incompatibilities

  return 1;
}

//______________________________________________________________________________
Int_t THealPainter::MakeCuts(char* choptin)
{
  fNcuts = 0;
  char *left = (char*)strchr(choptin,'[');
  if (!left) return 0;
  char *right = (char*)strchr(choptin,']');
  if (!right) return 0;
  Int_t nch = right-left;
  if (nch < 2) return 0;
  char *cuts = left+1;
  *right = 0;
  char *comma, *minus;
  Int_t i;
  while(1) {
    comma = strchr(cuts,',');
    if (comma) *comma = 0;
    minus = strchr(cuts,'-');
    if (minus) cuts = minus+1;
    while (*cuts == ' ') cuts++;
    Int_t nc = strlen(cuts);
    while (cuts[nc-1] == ' ') {cuts[nc-1] = 0; nc--;}
    TIter next(gROOT->GetListOfSpecials());
    TCutG *cut=0;
    TObject *obj;
    while ((obj = next())) {
      if (!obj->InheritsFrom(TCutG::Class())) continue;
      if (strcmp(obj->GetName(),cuts)) continue;
      cut = (TCutG*)obj;
      break;
    }
    if (cut) {
      fCuts[fNcuts] = cut;
      fCutsOpt[fNcuts] = 1;
      if (minus) fCutsOpt[fNcuts] = -1;
      fNcuts++;
    }
    if (!comma) break;
    cuts = comma+1;
  }
  for (i=0;i<=nch;i++) left[i] = ' ';
  return fNcuts;
}

//______________________________________________________________________________
void THealPainter::Paint(Option_t* option)
{
  // Paint HEALPix
  //
  // List of Options:
  // "COL"  Colored polygon is drawn at each bin.
  // "COLZ" Same as "COL". In addition color palette is drawn.
  // "A" Suppress the axis
  // "SAME" Superimpose on previous picture in the same pad.
  //
  // "EQUIRECT" Use equirect projection. (default)
  // "POLAR1" Use polar projection viewed from the zenith. +X and +Y are phi=0
  //          and phi=90 respectively.
  // "POLAR2" Use polar projection viewed from the nadir. +X and +Y are phi=0
  //          and phi=90 respectively.
  // "POLAR"  Same as "POLAR1"
  // "LAMBERT1" User Lambert-azimuthal projection viewed from the zenith.
  // "LAMBERT2" User Lambert-azimuthal projection viewed from the nadir.
  // "LAMBERT"  Same as "LAMBERT1"
  // "HAMMER" Use Hammer-Aitoff projecton.
  //
  // "THETAPHI"  The range of X/Y axes are set to (0, 360)/(0, 180) (default)
  // "GALACTIC"  The range of X/Y axes are set to (-180, 180)/(-90, 90)
  // "CELESTIAL" The range of X/Y axes are set to (0, 360)/(-90, 90)
  // "LATLONG"   The range of X/Y axes are set to (-180, 180)/(-90, 90)
  //
  // "XDIV" Draw the contents inverted along to X axis
  // "YDIV" Draw the contents inverted along to Y axis

  THealPix* oldheal = gCurrentHeal;
  gCurrentHeal = fHeal;
  THealPix* healsave = fHeal;

  Double_t minsav = fHeal->GetMinimumStored();

  if(!MakeChopt(option)){
    return;
  } // if

  if(Healoption.Proj%10 == kLambert || Healoption.Proj%10 == kPolar){
    fXaxis->Set(1, -180., 180.);
    fYaxis->Set(1, -180., 180.);
  } else {
    if(Healoption.System == kThetaPhi){
      fXaxis->Set(1, 0., 360.);
      fYaxis->Set(1, 0., 180.);
    } else if(Healoption.System == kGalactic || Healoption.System == kLatLong){
      fXaxis->Set(1, -180., 180.);
      fYaxis->Set(1, -90., 90.);
    } else if(Healoption.System == kCelestial){
      fXaxis->Set(1, 0., 360.);
      fYaxis->Set(1, -90., 90.);
    } // if
  } // if

  fXbuf = new Double_t[kNMAX];
  fYbuf = new Double_t[kNMAX];

  TView* view = gPad->GetView();
  if(view){
    if(!Healoption.Lego && !Healoption.Surf && !Healoption.Tri){
      delete view;
      gPad->SetView(0);
    } // if
  } // if

  PaintTable(option);
  fHeal->SetMinimum(minsav);
  if(Healoption.Func){
    Healoption_t hoptsave = Healoption;
    Hparam_t  hparsave = Healparam;
    PaintFunction(option);
    SetHealPix(healsave);
    Healoption = hoptsave;
    Healparam  = hparsave;
  }
  gCurrentHeal = oldheal;
  
  delete [] fXbuf;
  delete [] fYbuf;
}

//______________________________________________________________________________
void THealPainter::PaintAxis(Bool_t drawGridOnly)
{
  if(Healoption.Axis == -1){
    return;
  } // if
  if(Healoption.Same && Healoption.Axis <= 0){
    return;
  } // if
  
  static char chopt[10] = "";
  Double_t gridl = 0;
  Int_t ndiv, ndivsave;
  Int_t useHealparam = 0;
  Double_t umin, umax, uminsave, umaxsave;
  Short_t xAxisPos = Healoption.AxisPos/10;
  Short_t yAxisPos = Healoption.AxisPos - 10*xAxisPos;
  
  Double_t axmin = gPad->GetUxmin();
  Double_t axmax = gPad->GetUxmax();
  Double_t aymin = gPad->GetUymin();
  Double_t aymax = gPad->GetUymax();
  char* cw = 0;
  TGaxis axis;
  
  // In case of option 'cont4' or in case of option 'same' over a 'cont4 plot'
  // Healparam must be use for the axis limits.
  if(Healoption.Contour == 14){
    useHealparam = 1;
  } // if
  if(Healoption.Same){
    TObject *obj;
    TIter next(gPad->GetListOfPrimitives());
    while((obj = next())){
      if(strstr(obj->GetDrawOption(), "cont4")){
	useHealparam = 1;
 	break;
      } // if
    } // while
  } // if
  
   // Paint X axis
   Int_t ndivx = fXaxis->GetNdivisions();
   if (ndivx > 1000) {
      Int_t nx2   = ndivx/100;
      Int_t nx1   = TMath::Max(1, ndivx%100);
      ndivx = 100*nx2 + Int_t(Float_t(nx1)*gPad->GetAbsWNDC());
   }
   axis.SetTextAngle(0);
   axis.ImportAxisAttributes(fXaxis);

   chopt[0] = 0;
   strcat(chopt, "SDH");
   if (ndivx < 0) strcat(chopt, "N");
   if (gPad->GetGridx()) {
      gridl = (aymax-aymin)/(gPad->GetY2() - gPad->GetY1());
      strcat(chopt, "W");
   }

   // Define X-Axis limits
   ndiv = TMath::Abs(ndivx);
   if (useHealparam) {
     umin = Healparam.xmin;
     umax = Healparam.xmax;
   } else {
     umin = axmin;
     umax = axmax;
   }

   // Display axis as time
   if (fXaxis->GetTimeDisplay()) {
      strcat(chopt,"t");
      if (strlen(fXaxis->GetTimeFormatOnly()) == 0) {
         axis.SetTimeFormat(fXaxis->ChooseTimeFormat(Healparam.xmax-Healparam.xmin));
      }
   }

   // The main X axis can be on the bottom or on the top of the pad
   Double_t xAxisYPos1, xAxisYPos2;
   if (xAxisPos == 1) {
      // Main X axis top
      xAxisYPos1 = aymax;
      xAxisYPos2 = aymin;
   } else {
      // Main X axis bottom
      xAxisYPos1 = aymin;
      xAxisYPos2 = aymax;
   }

   // Paint the main X axis (always)
   uminsave = umin;
   umaxsave = umax;
   ndivsave = ndiv;
   axis.SetOption(chopt);
   if (xAxisPos) {
      strcat(chopt, "-");
      gridl = -gridl;
   }
   axis.PaintAxis(axmin, xAxisYPos1,
                  axmax, xAxisYPos1,
                  umin, umax,  ndiv, chopt, gridl, drawGridOnly);

   // Paint additional X axis (if needed)
   if (gPad->GetTickx()) {
      if (xAxisPos) {
         cw=strstr(chopt,"-");
         *cw='z';
      } else {
         strcat(chopt, "-");
      }
      if (gPad->GetTickx() < 2) strcat(chopt, "U");
      if ((cw=strstr(chopt,"W"))) *cw='z';
      axis.SetTitle("");
      axis.PaintAxis(axmin, xAxisYPos2,
                     axmax, xAxisYPos2,
                     uminsave, umaxsave,  ndivsave, chopt, gridl, drawGridOnly);
   }

   // Paint Y axis
   Int_t ndivy = fYaxis->GetNdivisions();
   axis.ImportAxisAttributes(fYaxis);

   chopt[0] = 0;
   strcat(chopt, "SDH");
   if (ndivy < 0) strcat(chopt, "N");
   if (gPad->GetGridy()) {
      gridl = (axmax-axmin)/(gPad->GetX2() - gPad->GetX1());
      strcat(chopt, "W");
   }

   // Define Y-Axis limits
   ndiv = TMath::Abs(ndivy);
   if (useHealparam) {
     umin = Healparam.ymin;
     umax = Healparam.ymax;
   } else {
     umin = aymin;
     umax = aymax;
   }

   // Display axis as time
   if (fYaxis->GetTimeDisplay()) {
      strcat(chopt,"t");
      if (strlen(fYaxis->GetTimeFormatOnly()) == 0) {
         axis.SetTimeFormat(fYaxis->ChooseTimeFormat(Healparam.ymax-Healparam.ymin));
      }
   }

   // The main Y axis can be on the left or on the right of the pad
   Double_t yAxisXPos1, yAxisXPos2;
   if (yAxisPos == 1) {
      // Main Y axis left
      yAxisXPos1 = axmax;
      yAxisXPos2 = axmin;
   } else {
      // Main Y axis right
      yAxisXPos1 = axmin;
      yAxisXPos2 = axmax;
   }

   // Paint the main Y axis (always)
   uminsave = umin;
   umaxsave = umax;
   ndivsave = ndiv;
   axis.SetOption(chopt);
   if (yAxisPos) {
      strcat(chopt, "+L");
      gridl = -gridl;
   }
   axis.PaintAxis(yAxisXPos1, aymin,
                  yAxisXPos1, aymax,
                  umin, umax,  ndiv, chopt, gridl, drawGridOnly);

   // Paint the additional Y axis (if needed)
   if (gPad->GetTicky()) {
      if (gPad->GetTicky() < 2) {
         strcat(chopt, "U");
         axis.SetTickSize(-fYaxis->GetTickLength());
      } else {
         strcat(chopt, "+L");
      }
      if ((cw=strstr(chopt,"W"))) *cw='z';
      axis.SetTitle("");
      axis.PaintAxis(yAxisXPos2, aymin,
                     yAxisXPos2, aymax,
                     uminsave, umaxsave,  ndivsave, chopt, gridl, drawGridOnly);
   }

  /*
  // Paint X axis
  Int_t ndivx = fXaxis->GetNdivisions();
  if (ndivx > 1000) {
    Int_t nx2   = ndivx/100;
    Int_t nx1   = TMath::Max(1, ndivx%100);
    ndivx = 100*nx2 + Int_t(Float_t(nx1)*gPad->GetAbsWNDC());
  }
  axis.SetTextAngle(0);
  axis.ImportAxisAttributes(fXaxis);
  
  chopt[0] = 0;
  if(Healoption.System == kThetaPhi || Healoption.System == kLatLong){
    strcat(chopt, "SDHR+");
  } else {
    strcat(chopt, "SDHL-");
    axis.SetLabelOffset(-TMath::Abs(axis.GetLabelOffset()));
  } // if
  if(ndivx < 0){
    strcat(chopt, "N");
  } // if
  if(gPad->GetGridx()){
    if(Healoption.System == kThetaPhi || Healoption.System == kLatLong){
      gridl = (aymax - aymin)/(gPad->GetY2() - gPad->GetY1());
    } else {
      gridl = -(aymax - aymin)/(gPad->GetY2() - gPad->GetY1());
    } // if
    strcat(chopt, "W");
  } // if
  
  // Define X-Axis limits
  ndiv = TMath::Abs(ndivx);
  if(useHealparam){
    umin = Healparam.xmin;
    umax = Healparam.xmax;
  } else {
    umin = axmin;
    umax = axmax;
  } // if
  
  // The main X axis can be on the bottom or on the top of the pad
  Double_t xAxisYPos1, xAxisYPos2;
  if(xAxisPos == 1){
    // Main X axis top
    xAxisYPos1 = aymax;
    xAxisYPos2 = aymin;
  } else {
    // Main X axis bottom
    xAxisYPos1 = aymin;
    xAxisYPos2 = aymax;
  } // if
  
  // Paint the main X axis (always)
  uminsave = umin;
  umaxsave = umax;
  ndivsave = ndiv;
  axis.SetOption(chopt);
  if(xAxisPos){
    if(Healoption.System == kThetaPhi || Healoption.System == kLatLong){
      strcat(chopt, "R+");
    } else {
      char* c = strstr(chopt, "R+");
      if(c) strncpy(c, "  ", 2);
      strcat(chopt, "L-");
      axis.SetLabelOffset(-TMath::Abs(axis.GetLabelOffset()));
    } // if
    gridl = -gridl;
  } // if
  if(Healoption.System == kThetaPhi || Healoption.System == kLatLong){
    axis.PaintAxis(axmin, xAxisYPos1, axmax, xAxisYPos1,
		   umin, umax,  ndiv, chopt, gridl, drawGridOnly);
  } else {
    axis.PaintAxis(axmax, xAxisYPos1, axmin, xAxisYPos1,
		   umin, umax,  ndiv, chopt, gridl, drawGridOnly);
  } // if
  
  // Paint additional X axis (if needed)
  if(gPad->GetTickx()){
    if(xAxisPos){
      cw = strstr(chopt,"-");
      *cw = 'z';
    } else {
      strcat(chopt, "-");
    } // if
    if(gPad->GetTickx() < 2){
      strcat(chopt, "U");
    } // if
    if((cw=strstr(chopt,"W"))){
      *cw='z';
    } // if
    axis.SetTitle("");
    axis.PaintAxis(axmin, xAxisYPos2, axmax, xAxisYPos2,
		   uminsave, umaxsave, ndivsave, chopt, gridl, drawGridOnly);
  }
  printf("%s\n", chopt);
  // Paint Y axis
  Int_t ndivy = fYaxis->GetNdivisions();
  axis.ImportAxisAttributes(fYaxis);
  axis.SetLabelOffset(-axis.GetLabelOffset());

  chopt[0] = 0;
  strcat(chopt, "SDHR+");
  if(ndivy < 0){
    strcat(chopt, "N");
  } // if
  if(gPad->GetGridy()){
    gridl = (axmax - axmin)/(gPad->GetX2() - gPad->GetX1());
    strcat(chopt, "W");
  } // if
  
  // Define Y-Axis limits
  ndiv = TMath::Abs(ndivy);
  if(useHealparam){
    umin = Healparam.ymin;
    umax = Healparam.ymax;
  } else {
    umin = aymin;
    umax = aymax;
  } // if
  
  // Display axis as time
  if(fYaxis->GetTimeDisplay()){
    strcat(chopt, "t");
    if(strlen(fYaxis->GetTimeFormatOnly()) == 0){
      axis.SetTimeFormat(fYaxis->ChooseTimeFormat(Healparam.ymax - Healparam.ymin));
    } // if
  } // if
  
  // The main Y axis can be on the left or on the right of the pad
  Double_t yAxisXPos1, yAxisXPos2;
  if(yAxisPos == 1){
    // Main Y axis left
    yAxisXPos1 = axmax;
    yAxisXPos2 = axmin;
  } else {
    // Main Y axis right
    yAxisXPos1 = axmin;
    yAxisXPos2 = axmax;
  } // if

  // Paint the main Y axis (always)
  uminsave = umin;
  umaxsave = umax;
  ndivsave = ndiv;
  axis.SetOption(chopt);
  if(yAxisPos){
    char* c = strstr(chopt, "R+");
    if(c) strncpy(c, "  ", 2);
    strcat(chopt, "L-");
    axis.SetLabelOffset(-axis.GetLabelOffset());
    gridl = -gridl;
  } // if

  axis.PaintAxis(yAxisXPos1, aymax, yAxisXPos1 - 1e-3, aymin,
		 umin, umax,  ndiv, chopt, gridl, drawGridOnly);
  
  // Paint the additional Y axis (if needed)
  if(gPad->GetTicky()){
    if(gPad->GetTicky() < 2){
      strcat(chopt, "U");
      axis.SetTickSize(-fYaxis->GetTickLength());
    } else {
      strcat(chopt, "-L");
    } // if
    if((cw=strstr(chopt,"W"))){
      *cw='z';
    } // if
    axis.SetTitle("");
    axis.PaintAxis(yAxisXPos2, aymax, yAxisXPos2 - 1e-3, aymin,
		   uminsave, umaxsave,  ndivsave, chopt, gridl, drawGridOnly);
  } // if
  printf("%s\n", chopt);
  */
}

//______________________________________________________________________________
void THealPainter::PaintColorLevels(Option_t* option)
{
  Double_t zmin = fHeal->GetMinimum();
  Double_t zmax = fHeal->GetMaximum();
  if(Healoption.Logz){
    if(zmin > 0){
      zmin = TMath::Log10(zmin);
      zmax = TMath::Log10(zmax);
    } else {
      return;
    } // if
  } // if
  
  Double_t dz = zmax - zmin;
  
  if(dz <= 0){
    return;
  } // if

  Style_t fillsav = fHeal->GetFillStyle();
  Style_t colsav  = fHeal->GetFillColor();
  fHeal->SetFillStyle(1001);
  fHeal->TAttFill::Modify();
  
  // Initialize the levels on the Z axis
  Int_t ncolors = gStyle->GetNumberOfColors();
  Int_t ndiv = fHeal->GetContour();
  if(ndiv == 0){
    ndiv = gStyle->GetNumberContours();
    fHeal->SetContour(ndiv);
  } // if
  Int_t ndivz = TMath::Abs(ndiv);
  if(fHeal->TestBit(THealPix::kUserContour) == 0){
    fHeal->SetContour(ndiv);
  } // if
  Double_t scale = ndivz/dz;
  
  Int_t color;
  Double_t xmin = gPad->GetUxmin();
  Double_t xmax = gPad->GetUxmax();
  Double_t ymin = gPad->GetUymin();
  Double_t ymax = gPad->GetUymax();

  for(Int_t bin = 0; bin < fHeal->GetNpix(); bin++){
    Double_t z = fHeal->GetBinContent(bin);
    if(z == 0 && (zmin >= 0 || Healoption.Logz)){
      continue; // don't draw the empty bins for histograms with positive content
    } // if
    if(Healoption.Logz){
      z = z > 0 ? TMath::Log10(z) : zmin;
    } // if
    if(z < zmin){
      continue;
    } // if

    Int_t n;
    Double_t x[5], y[5], xdiv[5], ydiv[5];
    Bool_t used[5];
    Bool_t divided = false;

    if(!Vertices(bin, n, x, y, xdiv, ydiv, used, divided, xmin, xmax, ymin, ymax)){
      continue;
    } // if

    if(fHeal->TestBit(THealPix::kUserContour)){
      Double_t zc = fHeal->GetContourLevelPad(0);
      if (z < zc) continue;
      color = -1;
      for(Int_t k = 0; k < ndiv; k++){
	zc = fHeal->GetContourLevelPad(k);
	if(z < zc){
	  continue;
	} else {
	  color++;
	} // if
      } // k
    } else {
      color = Int_t(0.01 + (z - zmin)*scale);
    } // if
    
    Int_t theColor = Int_t((color + 0.99)*Float_t(ncolors)/Float_t(ndivz));
    if(theColor > ncolors - 1){
      theColor = ncolors - 1;
    } // if
 
    fHeal->SetFillColor(gStyle->GetColorPalette(theColor));
    fHeal->TAttFill::Modify();
    gPad->PaintFillArea(n, x, y);
    if(divided) gPad->PaintFillArea(n, xdiv, ydiv);
  } // bin
  
  if(Healoption.Zscale){
    PaintPalette();
  } // if
  
  fHeal->SetFillStyle(fillsav);
  fHeal->SetFillColor(colsav);
  fHeal->TAttFill::Modify();
}

//______________________________________________________________________________
void THealPainter::PaintBoxes(Option_t* option)
{
  Double_t xmin = gPad->GetUxmin();
  Double_t xmax = gPad->GetUxmax();
  Double_t ymin = gPad->GetUymin();
  Double_t ymax = gPad->GetUymax();
  
  Double_t zmin = fHeal->GetMinimum();
  Double_t zmax = fHeal->GetMaximum();
  
  if(Healoption.Logz){
    if(zmin > 0){
      zmin = TMath::Log10(zmin*0.1);
      zmax = TMath::Log10(zmax);
    } else {
      return;
    } // if
  } else {
    zmax = TMath::Max(TMath::Abs(zmin), TMath::Abs(zmax));
    zmin = 0;
  } // if

  // In case of option SAME, zmin and zmax values are taken from the
  // first plotted 2D histogram.
  if(Healoption.Same){
    THealPix* heal;
    TIter next(gPad->GetListOfPrimitives());
    while((heal = (THealPix*)next())) {
      if(!heal->InheritsFrom(THealPix::Class())) continue;
      zmin = heal->GetMinimum();
      zmax = heal->GetMaximum();
      if(Healoption.Logz){
	zmax = TMath::Log10(zmax);
	if(zmin <= 0){
	  zmin = TMath::Log10(zmax*0.001);
	} else {
	  zmin = TMath::Log10(zmin);
	} // if
      } // if
      break;
    } // while
  } // if

  Double_t zratio, dz = zmax - zmin;
  
  for(Int_t bin = 0; bin < fHeal->GetNpix(); bin++){
    Double_t z = fHeal->GetBinContent(bin);
    if(z == 0 && (zmin >= 0 || Healoption.Logz)){
      continue; // don't draw the empty bins for histograms with positive content
    } // if
    if(Healoption.Logz){
      z = z > 0 ? TMath::Log10(z) : zmin;
    } // if
    if(z < zmin){
      continue;
    } // if

    Int_t n;
    Double_t x[6], y[6], xdiv[6], ydiv[6];
    Bool_t used[5];
    Bool_t divided = false;

    if(!Vertices(bin, n, x, y, xdiv, ydiv, used, divided, xmin, xmax, ymin, ymax)){
      continue;
    } // if
    
    x[n] = x[0];
    y[n] = y[0];
    gPad->PaintPolyLine(n + 1, x, y);
    if(divided){
      xdiv[n] = xdiv[0];
      ydiv[n] = ydiv[0];
      gPad->PaintPolyLine(n + 1, xdiv, ydiv);
    } // if
  } // bin
}

//______________________________________________________________________________
void THealPainter::PaintContour(Option_t* option)
{
  // Not implemented yet
}

//______________________________________________________________________________
void THealPainter::PaintFrame()
{
  if(Healoption.Same){
    return;
  } // if

  RecalculateRange();

  if(Healoption.Lego || Healoption.Surf || Healoption.Tri ||
     Healoption.Contour == 14) {
    TObject* frame = gPad->FindObject("TFrame");
    if(frame){
      gPad->GetListOfPrimitives()->Remove(frame);
    } // if
    return;
  } // if
  gPad->PaintPadFrame(Healparam.xmin, Healparam.ymin, Healparam.xmax, Healparam.ymax);
}

//______________________________________________________________________________
void THealPainter::PaintFunction(Option_t*)
{
  TObjOptLink* lnk = (TObjOptLink*)fFunctions->FirstLink();
  TObject* obj;
  
  while(lnk){
    obj = lnk->GetObject();
    TVirtualPad *padsave = gPad;
    if(obj->InheritsFrom(TF1::Class())){
      if (obj->TestBit(TF1::kNotDraw) == 0) obj->Paint("lsame");
    } else  {
      obj->Paint(lnk->GetOption());
    } // if
    lnk = (TObjOptLink*)lnk->Next();
    padsave->cd();
  } // while
}

//______________________________________________________________________________
void THealPainter::PaintLego(Option_t* option)
{
  // Not implemented yet
}

//______________________________________________________________________________
void THealPainter::PaintPalette()
{
  THealPaletteAxis* palette = (THealPaletteAxis*)fFunctions->FindObject("palette");
  TView* view = gPad->GetView();
  if(palette){
    if(view){
      if(!palette->TestBit(THealPaletteAxis::kHasView)) {
	delete palette;
	palette = 0;
      } // if
    } else {
      if(palette->TestBit(THealPaletteAxis::kHasView)){
	delete palette; palette = 0;
      } // if
    } // if
  } // if
  
  if(!palette){
    Double_t xup  = gPad->GetUxmax();
    Double_t x2   = gPad->PadtoX(gPad->GetX2());
    Double_t ymin = gPad->PadtoY(gPad->GetUymin());
    Double_t ymax = gPad->PadtoY(gPad->GetUymax());
    Double_t xr   = 0.05*(gPad->GetX2() - gPad->GetX1());
    Double_t xmin = gPad->PadtoX(xup + 0.1*xr);
    Double_t xmax = gPad->PadtoX(xup + xr);
    if(xmax > x2){
      xmax = gPad->PadtoX(gPad->GetX2() - 0.01*xr);
    } // if
    palette = new THealPaletteAxis(xmin, ymin, xmax, ymax, fHeal);
    palette->Paint();
  } // if
}

//______________________________________________________________________________
void THealPainter::PaintScatterPlot(Option_t* option)
{
  // Not implemented yet
}

//______________________________________________________________________________
void THealPainter::PaintStat(Int_t dostat, TF1* fit)
{
  // Not implemented yet
}

//______________________________________________________________________________
void THealPainter::PaintSurface(Option_t* option)
{
  // Not implemented yet
}

//______________________________________________________________________________
void THealPainter::PaintTable(Option_t* option)
{
  if(!TableInit()){
    return;
  } // if

  PaintFrame();

  if(fHeal->GetEntries() != 0 && Healoption.Axis <= 0){
    if(Healoption.Scat)     PaintScatterPlot(option);
    if(Healoption.Box)      PaintBoxes(option);
    if(Healoption.Color)    PaintColorLevels(option);
    if(Healoption.Contour)  PaintContour(option);
  } // if

  if(Healoption.Lego) PaintLego(option);
  if(Healoption.Surf && !Healoption.Contour) PaintSurface(option);
  if(Healoption.Tri) PaintTriangles(option);
  
  if(!Healoption.Lego && !Healoption.Surf && !Healoption.Tri) PaintAxis(kFALSE);

  PaintTitle();

  TF1* fit  = 0;
  TIter next(fFunctions);
  TObject *obj;
  while((obj = next())){
    if (obj->InheritsFrom(TF1::Class())) {
      fit = (TF1*)obj;
      break;
    } // if
  } // while
  if(Healoption.Same != 1){
    if (!fHeal->TestBit(THealPix::kNoStats)) {  // bit set via TH1::SetStats
      PaintStat(gStyle->GetOptStat(), fit);
    } // if
  } // if
}

//______________________________________________________________________________
void THealPainter::PaintTitle()
{
  if(Healoption.Same){
    return;
  } // if

  if(fHeal->TestBit(THealPix::kNoTitle)){
    return;
  } // if

  Int_t nt = strlen(fHeal->GetTitle());
  TPaveText* title = 0;
  TObject* obj;
  TIter next(gPad->GetListOfPrimitives());
  while((obj = next())) {
    if(!obj->InheritsFrom(TPaveText::Class())){
      continue;
    } // if
    title = (TPaveText*)obj;
    if(strcmp(title->GetName(), "title")){
      title = 0;
      continue;
    } // if
    break;
  } // while

  if(nt == 0 || gStyle->GetOptTitle() <= 0){
    if(title){
      delete title;
    } // if
    return;
  } // if

  Double_t ht = gStyle->GetTitleH();
  Double_t wt = gStyle->GetTitleW();
  if(ht <= 0){
    ht = 1.1*gStyle->GetTitleFontSize();
  } // if
  if(ht <= 0){
    ht = 0.05;
  } // if
  if(wt <= 0){
    TLatex l;
    l.SetTextSize(ht);
    l.SetTitle(fHeal->GetTitle());
    // adjustment in case the title has several lines (#splitline)
    ht = TMath::Max(ht, 1.2*l.GetYsize()/(gPad->GetY2() - gPad->GetY1()));
    Double_t wndc = l.GetXsize()/(gPad->GetX2() - gPad->GetX1());
    wt = TMath::Min(0.7, 0.02+wndc);
  } // if

  if(title){
    TText *t0 = (TText*)title->GetLine(0);
    if(t0){
      if(!strcmp(t0->GetTitle(), fHeal->GetTitle())){
	return;
      } // if
      t0->SetTitle(fHeal->GetTitle());
      if(wt > 0){
	title->SetX2NDC(title->GetX1NDC() + wt);
      } // if
    }
    return;
  }

  Int_t talh = gStyle->GetTitleAlign()/10;
  if(talh < 1){
    talh = 1;
    if(talh > 3){
      talh = 3;
    } // if
  } // if
  Int_t talv = gStyle->GetTitleAlign()%10;
  if(talv < 1){
    talv = 1;
    if(talv > 3){
      talv = 3;
    } // if
  } // if
  Double_t xpos, ypos;
  xpos = gStyle->GetTitleX();
  ypos = gStyle->GetTitleY();
  if(talh == 2) xpos = xpos-wt/2.;
  if(talh == 3) xpos = xpos-wt;
  if(talv == 2) ypos = ypos+ht/2.;
  if(talv == 1) ypos = ypos+ht;

  TPaveText *ptitle = new TPaveText(xpos, ypos - ht, xpos + wt, ypos, "blNDC");

  //     box with the histogram title
  ptitle->SetFillColor(gStyle->GetTitleFillColor());
  ptitle->SetFillStyle(gStyle->GetTitleStyle());
  ptitle->SetName("title");
  ptitle->SetBorderSize(gStyle->GetTitleBorderSize());
  ptitle->SetTextColor(gStyle->GetTitleTextColor());
  ptitle->SetTextFont(gStyle->GetTitleFont(""));
  if(gStyle->GetTitleFont("")%10 > 2){
    ptitle->SetTextSize(gStyle->GetTitleFontSize());
  } // if
  ptitle->AddText(fHeal->GetTitle());
  ptitle->SetBit(kCanDelete);
  ptitle->Draw();
  ptitle->Paint();
}

//______________________________________________________________________________
void THealPainter::PaintTriangles(Option_t* option)
{
  // Not implemented yet
}

//______________________________________________________________________________
void THealPainter::ProcessMessage(const char *mess, const TObject *obj)
{
}

//______________________________________________________________________________
void THealPainter::RecalculateRange()
{
  if(Healoption.Same){
    return;
  } // if

  Double_t xmin = Healparam.xmin;
  Double_t xmax = Healparam.xmax;
  Double_t ymin = Healparam.ymin;
  Double_t ymax = Healparam.ymax;

  Double_t xmin_aid, ymin_aid, xmax_aid, ymax_aid;
  if(Healoption.Proj == 1){
  } else if(Healoption.Proj == 2){
  } else if(Healoption.Proj == 3){
  } else if(Healoption.Proj == 4){
  } // if

  Healparam.xmin = xmin;
  Healparam.xmax = xmax;
  Healparam.ymin = ymin;
  Healparam.ymax = ymax;

  Double_t dx = xmax - xmin;
  Double_t dy = ymax - ymin;
  Double_t dxr  = dx/(1 - gPad->GetLeftMargin()   - gPad->GetRightMargin());
  Double_t dyr  = dy/(1 - gPad->GetBottomMargin() - gPad->GetTopMargin());

  gPad->Range(xmin - dxr*gPad->GetLeftMargin(),
	      ymin - dyr*gPad->GetBottomMargin(),
	      xmax + dxr*gPad->GetRightMargin(),
	      ymax + dyr*gPad->GetTopMargin());
  gPad->RangeAxis(xmin, ymin, xmax, ymax);
}

//______________________________________________________________________________
void THealPainter::SetHealPix(THealPix* heal)
{
  if(heal == 0) return;
  fHeal = heal;
  fXaxis = heal->GetXaxis();
  fYaxis = heal->GetYaxis();
  fZaxis = heal->GetZaxis();
  fFunctions = fHeal->GetListOfFunctions();
}

//______________________________________________________________________________
Int_t THealPainter::TableInit()
{
  static const char* where = "TableInit";
  
  Int_t first, last;
  Double_t yMARGIN = gStyle->GetHistTopMargin();
  Double_t zmin, zmax;
  Int_t maximum = 0;
  Int_t minimum = 0;
  if(fHeal->GetMaximumStored() != -1111) maximum = 1;
  if(fHeal->GetMinimumStored() != -1111) minimum = 1;
  
  //    -----------------  Compute X axis parameters
  first           = fXaxis->GetFirst();
  last            = fXaxis->GetLast();
  Healparam.xlast    = last;
  Healparam.xfirst   = first;
  Healparam.xlowedge = fXaxis->GetBinLowEdge(first);
  Healparam.xbinsize = fXaxis->GetBinWidth(first);
  Healparam.xmin     = Healparam.xlowedge;
  Healparam.xmax     = fXaxis->GetBinLowEdge(last) + fXaxis->GetBinWidth(last);
  
  //    -----------------  Compute Y axis parameters
  first           = fYaxis->GetFirst();
  last            = fYaxis->GetLast();
  Healparam.ylast    = last;
  Healparam.yfirst   = first;
  Healparam.ylowedge = fYaxis->GetBinLowEdge(first);
  Healparam.ybinsize = fYaxis->GetBinWidth(first);
  if(!Healparam.ybinsize){
    Healparam.ybinsize = 1;
  } // if
  Healparam.ymin     = Healparam.ylowedge;
  Healparam.ymax     = fYaxis->GetBinLowEdge(last) + fYaxis->GetBinWidth(last);
  
  //    -----------------  Compute Z axis parameters
  Double_t bigp = TMath::Power(10, 32);
  zmax = -bigp;
  zmin = bigp;
  Double_t allchan = 0;
  for(Int_t i = 0; i <= fHeal->GetNpix(); i++){
    Double_t c1 = fHeal->GetBinContent(i);
    zmax = TMath::Max(zmax,c1);
    zmin = TMath::Min(zmin, c1);
    allchan += c1;
  } // i
  
  //     Take into account maximum , minimum
  
  if(maximum) zmax = fHeal->GetMaximumStored();
  if(minimum) zmin = fHeal->GetMinimumStored();
  if(Healoption.Logz && zmax <= 0) {
    if(!Healoption.Same){
      Error(where, "log scale is requested but maximum is less or equal 0 (%f)", zmax);
    } // if
    return 0;
  }
  if(zmin >= zmax){
    if(Healoption.Logz){
      if(zmax > 0){
	zmin = 0.001*zmax;
      } else {
	if(!Healoption.Same){
	  Error(where, "log scale is requested but maximum is less or equal 0 (%f)", zmax);
	} // if
	return 0;
      } // if
    } // if
  } // if
  
  //     take into account normalization factor
  Healparam.allchan = allchan;
  Double_t factor = allchan;
  if(fHeal->GetNormFactor() > 0) factor = fHeal->GetNormFactor();
  if(allchan) factor /= allchan;
  if(factor == 0) factor = 1;
  Healparam.factor = factor;
  zmax = factor*zmax;
  zmin = factor*zmin;
  Double_t c1 = zmax;
  if(TMath::Abs(zmin) > TMath::Abs(c1)){
    c1 = zmin;
  } // if
  
  //         For log scales, histogram coordinates are log10(ymin) and
  //         log10(ymax). Final adjustment (if not option "Same")
  //         or "+" for ymax) of ymax and ymin for logarithmic scale, if
  //         Maximum and Minimum are not defined.
  if(Healoption.Logz){
    if(zmin <= 0){
      zmin = TMath::Min((Double_t)1, (Double_t)0.001*zmax);
      fHeal->SetMinimum(zmin);
    } // if
    zmin = TMath::Log10(zmin);
    if(!minimum){
      zmin += TMath::Log10(0.5);
    } // if
    zmax = TMath::Log10(zmax);
    if(!maximum){
      zmax += TMath::Log10(2*(0.9/0.95));
    } // if
    goto LZMIN;
  }
  
  //         final adjustment of YMAXI for linear scale (if not option "Same"):
  //         decrease histogram height to MAX% of allowed height if HMAXIM
  //         has not been called.
  //         MAX% is the value in percent which has been set in HPLSET
   //         (default is 90%).
  if(!maximum){
    zmax += yMARGIN*(zmax - zmin);
  } // if
  
  //         final adjustment of ymin for linear scale.
  //         if minimum is not set , then ymin is set to zero if >0
  //         or to ymin - yMARGIN if <0.
  if(!minimum){
    if(gStyle->GetHistMinimumZero()){
      if(zmin >= 0){
	zmin = 0;
      } else {
	zmin -= yMARGIN*(zmax - zmin);
      } // if
    } else {
      Double_t dzmin = yMARGIN*(zmax - zmin);
      if(zmin >= 0 && (zmin - dzmin <= 0)){
	zmin  = 0;
      } else {
	zmin -= dzmin;
      } // if
    } // if
  } // if
  
 LZMIN:
  Healparam.zmin = zmin;
  Healparam.zmax = zmax;
  
  //     Set bar offset and width
  Healparam.baroffset = fHeal->GetBarOffset();
  Healparam.barwidth  = fHeal->GetBarWidth();
  
  return 1;
}

//______________________________________________________________________________
Bool_t THealPainter::Vertices(Int_t bin, Int_t& n, Double_t* x, Double_t* y,
			      Double_t* xdiv, Double_t* ydiv,
			      Bool_t* used, Bool_t& divided,
			      Double_t xmin, Double_t xmax,
			      Double_t ymin, Double_t ymax)
{
  Double_t theta, phi; // x/y center
  fHeal->GetBinCenter(bin, theta, phi);
  if(!fHeal->IsDegree()){
    theta *= TMath::RadToDeg();
    phi *= TMath::RadToDeg();
  } // if
  if(Healoption.System == kGalactic || Healoption.System == kLatLong){
    theta = 90 - theta;
    phi -= 180;
  } else if(Healoption.System == kCelestial){
    theta = 90 - theta;
  } // if
  
  if(!IsInside(phi, theta)){
    return false;
  } // if

  for(Int_t i = 0; i < 5; i++) used[i] = true;
  n = fHeal->GetBinVertices(bin, x, y);
  if(Healoption.System == kGalactic || Healoption.System == kLatLong){
    if(x[0] >= 180. && x[1] >= 180. && x[2] >= 180. && x[3] >= 180. &&
       (n == 4 || (n == 5 && x[4] >= 180.))){
      for(Int_t j = 0; j < n; j++){
	x[j] -= 360.;
      } // j
    } // if
    for(Int_t j = 0; j < n; j++){
      y[j] = 90. - y[j];
    } // j
  } else if(Healoption.System == kCelestial){
    for(Int_t j = 0; j < n; j++){
      y[j] = 90. - y[j];
    } // j
  } // if
  
  if(Healoption.Proj == kHammer){
    if(Healoption.System == kGalactic || Healoption.System == kLatLong){
      for(Int_t j = 0; j < n; j++){
	Double_t lng = x[j]*d2r;
	Double_t lat = y[j]*d2r;
	x[j] = 180*TMath::Cos(lat)*TMath::Sin(lng/2.)
	  /TMath::Sqrt(1. + TMath::Cos(lat)*TMath::Cos(lng/2.));
	y[j] = 90.*TMath::Sin(lat)
	  /TMath::Sqrt(1. + TMath::Cos(lat)*TMath::Cos(lng/2.));
	if(x[j] > 180*TMath::Cos(lat) || x[j] < -180*TMath::Cos(lat)) used[j] = false;
      } // j
    } else if(Healoption.System == kCelestial){
      for(Int_t j = 0; j < n; j++){
	Double_t lng = (x[j] - 180.)*d2r;
	Double_t lat = y[j]*d2r;
	x[j] = 180. + 180*TMath::Cos(lat)*TMath::Sin(lng/2.)
	  /TMath::Sqrt(1. + TMath::Cos(lat)*TMath::Cos(lng/2.));
	y[j] = 90.*TMath::Sin(lat)
	  /TMath::Sqrt(1. + TMath::Cos(lat)*TMath::Cos(lng/2.));
	if(x[j] > 180. + 180*TMath::Cos(lat) || x[j] < 180. - 180*TMath::Cos(lat)) used[j] = false;
      } // j
    } else {
      for(Int_t j = 0; j < n; j++){
	Double_t lng = (x[j] - 180.)*d2r;
	Double_t lat = (90. - y[j])*d2r;
	x[j] = 180. + 180*TMath::Cos(lat)*TMath::Sin(lng/2.)
	  /TMath::Sqrt(1. + TMath::Cos(lat)*TMath::Cos(lng/2.));
	y[j] = 90. - 90.*TMath::Sin(lat)
	  /TMath::Sqrt(1. + TMath::Cos(lat)*TMath::Cos(lng/2.));
	if(x[j] > 180. + 180*TMath::Cos(lat) || x[j] < 180. - 180*TMath::Cos(lat)) used[j] = false;
      } // j
    } // if
  } else if(Healoption.Proj == kLambert + 10){
    for(Int_t j = 0; j < n; j++){
      Double_t sint = TMath::Sin(y[j]*d2r);
      Double_t z = TMath::Cos(y[j]*d2r);
      Double_t tmp = (z < 1) ? 180.*sint/TMath::Sqrt(2.*(1 - z)) : 180.;
      x[j] = tmp*TMath::Cos(x[j]*d2r);
      y[j] = tmp*TMath::Sin(x[j]*d2r);
    } // j
  } else if(Healoption.Proj == kLambert){
    for(Int_t j = 0; j < n; j++){
      Double_t y_ = (180. - y[j])*d2r;
      Double_t sint = TMath::Sin(y_);
      Double_t z = TMath::Cos(y_);
      Double_t tmp = (z < 1) ? 180.*sint/TMath::Sqrt(2.*(1 - z)) : 180.;
      x[j] = tmp*TMath::Cos(x[j]*d2r);
      y[j] = tmp*TMath::Sin(x[j]*d2r);
    } // j
  } else if(Healoption.Proj == kPolar + 10){
    for(Int_t j = 0; j < n; j++){
      Double_t r = 180. - y[j];
      Double_t phi = x[j]*d2r;
      x[j] = r*TMath::Cos(phi);
      y[j] = r*TMath::Sin(phi);
    } // j
  } else if(Healoption.Proj == kPolar){
    for(Int_t j = 0; j < n; j++){
      Double_t r = y[j];
      Double_t phi = x[j]*d2r;
      x[j] = r*TMath::Cos(phi);
      y[j] = r*TMath::Sin(phi);
    } // j
  } else {
    if(Healoption.System == kGalactic || Healoption.System == kLatLong){
      for(Int_t j = 0; j < n; j++){
	if(x[j] > 180. || x[j] < -180.) used[j] = false;
      } // j
    } else if(Healoption.System == kCelestial){
      for(Int_t j = 0; j < n; j++){
	if(x[j] > 360. || x[j] < 0.) used[j] = false;
      } // j
    } else {
      for(Int_t j = 0; j < n; j++){
	if(x[j] > 360. || x[j] < 0.) used[j] = false;
      } // j
    } // if
  } // if
  
  if(Healoption.Xinv == 1){
    for(Int_t j = 0; j < n; j++){
      x[j] = -x[j] + xmax + xmin;
    } // j
  } // if
  if(Healoption.Yinv == 1){
    for(Int_t j = 0; j < n; j++){
      y[j] = -y[j] + ymax + ymin;
    } // j
  } // if
  
  Bool_t isInsidePlotArea = kFALSE;
  for(Int_t i = 0; i < n; i++){
    if(xmin <= x[i] && x[i] <= xmax && ymin <= y[i] && y[i] <= ymax){
      isInsidePlotArea |= kTRUE;
      break;
    } // if
  } // i
  if(!isInsidePlotArea){
    // do not plot pixels outside the plot area
    return false;
  } // if
  
  Int_t nSav = n;
  for(Int_t i = 0; i < nSav; i++){
    if(!used[i]){
      divided = true;
      for(Int_t j = i; j < nSav - 1; j++){
	x[j] = x[j+1];
	y[j] = y[j+1];
      } // j
      for(Int_t j = 0; j < nSav - 1; j++){
	xdiv[j] = -1.*x[j];
	ydiv[j] = y[j];
	if(Healoption.System != kGalactic && Healoption.System != kLatLong) xdiv[j] += 360.;
      } // j
      n--;
      break;
    } // if
  } // i

  return true;
}
 THealPainter.cxx:1
 THealPainter.cxx:2
 THealPainter.cxx:3
 THealPainter.cxx:4
 THealPainter.cxx:5
 THealPainter.cxx:6
 THealPainter.cxx:7
 THealPainter.cxx:8
 THealPainter.cxx:9
 THealPainter.cxx:10
 THealPainter.cxx:11
 THealPainter.cxx:12
 THealPainter.cxx:13
 THealPainter.cxx:14
 THealPainter.cxx:15
 THealPainter.cxx:16
 THealPainter.cxx:17
 THealPainter.cxx:18
 THealPainter.cxx:19
 THealPainter.cxx:20
 THealPainter.cxx:21
 THealPainter.cxx:22
 THealPainter.cxx:23
 THealPainter.cxx:24
 THealPainter.cxx:25
 THealPainter.cxx:26
 THealPainter.cxx:27
 THealPainter.cxx:28
 THealPainter.cxx:29
 THealPainter.cxx:30
 THealPainter.cxx:31
 THealPainter.cxx:32
 THealPainter.cxx:33
 THealPainter.cxx:34
 THealPainter.cxx:35
 THealPainter.cxx:36
 THealPainter.cxx:37
 THealPainter.cxx:38
 THealPainter.cxx:39
 THealPainter.cxx:40
 THealPainter.cxx:41
 THealPainter.cxx:42
 THealPainter.cxx:43
 THealPainter.cxx:44
 THealPainter.cxx:45
 THealPainter.cxx:46
 THealPainter.cxx:47
 THealPainter.cxx:48
 THealPainter.cxx:49
 THealPainter.cxx:50
 THealPainter.cxx:51
 THealPainter.cxx:52
 THealPainter.cxx:53
 THealPainter.cxx:54
 THealPainter.cxx:55
 THealPainter.cxx:56
 THealPainter.cxx:57
 THealPainter.cxx:58
 THealPainter.cxx:59
 THealPainter.cxx:60
 THealPainter.cxx:61
 THealPainter.cxx:62
 THealPainter.cxx:63
 THealPainter.cxx:64
 THealPainter.cxx:65
 THealPainter.cxx:66
 THealPainter.cxx:67
 THealPainter.cxx:68
 THealPainter.cxx:69
 THealPainter.cxx:70
 THealPainter.cxx:71
 THealPainter.cxx:72
 THealPainter.cxx:73
 THealPainter.cxx:74
 THealPainter.cxx:75
 THealPainter.cxx:76
 THealPainter.cxx:77
 THealPainter.cxx:78
 THealPainter.cxx:79
 THealPainter.cxx:80
 THealPainter.cxx:81
 THealPainter.cxx:82
 THealPainter.cxx:83
 THealPainter.cxx:84
 THealPainter.cxx:85
 THealPainter.cxx:86
 THealPainter.cxx:87
 THealPainter.cxx:88
 THealPainter.cxx:89
 THealPainter.cxx:90
 THealPainter.cxx:91
 THealPainter.cxx:92
 THealPainter.cxx:93
 THealPainter.cxx:94
 THealPainter.cxx:95
 THealPainter.cxx:96
 THealPainter.cxx:97
 THealPainter.cxx:98
 THealPainter.cxx:99
 THealPainter.cxx:100
 THealPainter.cxx:101
 THealPainter.cxx:102
 THealPainter.cxx:103
 THealPainter.cxx:104
 THealPainter.cxx:105
 THealPainter.cxx:106
 THealPainter.cxx:107
 THealPainter.cxx:108
 THealPainter.cxx:109
 THealPainter.cxx:110
 THealPainter.cxx:111
 THealPainter.cxx:112
 THealPainter.cxx:113
 THealPainter.cxx:114
 THealPainter.cxx:115
 THealPainter.cxx:116
 THealPainter.cxx:117
 THealPainter.cxx:118
 THealPainter.cxx:119
 THealPainter.cxx:120
 THealPainter.cxx:121
 THealPainter.cxx:122
 THealPainter.cxx:123
 THealPainter.cxx:124
 THealPainter.cxx:125
 THealPainter.cxx:126
 THealPainter.cxx:127
 THealPainter.cxx:128
 THealPainter.cxx:129
 THealPainter.cxx:130
 THealPainter.cxx:131
 THealPainter.cxx:132
 THealPainter.cxx:133
 THealPainter.cxx:134
 THealPainter.cxx:135
 THealPainter.cxx:136
 THealPainter.cxx:137
 THealPainter.cxx:138
 THealPainter.cxx:139
 THealPainter.cxx:140
 THealPainter.cxx:141
 THealPainter.cxx:142
 THealPainter.cxx:143
 THealPainter.cxx:144
 THealPainter.cxx:145
 THealPainter.cxx:146
 THealPainter.cxx:147
 THealPainter.cxx:148
 THealPainter.cxx:149
 THealPainter.cxx:150
 THealPainter.cxx:151
 THealPainter.cxx:152
 THealPainter.cxx:153
 THealPainter.cxx:154
 THealPainter.cxx:155
 THealPainter.cxx:156
 THealPainter.cxx:157
 THealPainter.cxx:158
 THealPainter.cxx:159
 THealPainter.cxx:160
 THealPainter.cxx:161
 THealPainter.cxx:162
 THealPainter.cxx:163
 THealPainter.cxx:164
 THealPainter.cxx:165
 THealPainter.cxx:166
 THealPainter.cxx:167
 THealPainter.cxx:168
 THealPainter.cxx:169
 THealPainter.cxx:170
 THealPainter.cxx:171
 THealPainter.cxx:172
 THealPainter.cxx:173
 THealPainter.cxx:174
 THealPainter.cxx:175
 THealPainter.cxx:176
 THealPainter.cxx:177
 THealPainter.cxx:178
 THealPainter.cxx:179
 THealPainter.cxx:180
 THealPainter.cxx:181
 THealPainter.cxx:182
 THealPainter.cxx:183
 THealPainter.cxx:184
 THealPainter.cxx:185
 THealPainter.cxx:186
 THealPainter.cxx:187
 THealPainter.cxx:188
 THealPainter.cxx:189
 THealPainter.cxx:190
 THealPainter.cxx:191
 THealPainter.cxx:192
 THealPainter.cxx:193
 THealPainter.cxx:194
 THealPainter.cxx:195
 THealPainter.cxx:196
 THealPainter.cxx:197
 THealPainter.cxx:198
 THealPainter.cxx:199
 THealPainter.cxx:200
 THealPainter.cxx:201
 THealPainter.cxx:202
 THealPainter.cxx:203
 THealPainter.cxx:204
 THealPainter.cxx:205
 THealPainter.cxx:206
 THealPainter.cxx:207
 THealPainter.cxx:208
 THealPainter.cxx:209
 THealPainter.cxx:210
 THealPainter.cxx:211
 THealPainter.cxx:212
 THealPainter.cxx:213
 THealPainter.cxx:214
 THealPainter.cxx:215
 THealPainter.cxx:216
 THealPainter.cxx:217
 THealPainter.cxx:218
 THealPainter.cxx:219
 THealPainter.cxx:220
 THealPainter.cxx:221
 THealPainter.cxx:222
 THealPainter.cxx:223
 THealPainter.cxx:224
 THealPainter.cxx:225
 THealPainter.cxx:226
 THealPainter.cxx:227
 THealPainter.cxx:228
 THealPainter.cxx:229
 THealPainter.cxx:230
 THealPainter.cxx:231
 THealPainter.cxx:232
 THealPainter.cxx:233
 THealPainter.cxx:234
 THealPainter.cxx:235
 THealPainter.cxx:236
 THealPainter.cxx:237
 THealPainter.cxx:238
 THealPainter.cxx:239
 THealPainter.cxx:240
 THealPainter.cxx:241
 THealPainter.cxx:242
 THealPainter.cxx:243
 THealPainter.cxx:244
 THealPainter.cxx:245
 THealPainter.cxx:246
 THealPainter.cxx:247
 THealPainter.cxx:248
 THealPainter.cxx:249
 THealPainter.cxx:250
 THealPainter.cxx:251
 THealPainter.cxx:252
 THealPainter.cxx:253
 THealPainter.cxx:254
 THealPainter.cxx:255
 THealPainter.cxx:256
 THealPainter.cxx:257
 THealPainter.cxx:258
 THealPainter.cxx:259
 THealPainter.cxx:260
 THealPainter.cxx:261
 THealPainter.cxx:262
 THealPainter.cxx:263
 THealPainter.cxx:264
 THealPainter.cxx:265
 THealPainter.cxx:266
 THealPainter.cxx:267
 THealPainter.cxx:268
 THealPainter.cxx:269
 THealPainter.cxx:270
 THealPainter.cxx:271
 THealPainter.cxx:272
 THealPainter.cxx:273
 THealPainter.cxx:274
 THealPainter.cxx:275
 THealPainter.cxx:276
 THealPainter.cxx:277
 THealPainter.cxx:278
 THealPainter.cxx:279
 THealPainter.cxx:280
 THealPainter.cxx:281
 THealPainter.cxx:282
 THealPainter.cxx:283
 THealPainter.cxx:284
 THealPainter.cxx:285
 THealPainter.cxx:286
 THealPainter.cxx:287
 THealPainter.cxx:288
 THealPainter.cxx:289
 THealPainter.cxx:290
 THealPainter.cxx:291
 THealPainter.cxx:292
 THealPainter.cxx:293
 THealPainter.cxx:294
 THealPainter.cxx:295
 THealPainter.cxx:296
 THealPainter.cxx:297
 THealPainter.cxx:298
 THealPainter.cxx:299
 THealPainter.cxx:300
 THealPainter.cxx:301
 THealPainter.cxx:302
 THealPainter.cxx:303
 THealPainter.cxx:304
 THealPainter.cxx:305
 THealPainter.cxx:306
 THealPainter.cxx:307
 THealPainter.cxx:308
 THealPainter.cxx:309
 THealPainter.cxx:310
 THealPainter.cxx:311
 THealPainter.cxx:312
 THealPainter.cxx:313
 THealPainter.cxx:314
 THealPainter.cxx:315
 THealPainter.cxx:316
 THealPainter.cxx:317
 THealPainter.cxx:318
 THealPainter.cxx:319
 THealPainter.cxx:320
 THealPainter.cxx:321
 THealPainter.cxx:322
 THealPainter.cxx:323
 THealPainter.cxx:324
 THealPainter.cxx:325
 THealPainter.cxx:326
 THealPainter.cxx:327
 THealPainter.cxx:328
 THealPainter.cxx:329
 THealPainter.cxx:330
 THealPainter.cxx:331
 THealPainter.cxx:332
 THealPainter.cxx:333
 THealPainter.cxx:334
 THealPainter.cxx:335
 THealPainter.cxx:336
 THealPainter.cxx:337
 THealPainter.cxx:338
 THealPainter.cxx:339
 THealPainter.cxx:340
 THealPainter.cxx:341
 THealPainter.cxx:342
 THealPainter.cxx:343
 THealPainter.cxx:344
 THealPainter.cxx:345
 THealPainter.cxx:346
 THealPainter.cxx:347
 THealPainter.cxx:348
 THealPainter.cxx:349
 THealPainter.cxx:350
 THealPainter.cxx:351
 THealPainter.cxx:352
 THealPainter.cxx:353
 THealPainter.cxx:354
 THealPainter.cxx:355
 THealPainter.cxx:356
 THealPainter.cxx:357
 THealPainter.cxx:358
 THealPainter.cxx:359
 THealPainter.cxx:360
 THealPainter.cxx:361
 THealPainter.cxx:362
 THealPainter.cxx:363
 THealPainter.cxx:364
 THealPainter.cxx:365
 THealPainter.cxx:366
 THealPainter.cxx:367
 THealPainter.cxx:368
 THealPainter.cxx:369
 THealPainter.cxx:370
 THealPainter.cxx:371
 THealPainter.cxx:372
 THealPainter.cxx:373
 THealPainter.cxx:374
 THealPainter.cxx:375
 THealPainter.cxx:376
 THealPainter.cxx:377
 THealPainter.cxx:378
 THealPainter.cxx:379
 THealPainter.cxx:380
 THealPainter.cxx:381
 THealPainter.cxx:382
 THealPainter.cxx:383
 THealPainter.cxx:384
 THealPainter.cxx:385
 THealPainter.cxx:386
 THealPainter.cxx:387
 THealPainter.cxx:388
 THealPainter.cxx:389
 THealPainter.cxx:390
 THealPainter.cxx:391
 THealPainter.cxx:392
 THealPainter.cxx:393
 THealPainter.cxx:394
 THealPainter.cxx:395
 THealPainter.cxx:396
 THealPainter.cxx:397
 THealPainter.cxx:398
 THealPainter.cxx:399
 THealPainter.cxx:400
 THealPainter.cxx:401
 THealPainter.cxx:402
 THealPainter.cxx:403
 THealPainter.cxx:404
 THealPainter.cxx:405
 THealPainter.cxx:406
 THealPainter.cxx:407
 THealPainter.cxx:408
 THealPainter.cxx:409
 THealPainter.cxx:410
 THealPainter.cxx:411
 THealPainter.cxx:412
 THealPainter.cxx:413
 THealPainter.cxx:414
 THealPainter.cxx:415
 THealPainter.cxx:416
 THealPainter.cxx:417
 THealPainter.cxx:418
 THealPainter.cxx:419
 THealPainter.cxx:420
 THealPainter.cxx:421
 THealPainter.cxx:422
 THealPainter.cxx:423
 THealPainter.cxx:424
 THealPainter.cxx:425
 THealPainter.cxx:426
 THealPainter.cxx:427
 THealPainter.cxx:428
 THealPainter.cxx:429
 THealPainter.cxx:430
 THealPainter.cxx:431
 THealPainter.cxx:432
 THealPainter.cxx:433
 THealPainter.cxx:434
 THealPainter.cxx:435
 THealPainter.cxx:436
 THealPainter.cxx:437
 THealPainter.cxx:438
 THealPainter.cxx:439
 THealPainter.cxx:440
 THealPainter.cxx:441
 THealPainter.cxx:442
 THealPainter.cxx:443
 THealPainter.cxx:444
 THealPainter.cxx:445
 THealPainter.cxx:446
 THealPainter.cxx:447
 THealPainter.cxx:448
 THealPainter.cxx:449
 THealPainter.cxx:450
 THealPainter.cxx:451
 THealPainter.cxx:452
 THealPainter.cxx:453
 THealPainter.cxx:454
 THealPainter.cxx:455
 THealPainter.cxx:456
 THealPainter.cxx:457
 THealPainter.cxx:458
 THealPainter.cxx:459
 THealPainter.cxx:460
 THealPainter.cxx:461
 THealPainter.cxx:462
 THealPainter.cxx:463
 THealPainter.cxx:464
 THealPainter.cxx:465
 THealPainter.cxx:466
 THealPainter.cxx:467
 THealPainter.cxx:468
 THealPainter.cxx:469
 THealPainter.cxx:470
 THealPainter.cxx:471
 THealPainter.cxx:472
 THealPainter.cxx:473
 THealPainter.cxx:474
 THealPainter.cxx:475
 THealPainter.cxx:476
 THealPainter.cxx:477
 THealPainter.cxx:478
 THealPainter.cxx:479
 THealPainter.cxx:480
 THealPainter.cxx:481
 THealPainter.cxx:482
 THealPainter.cxx:483
 THealPainter.cxx:484
 THealPainter.cxx:485
 THealPainter.cxx:486
 THealPainter.cxx:487
 THealPainter.cxx:488
 THealPainter.cxx:489
 THealPainter.cxx:490
 THealPainter.cxx:491
 THealPainter.cxx:492
 THealPainter.cxx:493
 THealPainter.cxx:494
 THealPainter.cxx:495
 THealPainter.cxx:496
 THealPainter.cxx:497
 THealPainter.cxx:498
 THealPainter.cxx:499
 THealPainter.cxx:500
 THealPainter.cxx:501
 THealPainter.cxx:502
 THealPainter.cxx:503
 THealPainter.cxx:504
 THealPainter.cxx:505
 THealPainter.cxx:506
 THealPainter.cxx:507
 THealPainter.cxx:508
 THealPainter.cxx:509
 THealPainter.cxx:510
 THealPainter.cxx:511
 THealPainter.cxx:512
 THealPainter.cxx:513
 THealPainter.cxx:514
 THealPainter.cxx:515
 THealPainter.cxx:516
 THealPainter.cxx:517
 THealPainter.cxx:518
 THealPainter.cxx:519
 THealPainter.cxx:520
 THealPainter.cxx:521
 THealPainter.cxx:522
 THealPainter.cxx:523
 THealPainter.cxx:524
 THealPainter.cxx:525
 THealPainter.cxx:526
 THealPainter.cxx:527
 THealPainter.cxx:528
 THealPainter.cxx:529
 THealPainter.cxx:530
 THealPainter.cxx:531
 THealPainter.cxx:532
 THealPainter.cxx:533
 THealPainter.cxx:534
 THealPainter.cxx:535
 THealPainter.cxx:536
 THealPainter.cxx:537
 THealPainter.cxx:538
 THealPainter.cxx:539
 THealPainter.cxx:540
 THealPainter.cxx:541
 THealPainter.cxx:542
 THealPainter.cxx:543
 THealPainter.cxx:544
 THealPainter.cxx:545
 THealPainter.cxx:546
 THealPainter.cxx:547
 THealPainter.cxx:548
 THealPainter.cxx:549
 THealPainter.cxx:550
 THealPainter.cxx:551
 THealPainter.cxx:552
 THealPainter.cxx:553
 THealPainter.cxx:554
 THealPainter.cxx:555
 THealPainter.cxx:556
 THealPainter.cxx:557
 THealPainter.cxx:558
 THealPainter.cxx:559
 THealPainter.cxx:560
 THealPainter.cxx:561
 THealPainter.cxx:562
 THealPainter.cxx:563
 THealPainter.cxx:564
 THealPainter.cxx:565
 THealPainter.cxx:566
 THealPainter.cxx:567
 THealPainter.cxx:568
 THealPainter.cxx:569
 THealPainter.cxx:570
 THealPainter.cxx:571
 THealPainter.cxx:572
 THealPainter.cxx:573
 THealPainter.cxx:574
 THealPainter.cxx:575
 THealPainter.cxx:576
 THealPainter.cxx:577
 THealPainter.cxx:578
 THealPainter.cxx:579
 THealPainter.cxx:580
 THealPainter.cxx:581
 THealPainter.cxx:582
 THealPainter.cxx:583
 THealPainter.cxx:584
 THealPainter.cxx:585
 THealPainter.cxx:586
 THealPainter.cxx:587
 THealPainter.cxx:588
 THealPainter.cxx:589
 THealPainter.cxx:590
 THealPainter.cxx:591
 THealPainter.cxx:592
 THealPainter.cxx:593
 THealPainter.cxx:594
 THealPainter.cxx:595
 THealPainter.cxx:596
 THealPainter.cxx:597
 THealPainter.cxx:598
 THealPainter.cxx:599
 THealPainter.cxx:600
 THealPainter.cxx:601
 THealPainter.cxx:602
 THealPainter.cxx:603
 THealPainter.cxx:604
 THealPainter.cxx:605
 THealPainter.cxx:606
 THealPainter.cxx:607
 THealPainter.cxx:608
 THealPainter.cxx:609
 THealPainter.cxx:610
 THealPainter.cxx:611
 THealPainter.cxx:612
 THealPainter.cxx:613
 THealPainter.cxx:614
 THealPainter.cxx:615
 THealPainter.cxx:616
 THealPainter.cxx:617
 THealPainter.cxx:618
 THealPainter.cxx:619
 THealPainter.cxx:620
 THealPainter.cxx:621
 THealPainter.cxx:622
 THealPainter.cxx:623
 THealPainter.cxx:624
 THealPainter.cxx:625
 THealPainter.cxx:626
 THealPainter.cxx:627
 THealPainter.cxx:628
 THealPainter.cxx:629
 THealPainter.cxx:630
 THealPainter.cxx:631
 THealPainter.cxx:632
 THealPainter.cxx:633
 THealPainter.cxx:634
 THealPainter.cxx:635
 THealPainter.cxx:636
 THealPainter.cxx:637
 THealPainter.cxx:638
 THealPainter.cxx:639
 THealPainter.cxx:640
 THealPainter.cxx:641
 THealPainter.cxx:642
 THealPainter.cxx:643
 THealPainter.cxx:644
 THealPainter.cxx:645
 THealPainter.cxx:646
 THealPainter.cxx:647
 THealPainter.cxx:648
 THealPainter.cxx:649
 THealPainter.cxx:650
 THealPainter.cxx:651
 THealPainter.cxx:652
 THealPainter.cxx:653
 THealPainter.cxx:654
 THealPainter.cxx:655
 THealPainter.cxx:656
 THealPainter.cxx:657
 THealPainter.cxx:658
 THealPainter.cxx:659
 THealPainter.cxx:660
 THealPainter.cxx:661
 THealPainter.cxx:662
 THealPainter.cxx:663
 THealPainter.cxx:664
 THealPainter.cxx:665
 THealPainter.cxx:666
 THealPainter.cxx:667
 THealPainter.cxx:668
 THealPainter.cxx:669
 THealPainter.cxx:670
 THealPainter.cxx:671
 THealPainter.cxx:672
 THealPainter.cxx:673
 THealPainter.cxx:674
 THealPainter.cxx:675
 THealPainter.cxx:676
 THealPainter.cxx:677
 THealPainter.cxx:678
 THealPainter.cxx:679
 THealPainter.cxx:680
 THealPainter.cxx:681
 THealPainter.cxx:682
 THealPainter.cxx:683
 THealPainter.cxx:684
 THealPainter.cxx:685
 THealPainter.cxx:686
 THealPainter.cxx:687
 THealPainter.cxx:688
 THealPainter.cxx:689
 THealPainter.cxx:690
 THealPainter.cxx:691
 THealPainter.cxx:692
 THealPainter.cxx:693
 THealPainter.cxx:694
 THealPainter.cxx:695
 THealPainter.cxx:696
 THealPainter.cxx:697
 THealPainter.cxx:698
 THealPainter.cxx:699
 THealPainter.cxx:700
 THealPainter.cxx:701
 THealPainter.cxx:702
 THealPainter.cxx:703
 THealPainter.cxx:704
 THealPainter.cxx:705
 THealPainter.cxx:706
 THealPainter.cxx:707
 THealPainter.cxx:708
 THealPainter.cxx:709
 THealPainter.cxx:710
 THealPainter.cxx:711
 THealPainter.cxx:712
 THealPainter.cxx:713
 THealPainter.cxx:714
 THealPainter.cxx:715
 THealPainter.cxx:716
 THealPainter.cxx:717
 THealPainter.cxx:718
 THealPainter.cxx:719
 THealPainter.cxx:720
 THealPainter.cxx:721
 THealPainter.cxx:722
 THealPainter.cxx:723
 THealPainter.cxx:724
 THealPainter.cxx:725
 THealPainter.cxx:726
 THealPainter.cxx:727
 THealPainter.cxx:728
 THealPainter.cxx:729
 THealPainter.cxx:730
 THealPainter.cxx:731
 THealPainter.cxx:732
 THealPainter.cxx:733
 THealPainter.cxx:734
 THealPainter.cxx:735
 THealPainter.cxx:736
 THealPainter.cxx:737
 THealPainter.cxx:738
 THealPainter.cxx:739
 THealPainter.cxx:740
 THealPainter.cxx:741
 THealPainter.cxx:742
 THealPainter.cxx:743
 THealPainter.cxx:744
 THealPainter.cxx:745
 THealPainter.cxx:746
 THealPainter.cxx:747
 THealPainter.cxx:748
 THealPainter.cxx:749
 THealPainter.cxx:750
 THealPainter.cxx:751
 THealPainter.cxx:752
 THealPainter.cxx:753
 THealPainter.cxx:754
 THealPainter.cxx:755
 THealPainter.cxx:756
 THealPainter.cxx:757
 THealPainter.cxx:758
 THealPainter.cxx:759
 THealPainter.cxx:760
 THealPainter.cxx:761
 THealPainter.cxx:762
 THealPainter.cxx:763
 THealPainter.cxx:764
 THealPainter.cxx:765
 THealPainter.cxx:766
 THealPainter.cxx:767
 THealPainter.cxx:768
 THealPainter.cxx:769
 THealPainter.cxx:770
 THealPainter.cxx:771
 THealPainter.cxx:772
 THealPainter.cxx:773
 THealPainter.cxx:774
 THealPainter.cxx:775
 THealPainter.cxx:776
 THealPainter.cxx:777
 THealPainter.cxx:778
 THealPainter.cxx:779
 THealPainter.cxx:780
 THealPainter.cxx:781
 THealPainter.cxx:782
 THealPainter.cxx:783
 THealPainter.cxx:784
 THealPainter.cxx:785
 THealPainter.cxx:786
 THealPainter.cxx:787
 THealPainter.cxx:788
 THealPainter.cxx:789
 THealPainter.cxx:790
 THealPainter.cxx:791
 THealPainter.cxx:792
 THealPainter.cxx:793
 THealPainter.cxx:794
 THealPainter.cxx:795
 THealPainter.cxx:796
 THealPainter.cxx:797
 THealPainter.cxx:798
 THealPainter.cxx:799
 THealPainter.cxx:800
 THealPainter.cxx:801
 THealPainter.cxx:802
 THealPainter.cxx:803
 THealPainter.cxx:804
 THealPainter.cxx:805
 THealPainter.cxx:806
 THealPainter.cxx:807
 THealPainter.cxx:808
 THealPainter.cxx:809
 THealPainter.cxx:810
 THealPainter.cxx:811
 THealPainter.cxx:812
 THealPainter.cxx:813
 THealPainter.cxx:814
 THealPainter.cxx:815
 THealPainter.cxx:816
 THealPainter.cxx:817
 THealPainter.cxx:818
 THealPainter.cxx:819
 THealPainter.cxx:820
 THealPainter.cxx:821
 THealPainter.cxx:822
 THealPainter.cxx:823
 THealPainter.cxx:824
 THealPainter.cxx:825
 THealPainter.cxx:826
 THealPainter.cxx:827
 THealPainter.cxx:828
 THealPainter.cxx:829
 THealPainter.cxx:830
 THealPainter.cxx:831
 THealPainter.cxx:832
 THealPainter.cxx:833
 THealPainter.cxx:834
 THealPainter.cxx:835
 THealPainter.cxx:836
 THealPainter.cxx:837
 THealPainter.cxx:838
 THealPainter.cxx:839
 THealPainter.cxx:840
 THealPainter.cxx:841
 THealPainter.cxx:842
 THealPainter.cxx:843
 THealPainter.cxx:844
 THealPainter.cxx:845
 THealPainter.cxx:846
 THealPainter.cxx:847
 THealPainter.cxx:848
 THealPainter.cxx:849
 THealPainter.cxx:850
 THealPainter.cxx:851
 THealPainter.cxx:852
 THealPainter.cxx:853
 THealPainter.cxx:854
 THealPainter.cxx:855
 THealPainter.cxx:856
 THealPainter.cxx:857
 THealPainter.cxx:858
 THealPainter.cxx:859
 THealPainter.cxx:860
 THealPainter.cxx:861
 THealPainter.cxx:862
 THealPainter.cxx:863
 THealPainter.cxx:864
 THealPainter.cxx:865
 THealPainter.cxx:866
 THealPainter.cxx:867
 THealPainter.cxx:868
 THealPainter.cxx:869
 THealPainter.cxx:870
 THealPainter.cxx:871
 THealPainter.cxx:872
 THealPainter.cxx:873
 THealPainter.cxx:874
 THealPainter.cxx:875
 THealPainter.cxx:876
 THealPainter.cxx:877
 THealPainter.cxx:878
 THealPainter.cxx:879
 THealPainter.cxx:880
 THealPainter.cxx:881
 THealPainter.cxx:882
 THealPainter.cxx:883
 THealPainter.cxx:884
 THealPainter.cxx:885
 THealPainter.cxx:886
 THealPainter.cxx:887
 THealPainter.cxx:888
 THealPainter.cxx:889
 THealPainter.cxx:890
 THealPainter.cxx:891
 THealPainter.cxx:892
 THealPainter.cxx:893
 THealPainter.cxx:894
 THealPainter.cxx:895
 THealPainter.cxx:896
 THealPainter.cxx:897
 THealPainter.cxx:898
 THealPainter.cxx:899
 THealPainter.cxx:900
 THealPainter.cxx:901
 THealPainter.cxx:902
 THealPainter.cxx:903
 THealPainter.cxx:904
 THealPainter.cxx:905
 THealPainter.cxx:906
 THealPainter.cxx:907
 THealPainter.cxx:908
 THealPainter.cxx:909
 THealPainter.cxx:910
 THealPainter.cxx:911
 THealPainter.cxx:912
 THealPainter.cxx:913
 THealPainter.cxx:914
 THealPainter.cxx:915
 THealPainter.cxx:916
 THealPainter.cxx:917
 THealPainter.cxx:918
 THealPainter.cxx:919
 THealPainter.cxx:920
 THealPainter.cxx:921
 THealPainter.cxx:922
 THealPainter.cxx:923
 THealPainter.cxx:924
 THealPainter.cxx:925
 THealPainter.cxx:926
 THealPainter.cxx:927
 THealPainter.cxx:928
 THealPainter.cxx:929
 THealPainter.cxx:930
 THealPainter.cxx:931
 THealPainter.cxx:932
 THealPainter.cxx:933
 THealPainter.cxx:934
 THealPainter.cxx:935
 THealPainter.cxx:936
 THealPainter.cxx:937
 THealPainter.cxx:938
 THealPainter.cxx:939
 THealPainter.cxx:940
 THealPainter.cxx:941
 THealPainter.cxx:942
 THealPainter.cxx:943
 THealPainter.cxx:944
 THealPainter.cxx:945
 THealPainter.cxx:946
 THealPainter.cxx:947
 THealPainter.cxx:948
 THealPainter.cxx:949
 THealPainter.cxx:950
 THealPainter.cxx:951
 THealPainter.cxx:952
 THealPainter.cxx:953
 THealPainter.cxx:954
 THealPainter.cxx:955
 THealPainter.cxx:956
 THealPainter.cxx:957
 THealPainter.cxx:958
 THealPainter.cxx:959
 THealPainter.cxx:960
 THealPainter.cxx:961
 THealPainter.cxx:962
 THealPainter.cxx:963
 THealPainter.cxx:964
 THealPainter.cxx:965
 THealPainter.cxx:966
 THealPainter.cxx:967
 THealPainter.cxx:968
 THealPainter.cxx:969
 THealPainter.cxx:970
 THealPainter.cxx:971
 THealPainter.cxx:972
 THealPainter.cxx:973
 THealPainter.cxx:974
 THealPainter.cxx:975
 THealPainter.cxx:976
 THealPainter.cxx:977
 THealPainter.cxx:978
 THealPainter.cxx:979
 THealPainter.cxx:980
 THealPainter.cxx:981
 THealPainter.cxx:982
 THealPainter.cxx:983
 THealPainter.cxx:984
 THealPainter.cxx:985
 THealPainter.cxx:986
 THealPainter.cxx:987
 THealPainter.cxx:988
 THealPainter.cxx:989
 THealPainter.cxx:990
 THealPainter.cxx:991
 THealPainter.cxx:992
 THealPainter.cxx:993
 THealPainter.cxx:994
 THealPainter.cxx:995
 THealPainter.cxx:996
 THealPainter.cxx:997
 THealPainter.cxx:998
 THealPainter.cxx:999
 THealPainter.cxx:1000
 THealPainter.cxx:1001
 THealPainter.cxx:1002
 THealPainter.cxx:1003
 THealPainter.cxx:1004
 THealPainter.cxx:1005
 THealPainter.cxx:1006
 THealPainter.cxx:1007
 THealPainter.cxx:1008
 THealPainter.cxx:1009
 THealPainter.cxx:1010
 THealPainter.cxx:1011
 THealPainter.cxx:1012
 THealPainter.cxx:1013
 THealPainter.cxx:1014
 THealPainter.cxx:1015
 THealPainter.cxx:1016
 THealPainter.cxx:1017
 THealPainter.cxx:1018
 THealPainter.cxx:1019
 THealPainter.cxx:1020
 THealPainter.cxx:1021
 THealPainter.cxx:1022
 THealPainter.cxx:1023
 THealPainter.cxx:1024
 THealPainter.cxx:1025
 THealPainter.cxx:1026
 THealPainter.cxx:1027
 THealPainter.cxx:1028
 THealPainter.cxx:1029
 THealPainter.cxx:1030
 THealPainter.cxx:1031
 THealPainter.cxx:1032
 THealPainter.cxx:1033
 THealPainter.cxx:1034
 THealPainter.cxx:1035
 THealPainter.cxx:1036
 THealPainter.cxx:1037
 THealPainter.cxx:1038
 THealPainter.cxx:1039
 THealPainter.cxx:1040
 THealPainter.cxx:1041
 THealPainter.cxx:1042
 THealPainter.cxx:1043
 THealPainter.cxx:1044
 THealPainter.cxx:1045
 THealPainter.cxx:1046
 THealPainter.cxx:1047
 THealPainter.cxx:1048
 THealPainter.cxx:1049
 THealPainter.cxx:1050
 THealPainter.cxx:1051
 THealPainter.cxx:1052
 THealPainter.cxx:1053
 THealPainter.cxx:1054
 THealPainter.cxx:1055
 THealPainter.cxx:1056
 THealPainter.cxx:1057
 THealPainter.cxx:1058
 THealPainter.cxx:1059
 THealPainter.cxx:1060
 THealPainter.cxx:1061
 THealPainter.cxx:1062
 THealPainter.cxx:1063
 THealPainter.cxx:1064
 THealPainter.cxx:1065
 THealPainter.cxx:1066
 THealPainter.cxx:1067
 THealPainter.cxx:1068
 THealPainter.cxx:1069
 THealPainter.cxx:1070
 THealPainter.cxx:1071
 THealPainter.cxx:1072
 THealPainter.cxx:1073
 THealPainter.cxx:1074
 THealPainter.cxx:1075
 THealPainter.cxx:1076
 THealPainter.cxx:1077
 THealPainter.cxx:1078
 THealPainter.cxx:1079
 THealPainter.cxx:1080
 THealPainter.cxx:1081
 THealPainter.cxx:1082
 THealPainter.cxx:1083
 THealPainter.cxx:1084
 THealPainter.cxx:1085
 THealPainter.cxx:1086
 THealPainter.cxx:1087
 THealPainter.cxx:1088
 THealPainter.cxx:1089
 THealPainter.cxx:1090
 THealPainter.cxx:1091
 THealPainter.cxx:1092
 THealPainter.cxx:1093
 THealPainter.cxx:1094
 THealPainter.cxx:1095
 THealPainter.cxx:1096
 THealPainter.cxx:1097
 THealPainter.cxx:1098
 THealPainter.cxx:1099
 THealPainter.cxx:1100
 THealPainter.cxx:1101
 THealPainter.cxx:1102
 THealPainter.cxx:1103
 THealPainter.cxx:1104
 THealPainter.cxx:1105
 THealPainter.cxx:1106
 THealPainter.cxx:1107
 THealPainter.cxx:1108
 THealPainter.cxx:1109
 THealPainter.cxx:1110
 THealPainter.cxx:1111
 THealPainter.cxx:1112
 THealPainter.cxx:1113
 THealPainter.cxx:1114
 THealPainter.cxx:1115
 THealPainter.cxx:1116
 THealPainter.cxx:1117
 THealPainter.cxx:1118
 THealPainter.cxx:1119
 THealPainter.cxx:1120
 THealPainter.cxx:1121
 THealPainter.cxx:1122
 THealPainter.cxx:1123
 THealPainter.cxx:1124
 THealPainter.cxx:1125
 THealPainter.cxx:1126
 THealPainter.cxx:1127
 THealPainter.cxx:1128
 THealPainter.cxx:1129
 THealPainter.cxx:1130
 THealPainter.cxx:1131
 THealPainter.cxx:1132
 THealPainter.cxx:1133
 THealPainter.cxx:1134
 THealPainter.cxx:1135
 THealPainter.cxx:1136
 THealPainter.cxx:1137
 THealPainter.cxx:1138
 THealPainter.cxx:1139
 THealPainter.cxx:1140
 THealPainter.cxx:1141
 THealPainter.cxx:1142
 THealPainter.cxx:1143
 THealPainter.cxx:1144
 THealPainter.cxx:1145
 THealPainter.cxx:1146
 THealPainter.cxx:1147
 THealPainter.cxx:1148
 THealPainter.cxx:1149
 THealPainter.cxx:1150
 THealPainter.cxx:1151
 THealPainter.cxx:1152
 THealPainter.cxx:1153
 THealPainter.cxx:1154
 THealPainter.cxx:1155
 THealPainter.cxx:1156
 THealPainter.cxx:1157
 THealPainter.cxx:1158
 THealPainter.cxx:1159
 THealPainter.cxx:1160
 THealPainter.cxx:1161
 THealPainter.cxx:1162
 THealPainter.cxx:1163
 THealPainter.cxx:1164
 THealPainter.cxx:1165
 THealPainter.cxx:1166
 THealPainter.cxx:1167
 THealPainter.cxx:1168
 THealPainter.cxx:1169
 THealPainter.cxx:1170
 THealPainter.cxx:1171
 THealPainter.cxx:1172
 THealPainter.cxx:1173
 THealPainter.cxx:1174
 THealPainter.cxx:1175
 THealPainter.cxx:1176
 THealPainter.cxx:1177
 THealPainter.cxx:1178
 THealPainter.cxx:1179
 THealPainter.cxx:1180
 THealPainter.cxx:1181
 THealPainter.cxx:1182
 THealPainter.cxx:1183
 THealPainter.cxx:1184
 THealPainter.cxx:1185
 THealPainter.cxx:1186
 THealPainter.cxx:1187
 THealPainter.cxx:1188
 THealPainter.cxx:1189
 THealPainter.cxx:1190
 THealPainter.cxx:1191
 THealPainter.cxx:1192
 THealPainter.cxx:1193
 THealPainter.cxx:1194
 THealPainter.cxx:1195
 THealPainter.cxx:1196
 THealPainter.cxx:1197
 THealPainter.cxx:1198
 THealPainter.cxx:1199
 THealPainter.cxx:1200
 THealPainter.cxx:1201
 THealPainter.cxx:1202
 THealPainter.cxx:1203
 THealPainter.cxx:1204
 THealPainter.cxx:1205
 THealPainter.cxx:1206
 THealPainter.cxx:1207
 THealPainter.cxx:1208
 THealPainter.cxx:1209
 THealPainter.cxx:1210
 THealPainter.cxx:1211
 THealPainter.cxx:1212
 THealPainter.cxx:1213
 THealPainter.cxx:1214
 THealPainter.cxx:1215
 THealPainter.cxx:1216
 THealPainter.cxx:1217
 THealPainter.cxx:1218
 THealPainter.cxx:1219
 THealPainter.cxx:1220
 THealPainter.cxx:1221
 THealPainter.cxx:1222
 THealPainter.cxx:1223
 THealPainter.cxx:1224
 THealPainter.cxx:1225
 THealPainter.cxx:1226
 THealPainter.cxx:1227
 THealPainter.cxx:1228
 THealPainter.cxx:1229
 THealPainter.cxx:1230
 THealPainter.cxx:1231
 THealPainter.cxx:1232
 THealPainter.cxx:1233
 THealPainter.cxx:1234
 THealPainter.cxx:1235
 THealPainter.cxx:1236
 THealPainter.cxx:1237
 THealPainter.cxx:1238
 THealPainter.cxx:1239
 THealPainter.cxx:1240
 THealPainter.cxx:1241
 THealPainter.cxx:1242
 THealPainter.cxx:1243
 THealPainter.cxx:1244
 THealPainter.cxx:1245
 THealPainter.cxx:1246
 THealPainter.cxx:1247
 THealPainter.cxx:1248
 THealPainter.cxx:1249
 THealPainter.cxx:1250
 THealPainter.cxx:1251
 THealPainter.cxx:1252
 THealPainter.cxx:1253
 THealPainter.cxx:1254
 THealPainter.cxx:1255
 THealPainter.cxx:1256
 THealPainter.cxx:1257
 THealPainter.cxx:1258
 THealPainter.cxx:1259
 THealPainter.cxx:1260
 THealPainter.cxx:1261
 THealPainter.cxx:1262
 THealPainter.cxx:1263
 THealPainter.cxx:1264
 THealPainter.cxx:1265
 THealPainter.cxx:1266
 THealPainter.cxx:1267
 THealPainter.cxx:1268
 THealPainter.cxx:1269
 THealPainter.cxx:1270
 THealPainter.cxx:1271
 THealPainter.cxx:1272
 THealPainter.cxx:1273
 THealPainter.cxx:1274
 THealPainter.cxx:1275
 THealPainter.cxx:1276
 THealPainter.cxx:1277
 THealPainter.cxx:1278
 THealPainter.cxx:1279
 THealPainter.cxx:1280
 THealPainter.cxx:1281
 THealPainter.cxx:1282
 THealPainter.cxx:1283
 THealPainter.cxx:1284
 THealPainter.cxx:1285
 THealPainter.cxx:1286
 THealPainter.cxx:1287
 THealPainter.cxx:1288
 THealPainter.cxx:1289
 THealPainter.cxx:1290
 THealPainter.cxx:1291
 THealPainter.cxx:1292
 THealPainter.cxx:1293
 THealPainter.cxx:1294
 THealPainter.cxx:1295
 THealPainter.cxx:1296
 THealPainter.cxx:1297
 THealPainter.cxx:1298
 THealPainter.cxx:1299
 THealPainter.cxx:1300
 THealPainter.cxx:1301
 THealPainter.cxx:1302
 THealPainter.cxx:1303
 THealPainter.cxx:1304
 THealPainter.cxx:1305
 THealPainter.cxx:1306
 THealPainter.cxx:1307
 THealPainter.cxx:1308
 THealPainter.cxx:1309
 THealPainter.cxx:1310
 THealPainter.cxx:1311
 THealPainter.cxx:1312
 THealPainter.cxx:1313
 THealPainter.cxx:1314
 THealPainter.cxx:1315
 THealPainter.cxx:1316
 THealPainter.cxx:1317
 THealPainter.cxx:1318
 THealPainter.cxx:1319
 THealPainter.cxx:1320
 THealPainter.cxx:1321
 THealPainter.cxx:1322
 THealPainter.cxx:1323
 THealPainter.cxx:1324
 THealPainter.cxx:1325
 THealPainter.cxx:1326
 THealPainter.cxx:1327
 THealPainter.cxx:1328
 THealPainter.cxx:1329
 THealPainter.cxx:1330
 THealPainter.cxx:1331
 THealPainter.cxx:1332
 THealPainter.cxx:1333
 THealPainter.cxx:1334
 THealPainter.cxx:1335
 THealPainter.cxx:1336
 THealPainter.cxx:1337
 THealPainter.cxx:1338
 THealPainter.cxx:1339
 THealPainter.cxx:1340
 THealPainter.cxx:1341
 THealPainter.cxx:1342
 THealPainter.cxx:1343
 THealPainter.cxx:1344
 THealPainter.cxx:1345
 THealPainter.cxx:1346
 THealPainter.cxx:1347
 THealPainter.cxx:1348
 THealPainter.cxx:1349
 THealPainter.cxx:1350
 THealPainter.cxx:1351
 THealPainter.cxx:1352
 THealPainter.cxx:1353
 THealPainter.cxx:1354
 THealPainter.cxx:1355
 THealPainter.cxx:1356
 THealPainter.cxx:1357
 THealPainter.cxx:1358
 THealPainter.cxx:1359
 THealPainter.cxx:1360
 THealPainter.cxx:1361
 THealPainter.cxx:1362
 THealPainter.cxx:1363
 THealPainter.cxx:1364
 THealPainter.cxx:1365
 THealPainter.cxx:1366
 THealPainter.cxx:1367
 THealPainter.cxx:1368
 THealPainter.cxx:1369
 THealPainter.cxx:1370
 THealPainter.cxx:1371
 THealPainter.cxx:1372
 THealPainter.cxx:1373
 THealPainter.cxx:1374
 THealPainter.cxx:1375
 THealPainter.cxx:1376
 THealPainter.cxx:1377
 THealPainter.cxx:1378
 THealPainter.cxx:1379
 THealPainter.cxx:1380
 THealPainter.cxx:1381
 THealPainter.cxx:1382
 THealPainter.cxx:1383
 THealPainter.cxx:1384
 THealPainter.cxx:1385
 THealPainter.cxx:1386
 THealPainter.cxx:1387
 THealPainter.cxx:1388
 THealPainter.cxx:1389
 THealPainter.cxx:1390
 THealPainter.cxx:1391
 THealPainter.cxx:1392
 THealPainter.cxx:1393
 THealPainter.cxx:1394
 THealPainter.cxx:1395
 THealPainter.cxx:1396
 THealPainter.cxx:1397
 THealPainter.cxx:1398
 THealPainter.cxx:1399
 THealPainter.cxx:1400
 THealPainter.cxx:1401
 THealPainter.cxx:1402
 THealPainter.cxx:1403
 THealPainter.cxx:1404
 THealPainter.cxx:1405
 THealPainter.cxx:1406
 THealPainter.cxx:1407
 THealPainter.cxx:1408
 THealPainter.cxx:1409
 THealPainter.cxx:1410
 THealPainter.cxx:1411
 THealPainter.cxx:1412
 THealPainter.cxx:1413
 THealPainter.cxx:1414
 THealPainter.cxx:1415
 THealPainter.cxx:1416
 THealPainter.cxx:1417
 THealPainter.cxx:1418
 THealPainter.cxx:1419
 THealPainter.cxx:1420
 THealPainter.cxx:1421
 THealPainter.cxx:1422
 THealPainter.cxx:1423
 THealPainter.cxx:1424
 THealPainter.cxx:1425
 THealPainter.cxx:1426
 THealPainter.cxx:1427
 THealPainter.cxx:1428
 THealPainter.cxx:1429
 THealPainter.cxx:1430
 THealPainter.cxx:1431
 THealPainter.cxx:1432
 THealPainter.cxx:1433
 THealPainter.cxx:1434
 THealPainter.cxx:1435
 THealPainter.cxx:1436
 THealPainter.cxx:1437
 THealPainter.cxx:1438
 THealPainter.cxx:1439
 THealPainter.cxx:1440
 THealPainter.cxx:1441
 THealPainter.cxx:1442
 THealPainter.cxx:1443
 THealPainter.cxx:1444
 THealPainter.cxx:1445
 THealPainter.cxx:1446
 THealPainter.cxx:1447
 THealPainter.cxx:1448
 THealPainter.cxx:1449
 THealPainter.cxx:1450
 THealPainter.cxx:1451
 THealPainter.cxx:1452
 THealPainter.cxx:1453
 THealPainter.cxx:1454
 THealPainter.cxx:1455
 THealPainter.cxx:1456
 THealPainter.cxx:1457
 THealPainter.cxx:1458
 THealPainter.cxx:1459
 THealPainter.cxx:1460
 THealPainter.cxx:1461
 THealPainter.cxx:1462
 THealPainter.cxx:1463
 THealPainter.cxx:1464
 THealPainter.cxx:1465
 THealPainter.cxx:1466
 THealPainter.cxx:1467
 THealPainter.cxx:1468
 THealPainter.cxx:1469
 THealPainter.cxx:1470
 THealPainter.cxx:1471
 THealPainter.cxx:1472
 THealPainter.cxx:1473
 THealPainter.cxx:1474
 THealPainter.cxx:1475
 THealPainter.cxx:1476
 THealPainter.cxx:1477
 THealPainter.cxx:1478
 THealPainter.cxx:1479
 THealPainter.cxx:1480
 THealPainter.cxx:1481
 THealPainter.cxx:1482
 THealPainter.cxx:1483
 THealPainter.cxx:1484
 THealPainter.cxx:1485
 THealPainter.cxx:1486
 THealPainter.cxx:1487
 THealPainter.cxx:1488
 THealPainter.cxx:1489
 THealPainter.cxx:1490
 THealPainter.cxx:1491
 THealPainter.cxx:1492
 THealPainter.cxx:1493
 THealPainter.cxx:1494
 THealPainter.cxx:1495
 THealPainter.cxx:1496
 THealPainter.cxx:1497
 THealPainter.cxx:1498
 THealPainter.cxx:1499
 THealPainter.cxx:1500
 THealPainter.cxx:1501
 THealPainter.cxx:1502
 THealPainter.cxx:1503
 THealPainter.cxx:1504
 THealPainter.cxx:1505
 THealPainter.cxx:1506
 THealPainter.cxx:1507
 THealPainter.cxx:1508
 THealPainter.cxx:1509
 THealPainter.cxx:1510
 THealPainter.cxx:1511
 THealPainter.cxx:1512
 THealPainter.cxx:1513
 THealPainter.cxx:1514
 THealPainter.cxx:1515
 THealPainter.cxx:1516
 THealPainter.cxx:1517
 THealPainter.cxx:1518
 THealPainter.cxx:1519
 THealPainter.cxx:1520
 THealPainter.cxx:1521
 THealPainter.cxx:1522
 THealPainter.cxx:1523
 THealPainter.cxx:1524
 THealPainter.cxx:1525
 THealPainter.cxx:1526
 THealPainter.cxx:1527
 THealPainter.cxx:1528
 THealPainter.cxx:1529
 THealPainter.cxx:1530
 THealPainter.cxx:1531
 THealPainter.cxx:1532
 THealPainter.cxx:1533
 THealPainter.cxx:1534
 THealPainter.cxx:1535
 THealPainter.cxx:1536
 THealPainter.cxx:1537
 THealPainter.cxx:1538
 THealPainter.cxx:1539
 THealPainter.cxx:1540
 THealPainter.cxx:1541
 THealPainter.cxx:1542
 THealPainter.cxx:1543
 THealPainter.cxx:1544
 THealPainter.cxx:1545
 THealPainter.cxx:1546
 THealPainter.cxx:1547
 THealPainter.cxx:1548
 THealPainter.cxx:1549
 THealPainter.cxx:1550
 THealPainter.cxx:1551
 THealPainter.cxx:1552
 THealPainter.cxx:1553
 THealPainter.cxx:1554
 THealPainter.cxx:1555
 THealPainter.cxx:1556
 THealPainter.cxx:1557
 THealPainter.cxx:1558
 THealPainter.cxx:1559
 THealPainter.cxx:1560
 THealPainter.cxx:1561
 THealPainter.cxx:1562
 THealPainter.cxx:1563
 THealPainter.cxx:1564
 THealPainter.cxx:1565
 THealPainter.cxx:1566
 THealPainter.cxx:1567
 THealPainter.cxx:1568
 THealPainter.cxx:1569
 THealPainter.cxx:1570
 THealPainter.cxx:1571
 THealPainter.cxx:1572
 THealPainter.cxx:1573
 THealPainter.cxx:1574
 THealPainter.cxx:1575
 THealPainter.cxx:1576
 THealPainter.cxx:1577
 THealPainter.cxx:1578
 THealPainter.cxx:1579
 THealPainter.cxx:1580
 THealPainter.cxx:1581
 THealPainter.cxx:1582
 THealPainter.cxx:1583
 THealPainter.cxx:1584
 THealPainter.cxx:1585
 THealPainter.cxx:1586
 THealPainter.cxx:1587
 THealPainter.cxx:1588
 THealPainter.cxx:1589
 THealPainter.cxx:1590
 THealPainter.cxx:1591
 THealPainter.cxx:1592
 THealPainter.cxx:1593
 THealPainter.cxx:1594
 THealPainter.cxx:1595
 THealPainter.cxx:1596
 THealPainter.cxx:1597
 THealPainter.cxx:1598
 THealPainter.cxx:1599
 THealPainter.cxx:1600
 THealPainter.cxx:1601
 THealPainter.cxx:1602
 THealPainter.cxx:1603
 THealPainter.cxx:1604
 THealPainter.cxx:1605
 THealPainter.cxx:1606
 THealPainter.cxx:1607
 THealPainter.cxx:1608
 THealPainter.cxx:1609
 THealPainter.cxx:1610
 THealPainter.cxx:1611
 THealPainter.cxx:1612
 THealPainter.cxx:1613
 THealPainter.cxx:1614
 THealPainter.cxx:1615
 THealPainter.cxx:1616
 THealPainter.cxx:1617
 THealPainter.cxx:1618
 THealPainter.cxx:1619
 THealPainter.cxx:1620
 THealPainter.cxx:1621
 THealPainter.cxx:1622
 THealPainter.cxx:1623
 THealPainter.cxx:1624
 THealPainter.cxx:1625
 THealPainter.cxx:1626
 THealPainter.cxx:1627
 THealPainter.cxx:1628
 THealPainter.cxx:1629
 THealPainter.cxx:1630
 THealPainter.cxx:1631
 THealPainter.cxx:1632
 THealPainter.cxx:1633
 THealPainter.cxx:1634
 THealPainter.cxx:1635
 THealPainter.cxx:1636
 THealPainter.cxx:1637
 THealPainter.cxx:1638
 THealPainter.cxx:1639
 THealPainter.cxx:1640
 THealPainter.cxx:1641
 THealPainter.cxx:1642
 THealPainter.cxx:1643
 THealPainter.cxx:1644
 THealPainter.cxx:1645
 THealPainter.cxx:1646
 THealPainter.cxx:1647
 THealPainter.cxx:1648
 THealPainter.cxx:1649
 THealPainter.cxx:1650