ROOT logo
// $Id: THealPix.cxx,v 1.38 2008/07/18 00:32:19 oxon Exp $
// Author: Akira Okumura 2008/06/20

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

   This is a port of HEALPix C++ package to ROOT system.
   Original code is available at <http://healpix.jpl.nasa.gov> under GPL.
******************************************************************************/

#include <complex>
#include <cstring>
#include <iostream>
#include "fitsio.h"

#include "TDirectory.h"
#include "THashList.h"
#include "TMath.h"
#include "TPad.h"
#include "TROOT.h"
#include "TStyle.h"
#include "TVector3.h"

#include "THealFFT.h"
#include "THealPix.h"
#include "THealUtil.h"
#include "TVirtualHealPainter.h"

Bool_t THealPix::fgAddDirectory = kTRUE;
Bool_t THealPix::fgDefaultSumw2 = kFALSE;
THealPix::THealTable THealPix::fgTable = THealPix::THealTable();
const Int_t THealPix::fgJrll[] = {2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4};
const Int_t THealPix::fgJpll[] = {1, 3, 5, 7, 0, 2, 4, 6, 1, 3, 5, 7};

THealPix::THealTable::THealTable()
{
  for(Int_t i = 0; i < 0x100; i++){
    fCtab[i] = (i&0x1) | ((i&0x2 ) << 7) | ((i&0x4 ) >> 1) | ((i&0x8 ) << 6)
      | ((i&0x10) >> 2) | ((i&0x20) << 5) | ((i&0x40) >> 3) | ((i&0x80) << 4);
    fUtab[i] = (i&0x1) | ((i&0x2 ) << 1) | ((i&0x4 ) << 2) | ((i&0x8 ) << 3)
      | ((i&0x10) << 4) | ((i&0x20) << 5) | ((i&0x40) << 6) | ((i&0x80) << 7);
  } // i
}

ClassImp(THealPix)

//_____________________________________________________________________________
THealPix::THealPix() : TNamed(), TAttLine(), TAttFill(), TAttMarker()
{
  // Default constructor
  SetOrder(0);
  fDirectory = 0;
  fFunctions = new TList;
  fPainter   = 0;
  fEntries   = 0;
  fNormFactor= 0;
  fTsumw     = fTsumw2 = 0;
  fMaximum   = -1111;
  fMinimum   = -1111;
  fUnit      = "";
  fIsDegree  = kFALSE;
  fIsNested  = kFALSE;
  fXaxis.SetName("xaxis");
  fYaxis.SetName("yaxis");
  fZaxis.SetName("zaxis");
  fXaxis.SetParent(this);
  fYaxis.SetParent(this);
  fZaxis.SetParent(this);
  UseCurrentStyle();
}

//_____________________________________________________________________________
THealPix::~THealPix()
{
  // Destructor
  if(!TestBit(kNotDeleted)){
    return;
  } // if

  if(fFunctions){
    fFunctions->SetBit(kInvalidObject);
    TObject* obj = 0;
    //special logic to support the case where the same object is
    //added multiple times in fFunctions.
    //This case happens when the same object is added with different
    //drawing modes
    //In the loop below we must be careful with objects (eg TCutG) that may
    // have been added to the list of functions of several histograms
    //and may have been already deleted.
    while((obj = fFunctions->First())){
      while(fFunctions->Remove(obj)){ }
      if(!obj->TestBit(kNotDeleted)){
	break;
      } // if
      delete obj;
      obj = 0;
    } // while
    delete fFunctions;
    fFunctions = 0;
  } // if

  if(fDirectory){
    fDirectory->Remove(this);
    fDirectory = 0;
  } // if

  delete fPainter;
  fPainter = 0;
}

//_____________________________________________________________________________
THealPix::THealPix(const char* name, const char* title, Int_t order,
		   Bool_t isNested)
  : TNamed(name, title), TAttLine(), TAttFill(), TAttMarker()
{
  // Constructor
  fIsNested = isNested;
  fUnit     = "";
  Build();

  if(order < 0)  order = 0;
  if(order > 13) order = 13;

  SetOrder(order);
  if(fgDefaultSumw2){
    Sumw2();
  } // if
}

//_____________________________________________________________________________
THealPix::THealPix(const THealPix& hp) : TNamed(), TAttLine(), TAttFill(), TAttMarker()
{
  // Copy constructor
  ((THealPix&)hp).Copy(*this);
}

//______________________________________________________________________________
void THealPix::Add(const THealPix* hp1, Double_t c1)
{
  // Performs the operation: this = this + c1*hp1
  // if errors are defined (see THealPix::Sumw2), errors are also recalculated.
  // Note that if h1 has Sumw2 set, Sumw2 is automatically called for this
  // if not already set.
  //
  // SPECIAL CASE (Average/Efficiency HEALPixs)
  // For HEALPixs representing averages or efficiencies, one should compute the
  // average of the two HEALPixs and not the sum. One can mark a histogram to be
  // an average HEALPix by setting its bit kIsAverage with
  //    myhp.SetBit(THealPix::kIsAverage);
  // Note that the two HELAPixs must have their kIsAverage bit set
  //
  // IMPORTANT NOTE1: If you intend to use the errors of this HEALPix later
  // you should call Sumw2 before making this operation.
  // This is particularly important if you fit the histogram after THealPix::Add
  //
  // IMPORTANT NOTE2: if hp1 has a normalisation factor, the normalisation
  // factor is used, ie this = this + c1*factor*hp1
  // Use the other THealPix::Add function if you do not want this feature
  if(!hp1){
    Error("Add", "Attempt to add a non-existing HEALPix");
    return;
  } // if
  
  // Check HEALPix compatibility
  if(fOrder != hp1->GetOrder() || fIsNested != hp1->IsNested()){
    Error("Add", "Attempt to add HEALPixs with different number of order or scheme");
    return;
  } // if

  // Create Sumw2 if hp1 has Sumw2 set
  if(fSumw2.fN == 0 && hp1->GetSumw2N() != 0){
    Sumw2();
  } // if

  // Add statistics
  fEntries += c1*hp1->GetEntries();
 
  Double_t factor = 1;
  if(hp1->GetNormFactor() != 0){
    factor = hp1->GetNormFactor()/hp1->GetSumOfWeights();;
  } // if
  for(Int_t bin = 0; bin < fNpix; bin++){
    //special case where histograms have the kIsAverage bit set
    if(this->TestBit(kIsAverage) && hp1->TestBit(kIsAverage)){
      Double_t v1 = hp1->GetBinContent(bin);
      Double_t v2 = this->GetBinContent(bin);
      Double_t e1 = hp1->GetBinError(bin);
      Double_t e2 = this->GetBinError(bin);
      Double_t w1 = 1., w2 = 1.;
      if(e1 > 0) w1 = 1./(e1*e1);
      if(e2 > 0) w2 = 1./(e2*e2);
      SetBinContent(bin, (w1*v1 + w2*v2)/(w1 + w2));
      if(fSumw2.fN){
	fSumw2.fArray[bin] = 1./(w1 + w2);
      } // if
    } else {
      Double_t cu = c1*factor*hp1->GetBinContent(bin);
      AddBinContent(bin, cu);
      if(fSumw2.fN){
	Double_t e1 = factor*hp1->GetBinError(bin);
	fSumw2.fArray[bin] += c1*c1*e1*e1;
      } // if
    } // if
  } // i

}

//______________________________________________________________________________
void THealPix::Add(const THealPix* hp1, const THealPix* hp2, Double_t c1, Double_t c2)
{
  // Replace contents of this HEALPix by the addition of hp1 and hp2
  //
  //   this = c1*hp1 + c2*hp2
  // if errors are defined (see THealPix::Sumw2), errors are also recalculated
  // Note that if hp1 or hp2 have Sumw2 set, Sumw2 is automatically called for
  // this if not already set.
  //
  // SPECIAL CASE (Average/Efficiency HEALPixs)
  // For HEALPixs representing averages or efficiencies, one should compute the
  // average of the two HEALPixs and not the sum. One can mark a HEALPix to be
  // an average HEALPix by setting its bit kIsAverage with
  //    myhp.SetBit(THealPix::kIsAverage);
  // Note that the two HEALPixs must have their kIsAverage bit set
  //
  // IMPORTANT NOTE: If you intend to use the errors of this HEALPix later
  // you should call Sumw2 before making this operation.
  // This is particularly important if you fit the HEALPix after THealPix::Add
  if(!hp1 || !hp2){
    Error("Add", "Attempt to add a non-existing HEALPix");
    return;
  } // if

  Bool_t normWidth = kFALSE;
  if(hp1 == hp2 && c2 < 0){
    c2 = 0;
    normWidth = kTRUE;
  } // if
  // Check HEALPix compatibility
  if(fOrder != hp1->GetOrder() || fIsNested != hp1->IsNested()
  || fOrder != hp2->GetOrder() || fIsNested != hp2->IsNested()){
    Error("Add", "Attempt to add HEALPixs with different number of order or scheme");
    return;
  } // if

  // Create Sumw2 if hp1 or hp2 have Sumw2 set
  if(fSumw2.fN == 0 && (hp1->GetSumw2N() !=0 || hp2->GetSumw2N()  != 0)){
    Sumw2();
  } // if

  // Add statistics
  Double_t nEntries = c1*hp1->GetEntries() + c2*hp2->GetEntries();
  
  for(Int_t bin = 0; bin < fNpix; bin++){
    if(hp1->TestBit(kIsAverage) && hp2->TestBit(kIsAverage)){
      Double_t v1 = hp1->GetBinContent(bin);
      Double_t v2 = hp2->GetBinContent(bin);
      Double_t e1 = hp1->GetBinError(bin);
      Double_t e2 = hp2->GetBinError(bin);
      Double_t w1 = 1., w2 = 1.;
      if (e1 > 0) w1 = 1./(e1*e1);
      if (e2 > 0) w2 = 1./(e2*e2);
      SetBinContent(bin, (w1*v1 + w2*v2)/(w1 + w2));
      if(fSumw2.fN){
	fSumw2.fArray[bin] = 1./(w1 + w2);
      } // if
    } else {
      if(normWidth){
	Double_t w = 4.*TMath::Pi()/fNpix;
	Double_t cu = c1*hp1->GetBinContent(bin)/w;
	SetBinContent(bin, cu);
	if(fSumw2.fN){
	  Double_t e1 = hp1->GetBinError(bin)/w;
	  fSumw2.fArray[bin] = c1*c1*e1*e1;
	} // if
      } else {
	Double_t cu = c1*hp1->GetBinContent(bin) + c2*hp2->GetBinContent(bin);
	SetBinContent(bin, cu);
	if(fSumw2.fN){
	  Double_t e1 = hp1->GetBinError(bin);
	  Double_t e2 = hp2->GetBinError(bin);
	  fSumw2.fArray[bin] = c1*c1*e1*e1 + c2*c2*e2*e2;
	} // if
      } // if
    } // if
  } // i

  SetEntries(nEntries);
}

//______________________________________________________________________________
void THealPix::AddBinContent(Int_t)
{
  // Increment bin content by 1
  AbstractMethod("AddBinContent");
}

//______________________________________________________________________________
void THealPix::AddBinContent(Int_t, Double_t)
{
  // Incremetn bin content by a weight w
  AbstractMethod("AddBinContent");
}

//_____________________________________________________________________________
void THealPix::AddDirectory(Bool_t add)
{
  // Stes the flag controlling the automatic add of HEALPix in memory
  //
  // By default (fAddDirectory = kTRUE), HEALPixs are automatically added to the
  // list of objects in memory.
  // Note that one HEALPix can be removed from its support directory by calling
  // hp->SetDirectory(0) or hp->SetDirectory(dir) to add it to the list of
  // objects in the directory dir.
  //
  // NOTE that this is a static function. To call it, use;
  // THealPix::AddDirectory
  fgAddDirectory = add;
}

//_____________________________________________________________________________
Bool_t THealPix::AddDirectoryStatus()
{
  return fgAddDirectory;
}

//_____________________________________________________________________________
void THealPix::Build()
{
  // Creates HEALPix basic data structure
  fDirectory  = 0;
  fPainter    = 0;
  fEntries    = 0;
  fNormFactor = 0;
  fIsDegree   = kFALSE;
  fTsumw      = 0;
  fTsumw2     = 0;
  fMaximum    = -1111;
  fMinimum    = -1111;
  fUnit       = "";
  fXaxis.SetName("xaxis");
  fYaxis.SetName("yaxis");
  fZaxis.SetName("zaxis");
  fXaxis.Set(1, 0., 360.);
  fYaxis.Set(1, 0., 180.);
  fZaxis.Set(1, 0., 1.);
  fXaxis.SetNdivisions(408, kFALSE);
  fYaxis.SetNdivisions(408, kFALSE);
  fXaxis.SetParent(this);
  fYaxis.SetParent(this);
  fZaxis.SetParent(this);

  SetTitle(fTitle.Data());
  
  fFunctions = new TList;

  UseCurrentStyle();

  if(THealPix::AddDirectoryStatus()){
    fDirectory = gDirectory;
    if(fDirectory){
      fDirectory->Append(this, kTRUE);
    } // if
  } // if
}

//_____________________________________________________________________________
void THealPix::Copy(TObject& obj) const
{
  // Copy this HEALPix structure to obj
  //
  // Note that this function does not copy the list of associated functions.
  // Use TObJect::Clone to make a full copy of a HEALPix
  if(((THealPix&)obj).fDirectory){
    // We are likely to change the hash value of this object
    // with TNamed::Copy, to keep things correct, we need to
    // clean up its existing entries.
    ((THealPix&)obj).fDirectory->Remove(&obj);
    ((THealPix&)obj).fDirectory = 0;
  } // if
  TNamed::Copy(obj);
  ((THealPix&)obj).fNormFactor= fNormFactor;
  ((THealPix&)obj).fBarOffset = fBarOffset;
  ((THealPix&)obj).fBarWidth  = fBarWidth;
  ((THealPix&)obj).fOrder     = fOrder;
  ((THealPix&)obj).fNside     = fNside;
  ((THealPix&)obj).fNpix      = fNpix;
  ((THealPix&)obj).fNside2    = fNside2;
  ((THealPix&)obj).f3Nside2   = f3Nside2;
  ((THealPix&)obj).f2over3Nside= f2over3Nside;
  ((THealPix&)obj).f4Nside    = f4Nside;
  ((THealPix&)obj).f2Nside    = f2Nside;
  ((THealPix&)obj).fNcap      = fNcap;
  ((THealPix&)obj).fIsDegree  = fIsDegree;
  ((THealPix&)obj).fIsNested  = fIsNested;
  ((THealPix&)obj).fUnit      = fUnit;
  ((THealPix&)obj).fTsumw     = fTsumw;
  ((THealPix&)obj).fTsumw2    = fTsumw2;
  ((THealPix&)obj).fMaximum   = fMaximum;
  ((THealPix&)obj).fMinimum   = fMinimum;
  ((THealPix&)obj).fOption    = fOption;

  TArray* a = dynamic_cast<TArray*>(&obj);
  if(a){
    a->Set(fNpix);
  } // if
  for(Int_t i = 0; i < fNpix; i++){
    ((THealPix&)obj).SetBinContent(i, this->GetBinContent(i));
  } // i
  ((THealPix&)obj).fEntries  = fEntries;
  
  TAttLine::Copy(((THealPix&)obj));
  TAttFill::Copy(((THealPix&)obj));
  TAttMarker::Copy(((THealPix&)obj));
  fXaxis.Copy(((THealPix&)obj).fXaxis);
  fYaxis.Copy(((THealPix&)obj).fYaxis);
  fZaxis.Copy(((THealPix&)obj).fZaxis);
  ((THealPix&)obj).fXaxis.SetParent(&obj);
  ((THealPix&)obj).fYaxis.SetParent(&obj);
  ((THealPix&)obj).fZaxis.SetParent(&obj);
  fContour.Copy(((THealPix&)obj).fContour);
  fSumw2.Copy(((THealPix&)obj).fSumw2);

  if(fgAddDirectory && gDirectory){
    gDirectory->Append(&obj);
    ((THealPix&)obj).fDirectory = gDirectory;
  } // if
}

//______________________________________________________________________________
void THealPix::Divide(const THealPix* hp1)
{
  // Divide this HEALPix by hp1
  //
  // this = this/hp1
  // If errors are defined (see THealPix::Sumw2), errors are also recalculated.
  // Note that if hp1 has Sumw2 set, Sumw2 is automatically called for this
  // if not already set.
  // The resulting errors are calculated assuming uncorrelated HEALPixs.
  // See the other THealPix::Divide that gives the possibility to optionaly
  // compute Binomial errors.
  //
  // IMPORTANT NOTE: If you intend to use the errors of this HEALPix later
  // you should call Sumw2 before making this operation.
  // This is particularly important if you fit the HEALPix after THealPix::Scale
  if(!hp1){
    Error("Divide", "Attempt to divide by a non-existing HEALPix");
    return;
  } // if
  
  // Check HEALPix compatibility
  if(fOrder != hp1->GetOrder() || fIsNested != hp1->IsNested()){
    Error("Divide", "Attempt to devide HEALPixs with different number of order or scheme");
    return;
  } // if

  // Create Sumw2 if hp1 has Sumw2 set
  if(fSumw2.fN == 0 && hp1->GetSumw2N() != 0){
    Sumw2();
  } // if

  // Reset statistics
  Double_t nEntries = fEntries;
  fEntries = fTsumw = 0;

  for(Int_t i = 0; i < fNpix; i++){
    Double_t c0 = GetBinContent(i);
    Double_t c1 = hp1->GetBinContent(i);
    Double_t w;
    if(c1) w = c0/c1;
    else   w = 0;
    SetBinContent(i, w);
    fEntries++;
    if(fSumw2.fN){
      Double_t e0 = GetBinError(i);
      Double_t e1 = hp1->GetBinError(i);
      Double_t c12 = c1*c1;
      if(!c1){
	fSumw2.fArray[i] = 0;
	continue;
      } // if
      fSumw2.fArray[i] = (e0*e0*c1*c1 + e1*e1*c0*c0)/(c12*c12);
    } // if
  } // i

  SetEntries(nEntries);
}

//______________________________________________________________________________
Int_t THealPix::Fill(Double_t theta, Double_t phi)
{
  // Increments bin with polar coordinates by 1.
  //
  // If the storage of the sum of squares of weights has been triggered,
  // via the function Sumw2, then the sum of the sqaures of weights is
  // incremented by w^2 in the bin.
  Int_t bin = FindBin(theta, phi);
  fEntries++;
  AddBinContent(bin);
  if(fSumw2.fN){
    fSumw2.fArray[bin]++;
  } // if
  fTsumw++;
  fTsumw2++;
  return bin;
}

//______________________________________________________________________________
Int_t THealPix::Fill(Double_t theta, Double_t phi, Double_t w)
{
  // Increments bin with polar coordinates with a weight w.
  //
  // If the storage of the sum of squares of weights has been triggered,
  // via the function Sumw2, then the sum of the sqaures of weights is
  // incremented by w^2 in the bin.
  Int_t bin = FindBin(theta, phi);
  fEntries++;
  AddBinContent(bin, w);
  if(fSumw2.fN){
    fSumw2.fArray[bin] += w*w;
  } // if
  Double_t z = (w > 0 ? w : -w);
  fTsumw  += z;
  fTsumw2 += z*z;
  return bin;
}

//______________________________________________________________________________
Int_t THealPix::Fill(const Double_t* x)
{
  // Increments bin with cartesian coordinates by 1.
  //
  // If the storage of the sum of squares of weights has been triggered,
  // via the function Sumw2, then the sum of the sqaures of weights is
  // incremented by w^2 in the bin.
  TVector3 vec(x);

  if(fIsDegree){
    return Fill(vec.Theta()*TMath::RadToDeg(), vec.Phi()*TMath::RadToDeg());
  } else {
    return Fill(vec.Theta(), vec.Phi());
  } // if
}

