ROOT logo
HYDRA - THE HADES ANALYSIS PACKAGE » UTIL » HHistMap

class HHistMap: public TNamed

_HADES_CLASS_DESCRIPTION



 HHistMap
 helper class to hold a map of histogram, TCanvas, TCut,
 TF1 and TObject (parameters) pointers.
 The HHistMap is streamed into output file and can be
 read back to obtain all hists/canvas/cuts/fits/parmeters

#include "hhistmap.h"
#include "harray.h"
#include "htool.h"
#include "TH1.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TROOT.h"
#include "TRandom.h"
#include "TMath.h"
#include "TObjArray.h"
#include "TF1.h"
#include "TMacro.h"

#include <iostream>
using namespace std;

Bool_t fillGaus(TH1* h ,TString name,HHistMap* map,TObjArray* params)
{
    // fill some random gauss with
    // randomized mean and sigma
    // h : hist                                    (set automatically)
    // array : h is part of this array in HHistMap (set automatically)
    // map : HHistMap owning this object           (set automatically)
    // params : user params

    // defaults
    Double_t meanlow  = 10;
    Double_t meanup   = 10;
    Double_t siglow   = 2 ;
    Double_t sigup    = 2 ;

    if(map){
        HArrayD* par = (HArrayD*) map->getPar("parsGaus");
	if(par){

	    TArrayD* pars = par->data;

	    meanlow = pars->At(0);
	    meanup  = pars->At(1);
	    siglow  = pars->At(2);
	    sigup   = pars->At(3);
	}
    }

    Double_t mean = meanlow + gRandom->Rndm() * (meanup-meanlow);
    Double_t sig  = siglow  + gRandom->Rndm() * (sigup -siglow );

    if (h)  for(Int_t i = 0 ; i < 1000; i ++ ) h->Fill(gRandom->Gaus(mean,sig));

    return kTRUE;
}

Bool_t fillRndm(TH1* h ,TString name,HHistMap* map,TObjArray* params)
{
    // fill some random
    // randomized range
    // h : hist                                    (set automatically)
    // array : h is part of this array in HHistMap (set automatically)
    // map : HHistMap owning this object           (set automatically)
    // params : user params

    // defaults
    Double_t meanlow  = 10;
    Double_t meanup   = 10;

    if(map){
	HArrayD* par = (HArrayD*) map->getPar("parsGaus");
	if(par){
	    TArrayD* pars = par->data;

	    meanlow = pars->At(0);
	    meanup  = pars->At(1);
	}
    }

    if (h)  for(Int_t i = 0 ; i < 10000; i ++ ) h->Fill(meanlow + gRandom->Rndm() * (meanup-meanlow));

    return kTRUE;
}

Bool_t fillMeanRms(TH1* h ,TString name,HHistMap* map,TObjArray* params)
{
    // fill mean and rms to some other histogram
    // h : hist                                    (set automatically)
    // array : h is part of this array in HHistMap (set automatically)
    // map : HHistMap owning this object           (set automatically)
    // params : user params

    // defaults

    if(map&&h){
	TH1* mean = map->get("h8_mean");
	TH1* rms  = map->get("h8_rms");

        Int_t index = map->getIndex(name,h);
	if(mean) {
	    mean->SetBinContent(index+1,h->GetMean());
	    mean->SetBinError  (index+1,h->GetMeanError());
	}
	if(rms){
	    rms ->SetBinContent(index+1,h->GetRMS());
            rms ->SetBinError  (index+1,h->GetRMSError());
        }
    }

    return kTRUE;
}

Bool_t setColor(TH1* h ,TString name,HHistMap* map,TObjArray* params)
{
    // set color of hists in array
    // h : hist                                   (set automatically)
    // name : h is part of this array in HHistMap (set automatically)
    // map : HHistMap owning this hist            (set automatically)
    // params : user params

    if(map){
        HArrayI* cols = (HArrayI*) map->getPar("colors");
	if(cols){
	    Int_t index   = map->getIndex(name,h);     // linear index of this object in array
	    h->SetLineColor(cols->data->At(index));
	}
    }
    return kTRUE;
}

