#include "htool.h"

HTool


class description - source file - inheritance tree (.pdf)

class HTool : public TNamed

Inheritance Chart:
TObject
<-
TNamed
<-
HTool

    protected:
void initVariables() public:
HTool(const char* name, const char* title) HTool(const HTool&) ~HTool() static TDirectory* changeToDir(TString) static Bool_t checkDir(TString, TFile*) static TClass* Class() static void cleanHist(TH1* h, Double_t threshold = 3, Double_t val = 0) static TF1* cleanHistArroundLine(TH2* h, TF1* f = 0, TString axis = y, Int_t firstbin = 1, Int_t lastbin = 0, Int_t cut = 0, TString opt = QNR, TString suffix, TString optline = pol1, Float_t windowfunc = 1000., Float_t windowfunc2 = 1000.) static TF1* cleanHistBelowLine(TH2* h, TF1* f = 0, TString axis = y, Int_t firstbin = 1, Int_t lastbin = 0, Int_t cut = 0, TString opt = QNR, TString suffix, TString optline = pol1, Float_t windowfunc = 1000.) static Bool_t cleanHistCutG(TH2* = 0, TCutG* = 0) static Bool_t close(TFile**) static Bool_t closeAscii(FILE**) static Bool_t compHistFiles(TString nameinp1, TString nameinp2, TString name) static TH1* copyHist(TH1* h, TString name, Int_t val = -99, Int_t valerr = -99) static TH1* copyHistRange(TH1* h, TString name, Int_t val = -99, Int_t valerr = -99, Int_t start = 0, Int_t end = -99) static void deleteObject(TObject* h) static Bool_t drawHistComp(TString nameinp1, TString nameinp2, TString name, TCanvas* comp = 0, Int_t padn = 1) static TH2* exchangeXY(TH2* h2 = 0, TString newname) static Bool_t exchangeXYGraph(TGraph* g = 0) static Int_t exec(TString command, TString& output) static Int_t findFilledRange(TH1* h, Int_t& first, Int_t& last) static Bool_t findString(TString* classes, Int_t size, TString name) static TObjArray* fitArray(TObjArray* array = 0, TF1* fit = 0, TString name, Float_t min = 0, Float_t max = 0, Int_t opt = 0, Float_t x1 = 0, Float_t x2 = 0, Int_t markerstyle = 8, Int_t markercolor = 2, Float_t markersize = 0.7) static Bool_t fitScatter(TH2* h = 0, TF1* f = 0, TH1* hnorm = 0, TString opt = QNR, Float_t xmin = 0, Float_t xmax = 0, Float_t ymin = 0, Float_t ymax = 0, Float_t window = 0, Bool_t clean = kFALSE) static Bool_t flipAxis(TH2* h2 = 0, TString opt = x) static TH1* getHist(TFile* inp, TString name) static TList* getListOfAllDataMembers(TClass* cl) static Double_t getMaxHistArray(TH1** h, Int_t size, Int_t& index) static Double_t getMinHistArray(TH1** h, Int_t size, Int_t& index) static TObjArray* glob(TString pattern) static TGraph* histToGraph(TH1* h = 0, TString newname, Bool_t exchange = kFALSE, Int_t markerstyle = 8, Int_t markercolor = 2, Float_t markersize = 0.7) static TGraphErrors* histToGraphErrors(TH1* h = 0, TString newname, Bool_t exchange = kFALSE, Int_t markerstyle = 8, Int_t markercolor = 2, Float_t markersize = 0.7) virtual TClass* IsA() const static Double_t kurtosis(Int_t n, Short_t* data) static Double_t kurtosis(Int_t n, Int_t* data) static Double_t kurtosis(Int_t n, Float_t* data) static Double_t kurtosis(Int_t n, Double_t* data) static Bool_t makeHists(TString infile, Int_t evs = 0, TString histdescriptionfile, TString listofClasses) static TDirectory* Mkdir(TDirectory*, const Char_t*, Int_t, Int_t p = 1) static Int_t normalize_max(TH2* h2 = 0, TString axis = y) static Bool_t open(TFile**, TString, TString) static Bool_t openAscii(FILE**, TString, TString) HTool& operator=(const HTool&) static TString* parseString(TString options, Int_t& size, TString separator, Bool_t tolower = kTRUE) static Bool_t printCompHistInfo(TH1* h1 = 0, TH1* h2 = 0, Int_t detail = 0) static Bool_t printHistInfo(TH1* h1 = 0) static TObjArray* projections(TH2* h2, TString axis = y, Int_t firstbin = 0, Int_t lastbin = -1, Int_t nsteps = -99, TString opt = e, TString suffix, Int_t markerstyle = 8, Int_t markercolor = 2, Float_t markersize = 0.7) static TH1D* projectY(TH1* h = 0, Int_t xbin1 = 1, Int_t xbin2 = 0, TString suff, Int_t ybin = 0, Float_t ymin = -99, Float_t ymax = -99, Int_t markerstyle = 8, Int_t markercolor = 2, Float_t markersize = 0.7) static Bool_t readHistsDescription(TString file, TObjArray* myhists, TString* classes = 0, Int_t sizeclass = 0) static TH2* reBin(TH2* h2 = 0, Int_t groupX = 2, Int_t gropY = 2, TString newname) static Int_t removeEnds(TH1* h, Int_t first = 1, Int_t last = -1) static void resetHist(TH1* h, Float_t val = -99, Float_t valerr = -99) static Double_t roundDigits(Double_t d, Int_t ndigits = -1) static Float_t roundDigits(Float_t f, Int_t ndigits = -1) static void roundHist(TH2* h = 0, Int_t ndigit = -1, Int_t ndigiterr = -1) static Bool_t scaleGraph(TGraph* g = 0, Double_t xscale = 1., Double_t yscale = 1.) static void scanOracle(TString, TString) static void setHistErrors(TH1* h, TH1* h2) static Bool_t shiftGraph(TGraph* g = 0, Double_t xshift = 0., Double_t yshift = 0.) static Bool_t shiftHist(TH1* h = 0, Float_t shift = 0) static Bool_t shiftHistByBin(TH1* h = 0, Int_t shiftbin = 0) virtual void ShowMembers(TMemberInspector& insp, char* parent) static Double_t skew(Int_t n, Short_t* data) static Double_t skew(Int_t n, Int_t* data) static Double_t skew(Int_t n, Float_t* data) static Double_t skew(Int_t n, Double_t* data) static TObjArray* slices(TH2* h = 0, TF1* f = 0, TString axis = y, Int_t firstbin = 1, Int_t lastbin = 0, Int_t cut = 0, TString opt = QNR, TString suffix, Int_t markerstyle = 8, Int_t markercolor = 2, Float_t markersize = 0.7) static void sort(Int_t n, Char_t* arr, Int_t* index = 0, Bool_t down = kTRUE, Bool_t overwrite = kTRUE) static void sort(Int_t n, Short_t* arr, Int_t* index = 0, Bool_t down = kTRUE, Bool_t overwrite = kTRUE) static void sort(Int_t n, Int_t* arr, Int_t* index = 0, Bool_t down = kTRUE, Bool_t overwrite = kTRUE) static void sort(Int_t n, Float_t* arr, Int_t* index = 0, Bool_t down = kTRUE, Bool_t overwrite = kTRUE) static void sort(Int_t n, Double_t* arr, Int_t* index = 0, Bool_t down = kTRUE, Bool_t overwrite = kTRUE) static void sortParallel(Int_t n, Int_t nArrays, Char_t* listarr, Int_t leading = 0, Int_t* index = 0, Bool_t down = kTRUE) static void sortParallel(Int_t n, Int_t nArrays, Short_t* listarr, Int_t leading = 0, Int_t* index = 0, Bool_t down = kTRUE) static void sortParallel(Int_t n, Int_t nArrays, Int_t* listarr, Int_t leading = 0, Int_t* index = 0, Bool_t down = kTRUE) static void sortParallel(Int_t n, Int_t nArrays, Float_t* listarr, Int_t leading = 0, Int_t* index = 0, Bool_t down = kTRUE) static void sortParallel(Int_t n, Int_t nArrays, Double_t* listarr, Int_t leading = 0, Int_t* index = 0, Bool_t down = kTRUE) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) static Double_t weightedMean(Int_t n, Short_t* data, Short_t* dataerr) static Double_t weightedMean(Int_t n, Int_t* data, Int_t* dataerr) static Double_t weightedMean(Int_t n, Float_t* data, Float_t* dataerr) static Double_t weightedMean(Int_t n, Double_t* data, Double_t* dataerr) static Double_t weightedMeanAndSigma(Int_t n, Short_t* data, Short_t* dataerr, Double_t* mean, Double_t* sigma) static Double_t weightedMeanAndSigma(Int_t n, Int_t* data, Int_t* dataerr, Double_t* mean, Double_t* sigma) static Double_t weightedMeanAndSigma(Int_t n, Float_t* data, Float_t* dataerr, Double_t* mean, Double_t* sigma) static Double_t weightedMeanAndSigma(Int_t n, Double_t* data, Double_t* dataerr, Double_t* mean, Double_t* sigma) static Double_t weightedSigma(Int_t n, Short_t* dataerr) static Double_t weightedSigma(Int_t n, Int_t* dataerr) static Double_t weightedSigma(Int_t n, Float_t* dataerr) static Double_t weightedSigma(Int_t n, Double_t* dataerr) static Bool_t writeHistInfo(TH1* h1 = 0, FILE* anaout = 0) static void writeObject(TObject* h)

