CMS 3D CMS Logo

DrawPlot.h
Go to the documentation of this file.
1 #ifndef DrawPlot_h
2 #define DrawPlot_h
3 
4 
5 
6 #include <vector>
7 
8 
9 #include "TString.h"
10 #include "TFile.h"
11 #include "TTree.h"
12 #include "TH1.h"
13 #include "TLegend.h"
14 
15 
16 class DrawPlot{
17  public:
18  DrawPlot(const unsigned int =0, const bool =true);
19  ~DrawPlot();
20 
21  void setLegendEntry(const TString&, const TString&, const TString&);
22  void setLegendCoordinate(const double, const double, const double, const double);
23  void drawPlot(const TString&, const TString&, bool =true, bool =true);
24  void drawTrackPlot(const TString&, const TString&, const bool =true, const bool =true);
25  void drawEventPlot(const TString&, const TString&, const bool =true, const bool =true);
26 
27  void thesisMode(){thesisMode_ = true;}
28 
29  private:
30  struct LegendEntries{
32  TString legendEntry;
35  };
36 
37  void printHist(const TString&, const TString&, const bool, const bool);
38  void scale(std::vector<TH1*>&, const double =1.)const;
39  double maximumY(std::vector<TH1*>&)const;
40  double minimumY(std::vector<TH1*>&)const;
41  void setRangeUser(std::vector<TH1*>&, const double, const double)const;
42  void setLineWidth(std::vector<TH1*>&, const unsigned int)const;
43  void draw(std::vector<TH1*>&)const;
44  void cleanup(std::vector<TH1*>&)const;
45 
46  LegendEntries adjustLegendEntry(const TString&, TH1*&, TH1*&, TH1*&);
47  void adjustLegend(TLegend*&)const;
48 
49 
50  const TString* outpath_;
51  // File with distributions for result after iterations (final APE)
52  TFile* file_;
53  // File with distributions for result before iterations (APE=0)
54  TFile* fileZeroApe_;
55  // File with distributions for design geometry
56  TFile* designFile_;
57  // Only used when baseline should be drawn in residualWidth plot
60  double* delta0_;
61 
62  // For setting legend in plots
63  TString legendEntry_;
66  double legendXmin_;
67  double legendYmin_;
68  double legendXmax_;
69  double legendYmax_;
70 
72 };
73 
74 
75 
76 
77 
78 #endif
79 
80 
81 
bool thesisMode_
Definition: DrawPlot.h:71
TFile * designFile_
Definition: DrawPlot.h:56
double legendYmin_
Definition: DrawPlot.h:67
void setRangeUser(std::vector< TH1 *> &, const double, const double) const
void thesisMode()
Definition: DrawPlot.h:27
double legendXmin_
Definition: DrawPlot.h:66
double * delta0_
Definition: DrawPlot.h:60
DrawPlot(const unsigned int=0, const bool=true)
TTree * baselineTreeX_
Definition: DrawPlot.h:58
TString designLegendEntry_
Definition: DrawPlot.h:65
void drawEventPlot(const TString &, const TString &, const bool=true, const bool=true)
LegendEntries adjustLegendEntry(const TString &, TH1 *&, TH1 *&, TH1 *&)
TString legendEntryZeroApe
Definition: DrawPlot.h:33
TFile * file_
Definition: DrawPlot.h:52
void setLegendCoordinate(const double, const double, const double, const double)
void setLineWidth(std::vector< TH1 *> &, const unsigned int) const
TString legendEntry_
Definition: DrawPlot.h:63
TString designLegendEntry
Definition: DrawPlot.h:34
void setLegendEntry(const TString &, const TString &, const TString &)
double legendYmax_
Definition: DrawPlot.h:69
double legendXmax_
Definition: DrawPlot.h:68
TFile * fileZeroApe_
Definition: DrawPlot.h:54
double minimumY(std::vector< TH1 *> &) const
void adjustLegend(TLegend *&) const
void cleanup(std::vector< TH1 *> &) const
void draw(std::vector< TH1 *> &) const
const TString * outpath_
Definition: DrawPlot.h:50
void drawTrackPlot(const TString &, const TString &, const bool=true, const bool=true)
void scale(std::vector< TH1 *> &, const double=1.) const
double maximumY(std::vector< TH1 *> &) const
TTree * baselineTreeY_
Definition: DrawPlot.h:59
void printHist(const TString &, const TString &, const bool, const bool)
void drawPlot(const TString &, const TString &, bool=true, bool=true)
TString legendEntryZeroApe_
Definition: DrawPlot.h:64