本文整理汇总了C++中TObjArray::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ TObjArray::IsEmpty方法的具体用法?C++ TObjArray::IsEmpty怎么用?C++ TObjArray::IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TObjArray
的用法示例。
在下文中一共展示了TObjArray::IsEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateFillMeanRms
//________________________________________________________
void GFOverlay::CreateFillMeanRms(const TObjArray &hists, Int_t layer, const char *dirName,
std::vector<TH1*> &meanHists, std::vector<TH1*> &rmsHists) const
{
// fill mean/rms from hists into the corresponding meanHists/rmsHists
// if these are empty, create one hist for each slot of hists (even for empty ones!)
if (hists.IsEmpty()) return;
TH1 *h1 = 0;
for (Int_t iH = 0; !h1 && iH < hists.GetEntriesFast(); ++iH) {
h1 = static_cast<TH1*>(hists[iH]);
}
if (!h1 || h1->GetDimension() > 1) return; // only for 1D hists
if (meanHists.empty()) { // create mean/RMS hists if not yet done
const Float_t min = h1->GetXaxis()->GetXmin()/3.;
const Float_t max = h1->GetXaxis()->GetXmax()/3.;
const Int_t nBins = h1->GetNbinsX()/2;
for (Int_t iHist = 0; iHist < hists.GetEntriesFast(); ++iHist) {
TH1 *hMean = new TH1F(Form("mean%d_%d", layer, iHist), Form("%s: mean", dirName),
nBins, min, max);
meanHists.push_back(hMean);
TH1 *hRms = new TH1F(Form("rms%d_%d", layer, iHist), Form("%s: RMS", dirName),
nBins, 0., max);
rmsHists.push_back(hRms);
}
}
// now fill mean and rms hists
for (Int_t iHist = 0; iHist < hists.GetEntriesFast(); ++iHist) {
TH1 *h = static_cast<TH1*>(hists[iHist]);
if (!h) continue;
meanHists[iHist]->Fill(h->GetMean());
rmsHists[iHist]->Fill(h->GetRMS());
}
}