ROOT logo
//*-- AUTHOR : J. Markert

//_HADES_CLASS_DESCRIPTION 
////////////////////////////////////////////////////////////////////////////
// HTool
// Tool Class
////////////////////////////////////////////////////////////////////////////
using namespace std;
#include <stdlib.h>
#include <iostream>
#include <map>
#include <vector>
#include <iomanip>
#include <math.h>
#include <wordexp.h>
#include <execinfo.h> // for backtrace
#include <fstream>
#include "htool.h"
#include "TDirectory.h"
#include "TFile.h"
#include "TString.h"
#include "TObjString.h"
#include "TList.h"
#include "TROOT.h"
#include "TObject.h"
#include "TKey.h"
#include "TDataMember.h"
#include "TAxis.h"
#include "TBaseClass.h"
#include "TTree.h"
#include "TNtuple.h"
#include "TTreeFormula.h"
#include "TLeaf.h"
#include "TGraphErrors.h"
#include "TProfile.h"
#include "TSystem.h"
#include "TMatrixD.h"
#include "TMath.h"

ClassImp(HTool)

HTool::HTool(const Char_t* name,const Char_t* title)
    : TNamed(name,title)
{
    // constructor for HTool
    initVariables();
}
HTool::~HTool()
{
  // destructor of HTool
}
void HTool::initVariables()
{
    // inits all variables
}

//--------------------------Files---------------------------------------

Bool_t HTool::open(TFile** file,TString fName,TString option)
{
    // Opens root file "fName" to the pointer "file" with option
    // New,Read,Recreate and Update. Checks if file exists or is
    // already opened. If everything works fine kTRUE is returned.
    if(*file)
    {   // checking if file is opened
        if((*file)->IsOpen()){
	    cout<<"Error(HTool::open() , SPECIFIED INPUT FILE IS ALREADY OPEN!"<<endl;
            return kFALSE;
	}else{
	    *file=0;
	}
    }
    option.ToLower();
    if(option.CompareTo("read")==0){   // read from file
        *file = (TFile*)gROOT->GetListOfFiles()->FindObject(fName.Data());
	if (!*file){
	    *file= new TFile(fName.Data(),"READ");
	    cout<<"HTool::open()     : Reading from "<<fName.Data()<<endl;
            return kTRUE;
	}else{
	    cout<<"Error(HTool::open() , SPECIFIED INPUT FILE DOES NOT EXIST!"<<endl;;
	    return kFALSE;
	}
    }
    else if(option.CompareTo("update")==0){   // read from file
	*file = (TFile*)gROOT->GetListOfFiles()->FindObject(fName.Data());
	if (!*file){
	    *file= new TFile(fName.Data(),"UPDATE");
	    cout<<"HTool::open()     : Updating "<<fName.Data()<<endl;
            return kTRUE;
	}else{
	    cout<<"Error(HTool::open() , SPECIFIED INPUT FILE DOES NOT EXIST!"<<endl;
	    return kFALSE;
	}
    }
    else if(option.CompareTo("recreate")==0){
	*file= new TFile(fName.Data(),"RECREATE");
        return kTRUE;
    }
    else if(option.CompareTo("create")==0){
	*file= new TFile(fName.Data(),"CREATE");
        return kTRUE;
    }
    else if(option.CompareTo("new")==0){
	*file= new TFile(fName.Data(),"NEW");
        return kTRUE;
    }
    else {
	cout<<"Error(HTool::open() , UNKOWN OPTION!"<<endl;
	return kFALSE;
    }
}
Bool_t HTool::close(TFile** file)
{
    // Close the root file of the pointer file if
    // existing and open and sets the file pointer to 0.
    // Returns kTRUE if OK.
    TString opt;
    if(*file){
	if((*file)->IsOpen()){
            opt=(*file)->GetOption();
	    if(opt.CompareTo("READ")!=0)(*file)->Save();
	    (*file)->Close();
            *file=0;
	    return kTRUE;
	}else{
	    cout<<"Warning(HTool::close() , SPECIFIED FILE IS NOT OPEN!"<<endl;
	    return kTRUE;
	}
    }else{
	cout<<"Error(HTool::close() , SPECIFIED FILE POINTER IS ZERO!"<<endl;
	return kFALSE;
    }
}
Bool_t HTool::openAscii(FILE** file,TString fName,TString option)
{
    // Opens ascii file "fName" to the pointer file with the option
    // "r" and "w". Returns kTRUE if OK.
    if(*file)
    {   // checking if file is opened
	cout<<"Error(HTool::openAscii() , SPECIFIED INPUT FILE IS MAYBE ALREADY OPEN!"<<endl;
	return kFALSE;
    }

    option.ToLower();
    if(option.CompareTo("r")==0){   // read from file
	*file = (FILE*)gROOT->GetListOfFiles()->FindObject(fName.Data());
	if (!*file){
	    *file= fopen(fName.Data(),"r");
	    cout<<"HTool::openAscii()     : Reading from "<<fName.Data()<<endl;
	    return kTRUE;
	}else{
	    cout<<"Error(HTool::openAscii() , SPECIFIED INPUT FILE DOES NOT EXIST!"<<endl;;
	    return kFALSE;
	}
    }
    else if(option.CompareTo("w")==0){
	*file=fopen(fName.Data(),"w");
	cout<<"HTool::openAscii()     : Writing to "<<fName.Data()<<endl;
	return kTRUE;
    }
    else {
	cout<<"Error(HTool::openAscii() , UNKOWN OPTION!"<<endl;
	return kFALSE;
    }
}
Bool_t HTool::closeAscii(FILE** file)
{
    // Close ascii file of the pointer file if file!=0 and
    // sets the file pointr to 0 afterwards. Returns kTRUE
    // if OK.
    if(*file){
	fclose(*file);
        *file=0;
	return kTRUE;
    }else{
	cout<<"Error(HTool::closeAsii() , SPECIFIED FILE POINTER IS ZERO!"<<endl;
	return kFALSE;
    }
}
TObjArray* HTool::glob(TString pattern)
{
   // Expand 'pattern' as it would be done by the shell (see sh(1)):
   // '*', '?', '~', '$ENVIRONMENT_VARIABLE' and '[', ']' are expanded. In case
   // the expansion is successful, a TObjArray of TObjStrings with the
   // names of all existing files is returned - otherwise NULL.
   //
   // The returned TObjArray must be deleted by the caller of the function!
   //
   // This example returns all existing .root files in /tmp as well as all .root
   // files in your home directory starting with the characters 'a', 'b', 'c'
   // and 'e':
   //
   // TObjArray* files = HTool::glob( "/tmp/*.root $HOME/[a-c,e]*.root" );
   // if (files)
   // {
   //    TObjString* name = NULL;
   //    TIterator*  file = files->MakeIterator();
   //    while ((name = (TObjString*)file->Next()))
   //    {
   //       Char_t* input = name->GetString.Data(); ...
   //    }
   //    delete files;
   // }

   wordexp_t  file_list;
   Char_t**   file;
   TObjArray* filenames = NULL;

   if (pattern.IsNull())
      return NULL;

   if (::wordexp( pattern.Data(), &file_list, 0 ))
   {
      ::wordfree( &file_list );
      return NULL;
   }

   file      = file_list.we_wordv;
   filenames = new TObjArray;

   for (UInt_t i = 0; i < file_list.we_wordc; i++)
   {
      // check if files real exist, since ::wordexp(3) returns the unexpanded
      // pattern, if e.g. the path does not exist
      if (!gSystem->AccessPathName( file[i] ))
	 filenames->Add( new TObjString( file[i] ) );
   }

   ::wordfree( &file_list );
   if (filenames->GetEntries() == 0)
   {
      delete filenames;
      filenames = NULL;
   }

   return filenames;
}


Bool_t HTool::writeNtupleToAscii(TString Input ,
				 TString ntuple,
				 TString Output,
				 TString separator,
				 TString selection,
				 TString condition,
				 Long64_t entries ,
				 Long64_t startEntry,
				 Int_t   ColWidth   )
{
    // Util function for writing ntuple data to ascii file:
    // Input     : Input File (*.root)
    // ntuple    : name of ntuple in Input File
    // Output    : Output ascii File
    // separator : data field separator (" " or "," or "\t" .....)
    // selection : comma separated list of leaf names ( like x,y,z,mom ...)
    //             - the list defines the order of the columns
    //             - if empty all leafs will be written (default)
    //             - if list contains "-" all leafs but the listed ones will be written
    // condition : like Tree->Draw() selection. Only rows which fulfill the condition will be written
    //             - if empty no condition is applied (default)
    // entries   : number of entries which should be read
    //             - if == -1 all entries are analyzied (default)
    // startEntry: first entry to strt in in ntuple
    // ColWidth  : format width for the data field
    //             - if ==0 no format is applied  (default)

    if(gSystem->AccessPathName(Input.Data())){
	cout<<"HTool::writeNtupleToAscii(): Error::InputFile: "<<Input.Data()<<" has not been found!"<<endl;
	return kFALSE;
    }
    TFile*      in=new TFile(Input.Data(),"READ");
    TNtuple* tuple=(TNtuple*)in->Get(ntuple.Data());
    if(tuple==0){
	cout<<"HTool::writeNtupleToAscii(): Error::Ntuple: "<<ntuple.Data()<<" has not been found!"<<endl;
        return kFALSE;
    }
    //------------------------------------------
    // get List of variables in ntuple,
    // number of variables and Rows (Entries)
    TObjArray* arr=tuple->GetListOfLeaves();
    Int_t nvar=tuple->GetNvar();
    if(entries<0) entries =tuple->GetEntries();
    //------------------------------------------



    TArrayI flag(nvar);
    flag.Reset(0);
    cout<<"selection    --------------"<<endl;

    //------------------------------------------
    // positive or negative List ?
    Bool_t positivList=kTRUE;

    if(selection.Contains("-"))  {
        // use all leafs
        positivList=kFALSE;
        flag.Reset(1);
        selection.ReplaceAll("-","");
    }
    //------------------------------------------
    if(positivList){
	cout<<"This Leafs will be selected:"<<endl;
    }
    else{
	cout<<"This Leafs will be skipped:"<<endl;
    }
    cout<<selection.Data()<<endl;
    cout<<"Condition applied : "<<condition.Data()<<endl;

    //------------------------------------------
    // split the lable list into single
    // values. The TObjArray has to be deleted
    // later.
    TObjArray* useList=selection.Tokenize(",");
    Int_t nselect=useList->GetLast()+1;
    TArrayI found(nselect);
    found.Reset(0);
    //------------------------------------------


    //------------------------------------------
    // create a list of flags for the
    // columns (variables) which should
    // be written out
    // flag=0 will be ignored

    map<TString,Int_t> mLeafInd;
    vector<TString>    vLeafName;

    if(nselect!=0)
    {
	// only if a selection was made
        for(Int_t i=0;i<arr->GetLast()+1;i++)
	{
	    TLeaf* l=(TLeaf*)arr->At(i);
	    TString n = l->GetName();
	    mLeafInd[n] = i;

	    for(Int_t j=0;j<useList->GetLast()+1;j++)
	    {
		TObjString* obj=(TObjString*)useList->At(j);
		TString lable=obj->GetString();
		lable.ReplaceAll(" ","");

		if(lable.CompareTo(l->GetName())==0)
		{
		    found[j] = 1;

		    if(positivList) {

			// mark the leafs from the selection
			// as used
			flag[i]=1;


		    } else {
			// mark the leafs from the selection
			// as not used
			flag[i]=0;
		    }
		    break;
		}
	    }
	}

	for(Int_t j=0;j<useList->GetLast()+1;j++)
	{

	    TObjString* obj=(TObjString*)useList->At(j);
	    TString lable=obj->GetString();
	    lable.ReplaceAll(" ","");
	    if(found[j] == 0 ){
		cout<<"HTool::writeNtupleToAscii(): Error::  Selected variable: "<<lable.Data()<<" has not been found!"<<endl;
	    } else {
                  if(positivList) vLeafName.push_back(lable); // add all found lables of selection
	    }
	}
	if(!positivList){ // add all good lables for negative selection

	    for(Int_t i=0;i<arr->GetLast()+1;i++)
	    {
		TLeaf* l=(TLeaf*)arr->At(i);
		TString lable = l->GetName();
		if(flag[i] == 1) vLeafName.push_back(lable);
	    }
	}
    } else { // take all

	for(Int_t i=0;i<arr->GetLast()+1;i++)
	{
	    TLeaf* l=(TLeaf*)arr->At(i);
	    TString lable = l->GetName();
	    vLeafName.push_back(lable);
            mLeafInd[lable] = i;
	}
    }
    //------------------------------------------

    //------------------------------------------
    // open output stream for writing
    // ascii output
    ofstream out;

    out.open(Output.Data());

    if(!out.is_open())
    {
	cout<<"HTool::writeNtupleToAscii(): Error: Could not open Output File!"<<endl;
	return kFALSE;
    }
    //------------------------------------------


    //------------------------------------------
    // write the header line (names of variables)
    // separated by selected separator

    Int_t written=0;
    for(UInt_t i=0;i<vLeafName.size();i++)
    {
	if(written==0)
	{
	    out<<"#";
	    if(ColWidth<=0) out<<vLeafName[i];
	    else            out<<setw(ColWidth)<<vLeafName[i];
	}
	else
	{
	    if(ColWidth<=0) out<<separator.Data()<<vLeafName[i];
            else            out<<separator.Data()<<setw(ColWidth)<<vLeafName[i];
	}
 
	 written++;
     }
     out<<endl;
    //------------------------------------------

    //------------------------------------------
    // compile selection expression if there is one
    TTreeFormula* select = 0;

    if (condition.CompareTo("")!=0) {
	select = new TTreeFormula("Selection",condition,tuple);
	if (!select) {
            cout<<"HTool::writeNtupleToAscii(): TTreeFormular pointer == 0!"<<endl;
	    return kFALSE;
	}
	if (!select->GetNdim()) {
	    cout<<"HTool::writeNtupleToAscii(): TTreeFormular dimension == 0!"<<endl;
	    delete select;
	    return kFALSE;
	}
    }
    //------------------------------------------

    //------------------------------------------
    // no write the data lines
    // separated by selected separator
    Long64_t maxEntries = tuple->GetEntries();
    if(entries < 0 || entries > maxEntries) entries = tuple ->GetEntries();
    if(startEntry < 0 )         startEntry = 0;

    for(Long64_t lines=startEntry;lines<startEntry+entries;lines++)
    {
	tuple->GetEntry(lines);

	//------------------------------------------
	// aply condition on the line
	if (select) {
	    select->GetNdata();
	    if (select->EvalInstance(0) == 0) continue;
	}
	//------------------------------------------

	Float_t* dat=tuple->GetArgs();



	written=0;
	for(UInt_t i = 0; i < vLeafName.size(); i ++)
	{
	    if(written==0){
                out<<" ";
		if(ColWidth<=0)out<<dat[mLeafInd[vLeafName[i]]];
		else           out<<setw(ColWidth)<<dat[mLeafInd[vLeafName[i]]];
	    }
	    else
	    {   if(ColWidth<=0) out<<separator.Data()<<dat[mLeafInd[vLeafName[i]]];
	    else            out<<separator.Data()<<setw(ColWidth)<<dat[mLeafInd[vLeafName[i]]];
	    }
	    written++;
	}
        out<<endl;
    }
    //------------------------------------------

    //------------------------------------------
    // close output and delete temoray variables
    out.close();
    useList->Delete();
    delete useList;
    //------------------------------------------

    return kTRUE;
}
void HTool::createNtupleMap(TString infile,
			    TString prefix,
			    TString ntupleName,
			    TString outfile)
{
    // create all variables to map the ntuple in oufile. opens root file, retrieves
    // the ntuple pointer. sets all branch addresses.
    // "infile"     = input root file containing the ntuple
    // "prefix"     = this string will be prepended to the normal variable names (needed for multiple identical ntuples)
    // "ntupleName" = name of the ntuple in the root file
    // "outfile"    = macro file which will be created.
    //                this macro can be loaded via gROOT->LoadMaco(....)
    //                + execute function as macro name (without .C)
    //                TNtuple* ntuple = mymacro(); to get the ntuple pointer
    //                in compiled code you have to use "#include mymacro.C" of the
    //                before created macro and remove gROOT->LoadMaco(....)
    //
    //
    //
    // example :
    //
    //  //--------------------------------
    //  // comment in if you want to compile
    //  // and the macros exist already!
    //  //#include "mymacro.C"
    //  //#include "mymacro2.C"
    //  //--------------------------------
    //
    //
    // void testNtupleMap()
    // {
    //    //--------------------------------
    //    comment out if you want to compile and
    //    the macros are in the #include
    //
    //    create the first macro for ntuple
    //    HTool::createNtupleMap("myfile.root","test_" ,"myntuple","mymacro.C");
    //    HTool::createNtupleMap("myfile.root","test2_","myntuple","mymacro2.C");
    //    gROOT->LoadMacro("mymacro.C");
    //    gROOT->LoadMacro("mymacro.C");
    //    //-------------------------------------
    //
    //    TNtuple* ntuple  = mymacro (); // functions defined in marco
    //    TNtuple* ntuple2 = mymacro2(); // functions defined in marco
    //
    //    Int_t n = ntuple->GetEntries();
    //    Float_t* dat = ntuple->GetArgs();
    //    for(Int_t i = 0; i < n ; i ++){
    //        ntuple->GetEntry(i);
    //        cout<<test_var<<endl;   // if var is a member of the ntuple (defined in macro)
    //    }
    //    cout<<"----------------"<<endl;
    //
    //    Int_t n2 = ntuple2->GetEntries();
    //    for(Int_t i = 0; i < n2 ; i ++){
    //        ntuple2->GetEntry(i);
    //        cout<<test2_var<<endl;  // if var is a member of the ntuple (defined in macro)
    //    }
    // }



    TFile* file = new TFile(infile.Data(),"READ");
    if(!file)  {
	cout<<"HTool::createNtupleMap(), File not found!"<<endl;
	exit(1);
    }

    TNtuple* ntuple = (TNtuple*) file->Get(ntupleName.Data());
    if(!ntuple) {
	cout<<"HTool::createNtupleMap(), Ntuple not found!"<<endl;
	exit(1);
    }

    ofstream out;
    out.open(outfile.Data(), ios_base::out);


    TObjArray* listLeave = ntuple->GetListOfLeaves();
    if(!listLeave) {
	cout<<"HTool::createNtupleMap(), Could not get list of leaves!"<<endl;
        out.close();
	exit(1);
    }

    for(Int_t i = 0; i < listLeave->GetLast() + 1; i ++){
	TLeaf* leaf = (TLeaf*) listLeave->At(i);
	out<<leaf->GetTypeName()<<" "<<Form("%s%s",prefix.Data(),leaf->GetName())<<";"<<endl;
    }

    TString func = gSystem->BaseName(outfile);
    if(!func.Contains(".C")){
	cout<<"HTool::createNtupleMap(), Macro Name does not contain .C!"<<endl;
	exit(1);
    }
    func.ReplaceAll(".C","");

    out<<Form("TNtuple* %s(){",func.Data())<<endl;
    out<<Form("TFile* file     = new TFile(\"%s\",\"READ\");",infile.Data())<<endl;
    out<<Form("TNtuple* %s = (TNtuple*) file->Get(\"%s\");",ntupleName.Data(),ntupleName.Data())<<endl;
    for(Int_t i = 0; i < listLeave->GetLast() + 1; i ++){
	TLeaf* leaf = (TLeaf*) listLeave->At(i);
	TString tmp = Form("->SetBranchAddress(\"%s\",&%s%s);",leaf->GetName(),prefix.Data(),leaf->GetName());
	out<<ntupleName.Data()<<tmp.Data()<<endl;
    }
    out<<Form("return %s;",ntupleName.Data())<<endl;
    out<<"}"<<endl;

    out.close();
}

void  HTool::backTrace(Int_t level)
{
    // prints out level steps of function calls
    // before the function call (backtrace)
    // Useful for debugging

    void** array =new void* [level];
    size_t size = backtrace (array, level);

    if(size)
    {
 Char_t **strings;
	strings = backtrace_symbols (array, size);

	printf ("Obtained %zd stack frames.\n", size);

	for (size_t i = 0; i < size; i++)
	{
	    if(gSystem->Which("c++filt","/dev/null")==0)
	    {
                // do nice print out using c++filt from gnu binutils
                TString symbol=strings[i];
		TString lib   =symbol;

		lib.Replace   (lib.First('(')   ,lib.Length()-lib.First('('),"");
		symbol.Replace(0                ,symbol.First('(')+1        ,"");
		symbol.Replace(symbol.First('+'),symbol.Length()            ,"");

		cout<<lib.Data()<<": "<<flush;
		gSystem->Exec(Form("c++filt %s",symbol.Data()));
	    }
	    else
	    {
		// do normal print out
		cout<<strings[i]<<endl;

	    }
	}
        free(strings);
    }else{
	cout<<"HTool::backTrack() : Could not retrieve backtrace information"<<endl;
    }
    delete [] array;
}

Bool_t HTool::printBaskets(TString infile,
			   TString opt   ,
			   TString listofClasses ,
			   TString treename)
{
    Float_t factor = 1;
    TString label  = " Bytes";

    if(opt.CompareTo("M") == 0) {
	factor = 1024 * 1024;
	label  = " MBytes";
    }
    if(opt.CompareTo("k") == 0) {
	factor = 1024;
	label  = " kBytes";
    }

    if(infile.CompareTo("") == 0)
    {
	cout<<"No input file specified!"<<endl;
	return kFALSE;
    }

    Bool_t useClassList = kFALSE;
    if(listofClasses.CompareTo("") != 0)
    {
	useClassList = kTRUE;
    }

    Int_t numberclasses   = 0;
    TString* myclassNames = 0;

    if(useClassList)
    {
	myclassNames = HTool::parseString(listofClasses,numberclasses,",",kFALSE);
    }

    TFile* in = new TFile(infile.Data(),"READ");
    if(!in) {
	cout<<"Cannot find input file!"<<endl;
	return kFALSE;
    }

    in->cd();
    TTree* T = (TTree*)in->Get(treename.Data());


    TObjArray* classarray = new TObjArray();
    TString keyname;
    TString keyclassname;

    TString branch;
    TString histname;
    TString classname;
    TString varname;


    Int_t totBytes    = 0;
    Int_t totzipBytes = 0;
    Int_t totSize     = 0;
    TObjArray* a      = T->GetListOfLeaves();
    TString oldclass  = "";
    TString myclass;
    Int_t  ct          = 0;
    Int_t  ctClassList = 0;
    for(Int_t j=0;j<a->LastIndex()+1;j++)
    {

	TLeaf* l = (TLeaf*) a->At(j);
	TString myclass = l->GetName();

	TBranch* b = l->GetBranch();
	classname  = b->GetClassName();


	//----------------------------------------------------------------

	myclass.Replace(myclass.First("."),myclass.Length()-myclass.First("."),"");

	if(classarray->FindObject(myclass.Data())){
	    continue;
	}

	if(useClassList)
	{
	    if(HTool::findString(&myclassNames[0],numberclasses,myclass))
	    {
		classarray->Add(new TObjString(myclass));
		cout<<myclass.Data()<<endl;
		continue;
	    }
	}
	else
	{
	    classarray->Add(new TObjString(myclass));
	}

    }

    classarray->Expand(classarray->GetEntries());
    cout<<"Number of Categories: "<<classarray->GetEntries() <<endl;

    TCanvas* cstat=new TCanvas("cstat","cstat",1000,800);
    cstat->SetBottomMargin(0.25);
    cstat->SetLeftMargin(0.2);
    cstat->SetGridx();
    cstat->SetGridy();


    TH1F* hstat=new TH1F("hstat","hstat",classarray->GetEntries(),0,classarray->GetEntries());
    hstat->SetYTitle(Form("disk space [%s]",label.Data()));
    for(Int_t i=0;i<classarray->GetEntries();i++){
	hstat->GetXaxis()->SetBinLabel(i+1,((TKey*)classarray->At(i))->GetName());
    }
    hstat->GetXaxis()->LabelsOption("v");
    hstat->GetYaxis()->SetTitleOffset(2);
    hstat->SetFillColor(4);
    hstat->SetDirectory(0);
    hstat->SetStats(kFALSE);
    //--------------------looping over categories to get all data members----------------------------

    cout<<"-----------------------------------------------------------"<<endl;

    ct          = 0;
    ctClassList = 0;
    for(Int_t j=0;j<a->LastIndex()+1;j++)
    {

	TLeaf* l = (TLeaf*) a->At(j);
	TString myclass = l->GetName();

	TBranch* b = l->GetBranch();
	classname  = b->GetClassName();

	//----------------------------------------------------------------

	myclass.Replace(myclass.First("."),myclass.Length()-myclass.First("."),"");

	if(myclass.CompareTo(oldclass.Data()) != 0 && oldclass != "")
	{

	    if(oldclass.CompareTo("") == 0) keyname = myclass;
	    else                            keyname = oldclass;

	    //----------------------------------------------------------------
	    // print summed size of object
	    if(totBytes)
	    {
		cout<<"###########################################################"<<endl;
		cout<<keyname.Data()<<endl;

		if(useClassList)
		{
		    if(HTool::findString(&myclassNames[0],numberclasses,keyname))
		    {


			cout<<" \n\t total size         : "<<totSize    /factor <<label.Data()
			    <<" \n\t total Bytes        : "<<totBytes   /factor <<label.Data()
			    <<" \n\t total zip Bytes    : "<<totzipBytes/factor <<label.Data()
			    <<" \n\t compression factor : "<<totBytes   /((Float_t)totzipBytes)
			    <<endl;

			hstat->SetBinContent(ctClassList+1,totzipBytes/factor);
			ctClassList++;
		    }
		} else {

		    cout<<" \n\t total size         : "<<totSize    /factor  <<label.Data()
			<<" \n\t total Bytes        : "<<totBytes   /factor  <<label.Data()
			<<" \n\t total zip Bytes    : "<<totzipBytes/factor  <<label.Data()
			<<" \n\t compression factor : "<<totBytes   /((Float_t)totzipBytes)
			<<endl;

		    hstat->SetBinContent(ct+1,totzipBytes/factor);
		}
		if(j<a->LastIndex()+1){
		    totBytes    = 0;
		    totzipBytes = 0;
		    totSize     = 0;
		}

	    }
	    ct++;
	    //----------------------------------------------------------------

	} else {

	    if(useClassList)
	    {
		if(!HTool::findString(&myclassNames[0],numberclasses,myclass))
		{
		    continue;
		}
	    }

	    TBranch* b = l->GetBranch();
	    if(b){
		totSize     += b->GetTotalSize();
		totBytes    += b->GetTotBytes();
		totzipBytes += b->GetZipBytes();
	    } else {
		cout<<"ZERO pointer retrieved for branch: "<<l->GetName()<<endl;
	    }

	}


	oldclass = myclass;
    }


    //----------------------------------------------------------------

    cout<<"\n total selected data zip size of full File : "<<hstat->Integral()<<label.Data()<<endl;

    in->Close();
    delete classarray;
    hstat->Draw();
    return kTRUE;

}
void HTool::printProgress(Long64_t ct,Long64_t total,Long64_t step, TString comment )
{
    // print the progress of a loop in %, where ct is the loop
    // counter, total the total number of loops and step the
    // step size in precent for which the print should be done.

    if(total <= 0 ) {
	cout<<"Error::printProgress(), total is <=0 !"<<endl;
        return;
    }
    if(ct < 0 ) {
	cout<<"Error::printProgress(), ct is < 0 !"<<endl;
        return;
    }
    if(ct == 0 ) cout<< comment.Data() << flush;
    Long64_t frac   =  (Long64_t) ((( ct     /(Float_t)total) ) * 100);
    Long64_t frac_1 =  (Long64_t) ((((ct - 1)/(Float_t)total) ) * 100);

    if( frac % step == 0 &&  (frac != frac_1) )
    {
	if(frac_1/step > 0 ) cout<<"\b\b\b\b\b"<<flush;
	cout<<setw(3)<<frac<<" %"<<flush;
        if(frac + step >= 100) cout<<endl;
    }
}

//----------------------------Dirs-------------------------------------

TDirectory* HTool::Mkdir(TDirectory *dirOld, const Char_t *c, Int_t i, Int_t p)    //! Makes new Dir, changes to Dir, returns pointer to new Dir
{
    // Function to create subdirectories, where dirold is the pointer of the old Directory,
    // "c" the name of the new Directory an "i" the number (c + i) of the directory."p" gives
    // the formating number of digits filled with 0. If "i"==-99 the numbering part is skipped.
    // Checks if the Directrory exists , if so changes into otherwise create it new. The
    // pointer to the new Directory is returned.

    static Char_t sDir[255];// = new Char_t[strlen(c)+3];
    static Char_t sFmt[10];
    if(i!=-99)
    {
	sprintf(sFmt, "%%s %%0%1ii", p);
	sprintf(sDir, sFmt, c, i);
    }
    else
    {
	sprintf(sDir,"%s",c);
    }
    TDirectory *dirNew=0;
    if(!dirOld->FindKey(sDir))
    {
	dirNew = dirOld->mkdir(sDir);
    }
    else
    {
	dirNew=(TDirectory*)dirOld->Get(sDir);
    }
    dirOld->cd(sDir);
    return dirNew;
}

TDirectory* HTool::changeToDir(TString p)
{
    // Changes into the given path. If the Directory is not existing
    // it will be created. The pointer to the new directory will be returned.
    TDirectory *dirNew = 0;
    TString s1 = p;
    Ssiz_t len = s1.Length();
    if(len != 0 )
    {
	TObjString *stemp;
	TString argument;
	TObjArray* myarguments = s1.Tokenize("/");
	TIterator* myiter = myarguments->MakeIterator();

	// iterate over the list of arguments
	while ((stemp=(TObjString*)myiter->Next())!= 0)
	{
	    argument=stemp->GetString();

	    dirNew=HTool::Mkdir(gDirectory,argument.Data(),-99);
	}
	myarguments->Delete();
        delete myarguments;

    }
    return dirNew;
}

Bool_t HTool::checkDir(TString p,TFile* input)
{
    // Checks if a given path "p" in file "input" exists.
    // The actual directory will not be changed. Returns
    // kTRUE if OK.
    TDirectory* dirSave = gDirectory;

    TDirectory *dirNew = input;
    TString s1 = p;
    Ssiz_t len = s1.Length();
    if(len != 0)
    {
	TObjString *stemp;
	TString argument;
        TObjArray*  myarguments = s1.Tokenize("/");

	TIterator* myiter = myarguments->MakeIterator();

	// iterate over the list of arguments
	while ((stemp = (TObjString*)myiter->Next()) != 0)
	{
	    argument = stemp->GetString();
	    if(dirNew->FindKey(argument.Data()))
	    {
		dirNew->cd(argument.Data());
		dirNew = gDirectory;
	    } else {
		dirSave->cd();
		return kFALSE;
	    }
	}
	myarguments->Delete();
        delete myarguments;

    }
    dirSave->cd();
    return kTRUE;
}

//------------------------misc--------------------------------

TList*  HTool::getListOfAllDataMembers(TClass* cl)
{
    // return a list of all data members of a class.
    // contains all data members of bass classes.

    TList* list=cl->GetListOfDataMembers();

    TIter next_BaseClass(cl->GetListOfBases());
    TBaseClass *pB;
    while ((pB = (TBaseClass*) next_BaseClass())) {
        if (!pB->GetClassPointer()) continue;
        list->AddAll(pB->GetClassPointer()->GetListOfDataMembers() );
    }
    return list;
}

void HTool::scanOracle(TString inputname,TString outputname)
{
    // scans oracle runs table source code to extract
    // file names, run ids and number of events

    FILE* input =0;
    FILE* output=0;

    if(!HTool::openAscii(&input,inputname  ,"r"))
    {
	exit(1);
    }
    if(!HTool::openAscii(&output,outputname,"w"))
    {
	exit(1);
    }

    Char_t line[4000];

    TString buffer="";
    TString filename;
    TString fileRunId;
    TString fileNEvents;
    TString newLine;

    Int_t count=0;
    Int_t sumEvts=0;
    Int_t Evts=0;

    while(1)
    {
	if(feof(input)) break;
	Bool_t res=fgets(line, sizeof(line), input);
	if(!res) cout<<"scan oracle: error reading next line!"<<endl;
	
	buffer=line;
	if (buffer.Contains("<TD align=\"center\">100"))
	{
            buffer.ReplaceAll("<TD align=\"center\">","");
            buffer.ReplaceAll("</TD>","");
            buffer.ReplaceAll("\n","");
	    fileRunId=buffer;

	    Bool_t res=fgets(line, sizeof(line), input);
            res=fgets(line, sizeof(line), input);
            res=fgets(line, sizeof(line), input);
            res=fgets(line, sizeof(line), input);


	    buffer=line;
            buffer.ReplaceAll("<TD align=\"center\"><A href=\"hades_www.show_log_run_info.show?search_string=","");
            buffer.Remove(buffer.First("&"));
            buffer.ReplaceAll("\n","");
	    filename=buffer;

	    res=fgets(line, sizeof(line), input);

	    if(!res) cout<<"reading hist description: error reading next line!"<<endl;
	
	    buffer=line;
            buffer.ReplaceAll("<TD align=\"center\">","");
	    buffer.ReplaceAll("</TD>","");
            buffer.ReplaceAll("\n","");

	    fileNEvents=buffer;
	    newLine= filename + " " + fileRunId + " " + fileNEvents;
            sscanf(newLine.Data(),"%*s%*s%i",&Evts);
	    sumEvts=sumEvts+Evts;
            count++;
            fprintf(output,"%s%s",newLine.Data(),"\n");
	}
    }
    cout<<count<<" Files with "<<sumEvts<<" Events"<<endl;
    fprintf(output,"%i Files with %i Events\n",count,sumEvts);

    HTool::closeAscii(&input);
    HTool::closeAscii(&output);

}
Double_t HTool::roundDigits(Double_t d, Int_t ndigit)
{
    // Round d to ndigits
    if(ndigit<0) return -1.;
    d= pow(10.,-ndigit) * floor( pow(10.,ndigit) * d + 0.5 );
    return d;
}
Float_t HTool::roundDigits(Float_t f, Int_t ndigit)
{
    // Round d to ndigits
    if(ndigit<0) return -1.;
    f= pow(10.,-ndigit) * floor( pow(10.,ndigit) * f + 0.5 );
    return f;
}
Int_t HTool::exec(TString command, TString& output)
{
   // Execute 'command' in a shell and return the exit code of 'command'.
   // 'output' is filled with the data written to STDOUT and STDERR by
   // 'command'.
 
   TString line;
   FILE*   pipe;

   if (command.IsNull())
      return 1;

   command.Prepend( "exec 2>&1; " );
   pipe = gSystem->OpenPipe( command.Data(), "r" );

   output = "";
   while (line.Gets( pipe ))
      output += line;

   return gSystem->ClosePipe( pipe );
}

