CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
PlotCompareUtility Class Reference

#include <PlotCompareUtility.h>

Public Types

enum  Axis { axisX, axisY }
 

Public Member Functions

HistoDataaddHistoData (std::string NewName, std::string RefName, int PlotType)
 
HistoDataaddHistoData (std::string Name, int PlotType)
 
HistoDataaddProjectionXData (HistoData *Parent, std::string Name, int PlotType, int Bin, TH1 *NewHisto, TH1 *RefHisto)
 
HistoDataaddProjectionYData (HistoData *Parent, std::string Name, int PlotType, int Bin, TH1 *NewHisto, TH1 *RefHisto)
 
void clearHistos ()
 
void clearProjectionsX (HistoData *Parent)
 
void clearProjectionsY (HistoData *Parent)
 
bool compare (HistoData *)
 
void dump ()
 
double getChi2Threshold () const
 
bool getFinalResult () const
 
std::vector< HistoData > * getHistos ()
 
double getKSThreshold () const
 
int getNumHistos () const
 
int getPlotsBottomMargin () const
 
int getPlotsHeight () const
 
int getPlotsLeftMargin () const
 
int getPlotsRightMargin () const
 
int getPlotsTopMargin () const
 
int getPlotsWidth () const
 
int getProjectionsBarsThickness () const
 
int getProjectionsBottomMargin () const
 
int getProjectionsHeight () const
 
int getProjectionsLeftMargin () const
 
int getProjectionsRightMargin () const
 
int getProjectionsTopMargin () const
 
int getProjectionsWidth () const
 
std::vector< HistoData > * getProjectionsX (HistoData *HD)
 
std::vector< HistoData > * getProjectionsY (HistoData *HD)
 
int getSummaryBarsThickness () const
 
int getSummaryBottomMargin () const
 
int getSummaryHeight () const
 
int getSummaryLeftMargin () const
 
int getSummaryRightMargin () const
 
int getSummaryTopMargin () const
 
int getSummaryWidth () const
 
double getThreshold () const
 
bool isValid () const
 
void makeDefaultPlots ()
 
void makeHTML (HistoData *)
 
void makePlots (HistoData *)
 
void makeSummary (std::string Name)
 
void makeSummaryHTML (std::string Name)
 
void makeSummaryPlot (std::string Name)
 
 PlotCompareUtility (std::string Reference, std::string New, std::string NewBasePath, std::string NewPrefix="", std::string RefBasePath="", std::string RefPrefix="")
 
void setChi2Threshold (double Threshold)
 
void setKSThreshold (double Threshold)
 
void setPlotsBottomMargin (int Pixels)
 
void setPlotsHeight (int Pixels)
 
void setPlotsLeftMargin (int Pixels)
 
void setPlotsRightMargin (int Pixels)
 
void setPlotsTopMargin (int Pixels)
 
void setPlotsWidth (int Pixels)
 
void setProjectionsBarsThickness (int Pixels)
 
void setProjectionsBottomMargin (int Pixels)
 
void setProjectionsHeight (int Pixels)
 
void setProjectionsiWidth (int Pixels)
 
void setProjectionsLeftMargin (int Pixels)
 
void setProjectionsRightMargin (int Pixels)
 
void setProjectionsTopMargin (int Pixels)
 
void setSummaryBarsThickness (int Pixels)
 
void setSummaryBottomMargin (int Pixels)
 
void setSummaryHeight (int Pixels)
 
void setSummaryLeftMargin (int Pixels)
 
void setSummaryRightMargin (int Pixels)
 
void setSummaryTopMargin (int Pixels)
 
void setSummaryWidth (int Pixels)
 
virtual ~PlotCompareUtility ()
 

Private Member Functions

void centerRebin (TH1 *, TH1 *)
 
template<>
bool compare (HistoData *HD)
 
template<>
bool compare (HistoData *HD)
 
template<int PlotType>
bool compare (HistoData *)
 
template<int PlotType>
void makeHTML (HistoData *)
 
template<>
void makeHTML (HistoData *HD)
 
template<>
void makeHTML (HistoData *HD)
 
template<>
void makePlots (HistoData *HD)
 
template<int PlotType>
void makePlots (HistoData *)
 
template<>
void makePlots (HistoData *HD)
 
void renormalize (TH1 *, TH1 *)
 

Private Attributes

double chi2Threshold
 
bool finalResult
 
std::vector< HistoDatahistos
 
double ksThreshold
 
std::string newBasePath
 
TFile * newFile
 
std::string newPrefix
 
int plotsBottomMargin
 
int plotsHeight
 
int plotsLeftMargin
 
int plotsRightMargin
 
int plotsTopMargin
 
int plotsWidth
 
int projectionsBarsThickness
 
int projectionsBottomMargin
 
int projectionsHeight
 
int projectionsLeftMargin
 
int projectionsRightMargin
 
int projectionsTopMargin
 
int projectionsWidth
 
std::map< HistoData *, std::vector< HistoData > > projectionsX
 
std::map< HistoData *, std::vector< HistoData > > projectionsY
 
std::string refBasePath
 
TFile * refFile
 
std::string refPrefix
 
int summaryBarsThickness
 
int summaryBottomMargin
 
int summaryHeight
 
int summaryLeftMargin
 
int summaryRightMargin
 
int summaryTopMargin
 
int summaryWidth
 

Detailed Description

Definition at line 17 of file PlotCompareUtility.h.

Member Enumeration Documentation

◆ Axis

Enumerator
axisX 
axisY 

Definition at line 31 of file PlotCompareUtility.h.

Constructor & Destructor Documentation

◆ PlotCompareUtility()

PlotCompareUtility::PlotCompareUtility ( std::string  Reference,
std::string  New,
std::string  NewBasePath,
std::string  NewPrefix = "",
std::string  RefBasePath = "",
std::string  RefPrefix = "" 
)

◆ ~PlotCompareUtility()

virtual PlotCompareUtility::~PlotCompareUtility ( )
virtual

Member Function Documentation

◆ addHistoData() [1/2]

HistoData* PlotCompareUtility::addHistoData ( std::string  NewName,
std::string  RefName,
int  PlotType 
)

◆ addHistoData() [2/2]

HistoData* PlotCompareUtility::addHistoData ( std::string  Name,
int  PlotType 
)
inline

Definition at line 98 of file PlotCompareUtility.h.

References addHistoData(), and SiStripClientConfig_Tier0_cff::Name.

Referenced by addHistoData().

98 { return addHistoData(Name, Name, PlotType); }
PlotType
HistoData * addHistoData(std::string NewName, std::string RefName, int PlotType)

◆ addProjectionXData()

HistoData* PlotCompareUtility::addProjectionXData ( HistoData Parent,
std::string  Name,
int  PlotType,
int  Bin,
TH1 *  NewHisto,
TH1 *  RefHisto 
)

◆ addProjectionYData()

HistoData* PlotCompareUtility::addProjectionYData ( HistoData Parent,
std::string  Name,
int  PlotType,
int  Bin,
TH1 *  NewHisto,
TH1 *  RefHisto 
)

◆ centerRebin()

void PlotCompareUtility::centerRebin ( TH1 *  ,
TH1 *   
)
private

◆ clearHistos()

void PlotCompareUtility::clearHistos ( )
inline

Definition at line 103 of file PlotCompareUtility.h.

References histos.

103 { histos.clear(); }
std::vector< HistoData > histos

◆ clearProjectionsX()

void PlotCompareUtility::clearProjectionsX ( HistoData Parent)
inline

Definition at line 104 of file PlotCompareUtility.h.

References projectionsX.

104 { projectionsX[Parent].clear(); }
std::map< HistoData *, std::vector< HistoData > > projectionsX

◆ clearProjectionsY()

void PlotCompareUtility::clearProjectionsY ( HistoData Parent)
inline

