Crombie Tools
QuickPlot.h
Go to the documentation of this file.
1 /**
2  @file QuickPlot.h
3  Definition of QuickPlot class.
4  @author Daniel Abercrombie <dabercro@mit.edu>
5 */
6 
7 
8 #ifndef CROMBIETOOLS_PLOTTOOLS_QUICKPLOT_H
9 #define CROMBIETOOLS_PLOTTOOLS_QUICKPLOT_H
10 
11 #include <vector>
12 
13 #include "TString.h"
14 
15 #include "FileConfigReader.h"
16 
17 /**
18  @ingroup plotgroup
19  @class QuickPlot
20  A less flexible class that quickly compares shapes from the MCConfig.
21  This class is accessed through CrombieTools.PlotTools.QuickPlot.
22 */
23 
25 {
26  public:
27  QuickPlot();
28  virtual ~QuickPlot();
29 
30  /**
31  Add a MC contributer to the plots that will be shown.
32  @param entry is the legend entry in the MC Config.
33  @param color is the color to draw the line
34  @param type is the FileType where the FileInfo will be found.
35  */
36  void AddBackground ( TString entry, Color_t color, FileType type = kBackground );
37 
38  /// Make canvas using an array
39  void MakeCanvas ( TString FileBase, Int_t NumXBins, Double_t *XBins,
40  TString XLabel, TString = "", Bool_t logY = false);
41 
42  /// Make canvas using regular binning
43  void MakeCanvas ( TString FileBase, Int_t NumXBins, Double_t MinX, Double_t MaxX,
44  TString XLabel, TString = "", Bool_t logY = false);
45 
46  /// Reset the stored backgrounds to make a different plot
47  void Reset () { ResetLegend(); fBackgroundType.resize(0); }
48 
49  /// If this is false, the plots are not normalized at the end, so the shape is not as easily compared
50  void SetCompareShapes ( bool compare ) { bCompareShapes = compare; }
51 
52  private:
53  std::vector<FileType> fBackgroundType; ///< FileType for each background to plot
54  bool bCompareShapes = true; ///< Bool to tell whether to compare shapes by normalizing plots
55 
56  ClassDef(QuickPlot, 1)
57 };
58 
59 #endif