1 #ifndef __JHISTOGRAM_TOOLKIT__
2 #define __JHISTOGRAM_TOOLKIT__
63 #define make_key(PARAMETER) JKey(#PARAMETER, PARAMETER)
112 void Fill(
const Double_t xA,
const Double_t xB,
const bool option)
114 hA->Fill(logx ? log10(xA) : xA);
115 hB->Fill(logx ? log10(xB) : xB);
117 hC->Fill(logx ? log10(xB/xA) : xB - xA);
119 hD->Fill(logx ? log10(xB/xA) : xB - xA);
128 if (hA->GetEntries() != 0) { hA->Scale(1.0/hA->GetEntries()); }
129 if (hB->GetEntries() != 0) { hB->Scale(1.0/hB->GetEntries()); }
130 if (hC->GetEntries() != 0) { hC->Scale(1.0/hC->GetEntries()); }
131 if (hD->GetEntries() != 0) { hD->Scale(1.0/hD->GetEntries()); }
142 out.WriteTObject(hA);
143 out.WriteTObject(hB);
144 out.WriteTObject(hC);
145 out.WriteTObject(hD);
176 const double logx =
false)
180 TH1D* hA =
new TH1D((
"[A " + key.
name +
"]").c_str(), NULL, nx, xmin, xmax);
181 TH1D* hB =
new TH1D((
"[B " + key.
name +
"]").c_str(), NULL, nx, xmin, xmax);
182 TH1D* hC =
new TH1D((
"[C " + key.
name +
"]").c_str(), NULL, nx, -xmax, xmax);
183 TH1D* hD =
new TH1D((
"[D " + key.
name +
"]").c_str(), NULL, nx, -xmax, xmax);
198 for (
iterator i = begin(); i != end(); ++i) {
200 const int index = i->first.index;
203 i->second.Fill(fA.
getQ(), fB.
getQ(), option);
204 }
else if (fA.
hasW(index) && fB.
hasW(index)) {
205 i->second.Fill(fA.
getW(index), fB.
getW(index), option);
216 for (
iterator i = this->begin(); i != this->end(); ++i) {
229 for (
iterator i = this->begin(); i != this->end(); ++i) {
230 i->second.Write(out);
242 TFile out(file_name,
"RECREATE");