ROOTPWA
plotSpinTotals.h
Go to the documentation of this file.
1 
2 //
3 // Copyright 2009 Sebastian Neubert
4 //
5 // This file is part of rootpwa
6 //
7 // rootpwa is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // rootpwa is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with rootpwa. If not, see <http://www.gnu.org/licenses/>.
19 //
21 //-----------------------------------------------------------
22 // File and Version Information:
23 // $Id$
24 //
25 // Description:
26 // Creates summary plots with intensities of spin totals
27 //
28 //
29 // Author List:
30 // Sebastian Neubert TUM (original author)
31 //
32 //
33 //-----------------------------------------------------------
34 
35 
36 #ifndef PLOTSPINTOTALS_HH
37 #define PLOTSPINTOTALS_HH
38 
39 
40 #include <string>
41 #include <vector>
42 
43 #include "TVirtualPad.h"
44 #include "TTree.h"
45 
46 using namespace std;
47 
48 
49 std::vector<std::pair<string, TVirtualPad*> >
50 plotSpinTotals(const unsigned int nmbTrees, // number of fitResult trees
51  TTree** trees, // array of fitResult trees
52  const int* colors = 0, // array of line and marker colors
53  const double yAxisRangeMax = 0, // if != 0; range of y-axis is limited to this value
54  const bool drawLegend = true, // if set legend is drawn
55  const std::string& outFileName = "spinTotals.root",
56  const std::string& branchName = "fitResult_v2");
57 
58 
59 std::vector<std::pair<string, TVirtualPad*> >
60 plotSpinTotals(std::vector<TTree*>& trees, // array of fitResult trees
61  const std::vector<int>& colors, // array of line and marker colors
62  const double yAxisRangeMax = 0, // if != 0; range of y-axis is limited to this value
63  const bool drawLegend = true, // if set legend is drawn
64  const std::string& outFileName = "spinTotals.root",
65  const std::string& branchName = "fitResult_v2")
66 {
67  return plotSpinTotals(trees.size(), &(*(trees.begin())), &(*(colors.begin())),
68  yAxisRangeMax, drawLegend, outFileName, branchName);
69 }
70 
71 
72 std::vector<std::pair<std::string, TVirtualPad*> >
73 plotSpinTotals(TTree* tree, // fitResult tree
74  const int color = kBlack, // color of line and marker
75  const double yAxisRangeMax = 0, // if != 0; range of y-axis is limited to this value
76  const bool drawLegend = true, // if set legend is drawn
77  const std::string& outFileName = "spinTotals.root",
78  const std::string& branchName = "fitResult_v2")
79 {
80  return plotSpinTotals(1, &tree, &color, yAxisRangeMax, drawLegend, outFileName, branchName);
81 }
82 
83 
84 #endif // PLOTSPINTOTALS_HH