Data Members




Class Description

 HTool
 Tool Class


HTool(const char* name,const char* title) : TNamed(name,title)
 constructor for HTool

~HTool()
 destructor of HTool

void initVariables()
 inits all variables

Bool_t open(TFile** file,TString fName,TString option)
 Opens root file "fName" to the pointer "file" with option
 New,Read,Recreate and Update. Checks if file exists or is
 already opened. If everything works fine kTRUE is returned.

Bool_t close(TFile** file)
 Close the root file of the pointer file if
 existing and open and sets the file pointer to 0.
 Returns kTRUE if OK.

Bool_t openAscii(FILE** file,TString fName,TString option)
 Opens ascii file "fName" to the pointer file with the option
 "r" and "w". Returns kTRUE if OK.

Bool_t closeAscii(FILE** file)
 Close ascii file of the pointer file if file!=0 and
 sets the file pointr to 0 afterwards. Returns kTRUE
 if OK.

TObjArray* glob(TString pattern)
 Expand 'pattern' as it would be done by the shell (see sh(1)):
 '*', '?', '~', '$ENVIRONMENT_VARIABLE' and '[', ']' are expanded. In case
 the expansion is successful, a TObjArray of TObjStrings with the
 names of all existing files is returned - otherwise NULL.

 The returned TObjArray must be deleted by the caller of the function!

 This example returns all existing .root files in /tmp as well as all .root
 files in your home directory starting with the characters 'a', 'b', 'c'
 and 'e':

 TObjArray* files = HTool::glob( "/tmp/*.root $HOME/[a-c,e]*.root" );
 if (files)
 {
    TObjString* name = NULL;
    TIterator*  file = files->MakeIterator();
    while ((name = (TObjString*)file->Next()))
    {
       Char_t* input = name->GetString.Data(); ...
    }
    delete files;
 }

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

