47 #include "reportingUtils.hpp"
60 plot4(
const unsigned int nmbTrees,
64 const bool saveEps =
false,
65 const int* graphColors = NULL,
66 const double* graphScales = NULL,
67 const bool drawLegend =
true,
68 const std::string& graphTitle =
"",
69 const char* drawOption =
"AP",
70 const double massMin = 0,
71 const double massMax = 0,
72 const string& branchName =
"fitResult_v2",
73 TCanvas* canvas = NULL)
75 for (
unsigned int i = 0;
i < nmbTrees; ++
i)
77 printErr <<
"null pointer to tree[" << i <<
"]. aborting." << endl;
82 stringstream selectExpr;
83 if ((massMin != 0) || (massMax != 0))
84 selectExpr <<
"(massBinCenter() >= "<< massMin * 1000 <<
") "
85 <<
"&& (massBinCenter() <= " << massMax * 1000 <<
")";
87 stringstream canvName;
88 canvName <<
"4plot_" << waveIndexA <<
"_" << waveIndexB;
91 canvas =
new TCanvas(canvName.str().c_str(), canvName.str().c_str(), 10, 10, 1000, 800);
93 canvas->SetName(canvName.str().c_str());
94 canvas->SetTitle(canvName.str().c_str());
95 canvas->SetCanvasSize(1000, 800);
101 plotIntensity(nmbTrees, trees, waveIndexA,
false, graphColors, graphScales, drawLegend,
102 graphTitle, drawOption, 1, 0, selectExpr.str(), branchName);
105 plotPhase(nmbTrees, trees, waveIndexA, waveIndexB,
false, graphColors, drawLegend,
106 graphTitle, drawOption, selectExpr.str(), branchName);
109 plotIntensity(nmbTrees, trees, waveIndexB,
false, graphColors, graphScales, drawLegend,
110 graphTitle, drawOption, 1, 0, selectExpr.str(), branchName);
113 plotCoherence(nmbTrees, trees, waveIndexA, waveIndexB,
false, graphColors, drawLegend,
114 graphTitle, drawOption, selectExpr.str(), branchName);
118 gPad->SaveAs(((
string)canvas->GetName() +
".eps").c_str());
124 const int waveIndexA,
125 const int waveIndexB,
126 const bool saveEps =
false,
127 const int graphColor = kBlack,
128 const bool drawLegend =
false,
129 const string& graphTitle =
"",
130 const char* drawOption =
"AP",
131 const double massMin = 0,
132 const double massMax = 0,
133 const string& branchName =
"fitResult_v2",
134 TCanvas* canvas = NULL)
136 plot4(1, &tree, waveIndexA, waveIndexB, saveEps, &graphColor, NULL, drawLegend,
137 graphTitle, drawOption, massMin, massMax, branchName, canvas);
146 const string& waveNameA,
147 const string& waveNameB,
148 const bool saveEps =
false,
149 const int* graphColors = NULL,
150 const double* graphScales = NULL,
151 const bool drawLegend =
true,
152 const std::string& graphTitle =
"",
153 const char* drawOption =
"AP",
154 const double massMin = 0,
155 const double massMax = 0,
156 const string& branchName =
"fitResult_v2")
159 printErr <<
"null pointer to tree. exiting." << endl;
164 trees[0]->SetBranchAddress(branchName.c_str(), &massBin);
165 trees[0]->GetEntry(0);
166 const int indexA = massBin->
waveIndex(waveNameA);
167 const int indexB = massBin->
waveIndex(waveNameB);
168 if ((indexA >= 0) && (indexB >= 0))
169 return plot4(nmbTrees, trees, indexA, indexB, saveEps, graphColors, graphScales, drawLegend,
170 graphTitle, drawOption, massMin, massMax, branchName);
171 printErr <<
"cannot find wave(s) in tree '" << trees[0]->GetName() <<
"'. exiting." << endl;
177 const string& waveNameA,
178 const string& waveNameB,
179 const bool saveEps =
false,
180 const int graphColor = kBlack,
181 const bool drawLegend =
false,
182 const string& graphTitle =
"",
183 const char* drawOption =
"AP",
184 const double massMin = 0,
185 const double massMax = 0,
186 const string& branchName =
"fitResult_v2")
188 plot4(1, &tree, waveNameA, waveNameB, saveEps, &graphColor, NULL, drawLegend,
189 graphTitle, drawOption, massMin, massMax, branchName);