ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Plot/interface/PlotTask.h
Revision: 1.2
Committed: Sun Oct 3 03:45:46 2010 UTC (14 years, 6 months ago) by paus
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
State: FILE REMOVED
Log Message:
Error in cvs use.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: PlotTask.h,v 1.1 2010/10/03 03:40:00 paus Exp $
3 //
4 // PlotTask
5 //
6 // This class implements PlotTask which allows to plot the samples with various options.
7 //
8 // Authors: C.Paus
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITPLOTS_PLOT_PLOTTASK_H
12 #define MITPLOTS_PLOT_PLOTTASK_H
13
14 #include <TH1D.h>
15 #include "MitPlots/Input/interface/TaskSamples.h"
16
17 namespace mithep
18 {
19 class PlotTask
20 {
21 public:
22 PlotTask(const TaskSamples *taskSamples, const double lumi);
23 ~PlotTask();
24
25 void SetHistMinimum (double min) { fHistMinimum = min; }
26 void SetHistMaximum (double max) { fHistMaximum = max; }
27 void SetAxisTitles (const char* xtit, const char* ytit = "Number of Events");
28 void SetXLegend (double x) { fXLegend = x; }
29 void SetYLegend (double y) { fYLegend = y; }
30 void SetNRebin (UInt_t n) { fNRebin = n; }
31
32 private:
33 // Overlay the contribution in a single histogram (no adding/stacking)
34 void PlotContributions(const char* dir, const char* hist);
35 void PlotStack (const char* dir, const char* hist);
36
37 // Basic function to perfrom all reading and scaling operations
38 void ScaleHistograms (const char* dir, const char* hist);
39
40 // Helper to set scale for a histogram
41 void FindHistMaximum ();
42 void OverlayFrame () const;
43 void OverlayEmptyHist () const;
44
45 const TaskSamples *fTask; // analysis task to be plotted
46 const double fTargetLumi; // target luminosity for task
47
48 UInt_t fIdxHistMax; // index of histogram with maximum entry
49 UInt_t fNRebin; // rebin parameter (default is 1)
50 TH1D* fEmptyHist; // empty identical histogram
51 TH1D* fDataHist; // data histogram if it exists
52 double fHistMaximum; // histogram minimum to be displayed
53 double fHistMinimum; // histogram minimum to be displayed
54 TString fAxisTitleX; // x axis title
55 TString fAxisTitleY; // y axis title
56 double fXLegend; // x position of upper left legend box
57 double fYLegend; // y position of upper left legend box
58 std::vector<TH1D*> fHists; // list of scaled histograms
59 std::vector<TH1D*> fStackedHists; // list of scaled histograms
60
61 ClassDef(PlotTask, 0) // PlotTask plots analysis task with various options
62 };
63 }
64 #endif