Definition at line 105 of file PlotCompareUtility.h.

References projectionsY.

105 { projectionsY[Parent].clear(); }
std::map< HistoData *, std::vector< HistoData > > projectionsY

◆ compare() [1/4]

template<>
bool PlotCompareUtility::compare ( HistoData HD)
inlineprivate

Definition at line 18 of file Plot1D.h.

References DMR_cfg::cerr, dtSegmentAnalysisTest_cfi::chi2Threshold, postprocess-scan-build::href, and TriggerAnalyzer::passed.

18  {
19  // get the reference and comparison histograms
20  TH1F *href = (TH1F *)HD->getRefHisto();
21  TH1F *hnew = (TH1F *)HD->getNewHisto();
22 
23  // do not run comparisons if either histogram is empty/broken
24  if (hnew == nullptr || href == nullptr || hnew->GetEntries() <= 1 || href->GetEntries() <= 1) {
25  // std::cerr << HD->getName() << " error: unable to retrieve histogram (or
26  // no entries)\n";
27  HD->setIsEmpty(true);
28  return false;
29  }
30 
31  // rebin histograms and center on common range
32  if (HD->getDoAllow1DRebinning())
33  centerRebin(href, hnew);
34 
35  // run statistical comparisons
36  double ksScore = hnew->KolmogorovTest(href, "D");
37  double chi2Score = hnew->Chi2Test(href, "uup");
38 
39  // renormalize histograms for common display
40  renormalize(href, hnew);
41 
42  // set ks/chi2 and determine high/low scores
43  HD->setKSScore(ksScore);
44  HD->setChi2Score(chi2Score);
45  if (ksThreshold > 0 && chi2Threshold > 0) {
46  HD->setLowScore(ksScore < chi2Score ? ksScore : chi2Score);
47  HD->setHighScore(ksScore > chi2Score ? ksScore : chi2Score);
48  } else if (ksThreshold > 0) {
49  HD->setLowScore(ksScore);
50  HD->setHighScore(ksScore);
51  } else if (chi2Threshold > 0) {
52  HD->setLowScore(chi2Score);
53  HD->setHighScore(chi2Score);
54  } else
55  std::cerr << "error: no test performed? chi2Threshold and ksThreshold <= 0\n";
56 
57  // check overall result
58  bool passed = (ksScore >= ksThreshold && chi2Score >= chi2Threshold);
59  HD->setResult(passed);
60  // if (!passed) std::cout << "NOTPASSED!!!!"; else std::cout << "YESPASSED!";
61  // returns true on test passed and false on test failed
62  HD->setIsEmpty(false);
63  return passed;
64 }
bool getDoAllow1DRebinning() const
Definition: HistoData.h:28
void renormalize(TH1 *, TH1 *)
void setResult(bool Result)
void setIsEmpty(bool Toggle)
Definition: HistoData.h:82
void setKSScore(float Score)
Definition: HistoData.h:77
TH1 * getNewHisto() const
Definition: HistoData.h:21
TH1 * getRefHisto() const
Definition: HistoData.h:22
void setChi2Score(float Score)
Definition: HistoData.h:78
void setHighScore(float Score)
Definition: HistoData.h:80
void centerRebin(TH1 *, TH1 *)
void setLowScore(float Score)
Definition: HistoData.h:79

◆ compare() [2/4]

template<>
bool PlotCompareUtility::compare ( HistoData HD)
inlineprivate

Definition at line 21 of file Plot2D.h.

References newFWLiteAna::bin, reco::ceil(), DMR_cfg::cerr, gather_cfg::cout, postprocess-scan-build::href, createfilelist::int, seedmultiplicitymonitor_newtracking_cfi::nBins, Plot1D, and amptDefault_cfi::proj.

21  {
22  // get the reference and comparison histograms
23  TH2F *href2d = (TH2F *)HD->getRefHisto();
24  TH2F *hnew2d = (TH2F *)HD->getNewHisto();
25 
26  // do not run comparisons if either histogram is empty/broken
27  if (hnew2d == nullptr || href2d == nullptr || hnew2d->GetEntries() <= 1 || href2d->GetEntries() <= 1) {
28  // std::cerr << HD->getName() << " error: unable to retrieve histogram (or
29  // no entries)\n";
30  HD->setIsEmpty(true);
31  return false;
32  }
33 
34  // prepare an overall result
35  bool projectionsPassed = true;
36 
37  // loop over axes (projections on one or both may be requested)
38  for (int axis = axisX; axis <= axisY; ++axis) {
39  // for X: verify projections requested and proper Y binning of href2d and
40  // hnew2d
41  if (axis == axisX && !HD->getDoProjectionsX())
42  continue;
43  if (axis == axisX && href2d->GetNbinsY() != hnew2d->GetNbinsY()) {
44  std::cerr << HD->getName() << " error: incorrect number of bins for X projection tests\n";
45  projectionsPassed = false;
46  continue;
47  }
48 
49  // for Y: verify projections requested and proper X binning of href2d and
50  // hnew2d
51  if (axis == axisY && !HD->getDoProjectionsY())
52  continue;
53  if (axis == axisY && href2d->GetNbinsX() != hnew2d->GetNbinsX()) {
54  std::cerr << HD->getName() << " error: incorrect number of bins for Y projection tests\n";
55  projectionsPassed = false;
56  continue;
57  }
58 
59  // setup the rebinning variables
60  int nBins = (axis == axisX) ? href2d->GetNbinsY() : href2d->GetNbinsX();
61  int nProjections = (axis == axisX) ? HD->getMaxProjectionsX() : HD->getMaxProjectionsY();
62  int nGroups = (int)ceil(float(nBins) / nProjections);
63  bool rebinned = false;
64 
65  // for X projections: if required rebin a clone of href2d and hnew2d
66  if (axis == axisX && HD->getDoAllow2DRebinningX() && nGroups > 1) {
67  href2d = (TH2F *)(((TH2F *)(href2d->Clone()))->RebinY(nGroups));
68  hnew2d = (TH2F *)(((TH2F *)(hnew2d->Clone()))->RebinY(nGroups));
69  nBins = href2d->GetNbinsY();
70  rebinned = true;
71  }
72 
73  // for Y projections: if required rebin a clone of href2d and hnew2d
74  if (axis == axisY && HD->getDoAllow2DRebinningY() && nGroups > 1) {
75  href2d = (TH2F *)(((TH2F *)(href2d->Clone()))->RebinX(nGroups));
76  hnew2d = (TH2F *)(((TH2F *)(hnew2d->Clone()))->RebinX(nGroups));
77  nBins = href2d->GetNbinsX();
78  rebinned = true;
79  }
80 
81  // loop over bins in histograms (go backwords to keep in order)
82  // for (int bin = nBins; bin >= 1; --bin) {
83  for (int bin = 1; bin <= nBins; ++bin) {
84  std::cout << "bin " << bin << " of " << nBins << std::endl;
85  // create some unique identifiers for the histogram names
86  TString projName = HD->getName() + (axis == axisX ? "_px" : "_py");
87  projName += bin;
88  TString newProjName = "new_";
89  newProjName += projName;
90  TString refProjName = "ref_";
91  refProjName += projName;
92 
93  // get the 1d projections for this bin out of the histogram
94  TH1D *hnew = (axis == axisX) ? hnew2d->ProjectionX(newProjName.Data(), bin, bin)
95  : hnew2d->ProjectionY(newProjName.Data(), bin, bin);
96  TH1D *href = (axis == axisX) ? href2d->ProjectionX(refProjName.Data(), bin, bin)
97  : href2d->ProjectionY(refProjName.Data(), bin, bin);
98 
99  // set histogram axis labels
100  hnew->GetXaxis()->SetTitle((axis == axisX ? hnew2d->GetXaxis()->GetTitle() : hnew2d->GetYaxis()->GetTitle()));
101  href->GetXaxis()->SetTitle((axis == axisX ? href2d->GetXaxis()->GetTitle() : href2d->GetYaxis()->GetTitle()));
102 
103  // allow Root to delete these histograms after display
104  hnew->SetBit(kCanDelete);
105  href->SetBit(kCanDelete);
106 
107  // create a new HistoData based on this projection
108  HistoData *proj = (axis == axisX) ? addProjectionXData(HD, projName.Data(), Plot1D, bin, hnew, href)
109  : addProjectionYData(HD, projName.Data(), Plot1D, bin, hnew, href);
110 
111  // ignore empty bins
112  // if (hnew->Integral() == 0 || href->Integral() == 0) continue;
113  if (hnew->GetEntries() <= 1 || href->GetEntries() <= 1 || hnew->Integral() == 0 || href->Integral() == 0)
114  continue;
115 
116  // run this new HistoData through compare<Plot1D>
117  projectionsPassed &= compare<Plot1D>(proj);
118 
119  // get the high and low scores from this comparison
120  float lowScore = proj->getLowScore();
121  float highScore = proj->getHighScore();
122  if (lowScore < HD->getLowScore())
123  HD->setLowScore(lowScore);
124  if (highScore > HD->getHighScore())
125  HD->setHighScore(highScore);
126  }
127 
128  // if 2d histograms were rebinned, delete the clone and re-get the original
129  if (rebinned) {
130  delete href2d;
131  href2d = (TH2F *)HD->getRefHisto();
132  delete hnew2d;
133  hnew2d = (TH2F *)HD->getNewHisto();
134  }
135  }
136 
137  // check overall result
138  HD->setResult(projectionsPassed);
139  HD->setIsEmpty(false);
140 
141  // returns true on test passed and false on test failed
142  return projectionsPassed;
143 }
constexpr int32_t ceil(float num)
float getHighScore() const
Definition: HistoData.h:41
int getMaxProjectionsX() const
Definition: HistoData.h:33
void setResult(bool Result)
bool getDoAllow2DRebinningY() const
Definition: HistoData.h:30
int getMaxProjectionsY() const
Definition: HistoData.h:34
void setIsEmpty(bool Toggle)
Definition: HistoData.h:82
TH1 * getNewHisto() const
Definition: HistoData.h:21
bool getDoProjectionsY() const
Definition: HistoData.h:32
TH1 * getRefHisto() const
Definition: HistoData.h:22
std::string getName() const
Definition: HistoData.h:17
HistoData * addProjectionXData(HistoData *Parent, std::string Name, int PlotType, int Bin, TH1 *NewHisto, TH1 *RefHisto)
bool getDoProjectionsX() const
Definition: HistoData.h:31
HistoData * addProjectionYData(HistoData *Parent, std::string Name, int PlotType, int Bin, TH1 *NewHisto, TH1 *RefHisto)
void setHighScore(float Score)
Definition: HistoData.h:80
bool getDoAllow2DRebinningX() const
Definition: HistoData.h:29
void setLowScore(float Score)
Definition: HistoData.h:79