//______________________________________________________________________________
Int_t THealPix::Fill(const Double_t* x, Double_t w)
{
  // Increments bin with cartesian coordinates with a weight w
  //
  // If the storage of the sum of squares of weights has been triggered,
  // via the function Sumw2, then the sum of the sqaures of weights is
  // incremented by w^2 in the bin.
  TVector3 vec(x);

  if(fIsDegree){
    return Fill(vec.Theta()*TMath::RadToDeg(), vec.Phi()*TMath::RadToDeg(), w);
  } else {
    return Fill(vec.Theta(), vec.Phi(), w);
  } // if
}

//______________________________________________________________________________
Int_t THealPix::Fill(const Float_t* x)
{
  // Increments bin with cartesian coordinates by 1.
  //
  // If the storage of the sum of squares of weights has been triggered,
  // via the function Sumw2, then the sum of the sqaures of weights is
  // incremented by w^2 in the bin.
  TVector3 vec(x);

  if(fIsDegree){
    return Fill(vec.Theta()*TMath::RadToDeg(), vec.Phi()*TMath::RadToDeg());
  } else {
    return Fill(vec.Theta(), vec.Phi());
  } // if
}

//______________________________________________________________________________
Int_t THealPix::Fill(const Float_t* x, Double_t w)
{
  // Increments bin with cartesian coordinates with a weight w
  //
  // If the storage of the sum of squares of weights has been triggered,
  // via the function Sumw2, then the sum of the sqaures of weights is
  // incremented by w^2 in the bin.
  TVector3 vec(x);

  if(fIsDegree){
    return Fill(vec.Theta()*TMath::RadToDeg(), vec.Phi()*TMath::RadToDeg(), w);
  } else {
    return Fill(vec.Theta(), vec.Phi(), w);
  } // if
}

//_____________________________________________________________________________
Int_t THealPix::FindBin(Double_t theta, Double_t phi) const
{
  // Return the bin number corresponds to (theta, phi).
  //
  // Oribinal code is Healpix_Base::ang2pix_z_phi of HEALPix C++
  if(fIsDegree){
    theta *= TMath::DegToRad();
    phi   *= TMath::DegToRad();
  } // if

  // Theta must be in range [0, pi] # NOT [0, pi)
  while(theta < 0)               theta += TMath::TwoPi();
  while(theta >= TMath::TwoPi()) theta -= TMath::TwoPi();
  if(theta > TMath::Pi()){
    theta -= TMath::Pi();
    phi   += TMath::Pi();
  } // if

  // Phi must be in range [0, 2pi)
  while(phi   < 0)               phi   += TMath::TwoPi();
  while(phi   >= TMath::TwoPi()) phi   -= TMath::TwoPi();

  Double_t z = TMath::Cos(theta);
  Double_t zabs = TMath::Abs(z);
  Double_t z0 = 2./3.;
  // Conversion [0, 2pi) => [0, 4)
  Double_t tt = ::Modulo(phi, TMath::TwoPi())/TMath::PiOver2();

  if(!fIsNested){ // RING
    if(zabs <= z0){ // Equatorial region
      Double_t temp1 = fNside*(0.5 + tt);
      Double_t temp2 = fNside*z*0.75;
      Int_t jp = Int_t(temp1 - temp2); // index of  ascending edge line
      Int_t jm = Int_t(temp1 + temp2); // index of descending edge line
      
      // ring number counted from z = 2/3
      Int_t ir = fNside + 1 + jp - jm; // in {1,2n+1}
      Int_t kshift = 1 - (ir&1); // kshift=1 if ir even, 0 otherwise
      
      Int_t ip = (jp + jm -fNside + kshift + 1)/2; // in {0,4n-1}
      ip = ::Modulo(ip, f4Nside);
      
      return fNcap + (ir - 1)*f4Nside + ip;
    } else { // North & South polar caps
      Double_t tp = tt - Int_t(tt);
      Double_t tmp = fNside*TMath::Sqrt(3*(1 - zabs));
      
      Int_t jp = Int_t(tp*tmp); // increasing edge line index
      Int_t jm = Int_t((1. - tp)*tmp); // decreasing edge line index
      
      Int_t ir = jp + jm + 1; // ring number counted from the closest pole
      Int_t ip = Int_t(tt*ir); // in {0,4*ir-1}
      ip = ::Modulo(ip, 4*ir);
      
      if(z>0){
	return 2*ir*(ir - 1) + ip;
      } else {
	return fNpix - 2*ir*(ir + 1) + ip;
      } // if
    } // if
  } else { // scheme_ == NEST
    const Int_t order_max = 13;
    const Int_t ns_max = 1<<order_max;
    Int_t face_num, ix, iy;
    
    if(zabs <= z0){ // Equatorial region
      Double_t temp1 = ns_max*(0.5 + tt);
      Double_t temp2 = ns_max*z*0.75;
      Int_t jp = Int_t(temp1 - temp2); // index of  ascending edge line
      Int_t jm = Int_t(temp1 + temp2); // index of descending edge line
      Int_t ifp = jp >> order_max;  // in {0,4}
      Int_t ifm = jm >> order_max;
      if(ifp == ifm){           // faces 4 to 7
	face_num = (ifp == 4) ? 4: ifp + 4;
      } else if(ifp < ifm){       // (half-)faces 0 to 3
	face_num = ifp;
      } else {                     // (half-)faces 8 to 11
	face_num = ifm + 8;
      } // if
      
      ix = jm & (ns_max-1);
      iy = ns_max - (jp & (ns_max-1)) - 1;
    } else { // polar region, zabs > 2/3
      Int_t ntt = Int_t(tt);
      Double_t tp = tt - ntt;
      Double_t tmp = ns_max*TMath::Sqrt(3.*(1 - zabs));
      
      Int_t jp = Int_t(tp*tmp); // increasing edge line index
      Int_t jm = Int_t((1. - tp)*tmp); // decreasing edge line index
      if(jp >= ns_max){
	jp = ns_max - 1; // for points too close to the boundary
      } // if
      if(jm >= ns_max){
	jm = ns_max - 1;
      } // if
      if(z >= 0){
	face_num = ntt;  // in {0,3}
	ix = ns_max - jm - 1;
	iy = ns_max - jp - 1;
      } else {
	face_num = ntt + 8; // in {8,11}
	ix =  jp;
	iy =  jm;
      } // if
    } // if
    
    Int_t ipf = XY2Pix(ix, iy);
    
    ipf >>= (2*(order_max - fOrder));  // in {0, fNside**2 - 1}
    
    return ipf + (face_num << (2*fOrder));    // in {0, 12*fNside**2 - 1}
  } // if
}

//______________________________________________________________________________
Double_t THealPix::GetAverage() const
{
  // Return the average of all bin contents.
  Double_t total = 0;
  for(Int_t i = 0; i < fNpix; i++){
    total += GetBinContent(i);
  } // i
  
  return total/fNpix;
}

//_____________________________________________________________________________
Double_t THealPix::GetBinArea(Bool_t degree2) const
{
  // Return the solid angle of each bin. If degree2 == kTRUE, return value is
  // in unit of degree.
  Double_t area = TMath::Pi()*4/fNpix;
  if(degree2){
    area *= TMath::RadToDeg()*TMath::RadToDeg();
  } // if

  return area;
}

//______________________________________________________________________________
void THealPix::GetBinCenter(Int_t bin, Double_t& theta, Double_t& phi) const
{
  GetBinCenter(bin, &theta, &phi);
}

//______________________________________________________________________________
void THealPix::GetBinCenter(Int_t bin, Double_t* theta, Double_t* phi) const
{
  // Return the coordinates of bin center. If the default unit is set to degre
  // via THealPix::SetDegree, theta and phi are given in unit of degree.
  //
  // Oribinal code is Healpix_Base::pix2ang of HEALPix C++
  // See Gorski et al. ApJ 622 (2005) for equation numbering

  if(fIsNested){
    bin = Nest2Ring(bin);
  } // if

  if(bin < fNcap){ // North Polar cap
    Int_t i = Int_t(.5*(1 + ::Isqrt(1 + 2*bin))); //counted from North pole
    Int_t j = (bin + 1) - 2*i*(i - 1); // (3)
    *theta = TMath::ACos(1.0 - (i*i)/f3Nside2); // (4)
    *phi   = (j - .5)*TMath::Pi()/(2.*i); // (5)
  } else if(bin < (fNpix - fNcap)){ // Equatorial region
    Int_t ip = bin - fNcap;
    Int_t i = ip/f4Nside + fNside; // (6) counted from North pole
    Int_t j = ip%f4Nside + 1;      // (7)
    // 1 if i+Nside is odd, 1/2 otherwise
    Double_t fodd = ((i + fNside)&1) ? 1 : 0.5;
    
    *theta = TMath::ACos(4./3. - i*f2over3Nside); // (8)
    *phi   = (j - fodd) * TMath::Pi()/f2Nside;    // (9)
  } else { // South Polar cap
    Int_t ip = fNpix - bin;
    Int_t i = Int_t(0.5*(1 + ::Isqrt(2*ip - 1))); //counted from South pole
    Int_t j = 4*i + 1 - (ip - 2*i*(i - 1)); //(3)
    
    *theta = TMath::ACos(-1. + (i*i)/f3Nside2); // (4)
    *phi   = (j - .5)*TMath::PiOver2()/i;       // (5)
  } // if

  if(fIsDegree){
    *theta *= TMath::RadToDeg();
    *phi   *= TMath::RadToDeg();
  } // if
}

//______________________________________________________________________________
Double_t THealPix::GetBinContent(Int_t) const
{
  // Get the content of a bin.
  AbstractMethod("GetBinContent");
  return 0;
}

//______________________________________________________________________________
Int_t THealPix::GetBinVertices(Int_t bin, Double_t* x, Double_t* y) const
{
  // Return the coordinates of four or five vertices of each bin. Their unit
  // is always degree. The return value is the number of vertices. Five vertices
  // are given to only eight polar bins.
  if(fIsNested){
    bin = Nest2Ring(bin);
  } // if

  if(bin < fNcap){ // North polar cap
    Int_t i = Int_t(.5*(1 + ::Isqrt(1 + 2*bin)));
    Int_t j = (bin + 1) - 2*i*(i - 1); // (3)
    Double_t theta0 = TMath::RadToDeg()*TMath::ACos(1 - (i*i)/f3Nside2); // (4)
    Double_t theta1 = TMath::RadToDeg()*TMath::ACos(1 - ((i+1)*(i+1))/f3Nside2);
    Double_t theta2 = TMath::RadToDeg()*TMath::ACos(1 - ((i-1)*(i-1))/f3Nside2);
    //    Double_t phi0 = (j -  .5)*90./i; // (5)
    Double_t phi1 = (j     )*90./i; // eastward
    Double_t phi2 = (j - 1.)*90./i; // westward
    Double_t phi3 = (j + (j - 1)/i)*90./(i + 1); // southward
    if(i != 1){
      Double_t phi4 = (j - (j - 1)/i - 1. )*90./(i - 1); // northward
      x[0] = phi3; y[0] = theta1;
      x[1] = phi1; y[1] = theta0;
      x[2] = phi4; y[2] = theta2;
      x[3] = phi2; y[3] = theta0;
      return 4;
    } else {
      x[0] = phi3; y[0] = theta1;
      x[1] = phi1; y[1] = theta0;
      x[2] = phi1; y[2] = theta2;
      x[3] = phi2; y[3] = theta2;
      x[4] = phi2; y[4] = theta0;
      return 5;
    } // if
  } else if(bin < fNcap + f4Nside){
    Int_t i = Int_t(.5*(1 + ::Isqrt(1 + 2*bin)));
    Int_t j = (bin + 1) - 2*i*(i - 1); // (3)
    Double_t theta0 = TMath::RadToDeg()*TMath::ACos(1 - (i*i)/f3Nside2); // (4)
    Double_t theta1 = TMath::RadToDeg()*TMath::ACos(4./3. - (fNside+1)*f2over3Nside);
    Double_t theta2 = TMath::RadToDeg()*TMath::ACos(1 - ((i-1)*(i-1))/f3Nside2);
    Double_t phi0 = (j -  .5)*90./i; // (5)
    Double_t phi1 = (j     )*90./i; // eastward
    Double_t phi2 = (j - 1.)*90./i; // westward
    Double_t phi3 = (j - (j - 1)/i - 1. )*90./(i - 1); // northward
    x[0] = phi0; y[0] = theta1;
    x[1] = phi1; y[1] = theta0;
    x[2] = phi3; y[2] = theta2;
    x[3] = phi2; y[3] = theta0;
    return 4;
  } else if(bin < fNpix - fNcap - f4Nside){ // Eqatorial region
    Int_t pdash = bin - fNcap;
    Int_t i = pdash/f4Nside + fNside; // (6)
    Int_t j = pdash%f4Nside + 1;      // (7)
    Double_t z = 4./3. - i*f2over3Nside; // (8)
    Double_t theta0 = TMath::RadToDeg()*TMath::ACos(z);
    Double_t theta1 = TMath::RadToDeg()*TMath::ACos(z + f2over3Nside);
    Double_t theta2 = TMath::RadToDeg()*TMath::ACos(z - f2over3Nside);

    Double_t fodd = ((i + fNside)&1) ? 1 : 0.5;
    Double_t phi0 = (j - fodd)*180./f2Nside; // (9)
    Double_t phi1 = phi0 + 180./f4Nside;
    Double_t phi2 = phi0 - 180./f4Nside;
    x[0] = phi0; y[0] = theta1; // counter clock wise from south
    x[1] = phi1; y[1] = theta0;
    x[2] = phi0; y[2] = theta2;
    x[3] = phi2; y[3] = theta0;
    return 4;
  } else if(bin < fNpix - fNcap){
    Int_t ip = fNpix - bin;
    Int_t i = Int_t(.5*(1 + ::Isqrt(2*ip - 1)));
    Int_t j = 4*i + 1 - (ip - 2*i*(i - 1)); // (3)
    Double_t theta0 = TMath::RadToDeg()*TMath::ACos(-1 + (i*i)/f3Nside2); // (4)
    Double_t theta1 = TMath::RadToDeg()*TMath::ACos(-4./3. + (fNside+1)*f2over3Nside);
    Double_t theta2 = TMath::RadToDeg()*TMath::ACos(-1 + ((i-1)*(i-1))/f3Nside2);
    Double_t phi0 = (j -  .5)*90./i; // (5)
    Double_t phi1 = (j     )*90./i; // eastward
    Double_t phi2 = (j - 1.)*90./i; // westward
    Double_t phi3 = (j - (j - 1)/i - 1. )*90./(i - 1); // northward
    x[0] = phi0; y[0] = theta1;
    x[1] = phi1; y[1] = theta0;
    x[2] = phi3; y[2] = theta2;
    x[3] = phi2; y[3] = theta0;
    return 4;
  } else { // South polar cap
    Int_t ip = fNpix - bin;
    Int_t i = Int_t(.5*(1 + ::Isqrt(2*ip - 1)));
    Int_t j = 4*i + 1 - (ip - 2*i*(i - 1)); // (3)
    Double_t theta0 = TMath::RadToDeg()*TMath::ACos(-1 + (i*i)/f3Nside2); // (4)
    Double_t theta1 = TMath::RadToDeg()*TMath::ACos(-1 + ((i+1)*(i+1))/f3Nside2);
    Double_t theta2 = TMath::RadToDeg()*TMath::ACos(-1 + ((i-1)*(i-1))/f3Nside2);
    //    Double_t phi0 = (j -  .5)*90./i; // (5)
    Double_t phi1 = (j     )*90./i; // eastward
    Double_t phi2 = (j - 1.)*90./i; // westward
    Double_t phi3 = (j + (j - 1)/i)*90./(i + 1); // southward
    if(i != 1){
      Double_t phi4 = (j - (j - 1)/i - 1. )*90./(i - 1); // northward
      x[0] = phi3; y[0] = theta1;
      x[1] = phi1; y[1] = theta0;
      x[2] = phi4; y[2] = theta2;
      x[3] = phi2; y[3] = theta0;
      return 4;
    } else {
      x[0] = phi3; y[0] = theta1;
      x[1] = phi1; y[1] = theta0;
      x[2] = phi1; y[2] = theta2;
      x[3] = phi2; y[3] = theta2;
      x[4] = phi2; y[4] = theta0;
      return 5;
    } // if
  } // if
}

//______________________________________________________________________________
Bool_t THealPix::GetDefaultSumw2()
{
  // static function
  // return kTRUE if THealPix::Sumw2 must be called when creating new HEALPix.
  // see THealPix::SetDefaultSumw2.

  return fgDefaultSumw2;
}

//______________________________________________________________________________
Double_t THealPix::GetEntries() const
{
  // Return the current number of entries
  return fEntries;
}

//______________________________________________________________________________
void THealPix::GetRingInfo(Int_t ring, Int_t& startpix, Int_t& ringpix,
			   Double_t &costheta, Double_t& sintheta,
			   Bool_t& shifted) const
{
  if(fIsNested){
    Error("GetRingInfo", "Only RING scheme is supported");
    return;
  } // if

  Int_t northring = (ring > f2Nside) ? f4Nside - ring : ring;

  if(northring < fNside){
    costheta = 1 - northring*northring*4./fNpix;
    sintheta = TMath::Sin(2*TMath::ASin(northring/(TMath::Sqrt(6.)*fNside)));
    ringpix = 4*northring;
    shifted = kTRUE;
    startpix = 2*northring*(northring - 1);
  } else {
    costheta = (f2Nside - northring)*(8.*fNside/fNpix);
    sintheta = TMath::Sqrt(1 - costheta*costheta);
    ringpix = f4Nside;
    shifted = ((northring - fNside) & 1) == 0;
    startpix = fNcap + (northring - fNside)*ringpix;
  } // if

  if(northring != ring){ // southern hemisphere
    costheta = -costheta;
    startpix = fNpix - startpix - ringpix;
  } // if
}

//______________________________________________________________________________
Double_t THealPix::GetSumOfWeights() const
{
  // Return the sum of weights
  Double_t sum =0;
  for(Int_t i = 0; i <= fNpix; i++) {
    sum += GetBinContent(i);
  } // i
  return sum;
}

//_____________________________________________________________________________
void THealPix::Draw(Option_t* option)
{
  // Draw this HEALPix with options
  //
  // HEALPixs are drawn via the THealPainter class. Each HEALPix has a pointer
  // to its own painter (to be usable in a mutithreaded program). The same
  // HEALPix can be drawn with different options in different pads. When a
  // HEALPix drawn in a pad is deleted, the HEALPix is automatically removed
  // from the pad or pads where it was drawn.
  //
  // If a HEALPix is drawn in a pad, then filled again, the new status of the
  // HEALPix will be automatically shown in the pad next time the pad is
  // updated. One does not need to redraw the HEALPix.
  //
  // To draw the current version of a HEALPix in a pad, one can use
  //    hp->DrawCopy();
  // This make a clone of the HEALPix. Once the clone is drawn, the original
  // HEALPix may be modified or deleted without affecting the aspect of the
  // clone.
  //
  // By default, THealPix::Draw clears the current pad.
  //
  // One can use THealPix::SetMaximum and THealPix::SetMinimum to force a
  // particular value for the maximum or the minimum scale on the plot.
  //
  // THealPix::UseCurrentStyle can be used to change all HEALPix graphics
  // attributes to correspond to the current selected style. This function
  // must be called for each HEALPix.
  //
  // In case of reads and draws many HEALPixs from a file, one can force the
  // HEALPixs to inherit automatically the current graphic style by calling
  // before gROOT->ForceStyle();
  //
  // See THealPainter::Paint for a description of all the drawing options.
  TString opt = option;
  opt.ToLower();
  if(gPad){
    if(!gPad->IsEditable()){
      gROOT->MakeDefCanvas();
    } // if
    if(opt.Contains("same")){
      if(gPad->GetX1() == 0 && gPad->GetX2() == 1 &&
	 gPad->GetY1() == 0 && gPad->GetY2() == 1 &&
	 gPad->GetListOfPrimitives()->GetSize() == 0){
	opt.ReplaceAll("same", "");
      } // if
    } else {
      //the following statement is necessary in case one attempts to draw
      //a temporary HEALPix already in the current pad
      if(TestBit(kCanDelete)){
	gPad->GetListOfPrimitives()->Remove(this);
      } // if
      gPad->Clear();
    } // if
  } else {
    if(opt.Contains("same")){
      opt.ReplaceAll("same", "");
    } // if
  }
  AppendPad(option);
}

