52 const std::string& overRideName,
53 const std::string& overRideTitle)
55 TH1* result =
nullptr;
56 const int nDimensions = definition->nDimensions;
87 throw RBDSException(
"HistogramFactory::CreateHistogram>",
"Not compiled with BOOST libraries - no 4D histograms.");
109 const std::string& overRideName,
110 const std::string& overRideTitle)
112 TH1D* result =
nullptr;
113 std::string name = d->histName;
114 std::string title = name;
118 {result =
new TH1D(name.c_str(), title.c_str(), xbs.n, xbs.edges->data());}
120 {result =
new TH1D(name.c_str(), title.c_str(), xbs.n, xbs.low, xbs.high);}
125 const std::string& overRideName,
126 const std::string& overRideTitle)
128 TH2D* result =
nullptr;
129 std::string name = d->histName;
130 std::string title = name;
135 if (xbs.edges && ybs.edges)
137 result =
new TH2D(name.c_str(), title.c_str(),
138 xbs.n, xbs.edges->data(),
139 ybs.n, ybs.edges->data());
143 result =
new TH2D(name.c_str(), title.c_str(),
144 xbs.n, xbs.edges->data(),
145 ybs.n, ybs.low, ybs.high);
149 result =
new TH2D(name.c_str(), title.c_str(),
150 xbs.n, xbs.low, xbs.high,
151 ybs.n, ybs.edges->data());
155 result =
new TH2D(name.c_str(), title.c_str(),
156 xbs.n, xbs.low, xbs.high,
157 ybs.n, ybs.low, ybs.high);
163 const std::string& overRideName,
164 const std::string& overRideTitle)
166 TH3D* result =
nullptr;
167 std::string name = d->histName;
168 std::string title = name;
175 if (xbs.edges || ybs.edges || zbs.edges)
177 std::vector<double> binEdgesX = xbs.edges ? *(xbs.edges) :
RBDS::LinSpace(xbs.low, xbs.high, xbs.n);
178 std::vector<double> binEdgesY = ybs.edges ? *(ybs.edges) :
RBDS::LinSpace(ybs.low, ybs.high, ybs.n);
179 std::vector<double> binEdgesZ = zbs.edges ? *(zbs.edges) :
RBDS::LinSpace(zbs.low, zbs.high, zbs.n);
180 result =
new TH3D(name.c_str(), title.c_str(),
181 xbs.n, binEdgesX.data(),
182 ybs.n, binEdgesY.data(),
183 zbs.n, binEdgesZ.data());
187 result =
new TH3D(name.c_str(), title.c_str(),
188 xbs.n, xbs.low, xbs.high,
189 ybs.n, ybs.low, ybs.high,
190 zbs.n, zbs.low, zbs.high);
198 const std::string& overRideName,
199 const std::string& overRideTitle)
203 std::string name = d->histName;
204 std::string title = name;
212 std::vector<double> binEdgesE = ebs.edges ? *(ebs.edges) :
RBDS::LinSpace(ebs.low, ebs.high, ebs.n);
214 if(d->eScale ==
"linear")
217 xbs.n, xbs.low, xbs.high,
218 ybs.n, ybs.low, ybs.high,
219 zbs.n, zbs.low, zbs.high,
220 ebs.n, ebs.low, ebs.high);
222 else if(d->eScale ==
"log")
225 xbs.n, xbs.low, xbs.high,
226 ybs.n, ybs.low, ybs.high,
227 zbs.n, zbs.low, zbs.high,
228 ebs.n, ebs.low, ebs.high);
230 else if(d->eScale ==
"user")
233 xbs.n, xbs.low, xbs.high,
234 ybs.n, ybs.low, ybs.high,
235 zbs.n, zbs.low, zbs.high);
void CheckNameAndTitle(std::string &name, std::string &title, const std::string &overRideName="", const std::string &overRideTitle="")
Whether name is set or not.