◆ compare() [3/4]

bool PlotCompareUtility::compare ( HistoData )

◆ compare() [4/4]

template<int PlotType>
bool PlotCompareUtility::compare ( HistoData )
private

◆ dump()

void PlotCompareUtility::dump ( )

◆ getChi2Threshold()

double PlotCompareUtility::getChi2Threshold ( ) const
inline

Definition at line 44 of file PlotCompareUtility.h.

References chi2Threshold.

44 { return chi2Threshold; }

◆ getFinalResult()

bool PlotCompareUtility::getFinalResult ( ) const
inline

Definition at line 46 of file PlotCompareUtility.h.

References finalResult.

46 { return finalResult; }

◆ getHistos()

std::vector<HistoData>* PlotCompareUtility::getHistos ( )
inline

Definition at line 34 of file PlotCompareUtility.h.

References histos.

34 { return &histos; }
std::vector< HistoData > histos

◆ getKSThreshold()

double PlotCompareUtility::getKSThreshold ( ) const
inline

Definition at line 43 of file PlotCompareUtility.h.

References ksThreshold.

43 { return ksThreshold; }

◆ getNumHistos()

int PlotCompareUtility::getNumHistos ( ) const
inline

Definition at line 37 of file PlotCompareUtility.h.

References histos.

37 { return histos.size(); }
std::vector< HistoData > histos

◆ getPlotsBottomMargin()

int PlotCompareUtility::getPlotsBottomMargin ( ) const
inline

Definition at line 68 of file PlotCompareUtility.h.

References plotsBottomMargin.

◆ getPlotsHeight()

int PlotCompareUtility::getPlotsHeight ( ) const
inline

Definition at line 63 of file PlotCompareUtility.h.

References plotsHeight.

63 { return plotsHeight; }

◆ getPlotsLeftMargin()

int PlotCompareUtility::getPlotsLeftMargin ( ) const
inline

Definition at line 66 of file PlotCompareUtility.h.

References plotsLeftMargin.

◆ getPlotsRightMargin()

int PlotCompareUtility::getPlotsRightMargin ( ) const
inline

Definition at line 67 of file PlotCompareUtility.h.

References plotsRightMargin.

◆ getPlotsTopMargin()

int PlotCompareUtility::getPlotsTopMargin ( ) const
inline

Definition at line 65 of file PlotCompareUtility.h.

References plotsTopMargin.

65 { return plotsTopMargin; }

◆ getPlotsWidth()

int PlotCompareUtility::getPlotsWidth ( ) const
inline

Definition at line 64 of file PlotCompareUtility.h.

References plotsWidth.

64 { return plotsWidth; }

◆ getProjectionsBarsThickness()

int PlotCompareUtility::getProjectionsBarsThickness ( ) const
inline

Definition at line 58 of file PlotCompareUtility.h.

References projectionsBarsThickness.

◆ getProjectionsBottomMargin()

int PlotCompareUtility::getProjectionsBottomMargin ( ) const
inline

Definition at line 62 of file PlotCompareUtility.h.

References projectionsBottomMargin.

◆ getProjectionsHeight()

int PlotCompareUtility::getProjectionsHeight ( ) const
inline

Definition at line 56 of file PlotCompareUtility.h.

References projectionsHeight.

◆ getProjectionsLeftMargin()

int PlotCompareUtility::getProjectionsLeftMargin ( ) const
inline

Definition at line 60 of file PlotCompareUtility.h.

References projectionsLeftMargin.

◆ getProjectionsRightMargin()

int PlotCompareUtility::getProjectionsRightMargin ( ) const
inline

Definition at line 61 of file PlotCompareUtility.h.

References projectionsRightMargin.

◆ getProjectionsTopMargin()

int PlotCompareUtility::getProjectionsTopMargin ( ) const
inline

Definition at line 59 of file PlotCompareUtility.h.

References projectionsTopMargin.

◆ getProjectionsWidth()

int PlotCompareUtility::getProjectionsWidth ( ) const
inline

Definition at line 57 of file PlotCompareUtility.h.

References projectionsWidth.

◆ getProjectionsX()

std::vector<HistoData>* PlotCompareUtility::getProjectionsX ( HistoData HD)
inline

Definition at line 35 of file PlotCompareUtility.h.

References projectionsX.

35 { return &projectionsX[HD]; }
std::map< HistoData *, std::vector< HistoData > > projectionsX

◆ getProjectionsY()

std::vector<HistoData>* PlotCompareUtility::getProjectionsY ( HistoData HD)
inline

Definition at line 36 of file PlotCompareUtility.h.

References projectionsY.

36 { return &projectionsY[HD]; }
std::map< HistoData *, std::vector< HistoData > > projectionsY

◆ getSummaryBarsThickness()

int PlotCompareUtility::getSummaryBarsThickness ( ) const
inline

