本文整理汇总了C++中TH2::FindFixBin方法的典型用法代码示例。如果您正苦于以下问题:C++ TH2::FindFixBin方法的具体用法?C++ TH2::FindFixBin怎么用?C++ TH2::FindFixBin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TH2
的用法示例。
在下文中一共展示了TH2::FindFixBin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEfficiency
double BTagEffService::GetEfficiency(BTagger const &bTagger, double pt, double eta,
unsigned flavour) const
{
// Find the appropriate efficiency histogram. Load it if needed
auto histGroupIt = effHists.find(bTagger);
TH2 *hist = nullptr;
if (histGroupIt == effHists.end())
{
// Try to load histograms for the given b-tagger
const_cast<BTagEffService *>(this)->LoadEfficiencies(bTagger);
hist = effHists.at(bTagger).at(flavour).get();
}
else
hist = histGroupIt->second.at(flavour).get();
// Make sure the histogram exists
if (not hist)
{
std::ostringstream message;
message << "BTagEffService[\"" << GetName() << "\"]::GetEfficiency: " <<
"Failed to find an efficiency histogram for b tagger " << bTagger.GetTextCode() <<
", efficiency label \"" << curEffLabel << "\", jet flavour " << flavour << ".";
throw std::runtime_error(message.str());
}
// Return the efficiency
return hist->GetBinContent(hist->FindFixBin(pt, eta));
}