ROOT logo
// @(#)root/hist:$Id: THStack.cxx 31321 2009-11-19 16:46:07Z couet $
// Author: Rene Brun   10/12/2001

/*************************************************************************
 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TROOT.h"
#include "TClassRef.h"
#include "THStack.h"
#include "TVirtualPad.h"
#include "TVirtualHistPainter.h"
#include "THashList.h"
#include "TH2.h"
#include "TH3.h"
#include "TList.h"
#include "TStyle.h"
#include "Riostream.h"
#include "TBrowser.h"
#include "TMath.h"
#include "TObjString.h"

ClassImp(THStack)

//______________________________________________________________________________
//
//   A THStack is a collection of TH1 (or derived) objects
//   Use THStack::Add to add a new histogram to the list.
//   The THStack does not own the objects in the list.
//   By default (if option "nostack" is not specified), histograms will be paint
//   stacked on top of each other.
//   Example;
//      THStack hs("hs","test stacked histograms");
//      TH1F *h1 = new TH1F("h1","test hstack",100,-4,4);
//      h1->FillRandom("gaus",20000);
//      h1->SetFillColor(kRed);
//      hs.Add(h1);
//      TH1F *h2 = new TH1F("h2","test hstack",100,-4,4);
//      h2->FillRandom("gaus",15000);
//      h2->SetFillColor(kBlue);
//      hs.Add(h2);
//      TH1F *h3 = new TH1F("h3","test hstack",100,-4,4);
//      h3->FillRandom("gaus",10000);
//      h3->SetFillColor(kGreen);
//      hs.Add(h3);
//      TCanvas c1("c1","stacked hists",10,10,700,900);
//      c1.Divide(1,2);
//      c1.cd(1);
//      hs.Draw();
//      c1.cd(2);
//      hs->Draw("nostack");
//
//  See a more complex example in $ROOTSYS/tutorials/hist/hstack.C
//
//  Note that picking is supported for all drawing modes.

//______________________________________________________________________________
THStack::THStack(): TNamed()
{
// THStack default constructor

   fHists     = 0;
   fStack     = 0;
   fHistogram = 0;
   fMaximum   = -1111;
   fMinimum   = -1111;
}

//______________________________________________________________________________
THStack::THStack(const char *name, const char *title)
       : TNamed(name,title)
{
// constructor with name and title
   fHists     = 0;
   fStack     = 0;
   fHistogram = 0;
   fMaximum   = -1111;
   fMinimum   = -1111;
   gROOT->GetListOfCleanups()->Add(this);
}


//______________________________________________________________________________
THStack::THStack(const TH1* hist, Option_t *axis /*="x"*/,
                 const char *name /*=0*/, const char *title /*=0*/,
                 Int_t firstbin /*=1*/, Int_t lastbin /*=-1*/,
                 Int_t firstbin2 /*=1*/, Int_t lastbin2 /*=-1*/,
                 Option_t* proj_option /*=""*/, Option_t* draw_option /*=""*/): TNamed(name, title) {
// Creates a new THStack from a TH2 or TH3
// It is filled with the 1D histograms from GetProjectionX or GetProjectionY
// for each bin of the histogram. It illustrates the differences and total
// sum along an axis.
//
// Parameters:
// - hist:  the histogram used for the projections. Can be an object deriving
//          from TH2 or TH3.
// - axis:  for TH2: "x" for ProjectionX, "y" for ProjectionY.
//          for TH3: see TH3::Project3D.
// - name:  fName is set to name if given, otherwise to histo's name with
//          "_stack_<axis>" appended, where <axis> is the value of the
//          parameter axis.
// - title: fTitle is set to title if given, otherwise to histo's title
//          with ", stack of <axis> projections" appended.
// - firstbin, lastbin:
//          for each bin within [firstbin,lastbin] a stack entry is created.
//          See TH2::ProjectionX/Y for use overflow bins.
//          Defaults to "all bins but under- / overflow"
// - firstbin2, lastbin2:
//          Other axis range for TH3::Project3D, defaults to "all bins but
//          under- / overflow". Ignored for TH2s
// - proj_option:
//          option passed to TH2::ProjectionX/Y and TH3::Project3D (along
//          with axis)
// - draw_option:
//          option passed to THStack::Add.
   fHists     = 0;
   fStack     = 0;
   fHistogram = 0;
   fMaximum   = -1111;
   fMinimum   = -1111;
   gROOT->GetListOfCleanups()->Add(this);

   if (!axis) {
      Warning("THStack", "Need an axis.");
      return;
   }
   if (!hist) {
      Warning("THStack", "Need a histogram.");
      return;
   }
   Bool_t isTH2=hist->IsA()->InheritsFrom(TH2::Class());
   Bool_t isTH3=hist->IsA()->InheritsFrom(TH3::Class());
   if (!isTH2 && !isTH3) {
      Warning("THStack", "Need a histogram deriving from TH2 or TH3.");
      return;
   }

   if (!fName.Length())
      fName=Form("%s_stack%s", hist->GetName(), axis);
   if (!fTitle.Length()) {
      if (hist->GetTitle() && strlen(hist->GetTitle()))
         fTitle=Form("%s, stack of %s projections", hist->GetTitle(), axis);
      else
         fTitle=Form("stack of %s projections", axis);
   }

   if (isTH2) {
      TH2* hist2=(TH2*) hist;
      Bool_t useX=(strchr(axis,'x')) || (strchr(axis,'X'));
      Bool_t useY=(strchr(axis,'y')) || (strchr(axis,'Y'));
      if ((!useX && !useY) || (useX && useY)) {
         Warning("THStack", "Need parameter axis=\"x\" or \"y\" for a TH2, not none or both.");
         return;
      }
      TAxis* haxis= useX ? hist->GetYaxis() : hist->GetXaxis();
      if (!haxis) {
         Warning("HStack","Histogram axis is NULL");
         return;
      }
      Int_t nbins = haxis->GetNbins();
      if (firstbin < 0) firstbin = 1;
      if (lastbin  < 0) lastbin  = nbins;
      if (lastbin  > nbins+1) lastbin = nbins;
      for (Int_t iBin=firstbin; iBin<=lastbin; iBin++) {
         TH1* hProj=0;
         if (useX) hProj=hist2->ProjectionX(Form("%s_px%d",hist2->GetName(), iBin),
                                            iBin, iBin, proj_option);
         else hProj=hist2->ProjectionY(Form("%s_py%d",hist2->GetName(), iBin),
                                       iBin, iBin, proj_option);
         Add(hProj, draw_option);
      }
   } else {
      // hist is a TH3
      TH3* hist3=(TH3*) hist;
      TString sAxis(axis);
      sAxis.ToLower();
      Int_t dim=3-sAxis.Length();
      if (dim<1 || dim>2) {
         Warning("THStack", "Invalid length for parameter axis.");
         return;
      }

      if (dim==1) {
         TAxis* haxis = 0;
         // look for the haxis _not_ in axis
         if (sAxis.First('x')==kNPOS)
            haxis=hist->GetXaxis();
         else if (sAxis.First('y')==kNPOS)
            haxis=hist->GetYaxis();
         else if (sAxis.First('z')==kNPOS)
            haxis=hist->GetZaxis();
         if (!haxis) {
            Warning("HStack","Histogram axis is NULL");
            return;
         }

         Int_t nbins = haxis->GetNbins();
         if (firstbin < 0) firstbin = 1;
         if (lastbin  < 0) lastbin  = nbins;
         if (lastbin  > nbins+1) lastbin = nbins;
         Int_t iFirstOld=haxis->GetFirst();
         Int_t iLastOld=haxis->GetLast();
         for (Int_t iBin=firstbin; iBin<=lastbin; iBin++) {
            haxis->SetRange(iBin, iBin);
            // build projection named axis_iBin (passed through "option")
            TH1* hProj=hist3->Project3D(Form("%s_%s%s_%d", hist3->GetName(),
                                             axis, proj_option, iBin));
            Add(hProj, draw_option);
         }
         haxis->SetRange(iFirstOld, iLastOld);
      }  else {
         // if dim==2
         TAxis* haxis1 = 0;
         TAxis* haxis2 = 0;
         // look for the haxis _not_ in axis
         if (sAxis.First('x')!=kNPOS) {
            haxis1=hist->GetYaxis();
            haxis2=hist->GetZaxis();
         } else if (sAxis.First('y')!=kNPOS) {
            haxis1=hist->GetXaxis();
            haxis2=hist->GetZaxis();
         } else if (sAxis.First('z')!=kNPOS) {
            haxis1=hist->GetXaxis();
            haxis2=hist->GetYaxis();
         }
         if (!haxis1 || !haxis2) {
            Warning("HStack","Histogram axis is NULL");
            return;
         }

         Int_t nbins1 = haxis1->GetNbins();
         Int_t nbins2 = haxis2->GetNbins();
         if (firstbin < 0) firstbin = 1;
         if (lastbin  < 0) lastbin  = nbins1;
         if (lastbin  > nbins1+1) lastbin = nbins1;
         if (firstbin2 < 0) firstbin2 = 1;
         if (lastbin2  < 0) lastbin2  = nbins2;
         if (lastbin2  > nbins2+1) lastbin2 = nbins2;
         Int_t iFirstOld1=haxis1->GetFirst();
         Int_t iLastOld1=haxis1->GetLast();
         Int_t iFirstOld2=haxis2->GetFirst();
         Int_t iLastOld2=haxis2->GetLast();
         for (Int_t iBin=firstbin; iBin<=lastbin; iBin++) {
            haxis1->SetRange(iBin, iBin);
            for (Int_t jBin=firstbin2; jBin<=lastbin2; jBin++) {
               haxis2->SetRange(jBin, jBin);
               // build projection named axis_iBin (passed through "option")
               TH1* hProj=hist3->Project3D(Form("%s_%s%s_%d", hist3->GetName(),
                                                axis, proj_option, iBin));
               Add(hProj, draw_option);
            }
         }
         haxis1->SetRange(iFirstOld1, iLastOld1);
         haxis2->SetRange(iFirstOld2, iLastOld2);
      }
   } // if hist is TH2 or TH3
}