Definition at line 51 of file PlotCompareUtility.h.

References summaryBarsThickness.

◆ getSummaryBottomMargin()

int PlotCompareUtility::getSummaryBottomMargin ( ) const
inline

Definition at line 55 of file PlotCompareUtility.h.

References summaryBottomMargin.

◆ getSummaryHeight()

int PlotCompareUtility::getSummaryHeight ( ) const
inline

Definition at line 50 of file PlotCompareUtility.h.

References summaryHeight.

50 { return summaryHeight; }

◆ getSummaryLeftMargin()

int PlotCompareUtility::getSummaryLeftMargin ( ) const
inline

Definition at line 53 of file PlotCompareUtility.h.

References summaryLeftMargin.

◆ getSummaryRightMargin()

int PlotCompareUtility::getSummaryRightMargin ( ) const
inline

Definition at line 54 of file PlotCompareUtility.h.

References summaryRightMargin.

◆ getSummaryTopMargin()

int PlotCompareUtility::getSummaryTopMargin ( ) const
inline

Definition at line 52 of file PlotCompareUtility.h.

References summaryTopMargin.

◆ getSummaryWidth()

int PlotCompareUtility::getSummaryWidth ( ) const
inline

Definition at line 49 of file PlotCompareUtility.h.

References summaryWidth.

49 { return summaryWidth; }

◆ getThreshold()

double PlotCompareUtility::getThreshold ( ) const

◆ isValid()

bool PlotCompareUtility::isValid ( ) const

◆ makeDefaultPlots()

void PlotCompareUtility::makeDefaultPlots ( )

◆ makeHTML() [1/4]

void PlotCompareUtility::makeHTML ( HistoData )

◆ makeHTML() [2/4]

template<int PlotType>
void PlotCompareUtility::makeHTML ( HistoData )
private

◆ makeHTML() [3/4]

template<>
void PlotCompareUtility::makeHTML ( HistoData HD)
inlineprivate

Definition at line 149 of file Plot1D.h.

149  {
150  /* HTML is not presently required for 1D histograms -- do nothing
151 
152  // create HTML support code for this HistoData
153  std::string Name = hd->getName();
154  std::string gifName = Name + "_Results.gif";
155  std::string html = Name + "_Results.html";
156  ofstream fout(html.c_str());
157 
158  // simply link to the appropriate image overlay
159  fout << "<html><body><img src=\"" << gifName << "\"></body></html>" << endl;
160 
161  // close the file
162  fout.close();
163 
164  */
165 }

◆ makeHTML() [4/4]

template<>
void PlotCompareUtility::makeHTML ( HistoData HD)
inlineprivate

Definition at line 340 of file Plot2D.h.

References newFWLiteAna::bin, dqmMemoryStats::float, groupFilesInBlocks::fout, createfilelist::int, SiStripClientConfig_Tier0_cff::Name, hltrates_dqm_sourceclient-live_cfg::offset, amptDefault_cfi::proj, AlCaHLTBitMon_QueryRunRegistry::string, filterCSVwithJSON::target, testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, testProducerWithPsetDescEmpty_cfi::y1, and testProducerWithPsetDescEmpty_cfi::y2.

340  {
341  /* at present, makeHTML<Plot1D> does nothing, so don't waste the CPU cycles
342  // loop over projections and produce HTML
343  std::vector<HistoData>::iterator hd;
344  for (hd = projectionsX[HD].begin(); hd != projectionsX[HD].end(); hd++)
345  makePlots<Plot1D>(&(*hd)); for (hd = projectionsY[HD].begin(); hd !=
346  projectionsY[HD].end(); hd++) makePlots<Plot1D>(&(*hd));
347  */
348 
349  // get the HistoData name for later reuse
350  std::string Name = HD->getName();
351 
352  // loop over the axes to see if projections were produced
353  bool pfDone[2] = {false, false};
354  for (int axis = axisX; axis <= axisY; axis++) {
355  // get the list of projections associated with this HistoData
356  std::vector<HistoData> *proj = (axis == axisX) ? &projectionsX[HD] : &projectionsY[HD];
357  if (proj == nullptr || proj->empty())
358  continue;
359  else
360  pfDone[axis] = true;
361 
362  // setup some names, etc. for insertion into the HTML
363  std::string gifNameProjections = Name + (axis == axisX ? "_Results_px.gif" : "_Results_py.gif");
364  std::string gifNameAllProj = Name + (axis == axisX ? "_py_Results.gif" : "_px_Results.gif");
365  std::string gifNameProfile = Name + (axis == axisX ? "_pfx.gif" : "_pfy.gif");
366  std::string gifBinPrefix = Name + (axis == axisX ? "_px" : "_py");
367 
368  // setup some locations to put thumbnails, etc.
369  int offset = 10;
370  int thumbWidth = plotsWidth / 4;
371  int thumbHeight = plotsHeight / 4;
373  int leftThumbPos = offset + projectionsLeftMargin + bodyWidth / 4 - thumbWidth / 2;
374  int rightThumbPos = leftThumbPos + bodyWidth / 2;
375  int thumbsLoc = projectionsTopMargin + thumbHeight / 2;
376 
377  // create the profile's HTML document
378  std::string htmlNameProfile = Name + (axis == axisX ? "_Results_px.html" : "_Results_py.html");
379  std::ofstream fout(htmlNameProfile.c_str());
380 
381  // print top portion of document
382  fout << "<!DOCTYPE gif PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>" << std::endl
383  << "<html>" << std::endl
384  << " <head>" << std::endl
385  << " <title>Compatibility of Projections for " << HD->getRefHisto()->GetTitle() << "</title>" << std::endl
386  << " <script type='text/javascript'>" << std::endl
387  << std::endl
388  << " function tn(target,image,class) {" << std::endl
389  << " clear()" << std::endl
390  << " "
391  "document.getElementById('thumb_div').setAttribute('class',class)"
392  << std::endl
393  << " "
394  "document.getElementById('thumb_div').setAttribute('className',"
395  "class)"
396  << std::endl
397  << " document.getElementById('thumb_link').href = target" << std::endl
398  << " document.getElementById('thumb_img').src = image" << std::endl
399  << " document.getElementById('thumb_img').width = '" << thumbWidth << "'" << std::endl
400  << " document.getElementById('thumb_img').height = '" << thumbHeight << "'" << std::endl
401  << " document.getElementById('thumb_img').border = '1'" << std::endl
402  << " }" << std::endl
403  << std::endl
404  << " function clear() {" << std::endl
405  << " document.getElementById('thumb_link').href = '#'" << std::endl
406  << " document.getElementById('thumb_img').src = ''" << std::endl
407  << " document.getElementById('thumb_img').width = '0'" << std::endl
408  << " document.getElementById('thumb_img').height = '0'" << std::endl
409  << " document.getElementById('thumb_img').border = '0'" << std::endl
410  << " }" << std::endl
411  << std::endl
412  << " </script>" << std::endl
413  << " </head>" << std::endl
414  << " <body onClick=\"window.location.href='index.html'\">"
415  << std::endl
416  // << "<a href='index.html'>"
417  << " <style type='text/css'>" << std::endl
418  << " #thumb_div {}" << std::endl
419  << " div.thumb_left {position: absolute; left: " << leftThumbPos << "px; top: " << thumbsLoc << "px;}"
420  << std::endl
421  << " div.thumb_right {position: absolute; left: " << rightThumbPos << "px; top: " << thumbsLoc << "px;}"
422  << std::endl
423  << " #main_d {position: absolute; left: " << offset << "px;}" << std::endl
424  << " a:link {color: #000000}" << std::endl
425  << " a:visited {color: #000000}" << std::endl
426  << " a:hover {color: #000000}" << std::endl
427  << " a:active {color: #000000}" << std::endl
428  << " </style>" << std::endl
429  << " <div id='main_d'>"
430  << std::endl
431  // << " <p>" << HD->getRefHisto()->GetTitle() << "</p>" //include
432  // the Title of the Plot as a title of the page
433  << " <img src='" << gifNameProjections << "' usemap='#results' alt=''"
434  << " height=" << projectionsHeight << " width=" << projectionsWidth << " border=0>" << std::endl
435  << " <map id='#results' name='results' onMouseOut=\"clear()\">" << std::endl;
436 
437  // loop over projections
438  std::vector<HistoData>::iterator pd;
439  for (pd = proj->begin(); pd != proj->end(); pd++) {
440  // determine map coordinates for this bin (1 pixel offset due to borders?)
441  int bin = pd->getBin();
442  int x1 = projectionsLeftMargin + int(float(bin * 1.5 - 1.25) * projectionsBarsThickness);
444  int y1 = projectionsTopMargin + 1;
446  std::string image = pd->getResultImage();
447  std::string target = pd->getResultTarget();
448 
449  // add coordinates area to image map
450  std::string tnClass = (bin - 1 >= float(proj->size()) / 2 ? "thumb_left" : "thumb_right");
451  fout << " <area shape='rect' alt='' coords='" << x1 << "," << y1 << "," << x2 << "," << y2 << "'"
452  << " href='" << target << "' onMouseOver=\"tn('" << target << "','" << image << "','" << tnClass << "')\" "
453  << "onMouseDown=\"window.location.href='" << target << "'\">" << std::endl;
454  }
455 
456  fout << " <area shape='default' nohref='nohref' "
457  "onMouseDown='window.location.reload()' alt=''>"
458  << std::endl
459  << " </map>" << std::endl
460  << " <br><img src=\"" << gifNameAllProj << "\">" << std::endl
461  << " </div>" << std::endl
462  << " <div id='thumb_div'><a href='#' id='thumb_link'><img src='' "
463  "id='thumb_img' width=0 height=0 border=0></a></div>"
464  << std::endl
465  // << " </a>"
466  << " </body>" << std::endl
467  << "</html>" << std::endl;
468 
469  // close the file
470  HD->setResultTarget(htmlNameProfile);
471  fout.close();
472  }
473 
474  // if both profile dimensions were filled, we need an additional HTML document
475  if (pfDone[axisX] && pfDone[axisY]) {
476  // create HTML support code for this HistoData
477  std::string html = Name + "_Results_Profiles.html";
478  std::ofstream fout(html.c_str());
479 
480  // make a simple frames portal to show both profile
481  fout << "<html>" << std::endl
482  << " <frameset rows=\"50%,50%\">" << std::endl
483  << " <frame src=\"" << Name << "_Results_py.html\">" << std::endl
484  << " <frame src=\"" << Name << "_Results_px.html\">" << std::endl
485  << " <noframes><body>" << std::endl
486  << " unable to display frames -- click to select desired page" << std::endl
487  << " <br><a href =\"" << Name << "_Results_py.html\">Y Projections</a>" << std::endl
488  << " <br><a href =\"" << Name << "_Results_px.html\">X Projections</a>" << std::endl
489  << " </body></noframes>" << std::endl
490  << " </frameset>" << std::endl
491  << "</html>" << std::endl;
492 
493  // close the file
494  HD->setResultTarget(html);
495  fout.close();
496  }
497 }
Definition: html.py:1
void setResultTarget(std::string Target)
Definition: HistoData.h:60
std::map< HistoData *, std::vector< HistoData > > projectionsY
TH1 * getRefHisto() const
Definition: HistoData.h:22
std::string getName() const
Definition: HistoData.h:17
std::map< HistoData *, std::vector< HistoData > > projectionsX