TDirectory* changeToDir(TString p)
 Changes into the given path. If the Directory is not existing
 it will be created. The pointer to the new directory will be returned.

Bool_t checkDir(TString p,TFile* input)
 Checks if a given path "p" in file "input" exists.
 The actual directory will not be changed. Returns
 kTRUE if OK.

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

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

Double_t roundDigits(Double_t d, Int_t ndigit)
 Round d to ndigits

Float_t roundDigits(Float_t f, Int_t ndigit)
 Round d to ndigits

Int_t exec(TString command, TString& output)
 Execute 'command' in a shell and return the exit code of 'command'.
 'output' is filled with the data written to STDOUT and STDERR by
 'command'.

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

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

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

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

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

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

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

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

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

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

Double_t kurtosis(Int_t n, Short_t* data)
 calculates the kurtosis

   ---                     
                          
   /   ( x-mean)^4         
   ---                     
  ----------------  - 3    
       n*sigma^4           


 The kutosis will be > 0 for distributions
 compared wider than a normal distribution and
 and < 0 for distributions beeing peaking stronger

Double_t kurtosis(Int_t n, Int_t* data)
 calculates the kurtosis

   ---                     
                          
   /   ( x-mean)^4         
   ---                     
  ----------------  - 3    
       n*sigma^4           


 The kutosis will be > 0 for distributions
 compared wider than a normal distribution and
 and < 0 for distributions beeing peaking stronger

