ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPlots/Style/interface/HistStyles.h
Revision: 1.2
Committed: Tue Jan 25 11:30:31 2011 UTC (14 years, 3 months ago) by paus
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_029a, Mit_028, Mit_027, Mit_027a, HEAD
Changes since 1.1: +57 -0 lines
Log Message:
2nd try

File Contents

# User Rev Content
1 paus 1.2 //--------------------------------------------------------------------------------------------------
2     // $Id: HistStyles.h,v 1.1.2.2 2010/10/12 21:25:04 paus Exp $
3     //
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     #include <TH1.h>
17     #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     void Clear(); // clear Monte Carlo histogram style
33     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    
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    
44     void ApplyCurrentStyle(TH1 *h) const; // apply present Monte Carlo style
45     void ApplyDataStyle (TH1 *h) const; // apply present data style
46    
47     private:
48     // contents of the style
49     UInt_t fNStyles; // number of stored styles
50     UInt_t fIStyle; // index of present style
51     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