◆ makePlots() [1/4]

template<>
void PlotCompareUtility::makePlots ( HistoData HD)
inlineprivate

Definition at line 67 of file Plot1D.h.

References DMR_cfg::cerr, dtSegmentAnalysisTest_cfi::chi2Threshold, postprocess-scan-build::href, WDecay::kNone, compareTotals::legend, AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

67  {
68  std::cerr << HD->getName() << "makePlots<Plot1D>\n";
69 
70  // do not make any new plot if empty
71  if (HD->getIsEmpty()) {
72  HD->setResultImage("NoData_Results.gif");
73  HD->setResultTarget("NoData_Results.gif");
74  return;
75  }
76 
77  // get the reference and comparison histograms
78  TH1F *href = (TH1F *)HD->getRefHisto();
79  TH1F *hnew = (TH1F *)HD->getNewHisto();
80 
81  // set drawing options on the reference histogram
82  href->SetStats(false);
83  href->SetLineWidth(2);
84  href->SetLineColor(14);
85  href->SetMarkerColor(14);
86  href->SetFillColor(18);
87 
88  // set drawing options on the new histogram
89  hnew->SetStats(false);
90  hnew->SetLineWidth(2);
91  hnew->SetLineColor(HD->getShadedLineColor());
92  hnew->SetFillStyle(HD->getShadedFillStyle());
93  hnew->SetFillColor(HD->getShadedFillColor());
94 
95  // place the test results as the title
96  TString title = HD->getName();
97  if (ksThreshold > 0) {
98  title += " KS Score = ";
99  title += HD->getKSScore();
100  }
101  if (chi2Threshold > 0) {
102  title += " Chi^2 Score = ";
103  title += HD->getChi2Score();
104  }
105 
106  // the canvas is rescaled during gif conversion, so add padding to Canvas
107  // dimensions
108  int plotsCanvasWidth = plotsWidth + 4;
109  int plotsCanvasHeight = plotsHeight + 28;
110 
111  // setup canvas for displaying the compared histograms
112  TCanvas hCanvas("hCanvas", "hCanvas", plotsCanvasWidth, plotsCanvasHeight);
113  hCanvas.SetTopMargin(float(plotsTopMargin) / plotsHeight);
114  hCanvas.SetLeftMargin(float(plotsLeftMargin) / plotsWidth);
115  hCanvas.SetRightMargin(float(plotsRightMargin) / plotsWidth);
116  hCanvas.SetBottomMargin(float(plotsBottomMargin) / plotsHeight);
117  hCanvas.SetFrameFillColor(10);
118  hCanvas.SetGrid();
119  hCanvas.SetLogy(1);
120  hCanvas.Draw();
121 
122  TText canvasTitle(0.1, 0.97, title.Data());
123  canvasTitle.Draw("SAME");
124 
125  // draw the histograms
126  href->Draw();
127  hnew->Draw("SAME");
128  if (HD->getDoDrawErrorBars())
129  hnew->Draw("E1SAME");
130 
131  // draw a legend
132  TLegend legend(0.15, 0.01, 0.3, 0.08);
133  legend.AddEntry(hnew, "New", "lF");
134  legend.AddEntry(href, "Reference", "lF");
135  legend.SetFillColor(kNone);
136  legend.Draw("SAME");
137 
138  // create the plots overlay image
139  std::string gifName = HD->getName() + "_Results.gif";
140  if (HD->getResultImage().empty())
141  HD->setResultImage(gifName);
142  if (HD->getResultTarget().empty())
143  HD->setResultTarget(gifName);
144  std::cerr << "About to print" << gifName << "\n";
145  hCanvas.Print(gifName.c_str());
146 }
int getShadedFillColor() const
Definition: HistoData.h:51
float getChi2Score() const
Definition: HistoData.h:39
void setResultTarget(std::string Target)
Definition: HistoData.h:60
bool getIsEmpty() const
Definition: HistoData.h:43
TH1 * getNewHisto() const
Definition: HistoData.h:21
bool getDoDrawErrorBars() const
Definition: HistoData.h:27
TH1 * getRefHisto() const
Definition: HistoData.h:22
std::string getName() const
Definition: HistoData.h:17
std::string getResultImage() const
Definition: HistoData.h:23
void setResultImage(std::string Image)
Definition: HistoData.h:59
float getKSScore() const
Definition: HistoData.h:38
int getShadedLineColor() const
Definition: HistoData.h:50
std::string getResultTarget() const
Definition: HistoData.h:24
int getShadedFillStyle() const
Definition: HistoData.h:52