void histmap()
{
    gROOT->SetBatch();

    HHistMap hM("test.root");  // all hist will go to test.root
    hM.setSilentFail(kTRUE);   // (default kFALSE), kTRUE: do not emmit errors when hists do not exist in get(), get2() etc.
    hM.addHist(new TH1F("h","h",100,0,100),"hists/h");  // single hist, stored in subdir hists/h in output


    //------------------------------------------------------------
    // create hist arrays outside HHistMap and add them to HHistMap
    TH1F* h1[6];
    for(Int_t sector=0;sector<6;sector++){
	h1[sector]=new TH1F(Form("h1_s%i",sector),Form("h1_s%i",sector),100,0,100);
    }

    // create a linear array for 2dim indexing
    TH1F* h2[24]; // 6x4 like h2[6][4]
    for(Int_t sector=0;sector<6;sector++){
	for(Int_t module=0;module<4;module++){
	    h2[HTool::getLinearIndex(sector,6,module,4)]= new TH1F(Form("h2_s%i_m%i",sector,module),Form("h2_s%i_m%i",sector,module),100,0,100);
	}
    }


    hM.addHistArray((TH1**)h1,"h1","h1_s%i"    ,"h1_s%i"    ,"hists/h1",6);    // 1dim array size 6
    hM.addHistArray((TH1**)h2,"h2","h2_s%i_m%i","h2_s%i_m%i","hists/h2",6,4);  // 2dim array size 6x4
    //------------------------------------------------------------




    //------------------------------------------------------------
    // create hist arrays inside HHistMap    ( see hM.addHistN(...) and  hM.addHistArrayN(...) for non const hists
    hM.addHist     ("TH1F","h3","h3",100,0,100,0,0,0,0,0,0,"time1 [ns]","counts","","hists/h3");

    TString secname= "I,II,III,IV,V,VI";
    TString modname= "I,II,III,IV";


    // create hist array with custom names
    hM.addHistArray("TH1F","h4","h4t1_s[%i]m[%i]","time1s[%i]m[%i]"
		    ,100,0.,100.
		    ,0,0.,0.
		    ,0,0.,0.
		    ,"time1 [ns]","counts","","hists/h4",6,4,-1,-1,-1,secname,modname);  // create hists with special names;

    hM.addHistArray("TH2F","h5","h5t1_t12_s[%i]m[%i]","time1_t12s[%i]m[%i]"
		    ,100,0.,100.
		    ,100,0.,100.
		    ,0,0.,0.
		    ,"time1 [ns]","t2-t1","","hists/h5",6,4);

    hM.addHistArray("TH1F","h6","h6t1_s[%i]m[%i]","time1s[%i]m[%i]"
		    ,100,0.,100.
		    ,0,0.,0.
		    ,0,0.,0.
		    ,"time1 [ns]","counts","","hists/h6",6,4);

    hM.addHistArray("TH1F","h7","h7t1_s[%i]m[%i]","time1s[%i]m[%i]"
		    ,100,0.,100.
		    ,0,0.,0.
		    ,0,0.,0.
		    ,"time1 [ns]","counts","","hists/h7",6,4);

    hM.addHist("TH1F","h8_mean","h8_mean",24,0,24,0,0,0,0,0,0,"time1 index [ns]","time1 mean [ns]","","hists/h8");
    hM.addHist("TH1F","h8_rms" ,"h8_rms" ,24,0,24,0,0,0,0,0,0,"time1 index [ns]","time1 rms [ns]" ,"","hists/h8");
    //------------------------------------------------------------


    //------------------------------------------------------------
    // get multi dimensional arrays created by HHistMap.
    // delete of the pointer arrays is done in destructor!
    TH2F*** h5 = NULL; h5 = hM.getDim2(h5,"h5");
    for(Int_t sector=0;sector<6;sector++){
	for(Int_t module=0;module<4;module++){
	    //cout<<sector<<" "<<module<<" "<<h5[sector][module]->GetName()<<endl;
	}
    }
    //------------------------------------------------------------


    //------------------------------------------------------------
    // create pointer arrays , not managed by HHistMap
    // take care about delete yourself
    TH2F*** htest = NULL;
    htest = HHistMap::newDim2(htest,6,4);
    // .... put hist pointer to array
    HHistMap::deleteDim2(htest,6,4,kFALSE); // delete only pointer array, not hists!
    //------------------------------------------------------------


    //########################################################################
    //########################################################################
    //########################################################################
    //########################################################################



    //------------------------------------------------------------
    // create canvas arrays outside HHistMap and add them to HHistMap
    hM.addCanvas(new TCanvas("c","c",500,500),1,0,500,500,"canvas/c");  // canvas outside created

    TCanvas* c1[6];
    for(Int_t sector=0;sector<6;sector++){
	c1[sector]=new TCanvas(Form("c1_s%i",sector),Form("c1_s%i",sector),500,500);
    }

   // create a linear array for 2dim indexing
    TCanvas* c2[24]; // 6x4 like c2[6][4]
    for(Int_t sector=0;sector<6;sector++){
	for(Int_t module=0;module<4;module++){
	    c2[HTool::getLinearIndex(sector,6,module,4)] = new TCanvas(Form("c2_s%i_m%i",sector,module),Form("c2_s%i_m%i",sector,module),500,500);
	}
    }


    hM.addCanvasArray((TCanvas**)c1,"c1","c1_s%i"    ,"c1_s%i"    ,1,0,500,500,"canvas/c1",6);    // 1dim array size 6
    hM.addCanvasArray((TCanvas**)c2,"c2","c2_s%i_m%i","c2_s%i_m%i",1,0,500,500,"canvas/c2",6,4);  // 2dim array size 6x4
    //------------------------------------------------------------




    //------------------------------------------------------------
    // create canvas arrays inside HHistMap
    hM.addCanvas     ("c3","c3",2,1,500,500,"canvas/c3");
    hM.addCanvasArray("c4","c4t1_s[%i]m[%i]","c4time1s[%i]m[%i]"
		      ,1,0,500,500
                      ,"canvas/c4"
		      ,6,4);
    //------------------------------------------------------------


    //------------------------------------------------------------
    // get multi dimensional arrays created by HHistMap.
    // delete of the pointer arrays is done in destructor!
    TCanvas*** c4 = NULL; c4 = hM.getCanvasDim2(c4,"c4");
    for(Int_t sector=0;sector<6;sector++){
	for(Int_t module=0;module<4;module++){
	    //cout<<sector<<" "<<module<<" "<<c4[sector][module]->GetName()<<endl;
	}
    }
    //------------------------------------------------------------


    //------------------------------------------------------------
    // create pointer arrays , not managed by HHistMap
    // take care about delete yourself
    TCanvas*** ctest = NULL;
    ctest = HHistMap::newDim2(ctest,6,4);
    // .... put hist pointer to array
    HHistMap::deleteDim2(ctest,6,4,kFALSE); // delete only pointer array, not hists!
    //------------------------------------------------------------


    //########################################################################
    //########################################################################
    //########################################################################
    //########################################################################
    // accessing objects


    //------------------------------------------------------------
    // METHOD I:
    // access the histograms by name : use the lable
    // retrieve pointer by :
    // TH1* get()
    // TH2* get2()  for 2Dim hists  (get will work too, but some funtcion of TH2 can not be used with TH1 pointer)
    // TH3* get3()  for 3dim hists  (get will work too, but some funtcion of TH3 can not be used with TH1 pointer)

    hM.get("h")     ->FillRandom("gaus",1000);  // single
    hM.get("h1",1)  ->FillRandom("gaus",1000);  // 1dim index 1
    hM.get("h2",1,0)->FillRandom("gaus",1000);  // 2dim index [1][0]
    for(Int_t i=0;i<1000;i++) hM.get ("h5",1,0)->Fill(gRandom->Gaus()*10+50,gRandom->Gaus()*10+50);     // function in TH1
    for(Int_t i=0;i<1000;i++) hM.get2("h5",1,1)->Fill(gRandom->Gaus()*10+50,gRandom->Gaus()*10+50,2.);  // function in TH2

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

    //------------------------------------------------------------
    // METHOD II:
    // access the histograms by name : use the lable
    // retrieve a dynamically created multidim pointer

    TH2F*** h5_access = NULL;
    h5_access = hM.getDim2(h5,"h5");
    h5_access[0][0]->Fill( 1000, 100);
    //------------------------------------------------------------

    //------------------------------------------------------------
    // METHOD I:
    // access the canvas by name : use the lable
    hM.getCanvas("c3")     ->cd(1); // single canvas 2pads
    hM.get("h5",1,0)->Draw("colz");
    hM.getCanvas("c3")     ->cd(2); // single
    hM.get("h5",1,1)->Draw("colz");

    hM.getCanvas("c1",1)  ->cd(); // 1dim index 1
    hM.getCanvas("c2",1,0)->cd(); // 2dim index [1][0]
    //------------------------------------------------------------

    //------------------------------------------------------------
    // METHOD II:
    // access the histograms by name : use the lable
    TCanvas*** c4_access = NULL;
    c4_access = hM.getCanvasDim2(c4_access,"c4");
    c4_access[0][0]->cd();
    //------------------------------------------------------------


    //------------------------------------------------------------
    // working with cuts and params

    Double_t xcut[]= {
	0.191092,
	0.144397,
	0.15158,
	0.318606,
	0.483836,
	0.548491,
	0.51796,
	0.37967,
	0.221624,
	0.201868,
	0.191092};

    Double_t  ycut[]={
	83.8983,
	67.4788,
	47.3517,
	32.5212,
	34.375,
	55.8263,
	77.8072,
	89.4597,
      87.6059,
	85.7521,
	83.8983};

    hM.addCut("myCut",sizeof(xcut)/sizeof(Double_t),xcut,ycut,"cut");

    Double_t vals[4] = {30,50,2,6};
    HArrayD parsGaus(sizeof(vals)/sizeof(Double_t),vals); // wrapper for TArray
    parsGaus.print();

    hM.addPar(&parsGaus,"parsGaus","pars");

    Int_t colorsMod[4] = {1,2,4,8};
    HArrayI colors(24);
    Int_t* cl = colors.getArray();
    for(Int_t s = 0; s < 6; s ++) {
       for(Int_t m = 0; m < 4; m ++) {
	    cl[HTool::getLinearIndex(s,6,m,4)] = colorsMod[m];
	}
    }
    hM.addPar(&colors,"colors","pars");
    colors.print();

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

    //------------------------------------------------------------
    // working with functions on arrays

    hM.functionArray("h4", fillGaus   ,NULL); // fill some random  distributions
    hM.functionArray("h4", fillMeanRms,NULL); // fill hist with means+rms of h4   "h8_mean" "h8_rms"
    hM.functionArray("h6", fillRndm   ,NULL); // fill some random  distributions
    hM.functionArray("h4", setColor   ,NULL); // setColors per module
    hM.functionArray("h6", setColor   ,NULL); // setColors per module


    //see also : 2 and 3 operator add,multiply,divide
    hM.addArray     ("h7","h6",1.,1.);  // make copy of h6 to h7
    hM.divideArray  ("h6","h4",1.,1., "");
    //hM.multiplyArray("h6","h4",1.,1., "");
    // standard actions
    //hM.resetArray ("h7","");
    //hM.scaleArray ("h7", 2.);
    //hM.sumW2Array ("h7");
    //------------------------------------------------------------

    //------------------------------------------------------------
    // working with macros

	TF1* fgaus = new TF1("fgaus","gaus",-1,1);
	fgaus->SetLineColor(2);
	hM.addFit(fgaus,"fits/gaus");

      hM.addCanvas("c10","c10",1,1,500,500,"canvas/c2");


	TMacro* mac = new TMacro("drawHist");
	//mac->ReadFile("./histmac/hhistmap_drawHist.C");  // read  macro from existing file (file should not be in workdir)

	mac->AddLine("void drawHist(){");
	mac->AddLine("cout<<\"exec drawHist\"<<endl;");
	mac->AddLine("gHHistMap->getCanvas(\"c10\")->Draw();");
	mac->AddLine("gHHistMap->getCanvas(\"c10\")->cd();");
	mac->AddLine("gHHistMap->get(\"h\")->SetLineColor(4);");
	mac->AddLine("gHHistMap->get(\"h\")->SetLineStyle(2);");
	mac->AddLine("gHHistMap->get(\"h\")->SetMarkerStyle(8);");
	mac->AddLine("gHHistMap->get(\"h\")->SetMarkerColor(8);");
	mac->AddLine("gHHistMap->getFit(\"fgaus\")->SetRange(-1,1);");
	mac->AddLine("gHHistMap->get(\"h\")->Fit(gHHistMap->getFit(\"fgaus\"),\"R\");");
	mac->AddLine("cout<<\"mean =\"<<gHHistMap->getFit(\"fgaus\")->GetParameter(1)<<\" sig =\"<<gHHistMap->getFit(\"fgaus\")->GetParameter(2)<<endl;");
	mac->AddLine("gHHistMap->get(\"h\")->Draw(\"PL\");");
	mac->AddLine("gHHistMap->getCanvas(\"c10\")->Update();");
	mac->AddLine("}");
      // mac->SaveSource("./histmac/hhistmap_drawHist.C"); // write macro to text file

	hM.addMacro(mac,"drawHist","macros/draw");

      hm->getMacro("drawHist")->Print();  // print source code
      hm->getMacro("drawHist")->Exec();   // execute the macro

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

    // print content of HHistMap
    hM.print();
    //hM.printMap();
    //hM.printCanvasMap();
    //hM.printCutMap();
    //hM.printParameterMap();
    //hM.printMacroMap();


    //------------------------------------------------------------
    // input + output
    hM.writeHists();                       // write hists + canvas + cuts + fits + params + HHistMap  to root file
    //------------------------------------------------------------


    //------------------------------------------------------------
    // merging of root files
    HHistMap::addHistMap("histmap_file_*.root","merge.root"); // merge all HHistMap objects in matching files into merge.root
    HHistMap::addHistMap("histmap_file_1.root,histmap_file_2.root,histmap_file_3.root","merge.root"); // merge all HHistMap objects in files 1,2,3 into merge.root
    HHistMap::addHistMap("histmap_file_list.txt,histmap_file_2.root,histmap_file_3.root","merge.root"); // merge all HHistMap objects in files of filelist into merge.root
    //------------------------------------------------------------



Function Members (Methods)

public:
HHistMap(TString outputname = "")
HHistMap(const HHistMap&)
virtual~HHistMap()
voidTObject::AbstractMethod(const char* method) const
Bool_taddArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
static Bool_taddArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
Bool_taddArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
static Bool_taddArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
Bool_taddCanvas(TCanvas* h, Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "")
Bool_taddCanvas(TString name = "", TString title = "", Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "")
Bool_taddCanvasArray(TCanvas** c, TString name, TString mask = "", TString title = "", Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1)
Bool_taddCanvasArray(TString name = "", TString mask = "", TString title = "", Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1, TString n1 = "", TString n2 = "", TString n3 = "", TString n4 = "", TString n5 = "")
Bool_taddCut(TCutG* cut, TString dir = "")
Bool_taddCut(TString name, Int_t n = 0, Double_t* x = 0, Double_t* y = 0, TString dir = "")
Bool_taddFile(TString infile)
Bool_taddFiles(TString expression)
Bool_taddFilesList(TString filelist)
Bool_taddFit(TF1* cut, TString dir = "")
Bool_taddHist(TH1* h, TString dir = "")
Bool_taddHist(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t x1 = 0, Double_t x2 = 0, Int_t nbiny = 0, Double_t y1 = 0, Double_t y2 = 0, Int_t nbinz = 0, Double_t z1 = 0, Double_t z2 = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "")
Bool_taddHistArray(TH1** h, TString name, TString mask = "", TString title = "", TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1)
Bool_taddHistArray(TString Type = "", TString name = "", TString mask = "", TString title = "", Int_t nbinx = 0, Double_t x1 = 0., Double_t x2 = 0., Int_t nbiny = 0, Double_t y1 = 0., Double_t y2 = 0., Int_t nbinz = 0, Double_t z1 = 0., Double_t z2 = 0., TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1, TString n1 = "", TString n2 = "", TString n3 = "", TString n4 = "", TString n5 = "")
Bool_taddHistArrayN(TString Type = "", TString name = "", TString mask = "", TString title = "", Int_t nbinx = 0, Double_t* x = 0, Int_t nbiny = 0, Double_t* y = 0, Int_t nbinz = 0, Double_t* z = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1, TString n1 = "", TString n2 = "", TString n3 = "", TString n4 = "", TString n5 = "")
voidaddHistContent(HHistMap& hM2)
static Bool_taddHistMap(TString input = "", TString output = "")
Bool_taddHistN(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t* x = 0, Int_t nbiny = 0, Double_t* y = 0, Int_t nbinz = 0, Double_t* z = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "")
Bool_taddMacro(TMacro* par, TString name, TString dir = "")
Bool_taddMultFiles(TString commaSeparatedList)
Bool_taddPar(TObject* par, TString name, TString dir = "")
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
Bool_tcloneArray(TString source, TString name = "", TString mask = "", TString title = "", TString dir = "", Bool_t reset = kFALSE)
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
TH1*createHist(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t x1 = 0., Double_t x2 = 0., Int_t nbiny = 0, Double_t y1 = 0., Double_t y2 = 0., Int_t nbinz = 0, Double_t z1 = 0., Double_t z2 = 0., TString xtitle = "", TString ytitle = "", TString ztitle = "")
TH1*createHistN(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t* x = 0, Int_t nbiny = 0, Double_t* y = 0, Int_t nbinz = 0, Double_t* z = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "")
virtual voidTObject::Delete(Option_t* option = "")MENU
voiddisconnectAllHists()
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
Bool_tdivideArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
static Bool_tdivideArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
Bool_tdivideArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
static Bool_tdivideArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Bool_tfunctionArray(TString name, Bool_t (*)(TH1*,TString name,HHistMap* map, TObjArray* params) function, TObjArray* params)
static Bool_tfunctionArray(TObjArray* array, Bool_t (*)(TH1*,TObjArray* array,TObjArray* params) function, TObjArray* params)
TH1*get(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
TH2*get2(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
TProfile2D*get2P(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
TH3*get3(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
TProfile3D*get3P(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
TCanvas*getCanvas(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
TObjArray*getCanvasArray(TString name)
TArrayI*getCanvasDimArray(TString name)
TStringgetCanvasDir(TString name)
TStringgetCanvasMask(TString name)
TArrayI*getCanvasPropertiesArray(TString name)
TStringgetCanvasTitle(TString name)
TCutG*getCut(TString name)
TStringgetCutDir(TString name)
Bool_tgetDeleteObjects()
TArrayI*getDimAddress(TString name, TH1* h)
TArrayI*getDimAddress(TString name, TString histname)
TArrayI*getDimArray(TString name)
TStringgetDir(TString name)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
TFile*getFile()
TF1*getFit(TString name)
TStringgetFitDir(TString name)
TObjArray*getHistArray(TString name)
virtual const char*TObject::GetIconName() const
Int_tgetIndex(TString name, TH1* h)
Int_tgetIndex(TString name, TString histname)
TMacro*getMacro(TString name)
TStringgetMacroDir(TString name)
const map<TString,TObjArray>*getMap()
TStringgetMask(TString name)
vector<TCanvas*>getMatchingCanvas(TString expression, Int_t dim = -1)
vector<TString>getMatchingCanvasLabels(TString expression, Int_t dim = -1)
vector<TString>getMatchingCutLabels(TString expression)
vector<TCutG*>getMatchingCuts(TString expression)
vector<TString>getMatchingFitLabels(TString expression)
vector<TF1*>getMatchingFits(TString expression)
vector<TString>getMatchingHistLabels(TString expression, TString type = "", Int_t dim = -1)
vector<TH1*>getMatchingHists(TString expression, TString type = "", Int_t dim = -1)
vector<TString>getMatchingMacroLabels(TString expression)
vector<TMacro*>getMatchingMacros(TString expression)
vector<TString>getMatchingParLabels(TString expression)
vector<TObject*>getMatchingPars(TString expression)
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TProfile*getP(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
TObject*getPar(TString name)
TStringgetParDir(TString name)
virtual const char*TNamed::GetTitle() const
TStringgetTitle(TString name)
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tisInsideCut(TString name, Double_t x, Double_t y)
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
Bool_tmultiplyArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
static Bool_tmultiplyArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
Bool_tmultiplyArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
static Bool_tmultiplyArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
HHistMap&operator=(const HHistMap&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
voidprint()
virtual voidTNamed::Print(Option_t* option = "") const
voidprintCanvasMap()
voidprintCutMap()
voidprintFitMap()
voidprintMacroMap()
voidprintMap()
voidprintParameterMap()
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
Bool_tremoveCanvas(TString name)
Bool_tremoveCut(TString name, Bool_t removeObject = kTRUE)
Bool_tremoveFit(TString name, Bool_t removeObject = kTRUE)
Bool_tremoveHist(TString name)
Bool_tremoveMacro(TString name, Bool_t removeObject = kTRUE)
Bool_tremovePar(TString name, Bool_t removeObject = kTRUE)
voidresetAllHists(TString opt = "ICES")
Bool_tresetArray(TString name, TString opt = "")
static Bool_tresetArray(TObjArray* array, TString opt = "")
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
Bool_tscaleArray(TString name, Double_t fact)
static Bool_tscaleArray(TObjArray* array, Double_t fact)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidsetCurrentMap()
voidsetDeleteObjects(Bool_t del)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
Bool_tsetOutputFile(TString name = "")
voidsetSilentFail(Bool_t doit)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
Bool_tsumW2Array(TString name)
static Bool_tsumW2Array(TObjArray* array)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
Bool_twriteHists(TString opt = "")
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
TStringgetLabels(const TString name, vector<TString>& labels)

Data Members

protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
Bool_tfDeleteObjects! delete hists+canvas etc in destructor
Bool_tfSilentFail! switch off error+warnings in get() etc (own risk, default is kFALSE)
map<TString,TArrayI>hDArray for dimensions
map<TString,TArrayI>hDCArray for dimensions canvas
map<TString,TH1**>hDim1! dynamically created Array of hist pointers dimension = 1
map<TString,TCanvas**>hDim1C! dynamically created Array of canvas pointers dimension = 1
map<TString,TH1***>hDim2! dynamically created Array of hist pointers dimension = 2
map<TString,TCanvas***>hDim2C! dynamically created Array of canvas pointers dimension = 2
map<TString,TH1****>hDim3! dynamically created Array of hist pointers dimension = 3
map<TString,TCanvas****>hDim3C! dynamically created Array of canvas pointers dimension = 3
map<TString,TH1*****>hDim4! dynamically created Array of hist pointers dimension = 4
map<TString,TCanvas*****>hDim4C! dynamically created Array of canvas pointers dimension = 4
map<TString,TH1******>hDim5! dynamically created Array of hist pointers dimension = 5
map<TString,TCanvas******>hDim5C! dynamically created Array of canvas pointers dimension = 5
map<TString,TString>hDirdirectories per histogram
map<TString,TString>hDirCdirectories per canvas
map<TString,TString>hDirCutdirectories per TCutG
map<TString,TString>hDirFitdirectories per TF1
map<TString,TString>hDirMacromap of macro objects
map<TString,TString>hDirParmap of parameter objects (not streamed to root file)
map<TString,TObjArray>hMTObjArray for histogram pointers
map<TString,TObjArray>hMCTObjArray for canvas pointers
map<TString,TCutG*>hMCutTCutG pointers
map<TString,TF1*>hMFitTF1 pointers
map<TString,TMacro*>hMMacromap of macro objects
map<TString,TObject*>hMParmap of parameter objects (not streamed to root file)
map<TString,TString>hMaskmask string for names
map<TString,TString>hMaskCmask string for names canvas
map<TString,TArrayI>hNpCcanvas properties : number of pads x,y xpix,ypix canvas
map<TString,TString>hTitlemask string for titles
map<TString,TString>hTitleCmask string for titles canvas
TFile*output! store hists later

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HHistMap(TString outputname = "")
~HHistMap()
 hists
TString getLabels(const TString name, vector<TString>& labels)
Bool_t setOutputFile(TString name = "")
 set the output file for the histograms
 already existing file will be overwritten
void print()
void printMap()
 print he list of available histograms
void printCanvasMap()
 print the list of available canvas
void printCutMap()
 print the list of available cuts
void printFitMap()
 print the list of available fits
void printParameterMap()
 print the list of available parameters
void printMacroMap()
 print the list of available macros
void addHistContent(HHistMap& hM2)
 add content of all hists of hM2 to this (TH1::Add)
Bool_t addFile(TString infile)
 add HHIstMap from a single root file.
Bool_t addFiles(TString expression)
Bool_t addFilesList(TString filelist)
 add all files in list filelist. The list should contain
 1 root file per line (including path). Return kFALSE if
 list files does not exist or and error occured while
 reading the file
Bool_t addMultFiles(TString commaSeparatedList)
 add multiple files as comma separated file list : "file1,file2,file3"
Bool_t addHistMap(TString input = "", TString output = "")
 static function to add histogram contents of same type
 HHistMap stored in different root files. The HHistMap
 object of the first input file is copied, reset all hists
 and then the histogramm content of all files is added.

  input : a.  comma separated filelist  ("file1,root,file2.root")
          b.  reg expression matching root files (file_*.root" , has to end .root)
          c.  list file with 1 file per line
  output: root file name to store the merge HHistMap to
Bool_t addHist(TH1* h, TString dir = "")
 add a single histogram
Bool_t removeHist(TString name)
 remove a histogram/histogram array
TH1* createHist(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t x1 = 0., Double_t x2 = 0., Int_t nbiny = 0, Double_t y1 = 0., Double_t y2 = 0., Int_t nbinz = 0, Double_t z1 = 0., Double_t z2 = 0., TString xtitle = "", TString ytitle = "", TString ztitle = "")
 create an histograms (const binning).
 Type : TH1S,TH1I,TH1F,TH1D,TH2S,TH2I,TH2F,TH2D,TH3S,TH3I,TH3F,TH3D,TProfile,TProfile2D,TProfile3D
 name : hist name
 title : hist title
 hist axis : 1d  Int_t nbinx,Double_t x1,Double_t x2,
    	   2d  Int_t nbiny,Double_t y1,Double_t y2,
    	   3d  Int_t nbinz,Double_t z1,Double_t z2,
 axis title  xtitle,ytitle,ztitle
 dir : output dir
TH1* createHistN(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t* x = 0, Int_t nbiny = 0, Double_t* y = 0, Int_t nbinz = 0, Double_t* z = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "")
 create an histograms (non const binning).
 Type : TH1S,TH1I,TH1F,TH1D,TH2S,TH2I,TH2F,TH2D,TH3S,TH3I,TH3F,TH3D,TProfile,TProfile2D,TProfile3D
 name : hist name
 title : hist title
 hist axis : 1d  Int_t nbinx, pointer to Double_t array x for bins,
    	   2d  Int_t nbiny, pointer to Double_t array y for bins,
    	   3d  Int_t nbinz, pointer to Double_t array z for bins,
 axis title  xtitle,ytitle,ztitle
 dir : output dir
Bool_t addHist(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t x1 = 0, Double_t x2 = 0, Int_t nbiny = 0, Double_t y1 = 0, Double_t y2 = 0, Int_t nbinz = 0, Double_t z1 = 0, Double_t z2 = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "")
 add an histograms (const binning).
 Type : TH1S,TH1I,TH1F,TH1D,TH2S,TH2I,TH2F,TH2D,TH3S,TH3I,TH3F,TH3D,TProfile,TProfile2D,TProfile3D
 name : hist name
 title : hist title
 hist axis : 1d  Int_t nbinx,Double_t x1,Double_t x2,
    	   2d  Int_t nbiny,Double_t y1,Double_t y2,
    	   3d  Int_t nbinz,Double_t z1,Double_t z2,
 axis title  xtitle,ytitle,ztitle
 dir : output dir
Bool_t addHistN(TString Type = "", TString name = "", TString title = "", Int_t nbinx = 0, Double_t* x = 0, Int_t nbiny = 0, Double_t* y = 0, Int_t nbinz = 0, Double_t* z = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "")
 add an histograms (non const binning).
 Type : TH1S,TH1I,TH1F,TH1D,TH2S,TH2I,TH2F,TH2D,TH3S,TH3I,TH3F,TH3D,TProfile,TProfile2D,TProfile3D
 name : hist name
 title : hist title
 hist axis : 1d  Int_t nbinx, pointer to Double_t array x for bins,
    	   2d  Int_t nbiny, pointer to Double_t array y for bins,
    	   3d  Int_t nbinz, pointer to Double_t array z for bins,
 axis title  xtitle,ytitle,ztitle
 dir : output dir
Bool_t addHistArray(TH1** h, TString name, TString mask = "", TString title = "", TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1)
 add and array of histograms. the size of the array and
 a lable "name" to access the array later has to be specified
 mask  : printf format string for hist names (needed for config file)
 title : printf format string for hist titles (needed for config file)
 dir   : dir in otput file
 Only 1-dim arrays are supported. For more dimensional histogram
 arrays (up to 5 indices) one should use linearized versions
 using index made by HTool::getLinearIndex(....)
 i1max to i5max give the size in the dimension
 the histograms can later be retrieved by get("name",i1,i2....)
Bool_t addHistArray(TString Type = "", TString name = "", TString mask = "", TString title = "", Int_t nbinx = 0, Double_t x1 = 0., Double_t x2 = 0., Int_t nbiny = 0, Double_t y1 = 0., Double_t y2 = 0., Int_t nbinz = 0, Double_t z1 = 0., Double_t z2 = 0., TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1, TString n1 = "", TString n2 = "", TString n3 = "", TString n4 = "", TString n5 = "")
Bool_t addHistArrayN(TString Type = "", TString name = "", TString mask = "", TString title = "", Int_t nbinx = 0, Double_t* x = 0, Int_t nbiny = 0, Double_t* y = 0, Int_t nbinz = 0, Double_t* z = 0, TString xtitle = "", TString ytitle = "", TString ztitle = "", TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1, TString n1 = "", TString n2 = "", TString n3 = "", TString n4 = "", TString n5 = "")
TH1* get(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
 get histogram from map. print error and map
 if not existing. the map has to be set before
 If the requested object is an array of histograms
 the index has to specified.
TProfile* getP(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
 get Tprofile from map. print error and map
 if not existing. the map has to be set before
 If the requested object is an array of histograms
 the index has to specified.
TH2* get2(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
 get TH2 histogram from map (do not call it on other hist types!).
 print error and map if not existing. the map has to be set before
 If the requested object is an array of histograms
 the index has to specified.
TProfile2D* get2P(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
 get TProfile2D from map (do not call it on other hist types!).
 print error and map if not existing. the map has to be set before
 If the requested object is an array of histograms
 the index has to specified.
TH3* get3(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
 get TH3 histogram from map (do not call it on other hist types!).
 print error and map if not existing. the map has to be set before
 If the requested object is an array of histograms
 the index has to specified.
TProfile3D* get3P(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
 get TProfile3D histogram from map (do not call it on other hist types!).
 print error and map if not existing. the map has to be set before
 If the requested object is an array of histograms
 the index has to specified.
vector < TString> getMatchingHistLabels(TString expression, TString type = "", Int_t dim = -1)
 return stl vector of label name matching the expression.
 if type !="" the hist type is evaluated too.
 if dim  !=-1 the dimension of the array is evalated in addition.
vector < TH1*> getMatchingHists(TString expression, TString type = "", Int_t dim = -1)
 return stl vector of TH1*  matching the expression (by histname).
 if type !="" the hist type is evaluated too.
 if dim  !=-1 the dimension of the array is evalated in addition.
void resetAllHists(TString opt = "ICES")
 reset available histograms
void disconnectAllHists()
 set Directory of available histograms  0
Bool_t cloneArray(TString source, TString name = "", TString mask = "", TString title = "", TString dir = "", Bool_t reset = kFALSE)
 clones the source array to new array "name" with histograms following
 the naming mask "mask" , title and dir (see addHistArray())
 the procedure used THXX::Copy() . All features of the source hist
 and the content will be copied (Not the list of functions!).
 if reset is kTRUE the new hists will be reset.
Bool_t resetArray(TString name, TString opt = "")
 reset array of histograms
Bool_t resetArray(TObjArray* array, TString opt = "")
 reset array of histograms
Bool_t scaleArray(TString name, Double_t fact)
 scale array of histograms by factor fact
Bool_t scaleArray(TObjArray* array, Double_t fact)
 scale array of histograms by factor fact
Bool_t sumW2Array(TString name)
 call sumW2 for an array of histograms
Bool_t sumW2Array(TObjArray* array)
 call sumW2 for an array of histograms
Bool_t divideArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 divide two arrays of histograms (synthax see
 TH1::Divide(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt))
 hist1 will be modified
Bool_t divideArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 divide two arrays of histograms (syntax see
 TH1::Divide(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt))
 and store the result in a new histogram
 hist0 will be modified
Bool_t divideArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 divide two arrays of histograms (syntax see
 TH1::Divide(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt))
Bool_t divideArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 divide two arrays of histograms (syntax see
 TH1::Divide(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt))
 and store the result in a new hist (hist0)
Bool_t multiplyArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 multiply two arrays of histograms (synthax see
 TH1::Multiply(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt))
Bool_t multiplyArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 multiply two arrays of histograms (synthax see
 TH1::Multiply(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt))
 and store reult in a new histogram (hist0)
Bool_t multiplyArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 divide two arrays of histograms (synthax see
 TH1::Multiply(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt))
Bool_t multiplyArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 divide two arrays of histograms (synthax see
 TH1::Multiply(TH1*,TH1* ,Double _t fact1,Double _t fact2,TString opt))
 and stiore result in a new histogram (hist0)
Bool_t addArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 add two arrays of histograms (syntax see
 TH1::Add(TH1*,TH1* ,Double _t fact1,Double _t fact2,TString opt))
Bool_t addArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 add two arrays of histograms (syntax see
 TH1::Add(TH1*,TH1* ,Double _t fact1,Double _t fact2,TString opt))
 and store the result in a new histogram (hist0)
Bool_t addArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 add two arrays of histograms (syntax see
 TH1::Add(TH1*,TH1* ,Double _t fact1,Double _t fact2,TString opt))
Bool_t addArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "")
 add two arrays of histograms (syntax see
 TH1::Add(TH1*,TH1* ,Double _t fact1,Double _t fact2,TString opt))
 and store the reult in a new histogram (hist0)
Bool_t functionArray(TString name, Bool_t (*)(TH1*,TString name,HHistMap* map, TObjArray* params) function, TObjArray* params)
 execute function for each histogram of the array. TObjArray* params can be used
 to pass parameters to the funcion
Bool_t functionArray(TObjArray* array, Bool_t (*)(TH1*,TObjArray* array,TObjArray* params) function, TObjArray* params)
 execute function for each histogram of the array. TObjArray* params can be used
 to pass parameters to the funcion
TObjArray* getHistArray(TString name)
 get histogram array from map. print error and map
 if not existing. the map has to be set before
TArrayI* getDimArray(TString name)
 get histogram dim array from map. print error and map
 if not existing. the map has to be set before
TString getDir(TString name)
 get histogram dir from map. print error and map
 if not existing. the map has to be set before
TString getMask(TString name)
 get histogram mask from map. print error and map
 if not existing. the map has to be set before
TString getTitle(TString name)
 get histogram title from map. print error and map
 if not existing. the map has to be set before
TArrayI* getDimAddress(TString name, TH1* h)
 return multi dim coordinates for histogram
 user has to delete the TArrayI
TArrayI* getDimAddress(TString name, TString histname)
 return multi dim coordinates for histogram
 user has to delete the TArrayI
Int_t getIndex(TString name, TH1* h)
 return index in linear array for histogram
 -1 if not found
Int_t getIndex(TString name, TString histname)
 return index in linear array for histogram
 -1 if not found
Bool_t addCanvas(TCanvas* h, Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "")
 add a single canvas
 nx,ny pads in x and y
Bool_t addCanvas(TString name = "", TString title = "", Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "")
 add an canvas.
 name : canvas name
 title : canvas title
 xpix,ypix :x and y size of canvas in pixels (default 500)
 dir : output dir
Bool_t removeCanvas(TString name)
 remove a canvas/canvas array
Bool_t addCanvasArray(TCanvas** c, TString name, TString mask = "", TString title = "", Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1)
 add an array of canvas. the size of the array and
 a lable "name" to access the array later has to be specified
 mask  : printf format string for canvas names (needed for config file)
 title : printf format string for canvas titles (needed for config file)
 dir   : dir in otput file
 Only 1-dim arrays are supported. For more dimensional histogram
 arrays (up to 5 indices) one should use linearized versions
 using index made by HTool::getLinearIndex(....)
 i1max to i5max give the size in the dimension
 the histograms can later be retrieved by get("name",i1,i2....)
Bool_t addCanvasArray(TString name = "", TString mask = "", TString title = "", Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "", Int_t i1max = -1, Int_t i2max = -1, Int_t i3max = -1, Int_t i4max = -1, Int_t i5max = -1, TString n1 = "", TString n2 = "", TString n3 = "", TString n4 = "", TString n5 = "")
 add an array of canvas. the size of the array and
 a lable "name" to access the array later has to be specified
 name : lable for the canvas array
 mask : canvas name format like printf for the give numbers of dimensions : "ctest[%i][%i]" (2dim array)
 title : canvas title format like printf for the give numbers of dimensions : "ctest[%i][%i]" (2dim array)
         or same title for all canvas (if %i is not contained in format)
 xpix,ypix : canvas size in pixels (default 500)
 dir : output dir
 i1max to i5max give the size in the dimension
 the canvases can later be retrieved by getCanvas("name",i1,i2....)
 -1 (default) mean not used
 TString n1,n2,n3,n4,n5 (default empty) can contain a comma separated
 list of labels for each dimension (example: i1max=4 ,"MDCI,MDCII,MDCIII,MDCIV" )
 imax and number of labels have to be be equal. The lable
 will replace the dimension index (example:  ctime1_%i => ctime1_0 to ctime1_3 will
 become ctime1_MDCI to ctime1_MDCIV) in the name and title
TCanvas* getCanvas(TString name, Int_t i1 = 0, Int_t i2 = -1, Int_t i3 = -1, Int_t i4 = -1, Int_t i5 = -1)
 get canvas from map. print error and map
 if not existing. the map has to be set before
 If the requested object is an array of canvas
 the index has to specified.
TObjArray* getCanvasArray(TString name)
 get canvas array from map. print error and map
 if not existing. the map has to be set before
TArrayI* getCanvasDimArray(TString name)
 get canvas dim array from map. print error and map
 if not existing. the map has to be set before
TString getCanvasDir(TString name)
 get canvas dir from map. print error and map
 if not existing. the map has to be set before
TString getCanvasTitle(TString name)
 get canvas title from map. print error and map
 if not existing. the map has to be set before
TString getCanvasMask(TString name)
 get canvas mask from map. print error and map
 if not existing. the map has to be set before
TArrayI* getCanvasPropertiesArray(TString name)
 get canvas properties array from map. print error and map
 if not existing. the map has to be set before
vector < TString> getMatchingCanvasLabels(TString expression, Int_t dim = -1)
 return stl vector of label name matching the expression.
 if dim  !=-1 the dimension of the array is evalated in addition.
vector < TCanvas*> getMatchingCanvas(TString expression, Int_t dim = -1)
 return stl vector of TCanvas*  matching the expression (by canvas name).
 if dim  !=-1 the dimension of the array is evalated in addition.
Bool_t addCut(TCutG* cut, TString dir = "")
Bool_t addCut(TString name, Int_t n = 0, Double_t* x = 0, Double_t* y = 0, TString dir = "")
 add a TCutG
Bool_t removeCut(TString name, Bool_t removeObject = kTRUE)
 remove a cut
TCutG* getCut(TString name)
 get TCutG by name
TString getCutDir(TString name)
 get TCutG by name
Bool_t isInsideCut(TString name, Double_t x, Double_t y)
 returns kTRUE if point is inside the cut
vector < TString> getMatchingCutLabels(TString expression)
 return stl vector of label name matching the expression.
vector < TCutG*> getMatchingCuts(TString expression)
 return stl vector of TCutG*  matching the expression.
Bool_t addFit(TF1* cut, TString dir = "")
Bool_t removeFit(TString name, Bool_t removeObject = kTRUE)
 remove a fit
TF1* getFit(TString name)
 get TF1 by name
TString getFitDir(TString name)
 get Fit dir by name
vector < TString> getMatchingFitLabels(TString expression)
 return stl vector of label name matching the expression.
vector < TF1*> getMatchingFits(TString expression)
 return stl vector of TF1*  matching the expression.
Bool_t addPar(TObject* par, TString name, TString dir = "")
Bool_t removePar(TString name, Bool_t removeObject = kTRUE)
 remove a parameter
TObject* getPar(TString name)
 get Parameter by name
TString getParDir(TString name)
 get TCutG by name
vector < TString> getMatchingParLabels(TString expression)
 return stl vector of label name matching the expression.
vector < TObject*> getMatchingPars(TString expression)
 return stl vector of TObject*  matching the expression.
Bool_t addMacro(TMacro* par, TString name, TString dir = "")
Bool_t removeMacro(TString name, Bool_t removeObject = kTRUE)
 remove a cut
TMacro* getMacro(TString name)
 get TMacro by name
TString getMacroDir(TString name)
 get TMacro dir by name
vector < TString> getMatchingMacroLabels(TString expression)
 return stl vector of label name matching the expression.
vector < TMacro*> getMatchingMacros(TString expression)
 return stl vector of TMacros*  matching the expression.
Bool_t writeHists(TString opt = "")
 write he histograms and canvas to the output file
 the histograms will be stored in subdirs as
 specified in addHist(....) or in the main
 directory if no dir is specified
 opt = "nohists" will write only the HHistMap object
 opt = "nomap"   will write only the hists into subbdirs
 opt = ""  default will write both
HHistMap(TString outputname = "")
void setDeleteObjects(Bool_t del)
{ fDeleteObjects = del;}
Bool_t getDeleteObjects()
{ return fDeleteObjects;}
void setCurrentMap()
{ gHHistMap=this;}
void setSilentFail(Bool_t doit)
{fSilentFail = doit;}
const map < TString , TObjArray >* getMap()
{ return &hM; }
TFile* getFile()
{ return output;}