Int_t HTool::getLinearIndex(Int_t x1, UInt_t x1max,
			    Int_t x2, UInt_t x2max,
			    Int_t x3, UInt_t x3max,
			    Int_t x4, UInt_t x4max,
			    Int_t x5, UInt_t x5max)
{
    // Translates i.e. array coordinate 0,2,3 of array[3][8][1]
    // in a linear unique coordinate starting from 0  according
    // to standard memory layout of c++. Supports 2-5
    // dimensional addressing. Returns -1 in case of error.
    //
    //
    // index  =
    // 2-dim  = x2 + x1*x2max
    // 3-dim  = x3 + x1*x2max*x3max + x2*x3max
    // 4-dim  = x4 + x1*x2max*x3max*x4max + x2*x3max*x4max + x3*x4max
    // 5-dim  = x5 + x1*x2max*x3max*x4max*x5max + x2*x3max*x4max*x5max + x3*x4max*x5max + x4*x5max


    Int_t dim = 2;

    if(x1 < 0 ||  x1max <= 0 || x1 >= (Int_t)x1max)         dim = -1;
    if(x2 < 0 ||  x2max <= 0 || x2 >= (Int_t)x2max)         dim = -1;
    if(dim > 0)
    {
	if(x3 != -1 ){
	    if(x3max > 0 && x3 < (Int_t)x3max)              dim ++;
	    else                                            dim = -1;
	}
	if(x3 < 0 && x3max > 0)                             dim = -1;
	if(x4 != -1){
	    if (dim == 3 && x4max > 0 && x4 < (Int_t)x4max) dim ++;
	    else                                            dim = -1;
	}
	if(x4 < 0 && x4max > 0)                             dim = -1;
	if(x5 != -1){
	    if(dim == 4 && x5max > 0 && x5 < (Int_t)x5max)  dim ++;
	    else                                            dim = -1;
	}
	if(x5 < 0 && x5max > 0)                             dim = -1;

    }
    if(dim < 0){
	printf("getLinearIndex(): index : %4i %4i %4i %4i %4i, maxindex :  %4i %4i %4i %4i %4i\n"
		,x1,x2,x3,x4,x5,x1max,x2max,x3max,x4max,x5max);

	return -1;
    }

    if     (dim == 2) return x2 + x1*x2max;
    else if(dim == 3) return x3 + x1*x2max*x3max             + x2*x3max;
    else if(dim == 4) return x4 + x1*x2max*x3max*x4max       + x2*x3max*x4max       + x3*x4max;
    else if(dim == 5) return x5 + x1*x2max*x3max*x4max*x5max + x2*x3max*x4max*x5max + x3*x4max*x5max + x4*x5max;

    return 0;

}
Int_t  HTool::getDimIndex(Int_t index,
			  Int_t& x1,
			  Int_t& x2,
			  Int_t& x3,
			  Int_t& x4,
			  Int_t& x5,
			  UInt_t x1max,
			  UInt_t x2max,
			  UInt_t x3max,
			  UInt_t x4max,
			  UInt_t x5max)
{

    // Translates linear array coordinate (like produced with HTool::getLinearIndex())
    // back to multi dimensional indices . Returns -1 in case of error.
    //
    // linear index
    // index  = x2 + x1*x2max                                            2dim
    //          x3 + x1*x2max*x3max + x2*x3max                           3dim
    //          x4 + x1*x2max*x3max*x4max + x2*x3max*x4max + x3*x4max    4dim
    //          x5 + x1*x2max*x3max*x4max*x5max + x2*x3max*x4max*x5max + x3*x4max*x5max + x4*x5max    5dim

    x1=x2=x3=x4=x5=-1;

    Int_t dim = 2;

    if(x1max <= 0) dim = -1;
    if(x2max <= 0) dim = -1;
    if(dim > 0){
	if(x3max > 0) dim ++;
	if(dim == 3 && x4max > 0) dim ++;
	if(dim == 4 && x5max > 0) dim ++;
    }
    if(dim < 0){
	printf("getDimIndex(): maxindex :  %4i %4i %4i %4i %4i! \n",x1max,x2max,x3max,x4max,x5max);
	return -1;
    }
    Int_t max = 0;
    if     (dim == 2) max = x1max*x2max;
    else if(dim == 3) max = x1max*x2max*x3max;
    else if(dim == 4) max = x1max*x2max*x3max*x4max;
    else if(dim == 5) max = x1max*x2max*x3max*x4max*x5max;

    if(index < 0 || index >= max ){
	printf("getDimIndex(): index >= maxindex || index < 0 : index =%i! \n",index);
	return -1;
    }

    if       (dim == 2) {

	x1 = index / x2max;
	x2 = index - x1*x2max;

    } else if(dim == 3){

	Int_t ind2 = x2max*x3max;
	x1 = index / ind2;
	x2 = (index - x1*ind2) / x3max;
	x3 =  index - x1*ind2 - x2*x3max;

    } else if(dim == 4) {

	Int_t ind2 = x2max*x3max*x4max;
	Int_t ind3 = x3max*x4max;
	x1 =  index / ind2;
	x2 = (index - x1*ind2) / ind3;
	x3 = (index - x1*ind2 - x2*ind3) / x4max;
	x4 =  index - x1*ind2 - x2*ind3 - x3*x4max;

    } else if(dim == 5) {

	Int_t ind2 = x2max*x3max*x4max*x5max;
	Int_t ind3 = x3max*x4max*x5max;
	Int_t ind4 = x4max*x5max;

	x1 =  index / ind2;
	x2 = (index - x1*ind2) / ind3;
	x3 = (index - x1*ind2 - x2*ind3) / ind4;
	x4 = (index - x1*ind2 - x2*ind3 - x3*ind4) / x5max;
	x5 =  index - x1*ind2 - x2*ind3 - x3*ind4 - x4*x5max;
    }
    return 0;

}


void HTool::sort(Int_t n, Char_t* arrIn,Int_t* index,Bool_t down,Bool_t overwrite)
{
    // sorts array arrIn. If down=kTRUE sort in decreasing order.
    // If overwrite=kTRUE input array is sorted otherwise not and
    // the result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(!overwrite&&!index) return;
    if(n<2)                return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;
    Char_t val;

    Char_t* arr=0;
    Char_t* arrNew=0;

    if(!overwrite) {
	arrNew = new Char_t [n];
        memcpy(arrNew,arrIn,n*sizeof(Char_t));
	arr=arrNew;
    } else {
        arr=arrIn;
    }

    if(index) for(Int_t i=0;i<n;i++) index[i]=i;

    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;
	val      = arr[a];

	if(index) bin = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[b]>val)   // > decreasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[b]<val)   // < increasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{
	    arr[c]   = arr[a];
	    arr[a]   = val;

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }

	}
    }
    if(!overwrite) delete [] arrNew;
}

void HTool::sort(Int_t n, Short_t* arrIn,Int_t* index,Bool_t down,Bool_t overwrite)
{
    // sorts array arrIn. If down=kTRUE sort in decreasing order.
    // If overwrite=kTRUE input array is sorted otherwise not and
    // the result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(!overwrite&&!index) return;
    if(n<2)                return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;
    Short_t val;

    Short_t* arr=0;
    Short_t* arrNew=0;

    if(!overwrite) {
	arrNew = new Short_t [n];
        memcpy(arrNew,arrIn,n*sizeof(Short_t));
	arr=arrNew;
    } else {
        arr=arrIn;
    }

    if(index) for(Int_t i=0;i<n;i++) index[i]=i;

    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;
	val      = arr[a];

	if(index) bin = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[b]>val)   // > decreasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[b]<val)   // < increasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{
	    arr[c]   = arr[a];
	    arr[a]   = val;

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }

	}
    }
    if(!overwrite) delete [] arrNew;
}


void HTool::sort(Int_t n, Int_t* arrIn,Int_t* index,Bool_t down,Bool_t overwrite)
{
    // sorts array arrIn. If down=kTRUE sort in decreasing order.
    // If overwrite=kTRUE input array is sorted otherwise not and
    // the result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(!overwrite&&!index) return;
    if(n<2)                return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;
    Int_t val;

    Int_t* arr=0;
    Int_t* arrNew=0;

    if(!overwrite) {
	arrNew = new Int_t [n];
        memcpy(arrNew,arrIn,n*sizeof(Int_t));
	arr=arrNew;
    } else {
        arr=arrIn;
    }

    if(index) for(Int_t i=0;i<n;i++) index[i]=i;

    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;
	val      = arr[a];

	if(index) bin = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[b]>val)   // > decreasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[b]<val)   // < increasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{
	    arr[c]   = arr[a];
	    arr[a]   = val;

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }

	}
    }
    if(!overwrite) delete [] arrNew;
}

void HTool::sort(Int_t n, Float_t* arrIn,Int_t* index,Bool_t down,Bool_t overwrite)
{
    // sorts array arrIn. If down=kTRUE sort in decreasing order.
    // If overwrite=kTRUE input array is sorted otherwise not and
    // the result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(!overwrite&&!index) return;
    if(n<2)                return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;
    Float_t val;

    Float_t* arr=0;
    Float_t* arrNew=0;

    if(!overwrite) {
	arrNew = new Float_t [n];
        memcpy(arrNew,arrIn,n*sizeof(Float_t));
	arr=arrNew;
    } else {
        arr=arrIn;
    }

    if(index) for(Int_t i=0;i<n;i++) index[i]=i;

    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;
	val      = arr[a];

	if(index) bin = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[b]>val)   // > decreasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[b]<val)   // < increasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{
	    arr[c]   = arr[a];
	    arr[a]   = val;

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }

	}
    }
    if(!overwrite) delete [] arrNew;
}

void HTool::sort(Int_t n, Double_t* arrIn,Int_t* index,Bool_t down,Bool_t overwrite)
{
    // sorts array arrIn. If down=kTRUE sort in decreasing order.
    // If overwrite=kTRUE input array is sorted otherwise not and
    // the result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(!overwrite&&!index) return;
    if(n<2)                return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;
    Double_t val;

    Double_t* arr=0;
    Double_t* arrNew=0;

    if(!overwrite) {
	arrNew = new Double_t [n];
        memcpy(arrNew,arrIn,n*sizeof(Double_t));
	arr=arrNew;
    } else {
        arr=arrIn;
    }

    if(index) for(Int_t i=0;i<n;i++) index[i]=i;

    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;
	val      = arr[a];

	if(index) bin = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[b]>val)   // > decreasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[b]<val)   // < increasing order
	    {
		c        = b;
		val      = arr[b];
		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{
	    arr[c]   = arr[a];
	    arr[a]   = val;

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }

	}
    }
    if(!overwrite) delete [] arrNew;
}

void HTool::sortParallel(Int_t n,Int_t nArrays,Char_t* arrIn,Int_t leading,Int_t* index,Bool_t down)
{
    // sorts n arrays arrIn paralell (destruktive!). Array pointer arrIn[leading] will be the
    // leading one. The other arrays will be sorted according to the reordering of the leading array.
    // If down=kTRUE sort in decreasing order.
    // The result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(n<2)  return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;

    Char_t* arr=0;
    Char_t* tempVar =new Char_t [nArrays];

    arr=arrIn;

    // prepare index array
    if(index) {
	for(Int_t i=0;i<n;i++) index[i]=i;
    }


    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;

	for(Int_t i=0;i<nArrays;i++){
	    tempVar[i] = arr[i*n+a];
	}

	if(index) bin  = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[leading*n+b]>tempVar[leading])   // > decreasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[leading*n+b]<tempVar[leading])   // < increasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{

	    for(Int_t i=0;i<nArrays;i++){
		arr[i*n+c]=arr[i*n+a];
		arr[i*n+a]=tempVar[i];
	    }

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }
	}
    }

    delete [] tempVar;

}
void HTool::sortParallel(Int_t n,Int_t nArrays,Short_t* arrIn,Int_t leading,Int_t* index,Bool_t down)
{
    // sorts n arrays arrIn paralell (destruktive!). Array pointer arrIn[leading] will be the
    // leading one. The other arrays will be sorted according to the reordering of the leading array.
    // If down=kTRUE sort in decreasing order.
    // The result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(n<2)  return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;

    Short_t* arr=0;
    Short_t* tempVar =new Short_t [nArrays];

    arr=arrIn;

    // prepare index array
    if(index) {
	for(Int_t i=0;i<n;i++) index[i]=i;
    }


    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;

	for(Int_t i=0;i<nArrays;i++){
	    tempVar[i] = arr[i*n+a];
	}

	if(index) bin  = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[leading*n+b]>tempVar[leading])   // > decreasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[leading*n+b]<tempVar[leading])   // < increasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{

	    for(Int_t i=0;i<nArrays;i++){
		arr[i*n+c]=arr[i*n+a];
		arr[i*n+a]=tempVar[i];
	    }

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }
	}
    }

    delete [] tempVar;

}
void HTool::sortParallel(Int_t n,Int_t nArrays,Int_t* arrIn,Int_t leading,Int_t* index,Bool_t down)
{
    // sorts n arrays arrIn paralell (destruktive!). Array pointer arrIn[leading] will be the
    // leading one. The other arrays will be sorted according to the reordering of the leading array.
    // If down=kTRUE sort in decreasing order.
    // The result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(n<2)  return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;

    Int_t* arr=0;
    Int_t* tempVar =new Int_t [nArrays];

    arr=arrIn;

    // prepare index array
    if(index) {
	for(Int_t i=0;i<n;i++) index[i]=i;
    }


    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;

	for(Int_t i=0;i<nArrays;i++){
	    tempVar[i] = arr[i*n+a];
	}

	if(index) bin  = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[leading*n+b]>tempVar[leading])   // > decreasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[leading*n+b]<tempVar[leading])   // < increasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{

	    for(Int_t i=0;i<nArrays;i++){
		arr[i*n+c]=arr[i*n+a];
		arr[i*n+a]=tempVar[i];
	    }

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }
	}
    }

    delete [] tempVar;

}
void HTool::sortParallel(Int_t n,Int_t nArrays,Float_t* arrIn,Int_t leading,Int_t* index,Bool_t down)
{
    // sorts n arrays arrIn paralell (destruktive!). Array pointer arrIn[leading] will be the
    // leading one. The other arrays will be sorted according to the reordering of the leading array.
    // If down=kTRUE sort in decreasing order.
    // The result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(n<2)  return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;

    Float_t* arr=0;
    Float_t* tempVar =new Float_t [nArrays];

    arr=arrIn;

    // prepare index array
    if(index) {
	for(Int_t i=0;i<n;i++) index[i]=i;
    }


    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;

	for(Int_t i=0;i<nArrays;i++){
	    tempVar[i] = arr[i*n+a];
	}

	if(index) bin  = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[leading*n+b]>tempVar[leading])   // > decreasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[leading*n+b]<tempVar[leading])   // < increasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{

	    for(Int_t i=0;i<nArrays;i++){
		arr[i*n+c]=arr[i*n+a];
		arr[i*n+a]=tempVar[i];
	    }

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }
	}
    }

    delete [] tempVar;

}
void HTool::sortParallel(Int_t n,Int_t nArrays,Double_t* arrIn,Int_t leading,Int_t* index,Bool_t down)
{
    // sorts n arrays arrIn paralell (destruktive!). Array pointer arrIn[leading] will be the
    // leading one. The other arrays will be sorted according to the reordering of the leading array.
    // If down=kTRUE sort in decreasing order.
    // The result can be obtained from the index array (has to be provided
    // by the caller with size >=n ) If index=NULL the index array is not used.
    // if index=NULL and overwrite=kFALSE the function returns
    // without doing anything.

    if(n<2)  return;

    register Int_t a,b,c;
    Int_t exchange,bin=0;

    Double_t* arr=0;
    Double_t* tempVar =new Double_t [nArrays];

    arr=arrIn;

    // prepare index array
    if(index) {
	for(Int_t i=0;i<n;i++) index[i]=i;
    }


    for(a=0;a<n-1;++a)
    {
	exchange = 0;
	c        = a;

	for(Int_t i=0;i<nArrays;i++){
	    tempVar[i] = arr[i*n+a];
	}

	if(index) bin  = index[a];

	for(b=a+1;b<n;++b)
	{
	    if( down&&arr[leading*n+b]>tempVar[leading])   // > decreasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	    if(!down&&arr[leading*n+b]<tempVar[leading])   // < increasing order
	    {
		c        = b;

		for(Int_t i=0;i<nArrays;i++){
		    tempVar[i] = arr[i*n+b];
		}

		exchange = 1;

                if(index) bin = index[b];
	    }
	}
	if(exchange)
	{

	    for(Int_t i=0;i<nArrays;i++){
		arr[i*n+c]=arr[i*n+a];
		arr[i*n+a]=tempVar[i];
	    }

	    if(index)
	    {
		index[c] = index[a];
		index[a] = bin;
	    }
	}
    }

    delete [] tempVar;

}

Double_t HTool::kurtosis(Int_t n, Short_t* data)
{
    // calculates the kurtosis
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^4         //
    //   ---                     //
    //  ----------------  - 3    //
    //       n*sigma^4           //
    //
    //
    // The kurtosis will be > 0 for distributions
    // compared wider than a normal distribution and
    // and < 0 for distributions beeing peaking stronger

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,4);
    }
    Double_t kurtosis=(sum/((n)*TMath::Power(sigma,4)))-3;
    return  kurtosis;
}
Double_t HTool::kurtosis(Int_t n, Int_t* data)
{
    // calculates the kurtosis
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^4         //
    //   ---                     //
    //  ----------------  - 3    //
    //       n*sigma^4           //
    //
    //
    // The kurtosis will be > 0 for distributions
    // compared wider than a normal distribution and
    // and < 0 for distributions beeing peaking stronger

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,4);
    }
    Double_t kurtosis=(sum/((n)*TMath::Power(sigma,4)))-3;
    return  kurtosis;
}
Double_t HTool::kurtosis(Int_t n, Float_t* data)
{
    // calculates the kurtosis
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^4         //
    //   ---                     //
    //  ----------------  - 3    //
    //       n*sigma^4           //
    //
    //
    // The kurtosis will be > 0 for distributions
    // compared wider than a normal distribution and
    // and < 0 for distributions beeing peaking stronger

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,4);
    }
    Double_t kurtosis=(sum/((n)*TMath::Power(sigma,4)))-3;
    return  kurtosis;
}
Double_t HTool::kurtosis(Int_t n, Double_t* data)
{
    // calculates the kurtosis
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^4         //
    //   ---                     //
    //  ----------------  - 3    //
    //       n*sigma^4           //
    //
    //
    // The kurtosis will be > 0 for distributions
    // compared wider than a normal distribution and
    // and < 0 for distributions beeing peaking stronger

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,4);
    }
    Double_t kurtosis=(sum/((n)*TMath::Power(sigma,4)))-3;
    return  kurtosis;
}

Double_t HTool::skewness(Int_t n, Short_t* data)
{
    // calculates the skew
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^3         //
    //   ---                     //
    //  ----------------         //
    //       n*sigma^3           //
    //
    //
    // The skew will be > 0 for distributions
    // haveing more entries in the tails larger than mean
    // and < 0 for distributions haveing more entries small
    // than mean

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,3);
    }
    Double_t skew=sum/((n)*TMath::Power(sigma,3));
    return  skew;
}
Double_t HTool::skewness(Int_t n, Int_t* data)
{
    // calculates the skew
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^3         //
    //   ---                     //
    //  ----------------         //
    //       n*sigma^3           //
    //
    //
    // The skew will be > 0 for distributions
    // haveing more entries in the tails larger than mean
    // and < 0 for distributions haveing more entries small
    // than mean

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,3);
    }
    Double_t skew=sum/((n)*TMath::Power(sigma,3));
    return  skew;
}
Double_t HTool::skewness(Int_t n, Float_t* data)
{
    // calculates the skew
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^3         //
    //   ---                     //
    //  ----------------         //
    //       n*sigma^3           //
    //
    //
    // The skew will be > 0 for distributions
    // haveing more entries in the tails larger than mean
    // and < 0 for distributions haveing more entries small
    // than mean

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,3);
    }
    Double_t skew=sum/((n)*TMath::Power(sigma,3));
    return  skew;
}
Double_t HTool::skewness(Int_t n, Double_t* data)
{
    // calculates the skew
    //
    //   ---                     //
    //   \                       //
    //   /   ( x-mean)^3         //
    //   ---                     //
    //  ----------------         //
    //       n*sigma^3           //
    //
    //
    // The skew will be > 0 for distributions
    // haveing more entries in the tails larger than mean
    // and < 0 for distributions haveing more entries small
    // than mean

    if(n<1) return -999;

    Double_t mean = TMath::Mean(n,data);
    Double_t sigma= TMath::RMS (n,data);

    Double_t sum=0;
    for(Int_t i=0;i<n;i++){
	sum+= TMath::Power(data[i]-mean,3);
    }
    Double_t skew=sum/((n)*TMath::Power(sigma,3));
    return  skew;
}

Double_t HTool::weightedMean(Int_t n, Short_t* data,Short_t* dataerr)
{
    // calculates the weighted mean
    //
    //   ---                     //
    //   \                       //
    //   /   x/sigma^2           //
    //   ---                     //
    //  ----------------         //
    //   ---                     //
    //   \                       //
    //   /   1/sigma^2           //
    //   ---                     //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]

    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) return sum/sumerr;
    else          return -1;
}
Double_t HTool::weightedMean(Int_t n, Int_t* data,Int_t* dataerr)
{
    // calculates the weighted mean
    //
    //   ---                     //
    //   \                       //
    //   /   x/sigma^2           //
    //   ---                     //
    //  ----------------         //
    //   ---                     //
    //   \                       //
    //   /   1/sigma^2           //
    //   ---                     //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]

    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) return sum/sumerr;
    else          return -1;
}
Double_t HTool::weightedMean(Int_t n, Float_t* data,Float_t* dataerr)
{
    // calculates the weighted mean
    //
    //   ---                     //
    //   \                       //
    //   /   x/sigma^2           //
    //   ---                     //
    //  ----------------         //
    //   ---                     //
    //   \                       //
    //   /   1/sigma^2           //
    //   ---                     //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]

    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) return sum/sumerr;
    else          return -1;
}
Double_t HTool::weightedMean(Int_t n, Double_t* data,Double_t* dataerr)
{
    // calculates the weighted mean
    //
    //   ---                     //
    //   \                       //
    //   /   x/sigma^2           //
    //   ---                     //
    //  ----------------         //
    //   ---                     //
    //   \                       //
    //   /   1/sigma^2           //
    //   ---                     //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]

    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) return sum/sumerr;
    else          return -1;
}
Double_t HTool::weightedSigma(Int_t n,Short_t* dataerr)
{
    // calculates the weighted sigma
    //
    //             1                  //
    //sqrt  ----------------          //
    //        ---                     //
    //        \                       //
    //        /   1/sigma^2           //
    //        ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]

    if(n<1) return -999;


    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
        sumerr+= w;
    }
    if(sumerr!=0) return TMath::Sqrt(1./sumerr);
    else          return -1;
}
Double_t HTool::weightedSigma(Int_t n,Int_t* dataerr)
{
    // calculates the weighted sigma
    //
    //             1                  //
    //sqrt  ----------------          //
    //        ---                     //
    //        \                       //
    //        /   1/sigma^2           //
    //        ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]

    if(n<1) return -999;


    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
        sumerr+= w;
    }
    if(sumerr!=0) return TMath::Sqrt(1./sumerr);
    else          return -1;
}
Double_t HTool::weightedSigma(Int_t n,Float_t* dataerr)
{
    // calculates the weighted sigma
    //
    //             1                  //
    //sqrt  ----------------          //
    //        ---                     //
    //        \                       //
    //        /   1/sigma^2           //
    //        ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]

    if(n<1) return -999;


    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
        sumerr+= w;
    }
    if(sumerr!=0) return TMath::Sqrt(1./sumerr);
    else          return -1;
}
Double_t HTool::weightedSigma(Int_t n,Double_t* dataerr)
{
    // calculates the weighted sigma
    //
    //             1                  //
    //sqrt  ----------------          //
    //        ---                     //
    //        \                       //
    //        /   1/sigma^2           //
    //        ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]

    if(n<1) return -999;


    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
        sumerr+= w;
    }
    if(sumerr!=0) return TMath::Sqrt(1./sumerr);
    else          return -1;
}
Double_t HTool::weightedMeanAndSigma(Int_t n, Short_t* data,Short_t* dataerr, Double_t* mean, Double_t* sigma)
{
    // calculates the weighted mean and sigma
    //
    //         ---                    //
    //         \                      //
    //         /   x/sigma^2          //
    //         ---                    //
    // mean = ----------------        //
    //         ---                    //
    //         \                      //
    //         /   1/sigma^2          //
    //         ---                    //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]
    //
    // and
    //
    //                     1                  //
    //sigma = sqrt  ----------------          //
    //                ---                     //
    //                \                       //
    //                /   1/sigma^2           //
    //                ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]


    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) {
        *sigma=TMath::Sqrt(1./sumerr);
        *mean =sum/sumerr;
	return  0;
    }
    else {

	*sigma=0;
        *mean =0;
     
	return -1;
    }
}
Double_t HTool::weightedMeanAndSigma(Int_t n, Int_t* data,Int_t* dataerr, Double_t* mean, Double_t* sigma)
{
    // calculates the weighted mean and sigma
    //
    //         ---                    //
    //         \                      //
    //         /   x/sigma^2          //
    //         ---                    //
    // mean = ----------------        //
    //         ---                    //
    //         \                      //
    //         /   1/sigma^2          //
    //         ---                    //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]
    //
    // and
    //
    //                     1                  //
    //sigma = sqrt  ----------------          //
    //                ---                     //
    //                \                       //
    //                /   1/sigma^2           //
    //                ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]


    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) {
        *sigma=TMath::Sqrt(1./sumerr);
        *mean =sum/sumerr;
	return  0;
    }
    else {

	*sigma=0;
        *mean =0;
     
	return -1;
    }
}
Double_t HTool::weightedMeanAndSigma(Int_t n, Float_t* data,Float_t* dataerr, Double_t* mean, Double_t* sigma)
{
    // calculates the weighted mean and sigma
    //
    //         ---                    //
    //         \                      //
    //         /   x/sigma^2          //
    //         ---                    //
    // mean = ----------------        //
    //         ---                    //
    //         \                      //
    //         /   1/sigma^2          //
    //         ---                    //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]
    //
    // and
    //
    //                     1                  //
    //sigma = sqrt  ----------------          //
    //                ---                     //
    //                \                       //
    //                /   1/sigma^2           //
    //                ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]


    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) {
        *sigma=TMath::Sqrt(1./sumerr);
        *mean =sum/sumerr;
	return  0;
    }
    else {

	*sigma=0;
        *mean =0;
     
	return -1;
    }
}
Double_t HTool::weightedMeanAndSigma(Int_t n, Double_t* data,Double_t* dataerr, Double_t* mean, Double_t* sigma)
{
    // calculates the weighted mean and sigma
    //
    //         ---                    //
    //         \                      //
    //         /   x/sigma^2          //
    //         ---                    //
    // mean = ----------------        //
    //         ---                    //
    //         \                      //
    //         /   1/sigma^2          //
    //         ---                    //
    //
    // where x are the data points from data[i] and
    // sigma the standard deviations of the points from dataerr[i]
    //
    // and
    //
    //                     1                  //
    //sigma = sqrt  ----------------          //
    //                ---                     //
    //                \                       //
    //                /   1/sigma^2           //
    //                ---                     //
    //
    // where sigma is the standard deviations of the
    // points from dataerr[i]


    if(n<1) return -999;


    Double_t sum   =0;
    Double_t sumerr=0;
    Double_t w     =0;

    for(Int_t i=0;i<n;i++){
        w=1./(dataerr[i]*dataerr[i]);
	sum   += data[i]*w;
        sumerr+= w;
    }
    if(sumerr!=0) {
        *sigma=TMath::Sqrt(1./sumerr);
        *mean =sum/sumerr;
	return  0;
    }
    else {

	*sigma=0;
        *mean =0;
     
	return -1;
    }
}


Double_t HTool::truncatedMean(Int_t n, Short_t* arr, Float_t trunc, Bool_t down, Bool_t overwrite)
{
    // Calculates the truncated mean of array arr with size n. The n * trunc (rounded down)
    // of smallest and largest values are truncated. If overwrite == kTRUE (default) the content
    // of the array will be changed by the sorting (down == kTRUE (default) downwards) otherwise
    // the arry will be unchanged.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    Short_t* ar = 0;

    if(!overwrite){
	ar = new Short_t [n];
	memcpy(ar,arr, n * sizeof(Short_t));
    } else {
	ar = arr;
    }

    HTool::sort(n,ar,0,down,kTRUE);

    Double_t  mean = TMath::Mean(n - 2 * lower,&ar[lower]);

    if(ar && !overwrite) { delete [] ar; }  // delete local array

    return mean;
}

Double_t HTool::truncatedMean(Int_t n, Int_t* arr, Float_t trunc, Bool_t down, Bool_t overwrite)
{
    // Calculates the truncated mean of array arr with size n. The n * trunc (rounded down)
    // of smallest and largest values are truncated. If overwrite == kTRUE (default) the content
    // of the array will be changed by the sorting (down == kTRUE (default) downwards) otherwise
    // the arry will be unchanged.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    Int_t* ar = 0;

    if(!overwrite){
	ar = new Int_t [n];
	memcpy(ar,arr, n * sizeof(Int_t));
    } else {
	ar = arr;
    }

    HTool::sort(n,ar,0,down,kTRUE);

    Double_t  mean = TMath::Mean(n - 2 * lower,&ar[lower]);

    if(ar && !overwrite) { delete [] ar; }  // delete local array

    return mean;
}

Double_t HTool::truncatedMean(Int_t n, Float_t* arr, Float_t trunc, Bool_t down, Bool_t overwrite)
{
    // Calculates the truncated mean of array arr with size n. The n * trunc (rounded down)
    // of smallest and largest values are truncated. If overwrite == kTRUE (default) the content
    // of the array will be changed by the sorting (down == kTRUE (default) downwards) otherwise
    // the arry will be unchanged.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    Float_t* ar = 0;

    if(!overwrite){
	ar = new Float_t [n];
	memcpy(ar,arr, n * sizeof(Float_t));
    } else {
	ar = arr;
    }
    HTool::sort(n,ar,0,down,kTRUE);

    Double_t  mean = TMath::Mean(n - 2 * lower,&ar[lower]);

    if(ar && !overwrite) { delete [] ar; }  // delete local array

    return mean;
}

Double_t HTool::truncatedMean(Int_t n, Double_t* arr, Float_t trunc, Bool_t down, Bool_t overwrite)
{
    // Calculates the truncated mean of array arr with size n. The n * trunc (rounded down)
    // of smallest and largest values are truncated. If overwrite == kTRUE (default) the content
    // of the array will be changed by the sorting (down == kTRUE (default) downwards) otherwise
    // the arry will be unchanged.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    Double_t* ar = 0;

    if(!overwrite){
	ar = new Double_t [n];
	memcpy(ar,arr, n * sizeof(Double_t));
    } else {
	ar = arr;
    }

    HTool::sort(n,ar,0,down,kTRUE);

    Double_t  mean = TMath::Mean(n - 2 * lower,&ar[lower]);

    if(ar && !overwrite) { delete [] ar; }  // delete local array

    return mean;
}

Double_t HTool::truncatedSigma(Int_t n, Short_t* arr, Float_t trunc)
{
    // Calculates the truncated sigma of array arr with size n.
    // The n * trunc (rounded down)
    // of smallest and largest values are truncated.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    return TMath::RMS(n - 2 * lower,&arr[lower]);
}

Double_t HTool::truncatedSigma(Int_t n, Int_t* arr, Float_t trunc)
{
    // Calculates the truncated sigma of array arr with size n.
    // The n * trunc (rounded down)
    // of smallest and largest values are truncated.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    return TMath::RMS(n - 2 * lower,&arr[lower]);
}

Double_t HTool::truncatedSigma(Int_t n, Float_t* arr, Float_t trunc)
{
    // Calculates the truncated sigma of array arr with size n.
    // The n * trunc (rounded down)
    // of smallest and largest values are truncated.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    return TMath::RMS(n - 2 * lower,&arr[lower]);
}

Double_t HTool::truncatedSigma(Int_t n, Double_t* arr, Float_t trunc)
{
    // Calculates the truncated sigma of array arr with size n.
    // The n * trunc (rounded down)
    // of smallest and largest values are truncated.

    Int_t lower = HTool::truncatedIndex(n,trunc);
    if(lower < 0) return -999;

    return TMath::RMS(n - 2 * lower,&arr[lower]);
}


Int_t HTool::truncatedIndex(Int_t n, Float_t trunc)
{
    // calulates the downrounded integer corresponding
    // to n * trunc. Used to calulated the active range of
    // an sorted array for a truncation fraction trunc of
    // the smallest and largest values.

    if(trunc >= 0.5) {
	cout<<"HTool::truncatedIndex() : truncation fraction >= 0.5 not possible!"<<endl;
	return -1;
    }

    // take the next lower index to cut
    Int_t lower = (Int_t) (n*trunc);

    // check if the cuts are inside bounds
    if(lower*2 >= n) lower -= 1;
    if(lower   <  0) lower  = 0;

    return lower;
}

Double_t HTool::chi2DistributionNorm(Double_t *x,Double_t *par)
{

    // Chisquare density distribution for nrFree degrees of freedom
    // normalized by nrFree

    Double_t nrFree = par[0];
    Double_t chi2   =   x[0] * nrFree;

    if (chi2 > 0) {
	Double_t lambda = nrFree / 2.;
	Double_t norm   = TMath::Gamma(lambda) * TMath::Power(2.,lambda);
	return par[1] * nrFree * (TMath::Power(chi2,lambda-1) * TMath::Exp(-0.5 * chi2) / norm);
    } else
	return 0.0;
}

Double_t HTool::chi2Distribution(Double_t *x,Double_t *par)
{

    // Chisquare density distribution for nrFree degrees of freedom

    Double_t nrFree = par[0];
    Double_t chi2   =   x[0];

    if (chi2 > 0) {
	Double_t lambda = nrFree / 2.;
	Double_t norm   = TMath::Gamma(lambda) * TMath::Power(2.,lambda);
	return par[1] * (TMath::Power(chi2,lambda-1) * TMath::Exp(-0.5 * chi2) / norm);
    } else
	return 0.0;
}
TF1* HTool::chi2Distribution(Int_t nDegreeOfFreedom,TString name,Bool_t norm,Double_t scale)
{
    // Return TF1 for Chisquare density distribution for nDegreeOfFreedom
    // degrees of freedom. The distribution will be normalize if norm == kTRUE
    // The function will be named name. The user will be responible of deleting
    // the object after usage. TF1 params : par[0]=nDegreeOfFreedom , par[1]=scale
    // The scale typical should be binwidth*integral of the histogram if the
    // TF1 should be plotted on top

    TF1 *f1=0;
    if(norm) f1 = new TF1(name.Data(),HTool::chi2DistributionNorm,0.01,50,2);
    else     f1 = new TF1(name.Data(),HTool::chi2Distribution    ,0.01,50,2);
    f1->SetParameter(0,Double_t(nDegreeOfFreedom));
    f1->SetParameter(1,Double_t(scale));

    return f1;
}
//--------------------------hists-------------------------
void HTool::roundHist(TH2* h,Int_t ndigit,Int_t ndigiterr)
{
    // Round bin content to ndigit and binerror to ndigterr digits.
    // for ndigit or ndigiterr =-1 the rounding will be skipped for
    // the corresponding value.

    if(!h)
    {
	cout<<"HTool::roundHist(): Zero pointer received!"<<endl;
        exit(1);
    }
    Int_t binx=h->GetNbinsX();
    Int_t biny=h->GetNbinsY();
    Double_t val;
    for(Int_t i=1;i<=binx;i++)
    {
	for(Int_t j=1;j<=biny;j++)
	{
	    if(ndigit!=-1)
	    {
		val=h->GetBinContent(i,j);
		h->SetBinContent(i,j,HTool::roundDigits(val,ndigit));
	    }
	    if(ndigiterr!=-1)
	    {
		val=h->GetBinError(i,j);
		h->SetBinError(i,j,HTool::roundDigits(val,ndigiterr));
	    }
	}
    }
}
TH1* HTool::getHist(TFile* inp,TString name)
{
    // gets histogram with name name from root file
    inp->cd();
    TH1* h=(TH1*)inp->Get(name.Data());
    if(h==0)
    {
        cout<<"getHist(): Hist "<<name.Data()<<" does not exist !"<<endl;
        return h;
    }
    return h;
}
void HTool::smooth(TH1F* h,Int_t ntimes,Int_t firstbin,Int_t lastbin)
{
    // Smooth bin contents of this histogram between firstbin and lastbin.
    // (if firstbin=-1 and lastbin=-1 (default) all bins are smoothed.
    // bin contents are replaced by their smooth values.
    // Errors (if any) are not modified.
    // algorithm can only be applied to 1-d histograms
    // to replace removed function TH1::Smooth)

    if(h==0) return;

    Int_t nbins = h->GetXaxis()->GetNbins();
    if (firstbin < 0) firstbin = 1;
    if (lastbin  < 0) lastbin  = nbins;
    if (lastbin  > nbins+1) lastbin  = nbins;
    nbins = lastbin - firstbin + 1;
    Double_t *XX = new Double_t[nbins];
    Int_t i;
    for (i=0;i<nbins;i++) {
	XX[i] = h->GetBinContent(i+firstbin);
    }

    TH1::SmoothArray(nbins,XX,ntimes);

    for (i=0;i<nbins;i++) {
	h->SetBinContent(i+firstbin,XX[i]);
    }
    delete [] XX;
}

TObjArray* HTool::slices(TH2* h2,TF1* f,TString axis,Int_t firstbin,Int_t lastbin,Int_t cut,TString opt,TString suffix,Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    // calls internal the fitslice of root. Suffix can be added to name of fitted hists.
    // Returns a TObjArray pointer to an array containing the result hists of the fit.
    // Numbering is the same as the the parameters of the fitfunction + chi2 at last place.

    TObjArray* array=0;
    if(h2==0)
    {
        cout<<"Warning: HTool::slices : ZERO pointer retrieved for histogram!"<<endl;
        return array;
    }
    axis.ToLower();
    if     (axis.CompareTo("x")==0) h2->FitSlicesX(f,firstbin,lastbin,cut,opt);
    else if(axis.CompareTo("y")==0) h2->FitSlicesY(f,firstbin,lastbin,cut,opt);
    else
    {
        cout<<"Warning: HTool::slices : Unknown argument for axis : "<<axis.Data()<<"!"<<endl;
        return array;
    }
    Int_t owner=0;
    if(f==0) {f=new TF1("fit","gaus");owner=1;}

    TH1D* h;
    array=new TObjArray(f->GetNpar()+1);
    TString name="";
    name=h2->GetName();
    Char_t histname[300];

    for(Int_t i=0;i<f->GetNpar();i++)
    {
        sprintf(histname,"%s%s%i",name.Data(),"_",i);
        h= (TH1D*)gDirectory->Get(histname);
        if(suffix.CompareTo("")!=0)
        {
            sprintf(histname,"%s%s%s%s%i",name.Data(),"_",suffix.Data(),"_",i);
            h->SetName(histname);
        }
        array->AddAt(h,i);
    }
    sprintf(histname,"%s%s",name.Data(),"_chi2");
    h=(TH1D*)gDirectory->Get(histname);
    if(suffix.CompareTo("")!=0)
    {
        sprintf(histname,"%s%s%s%s",name.Data(),"_",suffix.Data(),"_chi2");
        h->SetName(histname);
    }
    array->AddAt(h,f->GetNpar());

    for(Int_t i=0;i<array->LastIndex()+1;i++)
    {
        h =(TH1D*)array->At(i);
        h->SetLineColor(markercolor);
        h->SetMarkerColor(markercolor);
        h->SetMarkerStyle(markerstyle);
        h->SetMarkerSize(markersize);
    }
    if(owner==1) delete f;
    return array;
}

