Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:20

0001 #ifndef DrawPlot_h
0002 #define DrawPlot_h
0003 
0004 
0005 
0006 #include <vector>
0007 
0008 
0009 #include "TString.h"
0010 #include "TFile.h"
0011 #include "TTree.h"
0012 #include "TH1.h"
0013 #include "TLegend.h"
0014 
0015 
0016 class DrawPlot{
0017   public:
0018     DrawPlot(const unsigned int =0, const bool =true);
0019     ~DrawPlot();
0020     
0021     void setLegendEntry(const TString&, const TString&, const TString&);
0022     void setLegendCoordinate(const double, const double, const double, const double);
0023     void drawPlot(const TString&, const TString&, bool =true, bool =true);
0024     void drawTrackPlot(const TString&, const TString&, const bool =true, const bool =true);
0025     void drawEventPlot(const TString&, const TString&, const bool =true, const bool =true);
0026     
0027     void thesisMode(){thesisMode_ = true;}
0028     
0029   private:
0030     struct LegendEntries{
0031       LegendEntries(): legendEntry(""), legendEntryZeroApe(""), designLegendEntry(""){}
0032       TString legendEntry;
0033       TString legendEntryZeroApe;
0034       TString designLegendEntry;
0035     };
0036     
0037     void printHist(const TString&, const TString&, const bool, const bool);
0038     void scale(std::vector<TH1*>&, const double =1.)const;
0039     double maximumY(std::vector<TH1*>&)const;
0040     double minimumY(std::vector<TH1*>&)const;
0041     void setRangeUser(std::vector<TH1*>&, const double, const double)const;
0042     void setLineWidth(std::vector<TH1*>&, const unsigned int)const;
0043     void draw(std::vector<TH1*>&)const;
0044     void cleanup(std::vector<TH1*>&)const;
0045     
0046     LegendEntries adjustLegendEntry(const TString&, TH1*&, TH1*&, TH1*&);
0047     void adjustLegend(TLegend*&)const;
0048     
0049     
0050     const TString* outpath_;
0051     // File with distributions for result after iterations (final APE)
0052     TFile* file_;
0053     // File with distributions for result before iterations (APE=0)
0054     TFile* fileZeroApe_;
0055     // File with distributions for design geometry
0056     TFile* designFile_;
0057     // Only used when baseline should be drawn in residualWidth plot
0058     TTree* baselineTreeX_;
0059     TTree* baselineTreeY_;
0060     double* delta0_;
0061     
0062     // For setting legend in plots
0063     TString legendEntry_;
0064     TString legendEntryZeroApe_;
0065     TString designLegendEntry_;
0066     double legendXmin_;
0067     double legendYmin_;
0068     double legendXmax_;
0069     double legendYmax_;
0070     
0071     bool thesisMode_;
0072 };
0073 
0074 
0075 
0076 
0077 
0078 #endif
0079 
0080 
0081