Double_t kurtosis(Int_t n, Float_t* data)
 calculates the kurtosis

   ---                     
                          
   /   ( x-mean)^4         
   ---                     
  ----------------  - 3    
       n*sigma^4           


 The kutosis will be > 0 for distributions
 compared wider than a normal distribution and
 and < 0 for distributions beeing peaking stronger

Double_t kurtosis(Int_t n, Double_t* data)
 calculates the kurtosis

   ---                     
                          
   /   ( x-mean)^4         
   ---                     
  ----------------  - 3    
       n*sigma^4           


 The kutosis will be > 0 for distributions
 compared wider than a normal distribution and
 and < 0 for distributions beeing peaking stronger

Double_t skew(Int_t n, Short_t* data)
 calculates the skew

   ---                     
                          
   /   ( x-mean)^3         
   ---                     
  ----------------         
       n*sigma^3           


 The skew will be > 0 for distributions
 haveing more entries in the tails larger than mean
 and < 0 for distributions haveing more entries small
 than mean

Double_t skew(Int_t n, Int_t* data)
 calculates the skew

   ---                     
                          
   /   ( x-mean)^3         
   ---                     
  ----------------         
       n*sigma^3           


 The skew will be > 0 for distributions
 haveing more entries in the tails larger than mean
 and < 0 for distributions haveing more entries small
 than mean

Double_t skew(Int_t n, Float_t* data)
 calculates the skew

   ---                     
                          
   /   ( x-mean)^3         
   ---                     
  ----------------         
       n*sigma^3           


 The skew will be > 0 for distributions
 haveing more entries in the tails larger than mean
 and < 0 for distributions haveing more entries small
 than mean

Double_t skew(Int_t n, Double_t* data)
 calculates the skew

   ---                     
                          
   /   ( x-mean)^3         
   ---                     
  ----------------         
       n*sigma^3           


 The skew will be > 0 for distributions
 haveing more entries in the tails larger than mean
 and < 0 for distributions haveing more entries small
 than mean

Double_t weightedMean(Int_t n, Short_t* data,Short_t* dataerr)
 calculates the weighted mean

   ---                     
                          
   /   x/sigma^2           
   ---                     
  ----------------         
   ---                     
                          
   /   1/sigma^2           
   ---                     

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

Double_t weightedMean(Int_t n, Int_t* data,Int_t* dataerr)
 calculates the weighted mean

   ---                     
                          
   /   x/sigma^2           
   ---                     
  ----------------         
   ---                     
                          
   /   1/sigma^2           
   ---                     

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

Double_t weightedMean(Int_t n, Float_t* data,Float_t* dataerr)
 calculates the weighted mean

   ---                     
                          
   /   x/sigma^2           
   ---                     
  ----------------         
   ---                     
                          
   /   1/sigma^2           
   ---                     

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

Double_t weightedMean(Int_t n, Double_t* data,Double_t* dataerr)
 calculates the weighted mean

   ---                     
                          
   /   x/sigma^2           
   ---                     
  ----------------         
   ---                     
                          
   /   1/sigma^2           
   ---                     

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

Double_t weightedSigma(Int_t n,Short_t* dataerr)
 calculates the weighted sigma

             1                  
sqrt  ----------------          
        ---                     
                               
        /   1/sigma^2           
        ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

Double_t weightedSigma(Int_t n,Int_t* dataerr)
 calculates the weighted sigma

             1                  
sqrt  ----------------          
        ---                     
                               
        /   1/sigma^2           
        ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

Double_t weightedSigma(Int_t n,Float_t* dataerr)
 calculates the weighted sigma

             1                  
sqrt  ----------------          
        ---                     
                               
        /   1/sigma^2           
        ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

Double_t weightedSigma(Int_t n,Double_t* dataerr)
 calculates the weighted sigma

             1                  
sqrt  ----------------          
        ---                     
                               
        /   1/sigma^2           
        ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

Double_t weightedMeanAndSigma(Int_t n, Short_t* data,Short_t* dataerr, Double_t* mean, Double_t* sigma)
 calculates the weighted mean and sigma

         ---                    
                               
         /   x/sigma^2          
         ---                    
 mean = ----------------        
         ---                    
                               
         /   1/sigma^2          
         ---                    

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

 and

                     1                  