TObjArray* HTool::projections(TH2* h2,TString axis,Int_t firstbin,Int_t lastbin,Int_t nsteps,TString opt,TString suffix,Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    // calls internal the projections function of the hist.
    // Suffix can be added to name of fitted hists.
    // Returns a TObjArray pointer to an array containing
    // the result hists of the loop of projections.

    TObjArray* array=0;
    if(h2==0)
    {
        cout<<"Warning: HTool::projections : ZERO pointer retrieved for histogram!"<<endl;
        return array;
    }
    axis.ToLower();

    Int_t stepsize;
    Int_t bin1=firstbin,bin2=lastbin;


    Char_t name[300];
    //---------------------defining range----------------------
    if(firstbin==0||lastbin==-1)
    {   // full range
        bin1=1;
        if(axis.CompareTo("x")==0)bin2=h2->GetNbinsY();
        if(axis.CompareTo("y")==0)bin2=h2->GetNbinsX();
    }else
    {   // part of range
        bin1 = firstbin;
        bin2 = lastbin;
    }
    array=new TObjArray(0);
    //---------------------defining stepsize--------------------
    if(nsteps==-99)stepsize = 1;
    else           stepsize = nsteps;

    //---------------------projecting---------------------------
    for(Int_t i=bin1;i<bin2+1;i+=stepsize)
    {
        if  (axis.CompareTo("x")==0){
            if(suffix.CompareTo("")==0)sprintf(name,"%s%s%i"    ,h2->GetName(),"_px_",i);
            else                       sprintf(name,"%s%s%s%s%i",h2->GetName(),"_",suffix.Data(),"_px_",i);
            array->AddLast(h2->ProjectionX(name,i,i+stepsize-1,opt)); }
        else if(axis.CompareTo("y")==0){
            if(suffix.CompareTo("")==0)sprintf(name,"%s%s%i"    ,h2->GetName(),"_py_",i);
            else                       sprintf(name,"%s%s%s%s%i",h2->GetName(),"_",suffix.Data(),"_py_",i);
            array->AddLast(h2->ProjectionY(name,i,i+stepsize-1,opt)); }
       else{
            cout<<"Warning: HTool::slices : Unknown argument for axis : "<<axis.Data()<<"!"<<endl;
            return array;
        }
    }

    //---------------------setting attributes-------------------
    array->Expand(array->GetLast()+1);
    cout<<"number of hists "<<array->LastIndex()+1<<endl;
    for(Int_t i=0;i<array->LastIndex()+1;i++)
    {
        ((TH1D*)array->At(i))->SetLineColor(markercolor);
        ((TH1D*)array->At(i))->SetMarkerColor(markercolor);
        ((TH1D*)array->At(i))->SetMarkerStyle(markerstyle);
        ((TH1D*)array->At(i))->SetMarkerSize(markersize);
    }
    return array;
}
TObjArray*  HTool::fitArray(TObjArray* array,TF1* fit,TString name,Float_t min,Float_t max,Int_t opt,Float_t x1,Float_t x2,Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    // Applies fit fit to all hists in array. The result of the fit
    // will be returned in a TObjArray which contains hists for all parameters
    // from fit (with corresponding errors set). The number of hists is equal npar+1.
    // The ordering inside the array starts from par0 to parN and the last hist
    // will contain the chi2. The number of bins in the hists will be equal to the
    // the number of fitted hists. The range of the result hists can be set via
    // min and max. If these values ar not specified the range will be 0-1.
    // If opt=1 fit will use range x1 x2 arround max of hists
    if(array==0){
	cout<<"HTool::fitArray(): array pointer =0!"<<endl;
	return 0;
    }
    if(fit  ==0){
	cout<<"HTool::fitArray(): fit pointer =0!"<<endl;
	return 0;
    }
    if(name.CompareTo("")==0) {
	cout<<"HTool::fitArray(): no name for hists specified!"<<endl;
	return 0;}

    Int_t size       =array->GetEntries();
    Int_t nPars      =fit->GetNpar();
    TObjArray* result=new TObjArray(nPars+1);
    TH1D* htmp=0;
    TString myname=name;

    Int_t nbinsx=size;
    Float_t xmin,xmax;

    if(min==0&&max==0)
    {
	xmin=0.;
	xmax=1.;
    }
    else
    {
 	xmin=min;
	xmax=max;
    }

    for(Int_t i=0;i<nPars+1;i++)
    {
        myname=name;
	if(i!=nPars){
	    myname+="_par";
            myname+=i;
	}
	else
	{
           myname+="_chi2";
	}
	htmp=new TH1D(myname,myname,nbinsx,xmin,xmax);
	htmp->SetLineColor(1);
	htmp->SetMarkerColor(markercolor);
        htmp->SetMarkerStyle(markerstyle);
        htmp->SetMarkerSize (markersize);
	result->AddAt(htmp,i);
    }
    Double_t val=0,valerr=0;
    for(Int_t j=0;j<size;j++)
    {
       TH1* h=(TH1*)array->At(j);
       if(opt==1)
       {
          Float_t mean=h->GetXaxis()->GetBinCenter(h->GetMaximumBin());
          fit->SetRange(mean-x1,mean+x2);
       }

       h->Fit(fit,"QNR");

       if(h->Integral()>2)
       {
	   for(Int_t i=0;i<nPars;i++)
	   {
               htmp=(TH1D*)result->At(i);
	       val   =fit->GetParameter(i);
               valerr=fit->GetParError (i);

	       if(finite(val)   !=0&&
                  finite(valerr)!=0)
	       {
		   htmp->SetBinContent(j+1,val);
		   htmp->SetBinError  (j+1,valerr);
	       }
	   }
	   val=fit->GetChisquare();
	   if(finite(val)!=0)
	   {
	       ((TH1*)result->At(nPars))->SetBinContent(j+1,val);
	   }
       }
    }

    return result;
}
TH1D*  HTool::projectY(TH1* h,Int_t xbin1,Int_t xbin2,TString suff,
                       Int_t ybin,Float_t ymin,Float_t ymax,
                       Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    if(h==0)
    {
        cout<<"HTool::projectY(): ZERO pointer for hists received!"<<endl;
        return 0;
    }
    TString name ="";
    name=h->GetName();

    TString title="";

    if(suff.CompareTo("")==0) name+="_projY";
    else                      name+=suff;

    if(ybin==0||(ymin==ymax))
    {
        ymin=h->GetMinimum();
        ymax=h->GetMaximum();
        ybin=100;
    }

    if(xbin1<1 )xbin1=1;
    if(xbin2>h->GetNbinsX())xbin2=h->GetNbinsX();

    if(xbin2==0)xbin2=h->GetNbinsX();

    TH1D* hproj=new TH1D(name,title,ybin,ymin,ymax);
    hproj->SetMarkerStyle(markerstyle);
    hproj->SetMarkerColor(markercolor);
    hproj->SetMarkerSize(markersize);
    hproj->SetLineColor(markercolor);
    hproj->SetXTitle(h->GetXaxis()->GetTitle());

    for(Int_t i=xbin1;i<=xbin2;i++)
    {
        hproj->Fill(h->GetBinContent(i));
    }
    return hproj;
}
TGraphErrors* HTool::fitScatter(TH2* h,TF1* f,
				TString opt,
                                Bool_t silent,
				Float_t xmin,Float_t xmax,
				Float_t ymin,Float_t ymax,
				Float_t window,Bool_t clean)
{
    // Fits h with TF1 f. Convert the hist to TGraphErrors
    // first and than perfom the fit on the graph.
    // With xmin/xmax/ymin,ymax a region can be selected.
    // If window is !=0 the graph is fitted with f and
    // in an second iteration the graph is rebuild to just
    // contain values inside the window arround f. If clean
    // is true all values of the hist arround the window of
    // f are set to 0. String opt are options for the Fit.
    // silent=kTRUE switches the prints off.

    if(h==0) return 0;
    if(f==0) return 0;

    Bool_t quiet=silent;
    if(!quiet)
    {
	cout<<"----------------------------------------------------"<<endl;
	cout<<"HTool:fitScatter(): fitting "<<h->GetName()<<endl;
	cout<<"----------------------------------------------------"<<endl;
    }
    Bool_t usewindow=kFALSE;
    if(window!=0)usewindow=kTRUE;

    Int_t nbinsx=h->GetNbinsX();
    Int_t nbinsy=h->GetNbinsY();

    Bool_t windowx=kFALSE;
    if(xmin!=0||xmax!=0) windowx=kTRUE;
    Bool_t windowy=kFALSE;
    if(ymin!=0||ymax!=0) windowy=kTRUE;

    TString name=h->GetName();
    name+="_gFit";

    TGraphErrors* g=0;
    g=new TGraphErrors();
    g->SetName(name.Data());

    Double_t max=h->GetMaximum();
    if(max==0) {
        delete g;
	return 0;
    }
    Int_t ctpoint=0;
    Double_t x,y,val,err;
    for(Int_t i=1;i<=nbinsx;i++){
        x=h->GetXaxis()->GetBinCenter(i);
        if(windowx) { if(x<xmin||x>xmax) continue;}
        for(Int_t j=1;j<=nbinsy;j++){
            y=h->GetYaxis()->GetBinCenter(j);
            if(windowy) { if(y<ymin||y>ymax) continue;}
            val=h->GetBinContent(i,j);
            if(val==0)continue;
            g->SetPoint(ctpoint,x,y);
            err=h->GetBinError(i,j);
            if(err==0) err=1e-10;
	    g->SetPointError(ctpoint,err,err);
            ctpoint++;
        }
    }
    if(!quiet)
    {
	cout<<"----------------------------------------------------"<<endl;
	cout<<"before cleaning:"<<endl;
	cout<<"----------------------------------------------------"<<endl;
    }
    g->Fit(f,opt.Data());
    if(usewindow)
    {
	if(!quiet)
	{
	    cout<<"----------------------------------------------------"<<endl;
	    cout<<"chi2   f : "<<f->GetChisquare()<<endl;
	    cout<<"----------------------------------------------------"<<endl;
	}
    }
    if(usewindow) delete g;

    if(usewindow)
    {
        g=new TGraphErrors();
        g->SetName(name.Data());
        Double_t ref;
        ctpoint=0;
        for(Int_t i=1;i<=nbinsx;i++){
            x=h->GetXaxis()->GetBinCenter(i);
            if(windowx) { if(x<xmin||x>xmax) continue;}
            for(Int_t j=1;j<=nbinsy;j++){
                y=h->GetYaxis()->GetBinCenter(j);
                if(windowy) { if(y<ymin||y>ymax) continue;}
                ref=f->Eval(x);
                if(y<ref-window||y>ref+window) { continue; }
                val=h->GetBinContent(i,j);
                if(val==0)continue;
                g->SetPoint(ctpoint,x,y);
		err=h->GetBinError(i,j);
                if(err==0) err=1e-10;
                g->SetPointError(ctpoint,0.,err);
                ctpoint++;
            }
        }
	if(!quiet)
	{
	    cout<<"----------------------------------------------------"<<endl;
	    cout<<"after cleaning:"<<endl;
	    cout<<"----------------------------------------------------"<<endl;
	}
	g->Fit(f,opt.Data());
        g->Print();

        //delete g;
    }
    if(clean)
    {
        Double_t ref;
        for(Int_t i=1;i<=nbinsx;i++)
        {
            x=h->GetXaxis()->GetBinCenter(i);
            for(Int_t j=1;j<=nbinsy;j++){
                y=h->GetYaxis()->GetBinCenter(j);
                ref=f->Eval(x);
                if(y<ref-window||y>ref+window)
                {
                    h->SetBinContent(i,j,0);
                    h->SetBinError(i,j,0);
                    continue;
                }
            }
        }
    }
    if(!quiet)
    {
	cout<<"----------------------------------------------------"<<endl;
	cout<<"Number of Points: "<<ctpoint<<endl;
	cout<<"window x : "<<xmin<<" , "<<xmax<<endl;
	cout<<"window y : "<<ymin<<" , "<<ymax<<endl;
	cout<<"window f : "<<window<<endl;
	cout<<"chi2   f : "<<f->GetChisquare()<<endl;
	cout<<"----------------------------------------------------"<<endl;
    }

    return g;
}
/*
TH1* HTool::removeEnds(const TH1* h,Int_t first,Int_t last,TString newname)
{
    // removes bins from start to first and from last to end
    // (first and last are kept). returns hist with name newname
    if(h==0)
    {
        cout<<"Error in HTool::removeEnds(): receiving zero pointer"<<endl;
        return 0;
    }
    if(newname.CompareTo("")==0)
    {
        newname =h->GetName();
        newname+="_remove";
    }
    if(last<0)last= h->GetNbinsX();
    TString classname=h->ClassName();
    TH1* hnew=0;
    if(classname.CompareTo("TH1I")==0)hnew=(TH1*)new TH1I(*(TH1I*)(h));
    if(classname.CompareTo("TH1S")==0)hnew=(TH1*)new TH1S(*(TH1S*)(h));
    if(classname.CompareTo("TH1F")==0)hnew=(TH1*)new TH1F(*(TH1F*)(h));
    if(classname.CompareTo("TH1D")==0)hnew=(TH1*)new TH1D(*(TH1D*)(h));
    if(classname.CompareTo("TProfile")==0)hnew=(TH1*)new TProfile(*(TProfile*)(h));
    if(hnew==0)
    {
        hnew->SetName(newname);
        hnew->SetBins(h->GetNbinsX()-(first-1)-last,h->GetXaxis()->GetBinLowEdge(first),h->GetXaxis()->GetBinUpEdge(last));
        for(Int_t i=1;i<=hnew->GetNbinsX();i++)
        {
            hnew->SetBinContent(i,h->GetBinContent(i,(first-1)+1));
            hnew->SetBinError(i,h->GetBinError(i,(first-1)+1));
        }
    }else cout<<"Error in HTool::removeEnds(): receiving zero pointer"<<endl;
    return hnew;
}*/
Int_t HTool::removeEnds(TH1* h,Int_t first,Int_t last)
{
    // removes bins from start to first and from last to end
    // (first and last are kept). returns hist with name newname

    cout<<"HTool::removeEnds():removing bins outside from first "<<first<<" last "<<last<<endl;
    if(h==0)
    {
        cout<<"Error in HTool::removeEnds(): receiving zero pointer"<<endl;
        return 0;
    }
    cout<<"test1"<<endl;
    TString newname =h->GetName();
    newname+="_remove";

    if(last<0)last= h->GetNbinsX();
    TString classname=h->ClassName();
    TH1* hnew=0;
    //if(classname.CompareTo("TH1I")==0)hnew=(TH1*)new TH1I(*(const TH1I*)(h));
    //if(classname.CompareTo("TH1S")==0)hnew=(TH1*)new TH1S(*(const TH1S*)(h));
    //if(classname.CompareTo("TH1F")==0)hnew=(TH1*)new TH1F(*(const TH1F*)(h));
    //if(classname.CompareTo("TH1D")==0)hnew=(TH1*)new TH1D(*(const TH1D*)(h));
    //if(classname.CompareTo("TProfile")==0)hnew=(TH1*)new TProfile(*(const TProfile*)(h));
    cout<<classname<<endl;
    const TH1D* hdummy=(TH1D*)h;
    hnew=new TH1D(*hdummy);
    hnew->Dump();


    cout<<"test2"<<endl;

    if(hnew==0)
    {
        hnew->SetName(newname);
        h->SetBins(hnew->GetNbinsX()-(first-1)-last,hnew->GetXaxis()->GetBinLowEdge(first),hnew->GetXaxis()->GetBinUpEdge(last));
        for(Int_t i=1;i<=h->GetNbinsX();i++)
        {
            h->SetBinContent(i,hnew->GetBinContent(i,(first-1)+1));
            h->SetBinError(i,hnew->GetBinError(i,(first-1)+1));
        }
    }else cout<<"Error in HTool::removeEnds(): receiving zero pointer"<<endl;
    cout<<"test3"<<endl;
    if(hnew) delete hnew;
    return 0;
}
Int_t HTool::findFilledRange(TH1* h,Int_t& first,Int_t& last)
{
    // find first bins and last filled bins

    if(h==0)
    {
        cout<<"Error in HTool::findFilledRange(): receiving zero pointer"<<endl;
        return 0;
    }
    Int_t nbins= h->GetNbinsX();
    Int_t f,l;
    f=0;
    l=0;
    first=0;
    last=nbins;
    for(Int_t i=1;i<=nbins;i++)
    {
       if(f==0 && h->GetBinContent(i)==0) first=i+1;
       else       f++;

       if(l==0 && h->GetBinContent(nbins-i)==0) last=nbins-i-1;
       else       l++;

       if(l>0&&f>0) return 0;
    }
    return 0;
}
void HTool::cleanHist(TH1* h,Double_t threshold,Double_t val)
{
    // clean hist if bincontent is below a certain value (threshold):
    // The bin content is replaced by val.

    if(h!=0)
    {
        TString classname=h->ClassName();
        Int_t type=0;

        if(classname.Contains("TH1")==1)type=1;
        if(classname.Contains("TH2")==1)type=2;

        Int_t binsX=0,binsY=0;

        binsX=h->GetNbinsX();
        if(type==2)binsY=h->GetNbinsY();

        Double_t bincontent;

        if(type==1)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                bincontent= h->GetBinContent(x+1);
		if(bincontent<threshold){
		    h->SetBinContent(x+1,val);
		}
	    }
        }
        if(type==2)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                for(Int_t y=0;y<=binsY;y++){
                    bincontent= h->GetBinContent(x+1,y+1);
		    if(bincontent<threshold){
			h->SetBinContent(x+1,y+1,val);
		    }
		}
            }
        }
    }
    else
    {
        cout<<"Warning: HTool::cleanHist : ZERO pointer for hist recieved!"<<endl;
    }
}
void HTool::resetHist(TH1* h,Float_t val,Float_t valerr)
{
    // reset hist with val for content and valerr for errors
    // (if this values not equal -99).


    if(h!=0)
    {
        TString classname=h->ClassName();
        Int_t type=0;

        if(classname.Contains("TH1")==1)type=1;
        if(classname.Contains("TH2")==1)type=2;

        Int_t binsX=0,binsY=0;

        binsX=h->GetNbinsX();
        if(type==2)binsY=h->GetNbinsY();

        if(type==1)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                if(val!=-99)   h->SetBinContent(x+1,val);
                if(valerr!=-99)h->SetBinError  (x+1,valerr);
            }
        }
        if(type==2)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                for(Int_t y=0;y<binsY;y++){
                    if(val!=-99)   h->SetBinContent(x+1,y+1,val);
                    if(valerr!=-99)h->SetBinError  (x+1,y+1,valerr);
                }
            }
        }
    }
    else
    {
        cout<<"Warning: HTool::resetHist : ZERO pointer for hist recieved!"<<endl;
    }
}
TH1* HTool::copyHist(TH1* h,TString name,Int_t val,Int_t valerr)
{
    // copy old hist into new one. You can decide to copy content of hist (val!=-99) and
    // errors (valerr!=-99). Combinations are possible.
    // if no new name is specified, _copy is appended to old name.

    TH1* hcp=0;
    if(h!=0)
    {
        TString classname=h->ClassName();
        TString myhistname="";
        Int_t type=0;

        if(classname.Contains("TH1")==1)type=1;
        if(classname.Contains("TH2")==1)type=2;
        if(classname.Contains("TProfile")==1)type=1;

        if(name.CompareTo("")==0)
        {   // if no new name, add _copy to old name
            myhistname=h->GetName();
            myhistname+=myhistname + "_copy";
        }
	else
	{
	   myhistname=name;
	}

        Int_t binsX=0,binsY=0;

        binsX=h->GetNbinsX();
        if(type==2)binsY=h->GetNbinsY();

        if(classname.Contains("TH1S")==1)hcp=new TH1S(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax());
        //if(classname.Contains("TH1I")==1)hcp=new TH1I(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax());
        if(classname.Contains("TH1F")==1)hcp=new TH1F(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax());
        if(classname.Contains("TH1D")==1)hcp=new TH1D(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax());
        if(classname.Contains("TProfile")==1)hcp=new TH1D(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax());

        if(classname.Contains("TH2S")==1)hcp=new TH2S(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax(),binsY,h->GetYaxis()->GetXmin(),h->GetYaxis()->GetXmax());
        //if(classname.Contains("TH2I")==1)hcp=new TH2I(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax(),binsY,h->GetYaxis()->GetXmin(),h->GetYaxis()->GetXmax());
        if(classname.Contains("TH2F")==1)hcp=new TH2F(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax(),binsY,h->GetYaxis()->GetXmin(),h->GetYaxis()->GetXmax());
        if(classname.Contains("TH2D")==1)hcp=new TH2D(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax(),binsY,h->GetYaxis()->GetXmin(),h->GetYaxis()->GetXmax());

        hcp->SetXTitle(h->GetXaxis()->GetTitle());
        hcp->SetYTitle(h->GetYaxis()->GetTitle());
        hcp->SetOption(hcp->GetOption());

        hcp->SetFillColor(hcp->GetFillColor());
        hcp->SetFillStyle(hcp->GetFillStyle());

        hcp->SetLineColor(hcp->GetLineColor());
        hcp->SetLineStyle(hcp->GetLineStyle());
        hcp->SetLineWidth(hcp->GetLineWidth());

        hcp->SetMarkerColor(hcp->GetMarkerColor());
        hcp->SetMarkerStyle(hcp->GetMarkerStyle());
        hcp->SetMarkerSize(hcp->GetMarkerSize());

        if(type==2)
        {
            hcp->SetZTitle(h->GetZaxis()->GetTitle());
        }

        if(type==1)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                if(val!=-99)   hcp->SetBinContent(x+1,h->GetBinContent(x+1));
                if(valerr!=-99)hcp->SetBinError  (x+1,h->GetBinError(x+1));
            }
        }
        if(type==2)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                for(Int_t y=0;y<=binsY;y++){
                    if(val!=-99)   hcp->SetBinContent(x+1,y+1,h->GetBinContent(x+1,y+1));
                    if(valerr!=-99)hcp->SetBinError  (x+1,y+1,h->GetBinError(x+1,y+1));
                }
            }
        }
    }
    else
    {
        cout<<"Warning: HTool::copyHist : ZERO pointer for hist recieved!"<<endl;
    }
    return hcp;
}
TH1* HTool::copyHistRange(TH1* h,TString name,Int_t val,Int_t valerr,Int_t start,Int_t end)
{
  // copy old hist into new one. You can decide to copy content of hist (val!=-99) and
  // errors (valerr!=-99). Combinations are possible.
  // if no new name is specified, _copy is appended to old name.
  // Copy is done in range from start to end. If end = -99, Full histogram is copied.

  TH1* hcp=0;
  if(h!=0)
    {
      TString classname=h->ClassName();
      TString myhistname="";
      Int_t type=0;

      if(classname.Contains("TH1")==1)type=1;
      if(classname.Contains("TH2")==1)type=2;
      if(classname.Contains("TProfile")==1)type=1;

      if(name.CompareTo("")==0)
        {   // if no new name, add _copy to old name
	  myhistname=h->GetName();
	  myhistname+=myhistname + "_copy";
        }
      else
	{
	  myhistname = name;
	}

      Int_t binsX=0,binsY=0;

      if(end!=-99)
	{
	  binsX = end - start;
	}
      else
	{
	  binsX = h->GetNbinsX() - start;
	  end = h->GetNbinsX();
	}
      if(type==2)binsY=h->GetNbinsY();

      if(classname.Contains("TH1S")==1)hcp=new TH1S(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetBinLowEdge(start),h->GetXaxis()->GetBinLowEdge(end));
      //if(classname.Contains("TH1I")==1)hcp=new TH1I(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax());
      if(classname.Contains("TH1F")==1)hcp=new TH1F(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetBinLowEdge(start),h->GetXaxis()->GetBinLowEdge(end));
      if(classname.Contains("TH1D")==1)hcp=new TH1D(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetBinLowEdge(start),h->GetXaxis()->GetBinLowEdge(end));
      if(classname.Contains("TProfile")==1)hcp=new TH1D(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetBinLowEdge(start),h->GetXaxis()->GetBinLowEdge(end));

      if(classname.Contains("TH2S")==1)hcp=new TH2S(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetBinLowEdge(start),binsY,h->GetYaxis()->GetBinLowEdge(end),h->GetYaxis()->GetXmax());
      //if(classname.Contains("TH2I")==1)hcp=new TH2I(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax(),binsY,h->GetYaxis()->GetXmin(),h->GetYaxis()->GetXmax());
      if(classname.Contains("TH2F")==1)hcp=new TH2F(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetBinLowEdge(start),binsY,h->GetYaxis()->GetBinLowEdge(end),h->GetYaxis()->GetXmax());
      if(classname.Contains("TH2D")==1)hcp=new TH2D(myhistname.Data(),h->GetTitle(),binsX,h->GetXaxis()->GetBinLowEdge(start),h->GetXaxis()->GetBinLowEdge(end),binsY,h->GetYaxis()->GetXmin(),h->GetYaxis()->GetXmax());

      hcp->SetXTitle(h->GetXaxis()->GetTitle());
      hcp->SetYTitle(h->GetYaxis()->GetTitle());
      hcp->SetOption(hcp->GetOption());

      hcp->SetFillColor(hcp->GetFillColor());
      hcp->SetFillStyle(hcp->GetFillStyle());

      hcp->SetLineColor(hcp->GetLineColor());
      hcp->SetLineStyle(hcp->GetLineStyle());
      hcp->SetLineWidth(hcp->GetLineWidth());

      hcp->SetMarkerColor(hcp->GetMarkerColor());
      hcp->SetMarkerStyle(hcp->GetMarkerStyle());
      hcp->SetMarkerSize(hcp->GetMarkerSize());

      if(type==2)
        {
	  hcp->SetZTitle(h->GetZaxis()->GetTitle());
        }

      if(type==1)
        {
	  for(Int_t x=start;x<=end;x++)
            {
	      if(val!=-99)   hcp->SetBinContent(x+1,h->GetBinContent(x+1));
	      if(valerr!=-99)hcp->SetBinError  (x+1,h->GetBinError(x+1));
            }
        }
      if(type==2)
        {
	  for(Int_t x=start;x<=end;x++)
            {
	      for(Int_t y=0;y<=binsY;y++){
		if(val!=-99)   hcp->SetBinContent(x+1,y+1,h->GetBinContent(x+1,y+1));
		if(valerr!=-99)hcp->SetBinError  (x+1,y+1,h->GetBinError(x+1,y+1));
	      }
            }
        }
    }
  else
    {
      cout<<"Warning: HTool::copyHist : ZERO pointer for hist recieved!"<<endl;
    }
  return hcp;
}
TF1* HTool::cleanHistBelowLine(TH2* h,TF1* f,TString axis,Int_t firstbin,Int_t lastbin,Int_t cut,TString opt,TString suffix,
                               TString optline,Float_t windowfunc)
{
    // beforms slices HTool::operation and fits the result with a line
    // Resets the bins blow line equation - windowfunc to 0.

    TObjArray* array =HTool::slices(h,f,axis,firstbin,lastbin,cut,opt,suffix,8,2,0.7);
    TH1D* h1=(TH1D*)array->At(1);

    TF1* fit=new TF1("tempfit",optline.Data());
    h1->Fit(fit,"QN");


    Int_t nbinsX=h->GetNbinsX();
    Int_t nbinsY=h->GetNbinsY();
    Float_t lowedgeY;
    Float_t myY;
    for(Int_t i=0;i<=nbinsX;i++)
    {
        lowedgeY=fit->Eval(h->GetBinCenter(i+1))-windowfunc;
        for(Int_t j=0;j<=nbinsY;j++)
        {
           myY=h->GetYaxis()->GetBinCenter(j+1);
           if(myY<lowedgeY)
           {
               h->SetBinContent(i+1,j+1,0);
               h->SetBinError(i+1,j+1,0);
           }
        }
    }
    array->Delete();
    delete array;
    return fit;
}

TF1* HTool::cleanHistArroundLine(TH2* h,TF1* f,TString axis,Int_t firstbin,Int_t lastbin,Int_t cut,TString opt,TString suffix,
                               TString optline,Float_t windowfunc,Float_t windowfunc2)
{
    // beforms slices HTool::operation and fits the result with a line
    // Resets the bins arround line equation +- windowfunc to 0.

    TObjArray* array =HTool::slices(h,f,axis,firstbin,lastbin,cut,opt,suffix,8,2,0.7);
    TH1D* h1=(TH1D*)array->At(1);

    TF1* fit=new TF1("tempfit",optline.Data());
    h1->Fit(fit,"QN");


    Int_t nbinsX=h->GetNbinsX();
    Int_t nbinsY=h->GetNbinsY();
    Float_t lowedgeY;
    Float_t upedgeY;
    Float_t myY;
    for(Int_t i=0;i<=nbinsX;i++)
    {
        lowedgeY=fit->Eval(h->GetBinCenter(i+1))-windowfunc;
        upedgeY =fit->Eval(h->GetBinCenter(i+1))+windowfunc2;
        for(Int_t j=0;j<=nbinsY;j++)
        {
           myY=h->GetYaxis()->GetBinCenter(j+1);
           if(myY<lowedgeY||myY>upedgeY)
           {
               h->SetBinContent(i+1,j+1,0);
               h->SetBinError(i+1,j+1,0);
           }
        }
    }
    array->Delete();
    delete array;
    return fit;
}
Bool_t  HTool::cleanHistCutG(TH2* h,TCutG* cut)
{
    // puts all bins outside the cut to 0.
    if(!h || !cut)
    {
        cout<<"HTool::cleanHistCutG():ZERO POINTER!"<<endl;
        return kFALSE;
    }

    Int_t nBinsX=h->GetNbinsX();
    Int_t nBinsY=h->GetNbinsY();
    Float_t x,y;

    for(Int_t i=0;i<=nBinsX;i++){
        x=h->GetXaxis()->GetBinCenter(i+1);
        for(Int_t j=0;j<=nBinsY;j++){
            y=h->GetYaxis()->GetBinCenter(j+1);

	    if(cut->IsInside(x,y)==0)
	    {
		h->SetBinContent(i+1,j+1,0);
	    }
	}
    }
    return kTRUE;
}

void HTool::setHistErrors(TH1* h,TH1* h2)
{
    // sets bincontent of hist h2 as errors of h

    if(h!=0&&h2!=0)
    {
        TString classname=h->ClassName();
        Int_t type=0;

        if(classname.Contains("TH1")==1)type=1;
        if(classname.Contains("TH2")==1)type=2;

        Int_t binsX=0,binsY=0;

        binsX=h->GetNbinsX();
        if(type==2)binsY=h->GetNbinsY();

        Double_t bincontent;

        if(type==1)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                bincontent= h2->GetBinContent(x+1);
                h->SetBinError(x+1,bincontent);
            }
        }
        if(type==2)
        {
            for(Int_t x=0;x<=binsX;x++)
            {
                for(Int_t y=0;y<=binsY;y++){
                    bincontent= h2->GetBinContent(x+1,y+1);
                    h->SetBinError(x+1,y+1,bincontent);
                }
            }
        }
    }
    else
    {
        cout<<"Warning: HTool::cleanHist : ZERO pointer for hist recieved!"<<endl;
    }
}
Double_t HTool::getMaxHistArray(TH1** h,Int_t size,Int_t& index)
{
    // Finds maximum of all hists in TH1* array of size size.
    // return max and the index of the hist inside the array
    // which has the highest max.
    if(size==0)
    {
        cout<<"HTool::getMaxHistArray()::Size of Array is ZERO!"<<endl;
        return 0;
    }
    Double_t max[size];

    for(Int_t i=0;i<size;i++){
       max[i]=h[i]->GetMaximum();
    }
    Int_t maxindex= TMath::LocMax(size,max);
    index=maxindex;
    return max[maxindex];
}
Double_t HTool::getMinHistArray(TH1** h,Int_t size,Int_t& index)
{
    // Finds minimum of all hists in TH1* array of size size.
    // return min and the index of the hist inside the array
    // which has the lowest min.
    if(size==0)
    {
        cout<<"HTool::getMaxHistArray()::Size of Array is ZERO!"<<endl;
        return 0;
    }
    Double_t min[size];

    for(Int_t i=0;i<size;i++){
       min[i]=h[i]->GetMinimum();
    }
    Int_t minindex= TMath::LocMin(size,min);
    index=minindex;
    return min[minindex];
}
TH2* HTool::reBin(TH2* h2,Int_t groupX,Int_t groupY,TString newname)
{
    // Rebins h2 with groups of groupX and groupY. The new created
    // hist with name newname (if specified) or oldname_rebin will
    // be returned.

    TH2* result=0;
    if(h2==0) return result;
    TString myname="";
    if(newname.CompareTo("")==0)
    { // default
	myname=h2->GetName();
	myname+="_rebin";
    } else
    {
	myname=newname;
    }

    if(groupX!=0&&groupY!=0)
    {
	result=(TH2*)h2->Clone(myname.Data());

        Int_t nbinsx=h2->GetNbinsX();
        Int_t nbinsy=h2->GetNbinsY();
        Float_t xmin=h2->GetXaxis()->GetXmin();
        Float_t xmax=h2->GetXaxis()->GetXmax();
        Float_t ymin=h2->GetYaxis()->GetXmin();
        Float_t ymax=h2->GetYaxis()->GetXmax();

	Int_t nbinsX=0;
        Int_t nbinsY=0;

	if(nbinsx%groupX!=0)
	{
	    nbinsX=(Int_t)(nbinsx/groupX)+1;
	}
	else
	{
           nbinsX=nbinsx/groupX;
	}
	if(nbinsy%groupY!=0)
	{
	    nbinsY=(Int_t)(nbinsy/groupY)+1;
	}
	else
	{
           nbinsY=nbinsy/groupY;
	}

	result->SetBins(nbinsX,xmin,xmax,nbinsY,ymin,ymax);
	result->Reset();
    }
    else
    {
	cout<<"HTool::reBin(): groupX or groupY =0!!!"<<endl;
        return 0;
    }
    cout<<"Rebin:"<<endl;
	cout<<"from :"<<h2->GetNbinsX()<<" "
        <<h2->GetXaxis()->GetXmin()<<" "
        <<h2->GetXaxis()->GetXmax()<<" "
        <<h2->GetNbinsY()<<" "
        <<h2->GetYaxis()->GetXmin()<<" "
        <<h2->GetYaxis()->GetXmax()<<endl;
    cout<<"to   :"<<result->GetNbinsX()<<" "
        <<result->GetXaxis()->GetXmin()<<" "
        <<result->GetXaxis()->GetXmax()<<" "
        <<result->GetNbinsY()<<" "
        <<result->GetYaxis()->GetXmin()<<" "
        <<result->GetYaxis()->GetXmax()<<endl;

    Int_t nBinsX=h2->GetNbinsX();
    Int_t nBinsY=h2->GetNbinsY();
    Float_t x,y;


    for(Int_t i=1;i<=nBinsX;i++){
	for(Int_t j=1;j<=nBinsY;j++){
            x=h2->GetXaxis()->GetBinCenter(i);
            y=h2->GetYaxis()->GetBinCenter(j);

	    result->Fill(x,y,h2->GetBinContent(i,j));

	}
    }
    return result;
}
TH2* HTool::exchangeXY(TH2* h2,TString newname)
{
    // creates new hist with name newname (if specified)
    // or oldname_exchangeXY with exchanged
    // x- and y-axis

    TH2* result=0;
    if(h2==0) return result;
    TString myname="";
    if(newname.CompareTo("")==0)
    { // default
	myname=h2->GetName();
	myname+="_exchangeXY";
    } else
    {
	myname=newname;
    }
    Int_t nbinsx=h2->GetNbinsX();
    Int_t nbinsy=h2->GetNbinsY();
    Float_t xmin=h2->GetXaxis()->GetXmin();
    Float_t xmax=h2->GetXaxis()->GetXmax();
    Float_t ymin=h2->GetYaxis()->GetXmin();
    Float_t ymax=h2->GetYaxis()->GetXmax();

    result=(TH2*)h2->Clone(myname.Data());
    result->SetBins(nbinsy,ymin,ymax,nbinsx,xmin,xmax);

    for(Int_t i=0;i<=nbinsx;i++){
	for(Int_t j=0;j<=nbinsy;j++){

            result->SetBinContent(j+1,i+1,h2->GetBinContent(i+1,j+1));
	    result->SetBinError  (j+1,i+1,h2->GetBinError(i+1,j+1));
        }
    }
    return result;

}
Bool_t HTool::flipAxis(TH2* h2,TString opt)
{
    // flips x or y axis or both depending on opt (x,y,xy)

    if(h2==0) return kFALSE;
    opt.ToLower();
    Int_t ax=0;
    if(opt.CompareTo("x")==0)
    {
        ax=0;
    }
    else if(opt.CompareTo("y")==0)
    {
      ax=1;
    }
    else if(opt.CompareTo("xy")==0)
    {
      ax=2;
    }
    else
    {
        cout<<"HTool::flipAxis():Unknown opt "<<opt.Data()<<"!"<<endl;
        return kFALSE;
    }
    Int_t nbinsx=h2->GetNbinsX();
    Int_t nbinsy=h2->GetNbinsY();
    Float_t xmin=h2->GetXaxis()->GetXmin();
    Float_t xmax=h2->GetXaxis()->GetXmax();
    Float_t ymin=h2->GetYaxis()->GetXmin();
    Float_t ymax=h2->GetYaxis()->GetXmax();

    TH2* hclone=(TH2*)h2->Clone("temp_clone");

    if(ax==0)h2->SetBins(nbinsx,-xmax,-xmin,nbinsy, ymin, ymax);
    if(ax==1)h2->SetBins(nbinsx, xmin, xmax,nbinsy,-ymax,-ymin);
    if(ax==2)h2->SetBins(nbinsx,-xmax,-xmin,nbinsy,-ymax,-ymin);

    for(Int_t i=1;i<=nbinsx;i++){
        for(Int_t j=1;j<=nbinsy;j++){

            if(ax==0||ax==2)
            {   // flip x
                h2->SetBinContent(i,j,hclone->GetBinContent(nbinsx+1-i,j));
                h2->SetBinError  (i,j,hclone->GetBinError  (nbinsx+1-i,j));
            }
            if(ax==1||ax==2)
            {   // flip y
                h2->SetBinContent(i,j,hclone->GetBinContent(i,nbinsy+1-j));
                h2->SetBinError  (i,j,hclone->GetBinError  (i,nbinsy+1-j));
            }
        }
    }
    delete hclone;
    return kTRUE;
}