//______________________________________________________________________________
THStack::~THStack()
{
// THStack destructor


   gROOT->GetListOfCleanups()->Remove(this);
   if (!fHists) return;
   fHists->Clear("nodelete");
   delete fHists;
   fHists = 0;
   if (fStack) {fStack->Delete(); delete fStack;}
   delete fHistogram;
   fHistogram = 0;
}

//______________________________________________________________________________
THStack::THStack(const THStack &hstack) :
   TNamed(hstack),
   fHists(0),
   fStack(0),
   fHistogram(0),
   fMaximum(hstack.fMaximum),
   fMinimum(hstack.fMinimum)
{
   // THStack copy constructor

   if (hstack.GetHists()) {
      TIter next(hstack.GetHists());
      TH1 *h;
      while ((h=(TH1*)next())) Add(h);
   }
}

//______________________________________________________________________________
void THStack::Add(TH1 *h1, Option_t *option)
{
   // add a new histogram to the list
   // Only 1-d and 2-d histograms currently supported.
   // A drawing option may be specified

   if (!h1) return;
   if (h1->GetDimension() > 2) {
      Error("Add","THStack supports only 1-d and 2-d histograms");
      return;
   }
   if (!fHists) fHists = new TList();
   fHists->Add(h1,option);
   Modified(); //invalidate stack
}

//______________________________________________________________________________
void THStack::Browse(TBrowser *b)
{
   // Browse.

   Draw(b ? b->GetDrawOption() : "");
   gPad->Update();
}

//______________________________________________________________________________
void THStack::BuildStack()
{
   //  build sum of all histograms
   //  Build a separate list fStack containing the running sum of all histograms

   if (fStack) return;
   if (!fHists) return;
   Int_t nhists = fHists->GetSize();
   if (!nhists) return;
   fStack = new TObjArray(nhists);
   Bool_t add = TH1::AddDirectoryStatus();
   TH1::AddDirectory(kFALSE);
   TH1 *h = (TH1*)fHists->At(0)->Clone();
   fStack->Add(h);
   for (Int_t i=1;i<nhists;i++) {
      h = (TH1*)fHists->At(i)->Clone();
      h->Add((TH1*)fStack->At(i-1));
      fStack->AddAt(h,i);
   }
   TH1::AddDirectory(add);
}

//______________________________________________________________________________
Int_t THStack::DistancetoPrimitive(Int_t px, Int_t py)
{
   // Compute distance from point px,py to each graph
   //

   //*-*- Are we on the axis?
   const Int_t kMaxDiff = 10;
   Int_t distance = 9999;
   if (fHistogram) {
      distance = fHistogram->DistancetoPrimitive(px,py);
      if (distance <= 0) {return distance;}
      if (distance <= 1) {gPad->SetSelected(fHistogram);return distance;}
   }


   //*-*- Loop on the list of histograms
   if (!fHists) return distance;
   TH1 *h = 0;
   const char *doption = GetDrawOption();
   Int_t nhists = fHists->GetSize();
   for (Int_t i=0;i<nhists;i++) {
      h = (TH1*)fHists->At(i);
      if (fStack && !strstr(doption,"nostack")) h = (TH1*)fStack->At(i);
      Int_t dist = h->DistancetoPrimitive(px,py);
      if (dist <= 0) return 0;
      if (dist < kMaxDiff) {
         gPad->SetSelected(fHists->At(i));
         gPad->SetCursor(kPointer);
         return dist;
      }
   }
   return distance;
}