sigma = sqrt  ----------------          
                ---                     
                                       
                /   1/sigma^2           
                ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

Double_t weightedMeanAndSigma(Int_t n, Int_t* data,Int_t* dataerr, Double_t* mean, Double_t* sigma)
 calculates the weighted mean and sigma

         ---                    
                               
         /   x/sigma^2          
         ---                    
 mean = ----------------        
         ---                    
                               
         /   1/sigma^2          
         ---                    

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

 and

                     1                  
sigma = sqrt  ----------------          
                ---                     
                                       
                /   1/sigma^2           
                ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

Double_t weightedMeanAndSigma(Int_t n, Float_t* data,Float_t* dataerr, Double_t* mean, Double_t* sigma)
 calculates the weighted mean and sigma

         ---                    
                               
         /   x/sigma^2          
         ---                    
 mean = ----------------        
         ---                    
                               
         /   1/sigma^2          
         ---                    

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

 and

                     1                  
sigma = sqrt  ----------------          
                ---                     
                                       
                /   1/sigma^2           
                ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

Double_t weightedMeanAndSigma(Int_t n, Double_t* data,Double_t* dataerr, Double_t* mean, Double_t* sigma)
 calculates the weighted mean and sigma

         ---                    
                               
         /   x/sigma^2          
         ---                    
 mean = ----------------        
         ---                    
                               
         /   1/sigma^2          
         ---                    

 where x are the data points from data[i] and
 sigma the standard deviations of the points from dataerr[i]

 and

                     1                  
sigma = sqrt  ----------------          
                ---                     
                                       
                /   1/sigma^2           
                ---                     

 where sigma is the standard deviations of the
 points from dataerr[i]

void roundHist(TH2* h,Int_t ndigit,Int_t ndigiterr)
 Round bin content to ndigit and binerror to ndigterr digits.
 for ndigit or ndigiterr =-1 the rounding will be skipped for
 the corresponding value.

TH1* getHist(TFile* inp,TString name)
 gets histogram with name name from root file

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

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

TObjArray* fitArray(TObjArray* array,TF1* fit,TString name,Float_t min,Float_t max,Int_t opt,Float_t x1,Float_t x2,Int_t markerstyle,Int_t markercolor,Float_t markersize)
 Applies fit fit to all hists in array. The result of the fit
 will be returned in a TObjArray which contains hists for all parameters
 from fit (with corresponding errors set). The number of hists is equal npar+1.
 The ordering inside the array starts from par0 to parN and the last hist
 will contain the chi2. The number of bins in the hists will be equal to the
 the number of fitted hists. The range of the result hists can be set via
 min and max. If these values ar not specified the range will be 0-1.
 If opt=1 fit will use range x1 x2 arround max of hists

TH1D* projectY(TH1* h,Int_t xbin1,Int_t xbin2,TString suff, Int_t ybin,Float_t ymin,Float_t ymax, Int_t markerstyle,Int_t markercolor,Float_t markersize)

Bool_t fitScatter(TH2* h,TF1* f,TH1* hnorm,TString opt,Float_t xmin,Float_t xmax,Float_t ymin,Float_t ymax,Float_t window,Bool_t clean)

TH1* removeEnds(const TH1* h,Int_t first,Int_t last,TString newname)
 removes bins from start to first and from last to end
 (first and last are kept). returns hist with name newname

Int_t removeEnds(TH1* h,Int_t first,Int_t last)
 removes bins from start to first and from last to end
 (first and last are kept). returns hist with name newname

Int_t findFilledRange(TH1* h,Int_t& first,Int_t& last)
 find first bins and last filled bins

void cleanHist(TH1* h,Double_t threshold,Double_t val)
 clean hist if bincontent is below a certain value (threshold):
 The bin content is replaced by val.

void resetHist(TH1* h,Float_t val,Float_t valerr)
 reset hist with val for content and valerr for errors
 (if this values not equal -99).

TH1* copyHist(TH1* h,TString name,Int_t val,Int_t valerr)
 copy old hist into new one. You can decide to copy content of hist (val!=-99) and
 errors (valerr!=-99). Combinations are possible.
 if no new name is specified, _copy is appended to old name.