Bool_t HTool::shiftHistByBin(TH1* h,Int_t shiftbin)
{
    // shifts hist content by shiftbin bins
    if(!h) return kFALSE;
    Int_t nbin=h->GetNbinsX();
    TH1* hclone=(TH1*)h->Clone("clone");
    for(Int_t i=1;i<=nbin;i++)
    {
        if((i+shiftbin)>1&&(i+shiftbin)<=nbin)
        {
            h->SetBinContent(i+shiftbin,hclone->GetBinContent(i));
        }
    }
    delete hclone;
    return kTRUE;
}
Bool_t HTool::shiftHist(TH1* h,Float_t shift)
{
    // shifts hist content by value shift
    if(!h) return kFALSE;
    Int_t nbin=h->GetNbinsX();
    TH1* hclone=(TH1*)h->Clone("clone");
    Float_t xmin=h->GetXaxis()->GetXmin();
    Float_t xmax=h->GetXaxis()->GetXmax();

    for(Int_t i=1;i<=nbin;i++)
    {
        if((i+shift)>=xmin&&(i+shift)<=xmax)
        {
            h->Fill(hclone->GetXaxis()->GetBinCenter(i),hclone->GetBinContent(i));
        }
    }
    delete hclone;
    return kTRUE;
}
Int_t HTool::normalize_max(TH2* ht,TString axis)
{
    // Project to axis and and calc scaling factor for the bin
    // to maximum of total hist max_total/max_proj. The bins of
    // the hist are scaled by the factor. The result is 2D hist
    // where each bin Projection has the same maximum height.
    // The opration is performed on the original Hist!
    // arguments:
    // TH2* ht        :pointer to hist which should be normalized
    // TString axis   :="x" , or "y" depending on the projection
    // return values:
    // -1 : In the case of zero pointer input or unknown axis argument
    //  0 : If opreation has been succesful
    //  3 : TH2 max is 0 (most probably empty).

    if(!ht)
    {
	cout<<"HTool::normalize_max(TH2*,TString axis):: ZERO pointer!"<<endl;

	return -1;
    }

    Double_t max = ht->GetMaximum();
    if(max==0) return 3;

    Int_t nbinsx=ht->GetNbinsX();
    Int_t nbinsy=ht->GetNbinsY();

    axis.ToLower();
    if(axis.CompareTo("y")==0)
    {
	for(Int_t i=0; i<nbinsy;i++)
	{
	    TH1D* hproj=ht->ProjectionX("proj",i+1,i+1,"");
	    hproj->SetDirectory(0);

	    Double_t max_y=hproj->GetMaximum();
	    if(max_y==0) continue;
	    Double_t scale=max/max_y;

	    for(Int_t j=0;j<nbinsx;j++)
	    {
		Double_t content=ht->GetBinContent(j+1,i+1);
		ht->SetBinContent(j+1,i+1,scale*content);
	    }

	    delete hproj;
	}
	return 0;
    }
    else if(axis.CompareTo("x")==0)
    {
	for(Int_t i=0; i<nbinsx;i++)
	{
	    TH1D* hproj=ht->ProjectionY("proj",i+1,i+1,"");
	    hproj->SetDirectory(0);

	    Double_t max_y=hproj->GetMaximum();
	    if(max_y==0) continue;
	    Double_t scale=max/max_y;

	    for(Int_t j=0;j<nbinsy;j++)
	    {
		Double_t content=ht->GetBinContent(i+1,j+1);
		ht->SetBinContent(i+1,j+1,scale*content);
	    }

	    delete hproj;
	}
	return 0;
    }
    else
    {
	cout<<"HTool::normalize_max(TH2*,TString axis):: unknown option for axis :"<<axis.Data()<<endl;
	return -1;
    }
}

TGraph* HTool::histToGraph(TH1* h,TString newname,Bool_t exchange,Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    // Creates a TGraph from hist h. The axis can be exchanged if
    // exchange=kTRUE; The Graph does not take empty bins into account.

    TGraph* result=0;
    if(h==0) return result;
    TString myname="";
    if(newname.CompareTo("")==0)
    { // default
	myname=h->GetName();
	myname+="_graph";
    } else
    {
	myname=newname;
    }

    Int_t nBinsX=h->GetNbinsX();
    Double_t x,y;

    result=new TGraph();
    result->SetName(myname.Data());
    result->SetLineColor(1);
    result->SetMarkerStyle(markerstyle);
    result->SetMarkerColor(markercolor);
    result->SetMarkerSize (markersize);

    for(Int_t i=0;i<nBinsX;i++)
    {
	x=h->GetXaxis()->GetBinCenter(i+1);
	y=h->GetBinContent(i+1);

	if(y!=0)
	{
	    if(!exchange)result->SetPoint(i,x,y);
            else         result->SetPoint(i,y,x);
	}
	else
	{
	    result->SetPoint(i,0.,0.);
	}
    }

    for(Int_t i=0;i<nBinsX;i++)
    {
	for(Int_t j=0;j<nBinsX;j++)
	{
	    if(!exchange)result->GetPoint(j,x,y);
            else         result->GetPoint(j,y,x);

	    if(y==0||!finite(y))
	    {
		result->RemovePoint(j);
		break;
	    }
	}
    }
    return result;
}
TGraphErrors* HTool::histToGraphErrors(TH1* h,TString newname,Bool_t exchange,Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    // Creates a TGraphErrors from hist h. The axis can be excganged if
    // exchange=kTRUE; The Graph does not take empty bins into account.

    TGraphErrors* result=0;
    if(h==0) return result;
    TString myname="";
    if(newname.CompareTo("")==0)
    { // default
	myname=h->GetName();
	myname+="_graph";
    } else
    {
	myname=newname;
    }

    Int_t nBinsX=h->GetNbinsX();
    Double_t x,y;
    Double_t xE,yE;

    result=new TGraphErrors();
    result->SetName(myname.Data());
    result->SetLineColor(1);
    result->SetMarkerStyle(markerstyle);
    result->SetMarkerColor(markercolor);
    result->SetMarkerSize (markersize);

    for(Int_t i=0;i<nBinsX;i++)
    {
	x =h->GetXaxis()->GetBinCenter(i+1);
	y =h->GetBinContent(i+1);
        xE=h->GetXaxis()->GetBinWidth(i+1);
        yE=h->GetBinError(i+1);

        if(y!=0)
	{
            if(!exchange)
            {
                result->SetPoint(i,x,y);
                result->SetPointError(i,xE,yE);
            }
            else
            {
                result->SetPoint(i,y,x);
                result->SetPointError(i,yE,xE);
            }
        }
	else
	{
	    result->SetPoint(i,0.,0.);
	}
    }

    for(Int_t i=0;i<nBinsX;i++)
    {
	for(Int_t j=0;j<nBinsX;j++)
	{
            if(!exchange)
            {
                result->GetPoint(j,x,y);
            }
            else
            {
                result->GetPoint(j,y,x);
            }
	    if(y==0||!finite(y))
	    {
		result->RemovePoint(j);
		break;
	    }
	}
    }
    return result;
}
TGraph* HTool::hist2DToGraph(TH2* h,Float_t xmin,Float_t xmax,
			     Float_t ymin,Float_t ymax
			    )
{
    // Puts h into TGraph .
    // With xmin/xmax/ymin,ymax a region can be selected.

    if(h==0) return 0;

    Int_t nbinsx=h->GetNbinsX();
    Int_t nbinsy=h->GetNbinsY();

    Bool_t windowx=kFALSE;
    if(xmin!=0||xmax!=0) windowx=kTRUE;
    Bool_t windowy=kFALSE;
    if(ymin!=0||ymax!=0) windowy=kTRUE;

    TString name=h->GetName();
    name+="_gTH2";

    TGraph* g=0;
    g=new TGraph();
    g->SetName(name.Data());

    Double_t max=h->GetMaximum();
    if(max==0) {
        delete g;
	return 0;
    }
    Double_t x,y,val;
    Int_t ctpoint=0;
    for(Int_t i=1;i<=nbinsx;i++){
        x=h->GetXaxis()->GetBinCenter(i);
        if(windowx) { if(x<xmin||x>xmax) continue;}
        for(Int_t j=1;j<=nbinsy;j++){
            y=h->GetYaxis()->GetBinCenter(j);
            if(windowy) { if(y<ymin||y>ymax) continue;}
            val=h->GetBinContent(i,j);
            if(val==0)continue;
	    g->SetPoint(ctpoint,x,y);
	    ctpoint++;
        }
    }

    return g;
}
TGraphErrors* HTool::hist2DToGraphErrors(TH2* h,
					 Float_t xmin,Float_t xmax,
					 Float_t ymin,Float_t ymax
					)
{
    // Puts h into TGraphErrors .
    // With xmin/xmax/ymin,ymax a region can be selected.

    if(h==0) return 0;

    Int_t nbinsx=h->GetNbinsX();
    Int_t nbinsy=h->GetNbinsY();

    Bool_t windowx=kFALSE;
    if(xmin!=0||xmax!=0) windowx=kTRUE;
    Bool_t windowy=kFALSE;
    if(ymin!=0||ymax!=0) windowy=kTRUE;

    TString name=h->GetName();
    name+="_gTH2";

    TGraphErrors* g=0;
    g=new TGraphErrors();
    g->SetName(name.Data());

    Double_t max=h->GetMaximum();
    if(max==0) {
        delete g;
	return 0;
    }
    Double_t x,y,val,err;
    Int_t ctpoint=0;
    for(Int_t i=1;i<=nbinsx;i++){
        x=h->GetXaxis()->GetBinCenter(i);
        if(windowx) { if(x<xmin||x>xmax) continue;}
        for(Int_t j=1;j<=nbinsy;j++){
            y=h->GetYaxis()->GetBinCenter(j);
            if(windowy) { if(y<ymin||y>ymax) continue;}
            val=h->GetBinContent(i,j);
            if(val==0)continue;
            g->SetPoint(ctpoint,x,y);
            err=h->GetBinError(i,j);
	    g->SetPointError(ctpoint,err,err);
	    ctpoint++;
        }
    }

    return g;
}

TH1* HTool::toNonConstBinHist(TH1* hconst,TH1* hnonconst,Bool_t normBinWidth,Double_t eps)
{
    // Takes hconst (constant binning) and rebins it in the same
    // way as hnonconst. The bin width of hconst has to be such
    // that an integer multiplier can be found to fit all bins
    // of hnonconst (example invariant mass :
    // hconst bin width = 1MeV/c,
    // hnonconst bin width x * 1MeV/c (x beining an integer number) )
    // The new histogram will be returned. The name of the
    // new histogram is is hconstname_varbin. If the rebin
    // did not work out a NULL pointer will be returned.


    if(!hconst)    { return 0;}
    if(!hnonconst) { return 0;}

    Double_t binw = hconst->GetXaxis()->GetBinWidth(1);

    TH1F* hnew =0;
    Double_t w=0;
    Int_t fac=0;
    Double_t* bins = new Double_t [hnonconst->GetNbinsX()+1];
    for(Int_t i=0;i<hnonconst->GetNbinsX();i++){
	bins[i] = hnonconst->GetXaxis()->GetBinLowEdge(i+1);

	w = hnonconst->GetXaxis()->GetBinWidth(i+1);
	fac =  (w/binw) + eps;

	if(fac*binw<w-eps || fac*binw>w+eps){
	    cout<<"ERROR: toNonConstBinHist() : cannot find integer multiplier for bin width! skipped!"<<endl;
	    cout<<"hconst = "<<hconst->GetName()
		<<" , binw = "<<binw
		<<" w = "     <<w
		<<" fac = "   <<fac
		<<" real fac "<<w/binw<<endl;
	    delete bins;
	    return hnew;
	}
    }
    cout<<"hconst = " <<hconst->GetName()
	<<" , binw = "<<binw
	<<" w = "     <<w
	<<" fac = "   <<fac
	<<" real fac "<<w/binw<<endl;

    bins[hnonconst->GetNbinsX()] = hnonconst->GetXaxis()->GetBinUpEdge(hnonconst->GetNbinsX());

    hnew = new TH1F(Form("%s_varbin",hconst->GetName()),
		    hconst->GetTitle(),
		    hnonconst->GetNbinsX(),bins);

    for(Int_t i=0;i<hconst->GetNbinsX();i++){
	Double_t x   = hconst->GetXaxis()->GetBinCenter(i+1);
	Double_t val = hconst->GetBinContent(i+1);
	hnew->Fill(x,val);
    }

    if(normBinWidth){
	for(Int_t i=0;i<hnew->GetNbinsX();i++){
	    Double_t w   =  hnew->GetXaxis()->GetBinWidth(i+1);
	    Double_t val =  hnew->GetBinContent(i+1);
	    //Double_t err =  hnew->GetBinError(i+1);

	    hnew->SetBinContent(i+1,val/w);
	    // hnew->SetBinError  (i+1,err);
	}
    }

    delete bins;

    return hnew;
}

TH1* HTool::inverseRebinBinHist(TH1* hnonconst,Double_t binw,Bool_t normBinWidth,Double_t eps)
{
    // Takes histogram and rebins it with binw binwidth, where binw
    // is smaller than the binwidth.
    // The bin width of the histogram has to be such
    // that an integer multiplier can be found to fit all bins
    // of hnonconst (example invariant mass :
    // hnonconst bin width = 10MeV/c,
    // rebin bin width binw =1MeV/c ). The bin content will
    // be equaly distributed to the bins.
    // The new histogram will be returned. The name of the
    // new histogram is is hconstname_rebin. If the rebin
    // did not work out a NULL pointer will be returned.

    if(!hnonconst) return 0;

    TH1F* hnew =0;
    Double_t w=0;
    Int_t fac=0;


    vector<Double_t> bins ;
    Double_t lowedge;
    for(Int_t i=0;i<hnonconst->GetNbinsX();i++){

	lowedge = hnonconst->GetXaxis()->GetBinLowEdge(i+1);


	w = hnonconst->GetXaxis()->GetBinWidth(i+1);
	fac =  (w/binw) + eps;

	if(fac*binw<w-eps || fac*binw>w+eps){
	    cout<<"ERROR: toNonConstBinHist() : cannot find integer multiplier for bin width! skipped!"<<endl;
	    cout<<"hconst = "<<hnonconst->GetName()<<" , binw = "<<binw<<" w = "<<w<<" fac = "<<fac<<" real fac "<<w/binw<<endl;
	    return hnew;
	}
	for (Int_t j = 0; j < fac; j ++){
	    bins.push_back(lowedge+j*binw);
	}

    }
    cout<<"hconst = "<<hnonconst->GetName()<<" , binw = "<<binw<<" w = "<<w<<" fac = "<<fac<<" real fac "<<w/binw<<endl;
    bins.push_back(hnonconst->GetXaxis()->GetBinUpEdge(hnonconst->GetNbinsX()));


    hnew = new TH1F(Form("%s_constbin",hnonconst->GetName()),
		    hnonconst->GetTitle(),
		    bins.size()-1,bins.data());


    for(Int_t i=0;i<hnonconst->GetNbinsX();i++){
	lowedge = hnonconst->GetXaxis()->GetBinLowEdge(i+1);

	w = hnonconst->GetXaxis()->GetBinWidth(i+1);
	fac =  (w/binw) + eps;

	for (Int_t j = 0; j < fac; j ++){
	    hnew->SetBinContent(hnew->FindBin(lowedge+j*binw+binw/2.),hnonconst->GetBinContent(i+1)/fac);
	}
    }

    if(normBinWidth){
	for(Int_t i=0;i<hnew->GetNbinsX();i++){
	    Double_t w   =  hnew->GetXaxis()->GetBinWidth(i+1);
	    Double_t val =  hnew->GetBinContent(i+1);
	   // Double_t err =  hnew->GetBinError(i+1);

	    hnew->SetBinContent(i+1,val/w);
	    // hnew->SetBinError  (i+1,err);
	}
    }

    return hnew;
}

void HTool::printHist(TH1* h)
{
    // prints the bin edges, content and error of hist (1dim support)

    if(!h) return;
    cout<<"h = "<<h->GetName()<<", nbins = "<<h->GetNbinsX()<<endl;
    for(Int_t i = 0; i < h->GetNbinsX(); i ++){
	Double_t xL  = h->GetXaxis()->GetBinLowEdge(i+1);
	Double_t xU  = h->GetXaxis()->GetBinUpEdge(i+1);
        Double_t val = h->GetBinContent(i+1);
	Double_t err = h->GetBinError(i+1);
	cout<<setw(4)<<i
	    <<" ["<<setw(8)<<xL
	    <<"," <<setw(8)<<xU<<"], val = "<<setw(8)<<val<<", err= "<<setw(8)<<err<<endl;
    }
}



void  HTool::histToText(TH1* h, TString filename)
{
    // put 1D histogram to ascii file with following
    // format :
    //
    // Minv  BinContent BinStatError BinWidth


    ofstream out;
    out.open(filename.Data());

    Int_t nbinx = h->GetNbinsX();

    out <<"Minv  BinContent BinStatError BinWidth"<<endl;
    cout<<"Minv  BinContent BinStatError BinWidth"<<endl;

    for(Int_t i=0;i<nbinx;i++){
	out <<scientific<<h->GetXaxis()->GetBinCenter(i+1)<<" "<<h->GetBinContent(i+1) <<" "<<h->GetBinError(i+1)<<" "<<h->GetXaxis()->GetBinWidth(i+1)<<endl;
	cout<<scientific<<h->GetXaxis()->GetBinCenter(i+1)<<" "<<h->GetBinContent(i+1) <<" "<<h->GetBinError(i+1)<<" "<<h->GetXaxis()->GetBinWidth(i+1)<<endl;
    }
    out.close();
}



//---------------------------graphs--------------------------------

TH1D* HTool::graphToHist(TGraph* g, Double_t firstBinWidth,
			 TString newname,Bool_t exchange,
			 Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    // Creates a TH1D from TGraph g. The binwidth of the first bin has to
    // specified. The others bins are calculated automatically. Supports also Graphs
    // with non constant x steps. The axis of the Graph can be exchanged if
    // exchange=kTRUE (modifies the Graph).


    TH1D* result = 0;
    if(g == 0)              return result;
    if(firstBinWidth == -1) return result;
    TString myname="";
    if(newname.CompareTo("") == 0)
    { // default
	myname = g->GetName();
	myname += "_graph";
    } else
    {
	myname = newname;
    }
    if(exchange) HTool::exchangeXYGraph(g);

    Int_t nBinX = g->GetN();
    Double_t* X = g->GetX();
    Double_t* Y = g->GetY();

    if(nBinX < 1) return result;

    //------------------------------------------
    // create the Matrix for the equation system
    // and init the values

    Int_t nDim = nBinX - 1;
    TMatrixD A(nDim,nDim);
    TMatrixD B(nDim,1);

    Double_t* aA = A.GetMatrixArray();
    Double_t* aB = B.GetMatrixArray();
    memset(aA,0,nDim * nDim * sizeof(Double_t));
    memset(aB,0,nDim * sizeof(Double_t));
    //------------------------------------------

    //------------------------------------------
    // setup equation system
    // width for 1st bin is given therefore
    // we shift bin parameter (column) by one to the left
    // to reduce the matrix size

    Double_t* xAxis = new Double_t [nBinX + 1];
    Double_t* binW  = new Double_t [nBinX ];
    binW[0] = firstBinWidth;

    aB[0] = X[1] - X[0]  - 0.5 * binW[0];
    aA[0] = 0.5;

    for(Int_t col = 1; col < nDim ; col ++)
    {
	Int_t row = col;
	aB[col] = X[col + 1] - X[ col ];
	aA[row * nDim + col - 1 ] = 0.5;
	aA[row * nDim + col     ] = 0.5;
    }
    //------------------------------------------

    //------------------------------------------
    // solve the equations
    A.Invert();
    TMatrixD C = A * B;
    //------------------------------------------

    //------------------------------------------
    // calculate the bin boundaries
    xAxis[0] = X[0] - 0.5 * binW[0];
    memcpy(&binW[1],C.GetMatrixArray(),nDim * sizeof(Double_t));
    for(Int_t col = 0; col < nBinX ; col ++) {
	xAxis[col + 1] = X[col] + 0.5 * binW[col];
    }
    //------------------------------------------

    //------------------------------------------
    // setup the final hist
    result = new TH1D(myname.Data(),myname.Data(),nBinX, xAxis);
    for(Int_t i = 0; i < nBinX; i ++){
	result->SetBinContent(i + 1, Y[i]);
    }
    result->SetMarkerColor(markercolor);
    result->SetMarkerStyle(markerstyle);
    result->SetMarkerSize(markersize);
    //------------------------------------------

    delete [] xAxis;
    delete [] binW;


    return result;
}

TH1D* HTool::graphErrorsToHist(TGraphErrors* g, Double_t firstBinWidth,
			       TString newname,Bool_t exchange,
			       Int_t markerstyle,Int_t markercolor,Float_t markersize)
{
    // Creates a TH1D from TGraph g. The binwidth of the first bin has to
    // specified. The others bins are calculated automatically. Supports also Graphs
    // with non constant x steps. The axis of the Graph can be exchanged if
    // exchange=kTRUE (modifies the Graph).

    TH1D* result = HTool::graphToHist(g,firstBinWidth,newname,exchange,
				      markerstyle,markercolor,markersize);
    if( result == 0) return result;

    //------------------------------------------
    // setup the final hist
    Int_t nBinX = g->GetN();
    Double_t* err = g->GetEY();           // error y is still ok even if exchanged
    for(Int_t i = 0; i < nBinX; i ++){
	result->SetBinError(i + 1, err[i]);
    }
    if(exchange){
        HTool::exchangeXYGraph(g);        // undo  what has been done in graphToHist
	HTool::exchangeXYGraphErrors(g);  // now exchange including errors
    }

    return result;
}

Bool_t HTool::exchangeXYGraph(TGraph* g)
{
    // exchanges x-values and y-values.
    if(g==0) return kFALSE;
    Int_t nbin=g->GetN();
    Double_t x,y;
    for(Int_t i = 0; i < nbin; i ++)
    {
        g->GetPoint(i,x,y);
        g->SetPoint(i,y,x);
    }

    return kTRUE;
}
Bool_t HTool::exchangeXYGraphErrors(TGraphErrors* g)
{
    // exchanges x-values and y-values and
    // corresponding errors.
    if(g==0) return kFALSE;
    Int_t nbin=g->GetN();
    Double_t x,y;
    Double_t ex,ey;
    for(Int_t i = 0; i < nbin; i ++)
    {
        g->GetPoint(i,x,y);
        ex = g->GetErrorX(i);
        ey = g->GetErrorY(i);
        g->SetPoint(i,y,x);
        g->SetPointError(i,ey,ex);
    }

    return kTRUE;
}

Double_t HTool::integralGraph(TGraph* g,Int_t first,Int_t last){
    // calulates the integral (culmulative sum) y-values.
    // By default all points are used. "first" and "last" defines
    // the range of points to integrate (including these points, counting from 0).
    // If "first" and "last" are no valid numbers inside the correct
    // range the range will be set to 0 and last point depending
    // which boundary has been violated.

    if(g == 0) return kFALSE;
    Int_t nbin = g->GetN();
    Double_t x,y;
    Double_t sum = 0;
    if(first > last ){
	first = 0;
        last  = nbin - 1;
	cout<<"integralGraph(): lower bound range larger as upper bound ! setting first and last point instead."<<endl;
    }

    if(first != -1) {
	// check range of start point
	if(first < 0) {
	    first = 0;
	    cout<<"integralGraph(): lower bound range not valid! setting first point instead."<<endl;
	}
    } else first = 0;

    if(last !=-1) {
	// check range of end point
	if(last < 0) {
	    last = nbin - 1;
	    cout<<"integralGraph(): upper bound range not valid! setting last point instead."<<endl;
	}
	if(last > nbin - 1) {
	    last = nbin - 1;
	    cout<<"integralGraph(): upper bound range not valid! setting last point instead."<<endl;
	}
    } else last = nbin - 1;

    for(Int_t i = first; i <= last; i ++)
    {
        g->GetPoint(i,x,y);
        sum += y;
    }
    return sum;
}

Bool_t HTool::scaleGraph(TGraph* g,Double_t xscale,Double_t yscale)
{
    // scales x-values and y-values with  xscale,yscale.
    if(g==0) return kFALSE;
    Int_t nbin=g->GetN();
    Double_t x,y;
    for(Int_t i=0;i<nbin;i++)
    {
        g->GetPoint(i,x,y);
        g->SetPoint(i,x*xscale,y*yscale);
    }
    return kTRUE;
}
Bool_t HTool::scaleGraphErrors(TGraphErrors* g,
			       Double_t xscale,Double_t yscale,
			       Double_t xErrscale,Double_t yErrscale)
{
    // scales x-values and y-values with  xscale,yscale.
    // scales x Err-values and yErr-values with  xErrscale,yErrscale.
    if(g==0) return kFALSE;
    Int_t nbin=g->GetN();
    Double_t x,y;
    Double_t xErr,yErr;
    for(Int_t i=0;i<nbin;i++)
    {
	g->GetPoint(i,x,y);
        xErr = g->GetErrorX(i);
        yErr = g->GetErrorY(i);

	g->SetPoint(i,x*xscale,y*yscale);
        g->SetPointError(i,xErr * xErrscale, yErr * yErrscale);
    }
    return kTRUE;
}
Bool_t HTool::shiftGraph(TGraph* g,Double_t xshift,Double_t yshift)
{
    // add shift to x-values and y-values
    if(g==0) return kFALSE;
    Int_t nbin=g->GetN();
    Double_t x,y;
    for(Int_t i=0;i<nbin;i++)
    {
        g->GetPoint(i,x,y);
        g->SetPoint(i,x+xshift,y+yshift);
    }
    return kTRUE;
}







//---------------------strings--------------------------------------

TString*  HTool::parseString(TString options,Int_t& size,TString separator,Bool_t tolower)
{
    // loops over TString options and find substrings separated by separator
    // and puts them to an array of TStrings. size will hold the size of this
    // array and the pointer to the array is returned. If tolower is kTRUE options
    // will be made toLower.
    if(tolower)options.ToLower();
    options.ReplaceAll(" ","");

    TString tmp = options;
    Ssiz_t len  = options.Length();

    TString* sarray = 0;
    size            = 0;

    if(len!=0)
    {
        TObjArray* array = tmp.Tokenize(separator.Data());

	if(array->GetEntries()>0) sarray = new TString [array->GetEntries()];

	for(Int_t i=0;i<array->GetEntries();i++)
	{
	    sarray[i]= ((TObjString*)(array->At(i)))->GetString();
	}
	size = array->GetEntries();
	array->Delete();
        delete array;
    }
    
    return sarray;
}
Bool_t  HTool::findString(TString* classes,Int_t size,TString name)
{
    // searches name in TString array classes with size size.
    // return kTRUE if the string is found.
    for(Int_t i=0;i<size;i++)
    {
        if(classes[i].CompareTo(name)==0)return kTRUE;
    }
    return kFALSE;
}

//---------------------------tree compare---------------------------

