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 
DrawPlot::adjustLegend
void adjustLegend(TLegend *&) const
DrawPlot::LegendEntries::legendEntryZeroApe
TString legendEntryZeroApe
Definition: DrawPlot.h:33
DrawPlot::thesisMode_
bool thesisMode_
Definition: DrawPlot.h:71
DrawPlot::~DrawPlot
~DrawPlot()
DrawPlot::drawEventPlot
void drawEventPlot(const TString &, const TString &, const bool=true, const bool=true)
DrawPlot::drawTrackPlot
void drawTrackPlot(const TString &, const TString &, const bool=true, const bool=true)
DrawPlot::LegendEntries::designLegendEntry
TString designLegendEntry
Definition: DrawPlot.h:34
DrawPlot::maximumY
double maximumY(std::vector< TH1 * > &) const
DrawPlot::designLegendEntry_
TString designLegendEntry_
Definition: DrawPlot.h:65
DrawPlot::LegendEntries
Definition: DrawPlot.h:30
DrawPlot::file_
TFile * file_
Definition: DrawPlot.h:52
DrawPlot::legendXmin_
double legendXmin_
Definition: DrawPlot.h:66
DrawPlot::legendEntryZeroApe_
TString legendEntryZeroApe_
Definition: DrawPlot.h:64
DrawPlot::cleanup
void cleanup(std::vector< TH1 * > &) const
DrawPlot::legendYmax_
double legendYmax_
Definition: DrawPlot.h:69
DrawPlot::thesisMode
void thesisMode()
Definition: DrawPlot.h:27
DrawPlot::drawPlot
void drawPlot(const TString &, const TString &, bool=true, bool=true)
DrawPlot::baselineTreeY_
TTree * baselineTreeY_
Definition: DrawPlot.h:59
DrawPlot::baselineTreeX_
TTree * baselineTreeX_
Definition: DrawPlot.h:58
DrawPlot::legendYmin_
double legendYmin_
Definition: DrawPlot.h:67
DrawPlot::LegendEntries::LegendEntries
LegendEntries()
Definition: DrawPlot.h:31
DrawPlot::setLegendCoordinate
void setLegendCoordinate(const double, const double, const double, const double)
DrawPlot::printHist
void printHist(const TString &, const TString &, const bool, const bool)
DrawPlot::setLineWidth
void setLineWidth(std::vector< TH1 * > &, const unsigned int) const
DrawPlot::setRangeUser
void setRangeUser(std::vector< TH1 * > &, const double, const double) const
DrawPlot::legendXmax_
double legendXmax_
Definition: DrawPlot.h:68
DrawPlot::delta0_
double * delta0_
Definition: DrawPlot.h:60
DrawPlot::adjustLegendEntry
LegendEntries adjustLegendEntry(const TString &, TH1 *&, TH1 *&, TH1 *&)
DrawPlot::outpath_
const TString * outpath_
Definition: DrawPlot.h:50
DrawPlot::scale
void scale(std::vector< TH1 * > &, const double=1.) const
DrawPlot::setLegendEntry
void setLegendEntry(const TString &, const TString &, const TString &)
DrawPlot::legendEntry_
TString legendEntry_
Definition: DrawPlot.h:63
DrawPlot::draw
void draw(std::vector< TH1 * > &) const
DrawPlot
Definition: DrawPlot.h:16
DrawPlot::designFile_
TFile * designFile_
Definition: DrawPlot.h:56
DrawPlot::LegendEntries::legendEntry
TString legendEntry
Definition: DrawPlot.h:32
DrawPlot::DrawPlot
DrawPlot(const unsigned int=0, const bool=true)
DrawPlot::minimumY
double minimumY(std::vector< TH1 * > &) const
DrawPlot::fileZeroApe_
TFile * fileZeroApe_
Definition: DrawPlot.h:54