//______________________________________________________________________________
void THStack::Draw(Option_t *option)
{
   // Draw this multihist with its current attributes.
   //
   //   Options to draw histograms  are described in THistPainter::Paint
   // By default (if option "nostack" is not specified), histograms will be paint
   // stacked on top of each other.

   TString opt = option;
   opt.ToLower();
   if (gPad) {
      if (!gPad->IsEditable()) gROOT->MakeDefCanvas();
      if (!opt.Contains("same")) {
         //the following statement is necessary in case one attempts to draw
         //a temporary histogram already in the current pad
         if (TestBit(kCanDelete)) gPad->GetListOfPrimitives()->Remove(this);
         gPad->Clear();
      }
   }
   AppendPad(opt.Data());
}

//______________________________________________________________________________
TH1 *THStack::GetHistogram() const
{
   //    Returns a pointer to the histogram used to draw the axis
   //    Takes into account the two following cases.
   //       1- option 'A' was specified in THStack::Draw. Return fHistogram
   //       2- user had called TPad::DrawFrame. return pointer to hframe histogram
   //
   // IMPORTANT NOTE
   //  You must call Draw before calling this function. The returned histogram
   //  depends on the selected Draw options.

   if (fHistogram) return fHistogram;
   if (!gPad) return 0;
   gPad->Modified();
   gPad->Update();
   if (fHistogram) return fHistogram;
   TH1 *h1 = (TH1*)gPad->FindObject("hframe");
   return h1;
}

//______________________________________________________________________________
Double_t THStack::GetMaximum(Option_t *option)
{
   //  returns the maximum of all added histograms
   //  returns the maximum of all histograms if option "nostack".

   TString opt = option;
   opt.ToLower();
   Bool_t lerr = kFALSE;
   if (opt.Contains("e")) lerr = kTRUE;
   Double_t them=0, themax = -1e300, c1, e1;
   if (!fHists) return 0;
   Int_t nhists = fHists->GetSize();
   TH1 *h;
   Int_t first,last;

   if (!opt.Contains("nostack")) {
      BuildStack();
      h = (TH1*)fStack->At(nhists-1);
      themax = h->GetMaximum();
   } else {
      for (Int_t i=0;i<nhists;i++) {
         h = (TH1*)fHists->At(i);
         them = h->GetMaximum();
         if (them > themax) themax = them;
      }
   }

   if (lerr) {
      for (Int_t i=0;i<nhists;i++) {
         h = (TH1*)fHists->At(i);
         first = h->GetXaxis()->GetFirst();
         last  = h->GetXaxis()->GetLast();
         for (Int_t j=first; j<=last;j++) {
            e1     = h->GetBinError(j);
            c1     = h->GetBinContent(j);
            themax = TMath::Max(themax,c1+e1);
         }
      }
   }

   return themax;
}

//______________________________________________________________________________
Double_t THStack::GetMinimum(Option_t *option)
{
   //  returns the minimum of all added histograms
   //  returns the minimum of all histograms if option "nostack".

   TString opt = option;
   opt.ToLower();
   Bool_t lerr = kFALSE;
   if (opt.Contains("e")) lerr = kTRUE;
   Double_t them=0, themin = 1e300, c1, e1;
   if (!fHists) return 0;
   Int_t nhists = fHists->GetSize();
   Int_t first,last;
   TH1 *h;

   if (!opt.Contains("nostack")) {
      BuildStack();
      h = (TH1*)fStack->At(nhists-1);
      themin = h->GetMinimum();
   } else {
      for (Int_t i=0;i<nhists;i++) {
         h = (TH1*)fHists->At(i);
         them = h->GetMinimum();
         if (them <= 0 && gPad && gPad->GetLogy()) them = h->GetMinimum(0);
         if (them < themin) themin = them;
      }
   }

   if (lerr) {
      for (Int_t i=0;i<nhists;i++) {
         h = (TH1*)fHists->At(i);
         first = h->GetXaxis()->GetFirst();
         last  = h->GetXaxis()->GetLast();
         for (Int_t j=first; j<=last;j++) {
             e1     = h->GetBinError(j);
             c1     = h->GetBinContent(j);
             themin = TMath::Min(themin,c1-e1);
         }
      }
   }

   return themin;
}

//______________________________________________________________________________
TObjArray *THStack::GetStack()
{
   // Return pointer to Stack. Build it if not yet done

   BuildStack();
   return fStack;
}

//______________________________________________________________________________
TAxis *THStack::GetXaxis() const
{
   // Get x axis of the histogram used to draw the stack.
   //
   // IMPORTANT NOTE
   //  You must call Draw before calling this function. The returned histogram
   //  depends on the selected Draw options.

   if (!gPad) return 0;
   TH1 *h = GetHistogram();
   if (!h) return 0;
   return h->GetXaxis();
}

//______________________________________________________________________________
TAxis *THStack::GetYaxis() const
{
   // Get x axis of the histogram used to draw the stack.
   //
   // IMPORTANT NOTE
   //  You must call Draw before calling this function. The returned histogram
   //  depends on the selected Draw options.

   if (!gPad) return 0;
   TH1 *h = GetHistogram();
   if (!h) return 0;
   return h->GetYaxis();
}

//______________________________________________________________________________
void THStack::ls(Option_t *option) const
{
   // List histograms in the stack

   TROOT::IndentLevel();
   cout <<IsA()->GetName()
      <<" Name= "<<GetName()<<" Title= "<<GetTitle()<<" Option="<<option<<endl;
   TROOT::IncreaseDirLevel();
   if (fHists) fHists->ls(option);
   TROOT::DecreaseDirLevel();
}

//______________________________________________________________________________
void THStack::Modified()
{
   // invalidate sum of histograms

   if (!fStack) return;
   fStack->Delete();
   delete fStack;
   fStack = 0;
   delete fHistogram;
   fHistogram = 0;
}