Bool_t  HTool::readHistsDescription(TString file,TObjArray* myhists,TString* classes,Int_t sizeclass)
{
    // reads the hist descriptions from ascii file file.
    // Creates the hists found in TString array classes
    // with size size and adds them to TObjArray myhists.

    FILE* ascii=fopen(file.Data(),"r");
    if(!ascii)
    {
          cout<<"reading hist description: Specified file "<<file.Data()<<" does not exist!"<<endl;
          return kFALSE;
    }
    else
    {
	TString buffer="";
        Char_t line[400];
        Int_t nbins;
        Float_t xmin,xmax;
        TString name;
        Int_t size;

        while(1)
        {

            if(feof(ascii)) break;
            Bool_t res=fgets(line, sizeof(line), ascii);

            if(!res) cout<<"reading hist description: error reading next line!"<<endl;
	    buffer=line;
            if(buffer.Contains("#") !=0)continue;
            if(buffer.Contains("//")!=0)continue;

            TString* ar=HTool::parseString(buffer,size,",",kFALSE);
            if(size==4)
            {
                name=ar[0];
                sscanf(ar[1].Data(),"%i",&nbins);
                sscanf(ar[2].Data(),"%f",&xmin);
                sscanf(ar[3].Data(),"%f",&xmax);
                if(classes!=0)
                {
                    if(HTool::findString(&classes[0],sizeclass,name))
                    {
                        myhists->Add(new TH1F(name.Data(),name.Data(),nbins,xmin,xmax));
                    }
                }
                else
                {
                    myhists->Add(new TH1F(name.Data(),name.Data(),nbins,xmin,xmax));
                }
            }else {
                cout<<"readHistsDescription(): Wrong number of arguments!"<<endl;
            }

        }
        fclose(ascii);
    }
    return kTRUE;
}
Bool_t HTool::makeHists(TString infile,Int_t evs,TString histdescriptionfile,TString listofClasses)
{
    // makeHists(TString infile,Int_t evs,TString histdescriptionfile,TString listofClasses)
    // Takes all categories in infile and generates generic histograms of all datamembers.
    // T->Draw() is used to fill the hists. evs is the number of entries to loop over. if evs=0
    // the full size of the tree will be used.
    // INPUT:
    // histdescriptionfile is the file with description of the histograms to fill (ascii).
    // if histdescriptionfile=="" histograms will be filled generic and a histdescription file
    // histDescription.txt will be generated in the working directory.
    // listofClasses contains a list of Classes which should be taken into account, all other
    // classes will be ignored. if listofClasses=="" all classes in infile will be taken.
    // OUTPUT:
    // I.   a root file treeHists.root will be generated which contains all histograms of the
    //      selected variables
    // II.  if histdescriptionfile has been empty an ascii file treeHistDescription.txt will
    //      be generated in the working directory.
    // III. an ascii file treeHistResults.txt with the analysis results of the hists will be created,
    //      which can be used for diff of different files.

    if (infile.CompareTo("")==0)
    {
        cout<<"No input file speciefied!"<<endl;
        return kFALSE;
    }
    if (evs==0)
    {
        //return kFALSE;
    }
    Bool_t useDescription=kFALSE;
    if (histdescriptionfile.CompareTo("")!=0)
    {
        useDescription=kTRUE;
    }
    Bool_t useClassList=kFALSE;
    if (listofClasses.CompareTo("")!=0)
    {
        useClassList=kTRUE;
    }

    Int_t numberclasses=0;
    TString* myclassNames=0;

    if(useClassList)
    {
        myclassNames=HTool::parseString(listofClasses,numberclasses,",",kFALSE);
    }

    TFile* out=new TFile("treeHists.root","RECREATE");
    TCanvas* result=new TCanvas("result","result",1000,800);
    result->cd();

    TFile* in=new TFile(infile.Data(),"READ");
    in->cd();
    Int_t events=evs;
    TTree* T=(TTree*)in->Get("T");

    if (evs==0)
    {
        events=(Int_t)T->GetEntries();
    }

    TObjArray* classarray=new TObjArray();
    TString keyname;
    TString keyclassname;

    //------------------Looping directories to find all categories in file--------------------------
    // has to done only if no histdescription is used!!

    TList* keylist=0;
    Int_t sizekey =0;
    Int_t counter=0;

    if(!useDescription)
    {
        cout<<"Getting categories from directory!"<<endl;
        keylist=gDirectory->GetListOfKeys();
        sizekey =keylist->LastIndex();
        counter=0;
        for(Int_t i=0;i<sizekey+1;i++)
        {
            TKey* key=(TKey*)keylist->At(i);
            keyname     = key->GetName();
            keyclassname= key->GetClassName();

            if(keyclassname.CompareTo("TDirectoryFile")==0)
            {
                cout<<keyname.Data()<<" "<<keyclassname.Data()<<endl;
                in->cd(keyname.Data());

                TList* keylist2=gDirectory->GetListOfKeys();

                //-------------------looping in dir for categories--------------------------------------
                for(Int_t j=0;j<keylist2->LastIndex()+1;j++)
                {
                    TKey* key2  =(TKey*)keylist2->At(j);
                    keyname     = key2->GetName();
                    keyclassname= key2->GetClassName();

                    if(keyclassname.Contains("Category")!=0)
                    {
                        if(useClassList)
                        {
                            if(HTool::findString(&myclassNames[0],numberclasses,keyname))
                            {
                                counter++;
                                classarray->Add(key2);
                            }
                        }
                        else
                        {
                            counter++;
                            classarray->Add(key2);
                        }
                    }
                }
            }
        }
        classarray->Expand(classarray->GetEntries());
        cout<<"Number of Categries: "<<classarray->GetEntries() <<endl;

    }



    TString branch;
    TString histname;
    TString classname;
    TString varname;


    //--------------------looping over categories to get all data members----------------------------

    if(!useDescription)
    {
        cout<<"Do not use description"<<endl;
        FILE* histout=fopen("treeHistDescription.txt","w");
        FILE* anaout =fopen("treeHistResults.txt","w");

        cout<<"-----------------------------------------------------------"<<endl;
        for(Int_t j=0;j<classarray->LastIndex()+1;j++)
        {

            cout<<"###########################################################"<<endl;

            TKey* k=(TKey*)classarray->At(j);
            classname=k->GetName();
            cout<<classname.Data()<<endl;

            TClass* cl=gROOT->GetClass(k->GetName(),1);
            TList* list=HTool::getListOfAllDataMembers(cl);
            Int_t size =list->LastIndex();
            TString datatype;
            for(Int_t i=0;i<size+1;i++)
            {
                TDataMember* member=(TDataMember*)list->At(i);
		varname = member->GetName();
		datatype = member->GetTypeName();

		if(!member->IsPersistent())             continue;

		if( datatype == "TObject::EStatusBits") continue;
		if( datatype == "enum TObject::")       continue;

		if(varname.Contains("fgDtorOnly"))      continue;
		if(varname.Contains("fgObjectStat"))    continue;

		if(varname.Contains("fgIsA")==0)
                {
                    branch=classname+".fData."+varname;
                    cout<<branch.Data()<<endl;

                    in->cd();
                    T->Draw(branch,"","",events,0);
                    TH1F *htemp = (TH1F*)gPad->GetPrimitive("htemp");
                    if(htemp)
                    {
                        branch=classname+"."+varname;
                        htemp->SetName(branch);
                        htemp->SetTitle(branch);
                        HTool::printHistInfo(htemp);
                        HTool::writeHistInfo(htemp,anaout);

                        fprintf(histout,"%s , %i , %f , %f \n",
                                htemp->GetName(),
                                htemp->GetNbinsX(),
                                htemp->GetXaxis()->GetXmin(),
                                htemp->GetXaxis()->GetXmax());

                        out->cd();
                        htemp->Write();
                        in->cd();
                    }
                }
            }
        }
        fclose(histout);
        fclose(anaout);

    }
    else
    {

        cout<<"Use description"<<endl;
        if(useClassList){
            cout<<"Use ClassList"<<endl;
            HTool::readHistsDescription(histdescriptionfile,classarray,myclassNames,numberclasses);
        } else {
            cout<<"Do not use ClassList"<<endl;
            HTool::readHistsDescription(histdescriptionfile,classarray,0,0);
        }
        classarray->Expand(classarray->GetEntries());
        cout<<"Number of Hists: "<<classarray->GetEntries() <<endl;

        FILE* anaout =fopen("treeHistResults.txt","w");

        for(Int_t j=0;j<classarray->LastIndex()+1;j++)
        {
            cout<<"###########################################################"<<endl;

            TH1* h=(TH1*)classarray->At(j);
            classname=h->GetName();
            classname.Resize(classname.First("."));
            varname  =h->GetName();

            Int_t st=varname.Last('.');
            for(Int_t ii=0;ii<st+1;ii++){
                varname[ii]=' ';
            }
            varname.ReplaceAll(" ","");

            branch=classname+".fData."+varname+">>"+h->GetName();
            cout<<branch.Data()<<endl;

            in->cd();
            T->Draw(branch,"","",events,0);
            if(h)
            {
                HTool::printHistInfo(h);
                HTool::writeHistInfo(h,anaout);

                out->cd();
                h->Write();
                in->cd();
            }
        }
        fclose(anaout);
    }

    delete result;
    classarray->Delete();
    delete classarray;
    out->Save();
    out->Close();

    return kTRUE;
}
Bool_t HTool::drawHistComp(TString nameinp1,TString nameinp2,TString name,TCanvas* comp,Int_t padn)
{
    // Gets histogram with name name from 2 input files and plots them into
    // into a canvas. If the canvas pointer is 0 a canvas will be created.
    // if padn=1 they will be overlayed in on pad, if pad=2 and comp=0, a
    // new canvas with n pads will be created and the 2 hists will be plotted single
    // if n=2 and comp not equal 0, the 2 pads of comp will used to draw.
    if(name.CompareTo("")==0)
    {
        cout<<"drawHistComp(): No Histogram name specified!"<<endl;
        return kFALSE;
    }
    if(nameinp1.CompareTo("")==0||nameinp2.CompareTo("")==0)
    {
        cout<<"drawHistComp(): File names not specified !"<<endl;
        return kFALSE;
    }

    TFile* inp1=new TFile(nameinp1.Data(),"READ");
    if(inp1==0)
    {
        cout<<"drawHistComp(): File "<<nameinp1.Data()<<" does not exist !"<<endl;
        return kFALSE;
    }

    TFile* inp2=new TFile(nameinp2.Data(),"READ");
    if(inp2==0)
    {
        cout<<"drawHistComp(): File "<<nameinp2.Data()<<" does not exist !"<<endl;
        return kFALSE;
    }

    TString longlist="";
    Bool_t getAll=kFALSE;
    if(name.Contains("DrawAll")!=0)
    {
        getAll=kTRUE;
        name.ReplaceAll("DrawAll","");
        Int_t nclasses=0;

        TString* myclasses=HTool::parseString(name,nclasses,",",kFALSE);

        TList* keylist=gDirectory->GetListOfKeys();
        Int_t sizekey =keylist->LastIndex();
        TString keyname;
        TString keyclassname;

        for(Int_t i=0;i<sizekey+1;i++)
        {
            TKey* key   =(TKey*)keylist->At(i);
            keyname     = key->GetName();
            keyclassname= key->GetClassName();

            if(keyclassname.Contains("TH1")!=0)
            {
                TString temp=keyname;
                temp.Resize(temp.First("."));
                if(HTool::findString(&myclasses[0],nclasses,temp)) longlist=longlist+keyname+",";
            }
        }

    }

    Int_t size=0;TString* mynames=0;

    if(!getAll)mynames= HTool::parseString(name,size,",",kFALSE);
    else       mynames= HTool::parseString(longlist,size,",",kFALSE);
    if(comp==0)
    {   // only if no canvas from outside is used
        comp=new TCanvas("compare","compare",1000,800);

        if(padn==2&&size==1)
        {   // if 2 pads are used and no multiple input
            comp ->Divide(2,1);
        }
        else if(padn==1&&size==1)
        {   // if 1 pads are used and no multiple input
        }
        else
        {   // if multiple input is used
            Int_t dim2=0;
            Int_t dim1=(Int_t)sqrt((Float_t)size);
            if(dim1*(dim1+1)<size)dim2=dim1+2;
            else                  dim2=dim1+1;
            comp ->Divide(dim1,dim2);
        }
        if(size==1)
        {  // if no multiple input

            TH1* h1=HTool::getHist(inp1,name);
            TH1* h2=HTool::getHist(inp2,name);

            if(!h1 || !h2) return kFALSE;

            h1->SetDirectory(0);
            h2->SetDirectory(0);

            h1->SetLineColor(2);
            h2->SetLineColor(4);
            if(padn==1)
            {
                if(h1->GetMaximum()>=h2->GetMaximum())
                {
                    h1->DrawCopy();
                    h2->DrawCopy("same");
                }
                else
                {
                    h2->DrawCopy();
                    h1->DrawCopy("same");
                }
            }
            else
            {
                comp->cd(1);
                h1->DrawCopy();
                comp->cd(2);
                h2->DrawCopy();
            }
            HTool::printCompHistInfo(h1,h2);
        }
        else if(padn==1&&size==1)
        {   // if 1 pads are used and no multiple input

        }
        else
        {
            // if multiple input is used
            for(Int_t i=0;i<size;i++)
            {
                comp->cd(i+1);

                TH1* h1=HTool::getHist(inp1,mynames[i]);
                TH1* h2=HTool::getHist(inp2,mynames[i]);

                if(!h1 || !h2) return kFALSE;

                h1->SetDirectory(0);
                h2->SetDirectory(0);

                h1->SetLineColor(2);
                h2->SetLineColor(4);

                if(h1->GetMaximum()>=h2->GetMaximum())
                {
                    h1->DrawCopy();
                    h2->DrawCopy("same");
                }
                else
                {
                    h2->DrawCopy();
                    h1->DrawCopy("same");
                }
                HTool::printCompHistInfo(h1,h2);
            }
        }
    }
    else
    {   // only if canvas from outside is used

        TH1* h1=HTool::getHist(inp1,name);
        TH1* h2=HTool::getHist(inp2,name);

        if(!h1 || !h2) return kFALSE;

        h1->SetDirectory(0);
        h2->SetDirectory(0);

        h1->SetLineColor(2);
        h2->SetLineColor(4);

	if(padn==1)
	{
            comp->cd();
            if(h1->GetMaximum()>=h2->GetMaximum())
            {
                h1->DrawCopy();
                h2->DrawCopy("same");
            }
            else
            {
                h2->DrawCopy();
                h1->DrawCopy("same");
            }
            HTool::printCompHistInfo(h1,h2);
        }
        else if(padn==2)
        {
            comp->cd(1);
            h1->DrawCopy();
            comp->cd(2);
            h2->DrawCopy();
            HTool::printCompHistInfo(h1,h2);
        }
        inp1->Close();
        inp2->Close();
    }
    return kTRUE;
}
Bool_t HTool::compHistFiles(TString nameinp1,TString nameinp2,TString name)
{
    // Gets histogram with name name from 2 input files and compares them by
    // mean,rms,range,maximum,maxposition, entries....

    if(nameinp1.CompareTo("")==0||nameinp2.CompareTo("")==0)
    {
        cout<<"compHistFiles(): File names not specified !"<<endl;
        return kFALSE;
    }

    TFile* inp1=new TFile(nameinp1.Data(),"READ");
    if(inp1==0)
    {
        cout<<"compHistFiles(): File "<<nameinp1.Data()<<" does not exist !"<<endl;
        return kFALSE;
    }

    TFile* inp2=new TFile(nameinp2.Data(),"READ");
    if(inp2==0)
    {
        cout<<"compHistFiles(): File "<<nameinp2.Data()<<" does not exist !"<<endl;
        return kFALSE;
    }
    TString* mynames=0;
    Int_t size=0;
    Bool_t useList=kFALSE;

    if(name.CompareTo("")==0)
    {
        TString longlist="";
        Int_t nclasses=0;

        TString* myclasses=HTool::parseString(name,nclasses,",",kFALSE);

        TList* keylist=gDirectory->GetListOfKeys();
        Int_t sizekey =keylist->LastIndex();
        TString keyname;
        TString keyclassname;

        for(Int_t i=0;i<sizekey+1;i++)
        {
            TKey* key   =(TKey*)keylist->At(i);
            keyname     = key->GetName();
            keyclassname= key->GetClassName();

            if(keyclassname.Contains("TH1")!=0)
            {
                TString temp=keyname;
                temp.Resize(temp.First("."));
                if(HTool::findString(&myclasses[0],nclasses,temp)) longlist=longlist+keyname+",";
            }
        }
        mynames= HTool::parseString(longlist,size,",",kFALSE);
        useList=kTRUE;
    }

    inp1->cd();
    TList* keylist=gDirectory->GetListOfKeys();
    Int_t sizekey =keylist->LastIndex();
    TString keyname;
    TString keyclassname;

    for(Int_t i=0;i<sizekey+1;i++)
    {
        TKey* key   =(TKey*)keylist->At(i);
        keyname     = key->GetName();
        keyclassname= key->GetClassName();

        if(keyclassname.Contains("TH1")!=0)
        {
            if(useList)
            {
                if(HTool::findString(&mynames[0],size,keyname))
                {
                    TH1* h1=HTool::getHist(inp1,keyname);
                    TH1* h2=HTool::getHist(inp2,keyname);
                    if(! h1 || !h2) continue;
                    HTool::printCompHistInfo(h1,h2,1);
                }
            }
            else
            {
                TH1* h1=HTool::getHist(inp1,keyname);
                TH1* h2=HTool::getHist(inp2,keyname);
                if(! h1 || !h2) continue;
                HTool::printCompHistInfo(h1,h2,1);
            }
        }
    }
    return kTRUE;
}
Bool_t HTool::printHistInfo(TH1* h1)
{
    // prints information over hist to screen .
    if(!h1) return kFALSE;
    cout<<"-----------------------------------------------------------"<<endl;
    cout<<h1->GetName()<<endl;
    cout<<"             Mean      :"<<h1->GetMean()<<endl;
    cout<<"             RMS       :"<<h1->GetRMS()<<endl;
    cout<<"             Entries   :"<<h1->GetEntries()<<endl;
    cout<<"             Integral  :"<<h1->Integral()<<endl;
    cout<<"             Maximum   :"<<h1->GetMaximum()<<endl;
    cout<<"             Maximum X :"<<h1->GetBinCenter(h1->GetMaximumBin())<<endl;
    cout<<"             UnderFlow :"<<h1->GetBinContent(0)<<endl;
    cout<<"             OverFlow  :"<<h1->GetBinContent(h1->GetNbinsX()+1)<<endl;
    cout<<"             nBins     :"<<h1->GetNbinsX()<<endl;
    cout<<"             xMin      :"<<h1->GetXaxis()->GetXmin()<<endl;
    cout<<"             xMax      :"<<h1->GetXaxis()->GetXmax()<<endl;
    cout<<"-----------------------------------------------------------"<<endl;
    return kTRUE;
}
Bool_t HTool::printCompHistInfo(TH1* h1,TH1* h2,Int_t detail)
{
    // prints information over hist to screen .
    if(!h1 || !h2) return kFALSE;
    cout<<"-----------------------------------------------------------"<<endl;
    cout<<h1->GetName()<<endl;
    if(detail==1)
    {
        TH1* h1tmp=(TH1*)h1->Clone();
        TH1* h2tmp=(TH1*)h2->Clone();

        Double_t prob=h1->KolmogorovTest(h2);
        cout<<" Kolmogorov Prob.            : "<<prob<<endl;

        h1tmp->Add(h2tmp,-1);
        cout<<" Integral after Substr.      : "<<h1tmp->Integral()<<endl;
        cout<<" Maximum after Substr.       : "<<h1tmp->GetMaximum()<<endl;
        cout<<" Maximum X after Substr.     : "<<h1tmp->GetBinCenter(h1tmp->GetMaximumBin())<<endl;

        cout<<" Minimum after Substr.       : "<<h1tmp->GetMinimum()<<endl;
        cout<<" Minimum X after Substr.     : "<<h1tmp->GetBinCenter(h1tmp->GetMinimumBin())<<endl;

        delete h1tmp;
        delete h2tmp;

    }
    cout<<" Mean      :"<< setw(15) <<h1->GetMean()                        <<" : "<<h2->GetMean()<<endl;
    cout<<" RMS       :"<< setw(15) <<h1->GetRMS()                         <<" : "<<h2->GetRMS()<<endl;
    cout<<" Entries   :"<< setw(15) <<h1->GetEntries()                     <<" : "<<h2->GetEntries()<<endl;
    cout<<" Integral  :"<< setw(15) <<h1->Integral()                       <<" : "<<h2->Integral()<<endl;
    cout<<" Maximum   :"<< setw(15) <<h1->GetMaximum()                     <<" : "<<h2->GetMaximum()<<endl;
    cout<<" Maximum X :"<< setw(15) <<h1->GetBinCenter(h1->GetMaximumBin())<<" : "<<h2->GetBinCenter(h2->GetMaximumBin())<<endl;
    cout<<" UnderFlow :"<< setw(15) <<h1->GetBinContent(0)                 <<" : "<<h2->GetBinContent(0)<<endl;
    cout<<" OverFlow  :"<< setw(15) <<h1->GetBinContent(h1->GetNbinsX()+1) <<" : "<<h2->GetBinContent(h2->GetNbinsX()+1)<<endl;
    cout<<" nBins     :"<< setw(15) <<h1->GetNbinsX()                      <<" : "<<h2->GetNbinsX()<<endl;
    cout<<" xMin      :"<< setw(15) <<h1->GetXaxis()->GetXmin()            <<" : "<<h2->GetXaxis()->GetXmin()<<endl;
    cout<<" xMax      :"<< setw(15) <<h1->GetXaxis()->GetXmax()            <<" : "<<h2->GetXaxis()->GetXmax()<<endl;
    cout<<"-----------------------------------------------------------"<<endl;
    return kTRUE;
}
Bool_t HTool::writeHistInfo(TH1* h1,FILE* anaout)
{
    // writes information over hist to ascii file .
    if(!h1 || !anaout) return kFALSE;

    fprintf(anaout,"-----------------------------------------------------------\n");
    fprintf(anaout,"%s\n",h1->GetName());
    fprintf(anaout,"             Mean      : %f\n",h1->GetMean());
    fprintf(anaout,"             RMS       : %f\n",h1->GetRMS());
    fprintf(anaout,"             Entries   : %f\n",h1->GetEntries());
    fprintf(anaout,"             Integral  : %f\n",h1->Integral());
    fprintf(anaout,"             Maximum   : %f\n",h1->GetMaximum());
    fprintf(anaout,"             Maximum X : %f\n",h1->GetBinCenter(h1->GetMaximumBin()));
    fprintf(anaout,"             UnderFlow : %f\n",h1->GetBinContent(0));
    fprintf(anaout,"             OverFlow  : %f\n",h1->GetBinContent(h1->GetNbinsX()+1));
    fprintf(anaout,"             nBins     : %i\n",h1->GetNbinsX());
    fprintf(anaout,"             xMin      : %f\n",h1->GetXaxis()->GetXmin());
    fprintf(anaout,"             xMax      : %f\n",h1->GetXaxis()->GetXmax());
    fprintf(anaout,"-----------------------------------------------------------\n");

    return kTRUE;
}
 htool.cc:1
 htool.cc:2
 htool.cc:3
 htool.cc:4
 htool.cc:5
 htool.cc:6
 htool.cc:7
 htool.cc:8
 htool.cc:9
 htool.cc:10
 htool.cc:11
 htool.cc:12
 htool.cc:13
 htool.cc:14
 htool.cc:15
 htool.cc:16
 htool.cc:17
 htool.cc:18
 htool.cc:19
 htool.cc:20
 htool.cc:21
 htool.cc:22
 htool.cc:23
 htool.cc:24
 htool.cc:25
 htool.cc:26
 htool.cc:27
 htool.cc:28
 htool.cc:29
 htool.cc:30
 htool.cc:31
 htool.cc:32
 htool.cc:33
 htool.cc:34
 htool.cc:35
 htool.cc:36
 htool.cc:37
 htool.cc:38
 htool.cc:39
 htool.cc:40
 htool.cc:41
 htool.cc:42
 htool.cc:43
 htool.cc:44
 htool.cc:45
 htool.cc:46
 htool.cc:47
 htool.cc:48
 htool.cc:49
 htool.cc:50
 htool.cc:51
 htool.cc:52
 htool.cc:53
 htool.cc:54
 htool.cc:55
 htool.cc:56
 htool.cc:57
 htool.cc:58
 htool.cc:59
 htool.cc:60
 htool.cc:61
 htool.cc:62
 htool.cc:63
 htool.cc:64
 htool.cc:65
 htool.cc:66
 htool.cc:67
 htool.cc:68
 htool.cc:69
 htool.cc:70
 htool.cc:71
 htool.cc:72
 htool.cc:73
 htool.cc:74
 htool.cc:75
 htool.cc:76
 htool.cc:77
 htool.cc:78
 htool.cc:79
 htool.cc:80
 htool.cc:81
 htool.cc:82
 htool.cc:83
 htool.cc:84
 htool.cc:85
 htool.cc:86
 htool.cc:87
 htool.cc:88
 htool.cc:89
 htool.cc:90
 htool.cc:91
 htool.cc:92
 htool.cc:93
 htool.cc:94
 htool.cc:95
 htool.cc:96
 htool.cc:97
 htool.cc:98
 htool.cc:99
 htool.cc:100
 htool.cc:101
 htool.cc:102
 htool.cc:103
 htool.cc:104
 htool.cc:105
 htool.cc:106
 htool.cc:107
 htool.cc:108
 htool.cc:109
 htool.cc:110
 htool.cc:111
 htool.cc:112
 htool.cc:113
 htool.cc:114
 htool.cc:115
 htool.cc:116
 htool.cc:117
 htool.cc:118
 htool.cc:119
 htool.cc:120
 htool.cc:121
 htool.cc:122
 htool.cc:123
 htool.cc:124
 htool.cc:125
 htool.cc:126
 htool.cc:127
 htool.cc:128
 htool.cc:129
 htool.cc:130
 htool.cc:131
 htool.cc:132
 htool.cc:133
 htool.cc:134
 htool.cc:135
 htool.cc:136
 htool.cc:137
 htool.cc:138
 htool.cc:139
 htool.cc:140
 htool.cc:141
 htool.cc:142
 htool.cc:143
 htool.cc:144
 htool.cc:145
 htool.cc:146
 htool.cc:147
 htool.cc:148
 htool.cc:149
 htool.cc:150
 htool.cc:151
 htool.cc:152
 htool.cc:153
 htool.cc:154
 htool.cc:155
 htool.cc:156
 htool.cc:157
 htool.cc:158
 htool.cc:159
 htool.cc:160
 htool.cc:161
 htool.cc:162
 htool.cc:163
 htool.cc:164
 htool.cc:165
 htool.cc:166
 htool.cc:167
 htool.cc:168
 htool.cc:169
 htool.cc:170
 htool.cc:171
 htool.cc:172
 htool.cc:173
 htool.cc:174
 htool.cc:175
 htool.cc:176
 htool.cc:177
 htool.cc:178
 htool.cc:179
 htool.cc:180
 htool.cc:181
 htool.cc:182
 htool.cc:183
 htool.cc:184
 htool.cc:185
 htool.cc:186
 htool.cc:187
 htool.cc:188
 htool.cc:189
 htool.cc:190
 htool.cc:191
 htool.cc:192
 htool.cc:193
 htool.cc:194
 htool.cc:195
 htool.cc:196
 htool.cc:197
 htool.cc:198
 htool.cc:199
 htool.cc:200
 htool.cc:201
 htool.cc:202
 htool.cc:203
 htool.cc:204
 htool.cc:205
 htool.cc:206
 htool.cc:207
 htool.cc:208
 htool.cc:209
 htool.cc:210
 htool.cc:211
 htool.cc:212
 htool.cc:213
 htool.cc:214
 htool.cc:215
 htool.cc:216
 htool.cc:217
 htool.cc:218
 htool.cc:219
 htool.cc:220
 htool.cc:221
 htool.cc:222
 htool.cc:223
 htool.cc:224
 htool.cc:225
 htool.cc:226
 htool.cc:227
 htool.cc:228
 htool.cc:229
 htool.cc:230
 htool.cc:231
 htool.cc:232
 htool.cc:233
 htool.cc:234
 htool.cc:235
 htool.cc:236
 htool.cc:237
 htool.cc:238
 htool.cc:239
 htool.cc:240
 htool.cc:241
 htool.cc:242
 htool.cc:243
 htool.cc:244
 htool.cc:245
 htool.cc:246
 htool.cc:247
 htool.cc:248
 htool.cc:249
 htool.cc:250
 htool.cc:251
 htool.cc:252
 htool.cc:253
 htool.cc:254
 htool.cc:255
 htool.cc:256
 htool.cc:257
 htool.cc:258
 htool.cc:259
 htool.cc:260
 htool.cc:261
 htool.cc:262
 htool.cc:263
 htool.cc:264
 htool.cc:265
 htool.cc:266
 htool.cc:267
 htool.cc:268
 htool.cc:269
 htool.cc:270
 htool.cc:271
 htool.cc:272
 htool.cc:273
 htool.cc:274
 htool.cc:275
 htool.cc:276
 htool.cc:277
 htool.cc:278
 htool.cc:279
 htool.cc:280
 htool.cc:281
 htool.cc:282
 htool.cc:283
 htool.cc:284
 htool.cc:285
 htool.cc:286
 htool.cc:287
 htool.cc:288
 htool.cc:289
 htool.cc:290
 htool.cc:291
 htool.cc:292
 htool.cc:293
 htool.cc:294
 htool.cc:295
 htool.cc:296
 htool.cc:297
 htool.cc:298
 htool.cc:299
 htool.cc:300
 htool.cc:301
 htool.cc:302
 htool.cc:303
 htool.cc:304
 htool.cc:305
 htool.cc:306
 htool.cc:307
 htool.cc:308
 htool.cc:309
 htool.cc:310
 htool.cc:311
 htool.cc:312
 htool.cc:313
 htool.cc:314
 htool.cc:315
 htool.cc:316
 htool.cc:317
 htool.cc:318
 htool.cc:319
 htool.cc:320
 htool.cc:321
 htool.cc:322
 htool.cc:323
 htool.cc:324
 htool.cc:325
 htool.cc:326
 htool.cc:327
 htool.cc:328
 htool.cc:329
 htool.cc:330
 htool.cc:331
 htool.cc:332
 htool.cc:333
 htool.cc:334
 htool.cc:335
 htool.cc:336
 htool.cc:337
 htool.cc:338
 htool.cc:339
 htool.cc:340
 htool.cc:341
 htool.cc:342
 htool.cc:343
 htool.cc:344
 htool.cc:345
 htool.cc:346
 htool.cc:347
 htool.cc:348
 htool.cc:349
 htool.cc:350
 htool.cc:351
 htool.cc:352
 htool.cc:353
 htool.cc:354
 htool.cc:355
 htool.cc:356
 htool.cc:357
 htool.cc:358
 htool.cc:359
 htool.cc:360
 htool.cc:361
 htool.cc:362
 htool.cc:363
 htool.cc:364
 htool.cc:365
 htool.cc:366
 htool.cc:367
 htool.cc:368
 htool.cc:369
 htool.cc:370
 htool.cc:371
 htool.cc:372
 htool.cc:373
 htool.cc:374
 htool.cc:375
 htool.cc:376
 htool.cc:377
 htool.cc:378
 htool.cc:379
 htool.cc:380
 htool.cc:381
 htool.cc:382
 htool.cc:383
 htool.cc:384
 htool.cc:385
 htool.cc:386
 htool.cc:387
 htool.cc:388
 htool.cc:389
 htool.cc:390
 htool.cc:391
 htool.cc:392
 htool.cc:393
 htool.cc:394
 htool.cc:395
 htool.cc:396
 htool.cc:397
 htool.cc:398
 htool.cc:399
 htool.cc:400
 htool.cc:401
 htool.cc:402
 htool.cc:403
 htool.cc:404
 htool.cc:405
 htool.cc:406
 htool.cc:407
 htool.cc:408
 htool.cc:409
 htool.cc:410
 htool.cc:411
 htool.cc:412
 htool.cc:413
 htool.cc:414
 htool.cc:415
 htool.cc:416
 htool.cc:417
 htool.cc:418
 htool.cc:419
 htool.cc:420
 htool.cc:421
 htool.cc:422
 htool.cc:423
 htool.cc:424
 htool.cc:425
 htool.cc:426
 htool.cc:427
 htool.cc:428
 htool.cc:429
 htool.cc:430
 htool.cc:431
 htool.cc:432
 htool.cc:433
 htool.cc:434
 htool.cc:435
 htool.cc:436
 htool.cc:437
 htool.cc:438
 htool.cc:439
 htool.cc:440
 htool.cc:441
 htool.cc:442
 htool.cc:443
 htool.cc:444
 htool.cc:445
 htool.cc:446
 htool.cc:447
 htool.cc:448
 htool.cc:449
 htool.cc:450
 htool.cc:451
 htool.cc:452
 htool.cc:453
 htool.cc:454
 htool.cc:455
 htool.cc:456
 htool.cc:457
 htool.cc:458
 htool.cc:459
 htool.cc:460
 htool.cc:461
 htool.cc:462
 htool.cc:463
 htool.cc:464
 htool.cc:465
 htool.cc:466
 htool.cc:467
 htool.cc:468
 htool.cc:469
 htool.cc:470
 htool.cc:471
 htool.cc:472
 htool.cc:473
 htool.cc:474
 htool.cc:475
 htool.cc:476
 htool.cc:477
 htool.cc:478
 htool.cc:479
 htool.cc:480
 htool.cc:481
 htool.cc:482
 htool.cc:483
 htool.cc:484
 htool.cc:485
 htool.cc:486
 htool.cc:487
 htool.cc:488
 htool.cc:489
 htool.cc:490
 htool.cc:491
 htool.cc:492
 htool.cc:493
 htool.cc:494
 htool.cc:495
 htool.cc:496
 htool.cc:497
 htool.cc:498
 htool.cc:499
 htool.cc:500
 htool.cc:501
 htool.cc:502
 htool.cc:503
 htool.cc:504
 htool.cc:505
 htool.cc:506
 htool.cc:507
 htool.cc:508
 htool.cc:509
 htool.cc:510
 htool.cc:511
 htool.cc:512
 htool.cc:513
 htool.cc:514
 htool.cc:515
 htool.cc:516
 htool.cc:517
 htool.cc:518
 htool.cc:519
 htool.cc:520
 htool.cc:521
 htool.cc:522
 htool.cc:523
 htool.cc:524
 htool.cc:525
 htool.cc:526
 htool.cc:527
 htool.cc:528
 htool.cc:529
 htool.cc:530
 htool.cc:531
 htool.cc:532
 htool.cc:533
 htool.cc:534
 htool.cc:535
 htool.cc:536
 htool.cc:537
 htool.cc:538
 htool.cc:539
 htool.cc:540
 htool.cc:541
 htool.cc:542
 htool.cc:543
 htool.cc:544
 htool.cc:545
 htool.cc:546
 htool.cc:547
 htool.cc:548
 htool.cc:549
 htool.cc:550
 htool.cc:551
 htool.cc:552
 htool.cc:553
 htool.cc:554
 htool.cc:555
 htool.cc:556
 htool.cc:557
 htool.cc:558
 htool.cc:559
 htool.cc:560
 htool.cc:561
 htool.cc:562
 htool.cc:563
 htool.cc:564
 htool.cc:565
 htool.cc:566
 htool.cc:567
 htool.cc:568
 htool.cc:569
 htool.cc:570
 htool.cc:571
 htool.cc:572
 htool.cc:573
 htool.cc:574
 htool.cc:575
 htool.cc:576
 htool.cc:577
 htool.cc:578
 htool.cc:579
 htool.cc:580
 htool.cc:581
 htool.cc:582
 htool.cc:583
 htool.cc:584
 htool.cc:585
 htool.cc:586
 htool.cc:587
 htool.cc:588
 htool.cc:589
 htool.cc:590
 htool.cc:591
 htool.cc:592
 htool.cc:593
 htool.cc:594
 htool.cc:595
 htool.cc:596
 htool.cc:597
 htool.cc:598
 htool.cc:599
 htool.cc:600
 htool.cc:601
 htool.cc:602
 htool.cc:603
 htool.cc:604
 htool.cc:605
 htool.cc:606
 htool.cc:607
 htool.cc:608
 htool.cc:609
 htool.cc:610
 htool.cc:611
 htool.cc:612
 htool.cc:613
 htool.cc:614
 htool.cc:615
 htool.cc:616
 htool.cc:617
 htool.cc:618
 htool.cc:619
 htool.cc:620
 htool.cc:621
 htool.cc:622
 htool.cc:623
 htool.cc:624
 htool.cc:625
 htool.cc:626
 htool.cc:627
 htool.cc:628
 htool.cc:629
 htool.cc:630
 htool.cc:631
 htool.cc:632
 htool.cc:633
 htool.cc:634
 htool.cc:635
 htool.cc:636
 htool.cc:637
 htool.cc:638
 htool.cc:639
 htool.cc:640
 htool.cc:641
 htool.cc:642
 htool.cc:643
 htool.cc:644
 htool.cc:645
 htool.cc:646
 htool.cc:647
 htool.cc:648
 htool.cc:649
 htool.cc:650
 htool.cc:651
 htool.cc:652
 htool.cc:653
 htool.cc:654
 htool.cc:655
 htool.cc:656
 htool.cc:657
 htool.cc:658
 htool.cc:659
 htool.cc:660
 htool.cc:661
 htool.cc:662
 htool.cc:663
 htool.cc:664
 htool.cc:665
 htool.cc:666
 htool.cc:667
 htool.cc:668
 htool.cc:669
 htool.cc:670
 htool.cc:671
 htool.cc:672
 htool.cc:673
 htool.cc:674
 htool.cc:675
 htool.cc:676
 htool.cc:677
 htool.cc:678
 htool.cc:679
 htool.cc:680
 htool.cc:681
 htool.cc:682
 htool.cc:683
 htool.cc:684
 htool.cc:685
 htool.cc:686
 htool.cc:687
 htool.cc:688
 htool.cc:689
 htool.cc:690
 htool.cc:691
 htool.cc:692
 htool.cc:693
 htool.cc:694
 htool.cc:695
 htool.cc:696
 htool.cc:697
 htool.cc:698
 htool.cc:699
 htool.cc:700
 htool.cc:701
 htool.cc:702
 htool.cc:703
 htool.cc:704
 htool.cc:705
 htool.cc:706
 htool.cc:707
 htool.cc:708
 htool.cc:709
 htool.cc:710
 htool.cc:711
 htool.cc:712
 htool.cc:713
 htool.cc:714
 htool.cc:715
 htool.cc:716
 htool.cc:717
 htool.cc:718
 htool.cc:719
 htool.cc:720
 htool.cc:721
 htool.cc:722
 htool.cc:723
 htool.cc:724
 htool.cc:725
 htool.cc:726
 htool.cc:727
 htool.cc:728
 htool.cc:729
 htool.cc:730
 htool.cc:731
 htool.cc:732
 htool.cc:733
 htool.cc:734
 htool.cc:735
 htool.cc:736
 htool.cc:737
 htool.cc:738
 htool.cc:739
 htool.cc:740
 htool.cc:741
 htool.cc:742
 htool.cc:743
 htool.cc:744
 htool.cc:745
 htool.cc:746
 htool.cc:747
 htool.cc:748
 htool.cc:749
 htool.cc:750
 htool.cc:751
 htool.cc:752
 htool.cc:753
 htool.cc:754
 htool.cc:755
 htool.cc:756
 htool.cc:757
 htool.cc:758
 htool.cc:759
 htool.cc:760
 htool.cc:761
 htool.cc:762
 htool.cc:763
 htool.cc:764
 htool.cc:765
 htool.cc:766
 htool.cc:767
 htool.cc:768
 htool.cc:769
 htool.cc:770
 htool.cc:771
 htool.cc:772
 htool.cc:773
 htool.cc:774
 htool.cc:775
 htool.cc:776
 htool.cc:777
 htool.cc:778
 htool.cc:779
 htool.cc:780
 htool.cc:781
 htool.cc:782
 htool.cc:783
 htool.cc:784
 htool.cc:785
 htool.cc:786
 htool.cc:787
 htool.cc:788
 htool.cc:789
 htool.cc:790
 htool.cc:791
 htool.cc:792
 htool.cc:793
 htool.cc:794
 htool.cc:795
 htool.cc:796
 htool.cc:797
 htool.cc:798
 htool.cc:799
 htool.cc:800
 htool.cc:801
 htool.cc:802
 htool.cc:803
 htool.cc:804
 htool.cc:805
 htool.cc:806
 htool.cc:807
 htool.cc:808
 htool.cc:809
 htool.cc:810
 htool.cc:811
 htool.cc:812
 htool.cc:813
 htool.cc:814
 htool.cc:815
 htool.cc:816
 htool.cc:817
 htool.cc:818
 htool.cc:819
 htool.cc:820
 htool.cc:821
 htool.cc:822
 htool.cc:823
 htool.cc:824
 htool.cc:825
 htool.cc:826
 htool.cc:827
 htool.cc:828
 htool.cc:829
 htool.cc:830
 htool.cc:831
 htool.cc:832
 htool.cc:833
 htool.cc:834
 htool.cc:835
 htool.cc:836
 htool.cc:837
 htool.cc:838
 htool.cc:839
 htool.cc:840
 htool.cc:841
 htool.cc:842
 htool.cc:843
 htool.cc:844
 htool.cc:845
 htool.cc:846
 htool.cc:847
 htool.cc:848
 htool.cc:849
 htool.cc:850
 htool.cc:851
 htool.cc:852
 htool.cc:853
 htool.cc:854
 htool.cc:855
 htool.cc:856
 htool.cc:857
 htool.cc:858
 htool.cc:859
 htool.cc:860
 htool.cc:861
 htool.cc:862
 htool.cc:863
 htool.cc:864
 htool.cc:865
 htool.cc:866
 htool.cc:867
 htool.cc:868
 htool.cc:869
 htool.cc:870
 htool.cc:871
 htool.cc:872
 htool.cc:873
 htool.cc:874
 htool.cc:875
 htool.cc:876
 htool.cc:877
 htool.cc:878
 htool.cc:879
 htool.cc:880
 htool.cc:881
 htool.cc:882
 htool.cc:883
 htool.cc:884
 htool.cc:885
 htool.cc:886
 htool.cc:887
 htool.cc:888
 htool.cc:889
 htool.cc:890
 htool.cc:891
 htool.cc:892
 htool.cc:893
 htool.cc:894
 htool.cc:895
 htool.cc:896
 htool.cc:897
 htool.cc:898
 htool.cc:899
 htool.cc:900
 htool.cc:901
 htool.cc:902
 htool.cc:903
 htool.cc:904
 htool.cc:905
 htool.cc:906
 htool.cc:907
 htool.cc:908
 htool.cc:909
 htool.cc:910
 htool.cc:911
 htool.cc:912
 htool.cc:913
 htool.cc:914
 htool.cc:915
 htool.cc:916
 htool.cc:917
 htool.cc:918
 htool.cc:919
 htool.cc:920
 htool.cc:921
 htool.cc:922
 htool.cc:923
 htool.cc:924
 htool.cc:925
 htool.cc:926
 htool.cc:927
 htool.cc:928
 htool.cc:929
 htool.cc:930
 htool.cc:931
 htool.cc:932
 htool.cc:933
 htool.cc:934
 htool.cc:935
 htool.cc:936
 htool.cc:937
 htool.cc:938
 htool.cc:939
 htool.cc:940
 htool.cc:941
 htool.cc:942
 htool.cc:943
 htool.cc:944
 htool.cc:945
 htool.cc:946
 htool.cc:947
 htool.cc:948
 htool.cc:949
 htool.cc:950
 htool.cc:951
 htool.cc:952
 htool.cc:953
 htool.cc:954
 htool.cc:955
 htool.cc:956
 htool.cc:957
 htool.cc:958
 htool.cc:959
 htool.cc:960
 htool.cc:961
 htool.cc:962
 htool.cc:963
 htool.cc:964
 htool.cc:965
 htool.cc:966
 htool.cc:967
 htool.cc:968
 htool.cc:969
 htool.cc:970
 htool.cc:971
 htool.cc:972
 htool.cc:973
 htool.cc:974
 htool.cc:975
 htool.cc:976
 htool.cc:977
 htool.cc:978
 htool.cc:979
 htool.cc:980
 htool.cc:981
 htool.cc:982
 htool.cc:983
 htool.cc:984
 htool.cc:985
 htool.cc:986
 htool.cc:987
 htool.cc:988
 htool.cc:989
 htool.cc:990
 htool.cc:991
 htool.cc:992
 htool.cc:993
 htool.cc:994
 htool.cc:995
 htool.cc:996
 htool.cc:997
 htool.cc:998
 htool.cc:999
 htool.cc:1000
 htool.cc:1001
 htool.cc:1002
 htool.cc:1003
 htool.cc:1004
 htool.cc:1005
 htool.cc:1006
 htool.cc:1007
 htool.cc:1008
 htool.cc:1009
 htool.cc:1010
 htool.cc:1011
 htool.cc:1012
 htool.cc:1013
 htool.cc:1014
 htool.cc:1015
 htool.cc:1016
 htool.cc:1017
 htool.cc:1018
 htool.cc:1019
 htool.cc:1020
 htool.cc:1021
 htool.cc:1022
 htool.cc:1023
 htool.cc:1024
 htool.cc:1025
 htool.cc:1026
 htool.cc:1027
 htool.cc:1028
 htool.cc:1029
 htool.cc:1030
 htool.cc:1031
 htool.cc:1032
 htool.cc:1033
 htool.cc:1034
 htool.cc:1035
 htool.cc:1036
 htool.cc:1037
 htool.cc:1038
 htool.cc:1039
 htool.cc:1040
 htool.cc:1041
 htool.cc:1042
 htool.cc:1043
 htool.cc:1044
 htool.cc:1045
 htool.cc:1046
 htool.cc:1047
 htool.cc:1048
 htool.cc:1049
 htool.cc:1050
 htool.cc:1051
 htool.cc:1052
 htool.cc:1053
 htool.cc:1054
 htool.cc:1055
 htool.cc:1056
 htool.cc:1057
 htool.cc:1058
 htool.cc:1059
 htool.cc:1060
 htool.cc:1061
 htool.cc:1062
 htool.cc:1063
 htool.cc:1064
 htool.cc:1065
 htool.cc:1066
 htool.cc:1067
 htool.cc:1068
 htool.cc:1069
 htool.cc:1070
 htool.cc:1071
 htool.cc:1072
 htool.cc:1073
 htool.cc:1074
 htool.cc:1075
 htool.cc:1076
 htool.cc:1077
 htool.cc:1078
 htool.cc:1079
 htool.cc:1080
 htool.cc:1081
 htool.cc:1082
 htool.cc:1083
 htool.cc:1084
 htool.cc:1085
 htool.cc:1086
 htool.cc:1087
 htool.cc:1088
 htool.cc:1089
 htool.cc:1090
 htool.cc:1091
 htool.cc:1092
 htool.cc:1093
 htool.cc:1094
 htool.cc:1095
 htool.cc:1096
 htool.cc:1097
 htool.cc:1098
 htool.cc:1099
 htool.cc:1100
 htool.cc:1101
 htool.cc:1102
 htool.cc:1103
 htool.cc:1104
 htool.cc:1105
 htool.cc:1106
 htool.cc:1107
 htool.cc:1108
 htool.cc:1109
 htool.cc:1110
 htool.cc:1111
 htool.cc:1112
 htool.cc:1113
 htool.cc:1114
 htool.cc:1115
 htool.cc:1116
 htool.cc:1117
 htool.cc:1118
 htool.cc:1119
 htool.cc:1120
 htool.cc:1121
 htool.cc:1122
 htool.cc:1123
 htool.cc:1124
 htool.cc:1125
 htool.cc:1126
 htool.cc:1127
 htool.cc:1128
 htool.cc:1129
 htool.cc:1130
 htool.cc:1131
 htool.cc:1132
 htool.cc:1133
 htool.cc:1134
 htool.cc:1135
 htool.cc:1136
 htool.cc:1137
 htool.cc:1138
 htool.cc:1139
 htool.cc:1140
 htool.cc:1141
 htool.cc:1142
 htool.cc:1143
 htool.cc:1144
 htool.cc:1145
 htool.cc:1146
 htool.cc:1147
 htool.cc:1148
 htool.cc:1149
 htool.cc:1150
 htool.cc:1151
 htool.cc:1152
 htool.cc:1153
 htool.cc:1154
 htool.cc:1155
 htool.cc:1156
 htool.cc:1157
 htool.cc:1158
 htool.cc:1159
 htool.cc:1160
 htool.cc:1161
 htool.cc:1162
 htool.cc:1163
 htool.cc:1164
 htool.cc:1165
 htool.cc:1166
 htool.cc:1167
 htool.cc:1168
 htool.cc:1169
 htool.cc:1170
 htool.cc:1171
 htool.cc:1172
 htool.cc:1173
 htool.cc:1174
 htool.cc:1175
 htool.cc:1176
 htool.cc:1177
 htool.cc:1178
 htool.cc:1179
 htool.cc:1180
 htool.cc:1181
 htool.cc:1182
 htool.cc:1183
 htool.cc:1184
 htool.cc:1185
 htool.cc:1186
 htool.cc:1187
 htool.cc:1188
 htool.cc:1189
 htool.cc:1190
 htool.cc:1191
 htool.cc:1192
 htool.cc:1193
 htool.cc:1194
 htool.cc:1195
 htool.cc:1196
 htool.cc:1197
 htool.cc:1198
 htool.cc:1199
 htool.cc:1200
 htool.cc:1201
 htool.cc:1202
 htool.cc:1203
 htool.cc:1204
 htool.cc:1205
 htool.cc:1206
 htool.cc:1207
 htool.cc:1208
 htool.cc:1209
 htool.cc:1210
 htool.cc:1211
 htool.cc:1212
 htool.cc:1213
 htool.cc:1214
 htool.cc:1215
 htool.cc:1216
 htool.cc:1217
 htool.cc:1218
 htool.cc:1219
 htool.cc:1220
 htool.cc:1221
 htool.cc:1222
 htool.cc:1223
 htool.cc:1224
 htool.cc:1225
 htool.cc:1226
 htool.cc:1227
 htool.cc:1228
 htool.cc:1229
 htool.cc:1230
 htool.cc:1231
 htool.cc:1232
 htool.cc:1233
 htool.cc:1234
 htool.cc:1235
 htool.cc:1236
 htool.cc:1237
 htool.cc:1238
 htool.cc:1239
 htool.cc:1240
 htool.cc:1241
 htool.cc:1242
 htool.cc:1243
 htool.cc:1244
 htool.cc:1245
 htool.cc:1246
 htool.cc:1247
 htool.cc:1248
 htool.cc:1249
 htool.cc:1250
 htool.cc:1251
 htool.cc:1252
 htool.cc:1253
 htool.cc:1254
 htool.cc:1255
 htool.cc:1256
 htool.cc:1257
 htool.cc:1258
 htool.cc:1259
 htool.cc:1260
 htool.cc:1261
 htool.cc:1262
 htool.cc:1263
 htool.cc:1264
 htool.cc:1265
 htool.cc:1266
 htool.cc:1267
 htool.cc:1268
 htool.cc:1269
 htool.cc:1270
 htool.cc:1271
 htool.cc:1272
 htool.cc:1273
 htool.cc:1274
 htool.cc:1275
 htool.cc:1276
 htool.cc:1277
 htool.cc:1278
 htool.cc:1279
 htool.cc:1280
 htool.cc:1281
 htool.cc:1282
 htool.cc:1283
 htool.cc:1284
 htool.cc:1285
 htool.cc:1286
 htool.cc:1287
 htool.cc:1288
 htool.cc:1289
 htool.cc:1290
 htool.cc:1291
 htool.cc:1292
 htool.cc:1293
 htool.cc:1294
 htool.cc:1295
 htool.cc:1296
 htool.cc:1297
 htool.cc:1298
 htool.cc:1299
 htool.cc:1300
 htool.cc:1301
 htool.cc:1302
 htool.cc:1303
 htool.cc:1304
 htool.cc:1305
 htool.cc:1306
 htool.cc:1307
 htool.cc:1308
 htool.cc:1309
 htool.cc:1310
 htool.cc:1311
 htool.cc:1312
 htool.cc:1313
 htool.cc:1314
 htool.cc:1315
 htool.cc:1316
 htool.cc:1317
 htool.cc:1318
 htool.cc:1319
 htool.cc:1320
 htool.cc:1321
 htool.cc:1322
 htool.cc:1323
 htool.cc:1324
 htool.cc:1325
 htool.cc:1326
 htool.cc:1327
 htool.cc:1328
 htool.cc:1329
 htool.cc:1330
 htool.cc:1331
 htool.cc:1332
 htool.cc:1333
 htool.cc:1334
 htool.cc:1335
 htool.cc:1336
 htool.cc:1337
 htool.cc:1338
 htool.cc:1339
 htool.cc:1340
 htool.cc:1341
 htool.cc:1342
 htool.cc:1343
 htool.cc:1344
 htool.cc:1345
 htool.cc:1346
 htool.cc:1347
 htool.cc:1348
 htool.cc:1349
 htool.cc:1350
 htool.cc:1351
 htool.cc:1352
 htool.cc:1353
 htool.cc:1354
 htool.cc:1355
 htool.cc:1356
 htool.cc:1357
 htool.cc:1358
 htool.cc:1359
 htool.cc:1360
 htool.cc:1361
 htool.cc:1362
 htool.cc:1363
 htool.cc:1364
 htool.cc:1365
 htool.cc:1366
 htool.cc:1367
 htool.cc:1368
 htool.cc:1369
 htool.cc:1370
 htool.cc:1371
 htool.cc:1372
 htool.cc:1373
 htool.cc:1374
 htool.cc:1375
 htool.cc:1376
 htool.cc:1377
 htool.cc:1378
 htool.cc:1379
 htool.cc:1380
 htool.cc:1381
 htool.cc:1382
 htool.cc:1383
 htool.cc:1384
 htool.cc:1385
 htool.cc:1386
 htool.cc:1387
 htool.cc:1388
 htool.cc:1389
 htool.cc:1390
 htool.cc:1391
 htool.cc:1392
 htool.cc:1393
 htool.cc:1394
 htool.cc:1395
 htool.cc:1396
 htool.cc:1397
 htool.cc:1398
 htool.cc:1399
 htool.cc:1400
 htool.cc:1401
 htool.cc:1402
 htool.cc:1403
 htool.cc:1404
 htool.cc:1405
 htool.cc:1406
 htool.cc:1407
 htool.cc:1408
 htool.cc:1409
 htool.cc:1410
 htool.cc:1411
 htool.cc:1412
 htool.cc:1413
 htool.cc:1414
 htool.cc:1415
 htool.cc:1416
 htool.cc:1417
 htool.cc:1418
 htool.cc:1419
 htool.cc:1420
 htool.cc:1421
 htool.cc:1422
 htool.cc:1423
 htool.cc:1424
 htool.cc:1425
 htool.cc:1426
 htool.cc:1427
 htool.cc:1428
 htool.cc:1429
 htool.cc:1430
 htool.cc:1431
 htool.cc:1432
 htool.cc:1433
 htool.cc:1434
 htool.cc:1435
 htool.cc:1436
 htool.cc:1437
 htool.cc:1438
 htool.cc:1439
 htool.cc:1440
 htool.cc:1441
 htool.cc:1442
 htool.cc:1443
 htool.cc:1444
 htool.cc:1445
 htool.cc:1446
 htool.cc:1447
 htool.cc:1448
 htool.cc:1449
 htool.cc:1450
 htool.cc:1451
 htool.cc:1452
 htool.cc:1453
 htool.cc:1454
 htool.cc:1455
 htool.cc:1456
 htool.cc:1457
 htool.cc:1458
 htool.cc:1459
 htool.cc:1460
 htool.cc:1461
 htool.cc:1462
 htool.cc:1463
 htool.cc:1464
 htool.cc:1465
 htool.cc:1466
 htool.cc:1467
 htool.cc:1468
 htool.cc:1469
 htool.cc:1470
 htool.cc:1471
 htool.cc:1472
 htool.cc:1473
 htool.cc:1474
 htool.cc:1475
 htool.cc:1476
 htool.cc:1477
 htool.cc:1478
 htool.cc:1479
 htool.cc:1480
 htool.cc:1481
 htool.cc:1482
 htool.cc:1483
 htool.cc:1484
 htool.cc:1485
 htool.cc:1486
 htool.cc:1487
 htool.cc:1488
 htool.cc:1489
 htool.cc:1490
 htool.cc:1491
 htool.cc:1492
 htool.cc:1493
 htool.cc:1494
 htool.cc:1495
 htool.cc:1496
 htool.cc:1497
 htool.cc:1498
 htool.cc:1499
 htool.cc:1500
 htool.cc:1501
 htool.cc:1502
 htool.cc:1503
 htool.cc:1504
 htool.cc:1505
 htool.cc:1506
 htool.cc:1507
 htool.cc:1508
 htool.cc:1509
 htool.cc:1510
 htool.cc:1511
 htool.cc:1512
 htool.cc:1513
 htool.cc:1514
 htool.cc:1515
 htool.cc:1516
 htool.cc:1517
 htool.cc:1518
 htool.cc:1519
 htool.cc:1520
 htool.cc:1521
 htool.cc:1522
 htool.cc:1523
 htool.cc:1524
 htool.cc:1525
 htool.cc:1526
 htool.cc:1527
 htool.cc:1528
 htool.cc:1529
 htool.cc:1530
 htool.cc:1531
 htool.cc:1532
 htool.cc:1533
 htool.cc:1534
 htool.cc:1535
 htool.cc:1536
 htool.cc:1537
 htool.cc:1538
 htool.cc:1539
 htool.cc:1540
 htool.cc:1541
 htool.cc:1542
 htool.cc:1543
 htool.cc:1544
 htool.cc:1545
 htool.cc:1546
 htool.cc:1547
 htool.cc:1548
 htool.cc:1549
 htool.cc:1550
 htool.cc:1551
 htool.cc:1552
 htool.cc:1553
 htool.cc:1554
 htool.cc:1555
 htool.cc:1556
 htool.cc:1557
 htool.cc:1558
 htool.cc:1559
 htool.cc:1560
 htool.cc:1561
 htool.cc:1562
 htool.cc:1563
 htool.cc:1564
 htool.cc:1565
 htool.cc:1566
 htool.cc:1567
 htool.cc:1568
 htool.cc:1569
 htool.cc:1570
 htool.cc:1571
 htool.cc:1572
 htool.cc:1573
 htool.cc:1574
 htool.cc:1575
 htool.cc:1576
 htool.cc:1577
 htool.cc:1578
 htool.cc:1579
 htool.cc:1580
 htool.cc:1581
 htool.cc:1582
 htool.cc:1583
 htool.cc:1584
 htool.cc:1585
 htool.cc:1586
 htool.cc:1587
 htool.cc:1588
 htool.cc:1589
 htool.cc:1590
 htool.cc:1591
 htool.cc:1592
 htool.cc:1593
 htool.cc:1594
 htool.cc:1595
 htool.cc:1596
 htool.cc:1597
 htool.cc:1598
 htool.cc:1599
 htool.cc:1600
 htool.cc:1601
 htool.cc:1602
 htool.cc:1603
 htool.cc:1604
 htool.cc:1605
 htool.cc:1606
 htool.cc:1607
 htool.cc:1608
 htool.cc:1609
 htool.cc:1610
 htool.cc:1611
 htool.cc:1612
 htool.cc:1613
 htool.cc:1614
 htool.cc:1615
 htool.cc:1616
 htool.cc:1617
 htool.cc:1618
 htool.cc:1619
 htool.cc:1620
 htool.cc:1621
 htool.cc:1622
 htool.cc:1623
 htool.cc:1624
 htool.cc:1625
 htool.cc:1626
 htool.cc:1627
 htool.cc:1628
 htool.cc:1629
 htool.cc:1630
 htool.cc:1631
 htool.cc:1632
 htool.cc:1633
 htool.cc:1634
 htool.cc:1635
 htool.cc:1636
 htool.cc:1637
 htool.cc:1638
 htool.cc:1639
 htool.cc:1640
 htool.cc:1641
 htool.cc:1642
 htool.cc:1643
 htool.cc:1644
 htool.cc:1645
 htool.cc:1646
 htool.cc:1647
 htool.cc:1648
 htool.cc:1649
 htool.cc:1650
 htool.cc:1651
 htool.cc:1652
 htool.cc:1653
 htool.cc:1654
 htool.cc:1655
 htool.cc:1656
 htool.cc:1657
 htool.cc:1658
 htool.cc:1659
 htool.cc:1660
 htool.cc:1661
 htool.cc:1662
 htool.cc:1663
 htool.cc:1664
 htool.cc:1665
 htool.cc:1666
 htool.cc:1667
 htool.cc:1668
 htool.cc:1669
 htool.cc:1670
 htool.cc:1671
 htool.cc:1672
 htool.cc:1673
 htool.cc:1674
 htool.cc:1675
 htool.cc:1676
 htool.cc:1677
 htool.cc:1678
 htool.cc:1679
 htool.cc:1680
 htool.cc:1681
 htool.cc:1682
 htool.cc:1683
 htool.cc:1684
 htool.cc:1685
 htool.cc:1686
 htool.cc:1687
 htool.cc:1688
 htool.cc:1689
 htool.cc:1690
 htool.cc:1691
 htool.cc:1692
 htool.cc:1693
 htool.cc:1694
 htool.cc:1695
 htool.cc:1696
 htool.cc:1697
 htool.cc:1698
 htool.cc:1699
 htool.cc:1700
 htool.cc:1701
 htool.cc:1702
 htool.cc:1703
 htool.cc:1704
 htool.cc:1705
 htool.cc:1706
 htool.cc:1707
 htool.cc:1708
 htool.cc:1709
 htool.cc:1710
 htool.cc:1711
 htool.cc:1712
 htool.cc:1713
 htool.cc:1714
 htool.cc:1715
 htool.cc:1716
 htool.cc:1717
 htool.cc:1718
 htool.cc:1719
 htool.cc:1720
 htool.cc:1721
 htool.cc:1722
 htool.cc:1723
 htool.cc:1724
 htool.cc:1725
 htool.cc:1726
 htool.cc:1727
 htool.cc:1728
 htool.cc:1729
 htool.cc:1730
 htool.cc:1731
 htool.cc:1732
 htool.cc:1733
 htool.cc:1734
 htool.cc:1735
 htool.cc:1736
 htool.cc:1737
 htool.cc:1738
 htool.cc:1739
 htool.cc:1740
 htool.cc:1741
 htool.cc:1742
 htool.cc:1743
 htool.cc:1744
 htool.cc:1745
 htool.cc:1746
 htool.cc:1747
 htool.cc:1748
 htool.cc:1749
 htool.cc:1750
 htool.cc:1751
 htool.cc:1752
 htool.cc:1753
 htool.cc:1754
 htool.cc:1755
 htool.cc:1756
 htool.cc:1757
 htool.cc:1758
 htool.cc:1759
 htool.cc:1760
 htool.cc:1761
 htool.cc:1762
 htool.cc:1763
 htool.cc:1764
 htool.cc:1765
 htool.cc:1766
 htool.cc:1767
 htool.cc:1768
 htool.cc:1769
 htool.cc:1770
 htool.cc:1771
 htool.cc:1772
 htool.cc:1773
 htool.cc:1774
 htool.cc:1775
 htool.cc:1776
 htool.cc:1777
 htool.cc:1778
 htool.cc:1779
 htool.cc:1780
 htool.cc:1781
 htool.cc:1782
 htool.cc:1783
 htool.cc:1784
 htool.cc:1785
 htool.cc:1786
 htool.cc:1787
 htool.cc:1788
 htool.cc:1789
 htool.cc:1790
 htool.cc:1791
 htool.cc:1792
 htool.cc:1793
 htool.cc:1794
 htool.cc:1795
 htool.cc:1796
 htool.cc:1797
 htool.cc:1798
 htool.cc:1799
 htool.cc:1800
 htool.cc:1801
 htool.cc:1802
 htool.cc:1803
 htool.cc:1804
 htool.cc:1805
 htool.cc:1806
 htool.cc:1807
 htool.cc:1808
 htool.cc:1809
 htool.cc:1810
 htool.cc:1811
 htool.cc:1812
 htool.cc:1813
 htool.cc:1814
 htool.cc:1815
 htool.cc:1816
 htool.cc:1817
 htool.cc:1818
 htool.cc:1819
 htool.cc:1820
 htool.cc:1821
 htool.cc:1822
 htool.cc:1823
 htool.cc:1824
 htool.cc:1825
 htool.cc:1826
 htool.cc:1827
 htool.cc:1828
 htool.cc:1829
 htool.cc:1830
 htool.cc:1831
 htool.cc:1832
 htool.cc:1833
 htool.cc:1834
 htool.cc:1835
 htool.cc:1836
 htool.cc:1837
 htool.cc:1838
 htool.cc:1839
 htool.cc:1840
 htool.cc:1841
 htool.cc:1842
 htool.cc:1843
 htool.cc:1844
 htool.cc:1845
 htool.cc:1846
 htool.cc:1847
 htool.cc:1848
 htool.cc:1849
 htool.cc:1850
 htool.cc:1851
 htool.cc:1852
 htool.cc:1853
 htool.cc:1854
 htool.cc:1855
 htool.cc:1856
 htool.cc:1857
 htool.cc:1858
 htool.cc:1859
 htool.cc:1860
 htool.cc:1861
 htool.cc:1862
 htool.cc:1863
 htool.cc:1864
 htool.cc:1865
 htool.cc:1866
 htool.cc:1867
 htool.cc:1868
 htool.cc:1869
 htool.cc:1870
 htool.cc:1871
 htool.cc:1872
 htool.cc:1873
 htool.cc:1874
 htool.cc:1875
 htool.cc:1876
 htool.cc:1877
 htool.cc:1878
 htool.cc:1879
 htool.cc:1880
 htool.cc:1881
 htool.cc:1882
 htool.cc:1883
 htool.cc:1884
 htool.cc:1885
 htool.cc:1886
 htool.cc:1887
 htool.cc:1888
 htool.cc:1889
 htool.cc:1890
 htool.cc:1891
 htool.cc:1892
 htool.cc:1893
 htool.cc:1894
 htool.cc:1895
 htool.cc:1896
 htool.cc:1897
 htool.cc:1898
 htool.cc:1899
 htool.cc:1900
 htool.cc:1901
 htool.cc:1902
 htool.cc:1903
 htool.cc:1904
 htool.cc:1905
 htool.cc:1906
 htool.cc:1907
 htool.cc:1908
 htool.cc:1909
 htool.cc:1910
 htool.cc:1911
 htool.cc:1912
 htool.cc:1913
 htool.cc:1914
 htool.cc:1915
 htool.cc:1916
 htool.cc:1917
 htool.cc:1918
 htool.cc:1919
 htool.cc:1920
 htool.cc:1921
 htool.cc:1922
 htool.cc:1923
 htool.cc:1924
 htool.cc:1925
 htool.cc:1926
 htool.cc:1927
 htool.cc:1928
 htool.cc:1929
 htool.cc:1930
 htool.cc:1931
 htool.cc:1932
 htool.cc:1933
 htool.cc:1934
 htool.cc:1935
 htool.cc:1936
 htool.cc:1937
 htool.cc:1938
 htool.cc:1939
 htool.cc:1940
 htool.cc:1941
 htool.cc:1942
 htool.cc:1943
 htool.cc:1944
 htool.cc:1945
 htool.cc:1946
 htool.cc:1947
 htool.cc:1948
 htool.cc:1949
 htool.cc:1950
 htool.cc:1951
 htool.cc:1952
 htool.cc:1953
 htool.cc:1954
 htool.cc:1955
 htool.cc:1956
 htool.cc:1957
 htool.cc:1958
 htool.cc:1959
 htool.cc:1960
 htool.cc:1961
 htool.cc:1962
 htool.cc:1963
 htool.cc:1964
 htool.cc:1965
 htool.cc:1966
 htool.cc:1967
 htool.cc:1968
 htool.cc:1969
 htool.cc:1970
 htool.cc:1971
 htool.cc:1972
 htool.cc:1973
 htool.cc:1974
 htool.cc:1975
 htool.cc:1976
 htool.cc:1977
 htool.cc:1978
 htool.cc:1979
 htool.cc:1980
 htool.cc:1981
 htool.cc:1982
 htool.cc:1983
 htool.cc:1984
 htool.cc:1985
 htool.cc:1986
 htool.cc:1987
 htool.cc:1988
 htool.cc:1989
 htool.cc:1990
 htool.cc:1991
 htool.cc:1992
 htool.cc:1993
 htool.cc:1994
 htool.cc:1995
 htool.cc:1996
 htool.cc:1997
 htool.cc:1998
 htool.cc:1999
 htool.cc:2000
 htool.cc:2001
 htool.cc:2002
 htool.cc:2003
 htool.cc:2004
 htool.cc:2005
 htool.cc:2006
 htool.cc:2007
 htool.cc:2008
 htool.cc:2009
 htool.cc:2010
 htool.cc:2011
 htool.cc:2012
 htool.cc:2013
 htool.cc:2014
 htool.cc:2015
 htool.cc:2016
 htool.cc:2017
 htool.cc:2018
 htool.cc:2019
 htool.cc:2020
 htool.cc:2021
 htool.cc:2022
 htool.cc:2023
 htool.cc:2024
 htool.cc:2025
 htool.cc:2026
 htool.cc:2027
 htool.cc:2028
 htool.cc:2029
 htool.cc:2030
 htool.cc:2031
 htool.cc:2032
 htool.cc:2033
 htool.cc:2034
 htool.cc:2035
 htool.cc:2036
 htool.cc:2037
 htool.cc:2038
 htool.cc:2039
 htool.cc:2040
 htool.cc:2041
 htool.cc:2042
 htool.cc:2043
 htool.cc:2044
 htool.cc:2045
 htool.cc:2046
 htool.cc:2047
 htool.cc:2048
 htool.cc:2049
 htool.cc:2050
 htool.cc:2051
 htool.cc:2052
 htool.cc:2053
 htool.cc:2054
 htool.cc:2055
 htool.cc:2056
 htool.cc:2057
 htool.cc:2058
 htool.cc:2059
 htool.cc:2060
 htool.cc:2061
 htool.cc:2062
 htool.cc:2063
 htool.cc:2064
 htool.cc:2065
 htool.cc:2066
 htool.cc:2067
 htool.cc:2068
 htool.cc:2069
 htool.cc:2070
 htool.cc:2071
 htool.cc:2072
 htool.cc:2073
 htool.cc:2074
 htool.cc:2075
 htool.cc:2076
 htool.cc:2077
 htool.cc:2078
 htool.cc:2079
 htool.cc:2080
 htool.cc:2081
 htool.cc:2082
 htool.cc:2083
 htool.cc:2084
 htool.cc:2085
 htool.cc:2086
 htool.cc:2087
 htool.cc:2088
 htool.cc:2089
 htool.cc:2090
 htool.cc:2091
 htool.cc:2092
 htool.cc:2093
 htool.cc:2094
 htool.cc:2095
 htool.cc:2096
 htool.cc:2097
 htool.cc:2098
 htool.cc:2099
 htool.cc:2100
 htool.cc:2101
 htool.cc:2102
 htool.cc:2103
 htool.cc:2104
 htool.cc:2105
 htool.cc:2106
 htool.cc:2107
 htool.cc:2108
 htool.cc:2109
 htool.cc:2110
 htool.cc:2111
 htool.cc:2112
 htool.cc:2113
 htool.cc:2114
 htool.cc:2115
 htool.cc:2116
 htool.cc:2117
 htool.cc:2118
 htool.cc:2119
 htool.cc:2120
 htool.cc:2121
 htool.cc:2122
 htool.cc:2123
 htool.cc:2124
 htool.cc:2125
 htool.cc:2126
 htool.cc:2127
 htool.cc:2128
 htool.cc:2129
 htool.cc:2130
 htool.cc:2131
 htool.cc:2132
 htool.cc:2133
 htool.cc:2134
 htool.cc:2135
 htool.cc:2136
 htool.cc:2137
 htool.cc:2138
 htool.cc:2139
 htool.cc:2140
 htool.cc:2141
 htool.cc:2142
 htool.cc:2143
 htool.cc:2144
 htool.cc:2145
 htool.cc:2146
 htool.cc:2147
 htool.cc:2148
 htool.cc:2149
 htool.cc:2150
 htool.cc:2151
 htool.cc:2152
 htool.cc:2153
 htool.cc:2154
 htool.cc:2155
 htool.cc:2156
 htool.cc:2157
 htool.cc:2158
 htool.cc:2159
 htool.cc:2160
 htool.cc:2161
 htool.cc:2162
 htool.cc:2163
 htool.cc:2164
 htool.cc:2165
 htool.cc:2166
 htool.cc:2167
 htool.cc:2168
 htool.cc:2169
 htool.cc:2170
 htool.cc:2171
 htool.cc:2172
 htool.cc:2173
 htool.cc:2174
 htool.cc:2175
 htool.cc:2176
 htool.cc:2177
 htool.cc:2178
 htool.cc:2179
 htool.cc:2180
 htool.cc:2181
 htool.cc:2182
 htool.cc:2183
 htool.cc:2184
 htool.cc:2185
 htool.cc:2186
 htool.cc:2187
 htool.cc:2188
 htool.cc:2189
 htool.cc:2190
 htool.cc:2191
 htool.cc:2192
 htool.cc:2193
 htool.cc:2194
 htool.cc:2195
 htool.cc:2196
 htool.cc:2197
 htool.cc:2198
 htool.cc:2199
 htool.cc:2200
 htool.cc:2201
 htool.cc:2202
 htool.cc:2203
 htool.cc:2204
 htool.cc:2205
 htool.cc:2206
 htool.cc:2207
 htool.cc:2208
 htool.cc:2209
 htool.cc:2210
 htool.cc:2211
 htool.cc:2212
 htool.cc:2213
 htool.cc:2214
 htool.cc:2215
 htool.cc:2216
 htool.cc:2217
 htool.cc:2218
 htool.cc:2219
 htool.cc:2220
 htool.cc:2221
 htool.cc:2222
 htool.cc:2223
 htool.cc:2224
 htool.cc:2225
 htool.cc:2226
 htool.cc:2227
 htool.cc:2228
 htool.cc:2229
 htool.cc:2230
 htool.cc:2231
 htool.cc:2232
 htool.cc:2233
 htool.cc:2234
 htool.cc:2235
 htool.cc:2236
 htool.cc:2237
 htool.cc:2238
 htool.cc:2239
 htool.cc:2240
 htool.cc:2241
 htool.cc:2242
 htool.cc:2243
 htool.cc:2244
 htool.cc:2245
 htool.cc:2246
 htool.cc:2247
 htool.cc:2248
 htool.cc:2249
 htool.cc:2250
 htool.cc:2251
 htool.cc:2252
 htool.cc:2253
 htool.cc:2254
 htool.cc:2255
 htool.cc:2256
 htool.cc:2257
 htool.cc:2258
 htool.cc:2259
 htool.cc:2260
 htool.cc:2261
 htool.cc:2262
 htool.cc:2263
 htool.cc:2264
 htool.cc:2265
 htool.cc:2266
 htool.cc:2267
 htool.cc:2268
 htool.cc:2269
 htool.cc:2270
 htool.cc:2271
 htool.cc:2272
 htool.cc:2273
 htool.cc:2274
 htool.cc:2275
 htool.cc:2276
 htool.cc:2277
 htool.cc:2278
 htool.cc:2279
 htool.cc:2280
 htool.cc:2281
 htool.cc:2282
 htool.cc:2283
 htool.cc:2284
 htool.cc:2285
 htool.cc:2286
 htool.cc:2287
 htool.cc:2288
 htool.cc:2289
 htool.cc:2290
 htool.cc:2291
 htool.cc:2292
 htool.cc:2293
 htool.cc:2294
 htool.cc:2295
 htool.cc:2296
 htool.cc:2297
 htool.cc:2298
 htool.cc:2299
 htool.cc:2300
 htool.cc:2301
 htool.cc:2302
 htool.cc:2303
 htool.cc:2304
 htool.cc:2305
 htool.cc:2306
 htool.cc:2307
 htool.cc:2308
 htool.cc:2309
 htool.cc:2310
 htool.cc:2311
 htool.cc:2312
 htool.cc:2313
 htool.cc:2314
 htool.cc:2315
 htool.cc:2316
 htool.cc:2317
 htool.cc:2318
 htool.cc:2319
 htool.cc:2320
 htool.cc:2321
 htool.cc:2322
 htool.cc:2323
 htool.cc:2324
 htool.cc:2325
 htool.cc:2326
 htool.cc:2327
 htool.cc:2328
 htool.cc:2329
 htool.cc:2330
 htool.cc:2331
 htool.cc:2332
 htool.cc:2333
 htool.cc:2334
 htool.cc:2335
 htool.cc:2336
 htool.cc:2337
 htool.cc:2338
 htool.cc:2339
 htool.cc:2340
 htool.cc:2341
 htool.cc:2342
 htool.cc:2343
 htool.cc:2344
 htool.cc:2345
 htool.cc:2346
 htool.cc:2347
 htool.cc:2348
 htool.cc:2349
 htool.cc:2350
 htool.cc:2351
 htool.cc:2352
 htool.cc:2353
 htool.cc:2354
 htool.cc:2355
 htool.cc:2356
 htool.cc:2357
 htool.cc:2358
 htool.cc:2359
 htool.cc:2360
 htool.cc:2361
 htool.cc:2362
 htool.cc:2363
 htool.cc:2364
 htool.cc:2365
 htool.cc:2366
 htool.cc:2367
 htool.cc:2368
 htool.cc:2369
 htool.cc:2370
 htool.cc:2371
 htool.cc:2372
 htool.cc:2373
 htool.cc:2374
 htool.cc:2375
 htool.cc:2376
 htool.cc:2377
 htool.cc:2378
 htool.cc:2379
 htool.cc:2380
 htool.cc:2381
 htool.cc:2382
 htool.cc:2383
 htool.cc:2384
 htool.cc:2385
 htool.cc:2386
 htool.cc:2387
 htool.cc:2388
 htool.cc:2389
 htool.cc:2390
 htool.cc:2391
 htool.cc:2392
 htool.cc:2393
 htool.cc:2394
 htool.cc:2395
 htool.cc:2396
 htool.cc:2397
 htool.cc:2398
 htool.cc:2399
 htool.cc:2400
 htool.cc:2401
 htool.cc:2402
 htool.cc:2403
 htool.cc:2404
 htool.cc:2405
 htool.cc:2406
 htool.cc:2407
 htool.cc:2408
 htool.cc:2409
 htool.cc:2410
 htool.cc:2411
 htool.cc:2412
 htool.cc:2413
 htool.cc:2414
 htool.cc:2415
 htool.cc:2416
 htool.cc:2417
 htool.cc:2418
 htool.cc:2419
 htool.cc:2420
 htool.cc:2421
 htool.cc:2422
 htool.cc:2423
 htool.cc:2424
 htool.cc:2425
 htool.cc:2426
 htool.cc:2427
 htool.cc:2428
 htool.cc:2429
 htool.cc:2430
 htool.cc:2431
 htool.cc:2432
 htool.cc:2433
 htool.cc:2434
 htool.cc:2435
 htool.cc:2436
 htool.cc:2437
 htool.cc:2438
 htool.cc:2439
 htool.cc:2440
 htool.cc:2441
 htool.cc:2442
 htool.cc:2443
 htool.cc:2444
 htool.cc:2445
 htool.cc:2446
 htool.cc:2447
 htool.cc:2448
 htool.cc:2449
 htool.cc:2450
 htool.cc:2451
 htool.cc:2452
 htool.cc:2453
 htool.cc:2454
 htool.cc:2455
 htool.cc:2456
 htool.cc:2457
 htool.cc:2458
 htool.cc:2459
 htool.cc:2460
 htool.cc:2461
 htool.cc:2462
 htool.cc:2463
 htool.cc:2464
 htool.cc:2465
 htool.cc:2466
 htool.cc:2467
 htool.cc:2468
 htool.cc:2469
 htool.cc:2470
 htool.cc:2471
 htool.cc:2472
 htool.cc:2473
 htool.cc:2474
 htool.cc:2475
 htool.cc:2476
 htool.cc:2477
 htool.cc:2478
 htool.cc:2479
 htool.cc:2480
 htool.cc:2481
 htool.cc:2482
 htool.cc:2483
 htool.cc:2484
 htool.cc:2485
 htool.cc:2486
 htool.cc:2487
 htool.cc:2488
 htool.cc:2489
 htool.cc:2490
 htool.cc:2491
 htool.cc:2492
 htool.cc:2493
 htool.cc:2494
 htool.cc:2495
 htool.cc:2496
 htool.cc:2497
 htool.cc:2498
 htool.cc:2499
 htool.cc:2500
 htool.cc:2501
 htool.cc:2502
 htool.cc:2503
 htool.cc:2504
 htool.cc:2505
 htool.cc:2506
 htool.cc:2507
 htool.cc:2508
 htool.cc:2509
 htool.cc:2510
 htool.cc:2511
 htool.cc:2512
 htool.cc:2513
 htool.cc:2514
 htool.cc:2515
 htool.cc:2516
 htool.cc:2517
 htool.cc:2518
 htool.cc:2519
 htool.cc:2520
 htool.cc:2521
 htool.cc:2522
 htool.cc:2523
 htool.cc:2524
 htool.cc:2525
 htool.cc:2526
 htool.cc:2527
 htool.cc:2528
 htool.cc:2529
 htool.cc:2530
 htool.cc:2531
 htool.cc:2532
 htool.cc:2533
 htool.cc:2534
 htool.cc:2535
 htool.cc:2536
 htool.cc:2537
 htool.cc:2538
 htool.cc:2539
 htool.cc:2540
 htool.cc:2541
 htool.cc:2542
 htool.cc:2543
 htool.cc:2544
 htool.cc:2545
 htool.cc:2546
 htool.cc:2547
 htool.cc:2548
 htool.cc:2549
 htool.cc:2550
 htool.cc:2551
 htool.cc:2552
 htool.cc:2553
 htool.cc:2554
 htool.cc:2555
 htool.cc:2556
 htool.cc:2557
 htool.cc:2558
 htool.cc:2559
 htool.cc:2560
 htool.cc:2561
 htool.cc:2562
 htool.cc:2563
 htool.cc:2564
 htool.cc:2565
 htool.cc:2566
 htool.cc:2567
 htool.cc:2568
 htool.cc:2569
 htool.cc:2570
 htool.cc:2571
 htool.cc:2572
 htool.cc:2573
 htool.cc:2574
 htool.cc:2575
 htool.cc:2576
 htool.cc:2577
 htool.cc:2578
 htool.cc:2579
 htool.cc:2580
 htool.cc:2581
 htool.cc:2582
 htool.cc:2583
 htool.cc:2584
 htool.cc:2585
 htool.cc:2586
 htool.cc:2587
 htool.cc:2588
 htool.cc:2589
 htool.cc:2590
 htool.cc:2591
 htool.cc:2592
 htool.cc:2593
 htool.cc:2594
 htool.cc:2595
 htool.cc:2596
 htool.cc:2597
 htool.cc:2598
 htool.cc:2599
 htool.cc:2600
 htool.cc:2601
 htool.cc:2602
 htool.cc:2603
 htool.cc:2604
 htool.cc:2605
 htool.cc:2606
 htool.cc:2607
 htool.cc:2608
 htool.cc:2609
 htool.cc:2610
 htool.cc:2611
 htool.cc:2612
 htool.cc:2613
 htool.cc:2614
 htool.cc:2615
 htool.cc:2616
 htool.cc:2617
 htool.cc:2618
 htool.cc:2619
 htool.cc:2620
 htool.cc:2621
 htool.cc:2622
 htool.cc:2623
 htool.cc:2624
 htool.cc:2625
 htool.cc:2626
 htool.cc:2627
 htool.cc:2628
 htool.cc:2629
 htool.cc:2630
 htool.cc:2631
 htool.cc:2632
 htool.cc:2633
 htool.cc:2634
 htool.cc:2635
 htool.cc:2636
 htool.cc:2637
 htool.cc:2638
 htool.cc:2639
 htool.cc:2640
 htool.cc:2641
 htool.cc:2642
 htool.cc:2643
 htool.cc:2644
 htool.cc:2645
 htool.cc:2646
 htool.cc:2647
 htool.cc:2648
 htool.cc:2649
 htool.cc:2650
 htool.cc:2651
 htool.cc:2652
 htool.cc:2653
 htool.cc:2654
 htool.cc:2655
 htool.cc:2656
 htool.cc:2657
 htool.cc:2658
 htool.cc:2659
 htool.cc:2660
 htool.cc:2661
 htool.cc:2662
 htool.cc:2663
 htool.cc:2664
 htool.cc:2665
 htool.cc:2666
 htool.cc:2667
 htool.cc:2668
 htool.cc:2669
 htool.cc:2670
 htool.cc:2671
 htool.cc:2672
 htool.cc:2673
 htool.cc:2674
 htool.cc:2675
 htool.cc:2676
 htool.cc:2677
 htool.cc:2678
 htool.cc:2679
 htool.cc:2680
 htool.cc:2681
 htool.cc:2682
 htool.cc:2683
 htool.cc:2684
 htool.cc:2685
 htool.cc:2686
 htool.cc:2687
 htool.cc:2688
 htool.cc:2689
 htool.cc:2690
 htool.cc:2691
 htool.cc:2692
 htool.cc:2693
 htool.cc:2694
 htool.cc:2695
 htool.cc:2696
 htool.cc:2697
 htool.cc:2698
 htool.cc:2699
 htool.cc:2700
 htool.cc:2701
 htool.cc:2702
 htool.cc:2703
 htool.cc:2704
 htool.cc:2705
 htool.cc:2706
 htool.cc:2707
 htool.cc:2708
 htool.cc:2709
 htool.cc:2710
 htool.cc:2711
 htool.cc:2712
 htool.cc:2713
 htool.cc:2714
 htool.cc:2715
 htool.cc:2716
 htool.cc:2717
 htool.cc:2718
 htool.cc:2719
 htool.cc:2720
 htool.cc:2721
 htool.cc:2722
 htool.cc:2723
 htool.cc:2724
 htool.cc:2725
 htool.cc:2726
 htool.cc:2727
 htool.cc:2728
 htool.cc:2729
 htool.cc:2730
 htool.cc:2731
 htool.cc:2732
 htool.cc:2733
 htool.cc:2734
 htool.cc:2735
 htool.cc:2736
 htool.cc:2737
 htool.cc:2738
 htool.cc:2739
 htool.cc:2740
 htool.cc:2741
 htool.cc:2742
 htool.cc:2743
 htool.cc:2744
 htool.cc:2745
 htool.cc:2746
 htool.cc:2747
 htool.cc:2748
 htool.cc:2749
 htool.cc:2750
 htool.cc:2751
 htool.cc:2752
 htool.cc:2753
 htool.cc:2754
 htool.cc:2755
 htool.cc:2756
 htool.cc:2757
 htool.cc:2758
 htool.cc:2759
 htool.cc:2760
 htool.cc:2761
 htool.cc:2762
 htool.cc:2763
 htool.cc:2764
 htool.cc:2765
 htool.cc:2766
 htool.cc:2767
 htool.cc:2768
 htool.cc:2769
 htool.cc:2770
 htool.cc:2771
 htool.cc:2772
 htool.cc:2773
 htool.cc:2774
 htool.cc:2775
 htool.cc:2776
 htool.cc:2777
 htool.cc:2778
 htool.cc:2779
 htool.cc:2780
 htool.cc:2781
 htool.cc:2782
 htool.cc:2783
 htool.cc:2784
 htool.cc:2785
 htool.cc:2786
 htool.cc:2787
 htool.cc:2788
 htool.cc:2789
 htool.cc:2790
 htool.cc:2791
 htool.cc:2792
 htool.cc:2793
 htool.cc:2794
 htool.cc:2795
 htool.cc:2796
 htool.cc:2797
 htool.cc:2798
 htool.cc:2799
 htool.cc:2800
 htool.cc:2801
 htool.cc:2802
 htool.cc:2803
 htool.cc:2804
 htool.cc:2805
 htool.cc:2806
 htool.cc:2807
 htool.cc:2808
 htool.cc:2809
 htool.cc:2810
 htool.cc:2811
 htool.cc:2812
 htool.cc:2813
 htool.cc:2814
 htool.cc:2815
 htool.cc:2816
 htool.cc:2817
 htool.cc:2818
 htool.cc:2819
 htool.cc:2820
 htool.cc:2821
 htool.cc:2822
 htool.cc:2823
 htool.cc:2824
 htool.cc:2825
 htool.cc:2826
 htool.cc:2827
 htool.cc:2828
 htool.cc:2829
 htool.cc:2830
 htool.cc:2831
 htool.cc:2832
 htool.cc:2833
 htool.cc:2834
 htool.cc:2835
 htool.cc:2836
 htool.cc:2837
 htool.cc:2838
 htool.cc:2839
 htool.cc:2840
 htool.cc:2841
 htool.cc:2842
 htool.cc:2843
 htool.cc:2844
 htool.cc:2845
 htool.cc:2846
 htool.cc:2847
 htool.cc:2848
 htool.cc:2849
 htool.cc:2850
 htool.cc:2851
 htool.cc:2852
 htool.cc:2853
 htool.cc:2854
 htool.cc:2855
 htool.cc:2856
 htool.cc:2857
 htool.cc:2858
 htool.cc:2859
 htool.cc:2860
 htool.cc:2861
 htool.cc:2862
 htool.cc:2863
 htool.cc:2864
 htool.cc:2865
 htool.cc:2866
 htool.cc:2867
 htool.cc:2868
 htool.cc:2869
 htool.cc:2870
 htool.cc:2871
 htool.cc:2872
 htool.cc:2873
 htool.cc:2874
 htool.cc:2875
 htool.cc:2876
 htool.cc:2877
 htool.cc:2878
 htool.cc:2879
 htool.cc:2880
 htool.cc:2881
 htool.cc:2882
 htool.cc:2883
 htool.cc:2884
 htool.cc:2885
 htool.cc:2886
 htool.cc:2887
 htool.cc:2888
 htool.cc:2889
 htool.cc:2890
 htool.cc:2891
 htool.cc:2892
 htool.cc:2893
 htool.cc:2894
 htool.cc:2895
 htool.cc:2896
 htool.cc:2897
 htool.cc:2898
 htool.cc:2899
 htool.cc:2900
 htool.cc:2901
 htool.cc:2902
 htool.cc:2903
 htool.cc:2904
 htool.cc:2905
 htool.cc:2906
 htool.cc:2907
 htool.cc:2908
 htool.cc:2909
 htool.cc:2910
 htool.cc:2911
 htool.cc:2912
 htool.cc:2913
 htool.cc:2914
 htool.cc:2915
 htool.cc:2916
 htool.cc:2917
 htool.cc:2918
 htool.cc:2919
 htool.cc:2920
 htool.cc:2921
 htool.cc:2922
 htool.cc:2923
 htool.cc:2924
 htool.cc:2925
 htool.cc:2926
 htool.cc:2927
 htool.cc:2928
 htool.cc:2929
 htool.cc:2930
 htool.cc:2931
 htool.cc:2932
 htool.cc:2933
 htool.cc:2934
 htool.cc:2935
 htool.cc:2936
 htool.cc:2937
 htool.cc:2938
 htool.cc:2939
 htool.cc:2940
 htool.cc:2941
 htool.cc:2942
 htool.cc:2943
 htool.cc:2944
 htool.cc:2945
 htool.cc:2946
 htool.cc:2947
 htool.cc:2948
 htool.cc:2949
 htool.cc:2950
 htool.cc:2951
 htool.cc:2952
 htool.cc:2953
 htool.cc:2954
 htool.cc:2955
 htool.cc:2956
 htool.cc:2957
 htool.cc:2958
 htool.cc:2959
 htool.cc:2960
 htool.cc:2961
 htool.cc:2962
 htool.cc:2963
 htool.cc:2964
 htool.cc:2965
 htool.cc:2966
 htool.cc:2967
 htool.cc:2968
 htool.cc:2969
 htool.cc:2970
 htool.cc:2971
 htool.cc:2972
 htool.cc:2973
 htool.cc:2974
 htool.cc:2975
 htool.cc:2976
 htool.cc:2977
 htool.cc:2978
 htool.cc:2979
 htool.cc:2980
 htool.cc:2981
 htool.cc:2982
 htool.cc:2983
 htool.cc:2984
 htool.cc:2985
 htool.cc:2986
 htool.cc:2987
 htool.cc:2988
 htool.cc:2989
 htool.cc:2990
 htool.cc:2991
 htool.cc:2992
 htool.cc:2993
 htool.cc:2994
 htool.cc:2995
 htool.cc:2996
 htool.cc:2997
 htool.cc:2998
 htool.cc:2999
 htool.cc:3000
 htool.cc:3001
 htool.cc:3002
 htool.cc:3003
 htool.cc:3004
 htool.cc:3005
 htool.cc:3006
 htool.cc:3007
 htool.cc:3008
 htool.cc:3009
 htool.cc:3010
 htool.cc:3011
 htool.cc:3012
 htool.cc:3013
 htool.cc:3014
 htool.cc:3015
 htool.cc:3016
 htool.cc:3017
 htool.cc:3018
 htool.cc:3019
 htool.cc:3020
 htool.cc:3021
 htool.cc:3022
 htool.cc:3023
 htool.cc:3024
 htool.cc:3025
 htool.cc:3026
 htool.cc:3027
 htool.cc:3028
 htool.cc:3029
 htool.cc:3030
 htool.cc:3031
 htool.cc:3032
 htool.cc:3033
 htool.cc:3034
 htool.cc:3035
 htool.cc:3036
 htool.cc:3037
 htool.cc:3038
 htool.cc:3039
 htool.cc:3040
 htool.cc:3041
 htool.cc:3042
 htool.cc:3043
 htool.cc:3044
 htool.cc:3045
 htool.cc:3046
 htool.cc:3047
 htool.cc:3048
 htool.cc:3049
 htool.cc:3050
 htool.cc:3051
 htool.cc:3052
 htool.cc:3053
 htool.cc:3054
 htool.cc:3055
 htool.cc:3056
 htool.cc:3057
 htool.cc:3058
 htool.cc:3059
 htool.cc:3060
 htool.cc:3061
 htool.cc:3062
 htool.cc:3063
 htool.cc:3064
 htool.cc:3065
 htool.cc:3066
 htool.cc:3067
 htool.cc:3068
 htool.cc:3069
 htool.cc:3070
 htool.cc:3071
 htool.cc:3072
 htool.cc:3073
 htool.cc:3074
 htool.cc:3075
 htool.cc:3076
 htool.cc:3077
 htool.cc:3078
 htool.cc:3079
 htool.cc:3080
 htool.cc:3081
 htool.cc:3082
 htool.cc:3083
 htool.cc:3084
 htool.cc:3085
 htool.cc:3086
 htool.cc:3087
 htool.cc:3088
 htool.cc:3089
 htool.cc:3090
 htool.cc:3091
 htool.cc:3092
 htool.cc:3093
 htool.cc:3094
 htool.cc:3095
 htool.cc:3096
 htool.cc:3097
 htool.cc:3098
 htool.cc:3099
 htool.cc:3100
 htool.cc:3101
 htool.cc:3102
 htool.cc:3103
 htool.cc:3104
 htool.cc:3105
 htool.cc:3106
 htool.cc:3107
 htool.cc:3108
 htool.cc:3109
 htool.cc:3110
 htool.cc:3111
 htool.cc:3112
 htool.cc:3113
 htool.cc:3114
 htool.cc:3115
 htool.cc:3116
 htool.cc:3117
 htool.cc:3118
 htool.cc:3119
 htool.cc:3120
 htool.cc:3121
 htool.cc:3122
 htool.cc:3123
 htool.cc:3124
 htool.cc:3125
 htool.cc:3126
 htool.cc:3127
 htool.cc:3128
 htool.cc:3129
 htool.cc:3130
 htool.cc:3131
 htool.cc:3132
 htool.cc:3133
 htool.cc:3134
 htool.cc:3135
 htool.cc:3136
 htool.cc:3137
 htool.cc:3138
 htool.cc:3139
 htool.cc:3140
 htool.cc:3141
 htool.cc:3142
 htool.cc:3143
 htool.cc:3144
 htool.cc:3145
 htool.cc:3146
 htool.cc:3147
 htool.cc:3148
 htool.cc:3149
 htool.cc:3150
 htool.cc:3151
 htool.cc:3152
 htool.cc:3153
 htool.cc:3154
 htool.cc:3155
 htool.cc:3156
 htool.cc:3157
 htool.cc:3158
 htool.cc:3159
 htool.cc:3160
 htool.cc:3161
 htool.cc:3162
 htool.cc:3163
 htool.cc:3164
 htool.cc:3165
 htool.cc:3166
 htool.cc:3167
 htool.cc:3168
 htool.cc:3169
 htool.cc:3170
 htool.cc:3171
 htool.cc:3172
 htool.cc:3173
 htool.cc:3174
 htool.cc:3175
 htool.cc:3176
 htool.cc:3177
 htool.cc:3178
 htool.cc:3179
 htool.cc:3180
 htool.cc:3181
 htool.cc:3182
 htool.cc:3183
 htool.cc:3184
 htool.cc:3185
 htool.cc:3186
 htool.cc:3187
 htool.cc:3188
 htool.cc:3189
 htool.cc:3190
 htool.cc:3191
 htool.cc:3192
 htool.cc:3193
 htool.cc:3194
 htool.cc:3195
 htool.cc:3196
 htool.cc:3197
 htool.cc:3198
 htool.cc:3199
 htool.cc:3200
 htool.cc:3201
 htool.cc:3202
 htool.cc:3203
 htool.cc:3204
 htool.cc:3205
 htool.cc:3206
 htool.cc:3207
 htool.cc:3208
 htool.cc:3209
 htool.cc:3210
 htool.cc:3211
 htool.cc:3212
 htool.cc:3213
 htool.cc:3214
 htool.cc:3215
 htool.cc:3216
 htool.cc:3217
 htool.cc:3218
 htool.cc:3219
 htool.cc:3220
 htool.cc:3221
 htool.cc:3222
 htool.cc:3223
 htool.cc:3224
 htool.cc:3225
 htool.cc:3226
 htool.cc:3227
 htool.cc:3228
 htool.cc:3229
 htool.cc:3230
 htool.cc:3231
 htool.cc:3232
 htool.cc:3233
 htool.cc:3234
 htool.cc:3235
 htool.cc:3236
 htool.cc:3237
 htool.cc:3238
 htool.cc:3239
 htool.cc:3240
 htool.cc:3241
 htool.cc:3242
 htool.cc:3243
 htool.cc:3244
 htool.cc:3245
 htool.cc:3246
 htool.cc:3247
 htool.cc:3248
 htool.cc:3249
 htool.cc:3250
 htool.cc:3251
 htool.cc:3252
 htool.cc:3253
 htool.cc:3254
 htool.cc:3255
 htool.cc:3256
 htool.cc:3257
 htool.cc:3258
 htool.cc:3259
 htool.cc:3260
 htool.cc:3261
 htool.cc:3262
 htool.cc:3263
 htool.cc:3264
 htool.cc:3265
 htool.cc:3266
 htool.cc:3267
 htool.cc:3268
 htool.cc:3269
 htool.cc:3270
 htool.cc:3271
 htool.cc:3272
 htool.cc:3273
 htool.cc:3274
 htool.cc:3275
 htool.cc:3276
 htool.cc:3277
 htool.cc:3278
 htool.cc:3279
 htool.cc:3280
 htool.cc:3281
 htool.cc:3282
 htool.cc:3283
 htool.cc:3284
 htool.cc:3285
 htool.cc:3286
 htool.cc:3287
 htool.cc:3288
 htool.cc:3289
 htool.cc:3290
 htool.cc:3291
 htool.cc:3292
 htool.cc:3293
 htool.cc:3294
 htool.cc:3295
 htool.cc:3296
 htool.cc:3297
 htool.cc:3298
 htool.cc:3299
 htool.cc:3300
 htool.cc:3301
 htool.cc:3302
 htool.cc:3303
 htool.cc:3304
 htool.cc:3305
 htool.cc:3306
 htool.cc:3307
 htool.cc:3308
 htool.cc:3309
 htool.cc:3310
 htool.cc:3311
 htool.cc:3312
 htool.cc:3313
 htool.cc:3314
 htool.cc:3315
 htool.cc:3316
 htool.cc:3317
 htool.cc:3318
 htool.cc:3319
 htool.cc:3320
 htool.cc:3321
 htool.cc:3322
 htool.cc:3323
 htool.cc:3324
 htool.cc:3325
 htool.cc:3326
 htool.cc:3327
 htool.cc:3328
 htool.cc:3329
 htool.cc:3330
 htool.cc:3331
 htool.cc:3332
 htool.cc:3333
 htool.cc:3334
 htool.cc:3335
 htool.cc:3336
 htool.cc:3337
 htool.cc:3338
 htool.cc:3339
 htool.cc:3340
 htool.cc:3341
 htool.cc:3342
 htool.cc:3343
 htool.cc:3344
 htool.cc:3345
 htool.cc:3346
 htool.cc:3347
 htool.cc:3348
 htool.cc:3349
 htool.cc:3350
 htool.cc:3351
 htool.cc:3352
 htool.cc:3353
 htool.cc:3354
 htool.cc:3355
 htool.cc:3356
 htool.cc:3357
 htool.cc:3358
 htool.cc:3359
 htool.cc:3360
 htool.cc:3361
 htool.cc:3362
 htool.cc:3363
 htool.cc:3364
 htool.cc:3365
 htool.cc:3366
 htool.cc:3367
 htool.cc:3368
 htool.cc:3369
 htool.cc:3370
 htool.cc:3371
 htool.cc:3372
 htool.cc:3373
 htool.cc:3374
 htool.cc:3375
 htool.cc:3376
 htool.cc:3377
 htool.cc:3378
 htool.cc:3379
 htool.cc:3380
 htool.cc:3381
 htool.cc:3382
 htool.cc:3383
 htool.cc:3384
 htool.cc:3385
 htool.cc:3386
 htool.cc:3387
 htool.cc:3388
 htool.cc:3389
 htool.cc:3390
 htool.cc:3391
 htool.cc:3392
 htool.cc:3393
 htool.cc:3394
 htool.cc:3395
 htool.cc:3396
 htool.cc:3397
 htool.cc:3398
 htool.cc:3399
 htool.cc:3400
 htool.cc:3401
 htool.cc:3402
 htool.cc:3403
 htool.cc:3404
 htool.cc:3405
 htool.cc:3406
 htool.cc:3407
 htool.cc:3408
 htool.cc:3409
 htool.cc:3410
 htool.cc:3411
 htool.cc:3412
 htool.cc:3413
 htool.cc:3414
 htool.cc:3415
 htool.cc:3416
 htool.cc:3417
 htool.cc:3418
 htool.cc:3419
 htool.cc:3420
 htool.cc:3421
 htool.cc:3422
 htool.cc:3423
 htool.cc:3424
 htool.cc:3425
 htool.cc:3426
 htool.cc:3427
 htool.cc:3428
 htool.cc:3429
 htool.cc:3430
 htool.cc:3431
 htool.cc:3432
 htool.cc:3433
 htool.cc:3434
 htool.cc:3435
 htool.cc:3436
 htool.cc:3437
 htool.cc:3438
 htool.cc:3439
 htool.cc:3440
 htool.cc:3441
 htool.cc:3442
 htool.cc:3443
 htool.cc:3444
 htool.cc:3445
 htool.cc:3446
 htool.cc:3447
 htool.cc:3448
 htool.cc:3449
 htool.cc:3450
 htool.cc:3451
 htool.cc:3452
 htool.cc:3453
 htool.cc:3454
 htool.cc:3455
 htool.cc:3456
 htool.cc:3457
 htool.cc:3458
 htool.cc:3459
 htool.cc:3460
 htool.cc:3461
 htool.cc:3462
 htool.cc:3463
 htool.cc:3464
 htool.cc:3465
 htool.cc:3466
 htool.cc:3467
 htool.cc:3468
 htool.cc:3469
 htool.cc:3470
 htool.cc:3471
 htool.cc:3472
 htool.cc:3473
 htool.cc:3474
 htool.cc:3475
 htool.cc:3476
 htool.cc:3477
 htool.cc:3478
 htool.cc:3479
 htool.cc:3480
 htool.cc:3481
 htool.cc:3482
 htool.cc:3483
 htool.cc:3484
 htool.cc:3485
 htool.cc:3486
 htool.cc:3487
 htool.cc:3488
 htool.cc:3489
 htool.cc:3490
 htool.cc:3491
 htool.cc:3492
 htool.cc:3493
 htool.cc:3494
 htool.cc:3495
 htool.cc:3496
 htool.cc:3497
 htool.cc:3498
 htool.cc:3499
 htool.cc:3500
 htool.cc:3501
 htool.cc:3502
 htool.cc:3503
 htool.cc:3504
 htool.cc:3505
 htool.cc:3506
 htool.cc:3507
 htool.cc:3508
 htool.cc:3509
 htool.cc:3510
 htool.cc:3511
 htool.cc:3512
 htool.cc:3513
 htool.cc:3514
 htool.cc:3515
 htool.cc:3516
 htool.cc:3517
 htool.cc:3518
 htool.cc:3519
 htool.cc:3520
 htool.cc:3521
 htool.cc:3522
 htool.cc:3523
 htool.cc:3524
 htool.cc:3525
 htool.cc:3526
 htool.cc:3527
 htool.cc:3528
 htool.cc:3529
 htool.cc:3530
 htool.cc:3531
 htool.cc:3532
 htool.cc:3533
 htool.cc:3534
 htool.cc:3535
 htool.cc:3536
 htool.cc:3537
 htool.cc:3538
 htool.cc:3539
 htool.cc:3540
 htool.cc:3541
 htool.cc:3542
 htool.cc:3543
 htool.cc:3544
 htool.cc:3545
 htool.cc:3546
 htool.cc:3547
 htool.cc:3548
 htool.cc:3549
 htool.cc:3550
 htool.cc:3551
 htool.cc:3552
 htool.cc:3553
 htool.cc:3554
 htool.cc:3555
 htool.cc:3556
 htool.cc:3557
 htool.cc:3558
 htool.cc:3559
 htool.cc:3560
 htool.cc:3561
 htool.cc:3562
 htool.cc:3563
 htool.cc:3564
 htool.cc:3565
 htool.cc:3566
 htool.cc:3567
 htool.cc:3568
 htool.cc:3569
 htool.cc:3570
 htool.cc:3571
 htool.cc:3572
 htool.cc:3573
 htool.cc:3574
 htool.cc:3575
 htool.cc:3576
 htool.cc:3577
 htool.cc:3578
 htool.cc:3579
 htool.cc:3580
 htool.cc:3581
 htool.cc:3582
 htool.cc:3583
 htool.cc:3584
 htool.cc:3585
 htool.cc:3586
 htool.cc:3587
 htool.cc:3588
 htool.cc:3589
 htool.cc:3590
 htool.cc:3591
 htool.cc:3592
 htool.cc:3593
 htool.cc:3594
 htool.cc:3595
 htool.cc:3596
 htool.cc:3597
 htool.cc:3598
 htool.cc:3599
 htool.cc:3600
 htool.cc:3601
 htool.cc:3602
 htool.cc:3603
 htool.cc:3604
 htool.cc:3605
 htool.cc:3606
 htool.cc:3607
 htool.cc:3608
 htool.cc:3609
 htool.cc:3610
 htool.cc:3611
 htool.cc:3612
 htool.cc:3613
 htool.cc:3614
 htool.cc:3615
 htool.cc:3616
 htool.cc:3617
 htool.cc:3618
 htool.cc:3619
 htool.cc:3620
 htool.cc:3621
 htool.cc:3622
 htool.cc:3623
 htool.cc:3624
 htool.cc:3625
 htool.cc:3626
 htool.cc:3627
 htool.cc:3628
 htool.cc:3629
 htool.cc:3630
 htool.cc:3631
 htool.cc:3632
 htool.cc:3633
 htool.cc:3634
 htool.cc:3635
 htool.cc:3636
 htool.cc:3637
 htool.cc:3638
 htool.cc:3639
 htool.cc:3640
 htool.cc:3641
 htool.cc:3642
 htool.cc:3643
 htool.cc:3644
 htool.cc:3645
 htool.cc:3646
 htool.cc:3647
 htool.cc:3648
 htool.cc:3649
 htool.cc:3650
 htool.cc:3651
 htool.cc:3652
 htool.cc:3653
 htool.cc:3654
 htool.cc:3655
 htool.cc:3656
 htool.cc:3657
 htool.cc:3658
 htool.cc:3659
 htool.cc:3660
 htool.cc:3661
 htool.cc:3662
 htool.cc:3663
 htool.cc:3664
 htool.cc:3665
 htool.cc:3666
 htool.cc:3667
 htool.cc:3668
 htool.cc:3669
 htool.cc:3670
 htool.cc:3671
 htool.cc:3672
 htool.cc:3673
 htool.cc:3674
 htool.cc:3675
 htool.cc:3676
 htool.cc:3677
 htool.cc:3678
 htool.cc:3679
 htool.cc:3680
 htool.cc:3681
 htool.cc:3682
 htool.cc:3683
 htool.cc:3684
 htool.cc:3685
 htool.cc:3686
 htool.cc:3687
 htool.cc:3688
 htool.cc:3689
 htool.cc:3690
 htool.cc:3691
 htool.cc:3692
 htool.cc:3693
 htool.cc:3694
 htool.cc:3695
 htool.cc:3696
 htool.cc:3697
 htool.cc:3698
 htool.cc:3699
 htool.cc:3700
 htool.cc:3701
 htool.cc:3702
 htool.cc:3703
 htool.cc:3704
 htool.cc:3705
 htool.cc:3706
 htool.cc:3707
 htool.cc:3708
 htool.cc:3709
 htool.cc:3710
 htool.cc:3711
 htool.cc:3712
 htool.cc:3713
 htool.cc:3714
 htool.cc:3715
 htool.cc:3716
 htool.cc:3717
 htool.cc:3718
 htool.cc:3719
 htool.cc:3720
 htool.cc:3721
 htool.cc:3722
 htool.cc:3723
 htool.cc:3724
 htool.cc:3725
 htool.cc:3726
 htool.cc:3727
 htool.cc:3728
 htool.cc:3729
 htool.cc:3730
 htool.cc:3731
 htool.cc:3732
 htool.cc:3733
 htool.cc:3734
 htool.cc:3735
 htool.cc:3736
 htool.cc:3737
 htool.cc:3738
 htool.cc:3739
 htool.cc:3740
 htool.cc:3741
 htool.cc:3742
 htool.cc:3743
 htool.cc:3744
 htool.cc:3745
 htool.cc:3746
 htool.cc:3747
 htool.cc:3748
 htool.cc:3749
 htool.cc:3750
 htool.cc:3751
 htool.cc:3752
 htool.cc:3753
 htool.cc:3754
 htool.cc:3755
 htool.cc:3756
 htool.cc:3757
 htool.cc:3758
 htool.cc:3759
 htool.cc:3760
 htool.cc:3761
 htool.cc:3762
 htool.cc:3763
 htool.cc:3764
 htool.cc:3765
 htool.cc:3766
 htool.cc:3767
 htool.cc:3768
 htool.cc:3769
 htool.cc:3770
 htool.cc:3771
 htool.cc:3772
 htool.cc:3773
 htool.cc:3774
 htool.cc:3775
 htool.cc:3776
 htool.cc:3777
 htool.cc:3778
 htool.cc:3779
 htool.cc:3780
 htool.cc:3781
 htool.cc:3782
 htool.cc:3783
 htool.cc:3784
 htool.cc:3785
 htool.cc:3786
 htool.cc:3787
 htool.cc:3788
 htool.cc:3789
 htool.cc:3790
 htool.cc:3791
 htool.cc:3792
 htool.cc:3793
 htool.cc:3794
 htool.cc:3795
 htool.cc:3796
 htool.cc:3797
 htool.cc:3798
 htool.cc:3799
 htool.cc:3800
 htool.cc:3801
 htool.cc:3802
 htool.cc:3803
 htool.cc:3804
 htool.cc:3805
 htool.cc:3806
 htool.cc:3807
 htool.cc:3808
 htool.cc:3809
 htool.cc:3810
 htool.cc:3811
 htool.cc:3812
 htool.cc:3813
 htool.cc:3814
 htool.cc:3815
 htool.cc:3816
 htool.cc:3817
 htool.cc:3818
 htool.cc:3819
 htool.cc:3820
 htool.cc:3821
 htool.cc:3822
 htool.cc:3823
 htool.cc:3824
 htool.cc:3825
 htool.cc:3826
 htool.cc:3827
 htool.cc:3828
 htool.cc:3829
 htool.cc:3830
 htool.cc:3831
 htool.cc:3832
 htool.cc:3833
 htool.cc:3834
 htool.cc:3835
 htool.cc:3836
 htool.cc:3837
 htool.cc:3838
 htool.cc:3839
 htool.cc:3840
 htool.cc:3841
 htool.cc:3842
 htool.cc:3843
 htool.cc:3844
 htool.cc:3845
 htool.cc:3846
 htool.cc:3847
 htool.cc:3848
 htool.cc:3849
 htool.cc:3850
 htool.cc:3851
 htool.cc:3852
 htool.cc:3853
 htool.cc:3854
 htool.cc:3855
 htool.cc:3856
 htool.cc:3857
 htool.cc:3858
 htool.cc:3859
 htool.cc:3860
 htool.cc:3861
 htool.cc:3862
 htool.cc:3863
 htool.cc:3864
 htool.cc:3865
 htool.cc:3866
 htool.cc:3867
 htool.cc:3868
 htool.cc:3869
 htool.cc:3870
 htool.cc:3871
 htool.cc:3872
 htool.cc:3873
 htool.cc:3874
 htool.cc:3875
 htool.cc:3876
 htool.cc:3877
 htool.cc:3878
 htool.cc:3879
 htool.cc:3880
 htool.cc:3881
 htool.cc:3882
 htool.cc:3883
 htool.cc:3884
 htool.cc:3885
 htool.cc:3886
 htool.cc:3887
 htool.cc:3888
 htool.cc:3889
 htool.cc:3890
 htool.cc:3891
 htool.cc:3892
 htool.cc:3893
 htool.cc:3894
 htool.cc:3895
 htool.cc:3896
 htool.cc:3897
 htool.cc:3898
 htool.cc:3899
 htool.cc:3900
 htool.cc:3901
 htool.cc:3902
 htool.cc:3903
 htool.cc:3904
 htool.cc:3905
 htool.cc:3906
 htool.cc:3907
 htool.cc:3908
 htool.cc:3909
 htool.cc:3910
 htool.cc:3911
 htool.cc:3912
 htool.cc:3913
 htool.cc:3914
 htool.cc:3915
 htool.cc:3916
 htool.cc:3917
 htool.cc:3918
 htool.cc:3919
 htool.cc:3920
 htool.cc:3921
 htool.cc:3922
 htool.cc:3923
 htool.cc:3924
 htool.cc:3925
 htool.cc:3926
 htool.cc:3927
 htool.cc:3928
 htool.cc:3929
 htool.cc:3930
 htool.cc:3931
 htool.cc:3932
 htool.cc:3933
 htool.cc:3934
 htool.cc:3935
 htool.cc:3936
 htool.cc:3937
 htool.cc:3938
 htool.cc:3939
 htool.cc:3940
 htool.cc:3941
 htool.cc:3942
 htool.cc:3943
 htool.cc:3944
 htool.cc:3945
 htool.cc:3946
 htool.cc:3947
 htool.cc:3948
 htool.cc:3949
 htool.cc:3950
 htool.cc:3951
 htool.cc:3952
 htool.cc:3953
 htool.cc:3954
 htool.cc:3955
 htool.cc:3956
 htool.cc:3957
 htool.cc:3958
 htool.cc:3959
 htool.cc:3960
 htool.cc:3961
 htool.cc:3962
 htool.cc:3963
 htool.cc:3964
 htool.cc:3965
 htool.cc:3966
 htool.cc:3967
 htool.cc:3968
 htool.cc:3969
 htool.cc:3970
 htool.cc:3971
 htool.cc:3972
 htool.cc:3973
 htool.cc:3974
 htool.cc:3975
 htool.cc:3976
 htool.cc:3977
 htool.cc:3978
 htool.cc:3979
 htool.cc:3980
 htool.cc:3981
 htool.cc:3982
 htool.cc:3983
 htool.cc:3984
 htool.cc:3985
 htool.cc:3986
 htool.cc:3987
 htool.cc:3988
 htool.cc:3989
 htool.cc:3990
 htool.cc:3991
 htool.cc:3992
 htool.cc:3993
 htool.cc:3994
 htool.cc:3995
 htool.cc:3996
 htool.cc:3997
 htool.cc:3998
 htool.cc:3999
 htool.cc:4000
 htool.cc:4001
 htool.cc:4002
 htool.cc:4003
 htool.cc:4004
 htool.cc:4005
 htool.cc:4006
 htool.cc:4007
 htool.cc:4008
 htool.cc:4009
 htool.cc:4010
 htool.cc:4011
 htool.cc:4012
 htool.cc:4013
 htool.cc:4014
 htool.cc:4015
 htool.cc:4016
 htool.cc:4017
 htool.cc:4018
 htool.cc:4019
 htool.cc:4020
 htool.cc:4021
 htool.cc:4022
 htool.cc:4023
 htool.cc:4024
 htool.cc:4025
 htool.cc:4026
 htool.cc:4027
 htool.cc:4028
 htool.cc:4029
 htool.cc:4030
 htool.cc:4031
 htool.cc:4032
 htool.cc:4033
 htool.cc:4034
 htool.cc:4035
 htool.cc:4036
 htool.cc:4037
 htool.cc:4038
 htool.cc:4039
 htool.cc:4040
 htool.cc:4041
 htool.cc:4042
 htool.cc:4043
 htool.cc:4044
 htool.cc:4045
 htool.cc:4046
 htool.cc:4047
 htool.cc:4048
 htool.cc:4049
 htool.cc:4050
 htool.cc:4051
 htool.cc:4052
 htool.cc:4053
 htool.cc:4054
 htool.cc:4055
 htool.cc:4056
 htool.cc:4057
 htool.cc:4058
 htool.cc:4059
 htool.cc:4060
 htool.cc:4061
 htool.cc:4062
 htool.cc:4063
 htool.cc:4064
 htool.cc:4065
 htool.cc:4066
 htool.cc:4067
 htool.cc:4068
 htool.cc:4069
 htool.cc:4070
 htool.cc:4071
 htool.cc:4072
 htool.cc:4073
 htool.cc:4074
 htool.cc:4075
 htool.cc:4076
 htool.cc:4077
 htool.cc:4078
 htool.cc:4079
 htool.cc:4080
 htool.cc:4081
 htool.cc:4082
 htool.cc:4083
 htool.cc:4084
 htool.cc:4085
 htool.cc:4086
 htool.cc:4087
 htool.cc:4088
 htool.cc:4089
 htool.cc:4090
 htool.cc:4091
 htool.cc:4092
 htool.cc:4093
 htool.cc:4094
 htool.cc:4095
 htool.cc:4096
 htool.cc:4097
 htool.cc:4098
 htool.cc:4099
 htool.cc:4100
 htool.cc:4101
 htool.cc:4102
 htool.cc:4103
 htool.cc:4104
 htool.cc:4105
 htool.cc:4106
 htool.cc:4107
 htool.cc:4108
 htool.cc:4109
 htool.cc:4110
 htool.cc:4111
 htool.cc:4112
 htool.cc:4113
 htool.cc:4114
 htool.cc:4115
 htool.cc:4116
 htool.cc:4117
 htool.cc:4118
 htool.cc:4119
 htool.cc:4120
 htool.cc:4121
 htool.cc:4122
 htool.cc:4123
 htool.cc:4124
 htool.cc:4125
 htool.cc:4126
 htool.cc:4127
 htool.cc:4128
 htool.cc:4129
 htool.cc:4130
 htool.cc:4131
 htool.cc:4132
 htool.cc:4133
 htool.cc:4134
 htool.cc:4135
 htool.cc:4136
 htool.cc:4137
 htool.cc:4138
 htool.cc:4139
 htool.cc:4140
 htool.cc:4141
 htool.cc:4142
 htool.cc:4143
 htool.cc:4144
 htool.cc:4145
 htool.cc:4146
 htool.cc:4147
 htool.cc:4148
 htool.cc:4149
 htool.cc:4150
 htool.cc:4151
 htool.cc:4152
 htool.cc:4153
 htool.cc:4154
 htool.cc:4155
 htool.cc:4156
 htool.cc:4157
 htool.cc:4158
 htool.cc:4159
 htool.cc:4160
 htool.cc:4161
 htool.cc:4162
 htool.cc:4163
 htool.cc:4164
 htool.cc:4165
 htool.cc:4166
 htool.cc:4167
 htool.cc:4168
 htool.cc:4169
 htool.cc:4170
 htool.cc:4171
 htool.cc:4172
 htool.cc:4173
 htool.cc:4174
 htool.cc:4175
 htool.cc:4176
 htool.cc:4177
 htool.cc:4178
 htool.cc:4179
 htool.cc:4180
 htool.cc:4181
 htool.cc:4182
 htool.cc:4183
 htool.cc:4184
 htool.cc:4185
 htool.cc:4186
 htool.cc:4187
 htool.cc:4188
 htool.cc:4189
 htool.cc:4190
 htool.cc:4191
 htool.cc:4192
 htool.cc:4193
 htool.cc:4194
 htool.cc:4195
 htool.cc:4196
 htool.cc:4197
 htool.cc:4198
 htool.cc:4199
 htool.cc:4200
 htool.cc:4201
 htool.cc:4202
 htool.cc:4203
 htool.cc:4204
 htool.cc:4205
 htool.cc:4206
 htool.cc:4207
 htool.cc:4208
 htool.cc:4209
 htool.cc:4210
 htool.cc:4211
 htool.cc:4212
 htool.cc:4213
 htool.cc:4214
 htool.cc:4215
 htool.cc:4216
 htool.cc:4217
 htool.cc:4218
 htool.cc:4219
 htool.cc:4220
 htool.cc:4221
 htool.cc:4222
 htool.cc:4223
 htool.cc:4224
 htool.cc:4225
 htool.cc:4226
 htool.cc:4227
 htool.cc:4228
 htool.cc:4229
 htool.cc:4230
 htool.cc:4231
 htool.cc:4232
 htool.cc:4233
 htool.cc:4234
 htool.cc:4235
 htool.cc:4236
 htool.cc:4237
 htool.cc:4238
 htool.cc:4239
 htool.cc:4240
 htool.cc:4241
 htool.cc:4242
 htool.cc:4243
 htool.cc:4244
 htool.cc:4245
 htool.cc:4246
 htool.cc:4247
 htool.cc:4248
 htool.cc:4249
 htool.cc:4250
 htool.cc:4251
 htool.cc:4252
 htool.cc:4253
 htool.cc:4254
 htool.cc:4255
 htool.cc:4256
 htool.cc:4257
 htool.cc:4258
 htool.cc:4259
 htool.cc:4260
 htool.cc:4261
 htool.cc:4262
 htool.cc:4263
 htool.cc:4264
 htool.cc:4265
 htool.cc:4266
 htool.cc:4267
 htool.cc:4268
 htool.cc:4269
 htool.cc:4270
 htool.cc:4271
 htool.cc:4272
 htool.cc:4273
 htool.cc:4274
 htool.cc:4275
 htool.cc:4276
 htool.cc:4277
 htool.cc:4278
 htool.cc:4279
 htool.cc:4280
 htool.cc:4281
 htool.cc:4282
 htool.cc:4283
 htool.cc:4284
 htool.cc:4285
 htool.cc:4286
 htool.cc:4287
 htool.cc:4288
 htool.cc:4289
 htool.cc:4290
 htool.cc:4291
 htool.cc:4292
 htool.cc:4293
 htool.cc:4294
 htool.cc:4295
 htool.cc:4296
 htool.cc:4297
 htool.cc:4298
 htool.cc:4299
 htool.cc:4300
 htool.cc:4301
 htool.cc:4302
 htool.cc:4303
 htool.cc:4304
 htool.cc:4305
 htool.cc:4306
 htool.cc:4307
 htool.cc:4308
 htool.cc:4309
 htool.cc:4310
 htool.cc:4311
 htool.cc:4312
 htool.cc:4313
 htool.cc:4314
 htool.cc:4315
 htool.cc:4316
 htool.cc:4317
 htool.cc:4318
 htool.cc:4319
 htool.cc:4320
 htool.cc:4321
 htool.cc:4322
 htool.cc:4323
 htool.cc:4324
 htool.cc:4325
 htool.cc:4326
 htool.cc:4327
 htool.cc:4328
 htool.cc:4329
 htool.cc:4330
 htool.cc:4331
 htool.cc:4332
 htool.cc:4333
 htool.cc:4334
 htool.cc:4335
 htool.cc:4336
 htool.cc:4337
 htool.cc:4338
 htool.cc:4339
 htool.cc:4340
 htool.cc:4341
 htool.cc:4342
 htool.cc:4343
 htool.cc:4344
 htool.cc:4345
 htool.cc:4346
 htool.cc:4347
 htool.cc:4348
 htool.cc:4349
 htool.cc:4350
 htool.cc:4351
 htool.cc:4352
 htool.cc:4353
 htool.cc:4354
 htool.cc:4355
 htool.cc:4356
 htool.cc:4357
 htool.cc:4358
 htool.cc:4359
 htool.cc:4360
 htool.cc:4361
 htool.cc:4362
 htool.cc:4363
 htool.cc:4364
 htool.cc:4365
 htool.cc:4366
 htool.cc:4367
 htool.cc:4368
 htool.cc:4369
 htool.cc:4370
 htool.cc:4371
 htool.cc:4372
 htool.cc:4373
 htool.cc:4374
 htool.cc:4375
 htool.cc:4376
 htool.cc:4377
 htool.cc:4378
 htool.cc:4379
 htool.cc:4380
 htool.cc:4381
 htool.cc:4382
 htool.cc:4383
 htool.cc:4384
 htool.cc:4385
 htool.cc:4386
 htool.cc:4387
 htool.cc:4388
 htool.cc:4389
 htool.cc:4390
 htool.cc:4391
 htool.cc:4392
 htool.cc:4393
 htool.cc:4394
 htool.cc:4395
 htool.cc:4396
 htool.cc:4397
 htool.cc:4398
 htool.cc:4399
 htool.cc:4400
 htool.cc:4401
 htool.cc:4402
 htool.cc:4403
 htool.cc:4404
 htool.cc:4405
 htool.cc:4406
 htool.cc:4407
 htool.cc:4408
 htool.cc:4409
 htool.cc:4410
 htool.cc:4411
 htool.cc:4412
 htool.cc:4413
 htool.cc:4414
 htool.cc:4415
 htool.cc:4416
 htool.cc:4417
 htool.cc:4418
 htool.cc:4419
 htool.cc:4420
 htool.cc:4421
 htool.cc:4422
 htool.cc:4423
 htool.cc:4424
 htool.cc:4425
 htool.cc:4426
 htool.cc:4427
 htool.cc:4428
 htool.cc:4429
 htool.cc:4430
 htool.cc:4431
 htool.cc:4432
 htool.cc:4433
 htool.cc:4434
 htool.cc:4435
 htool.cc:4436
 htool.cc:4437
 htool.cc:4438
 htool.cc:4439
 htool.cc:4440
 htool.cc:4441
 htool.cc:4442
 htool.cc:4443
 htool.cc:4444
 htool.cc:4445
 htool.cc:4446
 htool.cc:4447
 htool.cc:4448
 htool.cc:4449
 htool.cc:4450
 htool.cc:4451
 htool.cc:4452
 htool.cc:4453
 htool.cc:4454
 htool.cc:4455
 htool.cc:4456
 htool.cc:4457
 htool.cc:4458
 htool.cc:4459
 htool.cc:4460
 htool.cc:4461
 htool.cc:4462
 htool.cc:4463
 htool.cc:4464
 htool.cc:4465
 htool.cc:4466
 htool.cc:4467
 htool.cc:4468
 htool.cc:4469
 htool.cc:4470
 htool.cc:4471
 htool.cc:4472
 htool.cc:4473
 htool.cc:4474
 htool.cc:4475
 htool.cc:4476
 htool.cc:4477
 htool.cc:4478
 htool.cc:4479
 htool.cc:4480
 htool.cc:4481
 htool.cc:4482
 htool.cc:4483
 htool.cc:4484
 htool.cc:4485
 htool.cc:4486
 htool.cc:4487
 htool.cc:4488
 htool.cc:4489
 htool.cc:4490
 htool.cc:4491
 htool.cc:4492
 htool.cc:4493
 htool.cc:4494
 htool.cc:4495
 htool.cc:4496
 htool.cc:4497
 htool.cc:4498
 htool.cc:4499
 htool.cc:4500
 htool.cc:4501
 htool.cc:4502
 htool.cc:4503
 htool.cc:4504
 htool.cc:4505
 htool.cc:4506
 htool.cc:4507
 htool.cc:4508
 htool.cc:4509
 htool.cc:4510
 htool.cc:4511
 htool.cc:4512
 htool.cc:4513
 htool.cc:4514
 htool.cc:4515
 htool.cc:4516
 htool.cc:4517
 htool.cc:4518
 htool.cc:4519
 htool.cc:4520
 htool.cc:4521
 htool.cc:4522
 htool.cc:4523
 htool.cc:4524
 htool.cc:4525
 htool.cc:4526
 htool.cc:4527
 htool.cc:4528
 htool.cc:4529
 htool.cc:4530
 htool.cc:4531
 htool.cc:4532
 htool.cc:4533
 htool.cc:4534
 htool.cc:4535
 htool.cc:4536
 htool.cc:4537
 htool.cc:4538
 htool.cc:4539
 htool.cc:4540
 htool.cc:4541
 htool.cc:4542
 htool.cc:4543
 htool.cc:4544
 htool.cc:4545
 htool.cc:4546
 htool.cc:4547
 htool.cc:4548
 htool.cc:4549
 htool.cc:4550
 htool.cc:4551
 htool.cc:4552
 htool.cc:4553
 htool.cc:4554
 htool.cc:4555
 htool.cc:4556
 htool.cc:4557
 htool.cc:4558
 htool.cc:4559
 htool.cc:4560
 htool.cc:4561
 htool.cc:4562
 htool.cc:4563
 htool.cc:4564
 htool.cc:4565
 htool.cc:4566
 htool.cc:4567
 htool.cc:4568
 htool.cc:4569
 htool.cc:4570
 htool.cc:4571
 htool.cc:4572
 htool.cc:4573
 htool.cc:4574
 htool.cc:4575
 htool.cc:4576
 htool.cc:4577
 htool.cc:4578
 htool.cc:4579
 htool.cc:4580
 htool.cc:4581
 htool.cc:4582
 htool.cc:4583
 htool.cc:4584
 htool.cc:4585
 htool.cc:4586
 htool.cc:4587
 htool.cc:4588
 htool.cc:4589
 htool.cc:4590
 htool.cc:4591
 htool.cc:4592
 htool.cc:4593
 htool.cc:4594
 htool.cc:4595
 htool.cc:4596
 htool.cc:4597
 htool.cc:4598
 htool.cc:4599
 htool.cc:4600
 htool.cc:4601
 htool.cc:4602
 htool.cc:4603
 htool.cc:4604
 htool.cc:4605
 htool.cc:4606
 htool.cc:4607
 htool.cc:4608
 htool.cc:4609
 htool.cc:4610
 htool.cc:4611
 htool.cc:4612
 htool.cc:4613
 htool.cc:4614
 htool.cc:4615
 htool.cc:4616
 htool.cc:4617
 htool.cc:4618
 htool.cc:4619
 htool.cc:4620
 htool.cc:4621
 htool.cc:4622
 htool.cc:4623
 htool.cc:4624
 htool.cc:4625
 htool.cc:4626
 htool.cc:4627
 htool.cc:4628
 htool.cc:4629
 htool.cc:4630
 htool.cc:4631
 htool.cc:4632
 htool.cc:4633
 htool.cc:4634
 htool.cc:4635
 htool.cc:4636
 htool.cc:4637
 htool.cc:4638
 htool.cc:4639
 htool.cc:4640
 htool.cc:4641
 htool.cc:4642
 htool.cc:4643
 htool.cc:4644
 htool.cc:4645
 htool.cc:4646
 htool.cc:4647
 htool.cc:4648
 htool.cc:4649
 htool.cc:4650
 htool.cc:4651
 htool.cc:4652
 htool.cc:4653
 htool.cc:4654
 htool.cc:4655
 htool.cc:4656
 htool.cc:4657
 htool.cc:4658
 htool.cc:4659
 htool.cc:4660
 htool.cc:4661
 htool.cc:4662
 htool.cc:4663
 htool.cc:4664
 htool.cc:4665
 htool.cc:4666
 htool.cc:4667
 htool.cc:4668
 htool.cc:4669
 htool.cc:4670
 htool.cc:4671
 htool.cc:4672
 htool.cc:4673
 htool.cc:4674
 htool.cc:4675
 htool.cc:4676
 htool.cc:4677
 htool.cc:4678
 htool.cc:4679
 htool.cc:4680
 htool.cc:4681
 htool.cc:4682
 htool.cc:4683
 htool.cc:4684
 htool.cc:4685
 htool.cc:4686
 htool.cc:4687
 htool.cc:4688
 htool.cc:4689
 htool.cc:4690
 htool.cc:4691
 htool.cc:4692
 htool.cc:4693
 htool.cc:4694
 htool.cc:4695
 htool.cc:4696
 htool.cc:4697
 htool.cc:4698
 htool.cc:4699
 htool.cc:4700
 htool.cc:4701
 htool.cc:4702
 htool.cc:4703
 htool.cc:4704
 htool.cc:4705
 htool.cc:4706
 htool.cc:4707
 htool.cc:4708
 htool.cc:4709
 htool.cc:4710
 htool.cc:4711
 htool.cc:4712
 htool.cc:4713
 htool.cc:4714
 htool.cc:4715
 htool.cc:4716
 htool.cc:4717
 htool.cc:4718
 htool.cc:4719
 htool.cc:4720
 htool.cc:4721
 htool.cc:4722
 htool.cc:4723
 htool.cc:4724
 htool.cc:4725
 htool.cc:4726
 htool.cc:4727
 htool.cc:4728
 htool.cc:4729
 htool.cc:4730
 htool.cc:4731
 htool.cc:4732
 htool.cc:4733
 htool.cc:4734
 htool.cc:4735
 htool.cc:4736
 htool.cc:4737
 htool.cc:4738
 htool.cc:4739
 htool.cc:4740
 htool.cc:4741
 htool.cc:4742
 htool.cc:4743
 htool.cc:4744
 htool.cc:4745
 htool.cc:4746
 htool.cc:4747
 htool.cc:4748
 htool.cc:4749
 htool.cc:4750
 htool.cc:4751
 htool.cc:4752
 htool.cc:4753
 htool.cc:4754
 htool.cc:4755
 htool.cc:4756
 htool.cc:4757
 htool.cc:4758
 htool.cc:4759
 htool.cc:4760
 htool.cc:4761
 htool.cc:4762
 htool.cc:4763
 htool.cc:4764
 htool.cc:4765
 htool.cc:4766
 htool.cc:4767
 htool.cc:4768
 htool.cc:4769
 htool.cc:4770
 htool.cc:4771
 htool.cc:4772
 htool.cc:4773
 htool.cc:4774
 htool.cc:4775
 htool.cc:4776
 htool.cc:4777
 htool.cc:4778
 htool.cc:4779
 htool.cc:4780
 htool.cc:4781
 htool.cc:4782
 htool.cc:4783
 htool.cc:4784
 htool.cc:4785
 htool.cc:4786
 htool.cc:4787
 htool.cc:4788
 htool.cc:4789
 htool.cc:4790
 htool.cc:4791
 htool.cc:4792
 htool.cc:4793
 htool.cc:4794
 htool.cc:4795
 htool.cc:4796
 htool.cc:4797
 htool.cc:4798
 htool.cc:4799
 htool.cc:4800
 htool.cc:4801
 htool.cc:4802
 htool.cc:4803
 htool.cc:4804
 htool.cc:4805
 htool.cc:4806
 htool.cc:4807
 htool.cc:4808
 htool.cc:4809
 htool.cc:4810
 htool.cc:4811
 htool.cc:4812
 htool.cc:4813
 htool.cc:4814
 htool.cc:4815
 htool.cc:4816
 htool.cc:4817
 htool.cc:4818
 htool.cc:4819
 htool.cc:4820
 htool.cc:4821
 htool.cc:4822
 htool.cc:4823
 htool.cc:4824
 htool.cc:4825
 htool.cc:4826
 htool.cc:4827
 htool.cc:4828
 htool.cc:4829
 htool.cc:4830
 htool.cc:4831
 htool.cc:4832
 htool.cc:4833
 htool.cc:4834
 htool.cc:4835
 htool.cc:4836
 htool.cc:4837
 htool.cc:4838
 htool.cc:4839
 htool.cc:4840
 htool.cc:4841
 htool.cc:4842
 htool.cc:4843
 htool.cc:4844
 htool.cc:4845
 htool.cc:4846
 htool.cc:4847
 htool.cc:4848
 htool.cc:4849
 htool.cc:4850
 htool.cc:4851
 htool.cc:4852
 htool.cc:4853
 htool.cc:4854
 htool.cc:4855
 htool.cc:4856
 htool.cc:4857
 htool.cc:4858
 htool.cc:4859
 htool.cc:4860
 htool.cc:4861
 htool.cc:4862
 htool.cc:4863
 htool.cc:4864
 htool.cc:4865
 htool.cc:4866
 htool.cc:4867
 htool.cc:4868
 htool.cc:4869
 htool.cc:4870
 htool.cc:4871
 htool.cc:4872
 htool.cc:4873
 htool.cc:4874
 htool.cc:4875
 htool.cc:4876
 htool.cc:4877
 htool.cc:4878
 htool.cc:4879
 htool.cc:4880
 htool.cc:4881
 htool.cc:4882
 htool.cc:4883
 htool.cc:4884
 htool.cc:4885
 htool.cc:4886
 htool.cc:4887
 htool.cc:4888
 htool.cc:4889
 htool.cc:4890
 htool.cc:4891
 htool.cc:4892
 htool.cc:4893
 htool.cc:4894
 htool.cc:4895
 htool.cc:4896
 htool.cc:4897
 htool.cc:4898
 htool.cc:4899
 htool.cc:4900
 htool.cc:4901
 htool.cc:4902
 htool.cc:4903
 htool.cc:4904
 htool.cc:4905
 htool.cc:4906
 htool.cc:4907
 htool.cc:4908
 htool.cc:4909
 htool.cc:4910
 htool.cc:4911
 htool.cc:4912
 htool.cc:4913
 htool.cc:4914
 htool.cc:4915
 htool.cc:4916
 htool.cc:4917
 htool.cc:4918
 htool.cc:4919
 htool.cc:4920
 htool.cc:4921
 htool.cc:4922
 htool.cc:4923
 htool.cc:4924
 htool.cc:4925
 htool.cc:4926
 htool.cc:4927
 htool.cc:4928
 htool.cc:4929
 htool.cc:4930
 htool.cc:4931
 htool.cc:4932
 htool.cc:4933
 htool.cc:4934
 htool.cc:4935
 htool.cc:4936
 htool.cc:4937
 htool.cc:4938
 htool.cc:4939
 htool.cc:4940
 htool.cc:4941
 htool.cc:4942
 htool.cc:4943
 htool.cc:4944
 htool.cc:4945
 htool.cc:4946
 htool.cc:4947
 htool.cc:4948
 htool.cc:4949
 htool.cc:4950
 htool.cc:4951
 htool.cc:4952
 htool.cc:4953
 htool.cc:4954
 htool.cc:4955
 htool.cc:4956
 htool.cc:4957
 htool.cc:4958
 htool.cc:4959
 htool.cc:4960
 htool.cc:4961
 htool.cc:4962
 htool.cc:4963
 htool.cc:4964
 htool.cc:4965
 htool.cc:4966
 htool.cc:4967
 htool.cc:4968
 htool.cc:4969
 htool.cc:4970
 htool.cc:4971
 htool.cc:4972
 htool.cc:4973
 htool.cc:4974
 htool.cc:4975
 htool.cc:4976
 htool.cc:4977
 htool.cc:4978
 htool.cc:4979
 htool.cc:4980
 htool.cc:4981
 htool.cc:4982
 htool.cc:4983
 htool.cc:4984
 htool.cc:4985
 htool.cc:4986
 htool.cc:4987
 htool.cc:4988
 htool.cc:4989
 htool.cc:4990
 htool.cc:4991
 htool.cc:4992
 htool.cc:4993
 htool.cc:4994
 htool.cc:4995
 htool.cc:4996
 htool.cc:4997
 htool.cc:4998
 htool.cc:4999
 htool.cc:5000
 htool.cc:5001
 htool.cc:5002
 htool.cc:5003
 htool.cc:5004
 htool.cc:5005
 htool.cc:5006
 htool.cc:5007
 htool.cc:5008
 htool.cc:5009
 htool.cc:5010
 htool.cc:5011
 htool.cc:5012
 htool.cc:5013
 htool.cc:5014
 htool.cc:5015
 htool.cc:5016
 htool.cc:5017
 htool.cc:5018
 htool.cc:5019
 htool.cc:5020
 htool.cc:5021
 htool.cc:5022
 htool.cc:5023
 htool.cc:5024
 htool.cc:5025
 htool.cc:5026
 htool.cc:5027
 htool.cc:5028
 htool.cc:5029
 htool.cc:5030
 htool.cc:5031
 htool.cc:5032
 htool.cc:5033
 htool.cc:5034
 htool.cc:5035
 htool.cc:5036
 htool.cc:5037
 htool.cc:5038
 htool.cc:5039
 htool.cc:5040
 htool.cc:5041
 htool.cc:5042
 htool.cc:5043
 htool.cc:5044
 htool.cc:5045
 htool.cc:5046
 htool.cc:5047
 htool.cc:5048
 htool.cc:5049
 htool.cc:5050
 htool.cc:5051
 htool.cc:5052
 htool.cc:5053
 htool.cc:5054
 htool.cc:5055
 htool.cc:5056
 htool.cc:5057
 htool.cc:5058
 htool.cc:5059
 htool.cc:5060
 htool.cc:5061
 htool.cc:5062
 htool.cc:5063
 htool.cc:5064
 htool.cc:5065
 htool.cc:5066
 htool.cc:5067
 htool.cc:5068
 htool.cc:5069
 htool.cc:5070
 htool.cc:5071
 htool.cc:5072
 htool.cc:5073
 htool.cc:5074
 htool.cc:5075
 htool.cc:5076
 htool.cc:5077
 htool.cc:5078
 htool.cc:5079
 htool.cc:5080
 htool.cc:5081
 htool.cc:5082
 htool.cc:5083
 htool.cc:5084
 htool.cc:5085
 htool.cc:5086
 htool.cc:5087
 htool.cc:5088
 htool.cc:5089
 htool.cc:5090
 htool.cc:5091
 htool.cc:5092
 htool.cc:5093
 htool.cc:5094
 htool.cc:5095
 htool.cc:5096
 htool.cc:5097
 htool.cc:5098
 htool.cc:5099
 htool.cc:5100
 htool.cc:5101
 htool.cc:5102
 htool.cc:5103
 htool.cc:5104
 htool.cc:5105
 htool.cc:5106
 htool.cc:5107
 htool.cc:5108
 htool.cc:5109
 htool.cc:5110
 htool.cc:5111
 htool.cc:5112
 htool.cc:5113
 htool.cc:5114
 htool.cc:5115
 htool.cc:5116
 htool.cc:5117
 htool.cc:5118
 htool.cc:5119
 htool.cc:5120
 htool.cc:5121
 htool.cc:5122
 htool.cc:5123
 htool.cc:5124
 htool.cc:5125
 htool.cc:5126
 htool.cc:5127
 htool.cc:5128
 htool.cc:5129
 htool.cc:5130
 htool.cc:5131
 htool.cc:5132
 htool.cc:5133
 htool.cc:5134
 htool.cc:5135
 htool.cc:5136
 htool.cc:5137
 htool.cc:5138
 htool.cc:5139
 htool.cc:5140
 htool.cc:5141
 htool.cc:5142
 htool.cc:5143
 htool.cc:5144
 htool.cc:5145
 htool.cc:5146
 htool.cc:5147
 htool.cc:5148
 htool.cc:5149
 htool.cc:5150
 htool.cc:5151
 htool.cc:5152
 htool.cc:5153
 htool.cc:5154
 htool.cc:5155
 htool.cc:5156
 htool.cc:5157
 htool.cc:5158
 htool.cc:5159
 htool.cc:5160
 htool.cc:5161
 htool.cc:5162
 htool.cc:5163
 htool.cc:5164
 htool.cc:5165
 htool.cc:5166
 htool.cc:5167
 htool.cc:5168
 htool.cc:5169
 htool.cc:5170
 htool.cc:5171
 htool.cc:5172
 htool.cc:5173
 htool.cc:5174
 htool.cc:5175
 htool.cc:5176
 htool.cc:5177
 htool.cc:5178
 htool.cc:5179
 htool.cc:5180
 htool.cc:5181
 htool.cc:5182
 htool.cc:5183
 htool.cc:5184
 htool.cc:5185
 htool.cc:5186
 htool.cc:5187
 htool.cc:5188
 htool.cc:5189
 htool.cc:5190
 htool.cc:5191
 htool.cc:5192
 htool.cc:5193
 htool.cc:5194
 htool.cc:5195
 htool.cc:5196
 htool.cc:5197
 htool.cc:5198
 htool.cc:5199
 htool.cc:5200
 htool.cc:5201
 htool.cc:5202
 htool.cc:5203
 htool.cc:5204
 htool.cc:5205
 htool.cc:5206
 htool.cc:5207
 htool.cc:5208
 htool.cc:5209
 htool.cc:5210
 htool.cc:5211
 htool.cc:5212
 htool.cc:5213
 htool.cc:5214
 htool.cc:5215
 htool.cc:5216
 htool.cc:5217
 htool.cc:5218
 htool.cc:5219
 htool.cc:5220
 htool.cc:5221
 htool.cc:5222
 htool.cc:5223
 htool.cc:5224
 htool.cc:5225
 htool.cc:5226
 htool.cc:5227
 htool.cc:5228
 htool.cc:5229
 htool.cc:5230
 htool.cc:5231
 htool.cc:5232
 htool.cc:5233
 htool.cc:5234
 htool.cc:5235
 htool.cc:5236
 htool.cc:5237
 htool.cc:5238
 htool.cc:5239
 htool.cc:5240
 htool.cc:5241
 htool.cc:5242
 htool.cc:5243
 htool.cc:5244
 htool.cc:5245
 htool.cc:5246
 htool.cc:5247
 htool.cc:5248
 htool.cc:5249
 htool.cc:5250
 htool.cc:5251
 htool.cc:5252
 htool.cc:5253
 htool.cc:5254
 htool.cc:5255
 htool.cc:5256
 htool.cc:5257
 htool.cc:5258
 htool.cc:5259
 htool.cc:5260
 htool.cc:5261
 htool.cc:5262
 htool.cc:5263
 htool.cc:5264
 htool.cc:5265
 htool.cc:5266
 htool.cc:5267
 htool.cc:5268
 htool.cc:5269
 htool.cc:5270
 htool.cc:5271
 htool.cc:5272
 htool.cc:5273
 htool.cc:5274
 htool.cc:5275
 htool.cc:5276
 htool.cc:5277
 htool.cc:5278
 htool.cc:5279
 htool.cc:5280
 htool.cc:5281
 htool.cc:5282
 htool.cc:5283
 htool.cc:5284
 htool.cc:5285
 htool.cc:5286
 htool.cc:5287
 htool.cc:5288
 htool.cc:5289
 htool.cc:5290
 htool.cc:5291
 htool.cc:5292
 htool.cc:5293
 htool.cc:5294
 htool.cc:5295
 htool.cc:5296
 htool.cc:5297
 htool.cc:5298
 htool.cc:5299
 htool.cc:5300
 htool.cc:5301
 htool.cc:5302
 htool.cc:5303
 htool.cc:5304
 htool.cc:5305
 htool.cc:5306
 htool.cc:5307
 htool.cc:5308
 htool.cc:5309
 htool.cc:5310
 htool.cc:5311
 htool.cc:5312
 htool.cc:5313
 htool.cc:5314
 htool.cc:5315
 htool.cc:5316
 htool.cc:5317
 htool.cc:5318
 htool.cc:5319
 htool.cc:5320
 htool.cc:5321
 htool.cc:5322
 htool.cc:5323
 htool.cc:5324
 htool.cc:5325
 htool.cc:5326
 htool.cc:5327
 htool.cc:5328
 htool.cc:5329
 htool.cc:5330
 htool.cc:5331
 htool.cc:5332
 htool.cc:5333
 htool.cc:5334
 htool.cc:5335
 htool.cc:5336
 htool.cc:5337
 htool.cc:5338
 htool.cc:5339
 htool.cc:5340
 htool.cc:5341
 htool.cc:5342
 htool.cc:5343
 htool.cc:5344
 htool.cc:5345
 htool.cc:5346
 htool.cc:5347
 htool.cc:5348
 htool.cc:5349
 htool.cc:5350
 htool.cc:5351
 htool.cc:5352
 htool.cc:5353
 htool.cc:5354
 htool.cc:5355
 htool.cc:5356
 htool.cc:5357
 htool.cc:5358
 htool.cc:5359
 htool.cc:5360
 htool.cc:5361
 htool.cc:5362
 htool.cc:5363
 htool.cc:5364
 htool.cc:5365
 htool.cc:5366
 htool.cc:5367
 htool.cc:5368
 htool.cc:5369
 htool.cc:5370
 htool.cc:5371
 htool.cc:5372
 htool.cc:5373
 htool.cc:5374
 htool.cc:5375
 htool.cc:5376
 htool.cc:5377
 htool.cc:5378
 htool.cc:5379
 htool.cc:5380
 htool.cc:5381
 htool.cc:5382
 htool.cc:5383
 htool.cc:5384
 htool.cc:5385
 htool.cc:5386
 htool.cc:5387
 htool.cc:5388
 htool.cc:5389
 htool.cc:5390
 htool.cc:5391
 htool.cc:5392
 htool.cc:5393
 htool.cc:5394
 htool.cc:5395
 htool.cc:5396
 htool.cc:5397
 htool.cc:5398
 htool.cc:5399
 htool.cc:5400
 htool.cc:5401
 htool.cc:5402
 htool.cc:5403
 htool.cc:5404
 htool.cc:5405
 htool.cc:5406
 htool.cc:5407
 htool.cc:5408
 htool.cc:5409
 htool.cc:5410
 htool.cc:5411
 htool.cc:5412
 htool.cc:5413
 htool.cc:5414
 htool.cc:5415
 htool.cc:5416
 htool.cc:5417
 htool.cc:5418
 htool.cc:5419
 htool.cc:5420
 htool.cc:5421
 htool.cc:5422
 htool.cc:5423
 htool.cc:5424
 htool.cc:5425
 htool.cc:5426
 htool.cc:5427
 htool.cc:5428
 htool.cc:5429
 htool.cc:5430
 htool.cc:5431
 htool.cc:5432
 htool.cc:5433
 htool.cc:5434
 htool.cc:5435
 htool.cc:5436
 htool.cc:5437
 htool.cc:5438
 htool.cc:5439
 htool.cc:5440
 htool.cc:5441
 htool.cc:5442
 htool.cc:5443
 htool.cc:5444
 htool.cc:5445
 htool.cc:5446
 htool.cc:5447
 htool.cc:5448
 htool.cc:5449
 htool.cc:5450
 htool.cc:5451
 htool.cc:5452
 htool.cc:5453
 htool.cc:5454
 htool.cc:5455
 htool.cc:5456
 htool.cc:5457
 htool.cc:5458
 htool.cc:5459
 htool.cc:5460
 htool.cc:5461
 htool.cc:5462
 htool.cc:5463
 htool.cc:5464
 htool.cc:5465
 htool.cc:5466
 htool.cc:5467
 htool.cc:5468
 htool.cc:5469
 htool.cc:5470
 htool.cc:5471
 htool.cc:5472
 htool.cc:5473
 htool.cc:5474
 htool.cc:5475
 htool.cc:5476
 htool.cc:5477
 htool.cc:5478
 htool.cc:5479
 htool.cc:5480
 htool.cc:5481
 htool.cc:5482
 htool.cc:5483
 htool.cc:5484
 htool.cc:5485
 htool.cc:5486
 htool.cc:5487
 htool.cc:5488
 htool.cc:5489
 htool.cc:5490
 htool.cc:5491
 htool.cc:5492
 htool.cc:5493
 htool.cc:5494
 htool.cc:5495
 htool.cc:5496
 htool.cc:5497
 htool.cc:5498
 htool.cc:5499
 htool.cc:5500
 htool.cc:5501
 htool.cc:5502
 htool.cc:5503
 htool.cc:5504
 htool.cc:5505
 htool.cc:5506
 htool.cc:5507
 htool.cc:5508
 htool.cc:5509
 htool.cc:5510
 htool.cc:5511
 htool.cc:5512
 htool.cc:5513
 htool.cc:5514
 htool.cc:5515
 htool.cc:5516
 htool.cc:5517
 htool.cc:5518
 htool.cc:5519
 htool.cc:5520
 htool.cc:5521
 htool.cc:5522
 htool.cc:5523
 htool.cc:5524
 htool.cc:5525
 htool.cc:5526
 htool.cc:5527
 htool.cc:5528
 htool.cc:5529
 htool.cc:5530
 htool.cc:5531
 htool.cc:5532
 htool.cc:5533
 htool.cc:5534
 htool.cc:5535
 htool.cc:5536
 htool.cc:5537
 htool.cc:5538
 htool.cc:5539
 htool.cc:5540
 htool.cc:5541
 htool.cc:5542
 htool.cc:5543
 htool.cc:5544
 htool.cc:5545
 htool.cc:5546
 htool.cc:5547
 htool.cc:5548
 htool.cc:5549
 htool.cc:5550
 htool.cc:5551
 htool.cc:5552
 htool.cc:5553
 htool.cc:5554
 htool.cc:5555
 htool.cc:5556
 htool.cc:5557
 htool.cc:5558
 htool.cc:5559
 htool.cc:5560
 htool.cc:5561
 htool.cc:5562
 htool.cc:5563
 htool.cc:5564
 htool.cc:5565
 htool.cc:5566
 htool.cc:5567
 htool.cc:5568
 htool.cc:5569
 htool.cc:5570
 htool.cc:5571
 htool.cc:5572
 htool.cc:5573
 htool.cc:5574
 htool.cc:5575
 htool.cc:5576
 htool.cc:5577
 htool.cc:5578
 htool.cc:5579
 htool.cc:5580
 htool.cc:5581
 htool.cc:5582
 htool.cc:5583
 htool.cc:5584
 htool.cc:5585
 htool.cc:5586
 htool.cc:5587
 htool.cc:5588
 htool.cc:5589
 htool.cc:5590
 htool.cc:5591
 htool.cc:5592
 htool.cc:5593
 htool.cc:5594
 htool.cc:5595
 htool.cc:5596
 htool.cc:5597
 htool.cc:5598
 htool.cc:5599
 htool.cc:5600
 htool.cc:5601
 htool.cc:5602
 htool.cc:5603
 htool.cc:5604
 htool.cc:5605
 htool.cc:5606
 htool.cc:5607
 htool.cc:5608
 htool.cc:5609
 htool.cc:5610
 htool.cc:5611
 htool.cc:5612
 htool.cc:5613
 htool.cc:5614
 htool.cc:5615
 htool.cc:5616
 htool.cc:5617
 htool.cc:5618
 htool.cc:5619
 htool.cc:5620
 htool.cc:5621
 htool.cc:5622
 htool.cc:5623
 htool.cc:5624
 htool.cc:5625
 htool.cc:5626
 htool.cc:5627
 htool.cc:5628
 htool.cc:5629
 htool.cc:5630
 htool.cc:5631
 htool.cc:5632
 htool.cc:5633
 htool.cc:5634
 htool.cc:5635
 htool.cc:5636
 htool.cc:5637
 htool.cc:5638
 htool.cc:5639
 htool.cc:5640
 htool.cc:5641
 htool.cc:5642
 htool.cc:5643
 htool.cc:5644
 htool.cc:5645
 htool.cc:5646
 htool.cc:5647
 htool.cc:5648
 htool.cc:5649
 htool.cc:5650
 htool.cc:5651
 htool.cc:5652
 htool.cc:5653
 htool.cc:5654
 htool.cc:5655
 htool.cc:5656
 htool.cc:5657
 htool.cc:5658
 htool.cc:5659
 htool.cc:5660
 htool.cc:5661
 htool.cc:5662
 htool.cc:5663
 htool.cc:5664
 htool.cc:5665
 htool.cc:5666
 htool.cc:5667
 htool.cc:5668
 htool.cc:5669
 htool.cc:5670
 htool.cc:5671
 htool.cc:5672
 htool.cc:5673
 htool.cc:5674
 htool.cc:5675
 htool.cc:5676
 htool.cc:5677
 htool.cc:5678
 htool.cc:5679
 htool.cc:5680
 htool.cc:5681
 htool.cc:5682
 htool.cc:5683
 htool.cc:5684
 htool.cc:5685
 htool.cc:5686
 htool.cc:5687
 htool.cc:5688
 htool.cc:5689
 htool.cc:5690
 htool.cc:5691
 htool.cc:5692
 htool.cc:5693
 htool.cc:5694
 htool.cc:5695
 htool.cc:5696
 htool.cc:5697
 htool.cc:5698
 htool.cc:5699
 htool.cc:5700
 htool.cc:5701
 htool.cc:5702
 htool.cc:5703
 htool.cc:5704
 htool.cc:5705
 htool.cc:5706
 htool.cc:5707
 htool.cc:5708
 htool.cc:5709
 htool.cc:5710
 htool.cc:5711
 htool.cc:5712
 htool.cc:5713
 htool.cc:5714
 htool.cc:5715
 htool.cc:5716
 htool.cc:5717
 htool.cc:5718
 htool.cc:5719
 htool.cc:5720
 htool.cc:5721
 htool.cc:5722
 htool.cc:5723
 htool.cc:5724
 htool.cc:5725
 htool.cc:5726
 htool.cc:5727
 htool.cc:5728
 htool.cc:5729
 htool.cc:5730
 htool.cc:5731
 htool.cc:5732
 htool.cc:5733
 htool.cc:5734
 htool.cc:5735
 htool.cc:5736
 htool.cc:5737
 htool.cc:5738
 htool.cc:5739
 htool.cc:5740
 htool.cc:5741
 htool.cc:5742
 htool.cc:5743
 htool.cc:5744
 htool.cc:5745
 htool.cc:5746
 htool.cc:5747
 htool.cc:5748
 htool.cc:5749