PndHistoCombiner

class PndHistoCombiner : public TObject

Combines histograms with the same name from different files in one overlay histogram.

The class runs through all histograms or branches of the first file given and checks if histograms/branches with the same name exist in the other files. If this is the case they are plotted into a common histogram via the option “same”. The legend of the histogram is filled with the short name given by the user. The histograms are saved in a canvas as jpg files. The number of histograms per canvas can be set. In addition it is possible to perform a Kolmogorov, Chisquare or Anderson test between the first and all other histograms in one stack. If the test fail the word “FAILED” will be added to the title of the histogram. Furthermore, a cdash output can be created which uploads the probability of the test to the cdash server.

Author

Tobias Stockmanns t.stockmanns@fz-juelich.de

Date

2021-06-01

Public Functions

PndHistoCombiner()
virtual ~PndHistoCombiner()
inline void AddFileNamesAndShortName(TString fileName, TString shortName)

Adds the file which contain the histos to be plotted together. First file is the one comparisons are made to.

Parameters
  • fileName – full path to file

  • shortName – name displayed in histogram legend

int GenerateHistos()

Main method to generate histograms.

int GenerateBranches()

Main method to generate histograms from branches.

inline void AddHistoSelector(TString histoName)

Only those histograms are combined with part of their matching the histoName.

Parameters

histoName – part of the histo name to be compared

inline void AddBranchSelector(TString branchName)

Only those branches are combined with part of their matching the branchName.

Parameters

branchName – part of the histo name to be compared

inline void SetPicPerCan(int val)

pictures per canvas. They will be organized in a quadratic way

Parameters

val – number of pictures/pads

inline void SetCanvasPrefix(TString val)
inline void SetCanvasOutputDir(TString val)
inline void SetCanvasOutputFormat(TString val)
inline void SetPulls(bool dopulls = true)
inline void SetDimensions(int x = 400, int y = 300)
inline void SetGlobalThresholds(double thresholdKol = 0.03, double thresholdChi2 = -1.0, double thresholdAD = -1.0)

perform Kolmogorov or chi2 test between histograms of first file and all others.

Parameters
  • val – test type. 0: none, 1: Kolmogorov test, 2: chisquare test

  • threshold – for the probability of the test. Every p larger than threshold will be counted as passed

inline void AddHistoThresholds(TString histoName, double thresholdKol = 0.03, double thresholdChi2 = -1.0, double thresholdAD = -1.0)
inline void AddHistoThresholds(TString histoName, std::vector<double> thresholds)
inline void SetCDashOutput(bool val = true)

Select to generate output string automatically to upload data to CDASH server.

void CreateCDashOutput()

Generate output string to upload data to CDASH server This can be called automatically or by hand.

struct fileData

Public Functions

inline fileData()
inline fileData(TString fileName, TString shortName)

Public Members

TString fFileName
TString fShortName
TFile *fFile = nullptr
struct histoComparisonValues

Public Members

Double_t fChi2 = -1.
Double_t fKol = -1.
Double_t fAD = -1.