//______________________________________________________________________________
void THStack::Paint(Option_t *option)
{
   // paint the list of histograms
   // By default, histograms are shown stacked.
   //    -the first histogram is paint
   //    -then the sum of the first and second, etc
   //
   // If option "nostack" is specified, histograms are all paint in the same pad
   // as if the option "same" had been specified.
   //
   // if option "pads" is specified, the current pad/canvas is subdivided into
   // a number of pads equal to the number of histograms and each histogram
   // is paint into a separate pad.
   //
   // See THistPainter::Paint for a list of valid options.

   if (!fHists) return;
   if (!fHists->GetSize()) return;

   TString opt = option;
   opt.ToLower();
   Bool_t lsame = kFALSE;
   if (opt.Contains("same")) {
      lsame = kTRUE;
      opt.ReplaceAll("same","");
   }
   if (opt.Contains("pads")) {
      Int_t npads = fHists->GetSize();
      TVirtualPad *padsav = gPad;
      //if pad is not already divided into subpads, divide it
      Int_t nps = 0;
      TObject *obj;
      TIter nextp(padsav->GetListOfPrimitives());
      while ((obj = nextp())) {
         if (obj->InheritsFrom(TVirtualPad::Class())) nps++;
      }
      if (nps < npads) {
         padsav->Clear();
         Int_t nx = (Int_t)TMath::Sqrt((Double_t)npads);
         if (nx*nx < npads) nx++;
         Int_t ny = nx;
         if (((nx*ny)-nx) >= npads) ny--;
         padsav->Divide(nx,ny);
      }
      TH1 *h;
      Int_t i = 0;
      TObjOptLink *lnk = (TObjOptLink*)fHists->FirstLink();
      while (lnk) {
         i++;
         padsav->cd(i);
         h = (TH1*)lnk->GetObject();
         h->Draw(lnk->GetOption());
         lnk = (TObjOptLink*)lnk->Next();
      }
      padsav->cd();
      return;
   }

   // compute the min/max of each axis
   TH1 *h;
   TIter next(fHists);
   Double_t xmin = 1e100;
   Double_t xmax = -xmin;
   Double_t ymin = 1e100;
   Double_t ymax = -xmin;
   while ((h=(TH1*)next())) {
      if (h->GetXaxis()->GetXmin() < xmin) xmin = h->GetXaxis()->GetXmin();
      if (h->GetXaxis()->GetXmax() > xmax) xmax = h->GetXaxis()->GetXmax();
      if (h->GetYaxis()->GetXmin() < ymin) ymin = h->GetYaxis()->GetXmin();
      if (h->GetYaxis()->GetXmax() > ymax) ymax = h->GetYaxis()->GetXmax();
   }

   char loption[32];
   sprintf(loption,"%s",opt.Data());
   char *nostack = strstr(loption,"nostack");
   // do not delete the stack. Another pad may contain the same object
   // drawn in stack mode!
   //if (nostack && fStack) {fStack->Delete(); delete fStack; fStack = 0;}

   if (!opt.Contains("nostack")) BuildStack();

   Double_t themax,themin;
   if (fMaximum == -1111) themax = GetMaximum(option);
   else                   themax = fMaximum;
   if (fMinimum == -1111) {
      themin = GetMinimum(option);
      if (gPad->GetLogy()){
         if (themin>0)  themin *= .9;
         else           themin = themax*1.e-3;
      }
      else if (themin > 0)
         themin = 0;
   }
   else                   themin = fMinimum;
   if (!fHistogram) {
      Bool_t add = TH1::AddDirectoryStatus();
      TH1::AddDirectory(kFALSE);
      h = (TH1*)fHists->At(0);
      TAxis *xaxis = h->GetXaxis();
      TAxis *yaxis = h->GetYaxis();
      if (h->GetDimension() > 1) {
         if (strlen(option) == 0) strcpy(loption,"lego1");
         const TArrayD *xbins = xaxis->GetXbins();
         const TArrayD *ybins = yaxis->GetXbins();
         if (xbins->fN != 0 && ybins->fN != 0) {
            fHistogram = new TH2F(GetName(),GetTitle(),
               xaxis->GetNbins(), xbins->GetArray(),
               yaxis->GetNbins(), ybins->GetArray());
         } else if (xbins->fN != 0 && ybins->fN == 0) {
            fHistogram = new TH2F(GetName(),GetTitle(),
               xaxis->GetNbins(), xbins->GetArray(),
               yaxis->GetNbins(), ymin, ymax);
         } else if (xbins->fN == 0 && ybins->fN != 0) {
            fHistogram = new TH2F(GetName(),GetTitle(),
               xaxis->GetNbins(), xmin, xmax,
               yaxis->GetNbins(), ybins->GetArray());
         } else {
            fHistogram = new TH2F(GetName(),GetTitle(),
               xaxis->GetNbins(), xmin, xmax,
               yaxis->GetNbins(), ymin, ymax);
         }
      } else {
         fHistogram = new TH1F(GetName(),GetTitle(),xaxis->GetNbins(),xmin, xmax);
      }
      fHistogram->SetStats(0);
      TH1::AddDirectory(add);
   } else {
      fHistogram->SetTitle(GetTitle());
   }

   if (nostack) {*nostack = 0; strcat(nostack,nostack+7);}
   //if (nostack) {strncpy(nostack,"       ",7);}
   else fHistogram->GetPainter()->SetStack(fHists);

   if (!fHistogram->TestBit(TH1::kIsZoomed)) {
      if (nostack && fMaximum != -1111) fHistogram->SetMaximum(fMaximum);
      else {
         if (gPad->GetLogy())           fHistogram->SetMaximum(themax*(1+0.2*TMath::Log10(themax/themin)));
         else                           fHistogram->SetMaximum((1+gStyle->GetHistTopMargin())*themax);
      }
      if (nostack && fMinimum != -1111) fHistogram->SetMinimum(fMinimum);
      else {
         if (gPad->GetLogy())           fHistogram->SetMinimum(themin/(1+0.5*TMath::Log10(themax/themin)));
         else                           fHistogram->SetMinimum(themin);
      }
   }

   // Copy the axis labels if needed.
   TH1 *hfirst;
   TObjOptLink *lnk = (TObjOptLink*)fHists->FirstLink();
   hfirst = (TH1*)lnk->GetObject();
   THashList* labels = hfirst->GetXaxis()->GetLabels();
   if (labels) {
      TIter iL(labels);
      TObjString* lb;
      Int_t ilab = 1;
      while ((lb=(TObjString*)iL())) {
         fHistogram->GetXaxis()->SetBinLabel(ilab,lb->String().Data());
         ilab++;
      }
   }

   if (!lsame) fHistogram->Paint(loption);

   if (fHistogram->GetDimension() > 1) SetDrawOption(loption);
   if (strstr(loption,"lego")) return;

   char noption[32];
   strcpy(noption,loption);
   Int_t nhists = fHists->GetSize();
   if (nostack) {
      lnk = (TObjOptLink*)fHists->FirstLink();
      for (Int_t i=0;i<nhists;i++) {
         if (strstr(lnk->GetOption(),"same")) {
            sprintf(loption,"%s%s",noption,lnk->GetOption());
         } else {
            sprintf(loption,"%ssame%s",noption,lnk->GetOption());
         }
         fHists->At(i)->Paint(loption);
         lnk = (TObjOptLink*)lnk->Next();
      }
   } else {
      lnk = (TObjOptLink*)fHists->LastLink();
      TH1 *h1;
      Int_t h1col, h1fill;
      for (Int_t i=0;i<nhists;i++) {
         if (strstr(lnk->GetOption(),"same")) {
            sprintf(loption,"%s%s",noption,lnk->GetOption());
         } else {
            sprintf(loption,"%ssame%s",noption,lnk->GetOption());
         }
         h1 = (TH1*)fStack->At(nhists-i-1);
         if (i>0) {
            // Erase before drawing the histogram
            h1col  = h1->GetFillColor();
            h1fill = h1->GetFillStyle();
            h1->SetFillColor(1000);
            h1->SetFillStyle(1001);
            h1->Paint(loption);
            static TClassRef clTFrame = TClass::GetClass("TFrame",kFALSE);
            TAttFill *frameFill = (TAttFill*)clTFrame->DynamicCast(TAttFill::Class(),gPad->GetFrame());
            h1->SetFillColor(frameFill->GetFillColor());
            h1->SetFillStyle(frameFill->GetFillStyle());
            h1->Paint(loption);
            h1->SetFillColor(h1col);
            h1->SetFillStyle(h1fill);
         }
         h1->Paint(loption);
         lnk = (TObjOptLink*)lnk->Prev();
      }
   }
   if (!lsame) fHistogram->Paint("axissame");
}

