ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPlots/Style/interface/HistStyles.h
Revision: 1.1.2.2
Committed: Tue Oct 12 21:25:04 2010 UTC (14 years, 7 months ago) by paus
Content type: text/plain
Branch: Mit_014e
Changes since 1.1.2.1: +13 -1 lines
Log Message:
Automatic plot style now used in PlotTask.

File Contents

# User Rev Content
1 paus 1.1.2.1 //--------------------------------------------------------------------------------------------------
2 paus 1.1.2.2 // $Id: HistStyles.h,v 1.1.2.1 2010/10/03 04:08:49 paus Exp $
3 paus 1.1.2.1 //
4     // HistStyles
5     //
6     // This class implements HistStyles which is just a list of histogram and text styles needed to
7     // style a plot in PlotTask. There is a predefined default set of styles and there is a series of
8     // styles which can be defined by the user.
9     //
10     // Authors: C.Paus
11     //--------------------------------------------------------------------------------------------------
12    
13     #ifndef MITPLOTS_STYLE_HISTSTYLES_H
14     #define MITPLOTS_STYLE_HISTSTYLES_H
15    
16 paus 1.1.2.2 #include <TH1.h>
17 paus 1.1.2.1 #include <vector>
18     #include "MitPlots/Style/interface/HistStyle.h"
19    
20     namespace mithep
21     {
22     class HistStyles
23     {
24     public:
25     HistStyles();
26     ~HistStyles() {}
27     // access to the the style contents
28     const UInt_t *NStyles () const { return &fNStyles; }
29     const HistStyle *GetStyle(UInt_t i) const; // return 'i'th Monte Carlo style
30     const HistStyle *GetDataStyle() const; // return the data style
31     // add styles
32 paus 1.1.2.2 void Clear(); // clear Monte Carlo histogram style
33 paus 1.1.2.1 HistStyle *AddStyle(); // add another Monte Carlo histogram style
34     HistStyle *SetDataStyle(); // add the data histogram style
35     // helpers
36     void Show() const; // show style list properties
37 paus 1.1.2.2
38     // for looping
39     const HistStyle *CurrentStyle() const; // return the present Monte Carlo style
40     void NextStyle(); // return the next Monte Carlo style
41     void PreviousStyle(); // return the previous Monte Carlo style
42     void ResetStyle(); // return the first Monte Carlo style
43 paus 1.1.2.1
44 paus 1.1.2.2 void ApplyCurrentStyle(TH1 *h) const; // apply present Monte Carlo style
45     void ApplyDataStyle (TH1 *h) const; // apply present data style
46    
47 paus 1.1.2.1 private:
48     // contents of the style
49     UInt_t fNStyles; // number of stored styles
50 paus 1.1.2.2 UInt_t fIStyle; // index of present style
51 paus 1.1.2.1 std::vector<HistStyle> fStyles; // list of styles
52     HistStyle *fDataStyle; // data sample style
53    
54     ClassDef(HistStyles, 0) // Interface to HistStyles
55     };
56     }
57     #endif