_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 //------------------------------------------------------------
HHistMap(TString outputname = "") | |
HHistMap(const HHistMap&) | |
virtual | ~HHistMap() |
void | TObject::AbstractMethod(const char* method) const |
Bool_t | addArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
static Bool_t | addArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
Bool_t | addArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
static Bool_t | addArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
Bool_t | addCanvas(TCanvas* h, Int_t nx = 1, Int_t ny = 0, Int_t xpix = 500, Int_t ypix = 500, TString dir = "") |
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 = "") |
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) |
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 = "") |
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 = "") |
Bool_t | addFile(TString infile) |
Bool_t | addFiles(TString expression) |
Bool_t | addFilesList(TString filelist) |
Bool_t | addFit(TF1* cut, TString dir = "") |
Bool_t | addHist(TH1* h, TString 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 = "") |
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) |
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 = "") |
void | addHistContent(HHistMap& hM2) |
static Bool_t | addHistMap(TString input = "", TString output = "") |
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 = "") |
Bool_t | addMacro(TMacro* par, TString name, TString dir = "") |
Bool_t | addMultFiles(TString commaSeparatedList) |
Bool_t | addPar(TObject* par, TString name, TString dir = "") |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TNamed::Clear(Option_t* option = "") |
virtual TObject* | TNamed::Clone(const char* newname = "") const |
Bool_t | cloneArray(TString source, TString name = "", TString mask = "", TString title = "", TString dir = "", Bool_t reset = kFALSE) |
virtual Int_t | TNamed::Compare(const TObject* obj) const |
virtual void | TNamed::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 void | TObject::Delete(Option_t* option = "")MENU |
void | disconnectAllHists() |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
Bool_t | divideArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
static Bool_t | divideArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
Bool_t | divideArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
static Bool_t | divideArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual void | TNamed::FillBuffer(char*& buffer) |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
Bool_t | functionArray(TString name, Bool_t (*)(TH1*,TString name,HHistMap* map, TObjArray* params) function, TObjArray* params) |
static Bool_t | functionArray(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) |
TString | getCanvasDir(TString name) |
TString | getCanvasMask(TString name) |
TArrayI* | getCanvasPropertiesArray(TString name) |
TString | getCanvasTitle(TString name) |
TCutG* | getCut(TString name) |
TString | getCutDir(TString name) |
Bool_t | getDeleteObjects() |
TArrayI* | getDimAddress(TString name, TH1* h) |
TArrayI* | getDimAddress(TString name, TString histname) |
TArrayI* | getDimArray(TString name) |
TString | getDir(TString name) |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
TFile* | getFile() |
TF1* | getFit(TString name) |
TString | getFitDir(TString name) |
TObjArray* | getHistArray(TString name) |
virtual const char* | TObject::GetIconName() const |
Int_t | getIndex(TString name, TH1* h) |
Int_t | getIndex(TString name, TString histname) |
TMacro* | getMacro(TString name) |
TString | getMacroDir(TString name) |
const map<TString,TObjArray>* | getMap() |
TString | getMask(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_t | TObject::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) |
TString | getParDir(TString name) |
virtual const char* | TNamed::GetTitle() const |
TString | getTitle(TString name) |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TNamed::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | isInsideCut(TString name, Double_t x, Double_t y) |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TNamed::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TNamed::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
Bool_t | multiplyArray(TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
static Bool_t | multiplyArray(TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
Bool_t | multiplyArray(TString name0, TString name1, TString name2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
static Bool_t | multiplyArray(TObjArray* array0, TObjArray* array1, TObjArray* array2, Double_t fact1 = 1., Double_t fact2 = 1., TString opt = "") |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::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 void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
void | print() |
virtual void | TNamed::Print(Option_t* option = "") const |
void | printCanvasMap() |
void | printCutMap() |
void | printFitMap() |
void | printMacroMap() |
void | printMap() |
void | printParameterMap() |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
Bool_t | removeCanvas(TString name) |
Bool_t | removeCut(TString name, Bool_t removeObject = kTRUE) |
Bool_t | removeFit(TString name, Bool_t removeObject = kTRUE) |
Bool_t | removeHist(TString name) |
Bool_t | removeMacro(TString name, Bool_t removeObject = kTRUE) |
Bool_t | removePar(TString name, Bool_t removeObject = kTRUE) |
void | resetAllHists(TString opt = "ICES") |
Bool_t | resetArray(TString name, TString opt = "") |
static Bool_t | resetArray(TObjArray* array, TString opt = "") |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
Bool_t | scaleArray(TString name, Double_t fact) |
static Bool_t | scaleArray(TObjArray* array, Double_t fact) |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
void | setCurrentMap() |
void | setDeleteObjects(Bool_t del) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
virtual void | TNamed::SetName(const char* name)MENU |
virtual void | TNamed::SetNameTitle(const char* name, const char* title) |
static void | TObject::SetObjectStat(Bool_t stat) |
Bool_t | setOutputFile(TString name = "") |
void | setSilentFail(Bool_t doit) |
virtual void | TNamed::SetTitle(const char* title = "")MENU |
virtual void | TObject::SetUniqueID(UInt_t uid) |
virtual void | ShowMembers(TMemberInspector&) |
virtual Int_t | TNamed::Sizeof() const |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
Bool_t | sumW2Array(TString name) |
static Bool_t | sumW2Array(TObjArray* array) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
Bool_t | writeHists(TString opt = "") |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
TString | getLabels(const TString name, vector<TString>& labels) |
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
TString | TNamed::fName | object identifier |
TString | TNamed::fTitle | object title |
Bool_t | fDeleteObjects | ! delete hists+canvas etc in destructor |
Bool_t | fSilentFail | ! switch off error+warnings in get() etc (own risk, default is kFALSE) |
map<TString,TArrayI> | hD | Array for dimensions |
map<TString,TArrayI> | hDC | Array 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> | hDir | directories per histogram |
map<TString,TString> | hDirC | directories per canvas |
map<TString,TString> | hDirCut | directories per TCutG |
map<TString,TString> | hDirFit | directories per TF1 |
map<TString,TString> | hDirMacro | map of macro objects |
map<TString,TString> | hDirPar | map of parameter objects (not streamed to root file) |
map<TString,TObjArray> | hM | TObjArray for histogram pointers |
map<TString,TObjArray> | hMC | TObjArray for canvas pointers |
map<TString,TCutG*> | hMCut | TCutG pointers |
map<TString,TF1*> | hMFit | TF1 pointers |
map<TString,TMacro*> | hMMacro | map of macro objects |
map<TString,TObject*> | hMPar | map of parameter objects (not streamed to root file) |
map<TString,TString> | hMask | mask string for names |
map<TString,TString> | hMaskC | mask string for names canvas |
map<TString,TArrayI> | hNpC | canvas properties : number of pads x,y xpix,ypix canvas |
map<TString,TString> | hTitle | mask string for titles |
map<TString,TString> | hTitleC | mask string for titles canvas |
TFile* | output | ! store hists later |
set the output file for the histograms already existing file will be overwritten
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
add multiple files as comma separated file list : "file1,file2,file3"
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
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
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
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
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
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....)
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.
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.
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.
divide two arrays of histograms (synthax see TH1::Divide(TH1*,TH2* ,Double _t fact1,Double _t fact2,TString opt)) hist1 will be modified
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
divide two arrays of histograms (syntax see TH1::Divide(TH1*,TH2* ,Double _t fact1,Double _t fact2,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)
multiply two arrays of histograms (synthax see TH1::Multiply(TH1*,TH2* ,Double _t fact1,Double _t fact2,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)
divide two arrays of histograms (synthax see TH1::Multiply(TH1*,TH2* ,Double _t fact1,Double _t fact2,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)
add two arrays of histograms (syntax see TH1::Add(TH1*,TH1* ,Double _t fact1,Double _t fact2,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)
add two arrays of histograms (syntax see TH1::Add(TH1*,TH1* ,Double _t fact1,Double _t fact2,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)
execute function for each histogram of the array. TObjArray* params can be used to pass parameters to the funcion
execute function for each histogram of the array. TObjArray* params can be used to pass parameters to the funcion
return multi dim coordinates for histogram user has to delete the TArrayI
return multi dim coordinates for histogram user has to delete the TArrayI
return index in linear array for histogram -1 if not found
add a single canvas nx,ny pads in x and y
add an canvas. name : canvas name title : canvas title xpix,ypix :x and y size of canvas in pixels (default 500) dir : output dir
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....)
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
return stl vector of label name matching the expression. if dim !=-1 the dimension of the array is evalated in addition.
return stl vector of TCanvas* matching the expression (by canvas name). if dim !=-1 the dimension of the array is evalated in addition.
add a TCutG
return stl vector of label name matching the expression.
return stl vector of TCutG* matching the expression.
return stl vector of label name matching the expression.
return stl vector of TF1* matching the expression.
return stl vector of label name matching the expression.
return stl vector of TObject* matching the expression.
return stl vector of label name matching the expression.
return stl vector of TMacros* matching the expression.
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