//______________________________________________________________________________
THealPix* THealPix::DrawCopy(Option_t*) const
{
  // Copy this HEALPix and Draw in the current pad.
  //
  // Once the HEALPix is drawn into the pad, any further modification
  // using graphics input will be made on the copy of the HEALPix,
  // and not to the original object.
  //
  // See Draw for the list of options
  AbstractMethod("DrawCopy");
  return 0;
}

//______________________________________________________________________________
void THealPix::Multiply(const THealPix* hp1)
{
  if(!hp1){
    Error("Multiply", "Attempt to multiply a non-existing HEALPix");
    return;
  } // if
  
  // Check HEALPix compatibility
  if(fOrder != hp1->GetOrder() || fIsNested != hp1->IsNested()){
    Error("Multiply", "Attempt to multiply HEALPixs with different number of order or scheme");
    return;
  } // if

  // Create Sumw2 if hp1 has Sumw2 set
  if(fSumw2.fN == 0 && hp1->GetSumw2N() != 0){
    Sumw2();
  } // if

  // Reset statistics
  Double_t nEntries = fEntries;
  fEntries = fTsumw = 0;
  
  for(Int_t bin = 0; bin < fNpix; bin++){
    Double_t c0 = GetBinContent(bin);
    Double_t c1 = hp1->GetBinContent(bin);
    Double_t w  = c0*c1;
    SetBinContent(bin, w);
    fEntries++;
    if(fSumw2.fN){
      Double_t e0 = GetBinError(bin);
      Double_t e1 = hp1->GetBinError(bin);
      fSumw2.fArray[bin] = (e0*e0*c1*c1 + e1*e1*c0*c0);
    } // if
  } // i

  SetEntries(nEntries);
}

//______________________________________________________________________________
void THealPix::Paint(Option_t* option)
{
  // Control routine to paint any kind of HEALPixs
  GetPainter(option);

  if(fPainter){
    if(strlen(option) > 0){
      fPainter->Paint(option);
    } else {
      fPainter->Paint(fOption.Data());
    } // if
  } // if
}

//______________________________________________________________________________
Bool_t THealPix::ReadFitsHeader(fitsfile** fptr, const char* fname,
				const char* colname,
				HealHeader_t& head)
{
  // Read the header of a FITS file. If success, return kTRUE.
  Int_t status = 0;

  fits_open_file(fptr, fname, READONLY, &status);
  if(!THealUtil::FitsReportError(status)){
    return kFALSE;
  } // if

  Int_t hdutype;
  fits_movabs_hdu(*fptr, 2, &hdutype, &status);
  if(!THealUtil::FitsReportError(status) or hdutype != BINARY_TBL){
    return kFALSE;
  } // if

  Long_t nrows;
  Int_t ncols;
  fits_get_num_rows(*fptr, &nrows, &status);
  fits_get_num_cols(*fptr, &ncols, &status);

  char comment[FLEN_COMMENT];
  char pixtype[FLEN_VALUE];
  char ordering[FLEN_VALUE];

  fits_read_key(*fptr, TSTRING, "PIXTYPE", pixtype, comment, &status);
  if(!THealUtil::FitsReportError(status)){
    fits_close_file(*fptr, &status);
    return kFALSE;
  } // if
  
  fits_read_key(*fptr, TSTRING, "ORDERING", ordering, comment, &status);
  if(!THealUtil::FitsReportError(status)){
    fits_close_file(*fptr, &status);
    return kFALSE;
  } // if

  if(strcmp(pixtype, "HEALPIX") != 0){
    fits_close_file(*fptr, &status);
    return kFALSE;
  } // if
  
  Bool_t isNested;
  if(strcmp(ordering, "RING") == 0){
    isNested = kFALSE;
  } else if(strcmp(ordering, "NESTED") == 0){
    isNested = kTRUE;
  } else {
    fits_close_file(*fptr, &status);
    std::cerr << Form("Unknown ordering keyword %s found.\n", ordering);
    return kFALSE;
  } // if
  
  Int_t colnum = 0;
  fits_get_colnum(*fptr, CASEINSEN, (char*)colname, &colnum, &status);
  
  if(colnum == 0){
    std::cerr << Form("Column \"%s\" not found. Reading the 1st column instead.\n", colname);
    colnum = 1;
    status = 0;
  } // if

  char tform[FLEN_VALUE], tdisp[FLEN_VALUE];
  Long_t repeat, nulval;
  Double_t scale, zero;
    
  // For example,
  // TTYPE1  = 'diffuse'
  // TFORM1  = '1024D'
  // gives ttype = 'diffuse', repeat = 1024 and tform = 'D'
  fits_get_bcolparms(*fptr, colnum, head.ttype, head.tunit, tform, &repeat,
		     &scale, &zero, &nulval, tdisp, &status);
  if(!THealUtil::FitsReportError(status)){
    fits_close_file(*fptr, &status);
    return kFALSE;
  } // if

  Long_t nside;
  fits_read_key_lng(*fptr, "NSIDE", &nside, comment, &status);
  if(!THealUtil::FitsReportError(status)){
    fits_close_file(*fptr, &status);
    return kFALSE;
  } // if

  // Check if nside == 2^0 or 2^2 ... or 2^13 (8192)
  Int_t order = 0;
  for(; order < 15; order++){
    if(nside == 1<<order){
      break;
    } // if
    if(order == 14){
      fits_close_file(*fptr, &status);
      std::cerr << Form("Invalid Nside %d was given.\n", nside);
      return kFALSE;
    } // if
  } // i

  Int_t npix = Nside2Npix(nside);

  if(!(nrows*repeat == npix || nrows == npix || repeat >= 1)){
    fits_close_file(*fptr, &status);
    std::cerr << Form("Incompatible type of header (Npix = %d, Nrows = %d, Repeat = %d).\n", npix, nrows, repeat);
    return kFALSE;
  } // if

  head.isNested = isNested;
  head.order    = order;
  head.nrows    = nrows;
  head.repeat   = repeat;
  head.colnum   = colnum;
  head.npix     = npix;

  return kTRUE;
}

//______________________________________________________________________________
THealPix* THealPix::Rebin(Int_t neworder, const char* newname)
{
  // Rebin this HEALPix to new order.
  // 
  // If a new name is given, return value is a pointer to new object. Otherwise
  // this object will be rebined.
  //
  // Rebinning to higher resolution does not do any interpolation nor smoothing.
  // It does only dividing the bin contents.
  if(neworder > 13 || neworder < 0){
    Error("Rebin", "Illegal value of neworder=%d",neworder);
    return 0;
  } // if

  THealPix* hpnew = this;
  if(newname && strlen(newname) > 0){
    hpnew = (THealPix*)Clone(newname);
  } // if

  if(neworder == fOrder){
    return hpnew;
  } // if

  // If overwrite this, clone this to keep original information
  THealPix* hpold = (hpnew == this) ? (THealPix*)Clone() : this;

  hpnew->SetOrder(neworder);
  hpnew->SetBins(hpnew->GetNpix());

  Int_t newnpix  = hpnew->GetNpix();
  if(hpnew->IsNested()){ // NESTED
    if(neworder < hpold->GetOrder()){ // rebin to lower level
      Int_t div = hpold->GetNpix()/newnpix;
      for(Int_t i = 0; i < newnpix; i++){
	Double_t content = 0;
	Double_t error   = 0;
	for(Int_t j = i*div; j < (i + 1)*div; j++){
	  content += hpold->GetBinContent(j);
	  if(hpold->GetSumw2N()){
	    error += hpold->GetBinError(j)*hpold->GetBinError(j);
	  } // if
	} // j
	hpnew->SetBinContent(i, content);
	if(hpold->GetSumw2N()){
	  hpnew->SetBinError(i, TMath::Sqrt(error));
	} // if
      } // i
    } else { // rebin to higher level
      Int_t div = newnpix/hpold->GetNpix();
      for(Int_t i = 0; i < newnpix; i++){
	hpnew->SetBinContent(i, hpold->GetBinContent(i/div)/div);
	if(hpold->GetSumw2N()){
	  hpnew->SetBinError(i, hpold->GetBinError(i/div)/TMath::Sqrt(div));
	} // if
      } // i
    } // if
  } else { // RING
    if(neworder < hpold->GetOrder()){ // rebin to lower level
      Int_t div = hpold->GetNpix()/newnpix;
      for(Int_t i = 0; i < newnpix; i++){
	Double_t content = 0;
	Double_t error   = 0;
	Int_t inest = hpnew->Ring2Nest(i);
	for(Int_t jnest = inest*div; jnest < (inest + 1)*div; jnest++){
	  Int_t j = hpold->Nest2Ring(jnest);
	  content += hpold->GetBinContent(j);
	  if(hpold->GetSumw2N()){
	    error += hpold->GetBinError(j)*hpold->GetBinError(j);
	  } // if
	} // j
	hpnew->SetBinContent(i, content);
	if(hpold->GetSumw2N()){
	  hpnew->SetBinError(i, TMath::Sqrt(error));
	} // if
      } // i
    } else { // rebin to higher level
      Int_t div = newnpix/hpold->GetNpix();
      for(Int_t i = 0; i < newnpix; i++){
	Int_t inest = hpnew->Ring2Nest(i);
	Int_t p = hpold->Nest2Ring(inest/div);
	hpnew->SetBinContent(i, hpold->GetBinContent(p)/div);
	if(hpold->GetSumw2N()){
	  hpnew->SetBinError(i, hpold->GetBinError(p)/TMath::Sqrt(div));
	} // if
      } // i
    } // if
  } // if

  hpnew->SetEntries(hpold->GetEntries()); //was modified by SetBinContent

  if(hpold != this){
    delete hpold;
  } // if

  return hpnew;
}

//______________________________________________________________________________
void THealPix::SetBinContent(Int_t, Double_t)
{
  // Set the contents of a bin
  AbstractMethod("SetBinContent");
}

//______________________________________________________________________________
void THealPix::SetDefaultSumw2(Bool_t sumw2)
{
  // static function.
  // When this static function is called with sumw2=kTRUE, all new
  // HEALPix will automatically activate the storage of
  // the sum of squares of errors, ie THealPix::Sumw2 is automatically called.
  
  fgDefaultSumw2 = sumw2;
}

//______________________________________________________________________________
void THealPix::SetOrder(Int_t order)
{
  // Set the order of a HEALPix. Do NOT call this function when you want to
  // rebin the HEALPix. Use THealPix::Rebin instead.
  if(order < 0)  order = 0;
  if(order > 13) order = 13;

  fOrder   = order;
  fNside   = Order2Nside(fOrder);
  fNpix    = Nside2Npix(fNside);
  fNside2  = fNside*fNside;
  f2Nside  = 2*fNside;
  fNcap    = f2Nside*(fNside - 1);
  f3Nside2 = 3*fNside2;
  f2over3Nside = 2./(3.*fNside);
  f4Nside  = 4*fNside;
}

//______________________________________________________________________________
void THealPix::SetUnit(const char* unit)
{
  // Set the unit of HEALPix. This value is used in saving to FITS format.
  fUnit = std::string(unit);
}

//______________________________________________________________________________
void THealPix::Streamer(TBuffer& b)
{
  // Stream a class object.
  if(b.IsReading()){
    UInt_t R__s, R__c;
    Version_t R__v = b.ReadVersion(&R__s, &R__c);
    fDirectory = 0;
    b.ReadClassBuffer(THealPix::Class(), this, R__v, R__s, R__c);
    SetOrder(fOrder);
  } else {
    b.WriteClassBuffer(THealPix::Class(), this);
  }
}

//______________________________________________________________________________
void THealPix::Sumw2()
{
  // Create structure to store sum of squares of weights*-*-*-*-*-*-*-*
  //
  //     if HEALPix is already filled, the sum of squares of weights
  //     is filled with the existing bin contents
  //
  //     The error per bin will be computed as sqrt(sum of squares of weight)
  //     for each bin.
  //
  //  This function is automatically called when the HEALPix is created
  //  if the static function THealPix::SetDefaultSumw2 has been called before.

   if(!fgDefaultSumw2 && fSumw2.fN){
      Warning("Sumw2", "Sum of squares of weights structure already created");
      return;
   } // if

   fSumw2.Set(fNpix);

   for(Int_t bin = 0; bin < fNpix; bin++) {
     fSumw2.fArray[bin] = GetBinContent(bin);
   } // bin
}

//______________________________________________________________________________
void THealPix::UseCurrentStyle()
{
  // Copy current attributes from/to current style.
  if(gStyle->IsReading()) {
    fXaxis.ResetAttAxis("X");
    fYaxis.ResetAttAxis("Y");
    fZaxis.ResetAttAxis("Z");
    SetBarOffset(gStyle->GetBarOffset());
    SetBarWidth(gStyle->GetBarWidth());
    SetFillColor(gStyle->GetHistFillColor());
    SetFillStyle(gStyle->GetHistFillStyle());
    SetLineColor(gStyle->GetHistLineColor());
    SetLineStyle(gStyle->GetHistLineStyle());
    SetLineWidth(gStyle->GetHistLineWidth());
    SetMarkerColor(gStyle->GetMarkerColor());
    SetMarkerStyle(gStyle->GetMarkerStyle());
    SetMarkerSize(gStyle->GetMarkerSize());
    Int_t dostat = gStyle->GetOptStat();
    if (gStyle->GetOptFit() && !dostat) dostat = 1000000001;
    //    SetStats(dostat);
  } else {
    gStyle->SetBarOffset(fBarOffset);
    gStyle->SetBarWidth(fBarWidth);
    gStyle->SetHistFillColor(GetFillColor());
    gStyle->SetHistFillStyle(GetFillStyle());
    gStyle->SetHistLineColor(GetLineColor());
    gStyle->SetHistLineStyle(GetLineStyle());
    gStyle->SetHistLineWidth(GetLineWidth());
    gStyle->SetMarkerColor(GetMarkerColor());
    gStyle->SetMarkerStyle(GetMarkerStyle());
    gStyle->SetMarkerSize(GetMarkerSize());
    gStyle->SetOptStat(TestBit(kNoStats));
  } // if

  TIter next(GetListOfFunctions());
  TObject* obj;
  
  while((obj = next())){
    obj->UseCurrentStyle();
  } // while
}

//______________________________________________________________________________
Double_t THealPix::GetBinError(Int_t bin) const
{
  //   -*-*-*-*-*Return value of error associated to bin number bin*-*-*-*-*
  //             ==================================================
  //
  //    if the sum of squares of weights has been defined (via Sumw2),
  //    this function returns the sqrt(sum of w2).
  //    otherwise it returns the sqrt(contents) for this bin.
  //
  //   -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  if(bin < 0){
    bin = 0;
  } // if
  if(bin >= fNpix){
    bin = fNpix - 1;
  } // if

  if(fSumw2.fN){
    Double_t err2 = fSumw2.fArray[bin];
    return TMath::Sqrt(err2);
  } // if
  Double_t error2 = TMath::Abs(GetBinContent(bin));
  return TMath::Sqrt(error2);
}

//______________________________________________________________________________
Int_t THealPix::GetContour(Double_t* levels)
{
  //  Return contour values into array levels if pointer levels is non zero
  //
  //  The function returns the number of contour levels.
  //  see GetContourLevel to return one contour only
  //
  
  Int_t nlevels = fContour.fN;
  if(levels){
    if(nlevels == 0){
      nlevels = 20;
      SetContour(nlevels);
    } else {
      if(TestBit(kUserContour) == 0) SetContour(nlevels);
    } // if
    for(Int_t i = 0; i < nlevels; i++){
      levels[i] = fContour.fArray[i];
    } // i
  } // if
  return nlevels;
}

//______________________________________________________________________________
Double_t THealPix::GetContourLevel(Int_t level) const
{
  // Return value of contour number level
  // see GetContour to return the array of all contour levels
  
  if(level <0 || level >= fContour.fN) return 0;
  Double_t zlevel = fContour.fArray[level];
  return zlevel;
}

//______________________________________________________________________________
Double_t THealPix::GetContourLevelPad(Int_t level) const
{
  // Return the value of contour number "level" in Pad coordinates ie: if the
  // Pad is in log scale along Z it returns le log of the contour level value.
  // see GetContour to return the array of all contour levels
  
  if(level <0 || level >= fContour.fN) return 0;
  Double_t zlevel = fContour.fArray[level];
  
  // In case of user defined contours and Pad in log scale along Z,
  // fContour.fArray doesn't contain the log of the contour whereas it does
  // in case of equidistant contours.
  if(gPad && gPad->GetLogz() && TestBit(kUserContour)){
    if(zlevel <= 0) return 0;
    zlevel = TMath::Log10(zlevel);
  } // if
  return zlevel;
}

//______________________________________________________________________________
Double_t THealPix::GetMaximum(Double_t maxval) const
{
  // Retrun maximum value smaller than maxval of bins.
  if(fMaximum != -1111){
    return fMaximum;
  } // if

  Double_t maximum = -FLT_MAX;
  for(Int_t i = 0; i < fNpix; i++){
    Double_t value = GetBinContent(i);
    if(value > maximum && value < maxval){
      maximum = value;
    } // if
  } // i

  return maximum;
}

//______________________________________________________________________________
Int_t THealPix::GetMaximumBin() const
{
  // Return location of bin with maximum value.
  Int_t bin = 0;
  Double_t maximum = -FLT_MAX;
  for(Int_t i = 0; i < fNpix; i++){
    Double_t value = GetBinContent(i);
    if(value > maximum){
      maximum = value;
      bin = i;
    } // if
  } // i

  return bin;
}

//______________________________________________________________________________
Double_t THealPix::GetMinimum(Double_t minval) const
{
  // Retrun minimum value smaller than maxval of bins.
  if(fMinimum != -1111){
    return fMinimum;
  } // if

  Double_t minimum = FLT_MAX;
  for(Int_t i = 0; i < fNpix; i++){
    Double_t value = GetBinContent(i);
    if(value < minimum && value > minval){
      minimum = value;
    } // if
  } // i

  return minimum;
}

//______________________________________________________________________________
Int_t THealPix::GetMinimumBin() const
{
  // Return location of bin with minimum value.
  Int_t bin = 0;
  Double_t minimum = FLT_MAX;
  for(Int_t i = 0; i < fNpix; i++){
    Double_t value = GetBinContent(i);
    if(value < minimum){
      minimum = value;
      bin = i;
    } // if
  } // i

  return bin;
}

//______________________________________________________________________________
Int_t THealPix::GetNrows() const
{
  // Return number of rows used in FITS storaging.
  return fOrder < 4 ? 1 : 1024;
}

//______________________________________________________________________________
TVirtualHealPainter* THealPix::GetPainter(Option_t* option)
{
  // return pointer to patiner
  // if painter does not exist, it is created
  if(!fPainter){
    TString opt = option;
    opt.ToLower();
    if(opt.Contains("gl") || gStyle->GetCanvasPreferGL()){
      fPainter = 0; // to be modified
    } // if
  } // if

  if(!fPainter){
    fPainter = TVirtualHealPainter::HealPainter(this);
  } // if

  return fPainter;
}

//______________________________________________________________________________
std::string THealPix::GetSchemeString() const
{
  // Return ordering sheme as string.
  // R
  if(fIsNested){
    return "NESTED";
  } else {
    return "RING";
  } // if
}

//______________________________________________________________________________
TAxis* THealPix::GetXaxis() const
{
  // return a pointer to the X axis object
  
  return &((THealPix*)this)->fXaxis;
}

//______________________________________________________________________________
TAxis* THealPix::GetYaxis() const
{
  // return a pointer to the Y axis object
  
  return &((THealPix*)this)->fYaxis;
}

