ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/IPHCalignment2/analysis/Layout.h
Revision: 1.1
Committed: Sun Nov 27 09:57:20 2011 UTC (13 years, 5 months ago) by econte
Content type: text/plain
Branch: MAIN
Log Message:
Layout add

File Contents

# User Rev Content
1 econte 1.1 #ifndef Layout_h
2     #define Layout_h
3    
4     #include <TROOT.h>
5     #include <TH1F.h>
6     #include <TCanvas.h>
7     #include <TLegend.h>
8     #include <THStack.h>
9     #include <TColor.h>
10    
11     #include <vector>
12     #include <string>
13     #include <sstream>
14    
15    
16     #include "histoAlgo.h"
17    
18    
19     class Layout
20     {
21     public:
22     Layout() { counter_=0;}
23     ~Layout() {}
24    
25     void Draw(const std::vector<HistoBlock>& histos,
26     std::string& xlabel, float K, float MU, float SIG);
27     void DrawInit();
28    
29     private:
30    
31     unsigned int counter_;
32    
33     // Give a unique string (for ROOT name object)
34     std::string dummy()
35     {
36     counter_++;
37     std::stringstream str;
38     str << counter_;
39     return "dummy_"+str.str();
40     }
41    
42     // Some change to be sure that the string could be a filename
43     std::string GetFileName(std::string name)
44     {
45     for (unsigned int i=0;i<name.size();i++)
46     {
47     if (name[i]=' ') name[i]='_';
48     if (name[i]='*') name[i]='_';
49     if (name[i]='/') name[i]='_';
50     if (name[i]='\\') name[i]='_';
51     }
52     return name;
53     }
54    
55     };
56    
57     #endif
58