ROOTPWA
plotAllIntensities.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 // Draws intensity graph for single wave from tree.
27 //
28 //
29 // Author List:
30 // Sebastian Neubert TUM (original author)
31 //
32 //
33 //-----------------------------------------------------------
34 
35 
36 //
37 // plots all waves of all trees sorted by JPC and intensity and
38 // returns a list of wave names and pointers to the pads they were
39 // drawn into
40 // the intensity sorting is performed w.r.t. the first tree
41 //
42 
43 
44 #ifndef PLOTALLINTENSITIES_HH
45 #define PLOTALLINTENSITIES_HH
46 
47 
48 #include <string>
49 #include <vector>
50 
51 #include "TVirtualPad.h"
52 #include "TTree.h"
53 
54 using namespace std;
55 
56 
57 std::vector<std::pair<std::string, TVirtualPad*> >
58 plotAllIntensities(const unsigned int nmbTrees, // number of fitResult trees
59  TTree** trees, // array of fitResult trees
60  const bool createPsFile = false, // if true, plots are written to waves.ps
61  const std::string& outPath = "./", // path for output files
62  const int* graphColors = NULL, // array of colors for graph line and marker
63  const double* graphScales = NULL, // array of scales for graph scaling (scales all graphs of one tree)
64  const bool drawLegend = true, // if set legend is drawn
65  const double yAxisRangeMax = 0, // if != 0; range of y-axis is limited to this value
66  const string& branchName = "fitResult_v2");
67 
68 inline
69 std::vector<std::pair<std::string, TVirtualPad*> >
70 plotAllIntensities(TTree* tree, // fitResult tree
71  const bool createPsFile = false, // if true, plots are written to waves.ps
72  const std::string& outPath = "./", // path for output files
73  const double yAxisRangeMax = 0, // if != 0; range of y-axis is limited to this value
74  const string& branchName = "fitResult_v2")
75 {
76  return plotAllIntensities(1, &tree, createPsFile, outPath, NULL, NULL, false, yAxisRangeMax, branchName);
77 }
78 
79 
80 inline
81 std::vector<std::pair<std::string, TVirtualPad*> >
82 plotAllIntensities(std::vector<TTree*>& trees, // vector of fitResult trees
83  const bool createPsFile = false, // if true, plots are written to waves.ps
84  const std::string& outPath = "./", // path for output files
85  const std::vector<int>& graphColors = std::vector<int>(), // vector of colors for graph line and marker
86  const std::vector<double>& graphScales = std::vector<double>(), // vector of scales for graphs
87  const bool drawLegend = true, // if set legend is drawn
88  const double yAxisRangeMax = 0, // if != 0; range of y-axis is limited to this value
89  const string& branchName = "fitResult_v2")
90 {
91  return plotAllIntensities(trees.size(), &(*(trees.begin())), createPsFile, outPath,
92  &(*(graphColors.begin())), &(*(graphScales.begin())), drawLegend, yAxisRangeMax, branchName);
93 }
94 
95 
96 #endif // PLOTALLINTENSITIES_HH