CMS 3D CMS Logo

HistoData.h
Go to the documentation of this file.
1 #ifndef HISTO_DATA__H
2 #define HISTO_DATA__H
3 
4 #include <TFile.h>
5 #include <TH1.h>
6 #include <cstring>
7 #include <string>
8 
9 class HistoData {
10 public:
11  HistoData(
12  std::string Name, int PlotType, int Bin, std::string NewPath, TFile *NewFile, std::string RefPath, TFile *RefFile);
13  HistoData(std::string Name, int PlotType, int Bin, TH1 *NewHisto, TH1 *RefHisto);
14  virtual ~HistoData() {}
15 
16  // Get General Information
17  std::string getName() const { return name; }
18  // PlotType getType() const { return type; }
19  int getType() const { return type; }
20  int getBin() const { return bin; }
21  TH1 *getNewHisto() const { return newHisto; }
22  TH1 *getRefHisto() const { return refHisto; }
25 
26  // Projections/Rebinning Getters
27  bool getDoDrawErrorBars() const { return doDrawErrorBars; }
28  bool getDoAllow1DRebinning() const { return doAllow1DRebinning; }
31  bool getDoProjectionsX() const { return doProjectionsX; }
32  bool getDoProjectionsY() const { return doProjectionsY; }
33  int getMaxProjectionsX() const { return maxProjectionsX; }
34  int getMaxProjectionsY() const { return maxProjectionsY; }
35 
36  // Get Test Results
37  bool comparisonSuccess() const { return lowScore != 10 && !isEmpty; }
38  float getKSScore() const { return ksScore; }
39  float getChi2Score() const { return chi2Score; }
40  float getLowScore() const { return lowScore; }
41  float getHighScore() const { return highScore; }
42  bool getResult() const { return result; }
43  bool getIsEmpty() const { return isEmpty; }
44 
45  // Get Visual Attributes
46  bool getLineUseFillColor() const { return lineUseFillColor; }
48  int getSolidFillColor() const { return solidFillColor; }
49  int getSolidFillStyle() const { return solidFillStyle; }
51  int getShadedFillColor() const { return shadedFillColor; }
52  int getShadedFillStyle() const { return shadedFillStyle; }
53 
54  // Set General Information
56  // void setType(PlotType Type) { type = Type; }
57  void setType(int PlotType) { type = PlotType; }
58  void setBin(int Bin) { bin = Bin; }
59  void setResultImage(std::string Image) { resultImage = Image; }
61 
62  // Projections/Rebinning Setters
63  void setDoDrawErrorBars(bool Toggle) { doDrawErrorBars = Toggle; }
64  void setDoAllow1DRebinning(bool Toggle) { doAllow1DRebinning = Toggle; }
65  void setDoAllow2DRebinningX(bool Toggle) { doAllow2DRebinningX = Toggle; }
66  void setDoAllow2DRebinningY(bool Toggle) { doAllow2DRebinningY = Toggle; }
67  void setDoProjectionsX(bool Toggle) { doProjectionsX = Toggle; }
68  void setDoProjectionsY(bool Toggle) { doProjectionsY = Toggle; }
69  void setMaxProjections(int Num) {
70  maxProjectionsX = Num;
71  maxProjectionsY = Num;
72  }
73  void setMaxProjectionsX(bool Num) { maxProjectionsX = Num; }
74  void setMaxProjectionsY(bool Num) { maxProjectionsY = Num; }
75 
76  // Set Test Results
77  void setKSScore(float Score) { ksScore = Score; }
78  void setChi2Score(float Score) { chi2Score = Score; }
79  void setLowScore(float Score) { lowScore = Score; }
80  void setHighScore(float Score) { highScore = Score; }
81  void setResult(bool Result); // also sets display colors
82  void setIsEmpty(bool Toggle) { isEmpty = Toggle; }
83 
84  // Set Visual Attributes
85  void setLineUseFillColor(bool Toggle) { lineUseFillColor = Toggle; }
86  void setSolidLineColor(int Color) { solidLineColor = Color; }
87  void setSolidFillColor(int Color) { solidFillColor = Color; }
89  void setShadedLineColor(int Color) { shadedLineColor = Color; }
90  void setShadedFillColor(int Color) { shadedFillColor = Color; }
92 
93  // Misc Functions
94  void drawResult(TH1 *Summary, bool Vertical = true, bool SetLabels = false);
95  void clear() {
96  newHisto->Clear();
97  refHisto->Clear();
98  };
99  inline void dump();
100 
101 private:
102  // Misc. Data
104  // PlotType type;
105  int type;
106  int bin;
107  TH1 *newHisto;
108  TH1 *refHisto;
113 
114  // 2D data members
121 
122  // Scores/Results
123  float ksScore;
124  float chi2Score;
125  float lowScore;
126  float highScore;
127  bool result;
128  bool isEmpty;
129 
130  // Attributes of Results Display
135 
136  // Implementation Function
137  void initialize();
138 };
139 
140 #endif // HISTO_DATA__H
HistoData::errorColor
int errorColor
Definition: HistoData.h:131
HistoData::doProjectionsX
bool doProjectionsX
Definition: HistoData.h:119
HistoData::getResultTarget
std::string getResultTarget() const
Definition: HistoData.h:24
HistoData::setResultImage
void setResultImage(std::string Image)
Definition: HistoData.h:59
Target
TFile * Target
Definition: compareAlignments.cc:26
HistoData::resultImage
std::string resultImage
Definition: HistoData.h:109
HistoData::setMaxProjectionsY
void setMaxProjectionsY(bool Num)
Definition: HistoData.h:74
HistoData::getKSScore
float getKSScore() const
Definition: HistoData.h:38
HistoData::getRefHisto
TH1 * getRefHisto() const
Definition: HistoData.h:22
HistoData::getIsEmpty
bool getIsEmpty() const
Definition: HistoData.h:43
SiStripClientConfig_Tier0_cff.Name
Name
Definition: SiStripClientConfig_Tier0_cff.py:13
HistoData::getResult
bool getResult() const
Definition: HistoData.h:42
HistoData::name
std::string name
Definition: HistoData.h:103
HistoData::setDoProjectionsY
void setDoProjectionsY(bool Toggle)
Definition: HistoData.h:68
HistoData::setHighScore
void setHighScore(float Score)
Definition: HistoData.h:80
HistoData::bin
int bin
Definition: HistoData.h:106
HistoData::getDoProjectionsX
bool getDoProjectionsX() const
Definition: HistoData.h:31
HistoData::setDoAllow2DRebinningX
void setDoAllow2DRebinningX(bool Toggle)
Definition: HistoData.h:65
HistoData::setDoAllow2DRebinningY
void setDoAllow2DRebinningY(bool Toggle)
Definition: HistoData.h:66
HistoData::getShadedFillStyle
int getShadedFillStyle() const
Definition: HistoData.h:52
HistoData::getSolidFillColor
int getSolidFillColor() const
Definition: HistoData.h:48
HistoData::passColor
int passColor
Definition: HistoData.h:131
HistoData::doDrawErrorBars
bool doDrawErrorBars
Definition: HistoData.h:112
HistoData::chi2Score
float chi2Score
Definition: HistoData.h:124
HistoData::highScore
float highScore
Definition: HistoData.h:126
HistoData::setSolidFillStyle
void setSolidFillStyle(int Style)
Definition: HistoData.h:88
HistoData::getLineUseFillColor
bool getLineUseFillColor() const
Definition: HistoData.h:46
HistoData::getSolidFillStyle
int getSolidFillStyle() const
Definition: HistoData.h:49
HistoData::setShadedLineColor
void setShadedLineColor(int Color)
Definition: HistoData.h:89
HistoData::shadedFillStyle
int shadedFillStyle
Definition: HistoData.h:133
HistoData::setName
void setName(std::string Name)
Definition: HistoData.h:55
HistoData::setDoAllow1DRebinning
void setDoAllow1DRebinning(bool Toggle)
Definition: HistoData.h:64
HistoData::setBin
void setBin(int Bin)
Definition: HistoData.h:58
HistoData::maxProjectionsX
int maxProjectionsX
Definition: HistoData.h:117
HistoData::drawResult
void drawResult(TH1 *Summary, bool Vertical=true, bool SetLabels=false)
HistoData::isEmpty
bool isEmpty
Definition: HistoData.h:128
HistoData::getChi2Score
float getChi2Score() const
Definition: HistoData.h:39
HistoData::maxProjectionsY
int maxProjectionsY
Definition: HistoData.h:118
HistoData::doProjectionsY
bool doProjectionsY
Definition: HistoData.h:120
HistoData::setLineUseFillColor
void setLineUseFillColor(bool Toggle)
Definition: HistoData.h:85
HistoData::setLowScore
void setLowScore(float Score)
Definition: HistoData.h:79
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HistoData::solidFillStyle
int solidFillStyle
Definition: HistoData.h:132
HistoData::getNewHisto
TH1 * getNewHisto() const
Definition: HistoData.h:21
HistoData::setDoProjectionsX
void setDoProjectionsX(bool Toggle)
Definition: HistoData.h:67
HistoData::getName
std::string getName() const
Definition: HistoData.h:17
HistoData::type
int type
Definition: HistoData.h:105
HistoData::getHighScore
float getHighScore() const
Definition: HistoData.h:41
HistoData::solidLineColor
int solidLineColor
Definition: HistoData.h:132
HistoData
Definition: HistoData.h:9
Style
Definition: Style.py:1
HistoData::ksScore
float ksScore
Definition: HistoData.h:123
HistoData::setResultTarget
void setResultTarget(std::string Target)
Definition: HistoData.h:60
HistoData::refHisto
TH1 * refHisto
Definition: HistoData.h:108
HistoData::comparisonSuccess
bool comparisonSuccess() const
Definition: HistoData.h:37
HistoData::getLowScore
float getLowScore() const
Definition: HistoData.h:40
HistoData::getMaxProjectionsX
int getMaxProjectionsX() const
Definition: HistoData.h:33
HistoData::getDoAllow2DRebinningX
bool getDoAllow2DRebinningX() const
Definition: HistoData.h:29
HistoData::setMaxProjectionsX
void setMaxProjectionsX(bool Num)
Definition: HistoData.h:73
HistoData::getType
int getType() const
Definition: HistoData.h:19
HistoData::getBin
int getBin() const
Definition: HistoData.h:20
HistoData::lowScore
float lowScore
Definition: HistoData.h:125
HistoData::getDoAllow2DRebinningY
bool getDoAllow2DRebinningY() const
Definition: HistoData.h:30
HistoData::getDoAllow1DRebinning
bool getDoAllow1DRebinning() const
Definition: HistoData.h:28
HistoData::initialize
void initialize()
type
type
Definition: HCALResponse.h:21
HistoData::failColor
int failColor
Definition: HistoData.h:131
HistoData::lineUseFillColor
bool lineUseFillColor
Definition: HistoData.h:134
hlx_dqm_sourceclient_cfi.Style
Style
Definition: hlx_dqm_sourceclient_cfi.py:9
HistoData::solidFillColor
int solidFillColor
Definition: HistoData.h:132
HistoData::setSolidFillColor
void setSolidFillColor(int Color)
Definition: HistoData.h:87
HistoData::setDoDrawErrorBars
void setDoDrawErrorBars(bool Toggle)
Definition: HistoData.h:63
HistoData::doAllow2DRebinningX
bool doAllow2DRebinningX
Definition: HistoData.h:115
HistoData::getShadedFillColor
int getShadedFillColor() const
Definition: HistoData.h:51
HistoData::setType
void setType(int PlotType)
Definition: HistoData.h:57
HistoData::doAllow2DRebinningY
bool doAllow2DRebinningY
Definition: HistoData.h:116
HistoData::getDoProjectionsY
bool getDoProjectionsY() const
Definition: HistoData.h:32
HistoData::setChi2Score
void setChi2Score(float Score)
Definition: HistoData.h:78
EcalCondDBWriter_cfi.Summary
Summary
Definition: EcalCondDBWriter_cfi.py:155
HistoData::setIsEmpty
void setIsEmpty(bool Toggle)
Definition: HistoData.h:82
HistoData::setKSScore
void setKSScore(float Score)
Definition: HistoData.h:77
HistoData::~HistoData
virtual ~HistoData()
Definition: HistoData.h:14
PlotType
PlotType
Definition: trackSplitPlot.h:33
HistoData::HistoData
HistoData(std::string Name, int PlotType, int Bin, std::string NewPath, TFile *NewFile, std::string RefPath, TFile *RefFile)
HistoData::resultTarget
std::string resultTarget
Definition: HistoData.h:110
HistoData::newHisto
TH1 * newHisto
Definition: HistoData.h:107
HistoData::doAllow1DRebinning
bool doAllow1DRebinning
Definition: HistoData.h:111
HistoData::result
bool result
Definition: HistoData.h:127
HistoData::getShadedLineColor
int getShadedLineColor() const
Definition: HistoData.h:50
HistoData::setResult
void setResult(bool Result)
HistoData::setSolidLineColor
void setSolidLineColor(int Color)
Definition: HistoData.h:86
HistoData::dump
void dump()
HistoData::shadedFillColor
int shadedFillColor
Definition: HistoData.h:133
HistoData::setMaxProjections
void setMaxProjections(int Num)
Definition: HistoData.h:69
HistoData::getResultImage
std::string getResultImage() const
Definition: HistoData.h:23
HistoData::getMaxProjectionsY
int getMaxProjectionsY() const
Definition: HistoData.h:34
HistoData::setShadedFillColor
void setShadedFillColor(int Color)
Definition: HistoData.h:90
HistoData::setShadedFillStyle
void setShadedFillStyle(int Style)
Definition: HistoData.h:91
HistoData::clear
void clear()
Definition: HistoData.h:95
HistoData::shadedLineColor
int shadedLineColor
Definition: HistoData.h:133
HistoData::getSolidLineColor
int getSolidLineColor() const
Definition: HistoData.h:47
HistoData::getDoDrawErrorBars
bool getDoDrawErrorBars() const
Definition: HistoData.h:27