◆ makePlots() [2/4]

void PlotCompareUtility::makePlots ( HistoData )

◆ makePlots() [3/4]

template<int PlotType>
void PlotCompareUtility::makePlots ( HistoData )
private

◆ makePlots() [4/4]

template<>
void PlotCompareUtility::makePlots ( HistoData HD)
inlineprivate

Definition at line 146 of file Plot2D.h.

References postprocess-scan-build::href, createfilelist::int, Plot1D, amptDefault_cfi::proj, HistoData::setIsEmpty(), HistoData::setShadedFillColor(), HistoData::setShadedFillStyle(), HistoData::setShadedLineColor(), AlCaHLTBitMon_QueryRunRegistry::string, HLT_2022v15_cff::xAxis, multiplicitycorr_cfi::xMax, photonAnalyzer_cfi::xMin, HLT_2022v15_cff::yAxis, multiplicitycorr_cfi::yMax, and photonAnalyzer_cfi::yMin.

146  {
147  // do not make any new plot if empty
148  if (HD->getIsEmpty()) {
149  HD->setResultImage("NoData_Results.gif");
150  HD->setResultTarget("NoData_Results.gif");
151  return;
152  }
153 
154  // loop over the projections to make 1D plots
155  std::vector<HistoData>::iterator hd;
156  for (hd = projectionsX[HD].begin(); hd != projectionsX[HD].end(); hd++)
157  makePlots<Plot1D>(&(*hd));
158  for (hd = projectionsY[HD].begin(); hd != projectionsY[HD].end(); hd++)
159  makePlots<Plot1D>(&(*hd));
160 
161  // make projection summaries
162  for (int axis = axisX; axis <= axisY; ++axis) {
163  // get the list of projections associated with this HistoData
164  std::vector<HistoData> *proj = (axis == axisX) ? &projectionsX[HD] : &projectionsY[HD];
165  if (proj == nullptr || proj->empty())
166  continue;
167 
168  // get the 2d histograms
169  TH2F *hnew2d = (TH2F *)HD->getNewHisto();
170  TH2F *href2d = (TH2F *)HD->getRefHisto();
171 
172  // generate a reasonable width for the projections summary
173  int numHistos = proj->size();
174  int bodyWidth = int(float(numHistos * projectionsBarsThickness) * 1.5);
176 
177  // the canvas is rescaled during gif conversion, so add padding to Canvas
178  // dimensions
179  int projectionsCanvasWidth = projectionsWidth + 4;
180  int projectionsCanvasHeight = projectionsHeight + 28;
181 
182  // create and setup projections canvas
183  TCanvas projectionsCanvas(
184  "projectionsCanvas", "projectionsCanvas", projectionsCanvasWidth, projectionsCanvasHeight);
185  projectionsCanvas.SetFrameFillColor(10);
186  projectionsCanvas.SetLogy(1);
187  projectionsCanvas.SetTopMargin(float(projectionsTopMargin) / projectionsHeight);
188  projectionsCanvas.SetLeftMargin(float(projectionsLeftMargin) / projectionsWidth);
189  projectionsCanvas.SetRightMargin(float(projectionsRightMargin) / projectionsWidth);
190  projectionsCanvas.SetBottomMargin(float(projectionsBottomMargin) / projectionsHeight);
191  projectionsCanvas.Draw();
192 
193  // create and setup the summary histogram
194  TH1F projectionsSummary(
195  "projectionsSummary", "Compatibility with Reference Histograms", numHistos, 1, numHistos + 1);
196  projectionsSummary.GetYaxis()->SetRangeUser(getThreshold() / 10, 2);
197  projectionsSummary.SetStats(false);
198 
199  // display histogram (take axis from original histogram)
200  projectionsSummary.Draw("AH");
201 
202  // draw X axis
203  float xMin = hnew2d->GetXaxis()->GetXmin();
204  float xMax = hnew2d->GetXaxis()->GetXmax();
205  int ticksNDiv = numHistos * 20 + bodyWidth / 50; // formerly *20
206  TGaxis *xAxis = new TGaxis(1, 0, numHistos + 1, 0, xMin, xMax, ticksNDiv, "");
207  if (axis == axisX)
208  xAxis->SetTitle(hnew2d->GetYaxis()->GetTitle());
209  if (axis == axisY)
210  xAxis->SetTitle(hnew2d->GetXaxis()->GetTitle());
211  xAxis->Draw();
212 
213  // draw Y axis
214  float yMin = getThreshold() / 10;
215  float yMax = 2;
216  TGaxis *yAxis = new TGaxis(1, yMin, 1, yMax, yMin, yMax, 510, "G");
217  yAxis->SetTitle("Compatibility");
218  yAxis->Draw();
219 
220  // loop over projections and draw result
221  std::vector<HistoData>::iterator pd;
222  for (pd = proj->begin(); pd != proj->end(); pd++)
223  pd->drawResult(&projectionsSummary, true, false);
224 
225  // draw the pass/fail cutoff line
226  TLine passLine(1, getThreshold(), numHistos + 1, getThreshold());
227  passLine.SetLineColor(kRed);
228  passLine.SetLineWidth(2);
229  passLine.SetLineStyle(2);
230  passLine.Draw("SAME");
231 
232  // create the summary image
233  std::string gifName = HD->getName() + (axis == axisX ? "_Results_px.gif" : "_Results_py.gif");
234  projectionsCanvas.Print(gifName.c_str());
235 
236  // make overall projection plot of the original 2d histogram
237  std::string projName = HD->getName() + (axis == axisX ? "_py" : "_px");
238  std::string newBinsProj = projName + "_new";
239  std::string refBinsProj = projName + "_ref";
240  TH1D *href = (axis == axisX) ? href2d->ProjectionY(refBinsProj.c_str()) : href2d->ProjectionX(refBinsProj.c_str());
241  TH1D *hnew = (axis == axisX) ? hnew2d->ProjectionY(newBinsProj.c_str()) : hnew2d->ProjectionX(newBinsProj.c_str());
242 
243  // allow Root to delete these histograms after display
244  href->SetBit(kCanDelete);
245  hnew->SetBit(kCanDelete);
246 
247  // create a new HistoData based on this projection and plot it
248  HistoData allBins(projName, Plot1D, 0, hnew, href);
249  allBins.setIsEmpty(false);
250  allBins.setShadedFillColor(HD->getShadedFillColor());
251  allBins.setShadedFillStyle(HD->getShadedFillStyle());
252  allBins.setShadedLineColor(HD->getShadedLineColor());
253  makePlots<Plot1D>(&allBins);
254 
255  // set the default image (axisY takes priority by default)
256  if (HD->getResultImage().empty() || axis == axisY)
257  HD->setResultImage(projName + "_Results.gif");
258 
259  // set the default target (in case additional HTML code is/was not produced)
260  std::string currentTarget = HD->getResultTarget();
261  std::string xImgTarget = HD->getName() + "_px_Results.gif";
262  if (currentTarget.empty() || (axis == axisY && currentTarget == xImgTarget))
263  HD->setResultTarget(projName + "_Results.gif");
264  }
265 
266  /*
267  // make overall profile plot of the original 2d histogram
268  for (int axis = axisX; axis <= axisY; ++axis) {
269 
270  // make profile plots out of original 2D histograms
271  TProfile *pref = (axis == axisX) ? ((TH2F *)HD->getRefHisto())->ProfileY() :
272  ((TH2F *)HD->getRefHisto())->ProfileX(); TProfile *pnew = (axis == axisX) ?
273  ((TH2F *)HD->getNewHisto())->ProfileY() : ((TH2F
274  *)HD->getNewHisto())->ProfileX();
275 
276  // renormalize results for display
277  renormalize(pref,pnew);
278 
279  // do not allow Root to deallocate this memory after drawing (tries to free
280  twice?) pref->SetBit(kCanDelete); pnew->SetBit(kCanDelete);
281 
282  // set drawing options on the reference histogram
283  pref->SetStats(0);
284  pref->SetLineColor(kBlack);
285  pref->SetMarkerColor(kBlack);
286 
287  // set drawing options on the new histogram
288  pnew->SetStats(0);
289  pnew->SetLineColor(HD->getSolidLineColor());
290 
291  // place the test results as the title
292  TString title = HD->getName();
293 
294  // the canvas is rescaled during gif conversion, so add padding to Canvas
295  dimensions int plotsCanvasWidth = plotsWidth + 4; int plotsCanvasHeight =
296  plotsHeight + 28;
297 
298  // setup canvas for displaying the compared histograms
299  TCanvas hCanvas("hCanvas",title.Data(),plotsCanvasWidth,plotsCanvasHeight);
300  hCanvas.SetTopMargin(float(plotsTopMargin) / plotsHeight);
301  hCanvas.SetLeftMargin(float(plotsLeftMargin) / plotsWidth);
302  hCanvas.SetRightMargin(float(plotsRightMargin) / plotsWidth);
303  hCanvas.SetBottomMargin(float(plotsBottomMargin) / plotsHeight);
304  hCanvas.SetFrameFillColor(10);
305  hCanvas.SetGrid();
306  //hCanvas.SetLogy(1);
307  hCanvas.Draw();
308 
309  // draw the profiles
310  pref->Draw();
311  pnew->Draw("SAME");
312  if (HD->getDoDrawErrorBars()) pnew->Draw("E1SAME");
313 
314  // draw a legend
315  TLegend legend(0.15,0.01,0.3, 0.08);
316  legend.AddEntry(pnew,"New","lF");
317  legend.AddEntry(pref,"Reference","lF");
318  legend.SetFillColor(kNone);
319  legend.Draw("SAME");
320 
321  // create the plots overlay image
322  std::string gifName = HD->getName() + (axis == axisX ? "_pfx.gif" :
323  "_pfy.gif"); hCanvas.Print(gifName.c_str());
324 
325  // set the default image (axisY takes priority by default)
326  if (HD->getResultImage() == "" || axis == axisY)
327  HD->setResultImage(gifName);
328 
329  // set the default target (in case additional HTML code is/was not produced)
330  std::string currentTarget = HD->getResultTarget();
331  std::string xImgTarget = HD->getName() + "_pfx.gif";
332  if (currentTarget == "" || (axis == axisY && currentTarget == xImgTarget))
333  HD->setResultTarget(gifName);
334 
335  }
336  */
337 }
int getShadedFillColor() const
Definition: HistoData.h:51
void setResultTarget(std::string Target)
Definition: HistoData.h:60
bool getIsEmpty() const
Definition: HistoData.h:43
TH1 * getNewHisto() const
Definition: HistoData.h:21
std::map< HistoData *, std::vector< HistoData > > projectionsY
TH1 * getRefHisto() const
Definition: HistoData.h:22
std::string getName() const
Definition: HistoData.h:17
std::map< HistoData *, std::vector< HistoData > > projectionsX
std::string getResultImage() const
Definition: HistoData.h:23
void setResultImage(std::string Image)
Definition: HistoData.h:59
double getThreshold() const
int getShadedLineColor() const
Definition: HistoData.h:50
std::string getResultTarget() const
Definition: HistoData.h:24
int getShadedFillStyle() const
Definition: HistoData.h:52

