RootUtils
Summary
Members Descriptions
namespaceFileUtils Utility namespace for ROOT files.
namespaceFitUtils Utility namespace for ROOT files.

namespaceHistUtils | namespaceStringUtils | namespaceUiUtils |

namespace <tt>FileUtils</tt>

Utility namespace for ROOT files.

Detailed description follows here. X. XYZ, DESY

March 2008

Summary

Members Descriptions
public TList *findFilesInDirectory(const char * dirPath,const char * extension) Obtain list of file paths in directory (with given extension).
public TFile *openFile(const char * filePathName) Open ROOT file with given absolute path.
public TTree *getTree(TFile * file,const char * treeName) Parse absolute file path into path, name and extension.

public TBranch *getBranch(TTree * tree,const char * branchName) | public Double_tgetBranchMinimum(TTree * tree,const char * branchName) | public Double_tgetBranchMaximum(TTree * tree,const char * branchName) | public Double_tgetBranchMaximumInFiles(TList * files,const char * treeName,const char * branchName) | public TH1 *getBranchHistogram(TTree * tree,const char * branchName,Int_t nBins) | Shortcut to get a histogram from ROOT tree branch. publicPathComponentsparseFilePath(const char * filePathName) | Parse absolute file path into path, name and extension. structFileUtils::PathComponents | Struct contains path components parsed by the parseFilePath()

Members

<tt>public TList *</tt><a href="#namespaceFileUtils_1a96a2b93d8699379f78c048e90b4968c9"><tt>findFilesInDirectory</tt></a><tt>(const char * dirPath,const char * extension)</tt>

Obtain list of file paths in directory (with given extension).

Function returns a TList* of TObjString* with full absolute paths of files in a given directory with given extension. Program exits if directory does not exist or not readable.

Parameters

  • dirPath Directory path.
  • extension Optional extension of files to find.

Returns

TList* of TObjString* with full absolute paths.

<tt>public TFile *</tt><a href="#namespaceFileUtils_1a34ac56b2e27b16a4f39c7562083f7967"><tt>openFile</tt></a><tt>(const char * filePathName)</tt>

Open ROOT file with given absolute path.

Function checks if a file is good and returns a pointer to a ROOT file TFile* with given absolute path.

Parameters

  • filePathName full ROOT file URI.

Returns

Pointer to TFile* object.

<tt>public TTree *</tt><a href="#namespaceFileUtils_1a8c4d09cff14a6e8961c18e72b014d4dc"><tt>getTree</tt></a><tt>(TFile * file,const char * treeName)</tt>

Parse absolute file path into path, name and extension.

Function parses file path into components: path, basename, name, extension.

Parameters

  • filePathName absolute file path.

Returns

PathComponents struct with path components.

<tt>public TBranch *</tt><a href="#namespaceFileUtils_1a45e68df91807fe034fd708eb008cb7e4"><tt>getBranch</tt></a><tt>(TTree * tree,const char * branchName)</tt>

<tt>public Double_t</tt><a href="#namespaceFileUtils_1a5c6c473991d4e7dbe20d50d0f8f5527d"><tt>getBranchMinimum</tt></a><tt>(TTree * tree,const char * branchName)</tt>

<tt>public Double_t</tt><a href="#namespaceFileUtils_1a3178659d6557381e3ec5145dcf4c5c75"><tt>getBranchMaximum</tt></a><tt>(TTree * tree,const char * branchName)</tt>

<tt>public Double_t</tt><a href="#namespaceFileUtils_1ad3eb992a1e5a43ff67c410394c2d0845"><tt>getBranchMaximumInFiles</tt></a><tt>(TList * files,const char * treeName,const char * branchName)</tt>

<tt>public TH1 *</tt><a href="#namespaceFileUtils_1aa15e5724ad5a206fcf80a47ea94cb471"><tt>getBranchHistogram</tt></a><tt>(TTree * tree,const char * branchName,Int_t nBins)</tt>

Shortcut to get a histogram from ROOT tree branch.

Function automatically determines histogram minimum and maximum.

Parameters

  • tree Pointer to the tree.
  • branchName branchName name of a branch.
  • nBins number of bins in the histogram. Default is 150.

Returns

TH1* pointer to the histogram.

<tt>public</tt><a href="#structFileUtils_1_1PathComponents"><tt>PathComponents</tt></a><a href="#namespaceFileUtils_1a6c7da44223cc4a1f99f2ec73a3d3c80f"><tt>parseFilePath</tt></a><tt>(const char * filePathName)</tt>

Parse absolute file path into path, name and extension.

Function parses file path into components: path, basename, name, extension.

Parameters

  • filePathName absolute file path.

Returns

PathComponents struct with path components.

struct <tt>FileUtils::PathComponents</tt>

Struct contains path components parsed by the parseFilePath()

Summary

Members Descriptions
public TStringpath Member absolute file path
public TStringbase Member filename with extension
public TStringname Member filename only
public TStringextension Member extension

Members

<tt>public TString</tt><a href="#structFileUtils_1_1PathComponents_1a7aca5f41d470ef816c2d9c4862bf7d0a"><tt>path</tt></a>

Member absolute file path

<tt>public TString</tt><a href="#structFileUtils_1_1PathComponents_1a3c7cb0f30b423ed8f85bac1cd020a79b"><tt>base</tt></a>

Member filename with extension

<tt>public TString</tt><a href="#structFileUtils_1_1PathComponents_1a21eddcf7c60f5d124365481e5fc97780"><tt>name</tt></a>

Member filename only

