28 #ifndef TOOLS_PNDHISTOCOMBINER_H_ 29 #define TOOLS_PNDHISTOCOMBINER_H_ 39 #include "FairLogger.h" 72 fileData myData(fileName, shortName);
73 fFileData.push_back(myData);
114 void SetDimensions(
int x = 400,
int y = 300) { fCanCreator.SetDimensions(x, y); }
121 void SetGlobalThresholds(
double thresholdKol = 0.03,
double thresholdChi2 = -1.0,
double thresholdAD = -1.0)
127 void AddHistoThresholds(TString histoName,
double thresholdKol = 0.03,
double thresholdChi2 = -1.0,
double thresholdAD = -1.0){
129 thresholds.
fKol = thresholdKol;
130 thresholds.
fChi2 = thresholdChi2;
131 thresholds.
fAD = thresholdAD;
132 fThresholds.push_back(std::make_pair(histoName, thresholds));
136 if (thresholds.size() == 3)
139 LOG(warning) <<
"Wrong number of threshold values: " << histoName <<
" : " << thresholds.size();
161 void DrawPulls(std::vector<TH1 *> &histos);
167 if (thresholds.
fKol > 0){
170 histoTitle +=
" P(K)= ";
171 histoTitle += (TString::Format(
"%.2f", results.
fKol));
173 if (thresholds.
fChi2 > 0){
176 histoTitle +=
" /P(#Chi^{2})= ";
177 histoTitle += (TString::Format(
"%.2f", results.
fChi2));
179 if (thresholds.
fAD > 0){
180 if (results.
fAD < thresholds.
fAD)
182 histoTitle +=
" /P(AD)= ";
183 histoTitle += (TString::Format(
"%.2f", results.
fAD));
196 std::vector<std::pair<TString, histoComparisonValues>> fThresholds;
197 std::vector<fileData> fFileData;
198 std::vector<TString> fHistoSelector;
199 std::vector<TString> fBranchSelector;
200 std::vector<TString> fCDashOutput;
202 bool fCreateCDashOutput =
false;
205 bool fDoPulls =
false;
std::pair< TPad *, TPad * > SplitPadForPulls()
int GenerateHistos()
Main method to generate histograms.
TString RemoveSpecialCharacters(TString input)
histoComparisonValues PerformTest(TH1 *h1, TH1 *h2)
void DrawAndTest2DHistoStack(std::vector< TH1 *> &histos)
void SetPicPerCan(int val)
pictures per canvas. They will be organized in a quadratic way
void SetCanvasPrefix(TString val)
fileData(TString fileName, TString shortName)
Combines histograms with the same name from different files in one overlay histogram.
void AddHistoThresholds(TString histoName, std::vector< double > thresholds)
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.
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...
void AddCDashOutput(TString prefix, TString histoName, histoComparisonValues value)
Add to output string to upload data to CDASH server.
void AddHistoThresholds(TString histoName, double thresholdKol=0.03, double thresholdChi2=-1.0, double thresholdAD=-1.0)
bool CheckBranchName(TString branchName)
void AddFileNamesAndShortName(TString fileName, TString shortName)
Adds the file which contain the histos to be plotted together. First file is the one comparisons are ...
void SetCanvasOutputFormat(TString val)
Creates new canvasses once the number of histograms per canvas exceeds a setable threshold Automatic...
void AddHistoSelector(TString histoName)
Only those histograms are combined with part of their matching the histoName.
bool CheckHistoName(TString histoName)
void CreateLegend(std::vector< TH1 *> &histos)
void AddBranchSelector(TString branchName)
Only those branches are combined with part of their matching the branchName.
bool TestPassed(TString &histoTitle, histoComparisonValues results, histoComparisonValues thresholds)
void SetDimensions(int x=400, int y=300)
int GenerateBranches()
Main method to generate histograms from branches.
void SetCanvasOutputDir(TString val)
void SetPulls(bool dopulls=true)
bool CheckBranchType(TString branchType)
void DrawPulls(std::vector< TH1 *> &histos)
virtual ~PndHistoCombiner()
void DrawAndTestHistoStack(std::vector< TH1 *> &histos)