//______________________________________________________________________________
TAxis* THealPix::GetZaxis() const
{
  // return a pointer to the Z axis object
  
  return &((THealPix*)this)->fZaxis;
}

//_____________________________________________________________________________
void THealPix::Scale(Double_t c1, Option_t* option)
{
  // Multiply this histogram by a constant c1
  //
  // this = c1*this
  //
  // Note that both contents and errors (if any) are scaled.
  // This function uses the services of THealPix::Add
  //
  // IMPORTANT NOTE: If you intend to use the errors of this HEALPix later
  // you should call Sumw2 before making this operation.
  // This is particularly important if you fit the histogram after
  // THealPix::Scale
  //
  // One can scale a HEALPix such that the bins integral is equal to
  // the normalization parameter via THealPix::Scale(Double_t norm), where norm
  // is the desired normalization divided by the integral of the histogram.
  //
  // If option contains "width" the bin contents and errors are divided
  // by the bin width.
  TString opt = option;
  opt.ToLower();
  Double_t ent = fEntries;
  if(opt.Contains("width")){
    Add(this, this, c1, -1);
  } else {
    Add(this, this, c1, 0);
  } // if
  fEntries = ent;

  //if contours set, must also scale contours
  Int_t ncontours = GetContour();
  if(ncontours == 0) return;
  Double_t* levels = fContour.GetArray();
  for(Int_t i = 0; i < ncontours; i++){
    levels[i] *= c1;
  } // i
}

//______________________________________________________________________________
void THealPix::SetBinError(Int_t bin, Double_t error)
{
  // see convention for numbering bins in THealPix::GetBin
  if(!fSumw2.fN){
    Sumw2();
  } // if
  if(bin <0 || bin >= fSumw2.fN){
    return;
  } // if
  fSumw2.fArray[bin] = error*error;
}

//______________________________________________________________________________
void THealPix::SetBins(Int_t n)
{
  // Redifine the number of bins. Do NOT call this method.
  SetBinsLength(n);
  if(fSumw2.fN){
    fSumw2.Set(n);
  } // if
}

//______________________________________________________________________________
void THealPix::SetContour(Int_t  nlevels, const Double_t* levels)
{
  //   -*-*-*-*-*-*Set the number and values of contour levels*-*-*-*-*-*-*-*-*
  //               ===========================================
  //
  //  By default the number of contour levels is set to 20.
  //
  //  if argument levels = 0 or missing, equidistant contours are computed
  //
  
  ResetBit(kUserContour);
  if(nlevels <= 0){
    fContour.Set(0);
    return;
  } // if
  fContour.Set(nlevels);
  
  //   -  Contour levels are specified
  if(levels){
    SetBit(kUserContour);
    for(Int_t i=0; i < nlevels; i++){
      fContour.fArray[i] = levels[i];
    } // i
  } else {
    //   - contour levels are computed automatically as equidistant contours
    Double_t zmin = GetMinimum();
    Double_t zmax = GetMaximum();
    if((zmin == zmax) && (zmin != 0)){
      zmax += 0.01*TMath::Abs(zmax);
      zmin -= 0.01*TMath::Abs(zmin);
    } // if
    Double_t dz = (zmax - zmin)/Double_t(nlevels);
    if(gPad && gPad->GetLogz()){
      if (zmax <= 0) return;
      if (zmin <= 0) zmin = 0.001*zmax;
      zmin = TMath::Log10(zmin);
      zmax = TMath::Log10(zmax);
      dz   = (zmax-zmin)/Double_t(nlevels);
    } // if
    for(Int_t i=0; i < nlevels; i++) {
      fContour.fArray[i] = zmin + dz*Double_t(i);
    } // i
  } // if
}

//______________________________________________________________________________
void THealPix::SetContourLevel(Int_t level, Double_t value)
{
  //   -*-*-*-*-*-*-*-*-*Set value for one contour level*-*-*-*-*-*-*-*-*-*-*-*
  //                     ===============================
  if(level <0 || level >= fContour.fN) return;
  SetBit(kUserContour);
  fContour.fArray[level] = value;
}

//______________________________________________________________________________
void THealPix::SetDirectory(TDirectory *dir)
{
  // By default when a HEALPix is created, it is added to the list
  // of HEALPix objects in the current directory in memory.
  // Remove reference to this HEALPix from current directory and add
  // reference to new directory dir. dir can be 0 in which case the
  // HEALPix does not belong to any directory.

  if(fDirectory == dir){
    return;
  } // if
  if(fDirectory){
    fDirectory->Remove(this);
  } // if

  fDirectory = dir;

  if(fDirectory){
    fDirectory->Append(this);
  } // if
}

//______________________________________________________________________________
void THealPix::SetMaximum(Double_t maximum)
{
  // Set the maximum value for the Z axis.
  //
  // By default the maximum value is automatically set to the maximum bin
  // content plus a margin of 10 per cent.
  // Use THealPix::GetMaximum to find the maximum value of a HEALPix.
  // Use THealPix::GetMaximumBin to find the bin with the maximum value of
  // a HEALPix.
  fMaximum = maximum;
}

//______________________________________________________________________________
void THealPix::SetMinimum(Double_t minimum)
{
  // Set the minimum value for the Z axis.
  //
  // By default the minimum value is automatically set to zero if all bin
  // contents are positive or the minimum - 10 per cen otherwise.
  // Use THealPix::GetMinimum to find the minimum value of a HEALPix.
  // Use THealPix::GetMinimumBin to find the bin with the minimum value of
  // a HEALPix.
  fMinimum = minimum;
}

//______________________________________________________________________________
void THealPix::SetName(const char* name)
{
  // Change the name of this HEALPix.
  if(fDirectory){
    fDirectory->Remove(this);
  } // if
  fName = name;
  if(fDirectory){
    fDirectory->Append(this);
  } // if
}

//______________________________________________________________________________
void THealPix::SetNameTitle(const char* name, const char* title)
{
  // Change the name and title of this HEALPix.
  if(fDirectory){
    fDirectory->Remove(this);
  } // if
  fName  = name;
  SetTitle(title);
  if(fDirectory){
    fDirectory->Append(this);
  } // if
}

//_____________________________________________________________________________
void THealPix::Ring2XYF(Int_t pix, Int_t& x, Int_t& y, Int_t& face) const
{
  // Original code is Healpix_Base::ring2xyf of HEALPix C++
  Int_t iring, iphi, kshift, nr;
  
  if(pix < fNcap){ // North Polar cap
    iring = Int_t(0.5*(1 + ::Isqrt(1 + 2*pix))); //counted from North pole
    iphi  = (pix + 1) - 2*iring*(iring - 1);
    kshift = 0;
    nr = iring;
    face = 0;
    Int_t tmp = iphi - 1;
    if(tmp >= 2*iring){
      face = 2;
      tmp -= 2*iring;
    } // if
    if(tmp >= iring){
      face++;
    } // if
  } else if(pix < fNpix - fNcap){ // Equatorial region
    Int_t ip = pix - fNcap;
    if(fOrder >= 0){
      iring = (ip>>(fOrder + 2)) + fNside; // counted from North pole
      iphi  = (ip&(f4Nside - 1)) + 1;
    } else {
      iring = (ip/(f4Nside)) + fNside; // counted from North pole
      iphi = (ip%(f4Nside)) + 1;
    } // if
    kshift = (iring + fNside)&1;
    nr = fNside;
    UInt_t ire = iring - fNside + 1;
    UInt_t irm = f2Nside + 2 - ire;
    Int_t ifm, ifp;
    if(fOrder >= 0){
      ifm = (iphi - ire/2 + fNside -1) >> fOrder;
      ifp = (iphi - irm/2 + fNside -1) >> fOrder;
    } else {
      ifm = (iphi - ire/2 + fNside -1) / fNside;
      ifp = (iphi - irm/2 + fNside -1) / fNside;
    } // if
    if(ifp == ifm){ // faces 4 to 7
      face = (ifp==4) ? 4 : ifp+4;
    } else if(ifp<ifm){ // (half-)faces 0 to 3
      face = ifp;
    } else { // (half-)faces 8 to 11
      face = ifm + 8;
    } // if
  } else { // South Polar cap
    Int_t ip = fNpix - pix;
    iring = Int_t(0.5*(1 + ::Isqrt(2*ip - 1))); //counted from South pole
    iphi  = 4*iring + 1 - (ip - 2*iring*(iring - 1));
    kshift = 0;
    nr = iring;
    iring = f4Nside - iring;
    face = 8;
    Int_t tmp = iphi - 1;
    if(tmp >= 2*nr){
      face = 10;
      tmp -= 2*nr;
    } // if
    if(tmp >= nr){
      ++face;
    } // if
  } // if

  Int_t irt = iring - (fgJrll[face]*fNside) + 1;
  Int_t ipt = 2*iphi- fgJpll[face]*nr - kshift -1;
  if(ipt >= f2Nside){
    ipt -= 8*fNside;
  } // if

  x =  (ipt-irt) >>1;
  y =(-(ipt+irt))>>1;
}

//_____________________________________________________________________________
Int_t THealPix::XYF2Ring(Int_t x, Int_t y, Int_t face) const
{
  // Original code is Healpix_Base::xyf2ring of HEALPix C++
  Int_t jr = (fgJrll[face]*fNside) - x - y  - 1;

  Int_t nr, kshift, n_before;
  if(jr < fNside){
    nr = jr;
    n_before = 2*nr*(nr - 1);
    kshift = 0;
  } else if (jr > 3*fNside){
    nr = f4Nside - jr;
    n_before = fNpix - 2*(nr + 1)*nr;
    kshift = 0;
  } else {
    nr = fNside;
    n_before = fNcap + (jr - fNside)*f4Nside;
    kshift = (jr - fNside)&1;
  } // if

  Int_t jp = (fgJpll[face]*nr + x - y + 1 + kshift)/2;
  if(jp > f4Nside){
    jp -= f4Nside;
  } else {
    if(jp < 1){
      jp += f4Nside;
    } // if
  } // if

  return n_before + jp - 1;
}

ClassImp(THealPixF)

//_____________________________________________________________________________
// THealPixF methods
//_____________________________________________________________________________
THealPixF::THealPixF(): THealPix(), TArrayF()
{
  // Default constructor
  SetBinsLength(fNpix);
  if(fgDefaultSumw2){
    Sumw2();
  } // if
}

//_____________________________________________________________________________
THealPixF::THealPixF(const char* name, const char* title, Int_t order,
		     Bool_t isNested)
: THealPix(name, title, order, isNested)
{
  // Constructor
  TArrayF::Set(fNpix);
  if(fgDefaultSumw2){
    Sumw2();
  } // if
}

//_____________________________________________________________________________
THealPixF::THealPixF(const THealPixF& hpd) : THealPix(), TArrayF()
{
  // Copy constructor
  ((THealPixF&)hpd).Copy(*this);
}

//_____________________________________________________________________________
THealPixF::~THealPixF()
{
  // Destructor
}

//_____________________________________________________________________________
void THealPixF::Copy(TObject& newhp) const
{
  // Copy this to newhp
  THealPix::Copy(newhp);
}

//______________________________________________________________________________
THealPix* THealPixF::DrawCopy(Option_t* option) const
{
  // Draw copy.
  TString opt = option;
  opt.ToLower();
  if(gPad && !opt.Contains("same")){
    gPad->Clear();
  } // if
  THealPixF* newhpf = (THealPixF*)Clone();
  newhpf->SetDirectory(0);
  newhpf->SetBit(kCanDelete);
  newhpf->AppendPad(option);
  return newhpf;
}

//______________________________________________________________________________
Double_t THealPixF::GetBinContent(Int_t bin) const
{
  // See convention for numbering bins in THealPix::GetBin
  if(!fArray){
    return 0;
  } // if

  bin = bin < 0 ? 0 : bin;
  bin = bin < fNpix ? bin : fNpix - 1;

  return Double_t(fArray[bin]);
}

//_____________________________________________________________________________
Int_t THealPixF::GetType() const
{
  // Return type of content as CFITSIO type 'TFLOAT'
  return TFLOAT;
}

//_____________________________________________________________________________
std::string THealPixF::GetTypeString() const
{
  // Return type of content as FITS type string 'E'
  return "E";
}

//______________________________________________________________________________
THealPixF* THealPixF::ReadFits(const char* fname, const char* colname)
{
  // Read from FITS file
  //
  // If the given colname is found in the FITS file 'fname', the title of
  // returned HEALPix is set to colname.
  //
  // If the given colname is not found, automatically read the first column.
  // The title is set to the found column name instead.
  THealPix::HealHeader_t head;
  fitsfile* fptr = 0;

  if(!THealPix::ReadFitsHeader(&fptr, fname, colname, head)){
    return 0;
  } // if

  THealPixF* hpf = new THealPixF(fname, head.ttype, head.order, head.isNested);
  hpf->SetUnit(head.tunit);

  Int_t status = 0;

  if(head.nrows*head.repeat == hpf->GetNpix()){ // CMB-like FITS
    for(Int_t i = 0; i < head.nrows; i++){
      fits_read_col(fptr, TFLOAT, head.colnum, i + 1, 1, head.repeat, 0,
		    &(hpf->GetArray()[i*head.repeat]), 0, &status);
      if(!THealUtil::FitsReportError(status)){
	delete hpf;
	return 0;
      } // if
    } // i
  } else if(head.nrows == hpf->GetNpix()){ // HEALPix Cube
    // Read only the first layer
    for(Int_t i = 0; i < head.nrows; i++){
      fits_read_col(fptr, TFLOAT, head.colnum, i + 1, 1, 1, 0,
		    &(hpf->GetArray()[i]), 0, &status);
      if(!THealUtil::FitsReportError(status)){
	delete hpf;
	return 0;
      } // if
    } // i
  } // if

  Double_t entries = 0;
  for(Int_t i = 0; i  < hpf->GetNpix(); i++){
    if(hpf->GetBinContent(i) != 0){
      entries++;
    } // if
  } // i
  hpf->SetEntries(entries);

  return hpf;
}

//_____________________________________________________________________________
void THealPixF::SetBinContent(Int_t bin, Double_t content)
{
  // Set bin content.
  if(bin < 0 || fNpix <= 0){
    return;
  } // if
  fArray[bin] = content;
  fEntries++;
  fTsumw = 0;
}

//_____________________________________________________________________________
void THealPixF::SetBinsLength(Int_t n)
{
  // Set total number of bins
  // Reallocate bin contents array
  if(n < 0){
    n = fNpix;
  } // if
  TArrayF::Set(n);
}

//______________________________________________________________________________
THealPixF& THealPixF::operator=(const THealPixF& hp1)
{
  // Operator =
  if(this != &hp1){
    ((THealPixF&)hp1).Copy(*this);
  } // if
  return *this;
}

//______________________________________________________________________________
THealPixF THealPixF::__add__(const THealPixF& hp1) const
{
  // Python operator +
  return *this + hp1;
}

//______________________________________________________________________________
THealPixF THealPixF::__div__(const THealPixF& hp1) const
{
  // Python operator /
  return *this / hp1;
}

//______________________________________________________________________________
THealPixF THealPixF::__mul__(const THealPixF& hp1) const
{
  // Python operator *
  return *this * hp1;
}

//______________________________________________________________________________
THealPixF THealPixF::__mul__(Double_t c1) const
{
  // Python operator *
  return *this*c1;
}

//______________________________________________________________________________
THealPixF THealPixF::__rmul__(Double_t c1) const
{
  // Python operator *
  return *this*c1;
}

//______________________________________________________________________________
THealPixF THealPixF::__sub__(const THealPixF& hp1) const
{
  // Python operator -
  return *this - hp1;
}