//______________________________________________________________________________
void THStack::Print(Option_t *option) const
{
   // Print the list of histograms

   TH1 *h;
   if (fHists) {
      TIter   next(fHists);
      while ((h = (TH1*) next())) {
         h->Print(option);
      }
   }
}

//______________________________________________________________________________
void THStack::RecursiveRemove(TObject *obj)
{
   // Recursively remove object from the list of histograms

   if (!fHists) return;
   fHists->RecursiveRemove(obj);
   while (fHists->IndexOf(obj) >= 0) fHists->Remove(obj);
}

//______________________________________________________________________________
void THStack::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
{
   // Save primitive as a C++ statement(s) on output stream out

   char quote = '"';
   out<<"   "<<endl;
   if (gROOT->ClassSaved(THStack::Class())) {
      out<<"   ";
   } else {
      out<<"   THStack *";
   }
   out<<GetName()<<" = new THStack();"<<endl;
   out<<"   "<<GetName()<<"->SetName("<<quote<<GetName()<<quote<<");"<<endl;
   out<<"   "<<GetName()<<"->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;

   if (fMinimum != -1111) {
      out<<"   "<<GetName()<<"->SetMinimum("<<fMinimum<<");"<<endl;
   }
   if (fMaximum != -1111) {
      out<<"   "<<GetName()<<"->SetMaximum("<<fMaximum<<");"<<endl;
   }

   static Int_t frameNumber = 0;
   if (fHistogram) {
      frameNumber++;
      TString hname = fHistogram->GetName();
      hname += frameNumber;
      fHistogram->SetName(hname.Data());
      fHistogram->SavePrimitive(out,"nodraw");
      out<<"   "<<GetName()<<"->SetHistogram("<<fHistogram->GetName()<<");"<<endl;
      out<<"   "<<endl;
   }

   TH1 *h;
   if (fHists) {
      TObjOptLink *lnk = (TObjOptLink*)fHists->FirstLink();
      while (lnk) {
         h = (TH1*)lnk->GetObject();
         h->SavePrimitive(out,"nodraw");
         out<<"   "<<GetName()<<"->Add("<<h->GetName()<<","<<quote<<lnk->GetOption()<<quote<<");"<<endl;
         lnk = (TObjOptLink*)lnk->Next();
      }
   }
   out<<"   "<<GetName()<<"->Draw("
      <<quote<<option<<quote<<");"<<endl;
}

//______________________________________________________________________________
void THStack::SetMaximum(Double_t maximum)
{
   // Set maximum.

   fMaximum = maximum;
   if (fHistogram)  fHistogram->SetMaximum(maximum);
}