<tt>public TString</tt><a href="#structFileUtils_1_1PathComponents_1ad83ab03d5481848e1fb98467713ee31d"><tt>extension</tt></a>

Member extension

namespace <tt>FitUtils</tt>

Utility namespace for ROOT files.

Detailed description follows here. X. XYZ, DESY

March 2008

Summary

Members | Descriptions
-----------------------------—|------------------------------------------— public TF1 *fitHistWithROOTCrystalBall(TH1 * hist,Bool_t inverted) | public TF1 *getCrystalBallFunction(TH1 * hist,Bool_t reversed) | classFitUtils::CrystalBallFunctionObject |

Members

<tt>public TF1 *</tt><a href="#namespaceFitUtils_1afbac51c184fac0911488dd489fbd7250"><tt>fitHistWithROOTCrystalBall</tt></a><tt>(TH1 * hist,Bool_t inverted)</tt>

<tt>public TF1 *</tt><a href="#namespaceFitUtils_1a82ac01cf47da339477fa1dfa53d4df22"><tt>getCrystalBallFunction</tt></a><tt>(TH1 * hist,Bool_t reversed)</tt>

class <tt>FitUtils::CrystalBallFunctionObject</tt>

Summary

Members | Descriptions
-----------------------------—|------------------------------------------— publicCrystalBallFunctionObject(Bool_t _isInverted) | public Double_toperator()(double * _x,double * par) |

Members

<tt>public</tt><a href="#classFitUtils_1_1CrystalBallFunctionObject_1a62e6f49f2f1e3954146e614d9243da31"><tt>CrystalBallFunctionObject</tt></a><tt>(Bool_t _isInverted)</tt>

<tt>public Double_t</tt><a href="#classFitUtils_1_1CrystalBallFunctionObject_1a959e5bb14bd74fe547278b23c5ee4e10"><tt>operator()</tt></a><tt>(double * _x,double * par)</tt>

namespace <tt>HistUtils</tt>

Summary

Members | Descriptions
-----------------------------—|------------------------------------------— public Double_tgetMeanY(TH1 * hist) | public TTree *histsToTreeLin(TList * hists,const char * treeName,const char * treeTitle) | public TTree *histsToTree(TList * hists,const char * treeName,const char * treeTitle) | public TTree *histsToTreeXY(TList * hists,const char * treeName,const char * treeTitle) | public voidinvertHist(TH1 * hist) | public TH1 *cropHistogram(TH1 * hist,Double_t minX,Double_t maxX) | public TH1 *cropHistogram(TH1 * hist,Int_t minBin,Int_t maxBin) |

Members

<tt>public Double_t</tt><a href="#HistUtils_8h_1a0f27f40c41b52b247e12bc24aedc8b09"><tt>getMeanY</tt></a><tt>(TH1 * hist)</tt>

<tt>public TTree *</tt><a href="#HistUtils_8h_1a7a8faae65df61dc1820c1a1bef06b99a"><tt>histsToTreeLin</tt></a><tt>(TList * hists,const char * treeName,const char * treeTitle)</tt>

<tt>public TTree *</tt><a href="#HistUtils_8h_1a29f56b6f220137ec5b25b254bd4588fa"><tt>histsToTree</tt></a><tt>(TList * hists,const char * treeName,const char * treeTitle)</tt>

<tt>public TTree *</tt><a href="#HistUtils_8h_1a7aeb4b8ca3bd3a34da2bcae8675f386e"><tt>histsToTreeXY</tt></a><tt>(TList * hists,const char * treeName,const char * treeTitle)</tt>

<tt>public void</tt><a href="#HistUtils_8h_1a17dac3a36429bbccbc9b7a67d8fb7ea6"><tt>invertHist</tt></a><tt>(TH1 * hist)</tt>

<tt>public TH1 *</tt><a href="#HistUtils_8h_1a5ac85c46fa9ea77f1125c88e3ca21c77"><tt>cropHistogram</tt></a><tt>(TH1 * hist,Double_t minX,Double_t maxX)</tt>

<tt>public TH1 *</tt><a href="#HistUtils_8h_1a453130b9506397da2e32a3c9932ef744"><tt>cropHistogram</tt></a><tt>(TH1 * hist,Int_t minBin,Int_t maxBin)</tt>

namespace <tt>StringUtils</tt>

Summary

Members | Descriptions
-----------------------------—|------------------------------------------— public TStringstripExtension(const char * str) | public voidwriteProgress(const char * s,Int_t nTimes) |

Members

<tt>public TString</tt><a href="#StringUtils_8h_1ade13f67dae30a78599d8b42198def8bb"><tt>stripExtension</tt></a><tt>(const char * str)</tt>

<tt>public void</tt><a href="#StringUtils_8h_1af410ca865b51dbb47e473da94d8412d6"><tt>writeProgress</tt></a><tt>(const char * s,Int_t nTimes)</tt>

namespace <tt>UiUtils</tt>

Summary

Members | Descriptions
-----------------------------—|------------------------------------------— public voidmsgBoxInfo(const char * title,const char * text) | public TList *getFileNamesList(const char * text,Bool_t isMultiple) |

Members

<tt>public void</tt><a href="#UiUtils_8h_1ac45aa23c297b08ef04ab850c42dded4a"><tt>msgBoxInfo</tt></a><tt>(const char * title,const char * text)</tt>

<tt>public TList *</tt><a href="#UiUtils_8h_1a7b9a456d0fc715f9617fa47e78bcb067"><tt>getFileNamesList</tt></a><tt>(const char * text,Bool_t isMultiple)</tt>

Generated by Moxygen