16 #ifndef TOOLS_PNDHISTOCOMBINER_H_ 17 #define TOOLS_PNDHISTOCOMBINER_H_ 27 #include "FairLogger.h" 60 fileData myData(fileName, shortName);
61 fFileData.push_back(myData);
102 void SetDimensions(
int x = 400,
int y = 300) { fCanCreator.SetDimensions(x, y); }
109 void SetGlobalThresholds(
double thresholdKol = 0.03,
double thresholdChi2 = -1.0,
double thresholdAD = -1.0)
115 void AddHistoThresholds(TString histoName,
double thresholdKol = 0.03,
double thresholdChi2 = -1.0,
double thresholdAD = -1.0){
117 thresholds.
fKol = thresholdKol;
118 thresholds.
fChi2 = thresholdChi2;
119 thresholds.
fAD = thresholdAD;
120 fThresholds.push_back(std::make_pair(histoName, thresholds));
124 if (thresholds.size() == 3)
127 LOG(warning) <<
"Wrong number of threshold values: " << histoName <<
" : " << thresholds.size();
149 void DrawPulls(std::vector<TH1 *> &histos);
155 if (thresholds.
fKol > 0){
158 histoTitle +=
" P(K)= ";
159 histoTitle += (TString::Format(
"%.2f", results.
fKol));
161 if (thresholds.
fChi2 > 0){
164 histoTitle +=
" /P(#Chi^{2})= ";
165 histoTitle += (TString::Format(
"%.2f", results.
fChi2));
167 if (thresholds.
fAD > 0){
168 if (results.
fAD < thresholds.
fAD)
170 histoTitle +=
" /P(AD)= ";
171 histoTitle += (TString::Format(
"%.2f", results.
fAD));
184 std::vector<std::pair<TString, histoComparisonValues>> fThresholds;
185 std::vector<fileData> fFileData;
186 std::vector<TString> fHistoSelector;
187 std::vector<TString> fBranchSelector;
188 std::vector<TString> fCDashOutput;
190 bool fCreateCDashOutput =
false;
193 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)