TH1* copyHistRange(TH1* h,TString name,Int_t val,Int_t valerr,Int_t start,Int_t end)
 copy old hist into new one. You can decide to copy content of hist (val!=-99) and
 errors (valerr!=-99). Combinations are possible.
 if no new name is specified, _copy is appended to old name.
 Copy is done in range from start to end. If end = -99, Full histogram is copied.

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

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

Bool_t cleanHistCutG(TH2* h,TCutG* cut)
 puts all bins outside the cut to 0.

void setHistErrors(TH1* h,TH1* h2)
 sets bincontent of hist h2 as errors of h

Double_t getMaxHistArray(TH1** h,Int_t size,Int_t& index)
 Finds maximum of all hists in TH1* array of size size.
 return max and the index of the hist inside the array
 which has the highest max.

Double_t getMinHistArray(TH1** h,Int_t size,Int_t& index)
 Finds minimum of all hists in TH1* array of size size.
 return min and the index of the hist inside the array
 which has the lowest min.

TH2* reBin(TH2* h2,Int_t groupX,Int_t groupY,TString newname)
 Rebins h2 with groups of groupX and groupY. The new created
 hist with name newname (if specified) or oldname_rebin will
 be returned.

TH2* exchangeXY(TH2* h2,TString newname)
 creates new hist with name newname (if specified)
 or oldname_exchangeXY with exchanged
 x- and y-axis

Bool_t flipAxis(TH2* h2,TString opt)
 flips x or y axis or both depending on opt (x,y,xy)

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

TGraphErrors* histToGraphErrors(TH1* h,TString newname,Bool_t exchange,Int_t markerstyle,Int_t markercolor,Float_t markersize)
 Creates a TGraphErrors from hist h. The axis can be excganged if
 exchange=kTRUE; The Graph does not take empty bins into account.

Bool_t shiftHistByBin(TH1* h,Int_t shiftbin)
 shifts hist content by shiftbin bins

Bool_t shiftHist(TH1* h,Float_t shift)
 shifts hist content by value shift

Int_t normalize_max(TH2* ht,TString axis)
 Project to axis and and calc scaling factor for the bin
 to maximum of total hist max_total/max_proj. The bins of
 the hist are scaled by the factor. The result is 2D hist
 where each bin Projection has the same maximum height.
 The opration is performed on the original Hist!
 arguments:
 TH2* ht        :pointer to hist which should be normalized
 TString axis   :="x" , or "y" depending on the projection
 return values:
 -1 : In the case of zero pointer input or unknown axis argument
  0 : If opreation has been succesful
  3 : TH2 max is 0 (most probably empty).

Bool_t exchangeXYGraph(TGraph* g)
 exchanges x-values and y-values.

Bool_t scaleGraph(TGraph* g,Double_t xscale,Double_t yscale)
 scales x-values and y-values with  xscale,yscale.

Bool_t shiftGraph(TGraph* g,Double_t xshift,Double_t yshift)
 add shift to x-values and y-values

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

Bool_t findString(TString* classes,Int_t size,TString name)
 searches name in TString array classes with size size.
 return kTRUE if the string is found.

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

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

Bool_t drawHistComp(TString nameinp1,TString nameinp2,TString name,TCanvas* comp,Int_t padn)
 Gets histogram with name name from 2 input files and plots them into
 into a canvas. If the canvas pointer is 0 a canvas will be created.
 if padn=1 they will be overlayed in on pad, if pad=2 and comp=0, a
 new canvas with n pads will be created and the 2 hists will be plotted single
 if n=2 and comp not equal 0, the 2 pads of comp will used to draw.

Bool_t compHistFiles(TString nameinp1,TString nameinp2,TString name)
 Gets histogram with name name from 2 input files and compares them by
 mean,rms,range,maximum,maxposition, entries....

Bool_t printHistInfo(TH1* h1)
 prints information over hist to screen .

Bool_t printCompHistInfo(TH1* h1,TH1* h2,Int_t detail)
 prints information over hist to screen .

Bool_t writeHistInfo(TH1* h1,FILE* anaout)
 writes information over hist to ascii file .



Inline Functions


               void deleteObject(TObject* h)
               void writeObject(TObject* h)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)
              HTool HTool(const HTool&)
             HTool& operator=(const HTool&)


Last update: Mon Feb 5 16:53:49 2007


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.