本文整理汇总了C++中TAxis::GetXbins方法的典型用法代码示例。如果您正苦于以下问题:C++ TAxis::GetXbins方法的具体用法?C++ TAxis::GetXbins怎么用?C++ TAxis::GetXbins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAxis
的用法示例。
在下文中一共展示了TAxis::GetXbins方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeDataBackgroundHistosForModel
void writeDataBackgroundHistosForModel(const std::map<TString,TGraph*>& m_bkgds,
const std::vector<TH1D *>& vchans,
TFile *allHistFile)
{
for (std::map<TString,TGraph*>::const_iterator it = m_bkgds.begin();
it != m_bkgds.end();
it++) {
const TString& name = it->first;
// determine binning from the signal histogram for this channel
// - (sigh) have to find it first...
//
TString channame = name.Copy().Remove(0,strlen("Bckgrndtot_"));
TH1D *sigh=(TH1D*)0;
for (int ichan=0; ichan<NUMCHAN; ichan++) {
sigh = vchans.at(ichan);
if (strstr(sigh->GetName(),channame.Data()))
break;
}
assert (sigh);
// for variable binning - all histos must have the same binning per channel
TAxis *xax = sigh->GetXaxis();
TVectorD xbins = TVectorD(sigh->GetNbinsX(),xax->GetXbins()->GetArray());
int lobin = xax->FindFixBin(sumwinmin);
int hibin = xax->FindFixBin(sumwinmax)-1;
int nbins = hibin-lobin+1;
TVectorD xwindow = xbins.GetSub(lobin-1,hibin);
printf("Booking TH1D(%s,%s,%d,xwindowarray)\n",
name.Data(),name.Data(),nbins);
TH1D *h = new TH1D(name.Data(),name.Data(),nbins,xwindow.GetMatrixArray());
for (int ibin=1; ibin <= nbins; ibin++)
h->SetBinContent(ibin,
it->second->Eval(h->GetBinCenter(ibin))
* h->GetBinWidth(ibin)
);
allHistFile->WriteTObject(h);
}
} // writeDataBackgroundHistosForModel