//______________________________________________________________________________
THealPixF operator*(Double_t c1, const THealPixF& hp1)
{
  // Operator *
  THealPixF hpnew = hp1;
  hpnew.Scale(c1);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixF operator+(const THealPixF& hp1, const THealPixF& hp2)
{
  // Operator +
  THealPixF hpnew = hp1;
  hpnew.Add(&hp2, 1);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixF operator-(const THealPixF& hp1, const THealPixF& hp2)
{
  // Operator -
  THealPixF hpnew = hp1;
  hpnew.Add(&hp2, -1);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixF operator*(const THealPixF& hp1, const THealPixF& hp2)
{
  // Operator *
  THealPixF hpnew = hp1;
  hpnew.Multiply(&hp2);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixF operator/(const THealPixF& hp1, const THealPixF& hp2)
{
  // Operator /
  THealPixF hpnew = hp1;
  hpnew.Divide(&hp2);
  hpnew.SetDirectory(0);
  return hpnew;
}

ClassImp(THealPixD)

//_____________________________________________________________________________
// THealPixD methods
//_____________________________________________________________________________
THealPixD::THealPixD(): THealPix(), TArrayD()
{
  // Default constructor
  SetBinsLength(fNpix);
  if(fgDefaultSumw2){
    Sumw2();
  } // if
}

//_____________________________________________________________________________
THealPixD::THealPixD(const char* name, const char* title, Int_t order,
		     Bool_t isNested)
: THealPix(name, title, order, isNested)
{
  // Constructor
  TArrayD::Set(fNpix);
  if(fgDefaultSumw2){
    Sumw2();
  } // if
}

//_____________________________________________________________________________
THealPixD::THealPixD(const THealPixD& hpd) : THealPix(), TArrayD()
{
  // Copy constructor
  ((THealPixD&)hpd).Copy(*this);
}

//_____________________________________________________________________________
THealPixD::~THealPixD()
{
  // Destructor
}

//_____________________________________________________________________________
void THealPixD::Copy(TObject& newhp) const
{
  // Copy this to newhp
  THealPix::Copy(newhp);
}

//______________________________________________________________________________
THealPix* THealPixD::DrawCopy(Option_t* option) const
{
  // Draw copy.
  TString opt = option;
  opt.ToLower();
  if(gPad && !opt.Contains("same")){
    gPad->Clear();
  } // if
  THealPixD* newhpf = (THealPixD*)Clone();
  newhpf->SetDirectory(0);
  newhpf->SetBit(kCanDelete);
  newhpf->AppendPad(option);
  return newhpf;
}

//______________________________________________________________________________
Double_t THealPixD::GetBinContent(Int_t bin) const
{
  // See convention for numbering bins in THealPix::GetBin
  if(!fArray){
    return 0;
  } // if

  bin = bin < 0 ? 0 : bin;
  bin = bin < fNpix ? bin : fNpix - 1;

  return Double_t(fArray[bin]);
}

//_____________________________________________________________________________
Int_t THealPixD::GetType() const
{
  // Return type of content as CFITSIO type 'TDOUBLE'
  return TDOUBLE;
}

//_____________________________________________________________________________
std::string THealPixD::GetTypeString() const
{
  // Return type of content as FITS type string 'D'
  return "D";
}

//______________________________________________________________________________
THealPixD* THealPixD::ReadFits(const char* fname, const char* colname)
{
  // Read from FITS file
  //
  // If the given colname is found in the FITS file 'fname', the title of
  // returned HEALPix is set to colname.
  //
  // If the given colname is not found, automatically read the first column.
  // The title is set to the found column name instead.
  THealPix::HealHeader_t head;
  fitsfile* fptr = 0;

  if(!THealPix::ReadFitsHeader(&fptr, fname, colname, head)){
    return 0;
  } // if

  THealPixD* hpd = new THealPixD(fname, head.ttype, head.order, head.isNested);
  hpd->SetUnit(head.tunit);

  Int_t status = 0;

  if(head.nrows*head.repeat == hpd->GetNpix()){ // CMB-like FITS
    for(Int_t i = 0; i < head.nrows; i++){
      fits_read_col(fptr, TDOUBLE, head.colnum, i + 1, 1, head.repeat, 0,
		    &(hpd->GetArray()[i*head.repeat]), 0, &status);
      if(!THealUtil::FitsReportError(status)){
	delete hpd;
	return 0;
      } // if
    } // i
  } else if(head.nrows == hpd->GetNpix()){ // HEALPix Cube
    // Read only the first layer
    for(Int_t i = 0; i < head.nrows; i++){
      fits_read_col(fptr, TDOUBLE, head.colnum, i + 1, 1, 1, 0,
		    &(hpd->GetArray()[i]), 0, &status);
      if(!THealUtil::FitsReportError(status)){
	delete hpd;
	return 0;
      } // if
    } // i
  } // if

  Double_t entries = 0;
  for(Int_t i = 0; i  < hpd->GetNpix(); i++){
    if(hpd->GetBinContent(i) != 0){
      entries++;
    } // if
  } // i
  hpd->SetEntries(entries);

  return hpd;
}

//_____________________________________________________________________________
void THealPixD::SetBinContent(Int_t bin, Double_t content)
{
  // Set bin content.
  if(bin < 0 || fNpix <= 0){
    return;
  } // if
  fArray[bin] = content;
  fEntries++;
  fTsumw = 0;
}

//_____________________________________________________________________________
void THealPixD::SetBinsLength(Int_t n)
{
  // Set total number of bins
  // Reallocate bin contents array
  if(n < 0){
    n = fNpix;
  } // if
  TArrayD::Set(n);
}

//______________________________________________________________________________
THealPixD& THealPixD::operator=(const THealPixD& hp1)
{
  // Operator =
  if(this != &hp1){
    ((THealPixD&)hp1).Copy(*this);
  } // if
  return *this;
}

//______________________________________________________________________________
THealPixD THealPixD::__add__(const THealPixD& hp1) const
{
  // Python operator +
  return *this + hp1;
}

//______________________________________________________________________________
THealPixD THealPixD::__div__(const THealPixD& hp1) const
{
  // Python operator /
  return *this / hp1;
}

//______________________________________________________________________________
THealPixD THealPixD::__mul__(const THealPixD& hp1) const
{
  // Python operator *
  return *this * hp1;
}

//______________________________________________________________________________
THealPixD THealPixD::__mul__(Double_t c1) const
{
  // Python operator *
  return *this*c1;
}

//______________________________________________________________________________
THealPixD THealPixD::__rmul__(Double_t c1) const
{
  // Python operator *
  return *this*c1;
}

//______________________________________________________________________________
THealPixD THealPixD::__sub__(const THealPixD& hp1) const
{
  // Python operator -
  return *this - hp1;
}

//______________________________________________________________________________
THealPixD operator*(Double_t c1, const THealPixD& hp1)
{
  // Operator *
  THealPixD hpnew = hp1;
  hpnew.Scale(c1);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixD operator+(const THealPixD& hp1, const THealPixD& hp2)
{
  // Operator +
  THealPixD hpnew = hp1;
  hpnew.Add(&hp2, 1);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixD operator-(const THealPixD& hp1, const THealPixD& hp2)
{
  // Operator -
  THealPixD hpnew = hp1;
  hpnew.Add(&hp2, -1);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixD operator*(const THealPixD& hp1, const THealPixD& hp2)
{
  // Operator *
  THealPixD hpnew = hp1;
  hpnew.Multiply(&hp2);
  hpnew.SetDirectory(0);
  return hpnew;
}

//______________________________________________________________________________
THealPixD operator/(const THealPixD& hp1, const THealPixD& hp2)
{
  // Operator /
  THealPixD hpnew = hp1;
  hpnew.Divide(&hp2);
  hpnew.SetDirectory(0);
  return hpnew;
}

 THealPix.cxx:1
 THealPix.cxx:2
 THealPix.cxx:3
 THealPix.cxx:4
 THealPix.cxx:5
 THealPix.cxx:6
 THealPix.cxx:7
 THealPix.cxx:8
 THealPix.cxx:9
 THealPix.cxx:10
 THealPix.cxx:11
 THealPix.cxx:12
 THealPix.cxx:13
 THealPix.cxx:14
 THealPix.cxx:15
 THealPix.cxx:16
 THealPix.cxx:17
 THealPix.cxx:18
 THealPix.cxx:19
 THealPix.cxx:20
 THealPix.cxx:21
 THealPix.cxx:22
 THealPix.cxx:23
 THealPix.cxx:24
 THealPix.cxx:25
 THealPix.cxx:26
 THealPix.cxx:27
 THealPix.cxx:28
 THealPix.cxx:29
 THealPix.cxx:30
 THealPix.cxx:31
 THealPix.cxx:32
 THealPix.cxx:33
 THealPix.cxx:34
 THealPix.cxx:35
 THealPix.cxx:36
 THealPix.cxx:37
 THealPix.cxx:38
 THealPix.cxx:39
 THealPix.cxx:40
 THealPix.cxx:41
 THealPix.cxx:42
 THealPix.cxx:43
 THealPix.cxx:44
 THealPix.cxx:45
 THealPix.cxx:46
 THealPix.cxx:47
 THealPix.cxx:48
 THealPix.cxx:49
 THealPix.cxx:50
 THealPix.cxx:51
 THealPix.cxx:52
 THealPix.cxx:53
 THealPix.cxx:54
 THealPix.cxx:55
 THealPix.cxx:56
 THealPix.cxx:57
 THealPix.cxx:58
 THealPix.cxx:59
 THealPix.cxx:60
 THealPix.cxx:61
 THealPix.cxx:62
 THealPix.cxx:63
 THealPix.cxx:64
 THealPix.cxx:65
 THealPix.cxx:66
 THealPix.cxx:67
 THealPix.cxx:68
 THealPix.cxx:69
 THealPix.cxx:70
 THealPix.cxx:71
 THealPix.cxx:72
 THealPix.cxx:73
 THealPix.cxx:74
 THealPix.cxx:75
 THealPix.cxx:76
 THealPix.cxx:77
 THealPix.cxx:78
 THealPix.cxx:79
 THealPix.cxx:80
 THealPix.cxx:81
 THealPix.cxx:82
 THealPix.cxx:83
 THealPix.cxx:84
 THealPix.cxx:85
 THealPix.cxx:86
 THealPix.cxx:87
 THealPix.cxx:88
 THealPix.cxx:89
 THealPix.cxx:90
 THealPix.cxx:91
 THealPix.cxx:92
 THealPix.cxx:93
 THealPix.cxx:94
 THealPix.cxx:95
 THealPix.cxx:96
 THealPix.cxx:97
 THealPix.cxx:98
 THealPix.cxx:99
 THealPix.cxx:100
 THealPix.cxx:101
 THealPix.cxx:102
 THealPix.cxx:103
 THealPix.cxx:104
 THealPix.cxx:105
 THealPix.cxx:106
 THealPix.cxx:107
 THealPix.cxx:108
 THealPix.cxx:109
 THealPix.cxx:110
 THealPix.cxx:111
 THealPix.cxx:112
 THealPix.cxx:113
 THealPix.cxx:114
 THealPix.cxx:115
 THealPix.cxx:116
 THealPix.cxx:117
 THealPix.cxx:118
 THealPix.cxx:119
 THealPix.cxx:120
 THealPix.cxx:121
 THealPix.cxx:122
 THealPix.cxx:123
 THealPix.cxx:124
 THealPix.cxx:125
 THealPix.cxx:126
 THealPix.cxx:127
 THealPix.cxx:128
 THealPix.cxx:129
 THealPix.cxx:130
 THealPix.cxx:131
 THealPix.cxx:132
 THealPix.cxx:133
 THealPix.cxx:134
 THealPix.cxx:135
 THealPix.cxx:136
 THealPix.cxx:137
 THealPix.cxx:138
 THealPix.cxx:139
 THealPix.cxx:140
 THealPix.cxx:141
 THealPix.cxx:142
 THealPix.cxx:143
 THealPix.cxx:144
 THealPix.cxx:145
 THealPix.cxx:146
 THealPix.cxx:147
 THealPix.cxx:148
 THealPix.cxx:149
 THealPix.cxx:150
 THealPix.cxx:151
 THealPix.cxx:152
 THealPix.cxx:153
 THealPix.cxx:154
 THealPix.cxx:155
 THealPix.cxx:156
 THealPix.cxx:157
 THealPix.cxx:158
 THealPix.cxx:159
 THealPix.cxx:160
 THealPix.cxx:161
 THealPix.cxx:162
 THealPix.cxx:163
 THealPix.cxx:164
 THealPix.cxx:165
 THealPix.cxx:166
 THealPix.cxx:167
 THealPix.cxx:168
 THealPix.cxx:169
 THealPix.cxx:170
 THealPix.cxx:171
 THealPix.cxx:172
 THealPix.cxx:173
 THealPix.cxx:174
 THealPix.cxx:175
 THealPix.cxx:176
 THealPix.cxx:177
 THealPix.cxx:178
 THealPix.cxx:179
 THealPix.cxx:180
 THealPix.cxx:181
 THealPix.cxx:182
 THealPix.cxx:183
 THealPix.cxx:184
 THealPix.cxx:185
 THealPix.cxx:186
 THealPix.cxx:187
 THealPix.cxx:188
 THealPix.cxx:189
 THealPix.cxx:190
 THealPix.cxx:191
 THealPix.cxx:192
 THealPix.cxx:193
 THealPix.cxx:194
 THealPix.cxx:195
 THealPix.cxx:196
 THealPix.cxx:197
 THealPix.cxx:198
 THealPix.cxx:199
 THealPix.cxx:200
 THealPix.cxx:201
 THealPix.cxx:202
 THealPix.cxx:203
 THealPix.cxx:204
 THealPix.cxx:205
 THealPix.cxx:206
 THealPix.cxx:207
 THealPix.cxx:208
 THealPix.cxx:209
 THealPix.cxx:210
 THealPix.cxx:211
 THealPix.cxx:212
 THealPix.cxx:213
 THealPix.cxx:214
 THealPix.cxx:215
 THealPix.cxx:216
 THealPix.cxx:217
 THealPix.cxx:218
 THealPix.cxx:219
 THealPix.cxx:220
 THealPix.cxx:221
 THealPix.cxx:222
 THealPix.cxx:223
 THealPix.cxx:224
 THealPix.cxx:225
 THealPix.cxx:226
 THealPix.cxx:227
 THealPix.cxx:228
 THealPix.cxx:229
 THealPix.cxx:230
 THealPix.cxx:231
 THealPix.cxx:232
 THealPix.cxx:233
 THealPix.cxx:234
 THealPix.cxx:235
 THealPix.cxx:236
 THealPix.cxx:237
 THealPix.cxx:238
 THealPix.cxx:239
 THealPix.cxx:240
 THealPix.cxx:241
 THealPix.cxx:242
 THealPix.cxx:243
 THealPix.cxx:244
 THealPix.cxx:245
 THealPix.cxx:246
 THealPix.cxx:247
 THealPix.cxx:248
 THealPix.cxx:249
 THealPix.cxx:250
 THealPix.cxx:251
 THealPix.cxx:252
 THealPix.cxx:253
 THealPix.cxx:254
 THealPix.cxx:255
 THealPix.cxx:256
 THealPix.cxx:257
 THealPix.cxx:258
 THealPix.cxx:259
 THealPix.cxx:260
 THealPix.cxx:261
 THealPix.cxx:262
 THealPix.cxx:263
 THealPix.cxx:264
 THealPix.cxx:265
 THealPix.cxx:266
 THealPix.cxx:267
 THealPix.cxx:268
 THealPix.cxx:269
 THealPix.cxx:270
 THealPix.cxx:271
 THealPix.cxx:272
 THealPix.cxx:273
 THealPix.cxx:274
 THealPix.cxx:275
 THealPix.cxx:276
 THealPix.cxx:277
 THealPix.cxx:278
 THealPix.cxx:279
 THealPix.cxx:280
 THealPix.cxx:281
 THealPix.cxx:282
 THealPix.cxx:283
 THealPix.cxx:284
 THealPix.cxx:285
 THealPix.cxx:286
 THealPix.cxx:287
 THealPix.cxx:288
 THealPix.cxx:289
 THealPix.cxx:290
 THealPix.cxx:291
 THealPix.cxx:292
 THealPix.cxx:293
 THealPix.cxx:294
 THealPix.cxx:295
 THealPix.cxx:296
 THealPix.cxx:297
 THealPix.cxx:298
 THealPix.cxx:299
 THealPix.cxx:300
 THealPix.cxx:301
 THealPix.cxx:302
 THealPix.cxx:303
 THealPix.cxx:304
 THealPix.cxx:305
 THealPix.cxx:306
 THealPix.cxx:307
 THealPix.cxx:308
 THealPix.cxx:309
 THealPix.cxx:310
 THealPix.cxx:311
 THealPix.cxx:312
 THealPix.cxx:313
 THealPix.cxx:314
 THealPix.cxx:315
 THealPix.cxx:316
 THealPix.cxx:317
 THealPix.cxx:318
 THealPix.cxx:319
 THealPix.cxx:320
 THealPix.cxx:321
 THealPix.cxx:322
 THealPix.cxx:323
 THealPix.cxx:324
 THealPix.cxx:325
 THealPix.cxx:326
 THealPix.cxx:327
 THealPix.cxx:328
 THealPix.cxx:329
 THealPix.cxx:330
 THealPix.cxx:331
 THealPix.cxx:332
 THealPix.cxx:333
 THealPix.cxx:334
 THealPix.cxx:335
 THealPix.cxx:336
 THealPix.cxx:337
 THealPix.cxx:338
 THealPix.cxx:339
 THealPix.cxx:340
 THealPix.cxx:341
 THealPix.cxx:342
 THealPix.cxx:343
 THealPix.cxx:344
 THealPix.cxx:345
 THealPix.cxx:346
 THealPix.cxx:347
 THealPix.cxx:348
 THealPix.cxx:349
 THealPix.cxx:350
 THealPix.cxx:351
 THealPix.cxx:352
 THealPix.cxx:353
 THealPix.cxx:354
 THealPix.cxx:355
 THealPix.cxx:356
 THealPix.cxx:357
 THealPix.cxx:358
 THealPix.cxx:359
 THealPix.cxx:360
 THealPix.cxx:361
 THealPix.cxx:362
 THealPix.cxx:363
 THealPix.cxx:364
 THealPix.cxx:365
 THealPix.cxx:366
 THealPix.cxx:367
 THealPix.cxx:368
 THealPix.cxx:369
 THealPix.cxx:370
 THealPix.cxx:371
 THealPix.cxx:372
 THealPix.cxx:373
 THealPix.cxx:374
 THealPix.cxx:375
 THealPix.cxx:376
 THealPix.cxx:377
 THealPix.cxx:378
 THealPix.cxx:379
 THealPix.cxx:380
 THealPix.cxx:381
 THealPix.cxx:382
 THealPix.cxx:383
 THealPix.cxx:384
 THealPix.cxx:385
 THealPix.cxx:386
 THealPix.cxx:387
 THealPix.cxx:388
 THealPix.cxx:389
 THealPix.cxx:390
 THealPix.cxx:391
 THealPix.cxx:392
 THealPix.cxx:393
 THealPix.cxx:394
 THealPix.cxx:395
 THealPix.cxx:396
 THealPix.cxx:397
 THealPix.cxx:398
 THealPix.cxx:399
 THealPix.cxx:400
 THealPix.cxx:401
 THealPix.cxx:402
 THealPix.cxx:403
 THealPix.cxx:404
 THealPix.cxx:405
 THealPix.cxx:406
 THealPix.cxx:407
 THealPix.cxx:408
 THealPix.cxx:409
 THealPix.cxx:410
 THealPix.cxx:411
 THealPix.cxx:412
 THealPix.cxx:413
 THealPix.cxx:414
 THealPix.cxx:415
 THealPix.cxx:416
 THealPix.cxx:417
 THealPix.cxx:418
 THealPix.cxx:419
 THealPix.cxx:420
 THealPix.cxx:421
 THealPix.cxx:422
 THealPix.cxx:423
 THealPix.cxx:424
 THealPix.cxx:425
 THealPix.cxx:426
 THealPix.cxx:427
 THealPix.cxx:428
 THealPix.cxx:429
 THealPix.cxx:430
 THealPix.cxx:431
 THealPix.cxx:432
 THealPix.cxx:433
 THealPix.cxx:434
 THealPix.cxx:435
 THealPix.cxx:436
 THealPix.cxx:437
 THealPix.cxx:438
 THealPix.cxx:439
 THealPix.cxx:440
 THealPix.cxx:441
 THealPix.cxx:442
 THealPix.cxx:443
 THealPix.cxx:444
 THealPix.cxx:445
 THealPix.cxx:446
 THealPix.cxx:447
 THealPix.cxx:448
 THealPix.cxx:449
 THealPix.cxx:450
 THealPix.cxx:451
 THealPix.cxx:452
 THealPix.cxx:453
 THealPix.cxx:454
 THealPix.cxx:455
 THealPix.cxx:456
 THealPix.cxx:457
 THealPix.cxx:458
 THealPix.cxx:459
 THealPix.cxx:460
 THealPix.cxx:461
 THealPix.cxx:462
 THealPix.cxx:463
 THealPix.cxx:464
 THealPix.cxx:465
 THealPix.cxx:466
 THealPix.cxx:467
 THealPix.cxx:468
 THealPix.cxx:469
 THealPix.cxx:470
 THealPix.cxx:471
 THealPix.cxx:472
 THealPix.cxx:473
 THealPix.cxx:474
 THealPix.cxx:475
 THealPix.cxx:476
 THealPix.cxx:477
 THealPix.cxx:478
 THealPix.cxx:479
 THealPix.cxx:480
 THealPix.cxx:481
 THealPix.cxx:482
 THealPix.cxx:483
 THealPix.cxx:484
 THealPix.cxx:485
 THealPix.cxx:486
 THealPix.cxx:487
 THealPix.cxx:488
 THealPix.cxx:489
 THealPix.cxx:490
 THealPix.cxx:491
 THealPix.cxx:492
 THealPix.cxx:493
 THealPix.cxx:494
 THealPix.cxx:495
 THealPix.cxx:496
 THealPix.cxx:497
 THealPix.cxx:498
 THealPix.cxx:499
 THealPix.cxx:500
 THealPix.cxx:501
 THealPix.cxx:502
 THealPix.cxx:503
 THealPix.cxx:504
 THealPix.cxx:505
 THealPix.cxx:506
 THealPix.cxx:507
 THealPix.cxx:508
 THealPix.cxx:509
 THealPix.cxx:510
 THealPix.cxx:511
 THealPix.cxx:512
 THealPix.cxx:513
 THealPix.cxx:514
 THealPix.cxx:515
 THealPix.cxx:516
 THealPix.cxx:517
 THealPix.cxx:518
 THealPix.cxx:519
 THealPix.cxx:520
 THealPix.cxx:521
 THealPix.cxx:522
 THealPix.cxx:523
 THealPix.cxx:524
 THealPix.cxx:525
 THealPix.cxx:526
 THealPix.cxx:527
 THealPix.cxx:528
 THealPix.cxx:529
 THealPix.cxx:530
 THealPix.cxx:531
 THealPix.cxx:532
 THealPix.cxx:533
 THealPix.cxx:534
 THealPix.cxx:535
 THealPix.cxx:536
 THealPix.cxx:537
 THealPix.cxx:538
 THealPix.cxx:539
 THealPix.cxx:540
 THealPix.cxx:541
 THealPix.cxx:542
 THealPix.cxx:543
 THealPix.cxx:544
 THealPix.cxx:545
 THealPix.cxx:546
 THealPix.cxx:547
 THealPix.cxx:548
 THealPix.cxx:549
 THealPix.cxx:550
 THealPix.cxx:551
 THealPix.cxx:552
 THealPix.cxx:553
 THealPix.cxx:554
 THealPix.cxx:555
 THealPix.cxx:556
 THealPix.cxx:557
 THealPix.cxx:558
 THealPix.cxx:559
 THealPix.cxx:560
 THealPix.cxx:561
 THealPix.cxx:562
 THealPix.cxx:563
 THealPix.cxx:564
 THealPix.cxx:565
 THealPix.cxx:566
 THealPix.cxx:567
 THealPix.cxx:568
 THealPix.cxx:569
 THealPix.cxx:570
 THealPix.cxx:571
 THealPix.cxx:572
 THealPix.cxx:573
 THealPix.cxx:574
 THealPix.cxx:575
 THealPix.cxx:576
 THealPix.cxx:577
 THealPix.cxx:578
 THealPix.cxx:579
 THealPix.cxx:580
 THealPix.cxx:581
 THealPix.cxx:582
 THealPix.cxx:583
 THealPix.cxx:584
 THealPix.cxx:585
 THealPix.cxx:586
 THealPix.cxx:587
 THealPix.cxx:588
 THealPix.cxx:589
 THealPix.cxx:590
 THealPix.cxx:591
 THealPix.cxx:592
 THealPix.cxx:593
 THealPix.cxx:594
 THealPix.cxx:595
 THealPix.cxx:596
 THealPix.cxx:597
 THealPix.cxx:598
 THealPix.cxx:599
 THealPix.cxx:600
 THealPix.cxx:601
 THealPix.cxx:602
 THealPix.cxx:603
 THealPix.cxx:604
 THealPix.cxx:605
 THealPix.cxx:606
 THealPix.cxx:607
 THealPix.cxx:608
 THealPix.cxx:609
 THealPix.cxx:610
 THealPix.cxx:611
 THealPix.cxx:612
 THealPix.cxx:613
 THealPix.cxx:614
 THealPix.cxx:615
 THealPix.cxx:616
 THealPix.cxx:617
 THealPix.cxx:618
 THealPix.cxx:619
 THealPix.cxx:620
 THealPix.cxx:621
 THealPix.cxx:622
 THealPix.cxx:623
 THealPix.cxx:624
 THealPix.cxx:625
 THealPix.cxx:626
 THealPix.cxx:627
 THealPix.cxx:628
 THealPix.cxx:629
 THealPix.cxx:630
 THealPix.cxx:631
 THealPix.cxx:632
 THealPix.cxx:633
 THealPix.cxx:634
 THealPix.cxx:635
 THealPix.cxx:636
 THealPix.cxx:637
 THealPix.cxx:638
 THealPix.cxx:639
 THealPix.cxx:640
 THealPix.cxx:641
 THealPix.cxx:642
 THealPix.cxx:643
 THealPix.cxx:644
 THealPix.cxx:645
 THealPix.cxx:646
 THealPix.cxx:647
 THealPix.cxx:648
 THealPix.cxx:649
 THealPix.cxx:650
 THealPix.cxx:651
 THealPix.cxx:652
 THealPix.cxx:653
 THealPix.cxx:654
 THealPix.cxx:655
 THealPix.cxx:656
 THealPix.cxx:657
 THealPix.cxx:658
 THealPix.cxx:659
 THealPix.cxx:660
 THealPix.cxx:661
 THealPix.cxx:662
 THealPix.cxx:663
 THealPix.cxx:664
 THealPix.cxx:665
 THealPix.cxx:666
 THealPix.cxx:667
 THealPix.cxx:668
 THealPix.cxx:669
 THealPix.cxx:670
 THealPix.cxx:671
 THealPix.cxx:672
 THealPix.cxx:673
 THealPix.cxx:674
 THealPix.cxx:675
 THealPix.cxx:676
 THealPix.cxx:677
 THealPix.cxx:678
 THealPix.cxx:679
 THealPix.cxx:680
 THealPix.cxx:681
 THealPix.cxx:682
 THealPix.cxx:683
 THealPix.cxx:684
 THealPix.cxx:685
 THealPix.cxx:686
 THealPix.cxx:687
 THealPix.cxx:688
 THealPix.cxx:689
 THealPix.cxx:690
 THealPix.cxx:691
 THealPix.cxx:692
 THealPix.cxx:693
 THealPix.cxx:694
 THealPix.cxx:695
 THealPix.cxx:696
 THealPix.cxx:697
 THealPix.cxx:698
 THealPix.cxx:699
 THealPix.cxx:700
 THealPix.cxx:701
 THealPix.cxx:702
 THealPix.cxx:703
 THealPix.cxx:704
 THealPix.cxx:705
 THealPix.cxx:706
 THealPix.cxx:707
 THealPix.cxx:708
 THealPix.cxx:709
 THealPix.cxx:710
 THealPix.cxx:711
 THealPix.cxx:712
 THealPix.cxx:713
 THealPix.cxx:714
 THealPix.cxx:715
 THealPix.cxx:716
 THealPix.cxx:717
 THealPix.cxx:718
 THealPix.cxx:719
 THealPix.cxx:720
 THealPix.cxx:721
 THealPix.cxx:722
 THealPix.cxx:723
 THealPix.cxx:724
 THealPix.cxx:725
 THealPix.cxx:726
 THealPix.cxx:727
 THealPix.cxx:728
 THealPix.cxx:729
 THealPix.cxx:730
 THealPix.cxx:731
 THealPix.cxx:732
 THealPix.cxx:733
 THealPix.cxx:734
 THealPix.cxx:735
 THealPix.cxx:736
 THealPix.cxx:737
 THealPix.cxx:738
 THealPix.cxx:739
 THealPix.cxx:740
 THealPix.cxx:741
 THealPix.cxx:742
 THealPix.cxx:743
 THealPix.cxx:744
 THealPix.cxx:745
 THealPix.cxx:746
 THealPix.cxx:747
 THealPix.cxx:748
 THealPix.cxx:749
 THealPix.cxx:750
 THealPix.cxx:751
 THealPix.cxx:752
 THealPix.cxx:753
 THealPix.cxx:754
 THealPix.cxx:755
 THealPix.cxx:756
 THealPix.cxx:757
 THealPix.cxx:758
 THealPix.cxx:759
 THealPix.cxx:760
 THealPix.cxx:761
 THealPix.cxx:762
 THealPix.cxx:763
 THealPix.cxx:764
 THealPix.cxx:765
 THealPix.cxx:766
 THealPix.cxx:767
 THealPix.cxx:768
 THealPix.cxx:769
 THealPix.cxx:770
 THealPix.cxx:771
 THealPix.cxx:772
 THealPix.cxx:773
 THealPix.cxx:774
 THealPix.cxx:775
 THealPix.cxx:776
 THealPix.cxx:777
 THealPix.cxx:778
 THealPix.cxx:779
 THealPix.cxx:780
 THealPix.cxx:781
 THealPix.cxx:782
 THealPix.cxx:783
 THealPix.cxx:784
 THealPix.cxx:785
 THealPix.cxx:786
 THealPix.cxx:787
 THealPix.cxx:788
 THealPix.cxx:789
 THealPix.cxx:790
 THealPix.cxx:791
 THealPix.cxx:792
 THealPix.cxx:793
 THealPix.cxx:794
 THealPix.cxx:795
 THealPix.cxx:796
 THealPix.cxx:797
 THealPix.cxx:798
 THealPix.cxx:799
 THealPix.cxx:800
 THealPix.cxx:801
 THealPix.cxx:802
 THealPix.cxx:803
 THealPix.cxx:804
 THealPix.cxx:805
 THealPix.cxx:806
 THealPix.cxx:807
 THealPix.cxx:808
 THealPix.cxx:809
 THealPix.cxx:810
 THealPix.cxx:811
 THealPix.cxx:812
 THealPix.cxx:813
 THealPix.cxx:814
 THealPix.cxx:815
 THealPix.cxx:816
 THealPix.cxx:817
 THealPix.cxx:818
 THealPix.cxx:819
 THealPix.cxx:820
 THealPix.cxx:821
 THealPix.cxx:822
 THealPix.cxx:823
 THealPix.cxx:824
 THealPix.cxx:825
 THealPix.cxx:826
 THealPix.cxx:827
 THealPix.cxx:828
 THealPix.cxx:829
 THealPix.cxx:830
 THealPix.cxx:831
 THealPix.cxx:832
 THealPix.cxx:833
 THealPix.cxx:834
 THealPix.cxx:835
 THealPix.cxx:836
 THealPix.cxx:837
 THealPix.cxx:838
 THealPix.cxx:839
 THealPix.cxx:840
 THealPix.cxx:841
 THealPix.cxx:842
 THealPix.cxx:843
 THealPix.cxx:844
 THealPix.cxx:845
 THealPix.cxx:846
 THealPix.cxx:847
 THealPix.cxx:848
 THealPix.cxx:849
 THealPix.cxx:850
 THealPix.cxx:851
 THealPix.cxx:852
 THealPix.cxx:853
 THealPix.cxx:854
 THealPix.cxx:855
 THealPix.cxx:856
 THealPix.cxx:857
 THealPix.cxx:858
 THealPix.cxx:859
 THealPix.cxx:860
 THealPix.cxx:861
 THealPix.cxx:862
 THealPix.cxx:863
 THealPix.cxx:864
 THealPix.cxx:865
 THealPix.cxx:866
 THealPix.cxx:867
 THealPix.cxx:868
 THealPix.cxx:869
 THealPix.cxx:870
 THealPix.cxx:871
 THealPix.cxx:872
 THealPix.cxx:873
 THealPix.cxx:874
 THealPix.cxx:875
 THealPix.cxx:876
 THealPix.cxx:877
 THealPix.cxx:878
 THealPix.cxx:879
 THealPix.cxx:880
 THealPix.cxx:881
 THealPix.cxx:882
 THealPix.cxx:883
 THealPix.cxx:884
 THealPix.cxx:885
 THealPix.cxx:886
 THealPix.cxx:887
 THealPix.cxx:888
 THealPix.cxx:889
 THealPix.cxx:890
 THealPix.cxx:891
 THealPix.cxx:892
 THealPix.cxx:893
 THealPix.cxx:894
 THealPix.cxx:895
 THealPix.cxx:896
 THealPix.cxx:897
 THealPix.cxx:898
 THealPix.cxx:899
 THealPix.cxx:900
 THealPix.cxx:901
 THealPix.cxx:902
 THealPix.cxx:903
 THealPix.cxx:904
 THealPix.cxx:905
 THealPix.cxx:906
 THealPix.cxx:907
 THealPix.cxx:908
 THealPix.cxx:909
 THealPix.cxx:910
 THealPix.cxx:911
 THealPix.cxx:912
 THealPix.cxx:913
 THealPix.cxx:914
 THealPix.cxx:915
 THealPix.cxx:916
 THealPix.cxx:917
 THealPix.cxx:918
 THealPix.cxx:919
 THealPix.cxx:920
 THealPix.cxx:921
 THealPix.cxx:922
 THealPix.cxx:923
 THealPix.cxx:924
 THealPix.cxx:925
 THealPix.cxx:926
 THealPix.cxx:927
 THealPix.cxx:928
 THealPix.cxx:929
 THealPix.cxx:930
 THealPix.cxx:931
 THealPix.cxx:932
 THealPix.cxx:933
 THealPix.cxx:934
 THealPix.cxx:935
 THealPix.cxx:936
 THealPix.cxx:937
 THealPix.cxx:938
 THealPix.cxx:939
 THealPix.cxx:940
 THealPix.cxx:941
 THealPix.cxx:942
 THealPix.cxx:943
 THealPix.cxx:944
 THealPix.cxx:945
 THealPix.cxx:946
 THealPix.cxx:947
 THealPix.cxx:948
 THealPix.cxx:949
 THealPix.cxx:950
 THealPix.cxx:951
 THealPix.cxx:952
 THealPix.cxx:953
 THealPix.cxx:954
 THealPix.cxx:955
 THealPix.cxx:956
 THealPix.cxx:957
 THealPix.cxx:958
 THealPix.cxx:959
 THealPix.cxx:960
 THealPix.cxx:961
 THealPix.cxx:962
 THealPix.cxx:963
 THealPix.cxx:964
 THealPix.cxx:965
 THealPix.cxx:966
 THealPix.cxx:967
 THealPix.cxx:968
 THealPix.cxx:969
 THealPix.cxx:970
 THealPix.cxx:971
 THealPix.cxx:972
 THealPix.cxx:973
 THealPix.cxx:974
 THealPix.cxx:975
 THealPix.cxx:976
 THealPix.cxx:977
 THealPix.cxx:978
 THealPix.cxx:979
 THealPix.cxx:980
 THealPix.cxx:981
 THealPix.cxx:982
 THealPix.cxx:983
 THealPix.cxx:984
 THealPix.cxx:985
 THealPix.cxx:986
 THealPix.cxx:987
 THealPix.cxx:988
 THealPix.cxx:989
 THealPix.cxx:990
 THealPix.cxx:991
 THealPix.cxx:992
 THealPix.cxx:993
 THealPix.cxx:994
 THealPix.cxx:995
 THealPix.cxx:996
 THealPix.cxx:997
 THealPix.cxx:998
 THealPix.cxx:999
 THealPix.cxx:1000
 THealPix.cxx:1001
 THealPix.cxx:1002
 THealPix.cxx:1003
 THealPix.cxx:1004
 THealPix.cxx:1005
 THealPix.cxx:1006
 THealPix.cxx:1007
 THealPix.cxx:1008
 THealPix.cxx:1009
 THealPix.cxx:1010
 THealPix.cxx:1011
 THealPix.cxx:1012
 THealPix.cxx:1013
 THealPix.cxx:1014
 THealPix.cxx:1015
 THealPix.cxx:1016
 THealPix.cxx:1017
 THealPix.cxx:1018
 THealPix.cxx:1019
 THealPix.cxx:1020
 THealPix.cxx:1021
 THealPix.cxx:1022
 THealPix.cxx:1023
 THealPix.cxx:1024
 THealPix.cxx:1025
 THealPix.cxx:1026
 THealPix.cxx:1027
 THealPix.cxx:1028
 THealPix.cxx:1029
 THealPix.cxx:1030
 THealPix.cxx:1031
 THealPix.cxx:1032
 THealPix.cxx:1033
 THealPix.cxx:1034
 THealPix.cxx:1035
 THealPix.cxx:1036
 THealPix.cxx:1037
 THealPix.cxx:1038
 THealPix.cxx:1039
 THealPix.cxx:1040
 THealPix.cxx:1041
 THealPix.cxx:1042
 THealPix.cxx:1043
 THealPix.cxx:1044
 THealPix.cxx:1045
 THealPix.cxx:1046
 THealPix.cxx:1047
 THealPix.cxx:1048
 THealPix.cxx:1049
 THealPix.cxx:1050
 THealPix.cxx:1051
 THealPix.cxx:1052
 THealPix.cxx:1053
 THealPix.cxx:1054
 THealPix.cxx:1055
 THealPix.cxx:1056
 THealPix.cxx:1057
 THealPix.cxx:1058
 THealPix.cxx:1059
 THealPix.cxx:1060
 THealPix.cxx:1061
 THealPix.cxx:1062
 THealPix.cxx:1063
 THealPix.cxx:1064
 THealPix.cxx:1065
 THealPix.cxx:1066
 THealPix.cxx:1067
 THealPix.cxx:1068
 THealPix.cxx:1069
 THealPix.cxx:1070
 THealPix.cxx:1071
 THealPix.cxx:1072
 THealPix.cxx:1073
 THealPix.cxx:1074
 THealPix.cxx:1075
 THealPix.cxx:1076
 THealPix.cxx:1077
 THealPix.cxx:1078
 THealPix.cxx:1079
 THealPix.cxx:1080
 THealPix.cxx:1081
 THealPix.cxx:1082
 THealPix.cxx:1083
 THealPix.cxx:1084
 THealPix.cxx:1085
 THealPix.cxx:1086
 THealPix.cxx:1087
 THealPix.cxx:1088
 THealPix.cxx:1089
 THealPix.cxx:1090
 THealPix.cxx:1091
 THealPix.cxx:1092
 THealPix.cxx:1093
 THealPix.cxx:1094
 THealPix.cxx:1095
 THealPix.cxx:1096
 THealPix.cxx:1097
 THealPix.cxx:1098
 THealPix.cxx:1099
 THealPix.cxx:1100
 THealPix.cxx:1101
 THealPix.cxx:1102
 THealPix.cxx:1103
 THealPix.cxx:1104
 THealPix.cxx:1105
 THealPix.cxx:1106
 THealPix.cxx:1107
 THealPix.cxx:1108
 THealPix.cxx:1109
 THealPix.cxx:1110
 THealPix.cxx:1111
 THealPix.cxx:1112
 THealPix.cxx:1113
 THealPix.cxx:1114
 THealPix.cxx:1115
 THealPix.cxx:1116
 THealPix.cxx:1117
 THealPix.cxx:1118
 THealPix.cxx:1119
 THealPix.cxx:1120
 THealPix.cxx:1121
 THealPix.cxx:1122
 THealPix.cxx:1123
 THealPix.cxx:1124
 THealPix.cxx:1125
 THealPix.cxx:1126
 THealPix.cxx:1127
 THealPix.cxx:1128
 THealPix.cxx:1129
 THealPix.cxx:1130
 THealPix.cxx:1131
 THealPix.cxx:1132
 THealPix.cxx:1133
 THealPix.cxx:1134
 THealPix.cxx:1135
 THealPix.cxx:1136
 THealPix.cxx:1137
 THealPix.cxx:1138
 THealPix.cxx:1139
 THealPix.cxx:1140
 THealPix.cxx:1141
 THealPix.cxx:1142
 THealPix.cxx:1143
 THealPix.cxx:1144
 THealPix.cxx:1145
 THealPix.cxx:1146
 THealPix.cxx:1147
 THealPix.cxx:1148
 THealPix.cxx:1149
 THealPix.cxx:1150
 THealPix.cxx:1151
 THealPix.cxx:1152
 THealPix.cxx:1153
 THealPix.cxx:1154
 THealPix.cxx:1155
 THealPix.cxx:1156
 THealPix.cxx:1157
 THealPix.cxx:1158
 THealPix.cxx:1159
 THealPix.cxx:1160
 THealPix.cxx:1161
 THealPix.cxx:1162
 THealPix.cxx:1163
 THealPix.cxx:1164
 THealPix.cxx:1165
 THealPix.cxx:1166
 THealPix.cxx:1167
 THealPix.cxx:1168
 THealPix.cxx:1169
 THealPix.cxx:1170
 THealPix.cxx:1171
 THealPix.cxx:1172
 THealPix.cxx:1173
 THealPix.cxx:1174
 THealPix.cxx:1175
 THealPix.cxx:1176
 THealPix.cxx:1177
 THealPix.cxx:1178
 THealPix.cxx:1179
 THealPix.cxx:1180
 THealPix.cxx:1181
 THealPix.cxx:1182
 THealPix.cxx:1183
 THealPix.cxx:1184
 THealPix.cxx:1185
 THealPix.cxx:1186
 THealPix.cxx:1187
 THealPix.cxx:1188
 THealPix.cxx:1189
 THealPix.cxx:1190
 THealPix.cxx:1191
 THealPix.cxx:1192
 THealPix.cxx:1193
 THealPix.cxx:1194
 THealPix.cxx:1195
 THealPix.cxx:1196
 THealPix.cxx:1197
 THealPix.cxx:1198
 THealPix.cxx:1199
 THealPix.cxx:1200
 THealPix.cxx:1201
 THealPix.cxx:1202
 THealPix.cxx:1203
 THealPix.cxx:1204
 THealPix.cxx:1205
 THealPix.cxx:1206
 THealPix.cxx:1207
 THealPix.cxx:1208
 THealPix.cxx:1209
 THealPix.cxx:1210
 THealPix.cxx:1211
 THealPix.cxx:1212
 THealPix.cxx:1213
 THealPix.cxx:1214
 THealPix.cxx:1215
 THealPix.cxx:1216
 THealPix.cxx:1217
 THealPix.cxx:1218
 THealPix.cxx:1219
 THealPix.cxx:1220
 THealPix.cxx:1221
 THealPix.cxx:1222
 THealPix.cxx:1223
 THealPix.cxx:1224
 THealPix.cxx:1225
 THealPix.cxx:1226
 THealPix.cxx:1227
 THealPix.cxx:1228
 THealPix.cxx:1229
 THealPix.cxx:1230
 THealPix.cxx:1231
 THealPix.cxx:1232
 THealPix.cxx:1233
 THealPix.cxx:1234
 THealPix.cxx:1235
 THealPix.cxx:1236
 THealPix.cxx:1237
 THealPix.cxx:1238
 THealPix.cxx:1239
 THealPix.cxx:1240
 THealPix.cxx:1241
 THealPix.cxx:1242
 THealPix.cxx:1243
 THealPix.cxx:1244
 THealPix.cxx:1245
 THealPix.cxx:1246
 THealPix.cxx:1247
 THealPix.cxx:1248
 THealPix.cxx:1249
 THealPix.cxx:1250
 THealPix.cxx:1251
 THealPix.cxx:1252
 THealPix.cxx:1253
 THealPix.cxx:1254
 THealPix.cxx:1255
 THealPix.cxx:1256
 THealPix.cxx:1257
 THealPix.cxx:1258
 THealPix.cxx:1259
 THealPix.cxx:1260
 THealPix.cxx:1261
 THealPix.cxx:1262
 THealPix.cxx:1263
 THealPix.cxx:1264
 THealPix.cxx:1265
 THealPix.cxx:1266
 THealPix.cxx:1267
 THealPix.cxx:1268
 THealPix.cxx:1269
 THealPix.cxx:1270
 THealPix.cxx:1271
 THealPix.cxx:1272
 THealPix.cxx:1273
 THealPix.cxx:1274
 THealPix.cxx:1275
 THealPix.cxx:1276
 THealPix.cxx:1277
 THealPix.cxx:1278
 THealPix.cxx:1279
 THealPix.cxx:1280
 THealPix.cxx:1281
 THealPix.cxx:1282
 THealPix.cxx:1283
 THealPix.cxx:1284
 THealPix.cxx:1285
 THealPix.cxx:1286
 THealPix.cxx:1287
 THealPix.cxx:1288
 THealPix.cxx:1289
 THealPix.cxx:1290
 THealPix.cxx:1291
 THealPix.cxx:1292
 THealPix.cxx:1293
 THealPix.cxx:1294
 THealPix.cxx:1295
 THealPix.cxx:1296
 THealPix.cxx:1297
 THealPix.cxx:1298
 THealPix.cxx:1299
 THealPix.cxx:1300
 THealPix.cxx:1301
 THealPix.cxx:1302
 THealPix.cxx:1303
 THealPix.cxx:1304
 THealPix.cxx:1305
 THealPix.cxx:1306
 THealPix.cxx:1307
 THealPix.cxx:1308
 THealPix.cxx:1309
 THealPix.cxx:1310
 THealPix.cxx:1311
 THealPix.cxx:1312
 THealPix.cxx:1313
 THealPix.cxx:1314
 THealPix.cxx:1315
 THealPix.cxx:1316
 THealPix.cxx:1317
 THealPix.cxx:1318
 THealPix.cxx:1319
 THealPix.cxx:1320
 THealPix.cxx:1321
 THealPix.cxx:1322
 THealPix.cxx:1323
 THealPix.cxx:1324
 THealPix.cxx:1325
 THealPix.cxx:1326
 THealPix.cxx:1327
 THealPix.cxx:1328
 THealPix.cxx:1329
 THealPix.cxx:1330
 THealPix.cxx:1331
 THealPix.cxx:1332
 THealPix.cxx:1333
 THealPix.cxx:1334
 THealPix.cxx:1335
 THealPix.cxx:1336
 THealPix.cxx:1337
 THealPix.cxx:1338
 THealPix.cxx:1339
 THealPix.cxx:1340
 THealPix.cxx:1341
 THealPix.cxx:1342
 THealPix.cxx:1343
 THealPix.cxx:1344
 THealPix.cxx:1345
 THealPix.cxx:1346
 THealPix.cxx:1347
 THealPix.cxx:1348
 THealPix.cxx:1349
 THealPix.cxx:1350
 THealPix.cxx:1351
 THealPix.cxx:1352
 THealPix.cxx:1353
 THealPix.cxx:1354
 THealPix.cxx:1355
 THealPix.cxx:1356
 THealPix.cxx:1357
 THealPix.cxx:1358
 THealPix.cxx:1359
 THealPix.cxx:1360
 THealPix.cxx:1361
 THealPix.cxx:1362
 THealPix.cxx:1363
 THealPix.cxx:1364
 THealPix.cxx:1365
 THealPix.cxx:1366
 THealPix.cxx:1367
 THealPix.cxx:1368
 THealPix.cxx:1369
 THealPix.cxx:1370
 THealPix.cxx:1371
 THealPix.cxx:1372
 THealPix.cxx:1373
 THealPix.cxx:1374
 THealPix.cxx:1375
 THealPix.cxx:1376
 THealPix.cxx:1377
 THealPix.cxx:1378
 THealPix.cxx:1379
 THealPix.cxx:1380
 THealPix.cxx:1381
 THealPix.cxx:1382
 THealPix.cxx:1383
 THealPix.cxx:1384
 THealPix.cxx:1385
 THealPix.cxx:1386
 THealPix.cxx:1387
 THealPix.cxx:1388
 THealPix.cxx:1389
 THealPix.cxx:1390
 THealPix.cxx:1391
 THealPix.cxx:1392
 THealPix.cxx:1393
 THealPix.cxx:1394
 THealPix.cxx:1395
 THealPix.cxx:1396
 THealPix.cxx:1397
 THealPix.cxx:1398
 THealPix.cxx:1399
 THealPix.cxx:1400
 THealPix.cxx:1401
 THealPix.cxx:1402
 THealPix.cxx:1403
 THealPix.cxx:1404
 THealPix.cxx:1405
 THealPix.cxx:1406
 THealPix.cxx:1407
 THealPix.cxx:1408
 THealPix.cxx:1409
 THealPix.cxx:1410
 THealPix.cxx:1411
 THealPix.cxx:1412
 THealPix.cxx:1413
 THealPix.cxx:1414
 THealPix.cxx:1415
 THealPix.cxx:1416
 THealPix.cxx:1417
 THealPix.cxx:1418
 THealPix.cxx:1419
 THealPix.cxx:1420
 THealPix.cxx:1421
 THealPix.cxx:1422
 THealPix.cxx:1423
 THealPix.cxx:1424
 THealPix.cxx:1425
 THealPix.cxx:1426
 THealPix.cxx:1427
 THealPix.cxx:1428
 THealPix.cxx:1429
 THealPix.cxx:1430
 THealPix.cxx:1431
 THealPix.cxx:1432
 THealPix.cxx:1433
 THealPix.cxx:1434
 THealPix.cxx:1435
 THealPix.cxx:1436
 THealPix.cxx:1437
 THealPix.cxx:1438
 THealPix.cxx:1439
 THealPix.cxx:1440
 THealPix.cxx:1441
 THealPix.cxx:1442
 THealPix.cxx:1443
 THealPix.cxx:1444
 THealPix.cxx:1445
 THealPix.cxx:1446
 THealPix.cxx:1447
 THealPix.cxx:1448
 THealPix.cxx:1449
 THealPix.cxx:1450
 THealPix.cxx:1451
 THealPix.cxx:1452
 THealPix.cxx:1453
 THealPix.cxx:1454
 THealPix.cxx:1455
 THealPix.cxx:1456
 THealPix.cxx:1457
 THealPix.cxx:1458
 THealPix.cxx:1459
 THealPix.cxx:1460
 THealPix.cxx:1461
 THealPix.cxx:1462
 THealPix.cxx:1463
 THealPix.cxx:1464
 THealPix.cxx:1465
 THealPix.cxx:1466
 THealPix.cxx:1467
 THealPix.cxx:1468
 THealPix.cxx:1469
 THealPix.cxx:1470
 THealPix.cxx:1471
 THealPix.cxx:1472
 THealPix.cxx:1473
 THealPix.cxx:1474
 THealPix.cxx:1475
 THealPix.cxx:1476
 THealPix.cxx:1477
 THealPix.cxx:1478
 THealPix.cxx:1479
 THealPix.cxx:1480
 THealPix.cxx:1481
 THealPix.cxx:1482
 THealPix.cxx:1483
 THealPix.cxx:1484
 THealPix.cxx:1485
 THealPix.cxx:1486
 THealPix.cxx:1487
 THealPix.cxx:1488
 THealPix.cxx:1489
 THealPix.cxx:1490
 THealPix.cxx:1491
 THealPix.cxx:1492
 THealPix.cxx:1493
 THealPix.cxx:1494
 THealPix.cxx:1495
 THealPix.cxx:1496
 THealPix.cxx:1497
 THealPix.cxx:1498
 THealPix.cxx:1499
 THealPix.cxx:1500
 THealPix.cxx:1501
 THealPix.cxx:1502
 THealPix.cxx:1503
 THealPix.cxx:1504
 THealPix.cxx:1505
 THealPix.cxx:1506
 THealPix.cxx:1507
 THealPix.cxx:1508
 THealPix.cxx:1509
 THealPix.cxx:1510
 THealPix.cxx:1511
 THealPix.cxx:1512
 THealPix.cxx:1513
 THealPix.cxx:1514
 THealPix.cxx:1515
 THealPix.cxx:1516
 THealPix.cxx:1517
 THealPix.cxx:1518
 THealPix.cxx:1519
 THealPix.cxx:1520
 THealPix.cxx:1521
 THealPix.cxx:1522
 THealPix.cxx:1523
 THealPix.cxx:1524
 THealPix.cxx:1525
 THealPix.cxx:1526
 THealPix.cxx:1527
 THealPix.cxx:1528
 THealPix.cxx:1529
 THealPix.cxx:1530
 THealPix.cxx:1531
 THealPix.cxx:1532
 THealPix.cxx:1533
 THealPix.cxx:1534
 THealPix.cxx:1535
 THealPix.cxx:1536
 THealPix.cxx:1537
 THealPix.cxx:1538
 THealPix.cxx:1539
 THealPix.cxx:1540
 THealPix.cxx:1541
 THealPix.cxx:1542
 THealPix.cxx:1543
 THealPix.cxx:1544
 THealPix.cxx:1545
 THealPix.cxx:1546
 THealPix.cxx:1547
 THealPix.cxx:1548
 THealPix.cxx:1549
 THealPix.cxx:1550
 THealPix.cxx:1551
 THealPix.cxx:1552
 THealPix.cxx:1553
 THealPix.cxx:1554
 THealPix.cxx:1555
 THealPix.cxx:1556
 THealPix.cxx:1557
 THealPix.cxx:1558
 THealPix.cxx:1559
 THealPix.cxx:1560
 THealPix.cxx:1561
 THealPix.cxx:1562
 THealPix.cxx:1563
 THealPix.cxx:1564
 THealPix.cxx:1565
 THealPix.cxx:1566
 THealPix.cxx:1567
 THealPix.cxx:1568
 THealPix.cxx:1569
 THealPix.cxx:1570
 THealPix.cxx:1571
 THealPix.cxx:1572
 THealPix.cxx:1573
 THealPix.cxx:1574
 THealPix.cxx:1575
 THealPix.cxx:1576
 THealPix.cxx:1577
 THealPix.cxx:1578
 THealPix.cxx:1579
 THealPix.cxx:1580
 THealPix.cxx:1581
 THealPix.cxx:1582
 THealPix.cxx:1583
 THealPix.cxx:1584
 THealPix.cxx:1585
 THealPix.cxx:1586
 THealPix.cxx:1587
 THealPix.cxx:1588
 THealPix.cxx:1589
 THealPix.cxx:1590
 THealPix.cxx:1591
 THealPix.cxx:1592
 THealPix.cxx:1593
 THealPix.cxx:1594
 THealPix.cxx:1595
 THealPix.cxx:1596
 THealPix.cxx:1597
 THealPix.cxx:1598
 THealPix.cxx:1599
 THealPix.cxx:1600
 THealPix.cxx:1601
 THealPix.cxx:1602
 THealPix.cxx:1603
 THealPix.cxx:1604
 THealPix.cxx:1605
 THealPix.cxx:1606
 THealPix.cxx:1607
 THealPix.cxx:1608
 THealPix.cxx:1609
 THealPix.cxx:1610
 THealPix.cxx:1611
 THealPix.cxx:1612
 THealPix.cxx:1613
 THealPix.cxx:1614
 THealPix.cxx:1615
 THealPix.cxx:1616
 THealPix.cxx:1617
 THealPix.cxx:1618
 THealPix.cxx:1619
 THealPix.cxx:1620
 THealPix.cxx:1621
 THealPix.cxx:1622
 THealPix.cxx:1623
 THealPix.cxx:1624
 THealPix.cxx:1625
 THealPix.cxx:1626
 THealPix.cxx:1627
 THealPix.cxx:1628
 THealPix.cxx:1629
 THealPix.cxx:1630
 THealPix.cxx:1631
 THealPix.cxx:1632
 THealPix.cxx:1633
 THealPix.cxx:1634
 THealPix.cxx:1635
 THealPix.cxx:1636
 THealPix.cxx:1637
 THealPix.cxx:1638
 THealPix.cxx:1639
 THealPix.cxx:1640
 THealPix.cxx:1641
 THealPix.cxx:1642
 THealPix.cxx:1643
 THealPix.cxx:1644
 THealPix.cxx:1645
 THealPix.cxx:1646
 THealPix.cxx:1647
 THealPix.cxx:1648
 THealPix.cxx:1649
 THealPix.cxx:1650
 THealPix.cxx:1651
 THealPix.cxx:1652
 THealPix.cxx:1653
 THealPix.cxx:1654
 THealPix.cxx:1655
 THealPix.cxx:1656
 THealPix.cxx:1657
 THealPix.cxx:1658
 THealPix.cxx:1659
 THealPix.cxx:1660
 THealPix.cxx:1661
 THealPix.cxx:1662
 THealPix.cxx:1663
 THealPix.cxx:1664
 THealPix.cxx:1665
 THealPix.cxx:1666
 THealPix.cxx:1667
 THealPix.cxx:1668
 THealPix.cxx:1669
 THealPix.cxx:1670
 THealPix.cxx:1671
 THealPix.cxx:1672
 THealPix.cxx:1673
 THealPix.cxx:1674
 THealPix.cxx:1675
 THealPix.cxx:1676
 THealPix.cxx:1677
 THealPix.cxx:1678
 THealPix.cxx:1679
 THealPix.cxx:1680
 THealPix.cxx:1681
 THealPix.cxx:1682
 THealPix.cxx:1683
 THealPix.cxx:1684
 THealPix.cxx:1685
 THealPix.cxx:1686
 THealPix.cxx:1687
 THealPix.cxx:1688
 THealPix.cxx:1689
 THealPix.cxx:1690
 THealPix.cxx:1691
 THealPix.cxx:1692
 THealPix.cxx:1693
 THealPix.cxx:1694
 THealPix.cxx:1695
 THealPix.cxx:1696
 THealPix.cxx:1697
 THealPix.cxx:1698
 THealPix.cxx:1699
 THealPix.cxx:1700
 THealPix.cxx:1701
 THealPix.cxx:1702
 THealPix.cxx:1703
 THealPix.cxx:1704
 THealPix.cxx:1705
 THealPix.cxx:1706
 THealPix.cxx:1707
 THealPix.cxx:1708
 THealPix.cxx:1709
 THealPix.cxx:1710
 THealPix.cxx:1711
 THealPix.cxx:1712
 THealPix.cxx:1713
 THealPix.cxx:1714
 THealPix.cxx:1715
 THealPix.cxx:1716
 THealPix.cxx:1717
 THealPix.cxx:1718
 THealPix.cxx:1719
 THealPix.cxx:1720
 THealPix.cxx:1721
 THealPix.cxx:1722
 THealPix.cxx:1723
 THealPix.cxx:1724
 THealPix.cxx:1725
 THealPix.cxx:1726
 THealPix.cxx:1727
 THealPix.cxx:1728
 THealPix.cxx:1729
 THealPix.cxx:1730
 THealPix.cxx:1731
 THealPix.cxx:1732
 THealPix.cxx:1733
 THealPix.cxx:1734
 THealPix.cxx:1735
 THealPix.cxx:1736
 THealPix.cxx:1737
 THealPix.cxx:1738
 THealPix.cxx:1739
 THealPix.cxx:1740
 THealPix.cxx:1741
 THealPix.cxx:1742
 THealPix.cxx:1743
 THealPix.cxx:1744
 THealPix.cxx:1745
 THealPix.cxx:1746
 THealPix.cxx:1747
 THealPix.cxx:1748
 THealPix.cxx:1749
 THealPix.cxx:1750
 THealPix.cxx:1751
 THealPix.cxx:1752
 THealPix.cxx:1753
 THealPix.cxx:1754
 THealPix.cxx:1755
 THealPix.cxx:1756
 THealPix.cxx:1757
 THealPix.cxx:1758
 THealPix.cxx:1759
 THealPix.cxx:1760
 THealPix.cxx:1761
 THealPix.cxx:1762
 THealPix.cxx:1763
 THealPix.cxx:1764
 THealPix.cxx:1765
 THealPix.cxx:1766
 THealPix.cxx:1767
 THealPix.cxx:1768
 THealPix.cxx:1769
 THealPix.cxx:1770
 THealPix.cxx:1771
 THealPix.cxx:1772
 THealPix.cxx:1773
 THealPix.cxx:1774
 THealPix.cxx:1775
 THealPix.cxx:1776
 THealPix.cxx:1777
 THealPix.cxx:1778
 THealPix.cxx:1779
 THealPix.cxx:1780
 THealPix.cxx:1781
 THealPix.cxx:1782
 THealPix.cxx:1783
 THealPix.cxx:1784
 THealPix.cxx:1785
 THealPix.cxx:1786
 THealPix.cxx:1787
 THealPix.cxx:1788
 THealPix.cxx:1789
 THealPix.cxx:1790
 THealPix.cxx:1791
 THealPix.cxx:1792
 THealPix.cxx:1793
 THealPix.cxx:1794
 THealPix.cxx:1795
 THealPix.cxx:1796
 THealPix.cxx:1797
 THealPix.cxx:1798
 THealPix.cxx:1799
 THealPix.cxx:1800
 THealPix.cxx:1801
 THealPix.cxx:1802
 THealPix.cxx:1803
 THealPix.cxx:1804
 THealPix.cxx:1805
 THealPix.cxx:1806
 THealPix.cxx:1807
 THealPix.cxx:1808
 THealPix.cxx:1809
 THealPix.cxx:1810
 THealPix.cxx:1811
 THealPix.cxx:1812
 THealPix.cxx:1813
 THealPix.cxx:1814
 THealPix.cxx:1815
 THealPix.cxx:1816
 THealPix.cxx:1817
 THealPix.cxx:1818
 THealPix.cxx:1819
 THealPix.cxx:1820
 THealPix.cxx:1821
 THealPix.cxx:1822
 THealPix.cxx:1823
 THealPix.cxx:1824
 THealPix.cxx:1825
 THealPix.cxx:1826
 THealPix.cxx:1827
 THealPix.cxx:1828
 THealPix.cxx:1829
 THealPix.cxx:1830
 THealPix.cxx:1831
 THealPix.cxx:1832
 THealPix.cxx:1833
 THealPix.cxx:1834
 THealPix.cxx:1835
 THealPix.cxx:1836
 THealPix.cxx:1837
 THealPix.cxx:1838
 THealPix.cxx:1839
 THealPix.cxx:1840
 THealPix.cxx:1841
 THealPix.cxx:1842
 THealPix.cxx:1843
 THealPix.cxx:1844
 THealPix.cxx:1845
 THealPix.cxx:1846
 THealPix.cxx:1847
 THealPix.cxx:1848
 THealPix.cxx:1849
 THealPix.cxx:1850
 THealPix.cxx:1851
 THealPix.cxx:1852
 THealPix.cxx:1853
 THealPix.cxx:1854
 THealPix.cxx:1855
 THealPix.cxx:1856
 THealPix.cxx:1857
 THealPix.cxx:1858
 THealPix.cxx:1859
 THealPix.cxx:1860
 THealPix.cxx:1861
 THealPix.cxx:1862
 THealPix.cxx:1863
 THealPix.cxx:1864
 THealPix.cxx:1865
 THealPix.cxx:1866
 THealPix.cxx:1867
 THealPix.cxx:1868
 THealPix.cxx:1869
 THealPix.cxx:1870
 THealPix.cxx:1871
 THealPix.cxx:1872
 THealPix.cxx:1873
 THealPix.cxx:1874
 THealPix.cxx:1875
 THealPix.cxx:1876
 THealPix.cxx:1877
 THealPix.cxx:1878
 THealPix.cxx:1879
 THealPix.cxx:1880
 THealPix.cxx:1881
 THealPix.cxx:1882
 THealPix.cxx:1883
 THealPix.cxx:1884
 THealPix.cxx:1885
 THealPix.cxx:1886
 THealPix.cxx:1887
 THealPix.cxx:1888
 THealPix.cxx:1889
 THealPix.cxx:1890
 THealPix.cxx:1891
 THealPix.cxx:1892
 THealPix.cxx:1893
 THealPix.cxx:1894
 THealPix.cxx:1895
 THealPix.cxx:1896
 THealPix.cxx:1897
 THealPix.cxx:1898
 THealPix.cxx:1899
 THealPix.cxx:1900
 THealPix.cxx:1901
 THealPix.cxx:1902
 THealPix.cxx:1903
 THealPix.cxx:1904
 THealPix.cxx:1905
 THealPix.cxx:1906
 THealPix.cxx:1907
 THealPix.cxx:1908
 THealPix.cxx:1909
 THealPix.cxx:1910
 THealPix.cxx:1911
 THealPix.cxx:1912
 THealPix.cxx:1913
 THealPix.cxx:1914
 THealPix.cxx:1915
 THealPix.cxx:1916
 THealPix.cxx:1917
 THealPix.cxx:1918
 THealPix.cxx:1919
 THealPix.cxx:1920
 THealPix.cxx:1921
 THealPix.cxx:1922
 THealPix.cxx:1923
 THealPix.cxx:1924
 THealPix.cxx:1925
 THealPix.cxx:1926
 THealPix.cxx:1927
 THealPix.cxx:1928
 THealPix.cxx:1929
 THealPix.cxx:1930
 THealPix.cxx:1931
 THealPix.cxx:1932
 THealPix.cxx:1933
 THealPix.cxx:1934
 THealPix.cxx:1935
 THealPix.cxx:1936
 THealPix.cxx:1937
 THealPix.cxx:1938
 THealPix.cxx:1939
 THealPix.cxx:1940
 THealPix.cxx:1941
 THealPix.cxx:1942
 THealPix.cxx:1943
 THealPix.cxx:1944
 THealPix.cxx:1945
 THealPix.cxx:1946
 THealPix.cxx:1947
 THealPix.cxx:1948
 THealPix.cxx:1949
 THealPix.cxx:1950
 THealPix.cxx:1951
 THealPix.cxx:1952
 THealPix.cxx:1953
 THealPix.cxx:1954
 THealPix.cxx:1955
 THealPix.cxx:1956
 THealPix.cxx:1957
 THealPix.cxx:1958
 THealPix.cxx:1959
 THealPix.cxx:1960
 THealPix.cxx:1961
 THealPix.cxx:1962
 THealPix.cxx:1963
 THealPix.cxx:1964
 THealPix.cxx:1965
 THealPix.cxx:1966
 THealPix.cxx:1967
 THealPix.cxx:1968
 THealPix.cxx:1969
 THealPix.cxx:1970
 THealPix.cxx:1971
 THealPix.cxx:1972
 THealPix.cxx:1973
 THealPix.cxx:1974
 THealPix.cxx:1975
 THealPix.cxx:1976
 THealPix.cxx:1977
 THealPix.cxx:1978
 THealPix.cxx:1979
 THealPix.cxx:1980
 THealPix.cxx:1981
 THealPix.cxx:1982
 THealPix.cxx:1983
 THealPix.cxx:1984
 THealPix.cxx:1985
 THealPix.cxx:1986
 THealPix.cxx:1987
 THealPix.cxx:1988
 THealPix.cxx:1989
 THealPix.cxx:1990
 THealPix.cxx:1991
 THealPix.cxx:1992
 THealPix.cxx:1993
 THealPix.cxx:1994
 THealPix.cxx:1995
 THealPix.cxx:1996
 THealPix.cxx:1997
 THealPix.cxx:1998
 THealPix.cxx:1999
 THealPix.cxx:2000
 THealPix.cxx:2001
 THealPix.cxx:2002
 THealPix.cxx:2003
 THealPix.cxx:2004
 THealPix.cxx:2005
 THealPix.cxx:2006
 THealPix.cxx:2007
 THealPix.cxx:2008
 THealPix.cxx:2009
 THealPix.cxx:2010
 THealPix.cxx:2011
 THealPix.cxx:2012
 THealPix.cxx:2013
 THealPix.cxx:2014
 THealPix.cxx:2015
 THealPix.cxx:2016
 THealPix.cxx:2017
 THealPix.cxx:2018
 THealPix.cxx:2019
 THealPix.cxx:2020
 THealPix.cxx:2021
 THealPix.cxx:2022
 THealPix.cxx:2023
 THealPix.cxx:2024
 THealPix.cxx:2025
 THealPix.cxx:2026
 THealPix.cxx:2027
 THealPix.cxx:2028
 THealPix.cxx:2029
 THealPix.cxx:2030
 THealPix.cxx:2031
 THealPix.cxx:2032
 THealPix.cxx:2033
 THealPix.cxx:2034
 THealPix.cxx:2035
 THealPix.cxx:2036
 THealPix.cxx:2037
 THealPix.cxx:2038
 THealPix.cxx:2039
 THealPix.cxx:2040
 THealPix.cxx:2041
 THealPix.cxx:2042
 THealPix.cxx:2043
 THealPix.cxx:2044
 THealPix.cxx:2045
 THealPix.cxx:2046
 THealPix.cxx:2047
 THealPix.cxx:2048
 THealPix.cxx:2049
 THealPix.cxx:2050
 THealPix.cxx:2051
 THealPix.cxx:2052
 THealPix.cxx:2053
 THealPix.cxx:2054
 THealPix.cxx:2055
 THealPix.cxx:2056
 THealPix.cxx:2057
 THealPix.cxx:2058
 THealPix.cxx:2059
 THealPix.cxx:2060
 THealPix.cxx:2061
 THealPix.cxx:2062
 THealPix.cxx:2063
 THealPix.cxx:2064
 THealPix.cxx:2065
 THealPix.cxx:2066
 THealPix.cxx:2067
 THealPix.cxx:2068
 THealPix.cxx:2069
 THealPix.cxx:2070
 THealPix.cxx:2071
 THealPix.cxx:2072
 THealPix.cxx:2073
 THealPix.cxx:2074
 THealPix.cxx:2075
 THealPix.cxx:2076
 THealPix.cxx:2077
 THealPix.cxx:2078
 THealPix.cxx:2079
 THealPix.cxx:2080
 THealPix.cxx:2081
 THealPix.cxx:2082
 THealPix.cxx:2083
 THealPix.cxx:2084
 THealPix.cxx:2085
 THealPix.cxx:2086
 THealPix.cxx:2087
 THealPix.cxx:2088
 THealPix.cxx:2089
 THealPix.cxx:2090
 THealPix.cxx:2091
 THealPix.cxx:2092
 THealPix.cxx:2093
 THealPix.cxx:2094
 THealPix.cxx:2095
 THealPix.cxx:2096
 THealPix.cxx:2097
 THealPix.cxx:2098
 THealPix.cxx:2099
 THealPix.cxx:2100
 THealPix.cxx:2101
 THealPix.cxx:2102
 THealPix.cxx:2103
 THealPix.cxx:2104
 THealPix.cxx:2105
 THealPix.cxx:2106
 THealPix.cxx:2107
 THealPix.cxx:2108
 THealPix.cxx:2109
 THealPix.cxx:2110
 THealPix.cxx:2111
 THealPix.cxx:2112
 THealPix.cxx:2113
 THealPix.cxx:2114
 THealPix.cxx:2115
 THealPix.cxx:2116
 THealPix.cxx:2117
 THealPix.cxx:2118
 THealPix.cxx:2119
 THealPix.cxx:2120
 THealPix.cxx:2121
 THealPix.cxx:2122
 THealPix.cxx:2123
 THealPix.cxx:2124
 THealPix.cxx:2125
 THealPix.cxx:2126
 THealPix.cxx:2127
 THealPix.cxx:2128
 THealPix.cxx:2129
 THealPix.cxx:2130
 THealPix.cxx:2131
 THealPix.cxx:2132
 THealPix.cxx:2133
 THealPix.cxx:2134
 THealPix.cxx:2135
 THealPix.cxx:2136
 THealPix.cxx:2137
 THealPix.cxx:2138
 THealPix.cxx:2139
 THealPix.cxx:2140
 THealPix.cxx:2141
 THealPix.cxx:2142
 THealPix.cxx:2143
 THealPix.cxx:2144
 THealPix.cxx:2145
 THealPix.cxx:2146
 THealPix.cxx:2147
 THealPix.cxx:2148
 THealPix.cxx:2149
 THealPix.cxx:2150
 THealPix.cxx:2151
 THealPix.cxx:2152
 THealPix.cxx:2153
 THealPix.cxx:2154
 THealPix.cxx:2155
 THealPix.cxx:2156
 THealPix.cxx:2157
 THealPix.cxx:2158
 THealPix.cxx:2159
 THealPix.cxx:2160
 THealPix.cxx:2161
 THealPix.cxx:2162
 THealPix.cxx:2163
 THealPix.cxx:2164
 THealPix.cxx:2165
 THealPix.cxx:2166
 THealPix.cxx:2167
 THealPix.cxx:2168
 THealPix.cxx:2169
 THealPix.cxx:2170
 THealPix.cxx:2171
 THealPix.cxx:2172
 THealPix.cxx:2173
 THealPix.cxx:2174
 THealPix.cxx:2175
 THealPix.cxx:2176
 THealPix.cxx:2177
 THealPix.cxx:2178
 THealPix.cxx:2179
 THealPix.cxx:2180
 THealPix.cxx:2181
 THealPix.cxx:2182
 THealPix.cxx:2183
 THealPix.cxx:2184
 THealPix.cxx:2185
 THealPix.cxx:2186
 THealPix.cxx:2187
 THealPix.cxx:2188
 THealPix.cxx:2189
 THealPix.cxx:2190
 THealPix.cxx:2191
 THealPix.cxx:2192
 THealPix.cxx:2193
 THealPix.cxx:2194
 THealPix.cxx:2195
 THealPix.cxx:2196
 THealPix.cxx:2197
 THealPix.cxx:2198
 THealPix.cxx:2199
 THealPix.cxx:2200
 THealPix.cxx:2201
 THealPix.cxx:2202
 THealPix.cxx:2203
 THealPix.cxx:2204
 THealPix.cxx:2205
 THealPix.cxx:2206
 THealPix.cxx:2207
 THealPix.cxx:2208
 THealPix.cxx:2209
 THealPix.cxx:2210
 THealPix.cxx:2211
 THealPix.cxx:2212
 THealPix.cxx:2213
 THealPix.cxx:2214
 THealPix.cxx:2215
 THealPix.cxx:2216
 THealPix.cxx:2217
 THealPix.cxx:2218
 THealPix.cxx:2219
 THealPix.cxx:2220
 THealPix.cxx:2221
 THealPix.cxx:2222
 THealPix.cxx:2223
 THealPix.cxx:2224
 THealPix.cxx:2225
 THealPix.cxx:2226
 THealPix.cxx:2227
 THealPix.cxx:2228
 THealPix.cxx:2229
 THealPix.cxx:2230
 THealPix.cxx:2231
 THealPix.cxx:2232
 THealPix.cxx:2233
 THealPix.cxx:2234
 THealPix.cxx:2235
 THealPix.cxx:2236
 THealPix.cxx:2237
 THealPix.cxx:2238
 THealPix.cxx:2239
 THealPix.cxx:2240
 THealPix.cxx:2241
 THealPix.cxx:2242
 THealPix.cxx:2243
 THealPix.cxx:2244
 THealPix.cxx:2245
 THealPix.cxx:2246
 THealPix.cxx:2247
 THealPix.cxx:2248
 THealPix.cxx:2249
 THealPix.cxx:2250
 THealPix.cxx:2251
 THealPix.cxx:2252
 THealPix.cxx:2253
 THealPix.cxx:2254
 THealPix.cxx:2255
 THealPix.cxx:2256
 THealPix.cxx:2257
 THealPix.cxx:2258
 THealPix.cxx:2259
 THealPix.cxx:2260
 THealPix.cxx:2261
 THealPix.cxx:2262
 THealPix.cxx:2263
 THealPix.cxx:2264
 THealPix.cxx:2265
 THealPix.cxx:2266
 THealPix.cxx:2267
 THealPix.cxx:2268
 THealPix.cxx:2269
 THealPix.cxx:2270
 THealPix.cxx:2271
 THealPix.cxx:2272
 THealPix.cxx:2273
 THealPix.cxx:2274
 THealPix.cxx:2275
 THealPix.cxx:2276
 THealPix.cxx:2277
 THealPix.cxx:2278
 THealPix.cxx:2279
 THealPix.cxx:2280
 THealPix.cxx:2281
 THealPix.cxx:2282
 THealPix.cxx:2283
 THealPix.cxx:2284
 THealPix.cxx:2285
 THealPix.cxx:2286
 THealPix.cxx:2287
 THealPix.cxx:2288
 THealPix.cxx:2289
 THealPix.cxx:2290
 THealPix.cxx:2291
 THealPix.cxx:2292
 THealPix.cxx:2293
 THealPix.cxx:2294
 THealPix.cxx:2295
 THealPix.cxx:2296
 THealPix.cxx:2297
 THealPix.cxx:2298
 THealPix.cxx:2299
 THealPix.cxx:2300
 THealPix.cxx:2301
 THealPix.cxx:2302
 THealPix.cxx:2303
 THealPix.cxx:2304
 THealPix.cxx:2305
 THealPix.cxx:2306
 THealPix.cxx:2307
 THealPix.cxx:2308
 THealPix.cxx:2309
 THealPix.cxx:2310
 THealPix.cxx:2311
 THealPix.cxx:2312
 THealPix.cxx:2313
 THealPix.cxx:2314
 THealPix.cxx:2315
 THealPix.cxx:2316
 THealPix.cxx:2317
 THealPix.cxx:2318
 THealPix.cxx:2319
 THealPix.cxx:2320
 THealPix.cxx:2321
 THealPix.cxx:2322
 THealPix.cxx:2323
 THealPix.cxx:2324
 THealPix.cxx:2325
 THealPix.cxx:2326
 THealPix.cxx:2327
 THealPix.cxx:2328
 THealPix.cxx:2329
 THealPix.cxx:2330
 THealPix.cxx:2331
 THealPix.cxx:2332
 THealPix.cxx:2333
 THealPix.cxx:2334
 THealPix.cxx:2335
 THealPix.cxx:2336
 THealPix.cxx:2337
 THealPix.cxx:2338
 THealPix.cxx:2339
 THealPix.cxx:2340
 THealPix.cxx:2341
 THealPix.cxx:2342
 THealPix.cxx:2343
 THealPix.cxx:2344
 THealPix.cxx:2345
 THealPix.cxx:2346
 THealPix.cxx:2347
 THealPix.cxx:2348
 THealPix.cxx:2349
 THealPix.cxx:2350
 THealPix.cxx:2351
 THealPix.cxx:2352
 THealPix.cxx:2353
 THealPix.cxx:2354
 THealPix.cxx:2355
 THealPix.cxx:2356
 THealPix.cxx:2357
 THealPix.cxx:2358
 THealPix.cxx:2359
 THealPix.cxx:2360
 THealPix.cxx:2361
 THealPix.cxx:2362
 THealPix.cxx:2363
 THealPix.cxx:2364
 THealPix.cxx:2365
 THealPix.cxx:2366
 THealPix.cxx:2367
 THealPix.cxx:2368
 THealPix.cxx:2369
 THealPix.cxx:2370
 THealPix.cxx:2371
 THealPix.cxx:2372
 THealPix.cxx:2373
 THealPix.cxx:2374
 THealPix.cxx:2375
 THealPix.cxx:2376
 THealPix.cxx:2377
 THealPix.cxx:2378
 THealPix.cxx:2379
 THealPix.cxx:2380
 THealPix.cxx:2381
 THealPix.cxx:2382
 THealPix.cxx:2383
 THealPix.cxx:2384
 THealPix.cxx:2385
 THealPix.cxx:2386
 THealPix.cxx:2387
 THealPix.cxx:2388
 THealPix.cxx:2389
 THealPix.cxx:2390
 THealPix.cxx:2391
 THealPix.cxx:2392
 THealPix.cxx:2393
 THealPix.cxx:2394
 THealPix.cxx:2395
 THealPix.cxx:2396
 THealPix.cxx:2397
 THealPix.cxx:2398
 THealPix.cxx:2399
 THealPix.cxx:2400
 THealPix.cxx:2401
 THealPix.cxx:2402
 THealPix.cxx:2403
 THealPix.cxx:2404
 THealPix.cxx:2405
 THealPix.cxx:2406
 THealPix.cxx:2407
 THealPix.cxx:2408
 THealPix.cxx:2409
 THealPix.cxx:2410
 THealPix.cxx:2411
 THealPix.cxx:2412
 THealPix.cxx:2413
 THealPix.cxx:2414
 THealPix.cxx:2415
 THealPix.cxx:2416
 THealPix.cxx:2417
 THealPix.cxx:2418
 THealPix.cxx:2419
 THealPix.cxx:2420
 THealPix.cxx:2421
 THealPix.cxx:2422
 THealPix.cxx:2423
 THealPix.cxx:2424
 THealPix.cxx:2425
 THealPix.cxx:2426
 THealPix.cxx:2427
 THealPix.cxx:2428
 THealPix.cxx:2429
 THealPix.cxx:2430
 THealPix.cxx:2431
 THealPix.cxx:2432
 THealPix.cxx:2433
 THealPix.cxx:2434
 THealPix.cxx:2435
 THealPix.cxx:2436
 THealPix.cxx:2437
 THealPix.cxx:2438
 THealPix.cxx:2439
 THealPix.cxx:2440
 THealPix.cxx:2441
 THealPix.cxx:2442
 THealPix.cxx:2443
 THealPix.cxx:2444
 THealPix.cxx:2445
 THealPix.cxx:2446
 THealPix.cxx:2447
 THealPix.cxx:2448
 THealPix.cxx:2449
 THealPix.cxx:2450
 THealPix.cxx:2451
 THealPix.cxx:2452
 THealPix.cxx:2453
 THealPix.cxx:2454
 THealPix.cxx:2455
 THealPix.cxx:2456
 THealPix.cxx:2457
 THealPix.cxx:2458
 THealPix.cxx:2459
 THealPix.cxx:2460
 THealPix.cxx:2461
 THealPix.cxx:2462
 THealPix.cxx:2463
 THealPix.cxx:2464
 THealPix.cxx:2465
 THealPix.cxx:2466
 THealPix.cxx:2467
 THealPix.cxx:2468
 THealPix.cxx:2469
 THealPix.cxx:2470
 THealPix.cxx:2471
 THealPix.cxx:2472
 THealPix.cxx:2473
 THealPix.cxx:2474
 THealPix.cxx:2475
 THealPix.cxx:2476
 THealPix.cxx:2477
 THealPix.cxx:2478
 THealPix.cxx:2479
 THealPix.cxx:2480
 THealPix.cxx:2481
 THealPix.cxx:2482
 THealPix.cxx:2483
 THealPix.cxx:2484
 THealPix.cxx:2485
 THealPix.cxx:2486
 THealPix.cxx:2487
 THealPix.cxx:2488
 THealPix.cxx:2489
 THealPix.cxx:2490
 THealPix.cxx:2491
 THealPix.cxx:2492
 THealPix.cxx:2493
 THealPix.cxx:2494
 THealPix.cxx:2495
 THealPix.cxx:2496
 THealPix.cxx:2497
 THealPix.cxx:2498