◆ makeSummary()

void PlotCompareUtility::makeSummary ( std::string  Name)

◆ makeSummaryHTML()

void PlotCompareUtility::makeSummaryHTML ( std::string  Name)

◆ makeSummaryPlot()

void PlotCompareUtility::makeSummaryPlot ( std::string  Name)

◆ renormalize()

void PlotCompareUtility::renormalize ( TH1 *  ,
TH1 *   
)
private

◆ setChi2Threshold()

void PlotCompareUtility::setChi2Threshold ( double  Threshold)
inline

◆ setKSThreshold()

void PlotCompareUtility::setKSThreshold ( double  Threshold)
inline

◆ setPlotsBottomMargin()

void PlotCompareUtility::setPlotsBottomMargin ( int  Pixels)
inline

Definition at line 94 of file PlotCompareUtility.h.

References plotsBottomMargin.

94 { plotsBottomMargin = Pixels; }

◆ setPlotsHeight()

void PlotCompareUtility::setPlotsHeight ( int  Pixels)
inline

Definition at line 89 of file PlotCompareUtility.h.

References plotsHeight.

89 { plotsHeight = Pixels; }

◆ setPlotsLeftMargin()

void PlotCompareUtility::setPlotsLeftMargin ( int  Pixels)
inline

Definition at line 92 of file PlotCompareUtility.h.

References plotsLeftMargin.

92 { plotsLeftMargin = Pixels; }

◆ setPlotsRightMargin()

void PlotCompareUtility::setPlotsRightMargin ( int  Pixels)
inline

Definition at line 93 of file PlotCompareUtility.h.

References plotsRightMargin.

93 { plotsRightMargin = Pixels; }

◆ setPlotsTopMargin()

void PlotCompareUtility::setPlotsTopMargin ( int  Pixels)
inline

Definition at line 91 of file PlotCompareUtility.h.

References plotsTopMargin.

91 { plotsTopMargin = Pixels; }

◆ setPlotsWidth()

void PlotCompareUtility::setPlotsWidth ( int  Pixels)
inline

Definition at line 90 of file PlotCompareUtility.h.

References plotsWidth.

90 { plotsWidth = Pixels; }

◆ setProjectionsBarsThickness()

void PlotCompareUtility::setProjectionsBarsThickness ( int  Pixels)
inline

Definition at line 84 of file PlotCompareUtility.h.

References projectionsBarsThickness.

◆ setProjectionsBottomMargin()

void PlotCompareUtility::setProjectionsBottomMargin ( int  Pixels)
inline

Definition at line 88 of file PlotCompareUtility.h.

References projectionsBottomMargin.

◆ setProjectionsHeight()

void PlotCompareUtility::setProjectionsHeight ( int  Pixels)
inline

Definition at line 83 of file PlotCompareUtility.h.

References projectionsHeight.

83 { projectionsHeight = Pixels; }

◆ setProjectionsiWidth()

void PlotCompareUtility::setProjectionsiWidth ( int  Pixels)
inline

Definition at line 82 of file PlotCompareUtility.h.

References projectionsWidth.

82 { projectionsWidth = Pixels; }

◆ setProjectionsLeftMargin()

void PlotCompareUtility::setProjectionsLeftMargin ( int  Pixels)
inline

Definition at line 86 of file PlotCompareUtility.h.

References projectionsLeftMargin.

◆ setProjectionsRightMargin()

void PlotCompareUtility::setProjectionsRightMargin ( int  Pixels)
inline

Definition at line 87 of file PlotCompareUtility.h.

References projectionsRightMargin.

◆ setProjectionsTopMargin()

void PlotCompareUtility::setProjectionsTopMargin ( int  Pixels)
inline

Definition at line 85 of file PlotCompareUtility.h.

References projectionsTopMargin.

85 { projectionsTopMargin = Pixels; }

◆ setSummaryBarsThickness()

void PlotCompareUtility::setSummaryBarsThickness ( int  Pixels)
inline

Definition at line 77 of file PlotCompareUtility.h.

References summaryBarsThickness.