//______________________________________________________________________________
void THStack::SetMinimum(Double_t minimum)
{
   // Set minimum.

   fMinimum = minimum;
   if (fHistogram) fHistogram->SetMinimum(minimum);
}
 THStack.cxx:1
 THStack.cxx:2
 THStack.cxx:3
 THStack.cxx:4
 THStack.cxx:5
 THStack.cxx:6
 THStack.cxx:7
 THStack.cxx:8
 THStack.cxx:9
 THStack.cxx:10
 THStack.cxx:11
 THStack.cxx:12
 THStack.cxx:13
 THStack.cxx:14
 THStack.cxx:15
 THStack.cxx:16
 THStack.cxx:17
 THStack.cxx:18
 THStack.cxx:19
 THStack.cxx:20
 THStack.cxx:21
 THStack.cxx:22
 THStack.cxx:23
 THStack.cxx:24
 THStack.cxx:25
 THStack.cxx:26
 THStack.cxx:27
 THStack.cxx:28
 THStack.cxx:29
 THStack.cxx:30
 THStack.cxx:31
 THStack.cxx:32
 THStack.cxx:33
 THStack.cxx:34
 THStack.cxx:35
 THStack.cxx:36
 THStack.cxx:37
 THStack.cxx:38
 THStack.cxx:39
 THStack.cxx:40
 THStack.cxx:41
 THStack.cxx:42
 THStack.cxx:43
 THStack.cxx:44
 THStack.cxx:45
 THStack.cxx:46
 THStack.cxx:47
 THStack.cxx:48
 THStack.cxx:49
 THStack.cxx:50
 THStack.cxx:51
 THStack.cxx:52
 THStack.cxx:53
 THStack.cxx:54
 THStack.cxx:55
 THStack.cxx:56
 THStack.cxx:57
 THStack.cxx:58
 THStack.cxx:59
 THStack.cxx:60
 THStack.cxx:61
 THStack.cxx:62
 THStack.cxx:63
 THStack.cxx:64
 THStack.cxx:65
 THStack.cxx:66
 THStack.cxx:67
 THStack.cxx:68
 THStack.cxx:69
 THStack.cxx:70
 THStack.cxx:71
 THStack.cxx:72
 THStack.cxx:73
 THStack.cxx:74
 THStack.cxx:75
 THStack.cxx:76
 THStack.cxx:77
 THStack.cxx:78
 THStack.cxx:79
 THStack.cxx:80
 THStack.cxx:81
 THStack.cxx:82
 THStack.cxx:83
 THStack.cxx:84
 THStack.cxx:85
 THStack.cxx:86
 THStack.cxx:87
 THStack.cxx:88
 THStack.cxx:89
 THStack.cxx:90
 THStack.cxx:91
 THStack.cxx:92
 THStack.cxx:93
 THStack.cxx:94
 THStack.cxx:95
 THStack.cxx:96
 THStack.cxx:97
 THStack.cxx:98
 THStack.cxx:99
 THStack.cxx:100
 THStack.cxx:101
 THStack.cxx:102
 THStack.cxx:103
 THStack.cxx:104
 THStack.cxx:105
 THStack.cxx:106
 THStack.cxx:107
 THStack.cxx:108
 THStack.cxx:109
 THStack.cxx:110
 THStack.cxx:111
 THStack.cxx:112
 THStack.cxx:113
 THStack.cxx:114
 THStack.cxx:115
 THStack.cxx:116
 THStack.cxx:117
 THStack.cxx:118
 THStack.cxx:119
 THStack.cxx:120
 THStack.cxx:121
 THStack.cxx:122
 THStack.cxx:123
 THStack.cxx:124
 THStack.cxx:125
 THStack.cxx:126
 THStack.cxx:127
 THStack.cxx:128
 THStack.cxx:129
 THStack.cxx:130
 THStack.cxx:131
 THStack.cxx:132
 THStack.cxx:133
 THStack.cxx:134
 THStack.cxx:135
 THStack.cxx:136
 THStack.cxx:137
 THStack.cxx:138
 THStack.cxx:139
 THStack.cxx:140
 THStack.cxx:141
 THStack.cxx:142
 THStack.cxx:143
 THStack.cxx:144
 THStack.cxx:145
 THStack.cxx:146
 THStack.cxx:147
 THStack.cxx:148
 THStack.cxx:149
 THStack.cxx:150
 THStack.cxx:151
 THStack.cxx:152
 THStack.cxx:153
 THStack.cxx:154
 THStack.cxx:155
 THStack.cxx:156
 THStack.cxx:157
 THStack.cxx:158
 THStack.cxx:159
 THStack.cxx:160
 THStack.cxx:161
 THStack.cxx:162
 THStack.cxx:163
 THStack.cxx:164
 THStack.cxx:165
 THStack.cxx:166
 THStack.cxx:167
 THStack.cxx:168
 THStack.cxx:169
 THStack.cxx:170
 THStack.cxx:171
 THStack.cxx:172
 THStack.cxx:173
 THStack.cxx:174
 THStack.cxx:175
 THStack.cxx:176
 THStack.cxx:177
 THStack.cxx:178
 THStack.cxx:179
 THStack.cxx:180
 THStack.cxx:181
 THStack.cxx:182
 THStack.cxx:183
 THStack.cxx:184
 THStack.cxx:185
 THStack.cxx:186
 THStack.cxx:187
 THStack.cxx:188
 THStack.cxx:189
 THStack.cxx:190
 THStack.cxx:191
 THStack.cxx:192
 THStack.cxx:193
 THStack.cxx:194
 THStack.cxx:195
 THStack.cxx:196
 THStack.cxx:197
 THStack.cxx:198
 THStack.cxx:199
 THStack.cxx:200
 THStack.cxx:201
 THStack.cxx:202
 THStack.cxx:203
 THStack.cxx:204
 THStack.cxx:205
 THStack.cxx:206
 THStack.cxx:207
 THStack.cxx:208
 THStack.cxx:209
 THStack.cxx:210
 THStack.cxx:211
 THStack.cxx:212
 THStack.cxx:213
 THStack.cxx:214
 THStack.cxx:215
 THStack.cxx:216
 THStack.cxx:217
 THStack.cxx:218
 THStack.cxx:219
 THStack.cxx:220
 THStack.cxx:221
 THStack.cxx:222
 THStack.cxx:223
 THStack.cxx:224
 THStack.cxx:225
 THStack.cxx:226
 THStack.cxx:227
 THStack.cxx:228
 THStack.cxx:229
 THStack.cxx:230
 THStack.cxx:231
 THStack.cxx:232
 THStack.cxx:233
 THStack.cxx:234
 THStack.cxx:235
 THStack.cxx:236
 THStack.cxx:237
 THStack.cxx:238
 THStack.cxx:239
 THStack.cxx:240
 THStack.cxx:241
 THStack.cxx:242
 THStack.cxx:243
 THStack.cxx:244
 THStack.cxx:245
 THStack.cxx:246
 THStack.cxx:247
 THStack.cxx:248
 THStack.cxx:249
 THStack.cxx:250
 THStack.cxx:251
 THStack.cxx:252
 THStack.cxx:253
 THStack.cxx:254
 THStack.cxx:255
 THStack.cxx:256
 THStack.cxx:257
 THStack.cxx:258
 THStack.cxx:259
 THStack.cxx:260
 THStack.cxx:261
 THStack.cxx:262
 THStack.cxx:263
 THStack.cxx:264
 THStack.cxx:265
 THStack.cxx:266
 THStack.cxx:267
 THStack.cxx:268
 THStack.cxx:269
 THStack.cxx:270
 THStack.cxx:271
 THStack.cxx:272
 THStack.cxx:273
 THStack.cxx:274
 THStack.cxx:275
 THStack.cxx:276
 THStack.cxx:277
 THStack.cxx:278
 THStack.cxx:279
 THStack.cxx:280
 THStack.cxx:281
 THStack.cxx:282
 THStack.cxx:283
 THStack.cxx:284
 THStack.cxx:285
 THStack.cxx:286
 THStack.cxx:287
 THStack.cxx:288
 THStack.cxx:289
 THStack.cxx:290
 THStack.cxx:291
 THStack.cxx:292
 THStack.cxx:293
 THStack.cxx:294
 THStack.cxx:295
 THStack.cxx:296
 THStack.cxx:297
 THStack.cxx:298
 THStack.cxx:299
 THStack.cxx:300
 THStack.cxx:301
 THStack.cxx:302
 THStack.cxx:303
 THStack.cxx:304
 THStack.cxx:305
 THStack.cxx:306
 THStack.cxx:307
 THStack.cxx:308
 THStack.cxx:309
 THStack.cxx:310
 THStack.cxx:311
 THStack.cxx:312
 THStack.cxx:313
 THStack.cxx:314
 THStack.cxx:315
 THStack.cxx:316
 THStack.cxx:317
 THStack.cxx:318
 THStack.cxx:319
 THStack.cxx:320
 THStack.cxx:321
 THStack.cxx:322
 THStack.cxx:323
 THStack.cxx:324
 THStack.cxx:325
 THStack.cxx:326
 THStack.cxx:327
 THStack.cxx:328
 THStack.cxx:329
 THStack.cxx:330
 THStack.cxx:331
 THStack.cxx:332
 THStack.cxx:333
 THStack.cxx:334
 THStack.cxx:335
 THStack.cxx:336
 THStack.cxx:337
 THStack.cxx:338
 THStack.cxx:339
 THStack.cxx:340
 THStack.cxx:341
 THStack.cxx:342
 THStack.cxx:343
 THStack.cxx:344
 THStack.cxx:345
 THStack.cxx:346
 THStack.cxx:347
 THStack.cxx:348
 THStack.cxx:349
 THStack.cxx:350
 THStack.cxx:351
 THStack.cxx:352
 THStack.cxx:353
 THStack.cxx:354
 THStack.cxx:355
 THStack.cxx:356
 THStack.cxx:357
 THStack.cxx:358
 THStack.cxx:359
 THStack.cxx:360
 THStack.cxx:361
 THStack.cxx:362
 THStack.cxx:363
 THStack.cxx:364
 THStack.cxx:365
 THStack.cxx:366
 THStack.cxx:367
 THStack.cxx:368
 THStack.cxx:369
 THStack.cxx:370
 THStack.cxx:371
 THStack.cxx:372
 THStack.cxx:373
 THStack.cxx:374
 THStack.cxx:375
 THStack.cxx:376
 THStack.cxx:377
 THStack.cxx:378
 THStack.cxx:379
 THStack.cxx:380
 THStack.cxx:381
 THStack.cxx:382
 THStack.cxx:383
 THStack.cxx:384
 THStack.cxx:385
 THStack.cxx:386
 THStack.cxx:387
 THStack.cxx:388
 THStack.cxx:389
 THStack.cxx:390
 THStack.cxx:391
 THStack.cxx:392
 THStack.cxx:393
 THStack.cxx:394
 THStack.cxx:395
 THStack.cxx:396
 THStack.cxx:397
 THStack.cxx:398
 THStack.cxx:399
 THStack.cxx:400
 THStack.cxx:401
 THStack.cxx:402
 THStack.cxx:403
 THStack.cxx:404
 THStack.cxx:405
 THStack.cxx:406
 THStack.cxx:407
 THStack.cxx:408
 THStack.cxx:409
 THStack.cxx:410
 THStack.cxx:411
 THStack.cxx:412
 THStack.cxx:413
 THStack.cxx:414
 THStack.cxx:415
 THStack.cxx:416
 THStack.cxx:417
 THStack.cxx:418
 THStack.cxx:419
 THStack.cxx:420
 THStack.cxx:421
 THStack.cxx:422
 THStack.cxx:423
 THStack.cxx:424
 THStack.cxx:425
 THStack.cxx:426
 THStack.cxx:427
 THStack.cxx:428
 THStack.cxx:429
 THStack.cxx:430
 THStack.cxx:431
 THStack.cxx:432
 THStack.cxx:433
 THStack.cxx:434
 THStack.cxx:435
 THStack.cxx:436
 THStack.cxx:437
 THStack.cxx:438
 THStack.cxx:439
 THStack.cxx:440
 THStack.cxx:441
 THStack.cxx:442
 THStack.cxx:443
 THStack.cxx:444
 THStack.cxx:445
 THStack.cxx:446
 THStack.cxx:447
 THStack.cxx:448
 THStack.cxx:449
 THStack.cxx:450
 THStack.cxx:451
 THStack.cxx:452
 THStack.cxx:453
 THStack.cxx:454
 THStack.cxx:455
 THStack.cxx:456
 THStack.cxx:457
 THStack.cxx:458
 THStack.cxx:459
 THStack.cxx:460
 THStack.cxx:461
 THStack.cxx:462
 THStack.cxx:463
 THStack.cxx:464
 THStack.cxx:465
 THStack.cxx:466
 THStack.cxx:467
 THStack.cxx:468
 THStack.cxx:469
 THStack.cxx:470
 THStack.cxx:471
 THStack.cxx:472
 THStack.cxx:473
 THStack.cxx:474
 THStack.cxx:475
 THStack.cxx:476
 THStack.cxx:477
 THStack.cxx:478
 THStack.cxx:479
 THStack.cxx:480
 THStack.cxx:481
 THStack.cxx:482
 THStack.cxx:483
 THStack.cxx:484
 THStack.cxx:485
 THStack.cxx:486
 THStack.cxx:487
 THStack.cxx:488
 THStack.cxx:489
 THStack.cxx:490
 THStack.cxx:491
 THStack.cxx:492
 THStack.cxx:493
 THStack.cxx:494
 THStack.cxx:495
 THStack.cxx:496
 THStack.cxx:497
 THStack.cxx:498
 THStack.cxx:499
 THStack.cxx:500
 THStack.cxx:501
 THStack.cxx:502
 THStack.cxx:503
 THStack.cxx:504
 THStack.cxx:505
 THStack.cxx:506
 THStack.cxx:507
 THStack.cxx:508
 THStack.cxx:509
 THStack.cxx:510
 THStack.cxx:511
 THStack.cxx:512
 THStack.cxx:513
 THStack.cxx:514
 THStack.cxx:515
 THStack.cxx:516
 THStack.cxx:517
 THStack.cxx:518
 THStack.cxx:519
 THStack.cxx:520
 THStack.cxx:521
 THStack.cxx:522
 THStack.cxx:523
 THStack.cxx:524
 THStack.cxx:525
 THStack.cxx:526
 THStack.cxx:527
 THStack.cxx:528
 THStack.cxx:529
 THStack.cxx:530
 THStack.cxx:531
 THStack.cxx:532
 THStack.cxx:533
 THStack.cxx:534
 THStack.cxx:535
 THStack.cxx:536
 THStack.cxx:537
 THStack.cxx:538
 THStack.cxx:539
 THStack.cxx:540
 THStack.cxx:541
 THStack.cxx:542
 THStack.cxx:543
 THStack.cxx:544
 THStack.cxx:545
 THStack.cxx:546
 THStack.cxx:547
 THStack.cxx:548
 THStack.cxx:549
 THStack.cxx:550
 THStack.cxx:551
 THStack.cxx:552
 THStack.cxx:553
 THStack.cxx:554
 THStack.cxx:555
 THStack.cxx:556
 THStack.cxx:557
 THStack.cxx:558
 THStack.cxx:559
 THStack.cxx:560
 THStack.cxx:561
 THStack.cxx:562
 THStack.cxx:563
 THStack.cxx:564
 THStack.cxx:565
 THStack.cxx:566
 THStack.cxx:567
 THStack.cxx:568
 THStack.cxx:569
 THStack.cxx:570
 THStack.cxx:571
 THStack.cxx:572
 THStack.cxx:573
 THStack.cxx:574
 THStack.cxx:575
 THStack.cxx:576
 THStack.cxx:577
 THStack.cxx:578
 THStack.cxx:579
 THStack.cxx:580
 THStack.cxx:581
 THStack.cxx:582
 THStack.cxx:583
 THStack.cxx:584
 THStack.cxx:585
 THStack.cxx:586
 THStack.cxx:587
 THStack.cxx:588
 THStack.cxx:589
 THStack.cxx:590
 THStack.cxx:591
 THStack.cxx:592
 THStack.cxx:593
 THStack.cxx:594
 THStack.cxx:595
 THStack.cxx:596
 THStack.cxx:597
 THStack.cxx:598
 THStack.cxx:599
 THStack.cxx:600
 THStack.cxx:601
 THStack.cxx:602
 THStack.cxx:603
 THStack.cxx:604
 THStack.cxx:605
 THStack.cxx:606
 THStack.cxx:607
 THStack.cxx:608
 THStack.cxx:609
 THStack.cxx:610
 THStack.cxx:611
 THStack.cxx:612
 THStack.cxx:613
 THStack.cxx:614
 THStack.cxx:615
 THStack.cxx:616
 THStack.cxx:617
 THStack.cxx:618
 THStack.cxx:619
 THStack.cxx:620
 THStack.cxx:621
 THStack.cxx:622
 THStack.cxx:623
 THStack.cxx:624
 THStack.cxx:625
 THStack.cxx:626
 THStack.cxx:627
 THStack.cxx:628
 THStack.cxx:629
 THStack.cxx:630
 THStack.cxx:631
 THStack.cxx:632
 THStack.cxx:633
 THStack.cxx:634
 THStack.cxx:635
 THStack.cxx:636
 THStack.cxx:637
 THStack.cxx:638
 THStack.cxx:639
 THStack.cxx:640
 THStack.cxx:641
 THStack.cxx:642
 THStack.cxx:643
 THStack.cxx:644
 THStack.cxx:645
 THStack.cxx:646
 THStack.cxx:647
 THStack.cxx:648
 THStack.cxx:649
 THStack.cxx:650
 THStack.cxx:651
 THStack.cxx:652
 THStack.cxx:653
 THStack.cxx:654
 THStack.cxx:655
 THStack.cxx:656
 THStack.cxx:657
 THStack.cxx:658
 THStack.cxx:659
 THStack.cxx:660
 THStack.cxx:661
 THStack.cxx:662
 THStack.cxx:663
 THStack.cxx:664
 THStack.cxx:665
 THStack.cxx:666
 THStack.cxx:667
 THStack.cxx:668
 THStack.cxx:669
 THStack.cxx:670
 THStack.cxx:671
 THStack.cxx:672
 THStack.cxx:673
 THStack.cxx:674
 THStack.cxx:675
 THStack.cxx:676
 THStack.cxx:677
 THStack.cxx:678
 THStack.cxx:679
 THStack.cxx:680
 THStack.cxx:681
 THStack.cxx:682
 THStack.cxx:683
 THStack.cxx:684
 THStack.cxx:685
 THStack.cxx:686
 THStack.cxx:687
 THStack.cxx:688
 THStack.cxx:689
 THStack.cxx:690
 THStack.cxx:691
 THStack.cxx:692
 THStack.cxx:693
 THStack.cxx:694
 THStack.cxx:695
 THStack.cxx:696
 THStack.cxx:697
 THStack.cxx:698
 THStack.cxx:699
 THStack.cxx:700
 THStack.cxx:701
 THStack.cxx:702
 THStack.cxx:703
 THStack.cxx:704
 THStack.cxx:705
 THStack.cxx:706
 THStack.cxx:707
 THStack.cxx:708
 THStack.cxx:709
 THStack.cxx:710
 THStack.cxx:711
 THStack.cxx:712
 THStack.cxx:713
 THStack.cxx:714
 THStack.cxx:715
 THStack.cxx:716
 THStack.cxx:717
 THStack.cxx:718
 THStack.cxx:719
 THStack.cxx:720
 THStack.cxx:721
 THStack.cxx:722
 THStack.cxx:723
 THStack.cxx:724
 THStack.cxx:725
 THStack.cxx:726
 THStack.cxx:727
 THStack.cxx:728
 THStack.cxx:729
 THStack.cxx:730
 THStack.cxx:731
 THStack.cxx:732
 THStack.cxx:733
 THStack.cxx:734
 THStack.cxx:735
 THStack.cxx:736
 THStack.cxx:737
 THStack.cxx:738
 THStack.cxx:739
 THStack.cxx:740
 THStack.cxx:741
 THStack.cxx:742
 THStack.cxx:743
 THStack.cxx:744
 THStack.cxx:745
 THStack.cxx:746
 THStack.cxx:747
 THStack.cxx:748
 THStack.cxx:749
 THStack.cxx:750
 THStack.cxx:751
 THStack.cxx:752
 THStack.cxx:753
 THStack.cxx:754
 THStack.cxx:755
 THStack.cxx:756
 THStack.cxx:757
 THStack.cxx:758
 THStack.cxx:759
 THStack.cxx:760
 THStack.cxx:761
 THStack.cxx:762
 THStack.cxx:763
 THStack.cxx:764
 THStack.cxx:765
 THStack.cxx:766
 THStack.cxx:767
 THStack.cxx:768
 THStack.cxx:769
 THStack.cxx:770
 THStack.cxx:771
 THStack.cxx:772
 THStack.cxx:773
 THStack.cxx:774
 THStack.cxx:775
 THStack.cxx:776
 THStack.cxx:777
 THStack.cxx:778
 THStack.cxx:779
 THStack.cxx:780
 THStack.cxx:781
 THStack.cxx:782
 THStack.cxx:783
 THStack.cxx:784
 THStack.cxx:785
 THStack.cxx:786
 THStack.cxx:787
 THStack.cxx:788
 THStack.cxx:789
 THStack.cxx:790
 THStack.cxx:791
 THStack.cxx:792
 THStack.cxx:793
 THStack.cxx:794
 THStack.cxx:795
 THStack.cxx:796
 THStack.cxx:797
 THStack.cxx:798
 THStack.cxx:799
 THStack.cxx:800
 THStack.cxx:801
 THStack.cxx:802
 THStack.cxx:803
 THStack.cxx:804
 THStack.cxx:805
 THStack.cxx:806
 THStack.cxx:807
 THStack.cxx:808
 THStack.cxx:809
 THStack.cxx:810
 THStack.cxx:811
 THStack.cxx:812
 THStack.cxx:813
 THStack.cxx:814
 THStack.cxx:815
 THStack.cxx:816
 THStack.cxx:817
 THStack.cxx:818
 THStack.cxx:819
 THStack.cxx:820
 THStack.cxx:821
 THStack.cxx:822
 THStack.cxx:823
 THStack.cxx:824
 THStack.cxx:825
 THStack.cxx:826
 THStack.cxx:827
 THStack.cxx:828
 THStack.cxx:829
 THStack.cxx:830
 THStack.cxx:831
 THStack.cxx:832
 THStack.cxx:833
 THStack.cxx:834
 THStack.cxx:835
 THStack.cxx:836
 THStack.cxx:837
 THStack.cxx:838
 THStack.cxx:839
 THStack.cxx:840
 THStack.cxx:841
 THStack.cxx:842
 THStack.cxx:843
 THStack.cxx:844
 THStack.cxx:845
 THStack.cxx:846
 THStack.cxx:847
 THStack.cxx:848
 THStack.cxx:849
 THStack.cxx:850
 THStack.cxx:851
 THStack.cxx:852
 THStack.cxx:853
 THStack.cxx:854
 THStack.cxx:855
 THStack.cxx:856
 THStack.cxx:857
 THStack.cxx:858
 THStack.cxx:859
 THStack.cxx:860
 THStack.cxx:861
 THStack.cxx:862
 THStack.cxx:863
 THStack.cxx:864
 THStack.cxx:865
 THStack.cxx:866
 THStack.cxx:867
 THStack.cxx:868
 THStack.cxx:869
 THStack.cxx:870
 THStack.cxx:871
 THStack.cxx:872
 THStack.cxx:873
 THStack.cxx:874
 THStack.cxx:875
 THStack.cxx:876
 THStack.cxx:877
 THStack.cxx:878
 THStack.cxx:879
 THStack.cxx:880
 THStack.cxx:881
 THStack.cxx:882