TQSampleDataReader: The TQSampleDataReader class provides methods to retrieve analysis results (histograms, cutflow counters, ...) from a structure of instances of the TQSampleFolder class. Generally, those elements are obtained by summing individual contributions in sample folders recursively. Retrieving histograms (in subfolders ".histograms"): - TQSampleDataReader::getHistogram("<path>", "<cutName/histogram>", ...) returning TH1* Retrieving cutflow counter (in subfolders ".cutflow"): - TQSampleDataReader::getCounter("<path>", "<cutName>", ...) returning TQCounter*
virtual | ~TQSampleDataReader() |
void | applyStyleToElement(TObject* element, TCollection* sfList, TQTaggable* options = __null) |
bool | areFoldersCorrelated(TQFolder* f1, TQFolder* f2) |
bool | areFoldersCorrelated(TQFolder* f1, TQFolder* f2, double& correlation, bool reversed = false) |
static TClass* | Class() |
bool | compareHistograms(const TString& histName1, const TString& histName2, const TString path = "*", double maxdiff = 0.01, bool print = true) |
virtual void | copyData(const TString& source, const TString& target, const TString& options = "") |
virtual TFolder* | exportHistograms(const TString& sfpath, const TString& tags = "") |
virtual TFolder* | exportHistograms(const TString& sfpath, TQTaggable& tags) |
virtual bool | exportHistograms(TDirectory* d, const TString& sfpath, const TString& tags = "") |
virtual bool | exportHistograms(TDirectory* d, const TString& sfpath, TQTaggable& tags) |
virtual bool | exportHistogramsToFile(const TString& fname, const TString& sfpath, const TString& tags = "") |
virtual bool | exportHistogramsToFile(const TString& fname, const TString& sfpath, TQTaggable& tags) |
bool | getApplyStyles() |
TQFolder* | getCorrelationFolderByIdentifier(const TString& id, bool forceUpdate = false) |
virtual TQCounter* | getCounter(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
virtual TQCounter* | getCounter(const TString& path, const TString& name, TQTaggable* options, TList* sfList = 0) |
TObject* | getElement(const TString& path, const TString& name, TClass* objClass, const TString& subPath, TQTaggable* options, TList* sfList = __null) |
TString | getErrorMessage() |
virtual TQTable* | getEventlist(const TString& path, const TString& name, TQTaggable* options, TList* sfList = 0) |
virtual TQTable* | getEventlist(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
virtual TGraph* | getGraph(const TString& path, TString name, TQTaggable* options, TList* sfList = 0) |
virtual TGraph* | getGraph(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
virtual TGraph2D* | getGraph2D(const TString& path, TString name, TQTaggable* options, TList* sfList = 0) |
virtual TGraph2D* | getGraph2D(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
virtual TH1* | getHistogram(const TString& path, TString name, TQTaggable* options = nullptr, TList* sfList = 0) |
virtual TH1* | getHistogram(const TString& path, const TString& name, const TString& options, TList* sfList = 0) |
virtual TList* | getListOfCounterNames(const TString& path = ".", TList* sfList = 0) |
virtual TList* | getListOfEventlistNames(const TString& path = ".", TList* sfList = 0) |
virtual TList* | getListOfHistogramNames(const TString& path = ".", TList* sfList = 0) |
virtual TList* | getListOfObjectNames(TClass* objClass, const TString& subpath, const TString& path = ".", TList* sfList = 0) |
TList* | getListOfSampleFolders(const TString& path, TClass* tclass = TQSampleFolder::Class()) |
bool | getLocalMode() |
vector<vector<TString> > | getParsedPathStrings(TString paths, TList* inputTokens = 0, TString pathPrefix = "") |
vector<TString> | getPaths(const TString& paths, TList* inputTokens = 0, const TString& pathPrefix = "") |
virtual TQPCA* | getPCA(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
virtual TQPCA* | getPCA(const TString& path, const TString& name, TQTaggable* options, TList* sfList = 0) |
virtual TProfile* | getProfile(const TString& path, TString name, TQTaggable* options, TList* sfList = 0) |
virtual TProfile* | getProfile(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
virtual TH1* | getRatesHistogram(const TString& path, TString name, TQTaggable* options, TList* sfList = 0) |
virtual TH1* | getRatesHistogram(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
TQSampleFolder* | getSampleFolder() |
TString | getStoragePath(TQFolder* f) |
virtual THnBase* | getTHnBase(const TString& path, TString name, TQTaggable* options, TList* sfList = 0) |
virtual THnBase* | getTHnBase(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
virtual TTree* | getTree(const TString& path, const TString& name, TQTaggable* options, TList* sfList = 0) |
virtual TTree* | getTree(const TString& path, const TString& name, const TString& options = "", TList* sfList = 0) |
int | getVerbose() |
virtual bool | hasCounter(const TString& path, const TString& name, const TString& options = "") |
virtual bool | hasHistogram(const TString& path, const TString& name, const TString& options = "") |
virtual TClass* | IsA() const |
TQSampleDataReader& | operator=(const TQSampleDataReader&) |
vector<TQSampleDataReader::AltPath_t> | parsePaths(TString paths, TList* inputTokens = 0, TString pathPrefix = "") |
virtual bool | passesFilter(TQSampleFolder* sampleFolder, TString filterName) |
virtual void | printListOfCounterLocations(const TString& name) |
virtual void | printListOfCounters(TString options = "") |
virtual void | printListOfHistogramLocations(const TString& name) |
virtual void | printListOfHistograms(TString options = "") |
void | printPaths(TString paths) |
void | processHistogramOptions(TH1*& histo, TQTaggable* options) |
void | reset() |
void | setApplyStyles(bool doApply = true) |
void | setDefaultScaleScheme(const TString& defaultScheme) |
void | setLocalMode(bool localMode = false) |
void | setVerbose(int verbose) |
virtual void | ShowMembers(TMemberInspector& insp) const |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
TQSampleDataReader() | |
TQSampleDataReader(TQSampleFolder* sampleFolder) |
void | addObjectNames(TQSampleFolder* sampleFolder, const TString& objectPath, TClass* objectClass, TList*& objectNames, TList* sfList, const TString& filterScheme) |
void | addObjectNames(const TString& path, const TString& objectPath, TClass* objectClass, TList*& objectNames, TList* sfList, const TString& filterScheme) |
TList* | getBaseScaleFactors(TQSampleFolder* sampleFolder, const TString& path, const TString& scaleScheme) |
TList* | getListOfSampleFoldersTrivial(TString path, TClass* tclass = __null) |
void | setErrorMessage(const TString& fname, const TString& message) |
int | sumElements(TList* list, TQCounter*& counter, TQTaggable* options) |
int | sumElements(TList* list, TQTable*& table, TQTaggable* options) |
int | sumElements(TList* list, TGraph*& graph, TQTaggable* options) |
int | sumElements(TList* list, TGraph2D*& graph, TQTaggable* options) |
int | sumElements(TList* list, TTree*& tree, TQTaggable* options) |
int | sumElements(TList* list, TQPCA*& tree, TQTaggable* options) |
int | sumElements(TList* list, THnBase*& histo, TQTaggable* options) |
virtual Bool_t | CheckTObjectHashConsistency() const |
TStopwatch* | auxTimer | |
TStopwatch* | collectTimer | |
TStopwatch* | summationTimer |
int | f_Verbose | |
bool | f_applyStyles | |
TQSampleFolder* | f_baseSampleFolder | |
TQMessageStream | f_errMsg | |
TString | f_filterScheme | |
map<TString,TQFolder*> | f_identifierToFolderMap | |
bool | f_localMode | |
int | f_maxCorrWarnings | |
TString | f_normScheme | |
TString | f_pathCutflow | |
TString | f_pathEventlists | |
TString | f_pathGraphs | |
TString | f_pathGridScan | |
TString | f_pathHistograms | |
TString | f_pathPCA | |
TString | f_pathScaleFactors | |
TString | f_pathTrees | |
TString | f_scaleScheme | |
TString | f_styleScheme |
Inheritance Chart: | |||||
|
Enables (<localMode> == true) or disables (<localMode> == false) the 'local mode' of this instance of TQSampleDataReader (local mode is disabled by default). In local mode, scale factors (better: normalization factors) or ignored for sample folders starting from the base sample folder of this instance of TQSampleDataReader up to the root sample folder. If the local mode is disabled scale factors assigned to any sample folder up the sample folder tree are accounted for. Examples: Let <samples> refer to a sample folder hierarchy with the following structure samples bkg top WW sig and let the sample folder "bkg" have a scale factor of 2. assigned to it (at some object folder). Defining two different instances of TQSampleDataReader TQSampleDataReader rd1(samples); TQSampleDataReader rd2(samples->getSampleFolder("bkg")); both rd1.getHistogram(...) and rd2.getHistogram(...) will account for the scale factor at sample folder "bkg" (provided the requested object is stored in the corresponding object folder). However, in local mode, set by rd1.setLocalMode(true); rd2.setLocalMode(true); only rd1.getHistogram(...) will account for the scale factor at sample folder "bkg" (again, provided the requested object is stored in the corresponding object folder), while rd2.getHistogram(...) will ignore this scale factor. Please note: the local mode does equivalently affect the retrieval of counter and other scaleable objects.
Returns true if this instance of TQSampleDataReader is in local mode and false otherwise.
Sets the verbosity of this instance of TQSampleDataReader to level <verbose>. Verbosity levels are: - 0: No output on standard out at all (default) - 1: Print an error message on standard out if an operation fails - 2: Print info for main internal function calls - 3: Print info for nternal function calls - 4: Trace detailed way through structure of sample folders
Returns the level of verbosity of this instance of TQSampleDataReader (see documentation of TQSampleDataReader::setVerbose(...) for additional information on verbosity levels).
wrapper method to parsePaths for only returning the string values of the PathTerms
compare two histograms with each other via chi2 test (chi2 < maxdiff) return true if they are completely equal, false otherwise
no valid base sample folder available?
retrieve the list of sample folders matching the given path and class
Returns a histogram which is created from of a list of hitograms and cutflow
counter with each bin of the final histogram corresponding to the integral or
rate of one histogram or cutflow counter . The list of names of the input
histograms or counters has to be provided as a comma-separated list with the
full list being enclosed in "{}". For each name in the list first a counter is
searched for and only in case of failure a histogram is searched for. Each
individual histogram or counter is read from path <path>.
process all simple histogram transformations this includes everything that can be done *without* access to the sample folder itself, that is
Retrieves the histogram <name> by recursively summing corresponding contributions from sample folders matching <path> and returns a pointer to an independent copy of an instance of TH1 or a NULL pointer in case an error occured. Examples: - getHistogram("bkg", "Cut_0jet/MT") returns a pointer to the sum of all contributing histograms "Cut_0jet/MT" in sample folder "bkg" Please note: the user is responsible for deleting the returned histogram! Manipulations to the retrieved histogram do not affect the original source histograms. Contributing histograms are checked for consistency (dimension and binning) before being summed. Multiple sample folder paths as well as histogram names may be summed and subtracted 'in-situ' by using the addition and subtraction operators "+" and "-", respectively. Examples: - getHistogram("bkg + sig", "Cut_0jet/MT") returns a pointer to the sum of all contributing histograms "Cut_0jet/MT" in sample folder "bkg" and "sig" - getHistogram("data - bkg", "Cut_0jet/MT") returns a pointer to the sum of all contributing histograms "Cut_0jet/MT" in sample folder "data" subtracted by the corresponding sum in sample folder "bkg" - getHistogram("bkg", "Cut_0jet/MT + Cut_1jet/MT") returns a pointer to the sum of all contributing histograms "Cut_0jet/MT" and "Cut_1jet/MT" in sample folder "bkg" Furthermore, "rate histograms" with each bin corresponding to the total yield of one category may be obtained by providing a comma-separated list of histogram or counter names (see also TQSampleDataReader::getRatesHistogram(...)): - getHistogram("bkg", "{Cut_0jet, Cut_1jet}") returns a pointer to a histogram with 2 bins with the first (second) bin corresponding to the event yield obtained from the sum of counter "Cut_0jet" ("Cut_1jet") in sample folder "bkg". Several options can be used to manipulate the histogram before it is returned: - Applying histogram style options: Using style options various histogram style parameter can be set: @tag:title: sets the title using h->SetTitle(...) @tag:histFillColor: sets the fill color using h->SetFillColor(...) @tag:histFillStyle: sets the fill style using h->SetFillStyle(...) @tag:histLineColor: sets the line color using h->SetLineColor(...) @tag:histLineWidth: sets the line width using h->SetLineWidth(...) @tag:histLineStyle: sets the line style using h->SetLineStyle(...) @tag:histMarkerColor: sets the marker color using h->SetMarkerColor(...) @tag:histMarkerSize: sets the marker width using h->SetMarkerSize(...) @tag:histMarkerStyle: sets the marker style using h->SetMarkerStyle(...) @tag:color: default to histFillColor, histLineColor, and histMarkerColor For colors either the ROOT color code or the corresponding color code name may be used, e.g. "histFillColor = kRed" is equivalent to "histFillColor = 632". Defaults: color >> (histFillColor, histLineColor, histMarkerColor) [Please note: this notation means that the tag <color> will be propagated to tags <histFillColor>, <histLineColor>, and <histMarkerColor> as default, which can overwrite the default] - Cutting on histograms (removing bins): @tag: [cutBinLowX, cutBinHighX, cutBinLowY, cutBinHighY, cutBinLow, cutBinHigh] Cutting on histograms refers to completely removing bins to the left or right of any axis resulting in a new histogram with modified range of the corresponding axes. The bin contents of bins that are removed by this operation is NOT kept. The parameter <cutBinLow> and <cutBinHigh> refer to the bin index of those bins that form the first and last bin, respectively, of the axes of the new histogram. No cut is placed if the corresponding parameter is -1. Defaults: -1 >> cutBinLow >> cutBinLowX -1 >> cutBinHigh >> cutBinHighX -1 >> cutBinLowY -1 >> cutBinHighY - Zooming into histograms: @tag: [zoomBinLowX, zoomBinHighX, zoomBinLowY, zoomBinHighY, zoomBinLow, zoomBinHigh] Zooming into histograms refers to selecting a sub-range of a histogram by merging bins to the left or right of any axis and accounting both bin content as well as bin errors to the corresponding underflow and overflow bins. The resulting histogram has a modified range of the corresponding axes but the same total integral as the original histogram. The parameter <zoomBinLow> and <zoomBinHigh> refer to the bin index of those bins that form the first and last bin, respectively, of the axes of the new histogram. Bins are kept if the corresponding parameter is -1. Defaults: -1 >> zoomBinLow >> zoomBinLowX -1 >> zoomBinHigh >> zoomBinHighX -1 >> zoomBinLowY -1 >> zoomBinHighY - Projecting 2D -> 1D: @tag: [projXBinLowY, projXBinY, projXBinHighY, projXBinY, projYBinLowX, projYBinX, projYBinHighX, projYBinX, projX, projX, projY, projY] Allows to project a 2D histogram onto one of its axes. Defaults: false >> projX ___(== false): -2 ___ projXBinY >> (projXBinLowY, projXBinHighY) \_(== true) : -1 _/ false >> projY ___(== false): -2 ___ projYBinX >> (projYBinLowX, projYBinHighX) \_(== true) : -1 _/ - Rebinning (merging bins): @tag: [rebinX, rebinY, rebinZ, rebin] Histograms can be rebinned using rebinning options: > rebinX: merged <rebinX> bins on X axis to one bin using TH1::RebinX(...) or TH1::Rebin3D(...). No rebinning on X axis is performed if <rebinX> = 0 > rebinY: merged <rebinY> bins on Y axis to one bin using TH1::RebinY(...) or TH1::Rebin3D(...). No rebinning on Y axis is performed if <rebinY> = 0 > rebinZ: merged <rebinZ> bins on Z axis to one bin using TH1::Rebin3D(...). No rebinning on Z axis is performed if <rebinZ> = 0 > rebin: default to <rebinX> Defaults: 0 >> rebin >> rebinX 0 >> rebinY 0 >> rebinZ The normalization of histograms can be changed using <norm> and <scale>: @tag:norm: scales the histogram such that the total integral of it is 1 using TH1::Scale(...) @tag:scale: scales the histogram by a factor <scale> using TH1::Scale(...). This operation is performed after <norm>. - Reseting histograms: @tag:[reset]: reset the histogram (set all contents to zero) - Applying a slope (reweighting): @tag:[slope]: reweight a histogam with a slope - Applying Poisson errors: @tag:[applyPoissonErrors]: apply poisson errors to all bins @tag:rerollGauss: randomize the bin contents of the histogram according to the erros set, assuming gaussian errors. if tag value is numeric, errors are scaled with that number @tag:rerollPoisson: randomize the bin contents of the histogram according to the bin contents, assuming poisson errors @tag:includeUnderflow: include the underflow bin in the first bin of the histogram @tag:includeOverflow: include the overflow bin in the last bin of the histogram @tag:extraUnderflow: move the underflow bin into the range of the histogram (use with remap) @tag:extraOverflow: move the overflow bin into the range of the histogram (use with remap) @tag:includeUnderflowOverflow: same as includeUnderflow and includeOverflow @tag:extraUnderflowOverflow: same as extraUnderflow and includeOverflow @tag:transferRelativeErrorsFromPath: copy relative error from another histogram (or counter in getCounter) with path given by this tag
Does the same as getHistogram with support for multidimentional histograms (THnBase)
Does the same as getHistogram with support for multidimentional histograms (THnBase)
Does the same as getHistogram for TGraph
Does the same as getHistogram for TGraph
Does the same as getHistogram for TGraph
Does the same as getHistogram for TGraph
sum all elements in the list (histogram variant)
sum all elements in the list (eventlist variant)
sum all elements in the list (TGraph variant)
sum all elements in the list (TGraph variant)
sum all elements in the list (TQPCA variant)
sum all elements in the list (TTree variant)
get the tail of the folders path which corresponds to folders not inheriting from TQSampleFolder
checks if tags are set indicating that elements in <f1> should be correlated with elements in folder <f2>. the corresponding correlation value if then stored in <correlation>. Please note that one should check in addition if the actual objects in question are correlated (e.g. same distribution / same cut stage).
retrieve a counter path/name with the given options
retrieve an eventlist path/name with the given options
retrieve an eventlist path/name with the given options
retrieve a counter path/name with the given options
retrieve a PCA object path/name with the given options
retrieve a PCA object path/name with the given options
retrieve a tree path/name with the given options please note that you will need a writeable TDirectory open to allow merging, because ROOT will not allow TTrees to be cloned/merged in memory!
retrieve a tree path/name with the given options please note that you will need a writeable TDirectory open to allow merging, because ROOT will not allow TTrees to be cloned/merged in memory!
this is a legacy wrapper for getElement that still uses the root TClass pointer functionality
stop if sample folder is invalid
get the list of sample folders matching path
Tries to retrieve the histogram <name> from <path> applying options <options> and returns true in case of success or false otherwise.
Tries to retrieve the counter <name> from <path> applying options <options> and returns true in case of success or false otherwise.
Returns a list (instance of TList* with instances of TObjString*) of the names of all histograms available in the sample folder structure referred to by <path> or a NULL pointer in case of failure or if no histogram is available. Please note: the user is responsible to delete the list.
Returns a list (instance of TList* with instances of TObjString*) of the names of all counter available in the sample folder structure referred to by <path> or a NULL pointer in case of failure or if no counter is available. Please note: the user is responsible to delete the list.
export all histograms from a certain path to a TDirectory object
export all histograms from a certain path to a TFolder object tags will be passed along to the histogram retrieval the tag "filter" allows to filter the histogram names if the tag "cutdiagram" is set, it will be used to retrieve a cut hierarchy from a folder under the path given as value to this tag and export a cut diagram as TNamed tags prefixed with "cutdiagram." will be passed through to the cut diagram making
export all histograms from a certain path to a TDirectory object tags will be passed along to the histogram retrieval the tag "filter" allows to filter the histogram names
export all histograms from a certain path to a TDirectory object tags will be passed along to the histogram retrieval the tag "filter" allows to filter the histogram names
export all histograms from a certain path to a file with the given name the file will be opened with the RECREATE option, and if ensureDirectory=true is passed, missing parent directories will be created
export all histograms from a certain path to a file with the given name the file will be opened with the RECREATE option, and if ensureDirectory=true is passed, missing parent directories will be created
resolves a sample identifier for its path in the folder hierarchy
copy the data from one part of the sample folder to another