77 { summaryBarsThickness = Pixels; }

◆ setSummaryBottomMargin()

void PlotCompareUtility::setSummaryBottomMargin ( int  Pixels)
inline

Definition at line 81 of file PlotCompareUtility.h.

References summaryBottomMargin.

81 { summaryBottomMargin = Pixels; }

◆ setSummaryHeight()

void PlotCompareUtility::setSummaryHeight ( int  Pixels)
inline

Definition at line 76 of file PlotCompareUtility.h.

References summaryHeight.

76 { summaryHeight = Pixels; }

◆ setSummaryLeftMargin()

void PlotCompareUtility::setSummaryLeftMargin ( int  Pixels)
inline

Definition at line 79 of file PlotCompareUtility.h.

References summaryLeftMargin.

79 { summaryLeftMargin = Pixels; }

◆ setSummaryRightMargin()

void PlotCompareUtility::setSummaryRightMargin ( int  Pixels)
inline

Definition at line 80 of file PlotCompareUtility.h.

References summaryRightMargin.

80 { summaryRightMargin = Pixels; }

◆ setSummaryTopMargin()

void PlotCompareUtility::setSummaryTopMargin ( int  Pixels)
inline

Definition at line 78 of file PlotCompareUtility.h.

References summaryTopMargin.

78 { summaryTopMargin = Pixels; }

◆ setSummaryWidth()

void PlotCompareUtility::setSummaryWidth ( int  Pixels)
inline

Definition at line 75 of file PlotCompareUtility.h.

References summaryWidth.

75 { summaryWidth = Pixels; }

Member Data Documentation

◆ chi2Threshold

double PlotCompareUtility::chi2Threshold
private

Definition at line 137 of file PlotCompareUtility.h.

Referenced by getChi2Threshold(), and setChi2Threshold().

◆ finalResult

bool PlotCompareUtility::finalResult
private

Definition at line 176 of file PlotCompareUtility.h.

Referenced by getFinalResult().

◆ histos

std::vector<HistoData> PlotCompareUtility::histos
private

Definition at line 123 of file PlotCompareUtility.h.

Referenced by clearHistos(), getHistos(), and getNumHistos().

◆ ksThreshold

double PlotCompareUtility::ksThreshold
private

Definition at line 136 of file PlotCompareUtility.h.

Referenced by getKSThreshold(), and setKSThreshold().

◆ newBasePath

std::string PlotCompareUtility::newBasePath
private

Definition at line 130 of file PlotCompareUtility.h.

◆ newFile

TFile* PlotCompareUtility::newFile
private

Definition at line 129 of file PlotCompareUtility.h.

◆ newPrefix

std::string PlotCompareUtility::newPrefix
private

Definition at line 131 of file PlotCompareUtility.h.

◆ plotsBottomMargin

int PlotCompareUtility::plotsBottomMargin
private

Definition at line 173 of file PlotCompareUtility.h.

Referenced by getPlotsBottomMargin(), and setPlotsBottomMargin().

◆ plotsHeight

int PlotCompareUtility::plotsHeight
private

Definition at line 169 of file PlotCompareUtility.h.

Referenced by getPlotsHeight(), and setPlotsHeight().

◆ plotsLeftMargin

int PlotCompareUtility::plotsLeftMargin
private

Definition at line 171 of file PlotCompareUtility.h.

Referenced by getPlotsLeftMargin(), and setPlotsLeftMargin().

◆ plotsRightMargin

int PlotCompareUtility::plotsRightMargin
private

Definition at line 172 of file PlotCompareUtility.h.

Referenced by getPlotsRightMargin(), and setPlotsRightMargin().

◆ plotsTopMargin

int PlotCompareUtility::plotsTopMargin
private

Definition at line 170 of file PlotCompareUtility.h.

Referenced by getPlotsTopMargin(), and setPlotsTopMargin().

◆ plotsWidth

int PlotCompareUtility::plotsWidth
private

Definition at line 168 of file PlotCompareUtility.h.

Referenced by getPlotsWidth(), and setPlotsWidth().

◆ projectionsBarsThickness

int PlotCompareUtility::projectionsBarsThickness
private

◆ projectionsBottomMargin

int PlotCompareUtility::projectionsBottomMargin
private

Definition at line 165 of file PlotCompareUtility.h.

Referenced by getProjectionsBottomMargin(), and setProjectionsBottomMargin().

◆ projectionsHeight

int PlotCompareUtility::projectionsHeight
private

Definition at line 160 of file PlotCompareUtility.h.

Referenced by getProjectionsHeight(), and setProjectionsHeight().

◆ projectionsLeftMargin

int PlotCompareUtility::projectionsLeftMargin
private

Definition at line 163 of file PlotCompareUtility.h.

Referenced by getProjectionsLeftMargin(), and setProjectionsLeftMargin().

◆ projectionsRightMargin

int PlotCompareUtility::projectionsRightMargin
private

Definition at line 164 of file PlotCompareUtility.h.

Referenced by getProjectionsRightMargin(), and setProjectionsRightMargin().

◆ projectionsTopMargin

int PlotCompareUtility::projectionsTopMargin
private

Definition at line 162 of file PlotCompareUtility.h.

Referenced by getProjectionsTopMargin(), and setProjectionsTopMargin().

◆ projectionsWidth

int PlotCompareUtility::projectionsWidth
private

Definition at line 159 of file PlotCompareUtility.h.

Referenced by getProjectionsWidth(), and setProjectionsiWidth().

◆ projectionsX

std::map<HistoData *, std::vector<HistoData> > PlotCompareUtility::projectionsX
private

Definition at line 124 of file PlotCompareUtility.h.

Referenced by clearProjectionsX(), and getProjectionsX().

◆ projectionsY

std::map<HistoData *, std::vector<HistoData> > PlotCompareUtility::projectionsY
private

Definition at line 125 of file PlotCompareUtility.h.

Referenced by clearProjectionsY(), and getProjectionsY().

◆ refBasePath

std::string PlotCompareUtility::refBasePath
private

Definition at line 132 of file PlotCompareUtility.h.

◆ refFile

TFile* PlotCompareUtility::refFile
private

Definition at line 128 of file PlotCompareUtility.h.

◆ refPrefix

std::string PlotCompareUtility::refPrefix
private

Definition at line 133 of file PlotCompareUtility.h.

◆ summaryBarsThickness

int PlotCompareUtility::summaryBarsThickness
private

Definition at line 152 of file PlotCompareUtility.h.

Referenced by getSummaryBarsThickness(), and setSummaryBarsThickness().

◆ summaryBottomMargin

int PlotCompareUtility::summaryBottomMargin
private

Definition at line 156 of file PlotCompareUtility.h.

Referenced by getSummaryBottomMargin(), and setSummaryBottomMargin().

◆ summaryHeight

int PlotCompareUtility::summaryHeight
private

Definition at line 151 of file PlotCompareUtility.h.

Referenced by getSummaryHeight(), and setSummaryHeight().

◆ summaryLeftMargin

int PlotCompareUtility::summaryLeftMargin
private

Definition at line 154 of file PlotCompareUtility.h.

Referenced by getSummaryLeftMargin(), and setSummaryLeftMargin().

◆ summaryRightMargin

int PlotCompareUtility::summaryRightMargin
private

Definition at line 155 of file PlotCompareUtility.h.

Referenced by getSummaryRightMargin(), and setSummaryRightMargin().

◆ summaryTopMargin

int PlotCompareUtility::summaryTopMargin
private

Definition at line 153 of file PlotCompareUtility.h.

Referenced by getSummaryTopMargin(), and setSummaryTopMargin().

◆ summaryWidth

int PlotCompareUtility::summaryWidth
private

Definition at line 150 of file PlotCompareUtility.h.

Referenced by getSummaryWidth(), and setSummaryWidth().